/* ============================================
   HOUYHNHNM-STYLE HOMEPAGE CSS
   洗練されたマガジンデザイン
   Colors: #003257 (navy), #b17931 (gold)
============================================ */

/* ============================================
   Variables & Base
============================================ */
:root {
    --primary-color: #003257;
    --accent-color: #b17931;
    --text-dark: #1a1a1a;
    --text-color: #333;
    --text-light: #666;
    --text-muted: #999;
    --border-color: #eaeaea;
    --bg-light: #f8f8f8;
    --white: #fff;
    --font-main: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", sans-serif;
    --font-en: "Helvetica Neue", "Arial", sans-serif;
}

* {
    box-sizing: border-box;
}

/* ============================================
   Container & Layout
============================================ */
.houyhnhnm-layout {
    background: var(--white);
    padding: 40px 0 0;
    overflow-x: hidden;
}

.houyhnhnm-layout .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   Brand Panel Section - メインビジュアル
   左: 大きな記事 | 右: 2記事縦並び
============================================ */
.section-brand-panel {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 0;
    padding-bottom: 64px;
}

/* 左: メイン記事 */
.top-panel {
    position: relative;
}

.top-panel .panel-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.top-panel .panel-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--bg-light);
}

.top-panel .panel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.top-panel .panel-link:hover .panel-image img {
    opacity: 0.85;
}

.top-panel .panel-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-light);
}

.top-panel .panel-text {
    padding: 16px 0 0;
}

.top-panel .type-label {
    display: inline-block;
    font-family: var(--font-en);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--white);
    background: var(--primary-color);
    padding: 4px 10px;
    margin-bottom: 12px;
}

.top-panel .panel-title {
    font-family: var(--font-main);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.6;
    color: var(--text-dark);
    margin: 0 0 8px 0;
}

.top-panel .panel-link:hover .panel-title {
    text-decoration: underline;
}

.top-panel .panel-date {
    font-family: var(--font-en);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* 右: サイドパネル（2記事縦並び） */
.side-panels-wrapper {
    display: flex;
    flex-direction: column;
}

.side-panels-slider {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

/* スライドグループ - アニメーション修正 */
.slide-group {
    display: none;
    flex-direction: column;
    gap: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.slide-group.active {
    display: flex;
    opacity: 1;
}

/* 最初のスライドグループのみ初期表示 */
.slide-group:first-child:not(.active) {
    display: none;
}

/* サイドパネル（小さい記事） */
.side-panel {
    flex: 1;
    min-height: 0;
}

.side-panel .panel-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.side-panel .panel-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--bg-light);
}

.side-panel .panel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.side-panel .panel-link:hover .panel-image img {
    opacity: 0.85;
}

.side-panel .panel-text {
    padding: 12px 0 0;
}

.side-panel .type-label {
    display: inline-block;
    font-family: var(--font-en);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--white);
    background: var(--accent-color);
    padding: 3px 8px;
    margin-bottom: 8px;
}

.side-panel .panel-title {
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text-dark);
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.side-panel .panel-link:hover .panel-title {
    text-decoration: underline;
}

.side-panel .panel-date {
    font-family: var(--font-en);
    font-size: 10px;
    color: var(--text-muted);
}

/* スライダーナビゲーション */
.slider-nav {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.slider-prev,
.slider-next {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--text-light);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-prev:hover,
.slider-next:hover {
    background: var(--text-dark);
    border-color: var(--text-dark);
    color: var(--white);
}

/* ============================================
   Main List Section - タブ切り替え
============================================ */
.section-main-list {
    margin-bottom: 0;
    background: var(--primary-color);
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding: 48px calc(50vw - 50%) 64px;
}

/* タブナビゲーション */
.tab-navigation {
    display: flex;
    justify-content: center;
    gap: 0;
    background: var(--primary-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 32px;
}

.tab-btn {
    padding: 16px 24px;
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    background: none;
    border: none;
    border-bottom: none;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color 0.3s ease;
    position: relative;
}

/* アンダーラインアニメーション */
.tab-btn::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease, left 0.3s ease;
}

.tab-btn:hover {
    color: var(--white);
}

.tab-btn.active {
    color: var(--white);
}

.tab-btn.active::before {
    width: 100%;
    left: 0;
}

/* タブコンテンツ */
.tab-contents {
    position: relative;
}

.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tab-content.active {
    display: block;
}

.tab-content.active.show {
    opacity: 1;
    transform: translateY(0);
}

/* フェードアウト中のスタイル */
.tab-content.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}

/* 記事リスト（縦並び） */
.articles-list {
    display: flex;
    flex-direction: column;
}

