/* サカイタイムズ インタビュー特設ページ
   フォント・文字色はテーマのもの（Noto Sans JP、--text、--orange）をそのまま使う。 */

.sthi-page { overflow: hidden; }

/* スマホ：このページだけ、ヘッダーの「検索結果1位」の画像を外して上を詰める（そのぶん鍵穴の下まで見せる） */
@media (max-width: 900px) {
    body.category .site-header .search-rank { display: none !important; }
    body.category .site-header .header-inner { min-height: 0 !important; padding-top: 10px !important; padding-bottom: 10px !important; }
}

/* 開いた時点（スクロール前）に、ヘッダーの下へ鍵穴の風景全体と「最新インタビュー」の見出しが収まるよう、
   回転エリアの高さを画面の高さから決める。
   --sthi-top   ：ページ上端から回転エリアまでの距離（ヘッダーの高さ。JavaScript が実測して上書きする）
   --sthi-below ：回転エリアの下に見せておく高さ（「最新インタビュー」の見出しぶん） */
.sthi-hero {
    --sthi-top: 90px;
    --sthi-below: 44px;
    --sthi-vh: 100vh;
    --sthi-stage-h: clamp(350px, calc(var(--sthi-vh) - var(--sthi-top) - var(--sthi-below)), 540px);
    --sthi-kt: 0px;                                      /* 鍵穴の画像の上端の位置 */
    --sthi-kh: calc(var(--sthi-stage-h) * .60);          /* 鍵穴の画像の高さ */
    --sthi-cw: clamp(140px, calc(var(--sthi-stage-h) * .38), 176px);   /* カードの幅 */
    position: relative;
    isolation: isolate;
    color: var(--text, #1d262a);
    background-color: #9a6c41;
    background-image: var(--sthi-stage), var(--sthi-wood);
    background-repeat: no-repeat, repeat-x;
    /* 鍵穴の画像は元画像の下端までそのまま使う（板の継ぎ目を上から下までつなげる。上下はぼかさない）。
       倍率と位置は、鍵穴を決まった大きさ・位置に出すための値 */
    background-position: center calc(var(--sthi-kt) - var(--sthi-kh) * .05), center top;
    background-size: auto calc(var(--sthi-kh) * 1.8654), calc(var(--sthi-kh) * 0.7706) 100%;
}

@supports (height: 100svh) {
    .sthi-hero { --sthi-vh: 100svh; }
}

.sthi-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sthi-crumb {
    position: absolute;
    left: 12px;
    top: 8px;
    z-index: 350;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    color: #fff;
    text-shadow: 0 1px 3px rgba(40, 20, 0, .85);
}

.sthi-crumb a { color: #fff; text-decoration: none; }
.sthi-crumb a:hover,
.sthi-crumb a:focus-visible { text-decoration: underline; }

.sthi-dummy-note {
    position: absolute;
    right: 10px;
    top: 6px;
    z-index: 350;
    margin: 0;
    padding: 3px 9px;
    border-radius: 6px;
    background: #1d262a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
}

/* ---------- 回転エリア ---------- */

.sthi-stage {
    position: relative;
    height: var(--sthi-stage-h);
    margin: 0 auto;
    max-width: 1400px;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
}

.sthi-stage__bg {
    /* JavaScript が鍵穴の位置と大きさを読み取るための目印（表示はしない） */
    position: absolute;
    left: 50%;
    top: var(--sthi-kt);
    width: 0;
    height: var(--sthi-kh);
    visibility: hidden;
    pointer-events: none;
}

.sthi-empty {
    position: absolute;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%);
    margin: 0;
    padding: 8px 18px;
    border-radius: 8px;
    background: rgba(255, 253, 249, .94);
    font-weight: 700;
    white-space: nowrap;
}

/* JavaScript が動く前（または使えない端末）：普通のカード一覧 */
.sthi-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 36px 14px 24px;
    list-style: none;
}

.sthi-stage:not(.is-enhanced) { height: auto; min-height: var(--sthi-stage-h); }
.sthi-stage.is-enhanced .sthi-cards { display: none; }

/* JavaScript が使える端末では、回転表示に組み替わるまでカード一覧を見せない
   （一覧が一瞬見えてから切り替わるのを防ぐ）。万一組み替えに失敗したら4秒後に一覧を出す。 */
