/* =====================================================================
 *  学園祭2026 特設ページ（2026/index.html）
 *  色はポスターの黒と金から。見出しは明朝（ポスターの題字に合わせる）
 * ===================================================================== */

:root {
    --ink: #1d1a16;
    --muted: #6b6358;
    --paper: #faf7f1;
    --card: #fff;
    --line: #e6dfd2;
    --gold: #b8903f;
    --gold-light: #e2c47f;
    --gold-deep: #8a6a2a;
    --night: #0f0d0b;
    --accent: #c2410c;     /* 注意書き */
    --ok: #2f6b3a;
    --radius: 14px;
    --shadow: 0 6px 24px rgb(29 26 22 / 8%);
    --nav-h: 3.25rem;
    --mincho: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
}

html {
    scroll-behavior: smooth;
    /* 目次の高さぶん、見出しが隠れないように止める */
    scroll-padding-top: calc(var(--nav-h) + .5rem);
}

body {
    margin: 0;
    background-color: var(--paper);
    color: var(--ink);
    line-height: 1.8;
    -webkit-text-size-adjust: 100%;
}

a {
    color: inherit;
}

/* ---- ポスター ---- */

.hero {
    position: relative;
    height: 100svh;
    min-height: 32rem;
    overflow: hidden;
    background-color: var(--night);
    display: grid;
    place-items: center;

    & .hero-bg {
        position: absolute;
        inset: -40px;
        background: url(../img/site/poster-sm.jpg) center / cover no-repeat;
        filter: blur(28px) brightness(.45) saturate(1.2);
    }

    & .hero-poster {
        position: relative;
        height: 100%;
        display: grid;
        place-items: center;

        & img {
            display: block;
            max-width: 100vw;
            max-height: 100svh;
            width: auto;
            height: auto;
            box-shadow: 0 0 60px rgb(0 0 0 / 60%);
        }
    }

    & .hero-scroll {
        position: absolute;
        left: 50%;
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
        transform: translateX(-50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: .25rem;
        padding: .5rem 1.25rem .6rem;
        border-radius: 2rem;
        background-color: rgb(15 13 11 / 70%);
        border: 1px solid rgb(226 196 127 / 60%);
        color: var(--gold-light);
        font-size: .85rem;
        letter-spacing: .1em;
        text-decoration: none;
        backdrop-filter: blur(4px);

        & .hero-arrow {
            width: .6rem;
            height: .6rem;
            border-right: 2px solid currentColor;
            border-bottom: 2px solid currentColor;
            transform: rotate(45deg);
            animation: hero-bounce 1.6s ease-in-out infinite;
        }
    }
}

@keyframes hero-bounce {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 4px; }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .hero .hero-scroll .hero-arrow {
        animation: none;
    }
}

/* ---- 目次 ---- */

.site-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    height: var(--nav-h);
    display: flex;
    /* safe: 万一はみ出しても左端が切れず、横スクロールで届くようにする */
    justify-content: safe center;
    padding: 0 .25rem;
    background-color: rgb(15 13 11 / 92%);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--gold-deep);
    overflow-x: auto;
    scrollbar-width: none;

    & a {
        flex: none;
        display: grid;
        place-items: center;
        /* 小さい iPhone（320px幅）でも5項目が1行に収まるよう幅に合わせて縮める */
        padding: 0 clamp(.25rem, 1.6vw, .9rem);
        color: #eee3cc;
        font-size: clamp(.72rem, 3.5vw, .9rem);
        text-decoration: none;
        white-space: nowrap;
        border-bottom: 2px solid transparent;

        &:hover,
        &.is-current {
            color: var(--gold-light);
            border-bottom-color: var(--gold-light);
        }
    }
}

/* ---- 各項目 ---- */

.section {
    width: min(100% - 2rem, 60rem);
    margin: 0 auto;
    padding: 3.5rem 0 1rem;

    & h2 {
        margin: 0 0 1.25rem;
        font-family: var(--mincho);
        font-weight: 700;
        font-size: clamp(1.6rem, 5vw, 2.2rem);
        line-height: 1.4;

        &::after {
            content: '';
            display: block;
            width: 3rem;
            height: 3px;
            margin-top: .6rem;
            background: linear-gradient(90deg, var(--gold), var(--gold-light));
            border-radius: 2px;
        }
    }

    & h3 {
        margin: 0 0 .5rem;
        font-size: 1.15rem;
        line-height: 1.5;
    }

    & .lead {
        margin: 0 0 1.5rem;
        color: var(--muted);
        text-wrap: pretty;

        & strong {
            color: var(--ink);
        }
    }
}

