/* ---- 事例グリッド ---- */
.wp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px 24px;
}
@media (max-width: 860px) {
    .wp-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 1.5em;
    }
}
@media (max-width: 560px) {
    .wp-grid {
        grid-template-columns: 1fr;
    }
}

.wp-card {
    display: flex;
    flex-direction: column;
}

.wp-shot {
    appearance: none;
    border: 1px solid #e4dcd4;
    background: #fff;
    padding: 0;
    margin: 0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    display: block;
    aspect-ratio: 600/456;
    width: 100%;
    box-shadow: 0 1px 2px rgba(40, 30, 20, 0.05);
    transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
}
.wp-shot picture {
    display: block;
    width: 100%;
    height: 100%;
}
.wp-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}
.wp-shot:hover {
    box-shadow: 0 10px 28px rgba(40, 30, 20, 0.16);
    transform: translateY(-3px);
    border-color: #cdbfb2;
}
.wp-shot:focus-visible {
    outline: 3px solid var(--c-green);
    outline-offset: 2px;
}
/* ホバー時の「フルサイズで見る」オーバーレイ */
.wp-shot__veil {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    padding: 16px 18px;
    box-sizing: border-box;
    background: linear-gradient(135deg, rgba(30, 24, 20, 0.58), rgba(30, 24, 20, 0.12) 62%);
    color: #fff;
    opacity: 0;
    transition: opacity 0.18s;
}
.wp-shot:hover .wp-shot__veil,
.wp-shot:focus-visible .wp-shot__veil {
    opacity: 1;
}
.wp-shot__badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.95);
    color: #2a2422;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 15px;
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}
.wp-shot__badge svg {
    width: 16px;
    height: 16px;
    color: var(--btn-primary);
}
.wp-shot__hint {
    display: none;
}

.wp-card__cap {
    padding: 13px 4px 0;
}
.wp-card__loc {
    font-size: 12px;
    color: #8a7f75;
    margin: 0 0 3px;
    letter-spacing: 0.02em;
}
.wp-card__name {
    font-size: 15px;
    font-weight: 700;
    color: #2a2422;
    margin: 0;
    line-height: 1.5;
}

/* ---- BUTTON（ahc-btn） ---- */
.ahc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-weight: bold;
    text-decoration: none;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}

.ahc-btn__t {
    font-weight: bold;
}
.ahc-btn__ic {
    display: inline-flex;
    flex: 0 0 auto;
}
.ahc-btn__ic i,
.ahc-btn__ic svg {
    height: 1.4em;
    width: auto;
}
/* 矢印（→内部 / ↓ページ内 / ↗外部） */
.ahc-arw {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ahc-arw--right,
.ahc-arw--down {
    width: 0.42em;
    height: 0.42em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    margin-left: 2px;
    transition: transform 0.15s;
}
.ahc-arw--right {
    transform: rotate(-45deg);
}
.ahc-arw--down {
    transform: rotate(45deg);
}
.ahc-arw--ext {
    width: 0.92em;
    height: 0.92em;
    margin-left: 3px;
}
.ahc-arw--ext svg {
    width: 100%;
    height: 100%;
}
.ahc-btn:hover .ahc-arw--right {
    transform: rotate(-45deg) translate(2px, 2px);
}
.ahc-btn:hover .ahc-arw--down {
    transform: rotate(45deg) translate(2px, 2px);
}
/* sizes */
.ahc-btn--sm {
    padding: 10px 20px;
    font-size: 14px;
}
.ahc-btn--md {
    padding: 13px 26px;
    font-size: 16px;
}
.ahc-btn--lg {
    padding: 16px 32px;
    font-size: 17px;
}
.ahc-btn--block {
    display: flex;
    width: 100%;
}
/* variant: primary（緑・主アクション） */
.ahc-btn--primary {
    background: #4b8325;
    color: #fff;
}
.ahc-btn--primary:hover {
    background: #3f6e1f;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(75, 131, 37, 0.3);
}

.ahc-btn--primary.ahc-btn:hover,
.ahc-btn--primary.ahc-btn:current,
.ahc-btn--primary.ahc-btn:visited {
    color: #fff;
    text-decoration: none;
}
/* variant: secondary（白地＋マルーン枠線） */
.ahc-btn--secondary {
    background: #fff;
    color: #8b1c23;
    box-shadow: inset 0 0 0 1.5px #e2c9cb;
}
.ahc-btn--secondary:hover {
    background: #fcf8f2;
    box-shadow: inset 0 0 0 1.5px #8b1c23;
    transform: translateY(-1px);
}
.ahc-btn--secondary.ahc-btn:hover,
.ahc-btn--secondary.ahc-btn:current,
.ahc-btn--secondary.ahc-btn:visited {
    color: #000;
    text-decoration: none;
}
/* variant: on-dark（暗背景・白塗り） */
.ahc-btn--on-dark {
    background: #fff;
    color: #3f6e1f;
}
.ahc-btn--on-dark:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}
@media (prefers-reduced-motion: reduce) {
    .ahc-btn,
    .ahc-arw {
        transition: none;
    }
    .ahc-btn:hover {
        transform: none;
    }
}