/* 記事アイテム */
.article-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    transition: background-color 0.3s ease;
}

.article-item:first-child {
    border-top: none;
}

.article-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.article-item .article-link {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 20px;
    padding: 24px 0;
    text-decoration: none;
    color: inherit;
}

.article-item .article-link:hover .article-title {
    text-decoration: underline;
}

.article-item .article-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--bg-light);
}

.article-item .article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.article-item .article-link:hover .article-image img {
    opacity: 0.85;
}

.article-item .article-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-light);
}

.article-item .article-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.article-item .type-label {
    display: inline-block;
    font-family: var(--font-en);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--accent-color);
    margin-bottom: 8px;
}

.article-item .article-title {
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.7;
    color: var(--white);
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-item .article-date {
    font-family: var(--font-en);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

/* 広告プレースホルダー */
.ad-placement {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 90px;
    background: var(--bg-light);
    margin: 24px 0;
}

.ad-label {
    font-family: var(--font-en);
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

/* もっと見るボタン */
.load-more-section {
    text-align: center;
    margin-top: 40px;
}

.load-more-btn {
    display: inline-block;
    padding: 14px 48px;
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 500;
    color: var(--white);
    background: linear-gradient(to right, var(--accent-color) 50%, transparent 50%);
    background-size: 200% 100%;
    background-position: right bottom;
    border: 1px solid var(--white);
    cursor: pointer;
    transition: background-position 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.load-more-btn:hover {
    background-position: left bottom;
    color: var(--white);
    border-color: var(--accent-color);
}

/* ============================================
   Category Sections - カテゴリ別
============================================ */
.category-sections {
    margin-top: 64px;
    margin-bottom: 40px;
}

.category-block {
    margin-bottom: 56px;
}

.category-block:last-child {
    margin-bottom: 0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--text-dark);
}

.category-name {
    font-family: var(--font-en);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-dark);
    margin: 0;
}

.category-more {
    font-family: var(--font-en);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.category-more:hover {
    color: var(--text-dark);
}

.category-articles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.category-article .article-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.category-article .article-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--bg-light);
    margin-bottom: 12px;
}

.category-article .article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.category-article .article-link:hover .article-image img {
    opacity: 0.85;
}

.category-article .article-link:hover .article-title {
    text-decoration: underline;
}

.category-article .article-text {
    padding: 0;
}

.category-article .article-title {
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;
    color: var(--text-dark);
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-article .article-date {
    font-family: var(--font-en);
    font-size: 10px;
    color: var(--text-muted);
}

/* ============================================
   Responsive Design
============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .houyhnhnm-layout .container {
        padding: 0 20px;
    }

    .section-brand-panel {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .top-panel .panel-title {
        font-size: 18px;
    }

    .category-articles {
        grid-template-columns: repeat(2, 1fr);
    }

    .article-item .article-link {
        grid-template-columns: 160px 1fr;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .houyhnhnm-layout {
        padding: 24px 0 60px;
    }

    .houyhnhnm-layout .container {
        padding: 0 16px;
    }

    .section-brand-panel {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-bottom: 48px;
    }

    .top-panel .panel-image {
        aspect-ratio: 16 / 10;
    }

    .top-panel .panel-title {
        font-size: 17px;
    }

    .side-panels-slider {
        flex-direction: row;
        gap: 16px;
    }

    .slide-group {
        flex-direction: row;
        gap: 16px;
    }

    .side-panel {
        flex: 1;
    }

    .side-panel .panel-image {
        aspect-ratio: 4 / 3;
    }

    .slider-nav {
        display: none;
    }

    .tab-navigation {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tab-navigation::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        padding: 14px 20px;
        font-size: 12px;
        white-space: nowrap;
    }

    .article-item .article-link {
        grid-template-columns: 110px 1fr;
        gap: 14px;
        padding: 20px 0;
    }

    .article-item .article-title {
        font-size: 14px;
        -webkit-line-clamp: 3;
    }

    .category-articles {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .category-article .article-title {
        font-size: 12px;
    }

    .load-more-btn {
        width: 100%;
        padding: 14px 24px;
    }

    .section-main-list,
    .category-block {
        margin-bottom: 48px;
    }
}

/* Mobile Small */
@media (max-width: 480px) {
    .side-panels-wrapper {
        display: none;
    }

    .top-panel .panel-title {
        font-size: 16px;
    }

    .article-item .article-link {
        grid-template-columns: 100px 1fr;
        gap: 12px;
    }

    .article-item .article-title {
        font-size: 13px;
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .category-articles {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
}

/* ============================================
   Loading States
============================================ */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
