﻿/**
 * EC-CUBE: html/user_data/assets/css/topic-switch-block.css
 * Topic switch block styles
 */

    .ec-topicRole {
        margin-top: 20px;
    }

    .topicSwitch {
        position: relative;
        overflow: hidden;
        background: #111;
        color: #fff;
        padding: 20px 24px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 21%);
        grid-template-rows: 1fr auto;
        gap: 20px;
        align-items: stretch;
        min-height: 450px;
        box-sizing: border-box;
    }

    .topicSwitch__video {
        position: absolute;
        inset: 0;
        z-index: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
        pointer-events: none;
    }

    /* 黒の透過 + #333 ドット（斜め送り＝行を半ピッチずらした網点） */
    .topicSwitch__veil {
        position: absolute;
        inset: 0;
        z-index: 1;
        pointer-events: none;
        background-color: rgba(0, 0, 0, 0.78);
        background-image: radial-gradient(
                circle,
                #333333 1.1px,
                transparent 1.2px
            ),
            radial-gradient(
                circle,
                #333333 1.1px,
                transparent 1.2px
            );
        background-size: 8px 8px, 8px 8px;
        background-position: 0 0, 4px 4px;
    }

    .topicSwitch__hexLayer {
        display: none;
    }

    .topicSwitch__hex {
        position: absolute;
        left: 0;
        top: 0;
        background: #cccccc;
        opacity: 0.45;
        clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
        --rot: 0deg;
        will-change: transform;
    }

    .topicSwitch__hex:nth-child(1) {
        width: 44px;
        height: 51px;
        --rot: 12deg;
    }

    .topicSwitch__hex:nth-child(2) {
        width: 32px;
        height: 37px;
        --rot: -8deg;
    }

    .topicSwitch__hex:nth-child(3) {
        width: 56px;
        height: 65px;
        --rot: 22deg;
    }

    .topicSwitch__hex:nth-child(4) {
        width: 28px;
        height: 32px;
        --rot: -15deg;
    }

    .topicSwitch__hex:nth-child(5) {
        width: 38px;
        height: 44px;
        --rot: 6deg;
    }

    .topicSwitch__hex:nth-child(6) {
        width: 48px;
        height: 55px;
        --rot: -20deg;
    }

    .topicSwitch__hex:nth-child(7) {
        width: 34px;
        height: 39px;
        --rot: 18deg;
    }

    .topicSwitch__hex:nth-child(8) {
        width: 40px;
        height: 46px;
        --rot: -5deg;
    }

    .topicSwitch__hex:nth-child(9) {
        width: 26px;
        height: 30px;
        --rot: 10deg;
    }

    .topicSwitch__hex:nth-child(10) {
        width: 36px;
        height: 42px;
        --rot: -12deg;
    }

    .topicSwitch__left {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 12px;
        position: relative;
        z-index: 2;
    }

    .topicSwitch__swap {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 6px;
        box-sizing: border-box;
        /* 大見出しと画像・コピーの開始位置を同じ左端に揃える */
        padding: 40px 40px 0;
        transition: opacity 0.32s ease;
        backface-visibility: hidden;
    }

    .topicSwitch__swap.is-switching {
        opacity: 0;
        pointer-events: none;
    }

    .topicSwitch__mediaRow {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 18px 24px;
        width: 100%;
        min-width: 0;
    }

    /* 親(.topicSwitch__swap)の flex 伸長に引きずられて img が縦に暴れないよう、枠の高さを aspect-ratio で固定 */
    .topicSwitch__media {
        position: relative;
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
        aspect-ratio: 16 / 9;
        max-height: min(42vh, 420px);
        overflow: hidden;
        box-sizing: border-box;
    }

    .topicSwitch__mediaRow--withCopy .topicSwitch__media {
        flex: 0 1 52%;
        max-width: min(52%, 520px);
    }

    .topicSwitch__copy {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding-top: 2px;
    }

    .topicSwitch__copy[hidden] {
        display: none !important;
    }

    .topicSwitch__kicker {
        margin: 90px 0 0;
        font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans",
            "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
        font-size: calc(0.8125rem + 2pt);
        font-weight: 700;
        letter-spacing: 0.06em;
        line-height: 1.35;
        color: #fff;
        text-transform: none;
    }

    .topicSwitch__lead {
        margin: 0;
        white-space: pre-line;
        font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans",
            "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
        font-size: 0.875rem;
        font-weight: 400;
        line-height: 1.75;
        color: rgba(255, 255, 255, 0.97);
    }

    .topicSwitch__kicker.topicSwitch__kicker--typing::after,
    .topicSwitch__lead.topicSwitch__lead--typing::after {
        content: "";
        display: inline-block;
        width: 0.06em;
        height: 0.9em;
        margin-left: 0.08em;
        vertical-align: -0.08em;
        background: currentColor;
        opacity: 0.75;
        animation: topicTitleCaret 0.55s steps(1, end) infinite;
    }

    .topicSwitch__media img {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        display: block;
        border: none;
        box-sizing: border-box;
        object-fit: contain;
        object-position: left center;
        transition: opacity 0.42s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
        backface-visibility: hidden;
    }

    .topicSwitch__media img.topicSwitch__mediaImg--waiting {
        opacity: 0;
        transform: scale(1.05);
        transition: none !important;
    }

    .topicSwitch__media img.topicSwitch__mediaImg--waiting.topicSwitch__mediaImg--visible {
        opacity: 1;
        transform: none;
        transition: opacity 0.42s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1) !important;
    }

    .topicSwitch__title {
        margin: 0;
        padding: 0 0 8px;
        box-sizing: border-box;
        color: #fff;
        min-height: clamp(42px, 6vw, 80px);
        font-family: "Anton", Impact, "Arial Black", Haettenschweiler,
            "Franklin Gothic Heavy", "Franklin Gothic Bold", "Segoe UI Black",
            "Helvetica Neue", sans-serif;
        font-weight: 400;
        font-style: normal;
        font-size: clamp(42px, 6vw, 80px);
        letter-spacing: 2px;
        line-height: 1;
        text-transform: uppercase;
        transform-origin: left center;
        backface-visibility: hidden;
    }

    .topicSwitch__title.topicSwitch__title--typing::after {
        content: "";
        display: inline-block;
        width: 0.08em;
        height: 0.75em;
        margin-left: 0.06em;
        vertical-align: -0.05em;
        background: currentColor;
        opacity: 0.85;
        animation: topicTitleCaret 0.55s steps(1, end) infinite;
    }

    @keyframes topicTitleCaret {
        50% {
            opacity: 0;
        }
    }

    .topicSwitch__button {
        position: relative;
        z-index: 2;
        grid-column: 1;
        grid-row: 2;
        justify-self: center;
        align-self: start;
        display: inline-block;
        width: auto;
        max-width: 100%;
        margin-top: 0;
        padding: 12px 28px;
        border: 1px solid #a31818;
        border-radius: 2px;
        background: #c62828;
        color: #fff;
        text-decoration: none;
        font-weight: 700;
        font-size: 14px;
        letter-spacing: 0.08em;
        line-height: 1.3;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
        transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .topicSwitch__button:hover {
        background: #b71c1c;
        color: #fff;
        border-color: #8b1515;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    }

    .topicSwitch__button:active {
        background: #9a1818;
        border-color: #6d1010;
        box-shadow: none;
    }

    .topicSwitch__button:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 3px;
    }

    .topicSwitch__right {
        grid-column: 2;
        grid-row: 1 / -1;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        gap: 8px;
        min-height: 0;
        min-width: 0;
        align-content: stretch;
        position: relative;
        z-index: 2;
    }

    .topicSwitch__menu {
        -webkit-appearance: none;
        appearance: none;
        margin: 0;
        position: relative;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        min-height: 0;
        padding-top: 4px;
        padding-bottom: 4px;
        padding-left: calc(4px + 5px + 8px);
        padding-right: calc(4px + 5px + 8px);
        border: 1px solid rgba(255, 170, 170, 0.58);
        border-radius: 0;
        background: rgba(120, 0, 0, 0.38);
        color: #fff;
        font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans",
            "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
        font-size: clamp(14px, 1.05rem, 18px);
        font-weight: 500;
        line-height: 1.45;
        letter-spacing: 0.02em;
        cursor: pointer;
        transition: background-color 0.2s ease, color 0.2s ease,
            border-color 0.2s ease;
    }

    /* 外枠1pxの内側に4px空け、その内側の左右だけ5pxの帯 */
    .topicSwitch__menu::before,
    .topicSwitch__menu::after {
        content: "";
        position: absolute;
        top: 4px;
        bottom: 4px;
        width: 5px;
        pointer-events: none;
        z-index: 0;
        background: rgba(255, 170, 170, 0.58);
        transition: background 0.2s ease;
    }

    .topicSwitch__menu::before {
        left: 4px;
    }

    .topicSwitch__menu::after {
        right: 4px;
    }

    .topicSwitch__menu:hover:not(.is-active) {
        background: rgba(255, 180, 180, 0.24);
        border-color: rgba(255, 200, 200, 0.78);
        color: #fff;
    }

    .topicSwitch__menu:hover:not(.is-active)::before,
    .topicSwitch__menu:hover:not(.is-active)::after {
        background: rgba(255, 200, 200, 0.78);
    }

    .topicSwitch__menu.is-active {
        background: linear-gradient(
            to bottom right,
            #d32f2f 0%,
            #c62828 45%,
            #8b1a1a 100%
        );
        border-color: #fff;
        color: #fff;
        font-weight: 600;
    }

    .topicSwitch__menu.is-active::before,
    .topicSwitch__menu.is-active::after {
        background: #fff;
    }

    .topicSwitch__menu:focus-visible {
        outline: 2px solid rgba(255, 200, 200, 0.95);
        outline-offset: 2px;
    }

    @media only screen and (max-width: 960px) {
        .topicSwitch {
            display: flex;
            flex-direction: column;
            padding: 16px 18px;
            gap: 14px;
            min-height: 0;
            align-items: stretch;
        }

        .topicSwitch__left {
            gap: 10px;
            grid-column: unset;
            grid-row: unset;
            width: 100%;
        }

        .topicSwitch__swap {
            padding: 24px 20px 0;
        }

        .topicSwitch__title {
            padding: 0 0 10px;
        }

        .topicSwitch__right {
            grid-column: unset;
            grid-row: unset;
            width: 100%;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            grid-template-rows: none;
            grid-auto-rows: auto;
            gap: 8px;
        }

        .topicSwitch__button {
            grid-column: unset;
            grid-row: unset;
            justify-self: stretch;
            align-self: stretch;
            width: 100%;
            max-width: 100%;
            text-align: center;
            box-sizing: border-box;
        }

        .topicSwitch__menu {
            padding-top: 12px;
            padding-bottom: 12px;
            padding-left: calc(4px + 5px + 8px);
            padding-right: calc(4px + 5px + 8px);
        }

        .topicSwitch__menu::before,
        .topicSwitch__menu::after {
            top: 12px;
            bottom: 12px;
        }

        /* スーパーイージーオーダー… はスマホレイアウト時は1行表示 */
        .topicSwitch__menu[data-key="seou"] br {
            display: none;
        }
    }

    @media only screen and (max-width: 640px) {
        .topicSwitch__right {
            grid-template-columns: 1fr;
        }

        .topicSwitch__copy {
            display: none !important;
        }

        .topicSwitch__mediaRow--withCopy .topicSwitch__media {
            flex: 1 1 auto;
            max-width: none;
            width: 100%;
        }
    }

    @media only screen and (max-width: 768px) {
        .topicSwitch__title {
            /* スマホのみ（clamp 各値 × 0.7） */
            font-size: clamp(29px, 4.2vw, 56px);
            min-height: clamp(29px, 4.2vw, 56px);
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .topicSwitch__video {
            display: none;
        }

        .topicSwitch {
            background: #1a1a1a;
        }
    }