/* ---- じゅくちゅう（学校のマスコット） ----
   見出しの右に小さく。右へ回り込ませ（float）、見出しと説明文は横をよける。
   カード・表などの箱は下へ回す（clear）。箱の横に並ぶと幅が縮むため */

.section {
    & .mascot {
        float: right;
        width: clamp(84px, 20vw, 136px);
        height: auto;
        margin: -.5rem 0 .25rem .75rem;
        transform: rotate(4deg);
        transform-origin: bottom center;
        animation: mascot-sway 4s ease-in-out infinite;
        pointer-events: none;
    }

    & > :not(.mascot, .eyebrow, h2, .lead) {
        clear: both;
    }

    /* 絵ごとの向き・大きさの微調整 */
    & .mascot-map,
    & .mascot-bus {
        width: clamp(80px, 18vw, 120px);
    }

    & .mascot-bus {
        transform: none;
        animation-name: mascot-drive;
    }
}

@keyframes mascot-sway {
    0%, 100% { rotate: 0deg; }
    50% { rotate: -5deg; }
}

@keyframes mascot-drive {
    0%, 100% { translate: 0 0; }
    50% { translate: -4px -2px; }
}

@media (prefers-reduced-motion: reduce) {
    .section .mascot {
        animation: none;
    }
}

.eyebrow {
    margin: 0;
    color: var(--gold);
    font-size: .8rem;
    font-weight: bold;
    letter-spacing: .25em;
}

.text-link {
    color: var(--gold-deep);
    font-weight: bold;
    text-underline-offset: .2em;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: .6rem 1.4rem;
    border-radius: 2rem;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    line-height: 1.4;

    &.primary {
        background: linear-gradient(135deg, var(--gold-deep), var(--gold));
        color: #fff;
        box-shadow: 0 4px 14px rgb(138 106 42 / 35%);
    }

    &.ghost {
        border: 1px solid var(--gold);
        color: var(--gold-deep);
        background-color: var(--card);
    }
}

/* ---- 開催概要 ---- */

.date-card {
    background: radial-gradient(circle at 20% 0%, #2a241c, var(--night) 70%);
    color: #f4ead6;
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);

    & p {
        margin: 0;
    }

    & .date-main {
        font-family: var(--mincho);
        font-size: clamp(3rem, 12vw, 4.5rem);
        line-height: 1.1;
        color: var(--gold-light);

        & small {
            font-size: 40%;
            color: #eee3cc;
        }
    }

    & .date-sub {
        margin-top: .5rem;
        font-size: 1.15rem;

        & strong {
            font-size: 1.5rem;
            color: #fff;
        }
    }

    & .date-note {
        margin-top: .5rem;
        font-size: .8rem;
        color: #b9ad97;
    }
}

.live {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    background-color: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);

    & img {
        display: block;
        width: 100%;
        height: auto;
    }

    & .live-body {
        padding: 1.25rem 1.5rem 1.5rem;
    }

    & .live-cast {
        margin: 0 0 1rem;
        font-family: var(--mincho);
        font-size: 1.3rem;
        font-weight: 700;
    }
}

@media (min-width: 720px) {
    .live {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }
}

.facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .35rem 1rem;
    margin: 0;

    & dt {
        color: var(--gold-deep);
        font-weight: bold;
    }

    & dd {
        margin: 0;
    }
}

/* ---- 催し物一覧 ---- */

.filters {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-bottom: 1rem;

    & .search {
        width: 100%;
        box-sizing: border-box;
        padding: .75rem 1rem;
        border: 1px solid var(--line);
        border-radius: 2rem;
        background-color: var(--card);
        font-size: 1rem;

        &:focus {
            outline: 2px solid var(--gold-light);
            border-color: var(--gold);
        }
    }

    & .chips {
        display: flex;
        flex-wrap: wrap;
        gap: .4rem;
    }

    & .chip {
        padding: .35rem .9rem;
        border: 1px solid var(--line);
        border-radius: 2rem;
        background-color: var(--card);
        color: var(--muted);
        font-size: .9rem;
        cursor: pointer;

        &.is-on {
            background-color: var(--ink);
            border-color: var(--ink);
            color: var(--gold-light);
        }
    }
}

.event-count {
    margin: 0 0 .75rem;
    color: var(--muted);
    font-size: .85rem;
}

