/* =========================================================
   COTOME 作例一覧（examples.html）
   home.css の紙面トーンを引き継ぎ、名刺そのものを主役に並べる。
   ========================================================= */

.examples main {
    padding-bottom: clamp(24px, 4vw, 48px);
}

.home-nav a[aria-current="page"] {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

/* ---------- 導入 ---------- */
.ex-hero {
    display: grid;
    justify-items: start;
    gap: 14px;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: clamp(28px, 5vw, 56px) var(--gutter) clamp(20px, 3vw, 32px);
}

.ex-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
}

.ex-breadcrumb li + li::before {
    content: "／";
    margin-right: 4px;
    color: var(--ink-3);
}

.ex-breadcrumb a {
    color: var(--ink-2);
}

.ex-breadcrumb a:hover {
    color: var(--accent);
}

.ex-title {
    margin: 0;
    font-size: clamp(30px, 4.6vw, 52px);
    line-height: 1.28;
    word-break: auto-phrase;
}

/* 「名刺とカード」を途中で割らない */
.ex-title .hero-accent {
    white-space: nowrap;
}

.ex-lead {
    max-width: 760px;
    margin: 0;
    text-wrap: pretty;
    word-break: auto-phrase;
    color: var(--ink-2);
    font-size: clamp(15px, 1.5vw, 17px);
    font-weight: 600;
}

.ex-howto {
    margin: 0;
    color: var(--ink-3);
    font-size: 13.5px;
    font-weight: 600;
}

.ex-notice {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    max-width: 820px;
    margin-top: 6px;
    padding: 14px 18px;
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--ink-2);
    font-size: 14px;
}

.ex-notice p {
    margin: 0;
}

.ex-notice p + p {
    margin-top: 4px;
}

.ex-notice strong {
    color: var(--ink);
}

.ex-notice-icon {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- 移動・表示切替 ---------- */
.ex-toolbar {
    position: sticky;
    top: 68px;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 10px var(--gutter);
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(8px);
}

.ex-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ex-jump a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 14px;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
}

.ex-jump a:hover {
    border-color: var(--line-strong);
    color: var(--accent);
}

.ex-jump-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.ex-jump-dot--business { background: #f0736c; }
.ex-jump-dot--oshikatsu { background: #4fb894; }
.ex-jump-dot--shop { background: #e0a526; }
.ex-jump-dot--product { background: #6b5bb8; }
.ex-jump-dot--thanks { background: #2f8fb8; }

.ex-jump-count {
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 600;
}

.ex-view {
    display: inline-flex;
    padding: 3px;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
}

.ex-view button {
    min-height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 700;
}

.ex-view button[aria-pressed="true"] {
    background: var(--ink);
    color: var(--bg);
}

/* ---------- ギャラリー（一覧） ----------
   カテゴリごとの区画を縦に並べ、区画の間に線を引く。区画の中は作例のカードを並べる（スマホ1列・タブレット2列・PC4列）。
   .ex-item の基本の指定は、作例の詳細（モーダル）で使う大きな表示。一覧での縮め方は .ex-gallery の下に書く。 */
.ex-gallery {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: clamp(8px, 1.2vw, 16px) var(--gutter) 0;
}

.ex-category {
    scroll-margin-top: 130px;
    padding: clamp(24px, 3.2vw, 40px) 0;
}

/* カテゴリの間の水平線 */
.ex-category + .ex-category {
    border-top: 1.5px solid var(--line-strong);
}

.ex-category-head {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 10px 24px;
    margin-bottom: clamp(16px, 2vw, 24px);
}

.ex-category-text {
    display: grid;
    gap: 6px;
    max-width: 760px;
}

.ex-category-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(22px, 2.4vw, 28px);
    font-weight: 900;
    line-height: 1.3;
}

.ex-category-count {
    color: var(--ink-3);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
}

.ex-category-lead {
    margin: 0;
    text-wrap: pretty;
    word-break: auto-phrase;
    color: var(--ink-2);
    font-size: 14.5px;
    font-weight: 600;
}

.ex-category-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-strong);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.ex-category-link svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ex-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(16px, 1.8vw, 24px);
}

.ex-item {
    --ex-mat: var(--pink-soft);
    --ex-ink: var(--accent-strong);
    scroll-margin-top: 140px;
    display: grid;
    gap: clamp(20px, 3vw, 32px);
    padding: clamp(22px, 4vw, 44px);
    border-radius: var(--radius-xl);
    background-color: var(--ex-mat);
    background-image: radial-gradient(color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1.4px);
    background-size: 20px 20px;
}

/* 台紙の色は区画の中で桃・藤・黄・薄緑を順に回す（詳細のモーダルへは data-mat で引き継ぐ） */
.ex-item[data-mat="lav"] { --ex-mat: var(--lav-soft); --ex-ink: #5b48a8; }
.ex-item[data-mat="butter"] { --ex-mat: var(--butter-soft); --ex-ink: #0d5560; }
.ex-item[data-mat="mint"] { --ex-mat: var(--mint-soft); --ex-ink: #1f6650; }

:root[data-theme="dark"] .ex-item { --ex-ink: var(--accent); }
:root[data-theme="dark"] .ex-item[data-mat="lav"] { --ex-ink: var(--lav); }
:root[data-theme="dark"] .ex-item[data-mat="butter"] { --ex-ink: var(--butter); }
:root[data-theme="dark"] .ex-item[data-mat="mint"] { --ex-ink: var(--mint); }

.ex-item-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.25fr);
    align-items: start;
    gap: 12px clamp(16px, 3vw, 32px);
}

.ex-no {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--ex-ink);
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 900;
}

.ex-item-title {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.ex-role {
    margin: 0;
    color: var(--ex-ink);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.ex-name {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(24px, 2.8vw, 30px);
    font-weight: 900;
    line-height: 1.3;
}

.ex-studio {
    margin: 0;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
}

.ex-spec {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    font-size: 14px;
}

.ex-spec div {
    display: grid;
    grid-template-columns: 6em 1fr;
    gap: 10px;
}

.ex-spec dt {
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 700;
}

.ex-spec dd {
    margin: 0;
    font-weight: 600;
}

/* 表と裏 */
.ex-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(18px, 3vw, 40px);
    align-items: start;
}

.ex-side {
    margin: 0;
    min-width: 0;
}

.ex-side figcaption {
    margin-top: 10px;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-align: center;
}

.ex-card {
    position: relative;
    display: block;
    border-radius: 5px;
    background: var(--paper);
    box-shadow: var(--shadow-card);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.ex-card img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 5px;
}

.ex-card:hover,
.ex-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card), 0 0 0 3px color-mix(in srgb, var(--ex-ink) 30%, transparent);
}

.ex-card:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}