.sthi-js .sthi-stage:not(.is-enhanced) { height: var(--sthi-stage-h); min-height: 0; overflow: hidden; }
.sthi-js .sthi-stage:not(.is-enhanced) .sthi-cards { visibility: hidden; animation: sthi-reveal 0s linear 4s forwards; }
@keyframes sthi-reveal { to { visibility: visible; } }
.sthi-ring { animation: sthi-ring-in .35s ease both; }
@keyframes sthi-ring-in { from { opacity: 0; } to { opacity: 1; } }

/* スマホ：操作ボタンを少し小さくして下端に寄せ、カードを鍵穴の下まで下げる */
@media (max-width: 699px) {
    .sthi-stage .sthi-controls { bottom: 5px; gap: 8px; }
    .sthi-stage .sthi-controls button { width: 36px; height: 36px; }
}

.sthi-card__link {
    display: block;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: #fffdf9;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(40, 20, 0, .25);
}

.sthi-card__img,
.sthi-slot__img,
.sthi-detail__img,
.sthi-latest__img {
    display: block;
    aspect-ratio: 5 / 3;
    background: #e9e2d6;
    overflow: hidden;
}

.sthi-card__img img,
.sthi-slot__img img,
.sthi-detail__img img,
.sthi-latest__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sthi-card__body { display: block; padding: 8px 10px 10px; }
.sthi-card__title { display: block; font-size: 13.5px; font-weight: 700; line-height: 1.45; }
.sthi-card__sub { display: none; }

/* 回るカード */
.sthi-ring { position: absolute; inset: 0; }

.sthi-slot {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--sthi-cw);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #fffdf9;
    color: var(--text, #1d262a);
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(40, 20, 0, .32), 0 0 0 1px rgba(255, 255, 255, .6);
    transform-origin: 50% 50%;
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-tap-highlight-color: transparent;
}

.sthi-slot:focus-visible { outline: 3px solid var(--orange, #f7bb5d); outline-offset: 2px; }

.sthi-slot__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    box-sizing: content-box;
    height: calc(1.42em * 3);
    margin: 8px 10px 10px;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.42;
}

.sthi-stage.is-selected .sthi-ring { opacity: .38; transition: opacity .25s ease; }
.sthi-stage.is-dragging { cursor: grabbing; }

/* 操作ボタン */
.sthi-controls {
    position: absolute;
    left: 50%;
    bottom: 10px;
    z-index: 300;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(-50%);
}

.sthi-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 253, 249, .94);
    color: var(--text, #1d262a);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(40, 20, 0, .3);
    -webkit-tap-highlight-color: transparent;
}

.sthi-controls button:hover,
.sthi-controls button:focus-visible { background: var(--orange, #f7bb5d); }
.sthi-controls svg { width: 18px; height: 18px; }
.sthi-stage.is-selected .sthi-controls { visibility: hidden; }

/* タップしたカードの詳細（サブタイトルまで表示） */
.sthi-detail {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 400;
    width: min(calc(100% - 36px), 380px);
    max-height: calc(100% - 20px);
    overflow: auto;
    border-radius: 12px;
    background: #fffdf9;
    box-shadow: 0 16px 44px rgba(30, 15, 0, .5);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -46%) scale(.92);
    transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
    -webkit-user-select: text;
    user-select: text;
}

.sthi-detail.is-open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    transition: opacity .22s ease, transform .22s ease;
}

.sthi-no-motion .sthi-detail,
.sthi-no-motion .sthi-ring { transition: none !important; }