.event-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: .75rem;

    & .event {
        position: relative;
        display: flex;
        flex-direction: column;
        gap: .2rem;
        padding: 1rem 1.1rem 1rem 1.3rem;
        background-color: var(--card);
        border-radius: 10px;
        box-shadow: 0 2px 10px rgb(29 26 22 / 6%);
        overflow: hidden;

        /* 左の帯で種類を見分ける */
        &::before {
            content: '';
            position: absolute;
            inset: 0 auto 0 0;
            width: 5px;
            background-color: var(--kind-color, var(--gold));
        }

        &[data-kind="class"]  { --kind-color: #b8903f; }
        &[data-kind="club"]   { --kind-color: #4d8a57; }
        &[data-kind="semi"]   { --kind-color: #5b6fb0; }
        &[data-kind="parent"] { --kind-color: #d2782f; }
        &[data-kind="other"]  { --kind-color: #8c8c8c; }
    }

    & .event-head {
        display: flex;
        align-items: center;
        gap: .5rem;
        flex-wrap: wrap;
        font-size: .8rem;
        color: var(--muted);
    }

    & .event-group {
        font-weight: bold;
        color: var(--kind-color);
    }

    & .badge {
        padding: 0 .55rem;
        border-radius: 1rem;
        font-size: .72rem;
        font-weight: bold;
        line-height: 1.7;
        background-color: #f3ead7;
        color: var(--gold-deep);

        &.sells {
            background-color: var(--gold);
            color: #fff;
        }
    }

    & .event-title {
        margin: 0;
        font-size: 1.05rem;
        font-weight: bold;
        line-height: 1.5;
        text-wrap: pretty;
    }

    & .event-desc {
        margin: 0;
        color: var(--muted);
        font-size: .9rem;
        line-height: 1.6;
    }

    & .event-place {
        margin: .25rem 0 0;
        font-size: .85rem;
        font-weight: bold;

        &::before {
            content: '📍 ';
        }
    }

    & .event-empty {
        grid-column: 1 / -1;
        padding: 2rem 1rem;
        text-align: center;
        color: var(--muted);
        background-color: var(--card);
        border-radius: 10px;
    }
}

/* 企画名の横の小さな「販売」はスマホの1行表示だけ（パソコンは上の行にバッジがある） */
.event-grid .badge.mini {
    display: none;
}

/* ---- 催し物一覧：スマホは1行（企画名・販売・場所）、タップで団体名・内容を開く ----
   件数が多く、カードのままだとスマホで下までスクロールするのが大変なため（2026-09-26 依頼元） */

@media (max-width: 700px) {
    .event-grid {
        gap: .35rem;

        & .event {
            display: grid;
            grid-template-columns: minmax(0, 1fr) auto;
            grid-template-areas:
                "title place"
                "head  head"
                "desc  desc";
            align-items: center;
            column-gap: .6rem;
            padding: .6rem .8rem .6rem 1rem;
            border-radius: 8px;
            cursor: pointer;
            -webkit-tap-highlight-color: transparent;

            &::before {
                width: 4px;
            }

            &:focus-visible {
                outline: 2px solid var(--gold-light);
            }
        }

        & .event-title {
            grid-area: title;
            font-size: .95rem;
            line-height: 1.45;
        }

        & .badge.mini {
            display: inline-block;
            margin-left: .4rem;
            vertical-align: .1em;
            font-size: .66rem;
            line-height: 1.6;
        }

        & .event-place {
            grid-area: place;
            margin: 0;
            font-size: .8rem;
            color: var(--muted);
            text-align: right;
            white-space: nowrap;
            max-width: 8.5rem;
            overflow: hidden;
            text-overflow: ellipsis;

            /* 開け閉めできることを示す小さな矢印 */
            &::after {
                content: '';
                display: inline-block;
                width: .4rem;
                height: .4rem;
                margin-left: .45rem;
                border-right: 1.5px solid var(--gold);
                border-bottom: 1.5px solid var(--gold);
                transform: translateY(-.15rem) rotate(45deg);
                transition: transform .2s;
            }
        }

        /* 閉じているときは団体名・内容を出さない */
        & .event-head,
        & .event-desc {
            display: none;
        }

        & .event.is-open {
            & .event-head {
                display: flex;
                grid-area: head;
                margin-top: .4rem;
            }

            & .event-desc {
                display: block;
                grid-area: desc;
                margin-top: .2rem;
            }

            & .event-place::after {
                transform: translateY(.05rem) rotate(-135deg);
            }
        }
    }
}

/* ---- 校内マップ ---- */

.map-frame {
    display: block;
    background-color: var(--card);
    border-radius: var(--radius);
    padding: .5rem;
    box-shadow: var(--shadow);
    overflow: hidden;

    & img {
        display: block;
        width: 100%;
        height: auto;
        border-radius: 8px;
    }
}

.map-links {
    margin: 1rem 0 0;
    text-align: center;
}

/* ---- 無料シャトルバス ---- */

.bus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 1rem;
}

.bus-card {
    background-color: var(--card);
    border-radius: var(--radius);
    padding: 1.25rem 1.25rem 1rem;
    box-shadow: var(--shadow);

    & h3 {
        display: flex;
        align-items: center;
        gap: .6rem;
    }

    & .bus-dir {
        padding: .1rem .7rem;
        border-radius: 1rem;
        background-color: var(--ok);
        color: #fff;
        font-size: .8rem;

        &.back {
            background-color: var(--gold-deep);
        }
    }
}

.bus-list {
    list-style: none;
    margin: 0;
    padding: 0;

    & li {
        display: grid;
        grid-template-columns: auto auto 1fr;
        grid-template-areas:
            "no time via"
            "no time arrive";
        align-items: center;
        column-gap: .75rem;
        padding: .75rem 0;
        border-top: 1px dashed var(--line);
    }

    & .bus-no {
        grid-area: no;
        color: var(--gold);
        font-size: 1.2rem;
    }

    & .bus-time {
        grid-area: time;
        font-family: var(--mincho);
        font-size: 2rem;
        font-weight: 700;
        line-height: 1;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;

        /* 「発」は時刻のすぐ右に小さく（時刻と同じ枠に入れる。枠の外に置くと次の段に回り込む） */
        & small {
            margin-left: .15em;
            font-family: system-ui, sans-serif;
            font-size: .9rem;
            font-weight: bold;
            color: var(--muted);
        }
    }

    & .bus-via {
        grid-area: via;
        color: var(--muted);
        font-size: .85rem;
    }

    & .bus-arrive {
        grid-area: arrive;
        font-weight: bold;
        font-size: .95rem;
    }
}

.notes {
    margin: 1.25rem 0 0;
    padding-left: 1.2rem;
    font-size: .92rem;

    & .warn {
        color: var(--accent);
    }
}

/* ---- お支払い ---- */

.pay-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1rem;
}

.pay-card {
    display: flex;
    flex-direction: column;
    background-color: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--gold);

    & .pay-tag {
        margin: 0 0 .25rem;
        color: var(--gold-deep);
        font-size: .82rem;
        font-weight: bold;
    }

    & h3 {
        font-family: var(--mincho);
        font-size: 1.35rem;
    }

    & .button {
        margin-top: auto;
    }

    & .pay-note {
        margin: .75rem 0 0;
        color: var(--muted);
        font-size: .85rem;
    }
}

.steps {
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
    counter-reset: step;

    & li {
        position: relative;
        padding: .35rem 0 .35rem 2.2rem;
        counter-increment: step;

        &::before {
            content: counter(step);
            position: absolute;
            left: 0;
            top: .4rem;
            width: 1.6rem;
            height: 1.6rem;
            border-radius: 50%;
            display: grid;
            place-items: center;
            background-color: var(--ink);
            color: var(--gold-light);
            font-size: .85rem;
            font-weight: bold;
        }
    }
}

.charge-box {
    margin-top: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    background-color: #fff6d6;
    border: 1px solid #f0d98a;
    text-align: center;

    & h3 {
        margin: 0;
    }

    & p {
        margin: .25rem 0 0;
    }
}

/* 掲示チラシ（.map-frame の枠を流用。スマホでも2枚を横並びにして、タップで拡大） */
.guide {
    margin-top: 2.5rem;

    & h3 {
        font-family: var(--mincho);
        font-size: 1.35rem;
        text-align: center;
    }

    & .lead {
        text-align: center;
    }

    & .guide-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: .75rem;
        max-width: 42rem;
        margin: 0 auto;

        @media (min-width: 700px) {
            gap: 1.25rem;
        }

        & figure {
            margin: 0;
        }

        & figcaption {
            margin-top: .5rem;
            color: var(--gold-deep);
            font-weight: bold;
            text-align: center;
        }
    }
}

/* ---- フッター ---- */

.site-footer {
    margin-top: 4rem;
    padding: 2rem 1rem calc(2rem + env(safe-area-inset-bottom, 0px));
    background-color: var(--night);
    color: #b9ad97;
    text-align: center;
    font-size: .85rem;

    & p {
        margin: 0;
    }

    & .mascot-footer {
        display: block;
        width: 110px;
        height: auto;
        margin: -4.5rem auto .5rem;   /* 黒い帯の上端から顔を出す */
    }

    & .footer-msg {
        margin-bottom: 1rem;
        font-family: var(--mincho);
        font-size: 1.05rem;
        color: var(--gold-light);
    }

    & .to-top {
        display: inline-block;
        margin-top: 1rem;
        color: var(--gold-light);
    }
}