/* ---- JSが動的に生成するフレーム ---- */
.wp-frame {
    position: relative;
}

/* 右下に重ねるスマホモック */
.wp-phone {
    position: absolute;
    right: -16px;
    bottom: -20px;
    z-index: 0;
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    cursor: pointer;
    width: 32%;
    max-width: 126px;
    filter: drop-shadow(0 9px 20px rgba(30, 22, 14, 0.3));
    transition: transform 0.18s;
}
.wp-phone:hover {
    transform: translateY(-4px);
}
.wp-phone:focus-visible {
    outline: 3px solid var(--c-green);
    outline-offset: 3px;
    border-radius: 16px;
}
.wp-phone__scr {
    --bezel: 3px;
    position: relative;
    display: block;
    background: linear-gradient(145deg, #43454b, #2b2c31);
    border-radius: 15px;
    padding: var(--bezel);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.wp-phone__scr img {
    width: 100%;
    aspect-ratio: 9/17.5;
    object-fit: cover;
    object-position: top center;
    display: block;
    border-radius: 12px;
    background: #fff;
}
.wp-phone__veil {
    position: absolute;
    inset: var(--bezel);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(30, 24, 20, 0.2), rgba(30, 24, 20, 0.58));
    opacity: 0;
    transition: opacity 0.18s;
}
.wp-phone:hover .wp-phone__veil,
.wp-phone:focus-visible .wp-phone__veil {
    opacity: 1;
}
.wp-phone__veil i {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: #2a2422;
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}
.wp-phone__veil svg {
    width: 14px;
    height: 14px;
    color: var(--btn-primary);
}

/* ================= ライトボックス ================= */
.lb {
    position: fixed;
    inset: 0;
    z-index: 120;
    z-index: 9999999999;
    display: none;
}
.lb.is-open {
    display: block;
}
.lb__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(24, 19, 16, 0.82);
    backdrop-filter: blur(2px);
}

.lb__panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-sizing: border-box;
}

/* ヘッダーバー */
.lb__bar {
    position: relative;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: rgba(20, 16, 13, 0.55);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}
.lb__barright {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 0;
    justify-content: flex-end;
}
.lb__segcount {
    display: none;
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}
.lb__ctamobile {
    display: none;
}

/* PC / スマホ 切替 */
.lb__seg {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 3px;
    flex: none;
}
.lb__seg button {
    appearance: none;
    border: 0;
    background: transparent;
    color: #e7ddd2;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, color 0.15s;
}
.lb__seg button svg {
    width: 15px;
    height: 15px;
}
.lb__seg button.is-on {
    background: #fff;
    color: #2a2422;
}