.ex-zoom {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 253, 248, 0.94);
    color: #2b2438;
    box-shadow: var(--shadow-md);
    opacity: 0.88;
    transition: opacity 0.2s;
}

.ex-card:hover .ex-zoom,
.ex-card:focus-visible .ex-zoom {
    opacity: 1;
}

.ex-zoom svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* 一覧のカード：名刺を縦に並べ、説明は詳細に回す */
.ex-gallery .ex-item {
    align-content: start;
    gap: 14px;
    padding: clamp(16px, 1.6vw, 22px);
    border-radius: var(--radius-lg);
    transition: box-shadow 0.2s var(--ease);
}

.ex-gallery.is-enhanced .ex-item {
    cursor: pointer;
}

.ex-gallery.is-enhanced .ex-item:hover {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--ex-ink) 38%, transparent);
}

/* 一覧の見出し：1行目に番号・職種・開くボタン、2行目以降に名前と屋号を横幅いっぱいで置く */
.ex-gallery .ex-item-head {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "no role open"
        "name name name"
        "studio studio studio";
    align-items: center;
    gap: 2px 10px;
}

.ex-gallery .ex-item-title {
    display: contents;
}

.ex-gallery .ex-no { grid-area: no; }
.ex-gallery .ex-role { grid-area: role; }
.ex-gallery .ex-name { grid-area: name; margin-top: 6px; }
.ex-gallery .ex-studio { grid-area: studio; }
.ex-gallery .ex-item-open { grid-area: open; }

.ex-gallery .ex-no {
    width: 34px;
    height: 34px;
    font-size: 14px;
}

