/* ------------------------------------------
   SHOWCASE BLOCK (.cc-ex) — video cards pasted into a checkout's Offer
   HTML/CSS field or a store product's Product Page Content, played through
   that page's showcase door (modules/checkout/checkout_showcase_routes.py).
   The field carries ONLY the markup; styling lives here and behaviour in
   js/checkout/checkout_showcase.js, so every page shares one copy. Theme
   tokens only. Loaded by templates/checkout/builder_checkout.html and
   templates/store/product_detail.html.
   Layout follows card count: ex-grid-1 (hero), ex-grid-2, ex-grid (3),
   ex-grid-n (4+, an opened card lifts to the top). One open card per row.
   ------------------------------------------ */
.cc-ex {
    box-sizing: border-box;
    max-width: 760px;
    margin: 0 auto;
    font-family: var(--font-sans);
    color: var(--text-primary);
    line-height: 1.5;
    text-align: left;
    -webkit-font-smoothing: antialiased;
}
.cc-ex *, .cc-ex *::before, .cc-ex *::after { box-sizing: inherit; }
.cc-ex .ex-row + .ex-row {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border-faint);
}
.cc-ex .ex-title {
    margin: 0 0 6px;
    padding: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--text-primary);
}
.cc-ex .ex-lead {
    margin: 0 0 16px;
    padding: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-muted);
}
.cc-ex .ex-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 12px;
}
.cc-ex .ex-grid.is-open { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Two cards: open, the active card takes the row and its sibling waits
   beneath at half width — a DAW screen share is unreadable at half width. */
.cc-ex .ex-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cc-ex .ex-grid-2.is-open { grid-template-columns: 1fr; }
.cc-ex .ex-grid-2.is-open .ex-card:not(.is-active) {
    width: calc(50% - 6px);
    margin: 0 auto;
}
/* One card — the hero. Full width closed and open. */
.cc-ex .ex-grid-1,
.cc-ex .ex-grid-1.is-open { grid-template-columns: 1fr; }
/* Four or more: three across; an opened card lifts to the top at full width
   instead of opening under a half-empty line. */
.cc-ex .ex-grid-n.is-open { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cc-ex .ex-grid-n.is-open .ex-card.is-active { order: -1; }
/* A row with no lead keeps the 16px a lead would have given. */
.cc-ex .ex-title + .ex-grid { margin-top: 10px; }
.cc-ex .ex-card {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    min-width: 0;
}
.cc-ex .ex-card.is-active { grid-column: 1 / -1; }
.cc-ex .ex-open {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.cc-ex .ex-open:focus-visible {
    outline: 2px solid var(--accent-on-light);
    outline-offset: 3px;
    border-radius: 10px;
}
.cc-ex .ex-thumb {
    position: relative;
    display: block;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-panel);
    border: 1px solid var(--border-faint);
}
.cc-ex .ex-thumb img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
/* The play disc: the same accent disc as the check marks in "What you get". */
.cc-ex .ex-play {
    position: absolute;
    left: 50%; top: 50%;
    width: 44px; height: 44px;
    margin: -22px 0 0 -22px;
    border-radius: 50%;
    background: var(--accent-glow);
    transition: transform 120ms ease;
}
.cc-ex .ex-play::after {
    content: "";
    position: absolute;
    left: 17px; top: 13px;
    border-style: solid;
    border-width: 9px 0 9px 14px;
    border-color: transparent transparent transparent var(--accent-on-light);
}
.cc-ex .ex-open:hover .ex-play { transform: scale(1.06); }
.cc-ex .ex-dur {
    position: absolute;
    right: 8px; bottom: 8px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--bg-card);
    border: 1px solid var(--border-faint);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.5;
}
.cc-ex .ex-name {
    display: block;
    margin: 10px 0 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}
/* A numbered part of a real sequence (checkout 92's three-part class). */
.cc-ex .ex-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--accent-glow);
    color: var(--accent-on-light);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    vertical-align: -5px;
}
.cc-ex .ex-sub {
    display: block;
    margin: 3px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-muted);
}
.cc-ex .ex-player {
    display: none;
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-panel);
    border: 1px solid var(--border-faint);
}
.cc-ex .ex-player video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
    background: var(--bg-panel);
}
.cc-ex .ex-card.is-active .ex-thumb { display: none; }
.cc-ex .ex-card.is-active .ex-player { display: block; order: -1; }
.cc-ex .ex-card.is-active .ex-name { font-size: 17px; }
/* A line that links to an order bump. */
.cc-ex .ex-more {
    margin: 18px 0 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
}
.cc-ex .ex-bump-link {
    color: var(--accent-on-light);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid var(--accent-glow);
    cursor: pointer;
}
.cc-ex .ex-bump-link:hover,
.cc-ex .ex-bump-link:focus-visible {
    border-bottom-color: var(--accent-on-light);
}
/* The ring on the order bump card the link lands on. Not scoped under
   .cc-ex: the card lives in the payment step. */
@keyframes ccExBumpRing {
    0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
    15%  { box-shadow: 0 0 0 6px var(--accent-glow); }
    100% { box-shadow: 0 0 0 0 transparent; }
}
.cc-ex-bump-flash { animation: ccExBumpRing 1600ms ease-out 2; }
@media (max-width: 640px) {
    .cc-ex .ex-grid, .cc-ex .ex-grid.is-open { grid-template-columns: 1fr; }
    .cc-ex .ex-grid-2.is-open .ex-card:not(.is-active) { width: 100%; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .cc-ex .ex-play { transition: none; }
    .cc-ex-bump-flash { animation: none; }
}
