/* ================================================
   レスポンシブデザイン - モバイル対応
   ================================================ */

/* ================================================
   大画面（1400px以上）- 3列グリッド用
   ================================================ */
@media screen and (min-width: 1400px) {
    .articles-grid-3col {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .articles-grid-2col {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ================================================
   デスクトップ大（1200px〜1399px）- 基本維持
   ================================================ */
@media screen and (max-width: 1399px) and (min-width: 1200px) {
    .articles-grid-3col {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .articles-grid-2col {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ================================================
   デスクトップ（992px〜1199px）- 3列→2列、2列維持
   ================================================ */
@media screen and (max-width: 1199px) and (min-width: 992px) {
    .articles-grid-3col {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .articles-grid-2col {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* ================================================
   タブレット・モバイル (991px以下) - 2列グリッド、サイドバー下部
   ================================================ */
@media screen and (max-width: 991px) {
    
    /* 基本設定 */
    html {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    

    
    .site-branding {
        text-align: left;
    }
    


    .site-description {
        margin-left: 0;
        text-align: left;
        margin-top: 5px;
    }
    
    /* ナビゲーション */
    .nav-menu {
        flex-direction: column;
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #333333;
        box-shadow: 0 4px 6px rgba(0,0,0,0.3);
        z-index: 1000;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        padding: 18px 20px;
        justify-content: flex-start;
        font-size: 0.9rem;
    }
    
    /* メインコンテンツ */
    .main-content {
        padding: 20px 0;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }
    
    .main-column {
        order: 1;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .sidebar {
        display: none;
    }
    
    /* レスポンシブ時の最大横幅統一 */
    .main-content-area,
    .articles-section {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0 auto;
    }
    
    /* コンテナ */
    .container {
        padding: 0 15px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    
    /* 記事グリッド - 2列表示 */
    .articles-grid-3col,
    .articles-grid-2col {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-top: 20px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    /* 記事カード（グリッド用） */
    .article-card-grid {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .article-card-grid .article-content {
        padding: 12px;
        height: 70px; /* 固定の高さを設定 */
    }
    
    .article-card-grid .article-title {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
        line-height: 1.3;
    }
    
    /* セクションヘッダー */
    .section-header {
        margin-bottom: 15px;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    /* ページネーション */
    .pagination-wrapper {
        margin-top: 30px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .pagination-numbers {
        order: 1;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    
    .pagination-link,
    .pagination-current {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-width: 40px;
    }
    
    .pagination-prev,
    .pagination-next {
        order: 2;
        padding: 10px 16px;
        font-size: 0.85rem;
        width: auto;
        margin: 0 5px;
    }
    

    
    /* Article詳細ページ */
    .article-detail {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .article-header {
        padding: 25px 15px;
    }
    
    .item-info-section, 
    .sample-gallery-section, 
    .purchase-section {
        padding: 25px 15px !important;
    }
    
    .article-share {
        padding: 15px 15px !important;
    }
    
    .related-articles {
        padding: 0 15px;
    }
    
    .article-title-main {
        font-size: 1.5rem !important;
    }
    
    .share-buttons {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    .share-button {
        justify-content: center !important;
        flex: 1 !important;
        min-width: auto !important;
    }
    
    .genre-tag {
        font-size: 0.8rem !important;
        padding: 5px 10px !important;
    }
    
    .purchase-btn {
        padding: 12px 24px !important;
        font-size: 1rem !important;
    }
    
    /* サイドバー */
    .sidebar {
        display: none;
    }
    
    /* フッター */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .footer-info {
        justify-content: center;
    }
    
    /* スクロールトップボタン */
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

/* ================================================
   モバイル (480px以下) - 2列維持
   ================================================ */
@media screen and (max-width: 480px) {
    
    /* 基本設定 */
    html {
        font-size: 14px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 12px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    
    /* ヘッダー */
    .main-header {
        padding: 0;
    }
    
    .site-branding {
        text-align: center;
    }
    
    .logo-text {
        font-family: 'Fredoka', 'Bangers', 'Comic Sans MS', cursive !important;
        font-size: 1.2rem;
        font-weight: 600;
        text-align: center;
    }
    

    
    .site-description {
        font-size: 0.8rem;
        margin-top: 5px;
    }
    
    .nav-link {
        padding: 15px;
        font-size: 0.85rem;
    }
    

    
    /* メインコンテンツ */
    .main-content {
        padding: 15px 0;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .main-column {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .articles-section {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .content-wrapper {
        gap: 15px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .section-title {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    /* 記事グリッド - 2列維持 */
    .articles-grid,
    .articles-grid-3col,
    .articles-grid-2col {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .article-card-grid {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .article-card-grid .article-content {
        padding: 10px;
        height: 65px; /* 固定の高さを設定（モバイル用） */
    }
    
    .article-card-grid .article-title {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
    }
    
    .article-card-grid .article-thumbnail {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .article-card-grid .article-thumbnail img {
        width: 100%;
        max-width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* ページネーション */
    .pagination {
        gap: 10px;
    }
    
    .pagination-link,
    .pagination-current {
        padding: 8px 10px;
        font-size: 0.8rem;
        min-width: 35px;
    }
    
    .pagination-prev,
    .pagination-next {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    /* Article詳細ページ */
    .article-detail {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    
    .article-header {
        padding: 12px;
    }
    
    .item-info-section, 
    .sample-gallery-section, 
    .purchase-section {
        padding: 20px 12px !important;
    }
    
    .article-share {
        padding: 15px 12px !important;
    }
    
    .related-articles {
        padding: 0 12px;
    }
    
    .article-title-main {
        font-size: 1.3rem !important;
    }
    
    .share-buttons {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    .share-button {
        justify-content: center !important;
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
        flex: 1 !important;
        min-width: auto !important;
    }
    
    .genre-tag {
        font-size: 0.75rem !important;
        padding: 4px 8px !important;
    }
    
    .purchase-btn {
        padding: 10px 20px !important;
        font-size: 0.9rem !important;
    }
    
    /* サイドバー */
    .sidebar {
        display: none;
    }
    
    .widget-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .widget-title i {
        margin-right: 6px;
    }
    
    /* フッター */
    .footer-main {
        padding: 30px 0;
    }
    
    .footer-content {
        gap: 25px;
    }
    
    .footer-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .footer-logo-text {
        font-size: 1.3rem;
    }
    
    .footer-description {
        font-size: 0.8rem;
        margin: 8px 0;
    }
    
    .footer-social {
        gap: 8px;
    }
    
    .footer-social-link {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .footer-bottom {
        padding: 15px 0;
    }
    
    .footer-copyright {
        font-size: 0.75rem;
    }
    
    .footer-info {
        gap: 10px;
        font-size: 0.75rem;
    }
    
    .scroll-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}