/* 一覧では職種・屋号を1行に収め、全文は詳細で見せる */
.ex-gallery .ex-role {
    overflow: hidden;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ex-gallery .ex-name {
    font-size: clamp(19px, 1.5vw, 22px);
}

.ex-gallery .ex-studio {
    overflow: hidden;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ex-gallery .ex-spec {
    grid-column: 1 / -1;
    padding: 10px 12px;
    font-size: 13px;
}

/* JSが動くときは、説明を詳細のモーダルで見せる（一覧には名刺と名前だけ） */
.ex-gallery.is-enhanced .ex-spec {
    display: none;
}

.ex-gallery .ex-pair {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.ex-gallery .ex-side figcaption {
    margin-top: 6px;
    font-size: 12px;
}

.ex-gallery .ex-zoom {
    right: 8px;
    bottom: 8px;
    width: 32px;
    height: 32px;
}

.ex-gallery .ex-zoom svg {
    width: 17px;
    height: 17px;
}

/* 詳細を開くボタン（JSで足す） */
.ex-item-open {
    grid-column: 3;
    grid-row: 1;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1.5px solid color-mix(in srgb, var(--ex-ink) 28%, var(--line));
    border-radius: 50%;
    background: var(--surface);
    color: var(--ex-ink);
    cursor: pointer;
}

.ex-item-open:hover {
    background: var(--surface-2);
}

.ex-item-open:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.ex-item-open svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 表面だけ・裏面だけで並べて比べる */
.ex-gallery[data-view="front"] .ex-side--back,
.ex-gallery[data-view="back"] .ex-side--front {
    display: none;
}

@media (min-width: 640px) {
    .ex-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* PCでは4列。各カテゴリが4件か8件なので、行の途中で途切れない */
@media (min-width: 1100px) {
    .ex-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* フルHD前後の画面では、ページの幅を広げる */
@media (min-width: 1440px) {
    .examples {
        --wrap: 1520px;
    }

    /* ヘッダーとフッターは、ほかのページと同じ幅のままにする（ページを移ってもロゴの位置が動かないように） */
    .examples .home-header,
    .examples .home-footer {
        --wrap: 1200px;
    }
}

/* ---------- 締め ---------- */
.ex-closing {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: clamp(48px, 7vw, 88px) var(--gutter) clamp(32px, 5vw, 56px);
}

.ex-closing-inner {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 14px;
    max-width: 860px;
    margin: 0 auto;
    padding: clamp(28px, 4vw, 48px);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.ex-closing-inner::after {
    content: "";
    position: absolute;
    inset: 12px;
    border: 1.5px dashed var(--accent-line);
    border-radius: calc(var(--radius-xl) - 8px);
    pointer-events: none;
}

.ex-closing-inner > * {
    position: relative;
    z-index: 1;
}

.ex-closing-title {
    margin: 0;
    font-size: clamp(26px, 3.4vw, 38px);
}

.ex-closing-inner p {
    margin: 0;
    color: var(--ink-2);
}

.ex-closing-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 6px;
}

.ex-closing-sub {
    font-size: 14px;
}

/* ---------- 作例の詳細・画像の拡大 ---------- */
.ex-lightbox,
.ex-detail {
    width: min(1180px, calc(100vw - 24px));
    max-width: none;
    max-height: calc(100dvh - 24px);
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 24px 60px -12px rgba(30, 20, 40, 0.5);
}

.ex-lightbox[open],
.ex-detail[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.ex-lightbox::backdrop,
.ex-detail::backdrop {
    background: rgba(43, 36, 56, 0.72);
    backdrop-filter: blur(3px);
}

.ex-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 12px 8px 20px;
}

.ex-detail-count {
    color: var(--ink-2);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.ex-detail-body {
    min-height: 0;
    padding: 0 20px 4px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.ex-detail-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px 8px;
}

.ex-lightbox-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px 8px 20px;
}

.ex-lightbox-caption {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 900;
}

.ex-lightbox-count {
    color: var(--ink-2);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ex-icon-btn {
    display: grid;
    flex: none;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1.5px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
}

.ex-icon-btn:hover {
    background: var(--surface-2);
}

.ex-icon-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.ex-lightbox-stage {
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 4px 20px 12px;
    background: var(--surface);
}

.ex-lightbox-stage img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(100dvh - 200px);
    border-radius: 5px;
    background: #fff;
    box-shadow: var(--shadow-card);
}

.ex-lightbox-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 4px 16px 8px;
}

.ex-lightbox-hint {
    margin: 0;
    padding: 0 20px 14px;
    color: var(--ink-2);
    font-size: 12.5px;
    text-align: center;
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 1020px) {
    .ex-item-head {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .ex-spec {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    .ex-br-wide {
        display: none;
    }

    .ex-toolbar {
        position: static;
    }

    .ex-item,
    .ex-category {
        scroll-margin-top: 16px;
    }
}

@media (max-width: 600px) {
    .ex-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ex-jump {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .ex-jump a {
        flex: none;
    }

    .ex-view {
        align-self: stretch;
    }

    .ex-view button {
        flex: 1;
        min-height: 40px;
    }

    .ex-gallery .ex-item {
        margin: 0 calc(var(--gutter) * -0.5);
        padding: 18px 14px;
    }

    .ex-detail .ex-item {
        padding: 18px 14px;
        border-radius: var(--radius-lg);
    }

    /* スマホでは詳細でも表と裏を縦に並べ、名刺を画面幅いっぱいに見せる */
    .ex-pair {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }

    .ex-spec div {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .ex-closing-actions,
    .ex-closing-actions .btn {
        width: 100%;
    }

    .ex-lightbox,
    .ex-detail {
        width: calc(100vw - 12px);
        max-height: calc(100dvh - 12px);
    }

    .ex-detail-body {
        padding: 0 8px 4px;
    }

    .ex-lightbox-stage {
        padding: 4px 10px 10px;
    }

    .ex-lightbox-stage img {
        max-height: calc(100dvh - 220px);
    }

    .ex-lightbox-hint {
        display: none;
    }
}
