/* "What the wizard builds" cycling video-poster showcase.
   Used on the workouts dashboard and the public homepage. Light poster cards
   (matching the program poster page) so the exercise illustrations render on the
   light background they're drawn for; a border + shadow separates each card from
   any page background. */

.wizard-builds {
    max-width: 900px;
    margin: 0 auto;
    padding: 0.5rem 0;
}

.wizard-builds-head {
    text-align: center;
    margin-bottom: 1rem;
}
.wizard-builds-title {
    font-weight: 700;
    color: inherit;
    margin: 0;
}
.wizard-builds-sub {
    margin: 0.25rem 0 0;
    opacity: 0.7;
    font-size: 0.95rem;
}

/* Two cards side by side. Dip-to-transparent crossfade between pairs. */
.wizard-builds-stage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    transition: opacity 0.45s ease;
}
.wizard-builds-stage.wb-fading {
    opacity: 0;
}

/* No-JS fallback: show the first two cards as stills. */
.wb-card {
    display: none;
}
.wb-card:nth-child(-n + 2) {
    display: flex;
}

/* JS-managed visibility (root gets .wb-ready once the script runs). */
.wizard-builds.wb-ready .wb-card {
    display: none;
}
.wizard-builds.wb-ready .wb-card.wb-active {
    display: flex;
}

.wb-card {
    position: relative;
    flex-direction: column;
    aspect-ratio: 4 / 5;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    overflow: hidden;
    padding: 0.7rem 0.7rem 0.5rem;
    text-decoration: none;
    color: #14261c;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wb-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.2);
}

.wb-card-title {
    font-weight: 700;
    font-size: clamp(0.85rem, 2.4vw, 1.05rem);
    line-height: 1.15;
    text-align: center;
    margin-bottom: 0.5rem;
    color: #14261c;
    /* keep the title to two lines so cards stay uniform */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wb-grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 0.4rem;
    min-height: 0;
}
.wb-tile {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 8px;
    overflow: hidden;
    min-height: 0;
}
.wb-tile-img {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    background: #f3f4f6;
}
.wb-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.wb-tile-cap {
    flex: 0 0 auto;
    padding: 0.25rem 0.4rem 0.3rem;
    line-height: 1.15;
}
.wb-tile-name {
    font-weight: 600;
    font-size: 0.72rem;
    color: #14261c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wb-tile-planned {
    font-size: 0.68rem;
    color: #5b6b60;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wb-watermark {
    position: absolute;
    right: 0.7rem;
    bottom: 0.45rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: rgba(20, 38, 28, 0.55);
    pointer-events: none;
}

/* Stack on small screens (the two active cards stack vertically). */
@media (max-width: 640px) {
    .wizard-builds-stage {
        grid-template-columns: 1fr;
    }
    .wb-card {
        aspect-ratio: 5 / 4;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wizard-builds-stage {
        transition: none;
    }
    .wb-card:hover {
        transform: none;
    }
}

/* ── Poster variant (homepage): the full shareable poster look, with write-in
   set/rep lines. One poster at a time (data-visible="1"), bigger, with a real
   two-column grid of horizontal image-plus-write-in tiles. ── */
.wb-variant-poster {
    max-width: 1100px;
}
/* Two posters side by side (inherits the base 2-column stage); smaller, but
   more for the visitor to look at. */
.wb-variant-poster .wb-card {
    aspect-ratio: auto; /* height follows content (image + write-in lines) */
    padding: 0.8rem 0.8rem 0.6rem;
}
.wb-variant-poster .wb-card-title {
    font-size: clamp(1rem, 2.6vw, 1.3rem);
}
.wb-variant-poster .wb-grid {
    grid-template-columns: 1fr 1fr; /* two tiles per row, like the poster */
    grid-auto-rows: auto;
    gap: 0.6rem;
}
.wb-variant-poster .wb-tile {
    flex-direction: row; /* image left, write-in body right */
    align-items: stretch;
    border: 1.5px solid #d1d5db;
    gap: 0.55rem;
    padding: 0.45rem;
}
.wb-variant-poster .wb-tile-img {
    flex: 0 0 44%;
    aspect-ratio: 1 / 1;
    border-radius: 5px;
}
.wb-variant-poster .wb-tile-cap {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 0.1rem 0.1rem 0.1rem 0;
}
.wb-variant-poster .wb-tile-name {
    font-size: 0.9rem;
    font-weight: 800;
    white-space: normal;
    line-height: 1.15;
    margin-bottom: 2px;
}
.wb-variant-poster .wb-tile-planned {
    font-size: 0.78rem;
    color: #4b5563;
    white-space: normal;
    margin-bottom: 4px;
}
.wb-setlines {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.wb-setline {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-size: 0.72rem;
    color: #374151;
}
.wb-setlabel {
    font-weight: 700;
    min-width: 32px;
}
.wb-blank {
    flex: 1;
    border-bottom: 1px solid #9ca3af;
    min-height: 12px;
}
.wb-x {
    font-weight: 700;
    color: #9ca3af;
}
@media (max-width: 640px) {
    .wb-variant-poster .wb-grid {
        grid-template-columns: 1fr; /* single column of tiles on phones */
    }
}
