/* ============================================
   layout.css — グリッド、フレックス、スペーシング
   ============================================ */

/* --- サイトヘッダー --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: none;
}

/* ヘッダー下部のグラデーションシマーライン */
.site-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FF6B9D, #C084FC, #FF6B9D, transparent);
    opacity: 0.5;
}

/* --- ヘッダーナビ（クイックリンクバー）— モバイルは非表示、PCのみ --- */
.header-nav {
    display: none;
}

@media (min-width: 769px) {
    .header-nav {
        display: block;
        position: sticky;
        top: var(--header-height);
        z-index: 99;
        background: rgba(255, 255, 255, 0.90);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--color-border);
        overflow: visible;
    }
}

/* ナビ下部のグラデーションシマーライン */
.header-nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #FF6B9D, #C084FC, #FF6B9D, transparent);
    opacity: 0.3;
}

.header-nav__inner {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    height: var(--header-nav-height);
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    white-space: nowrap;
}

.header-nav__inner::-webkit-scrollbar {
    display: none;
}

.header-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-sub);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: transparent;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.header-nav__link:hover {
    background: var(--color-primary-pale);
    color: var(--color-primary);
}

.header-nav__icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.header-nav__icon svg {
    width: 14px;
    height: 14px;
}

/* アクティブ状態 */
.home .header-nav__link--home,
.post-type-archive-show .header-nav__link--show,
.single-show .header-nav__link--show,
.post-type-archive-cast .header-nav__link--cast,
.single-cast .header-nav__link--cast,
.category-column .header-nav__link--column,
.category-news .header-nav__link--news,
.page-template-page-shindan .header-nav__link--shindan {
    background: var(--color-gradient);
    color: #fff;
    box-shadow: 0 2px 8px rgba(232, 97, 154, 0.25);
}

.home .header-nav__link--home svg,
.post-type-archive-show .header-nav__link--show svg,
.single-show .header-nav__link--show svg,
.post-type-archive-cast .header-nav__link--cast svg,
.single-cast .header-nav__link--cast svg,
.category-column .header-nav__link--column svg,
.category-news .header-nav__link--news svg,
.page-template-page-shindan .header-nav__link--shindan svg {
    color: #fff;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 var(--space-md);
    max-width: var(--content-max-width);
    margin: 0 auto;
}

/* --- ロゴ --- */
.site-logo {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-weight: 700;
    font-size: 1.125rem;
}

.site-logo__icon {
    font-size: 1.5rem;
}

