/* Ticketta! 公演の紹介ページ（案A「静かな受付」）。buyer.css と concert-list.css の値を使う。 */
/* Standalone stylesheet; deliberately valid CSS as well as SCSS. */
/* 空席状況と申込ボタンは concert-list.css の tk-concert-avail* と tk-concert-btn の見た目をそのまま使う。 */

.container.tk-cp-page {
    box-sizing: border-box;
    width: 100%;
    max-width: calc(var(--container-max) + 2 * var(--space-16));
    min-width: 0;
    padding: var(--space-32) var(--space-16) var(--space-48);
    text-align: left;
}

/* 戻るリンク: 左に矢印 */
.tk-cp-back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    min-height: 36px;
    color: var(--action);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: none;
}

.tk-cp-back:hover {
    color: var(--action-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.tk-cp-back:focus-visible {
    outline: 3px solid var(--action);
    outline-offset: 2px;
}

/* 未公開の表示（団体の管理者と運営だけに出す） */
.tk-cp-preview {
    margin: 0 0 var(--space-16);
    padding: var(--space-8) var(--space-16);
    border-radius: var(--radius-sm);
    background: var(--warning-bg);
    color: var(--warning-ink);
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* バナー: concert-list の3層（ぼかし・ベール・本体）を切らずに出す */
.tk-cp-banner {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    max-height: var(--banner-max-height);
    margin: var(--space-16) 0 0;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--banner-letterbox);
}

/* カルーセル（画像が2枚以上）: 外側の枠・余白・角丸は .tk-cp-banner と同じ。中のスライドは外側で切る */
.tk-cp-carousel {
    position: relative;
    box-sizing: border-box;
    margin: var(--space-16) 0 0;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--banner-letterbox);
}

.tk-cp-carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.tk-cp-carousel-track::-webkit-scrollbar {
    display: none;
}

.tk-cp-carousel-track:focus-visible {
    outline: 3px solid var(--action);
    outline-offset: -3px;
}

@media (prefers-reduced-motion: no-preference) {
    .tk-cp-carousel-track {
        scroll-behavior: smooth;
    }
}

/* 各スライドは .tk-cp-banner と同じ中身の並べ方（高さ・ぼかし背景・覆い・本体の収め方）。枠と角丸は外側が持つ */
.tk-cp-carousel-slide {
    flex: 0 0 100%;
    min-width: 0;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    max-height: var(--banner-max-height);
    overflow: hidden;
    background: var(--banner-letterbox);
}

.tk-cp-carousel-prev,
.tk-cp-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
}

.tk-cp-carousel-prev {
    left: 8px;
}

.tk-cp-carousel-next {
    right: 8px;
}

.tk-cp-carousel-prev:disabled,
.tk-cp-carousel-next:disabled {
    opacity: 0.3;
    cursor: default;
}

.tk-cp-carousel-prev:focus-visible,
.tk-cp-carousel-next:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.tk-cp-carousel-prev > svg,
.tk-cp-carousel-next > svg {
    display: block;
}

.tk-cp-carousel-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    display: flex;
    justify-content: center;
    gap: 4px;
}

.tk-cp-carousel-dot {
    position: relative;
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.tk-cp-carousel-dot::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
}

.tk-cp-carousel-dot[aria-current="true"]::before {
    background: #fff;
}

.tk-cp-carousel-dot:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* 2段組: 本文（main）と右の情報パネル（side） */
.tk-cp-layout {
    display: flex;
    align-items: flex-start;
    gap: var(--space-32);
    margin-top: var(--space-32);
}

.tk-cp-main {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: var(--space-32);
    min-width: 0;
}

.tk-cp-head {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
}

.tk-cp-group {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.tk-cp-title {
    margin: 0;
    color: var(--text);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.tk-cp-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    min-width: 0;
}

.tk-cp-h2 {
    margin: 0;
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.tk-cp-h3 {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
}

.tk-cp-intro {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.tk-cp-site {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    min-height: var(--control-height);
    color: var(--action);
    font-size: 14px;
    line-height: 1.6;
    text-underline-offset: 3px;
}

.tk-cp-site:hover {
    color: var(--action-hover);
}

.tk-cp-site:focus-visible,
.tk-cp-others-all:focus-visible {
    outline: 3px solid var(--action);
    outline-offset: 2px;
}

/* 出演者: PC は2列のカード、スマホは1列 */
.tk-cp-performers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-12);
    margin: 0;
    padding: 0;
    list-style: none;
}

.tk-cp-performers > li {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
    box-sizing: border-box;
    padding: var(--space-16);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
}

.tk-cp-role {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.tk-cp-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.tk-cp-profile {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

/* 出演者の本文（役割・名前・プロフィール）。写真の無い行は、これまで li が縦に積んでいた見た目を保つ */
.tk-cp-performer-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
}

/* 写真のある行: 写真を左に、本文を右に置く */
.tk-cp-performers > li.has-photo {
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-12);
}

.tk-cp-performer-img {
    flex: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-tint);
}

