/* ========================================
   Layout: header / footer / tab / year-nav
======================================== */

/* ---- Header ---- */
.l-header {
    position: relative;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 40px;
    background: #dc236e;
}

.l-header__logo-nadeshiko {
    display: block;
    width: 180px;
}

.l-header__logo-nadeshiko img {
    width: 100%;
    height: auto;
}

.l-header__logo-jfa {
    display: block;
    width: 72px;
}

.l-header__logo-jfa img {
    width: 100%;
    height: auto;
}

@media (max-width: 640px) {
    .l-header {
        height: 56px;
        padding: 0 16px;
    }

    .l-header__logo-nadeshiko {
        width: 130px;
    }

    .l-header__logo-jfa {
        width: 48px;
    }
}

/* ---- Footer ---- */
.l-footer {
    background: var(--color-black);
}

.l-footer__pagetop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 10px 0;
    background: var(--grad-primary);
    color: var(--color-white);
    font-family: var(--font-en-sub);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.08em;
    cursor: pointer;
    border: none;
}

.l-footer__pagetop-icon {
    width: 16px;
    height: 16px;
    border-left: 2px solid #fff;
    border-top: 2px solid #fff;
    transform: rotate(45deg);
    margin-bottom: -2px;
}

.l-footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 40px 16px 32px;
    background: var(--color-navy-deep);
}

.l-footer__logo {
    width: 92px;
    height: auto;
}

.l-footer__copy {
    font-family: var(--font-en-sub);
    font-size: 11px;
    color: var(--color-white);
    letter-spacing: 0.02em;
}

/* ---- Tabs (WORLD CUP / OLYMPIC) ---- */
.l-tab {
    position: relative;
    z-index: 60;
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: none;
    margin: -54px 0 0;
    padding: 0 20px 24px;
    background: #F0EDE8;
    box-sizing: border-box;
    overflow: visible;
}

.l-tab__btn {
    flex: 1 1 0;
    width: 100%;
    max-width: 570px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100px;
    font-family: var(--font-en-sub);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.08em;
    color: var(--color-primary);
    background: #EAD6F0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: background-color 0.2s ease-out, color 0.2s ease-out;
}

.l-tab__btn:first-child {
    border-radius: 16px 0 0 16px;
}

.l-tab__btn:last-child {
    border-radius: 0 16px 16px 0;
}

.l-tab__btn:hover:not(.is-active) {
    background: color-mix(in srgb, var(--color-primary) 70%, transparent);
    color: var(--color-white);
}

.l-tab__btn.is-active {
    color: var(--color-white);
    background: var(--color-primary);
}

.l-tab__btn.is-active::after {
    content: "";
    display: block;
    width: 120px;
    height: 3px;
    background: var(--color-white);
}

@media (max-width: 640px) {
    .l-tab {
        margin-top: -36px;
        padding: 0 12px 20px;
    }

    .l-tab__btn {
        height: 64px;
        font-size: 14px;
        letter-spacing: 0.04em;
    }

    .l-tab__btn.is-active::after {
        width: 72px;
        height: 2px;
    }
}

/* ---- Year nav pills ---- */
.l-yearnav-area {
    position: relative;
    z-index: 50;
    background: #F0EDE8;
    /* sticky固定時は JS で padding-top にナビ高さ分のプレースホルダを入れる */
    box-sizing: border-box;
}

.l-yearnav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 16px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
}

/* 背景との境：メイン横グラデ（全幅） */
.l-yearnav-line {
    display: block;
    width: 100vw;
    height: 24px;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background: var(--grad-primary);
    pointer-events: none;
}

/* スクロール追従（samuraiblue/worldcup_history の .nav 相当） */
.l-yearnav.is-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    max-width: none;
    width: 100%;
    margin: 0;
    background: #F0EDE8;
    box-shadow: 0 2px 10px rgba(0, 30, 85, 0.12);
    padding-top: 16px;
    padding-bottom: 16px;
}

.l-yearnav__item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 100px;
    min-height: 40px;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    color: #F0EDE8;
    font-family: var(--font-en-sub);
    font-weight: 700;
    font-size: 16px;
    line-height: 16px;
    letter-spacing: 0;
    text-decoration: none;
    background: var(--color-navy);
    box-shadow: 2px 3px 0 0 var(--color-primary);
    transition: background-color 0.2s ease-out, box-shadow 0.2s ease-out;
}

/* 年代下の下向き矢印 */
.l-yearnav__item::after {
    content: "";
    display: block;
    width: 8px;
    height: 8px;
    margin: 0;
    box-sizing: border-box;
    border: none;
    border-right: 2px solid #F0EDE8;
    border-bottom: 2px solid #F0EDE8;
    transform: rotate(45deg);
    background: none;
    position: relative;
    top: 0;
    transition: top 0.2s ease-out;
}

.l-yearnav__item:hover,
.l-yearnav__item:focus,
.l-yearnav__item.is-current {
    background: var(--color-primary);
    border-color: transparent;
    color: #F0EDE8;
    text-decoration: none;
    box-shadow: 2px 3px 0 0 var(--color-navy);
}

.l-yearnav__item:hover::after,
.l-yearnav__item:focus::after {
    top: 2px;
}

.l-yearnav__item.is-coming-soon {
    pointer-events: none;
    cursor: default;
    background: #8a8a8a;
    box-shadow: 2px 3px 0 0 rgba(0, 30, 85, 0.6);
    color: #fff;
}

/* Olympic year nav: same base + hover swap */
.l-panel--olympic .l-yearnav__item,
.page-detail.is-olympic .l-yearnav__item {
    border: none;
    color: #F0EDE8;
    background: var(--color-navy);
    box-shadow: 2px 3px 0 0 var(--color-primary);
}

.l-panel--olympic .l-yearnav__item::after,
.page-detail.is-olympic .l-yearnav__item::after {
    border: none;
    border-right: 2px solid #F0EDE8;
    border-bottom: 2px solid #F0EDE8;
    background: none;
}

.l-panel--olympic .l-yearnav__item:hover,
.l-panel--olympic .l-yearnav__item.is-current,
.page-detail.is-olympic .l-yearnav__item:hover,
.page-detail.is-olympic .l-yearnav__item.is-current {
    background: var(--color-primary);
    border-color: transparent;
    color: #F0EDE8;
    text-decoration: none;
    box-shadow: 2px 3px 0 0 var(--color-navy);
}

.page-detail.is-olympic .l-yearnav__item.is-coming-soon {
    pointer-events: none;
    cursor: default;
    background: #8a8a8a;
    box-shadow: 2px 3px 0 0 rgba(0, 30, 85, 0.6);
    color: #fff;
}

@media (max-width: 640px) {
    .l-yearnav {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 24px 16px;
    }

    .l-yearnav-line {
        height: 16px;
    }

    .l-yearnav__item {
        min-width: 0;
        width: 100%;
        min-height: 40px;
        height: auto;
        font-size: 14px;
        line-height: 16px;
        padding: 8px 12px;
    }

    /* スクロール追従（fixed）時のみ：SP仕様 */
    .l-yearnav.is-fixed {
        padding: 8px 16px;
        gap: 4px;
    }

    .l-yearnav.is-fixed .l-yearnav__item {
        min-height: 24px;
        font-size: 12px;
        padding: 4px;
        box-shadow: 1px 2px 0 0 var(--color-primary);
    }

    .l-yearnav.is-fixed .l-yearnav__item::after {
        display: none;
    }
}