.site-logo__text {
    background: var(--color-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- ハンバーガー --- */
.hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
    color: var(--color-text);
}

.hamburger:hover {
    background-color: var(--color-primary-pale);
}

.hamburger__icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger__icon svg {
    width: 24px;
    height: 24px;
}

/* --- グローバルナビ --- */
.global-nav {
    display: none;
    background: var(--color-card);
    border-top: 1px solid var(--color-border);
    padding: var(--space-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.global-nav.is-open {
    display: block;
    animation: navSlideDown 0.25s ease;
}

@keyframes navSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.global-nav__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.global-nav__list li a {
    display: block;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.global-nav__list li a:hover {
    background-color: var(--color-primary-pale);
    color: var(--color-primary);
}

/* --- メインコンテンツ --- */
.site-main {
    max-width: var(--content-max-width);
    margin: 0 auto;
    min-height: 100vh;
}

/* --- セクション --- */
.section {
    padding: var(--space-xl) 0;
}

.section + .section {
    padding-top: var(--space-md);
}

/* --- セクションヘッダー --- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-md);
    margin-bottom: var(--space-md);
}

.section-header h2 {
    font-size: 1.125rem;
    position: relative;
    padding-left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.section-header h2 svg {
    flex-shrink: 0;
    vertical-align: middle;
}

.section-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    border-radius: 2px;
    background: var(--color-gradient);
}

.section-header__more {
    font-size: 0.8125rem;
    color: var(--color-primary);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.25s ease, color 0.2s ease;
}

.section-header__more:hover {
    color: var(--color-accent);
    gap: 8px;
}

/* --- 横スクロールコンテナ --- */
.scroll-x {
    display: flex;
    overflow-x: auto;
    gap: var(--space-md);
    padding: 0 var(--space-md) var(--space-sm);
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.scroll-x::-webkit-scrollbar {
    display: none;
}

.scroll-x > * {
    flex-shrink: 0;
    scroll-snap-align: start;
}

/* --- 2カラムグリッド --- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    padding: 0 var(--space-md);
}

/* --- 3カラムグリッド --- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    padding: 0 var(--space-md);
}

/* --- フッター --- */
.site-footer {
    background: #2D1B33;
    color: #fff;
    padding: var(--space-2xl) var(--space-md);
    text-align: center;
}

.site-footer__inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.site-footer__logo {
    margin-bottom: var(--space-lg);
    font-size: 1.125rem;
    font-weight: 700;
}

.site-footer__logo .site-logo__text {
    -webkit-text-fill-color: #fff;
    background: none;
}

.footer-nav__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.footer-nav__list a {
    font-size: 0.875rem;
    opacity: 0.8;
    transition: opacity 0.2s ease, color 0.2s ease;
    color: #fff;
}

.footer-nav__list a:hover {
    opacity: 1;
    color: var(--color-accent);
}

.site-footer__links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-lg);
}

.site-footer__links a {
    font-size: 0.75rem;
    opacity: 0.6;
    white-space: nowrap;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.site-footer__links a:hover {
    opacity: 1;
    color: var(--color-accent);
}

.site-footer__copy {
    font-size: 0.6875rem;
    opacity: 0.5;
    margin: 0;
}

/* --- モバイルボトムナビ --- */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--bottom-nav-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-top: 1px solid rgba(232, 97, 154, 0.15);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    transform: translateZ(0);
    will-change: transform;
}

.mobile-bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.625rem;
    color: var(--color-text-sub);
    transition: color 0.25s ease;
    padding: var(--space-xs);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.mobile-bottom-nav__item.is-active {
    background: var(--color-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mobile-bottom-nav__icon {
    font-size: 1.25rem;
}

.mobile-bottom-nav__item.is-active .mobile-bottom-nav__icon {
    background: var(--color-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mobile-bottom-nav__label {
    font-weight: 500;
}

@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none;
    }

    .hamburger {
        display: none;
    }

    /* PC: ヘッダーナビ */
    .header-nav__inner {
        justify-content: center;
        gap: var(--space-md);
        overflow-x: visible;
    }

    .header-nav__link {
        font-size: 0.8rem;
        padding: 5px 14px;
        gap: 4px;
    }

    .global-nav {
        display: block;
        background: none;
        border: none;
        padding: 0;
    }

    .global-nav__list {
        flex-direction: row;
        gap: var(--space-lg);
    }

    .site-header__inner {
        gap: var(--space-xl);
    }

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

    .grid-3 {
        grid-template-columns: repeat(4, 1fr);
    }

    /* PC: カード幅調整 */
    .show-card {
        min-width: 160px;
    }

    .cast-card {
        min-width: 140px;
    }

    .schedule-card {
        flex: 1 0 0;
        min-width: 0;
    }

    .section--schedule .scroll-x {
        overflow-x: visible;
    }

    /* PC: コラムスライダー */
    .column-slide {
        min-width: 45%;
    }
    .column-slide--featured {
        min-width: 50%;
    }

    /* PC: 投票カード */
    .poll-card {
        max-width: 560px;
        margin-left: auto;
        margin-right: auto;
    }

    /* PC: ニュースカードグリッド化 */
    .news-card__thumb {
        width: 100px;
        height: 100px;
    }

    /* PC: 番組詳細ヘッダー */
    .show-detail-header {
        max-width: 600px;
        margin: 0 auto;
    }

    /* PC: 出演者プロフィールヘッダー */
    .cast-profile-header {
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        max-width: 600px;
        margin: 0 auto;
    }
}

/* --- モバイルドロワーメニュー --- */
.mobile-drawer__overlay {
    position: fixed;
    inset: 0;
    background: rgba(45, 27, 51, 0.4);
    z-index: 10000;
}
.mobile-drawer__panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    background: var(--color-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 70vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
    animation: drawerSlideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes drawerSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.mobile-drawer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    font-weight: 700;
    font-size: 1rem;
    border-bottom: 1px solid var(--color-border);
}
.mobile-drawer__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-sub);
    padding: var(--space-xs);
    transition: color 0.2s ease;
}
.mobile-drawer__close:hover {
    color: var(--color-primary);
}
.mobile-drawer__nav {
    display: flex;
    flex-direction: column;
    padding: var(--space-sm) 0;
}
.mobile-drawer__nav a {
    display: block;
    padding: var(--space-md) var(--space-lg);
    font-size: 0.9375rem;
    color: var(--color-text);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    border-left: 3px solid transparent;
}
.mobile-drawer__nav a:hover,
.mobile-drawer__nav a.is-active {
    background: var(--color-primary-pale);
    color: var(--color-primary);
    border-left-color: var(--color-primary);
}