/* 曲目: 1枚のパネルの中に行を線で区切る */
.tk-cp-programs {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: var(--space-4) var(--space-16);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    list-style: none;
}

.tk-cp-programs > li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-16);
    min-width: 0;
    padding: var(--space-12) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.tk-cp-programs > li:last-child {
    border-bottom: 0;
}

.tk-cp-composer {
    flex: 0 0 160px;
    width: 160px;
    padding-top: 2px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.tk-cp-piece {
    flex: 1 1 0;
    min-width: 0;
    font-size: 16px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* 右の情報パネル（日時・会場・空席・申込）。PC は追従する */
.tk-cp-side {
    display: flex;
    flex: 0 0 352px;
    flex-direction: column;
    gap: var(--space-16);
    box-sizing: border-box;
    width: 352px;
    position: sticky;
    top: var(--space-16);
    padding: 20px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
}

.tk-cp-facts {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    margin: 0;
}

.tk-cp-facts > div {
    display: flex;
    align-items: flex-start;
    gap: var(--space-12);
    min-width: 0;
}

.tk-cp-facts dt {
    flex: 0 0 48px;
    width: 48px;
    margin: 0;
    padding-top: 2px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.tk-cp-facts dd {
    min-width: 0;
    margin: 0;
    color: var(--text);
    font-size: 16px;
    line-height: 1.6;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.tk-cp-avail {
    padding-top: var(--space-16);
}

.tk-cp-actions {
    margin-top: 0;
}

.tk-cp-actions .tk-concert-btn {
    width: 100%;
    min-height: 52px;
    font-size: 16px;
}

/* 発売前の印: 申込ボタンと同じ幅と高さに収める（concert-list の .tk-concert-soon より後に読んで上書きする） */
.tk-concert-soon.tk-cp-soon {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    min-height: 52px;
    padding: 8px var(--space-16);
    font-size: 16px;
}

.tk-cp-note {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
}

/* 申込バー: スマホだけ画面下に固定。PC は通常の流れのまま */
.tk-cp-buy:empty {
    display: none;
}

/* ほかの公演 */
.tk-cp-others {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: var(--space-24);
    min-width: 0;
    margin-top: var(--space-32);
    padding-top: var(--space-32);
    border-top: 1px solid var(--border-subtle);
}

.tk-cp-others-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-8) var(--space-16);
}

.tk-cp-others-all {
    display: inline-flex;
    align-items: center;
    min-height: var(--control-height);
    color: var(--action);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
}

.tk-cp-others .tk-cp-h3 {
    margin-top: var(--space-8);
}

.tk-cp-other-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-16);
    margin: 0;
    padding: 0;
    list-style: none;
}

.tk-cp-other-list > li {
    min-width: 0;
    margin: 0;
    padding: 0;
}

.tk-cp-other {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px 0;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0 0 var(--space-16);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
}

.tk-cp-other:hover {
    border-color: var(--action);
    color: var(--text);
    text-decoration: none;
}

.tk-cp-other:focus-visible {
    outline: 3px solid var(--action);
    outline-offset: 2px;
}

.tk-cp-other-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    overflow: hidden;
    background: var(--banner-letterbox);
}

.tk-cp-other-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tk-cp-other-date,
.tk-cp-other-name,
.tk-cp-other-sub {
    display: block;
    min-width: 0;
    padding: 0 var(--space-16);
    overflow-wrap: anywhere;
}

.tk-cp-other-date {
    margin-top: var(--space-8);
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    font-variant-numeric: tabular-nums;
}

.tk-cp-other-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
}