.lb__close {
    flex: none;
    appearance: none;
    border: 0;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.lb__close:hover {
    background: rgba(255, 255, 255, 0.22);
}
.lb__close svg {
    width: 20px;
    height: 20px;
}

/* ステージ（スクロール領域）
   container-type:size でデバイス枠のサイズ基準にする（cqh/cqw はステージの内寸を参照）。
   ヘッダーバーの折り返しやモバイルCTAバーの有無を自動で吸収できる */
.lb__stage {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    overflow: auto;
    overscroll-behavior: contain;
    container-type: size;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 88px 20px;
}
@media (max-width: 720px) {
    .lb__stage {
        padding: 10px 14px 10px;
    }
}

/* PC枠 / スマホ枠 共通：縦横比を固定し、幅を画面高に連動させて縮小・上下中央寄せ */
.lb__device[hidden] {
    display: none !important;
}
.lb__device {
    flex: none;
    align-self: center;
    transition: opacity 0.12s;
}
.lb__device--pc {
    /* 幅上限＝ステージ高からブラウザクロム分(34px+余裕)を引いた高さ × アスペクト比1.6
       （cq単位非対応ブラウザ向けに1行目のフォールバックを維持） */
    width: min(980px, 100%);
    width: min(980px, 100%, calc((100cqh - 40px) * 1.6));
    background: #fff;
    border-radius: 12px 12px 8px 8px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}
.lb__chrome {
    height: 34px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px;
    border-bottom: 1px solid #d7dbe0;
}
.lb__chrome i {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #c4cad1;
    display: block;
}
.lb__chrome i:nth-child(1) {
    background: #ff5f57;
}
.lb__chrome i:nth-child(2) {
    background: #febc2e;
}
.lb__chrome i:nth-child(3) {
    background: #28c840;
}
.lb__chrome span {
    margin-left: 10px;
    font-size: 11px;
    color: #7c848d;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lb__device--pc img {
    width: 100%;
    display: block;
}
.pc-scroll {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* スマホ枠：外郭は縦横比固定、中身（キャプチャ）だけ縦スクロール */
.lb__device--sp {
    /* 幅上限＝ステージ高からiOSクロム分(ベゼル+ステータス/URLバー≈95px)を引いた高さ × 0.58
       （cq単位非対応ブラウザ向けに1行目のフォールバックを維持） */
    width: min(332px, 86vw);
    width: min(332px, 92cqw, calc((100cqh - 95px) * 0.58));
    background: linear-gradient(145deg, #43454b, #2b2c31);
    border-radius: 30px;
    padding: 6px;
    box-shadow: 0 20px 52px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    align-self: center;
    display: flex;
    flex-direction: column;
}
.lb__spscreen {
    background: #fff;
    border-radius: 25px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}
.ios-scroll {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 39 / 67;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.lb__device--sp img {
    width: 100%;
    display: block;
}

/* iOS Safari クロム */
.ios-sbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 28px;
    padding: 0 18px 0 20px;
    background: #6f7276;
    color: #fff;
    font: 600 12px/1 -apple-system, "Helvetica Neue", system-ui, sans-serif;
}
.ios-island {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 82px;
    height: 17px;
    background: #000;
    border-radius: 999px;
}
.ios-sbar__r {
    display: flex;
    align-items: center;
    gap: 5px;
}
.ios-sbar__r svg {
    display: block;
    fill: #fff;
}
.ios-sbar__batt {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
}
.ios-urlbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 9px;
    background: #6f7276;
}
.ios-urlbar__field {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: #e9eaec;
    border-radius: 11px;
    height: 34px;
    padding: 0 12px;
    min-width: 0;
}
.ios-urlbar__host {
    font: 600 14px/1 -apple-system, system-ui, sans-serif;
    color: #1c1c1e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ios-urlbar__ico {
    width: 15px;
    height: 15px;
    flex: none;
    color: #5a5d61;
}

/* 左右ナビ */
.lb__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    appearance: none;
    border: 0;
    cursor: pointer;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #2a2422;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transition: background 0.15s, transform 0.15s;
}
.lb__nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.06);
}
.lb__nav svg {
    width: 26px;
    height: 26px;
}
.lb__nav--prev {
    left: 18px;
}
.lb__nav--next {
    right: 18px;
}
@media (max-width: 720px) {
    .lb__nav {
        width: 44px;
        height: 44px;
    }
    .lb__nav--prev {
        left: 6px;
    }
    .lb__nav--next {
        right: 6px;
    }
    .lb__nav svg {
        width: 20px;
        height: 20px;
    }
}

/* ヘッダー内：情報（左）／CTA（中央）／切替・閉じる（右） */
.lb__info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    flex: 1 1 0;
    font-size: 12.5px;
    color: #e7ddd2;
}
.lb__count {
    font-weight: 700;
    color: #fff;
}
.lb__hint {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.lb__kbd {
    font: 600 11px/1 ui-monospace, monospace;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 5px;
    padding: 3px 6px;
    color: #fff;
}
.lb__cta {
    display: flex;
    align-items: center;
    gap: 14px 16px;
    flex-wrap: wrap;
    justify-content: center;
}
.lb__ctabtns {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.lb__ctabtns .ahc-btn {
    white-space: nowrap;
    padding-top: 13px;
    padding-bottom: 13px;
    font-size: 14px;
}
/* WPテーマ上はフォント・余白が大きく、redesign版の900pxでは
   .lb__barright の中身が縮まず中央CTAに重なるため、折り返しを1100pxに引き上げ */
@media (max-width: 1100px) {
    .lb__info {
        flex: 1 1 100%;
        order: 2;
    }
    .lb__cta {
        order: 1;
        flex: 1 1 100%;
    }
    .lb__barright {
        order: 0;
        flex: 1 1 100%;
        justify-content: space-between;
    }
}
@media (max-width: 640px) {
    .lb__bar {
        padding: 12px 14px;
        gap: 10px;
    }
    /* 情報ブロックと中央CTAはヘッダーから外し、CTAはプレビュー下へ */
    .lb__info {
        display: none;
    }
    .lb__cta {
        display: none;
    }
    /* ヘッダーは1行に：PC/スマホ切替 → 事例カウント → ✕ */
    .lb__barright {
        flex: 1 1 100%;
        justify-content: flex-start;
        gap: 10px;
    }
    .lb__segcount {
        display: inline;
    }
    .lb__close {
        margin-left: auto;
    }
    /* プレビュー下のCTAバー */
    .lb__ctamobile {
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex: none;
        box-sizing: border-box;
        width: 100%;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
        background: rgba(20, 16, 13, 0.6);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    .lb__ctamobile .ahc-btn {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        justify-content: center;
        padding-top: 13px;
        padding-bottom: 13px;
        font-size: 14px;
        white-space: nowrap;
    }
    /* デバイス枠のサイズはcqh/cqw基準のためモバイル用の再定義は不要（CTAバー分はステージ高が自動で縮む） */
}
