/* トップページ（app/views/performances/_landing.html.erb）。
   レイアウトの application.html.erb が、performances#index のときだけ読み込む。 */

.top-page {
    /* 季節で変える色。地の色（--top-ground）。
       季節は EventsHelper#top_page_season が月から決め、top-page--spring などのクラスで付く。
       どの季節もごく淡い色にとどめ、文字の読みやすさは変えない */
    --top-ground: #fafaf7;
    background: var(--top-ground);
    color: #1f2933;
}

.top-page--spring { --top-ground: #fcf7f6; } /* 3〜5月: 桜の淡い紅 */
.top-page--summer { --top-ground: #f5f9f9; } /* 6〜8月: 水辺の淡い青緑 */
.top-page--autumn { --top-ground: #faf6ef; } /* 9〜11月: 落ち葉の淡い黄茶 */
.top-page--winter { --top-ground: #f6f8fa; } /* 12〜2月: 冬空の淡い青灰 */

.top-page a { color: #0b5ed7; }
.top-page a:hover { color: #084298; }

.top-section-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
}

.top-section-title__count {
    font-size: 14px;
    font-weight: 400;
    color: #55606c;
}

.top-section-title--sub {
    font-size: 18px;
    margin-bottom: 16px;
}

.top-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
}

.top-badge--soon { color: #7a4b00; background: #fdebc2; }
.top-badge--lottery { color: #1d4f91; background: #dce9fb; }
.top-badge--onsale { color: #0f6b3c; background: #e3f4ea; font-size: 11px; padding: 4px 9px; }

/* ---------- イベントを探す（スライドの下の細い帯） ---------- */

.top-search {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 24px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 32px;
}

.top-search__form {
    flex: 0 1 640px; /* 入力欄が横幅いっぱいに伸びすぎないようにする */
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.top-search__label {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 700;
    color: #1f2933;
}

.top-search__input {
    flex: 1 1 200px;
    min-width: 0;
    font-size: 16px;
    padding: 10px 12px;
    border: 1px solid #8b96a3;
    border-radius: 8px;
    background: #fff;
    color: #1f2933;
}

.top-search__button {
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 700;
    padding: 11px 22px;
    border: 0;
    border-radius: 8px;
    background: #0b5ed7;
    color: #fff;
    cursor: pointer;
}

.top-search__button:hover { background: #084298; }

/* ---------- 注目のイベント（1 件ずつ大きく見せるスライド） ---------- */

.top-future {
    background: #1f2933; /* 公演の画像が映えるよう、ここだけ暗い紺色にする。中の文字は明るい色 */
    color: #fff;
    border-bottom: 0;
    padding-bottom: 28px;
}

.top-future__head {
    max-width: 1200px;
    margin: 0 auto;
    padding: 36px 24px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.top-future__position {
    font-size: 14px;
    color: #c3cad2;
}

.top-future__carousel {
    position: relative;
    max-width: 1344px;
    margin: 0 auto;
}

/* 横スクロール（スマホはスワイプ）。1 件ずつ止まる */
.top-future__track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.top-future__track::-webkit-scrollbar { display: none; }

.top-future__slide {
    flex: 0 0 100%;
    min-width: 0;
    scroll-snap-align: start;
}

.top-future__slide-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 72px 32px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 48px;
}

.top-future__image-box {
    flex: 1 1 380px;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-future__image {
    display: block;
    max-width: 100%;
    max-height: 560px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.top-future__body {
    flex: 999 1 460px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.top-future__badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.top-future__organizer {
    font-size: 13px;
    color: #c3cad2;
}

.top-future__title {
    margin: 0;
    font-size: 36px;
    font-weight: 800;
    line-height: 1.35;
}

.top-future__description {
    margin: 0;
    font-size: 16px;
    line-height: 1.95;
    color: #d5dae0;
}

.top-future__facts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    font-size: 15px;
    color: #2f3944;
}

.top-future__sale {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.top-future__sale-label {
    font-size: 13px;
    font-weight: 700;
    color: #7a4b00;
}

.top-future__sale-date {
    font-size: 22px;
    font-weight: 800;
    color: #1f2933;
}

.top-future__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.top-page a.top-future__button {
    background: #f5b800;
    color: #1f2933;
    text-decoration: none;
    padding: 17px 32px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 17px;
}

.top-page a.top-future__button:hover { background: #e0a800; color: #1f2933; }

/* 暗い帯の上の文字リンクは、明るい青にする */
.top-page a.top-future__link { color: #9cc7ff; }
.top-page a.top-future__link:hover { color: #fff; }

.top-future__link {
    font-size: 15px;
    font-weight: 700;
    padding: 14px 4px;
}

.top-future__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid #b8c0c9;
    background: #fff;
    color: #1f2933;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.top-future__arrow--prev { left: 12px; }
.top-future__arrow--next { right: 12px; }

.top-future__dots {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 4px 24px 0;
}

.top-future__dot {
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-future__dot span {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #7d8894;
    transition: width 0.2s ease, background-color 0.2s ease;
}

.top-future__dot.is-current span {
    width: 28px;
    background: #fff;
}

/* ---------- イベント一覧 ---------- */

.top-list {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 16px;
}

.top-list__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.top-list__done-link {
    font-size: 14px;
    padding: 8px 0;
}

/* PC は 1 列に 4〜6 枚。枚数（--top-list-columns）は件数から決まり（_landing.html.erb）、
   カードの幅はその枚数で横幅を等分する。タブレット幅は 3 枚、スマホは横スクロール（下のスマホの指定） */
.top-list__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

@media (min-width: 992px) {
    .top-list__grid { grid-template-columns: repeat(var(--top-list-columns, 4), minmax(0, 1fr)); }
    /* 6 枚並べるときはカードが細くなるので、間隔と文字を少し詰める */
    .top-list__grid--dense { gap: 14px; }
    .top-list__grid--dense .top-card__body { padding: 12px 12px 14px; }
    .top-list__grid--dense .top-card__title { font-size: 15px;     min-height: 2.9em; /* 2 行分（line-height 1.45） */
}
}

.top-list__empty {
    color: #55606c;
    padding: 24px 0;
    margin: 0;
}

.top-page a.top-card {
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: #1f2933;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.top-page a.top-card:hover {
    color: #1f2933;
    border-color: #b8c0c9;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

/* 画像の枠は、どのカードも同じ大きさ（縦長のチラシに合わせて 3:4）。画像が無い・横長・縦長でも枠は変わらないので、
   その下の日時・タイトルの位置がカード同士でそろう。画像は切り抜かず全体を出し、縦横比が合わない分は余白になる。
   画像を枠の中に絶対配置するのは、画像の元の大きさで枠が伸びないようにするため */
.top-card__image-box {
    position: relative;
    flex: 0 0 auto;
    aspect-ratio: 3 / 4;
    background: #eef0f2;
    overflow: hidden;
}

.top-card__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 日時とタイトルは、1 行でも 2 行でも 2 行分の高さを取る（タイトル・会場の始まる位置をそろえる）。
   販売中／発売日時の印は、いちばん下にそろえる */
.top-card__body {
    flex: 1 1 auto;
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.top-card__body > :last-child { margin-top: auto; padding-top: 4px; }

.top-card__date {
    font-size: 13px;
    font-weight: 700;
    color: #0b5ed7;
    line-height: 1.5;
    min-height: 3em; /* 2 行分 */
}

.top-card__title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.45;
}

.top-card__meta {
    font-size: 12px;
    color: #55606c;
}

.top-done {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 56px;
    scroll-margin-top: 16px;
}

/* ---------- 主催者の方へ ---------- */

.top-organizers {
    background: #fff;
    border-top: 1px solid #e3e6ea;
    border-bottom: 1px solid #e3e6ea;
}

.top-organizers__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 56px 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.top-organizers__lead {
    font-size: 13px;
    font-weight: 800;
    color: #0b5ed7;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.top-organizers__title {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.4;
}

/* 見出しの下の補足（下の 5 つは個人プランの機能で、電話受注などはビジネスプラン、という断り） */
.top-organizers__note {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.7;
    color: #55606c;
}

/* 狭い画面では縦に積み、主役の語から説明へ自然に読み進められるようにする */
.top-organizers__points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.top-organizers__point {
    min-width: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    background: var(--top-ground);
    border: 1px solid #e3e6ea;
    border-top: 4px solid #f5b800;
    border-radius: 10px;
    color: #1f2933;
    overflow-wrap: anywhere;
}

.top-organizers__point-number {
    align-self: flex-start;
    padding-bottom: 4px;
    border-bottom: 2px solid #f5b800;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

/* 主役の語は、カードの左右の真ん中に置く（その領域の中では上下も真ん中） */
.top-organizers__point-key {
    display: block;
    align-content: center;
    text-align: center;
    margin: 16px 0;
    color: #0b5ed7;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: -0.03em;
}

.top-organizers__point-key--numeric {
    font-size: 52px;
    line-height: 1.1;
}

.top-organizers__point-unit {
    margin-left: 4px;
    font-size: 28px;
}

.top-organizers__point-key--features {
    font-size: 21px;
}

.top-organizers__point-description {
    margin: 0;
    padding-top: 16px;
    border-top: 1px solid #e3e6ea;
    font-size: 14px;
    line-height: 1.8;
}

@media (min-width: 992px) {
    /* 等幅の5列にし、主役の語の領域もそろえて説明文の開始位置を合わせる */
    .top-organizers__points {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
    .top-organizers__point-key {
        min-height: 88px;
    }
}

.top-organizers__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.top-page a.top-organizers__button {
    background: #0b5ed7;
    color: #fff;
    text-decoration: none;
    padding: 15px 26px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
}

.top-page a.top-organizers__button:hover { background: #084298; color: #fff; }

.top-organizers__link {
    font-size: 15px;
    padding: 14px 8px;
    font-weight: 700;
}

/* ---------- 右下のヘルプ ---------- */

.top-page a.top-help-button {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    background: #fff;
    color: #0b5ed7;
    border: 1px solid #0b5ed7;
    text-decoration: none;
    padding: 14px 20px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.top-page a.top-help-button:hover { background: #fff; color: #084298; border-color: #084298; }

/* ---------- スマホ ---------- */

@media (max-width: 767.98px) {
    .top-search { padding: 20px 16px 0; }
    /* スマホは入力欄と「検索する」を 1 行に並べる。幅が足りないので「イベントを探す」の文字は画面から外し
       （読み上げには残る）、入力欄の中の案内（イベント・アーティスト名）に任せる */
    .top-search__form { flex-wrap: nowrap; flex-basis: 100%; }
    .top-search__form .top-search__label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .top-search__input { flex: 1 1 0; }
    .top-search__button { padding: 11px 16px; }

    .top-future__head { padding: 28px 16px 0; }
    .top-future__slide-inner { padding: 24px 16px 20px; gap: 24px; }
    .top-future__image { max-height: 360px; }
    .top-future__title { font-size: 26px; }
    /* スマホは横にスワイプして切り替えるので、矢印は出さない */
    .top-future__arrow { display: none; }

    .top-list { padding: 36px 16px 8px; }
    /* 一覧の公演がすべてスライドに出ているときは、スマホでは一覧を出さない（_landing.html.erb の list_covered） */
    .top-list--covered { display: none; }
    /* スマホの販売中一覧は、縦に積まず横スクロールで見比べる（終了イベントと同じ動き。カードはそれより大きい）。
       左右は画面の端まで流れるようにし、次のカードが少し見えて「横に続く」と分かる幅にする */
    .top-list__grid {
        display: flex;
        align-items: stretch;
        gap: 12px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 0 -16px;
        padding: 0 16px 8px;
        scroll-padding: 0 16px;
    }
    .top-list__grid::-webkit-scrollbar { display: none; }
    .top-page a.top-card {
        flex: 0 0 74%;
        max-width: 300px;
        scroll-snap-align: start;
    }
    /* 高さが未確定だと画像の内容に応じた最小サイズで枠が伸びるため、スマホだけ高さを固定する。
       画像は contain のまま枠内に収め、チラシの情報を切り抜かない。 */
    .top-card__image-box {
        height: 280px;
        max-height: 280px;
        min-height: 0;
        flex: 0 0 auto;
        aspect-ratio: auto;
    }
    .top-card__image { min-width: 0; min-height: 0; }
    .top-done { padding: 32px 16px 40px; }
    .top-organizers__inner { padding: 40px 16px; }
    .top-organizers__title { font-size: 22px; }
    /* 主ボタンを先に示し、補足のリンクは次の段で同じ幅にそろえる */
    .top-organizers__actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .top-page a.top-organizers__button {
        grid-column: 1 / -1;
        text-align: center;
    }
    .top-organizers__link {
        min-height: 44px;
        text-align: center;
        text-decoration: underline;
    }
    .top-page a.top-help-button {
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        min-height: 44px;
        padding: 10px 14px;
    }
    .top-help-button__detail { display: none; }
}

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