.sthi-detail__body { padding: 12px 16px 16px; }
.sthi-detail__title { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.45; }
.sthi-detail__sub { margin: 8px 0 0; font-size: 14px; line-height: 1.6; color: var(--muted, #575757); }

.sthi-detail__actions { display: flex; gap: 10px; margin-top: 14px; }

.sthi-detail__go,
.sthi-detail__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 0;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.sthi-detail__go { flex: 1 1 auto; background: #000; color: #fff; }
.sthi-detail__go:hover,
.sthi-detail__go:focus-visible { background: var(--orange, #f7bb5d); color: #000; }
.sthi-detail__go[aria-disabled="true"] { background: #8c8c8c; color: #fff; cursor: default; }
.sthi-detail__close { flex: 0 0 auto; background: #ece7df; color: var(--text, #1d262a); }

/* ---------- 最新インタビュー ---------- */
/* 見出しとカードはテーマ（Home）のものをそのまま使う。
   スマホ：全件をブロック表示で並べる。PC：最新の1件を全幅、2件目以降をブロック表示。 */

.sthi-page .sthi-latest.content-section { margin-top: 12px; }

/* スマホのブロック表示：長い語句（改行しないまとまり）が列を押し広げて右端が切れるのを防ぐ */
@media (max-width: 900px) {
    .sthi-grid { grid-template-columns: minmax(0, 1fr); }
}
.sthi-grid > * { min-width: 0; }
.sthi-grid .stdz-w { display: inline-block; max-width: 100%; white-space: normal; vertical-align: top; }
.sthi-grid .article-card-title,
.sthi-grid .article-card p { overflow-wrap: anywhere; }

.sthi-latest__card { display: none; }

.sthi-latest__date { display: block; font-size: 13px; color: var(--muted, #575757); }
.sthi-latest__title { display: block; margin-top: 4px; font-size: 22px; font-weight: 700; line-height: 1.45; }
.sthi-latest__sub { display: block; margin-top: 8px; font-size: 15px; line-height: 1.6; color: var(--muted, #575757); }
.sthi-latest__card:hover .sthi-latest__title { text-decoration: underline; }

/* ---------- PC ---------- */

@media (min-width: 700px) {
    .sthi-hero {
        --sthi-top: 135px;
        --sthi-below: 72px;
        --sthi-stage-h: clamp(400px, calc(var(--sthi-vh) - var(--sthi-top) - var(--sthi-below)), 620px);
        --sthi-kh: calc(var(--sthi-stage-h) * .88);
        --sthi-cw: clamp(190px, calc(var(--sthi-stage-h) * .5), 290px);
    }

    .sthi-crumb { left: max(16px, calc((100% - var(--content, 1224px)) / 2)); top: 12px; font-size: 13px; }
    .sthi-dummy-note { right: max(16px, calc((100% - var(--content, 1224px)) / 2)); top: 10px; font-size: 12px; }

    .sthi-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 44px 24px 24px; }
    /* PC：タイトルを最後まで読めるよう4行ぶん確保する */
    .sthi-slot__title { font-size: clamp(13.5px, calc(var(--sthi-cw) * .068), 16px); margin: 8px 12px 10px; -webkit-line-clamp: 4; height: calc(1.42em * 4); }
    /* PC：操作ボタンは右上に置き、手前のカードを下端まで下げて鍵穴の街並みを隠さないようにする */
    .sthi-controls { left: auto; right: max(16px, calc((100% - var(--content, 1224px)) / 2)); top: 10px; bottom: auto; transform: none; }
    .sthi-dummy-note { right: auto; left: 50%; transform: translateX(-50%); }
    .sthi-detail { width: min(calc(100% - 48px), 420px); }
    .sthi-detail__title { font-size: 19px; }
}

@media (min-width: 901px) {
    .sthi-page .sthi-latest.content-section { margin-top: 16px; }

    .sthi-latest__card {
        display: flex;
        align-items: stretch;
        margin: 0 0 34px;
        border: 1px solid var(--line, #e6e6e6);
        border-radius: 10px;
        overflow: hidden;
        background: #fff;
        color: inherit;
        text-decoration: none;
    }

    .sthi-latest__img { flex: 0 0 40%; aspect-ratio: 5 / 3; }
    .sthi-latest__body { flex: 1 1 auto; align-self: center; padding: 20px 28px; }

    /* 最新の1件は上の全幅カードで出しているので、ブロック一覧では2件目から */
    .sthi-grid > :first-child { display: none; }
}

/* 個別のインタビュー記事：通常の記事末尾は出さず、インタビューの画面を続ける */
body.sthi-interview-single .single-after-content { display: none; }
/* 記事ページは本文の幅に左右の余白があるので、画面の端まで広げる */
.sthi-page--single { margin-top: 30px; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