.tk-cp-other-sub {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

/* スマホ: 1段に積み、申込バーを画面下に固定する */
@media (max-width: 767.98px) {
    .container.tk-cp-page {
        padding: var(--space-16) var(--space-16) calc(96px + env(safe-area-inset-bottom, 0px));
    }

    .tk-cp-back {
        min-height: var(--control-height);
    }

    .tk-cp-banner,
    .tk-cp-carousel {
        margin-right: calc(-1 * var(--space-16));
        margin-left: calc(-1 * var(--space-16));
        border-width: 1px 0;
        border-radius: 0;
    }

    .tk-cp-layout {
        flex-direction: column;
        gap: 28px;
        margin-top: 28px;
    }

    .tk-cp-side {
        order: -1;
        flex: none;
        width: 100%;
        position: static;
        padding: var(--space-16);
    }

    .tk-cp-main {
        gap: 28px;
    }

    .tk-cp-title {
        font-size: 24px;
    }

    .tk-cp-performers {
        grid-template-columns: minmax(0, 1fr);
    }

    .tk-cp-programs > li {
        flex-direction: column;
        gap: var(--space-4);
    }

    .tk-cp-composer {
        flex: none;
        width: auto;
        padding-top: 0;
        font-size: 12px;
    }

    .tk-cp-buy {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 100;
        box-sizing: border-box;
        padding: 12px var(--space-16) calc(12px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid var(--border-subtle);
        background: var(--surface);
    }

    .tk-cp-buy .tk-cp-actions {
        margin: 0;
    }

    .tk-cp-others {
        margin-top: 28px;
        padding-top: 28px;
    }

    .tk-cp-others-head {
        align-items: flex-start;
        flex-direction: column;
        gap: var(--space-4);
    }

    .tk-cp-other-list {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-12);
    }

    .tk-cp-other {
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 4px var(--space-12);
        padding: var(--space-12);
    }

    .tk-cp-other-thumb {
        grid-row: 1 / span 3;
        height: auto;
        aspect-ratio: 4 / 3;
        border-radius: var(--radius-sm);
    }

    .tk-cp-other-date,
    .tk-cp-other-name,
    .tk-cp-other-sub {
        padding: 0;
    }

    .tk-cp-other-date {
        margin-top: 0;
        font-size: 12px;
    }

    .tk-cp-other-sub {
        font-size: 12px;
    }
}

/* 写真: PC は3列、スマホは2列 */
.tk-cp-photos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tk-cp-photos > li {
    min-width: 0;
    margin: 0;
    padding: 0;
}

.tk-cp-photo {
    display: block;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius-md);
    background: none;
    overflow: hidden;
    cursor: zoom-in;
}

.tk-cp-photo:focus-visible {
    outline: 3px solid var(--action);
    outline-offset: 2px;
}

.tk-cp-photo img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--surface-tint);
}

/* 拡大表示: 背景は暗く、画像は画面に収める */
.tk-cp-photo-dialog {
    max-width: min(96vw, 1200px);
    max-height: 96vh;
    padding: 0;
    border: 0;
    background: transparent;
}

/* 共通の CSS が dialog を display: block にしているので、閉じている間は消す */
.tk-cp-photo-dialog:not([open]) {
    display: none;
}

.tk-cp-photo-dialog::backdrop {
    background: rgba(0, 0, 0, 0.8);
}

.tk-cp-photo-dialog img {
    display: block;
    max-width: 100%;
    max-height: 84vh;
    width: auto;
    height: auto;
    margin: 0 auto;
    border-radius: 8px;
}

.tk-cp-photo-close {
    display: block;
    height: 44px;
    margin: 12px auto 0;
    padding: 0 24px;
    border: 1px solid var(--border-control);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.tk-cp-photo-close:focus-visible {
    outline: 3px solid var(--action);
    outline-offset: 2px;
}

/* お知らせ: 出演者・曲目と同じパネルの中に行を線で区切る */
.tk-cp-notices {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    list-style: none;
}

.tk-cp-notice {
    min-width: 0;
    margin: 0;
    padding: 12px 16px;
}

.tk-cp-notice + .tk-cp-notice {
    border-top: 1px solid var(--border-subtle);
}

.tk-cp-notice-date {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
    font-variant-numeric: tabular-nums;
}

.tk-cp-notice-body {
    margin: 4px 0 0;
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
    .tk-cp-photos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
}

/* 上部の画像（バナー・メイン画像）に重ねる拡大ボタン。操作部品（前後・ドット）はその上 */
.tk-cp-slide-zoom {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.tk-cp-slide-zoom:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -3px;
}

.tk-cp-banner {
    position: relative;
}

.tk-cp-carousel-prev,
.tk-cp-carousel-next,
.tk-cp-carousel-dots {
    z-index: 2;
}
