/*
 * SC-030-FZ — "Despre noi" as a visual story (template imok/about/story.phtml, CMS blocks imok_about_*).
 * Loaded only on a CMS page whose content uses the imok_about/story block (layout imok_about.xml, handle
 * imok_about_story, body class imok-story-page). Our own markup and CSS, scoped under .imok-story, using only the
 * tokens of imok-theme.css (docs/design/theme-guide.md).
 *
 * Specificity: rwd styles.css styles ".cms-page-view .std p / li" (Georgia italic 14px) and the legacy custom.css
 * (printed after every layout CSS) styles "body.cms-despre-noi .std …" — hence the "html body" prefix, at least two
 * classes per text rule, and !important only where the legacy rules are themselves stronger (old text block).
 */

/* ---------- base ---------- */

html body .imok-story {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    color: var(--c-ink);
}

html body .imok-story,
html body .imok-story * {
    box-sizing: border-box;
}

html body.imok-story-page .imok-story p,
html body.imok-story-page .imok-story li,
html body.imok-story-page .imok-story span,
html body.imok-story-page .imok-story h1,
html body.imok-story-page .imok-story h2,
html body.imok-story-page .imok-story h3 {
    font-style: normal;
    text-transform: none;
}

html body.imok-story-page .imok-story p,
html body.imok-story-page .imok-story li {
    margin: 0;
    color: var(--c-text);
    font-size: 15px;
    line-height: 1.6;
}

html body .imok-story img {
    display: block;
    max-width: 100%;
}

html body .imok-story a:focus-visible,
html body .imok-story summary:focus-visible {
    outline: 2px solid var(--c-orange);
    outline-offset: 2px;
}

/* the old stock-photo slider, should it still be rendered on this page by anything else */
html body.imok-story-page .col-main > .std > [id^="rev_slider"],
html body.imok-story-page .col-main > .std > .forcefullwidth_wrapper_tp_banner {
    display: none !important;
}

/* ---------- hero ---------- */

html body .imok-story .st-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 480px;
    margin: var(--s-5) 0 0;
    overflow: hidden;
    border-radius: var(--r-lg);
    background: var(--c-dark);
}

html body .imok-story .st-hero .st-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: cover;
}

html body .imok-story .st-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .05) 0%, rgba(0, 0, 0, .25) 45%, rgba(0, 0, 0, .78) 100%);
}

html body .imok-story .st-hero .st-hero-in {
    position: relative;
    z-index: 1;
    max-width: 760px;
    padding: 40px var(--s-8);
}

html body.imok-story-page .imok-story .st-hero .st-eye {
    margin: 0 0 10px;
    color: var(--c-orange);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .14em;
    text-transform: uppercase;
}

html body.imok-story-page .imok-story .st-hero h1 {
    margin: 0 0 14px;
    padding: 0;
    border: 0;
    color: var(--c-white);
    font-size: 46px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.02em;
}

html body.imok-story-page .imok-story .st-hero .st-lead {
    max-width: 620px;
    color: var(--c-white);
    font-size: 17px;
    line-height: 1.55;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .6);
}

/* ---------- key numbers ---------- */

html body .imok-story .st-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--s-4);
    margin: var(--s-6) 0 var(--s-2);
}

html body .imok-story .st-stat {
    padding: 18px var(--s-5);
    border: 1px solid var(--c-line);
    border-radius: var(--r-card);
    background: var(--c-white);
}

html body.imok-story-page .imok-story .st-stat b {
    display: block;
    color: var(--c-orange);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
}

html body.imok-story-page .imok-story .st-stat span {
    color: var(--c-text);
    font-size: 14px;
    line-height: 1.5;
}

/* ---------- section titles ---------- */

html body.imok-story-page .imok-story .st-h2 {
    margin: 48px 0 6px;
    color: var(--c-ink);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.02em;
}

html body.imok-story-page .imok-story .st-sub {
    margin: 0 0 26px;
    color: var(--c-muted);
    font-size: 15px;
}

/* ---------- timeline: alternating text card / photo, line in the middle ---------- */

html body .imok-story .st-tl {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

html body .imok-story .st-tl::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: linear-gradient(var(--c-orange), #f6c3a4);
    transform: translateX(-1px);
}

html body.imok-story-page .imok-story .st-tl .st-it {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-9);
    align-items: center;
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
}

html body .imok-story .st-tl .st-it::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    width: 18px;
    height: 18px;
    border: 4px solid var(--c-orange);
    border-radius: 50%;
    background: var(--c-white);
    transform: translate(-50%, -50%);
}

html body .imok-story .st-tl .st-it:nth-child(even) .st-txt {
    order: 2;
}

html body .imok-story .st-tl .st-it:nth-child(even) .st-ph {
    order: 1;
}

html body .imok-story .st-txt {
    padding: 22px var(--s-6);
    border: 1px solid var(--c-line);
    border-radius: var(--r-card);
    background: var(--c-white);
}

html body.imok-story-page .imok-story .st-txt .st-yr {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px var(--s-3);
    border-radius: var(--r-pill);
    background: var(--c-orange);
    color: var(--c-white);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: .02em;
}

html body.imok-story-page .imok-story .st-txt h3 {
    margin: 0 0 var(--s-2);
    color: var(--c-ink);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

html body .imok-story .st-ph {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid var(--c-line);
    border-radius: var(--r-card);
    background: var(--c-cream);
}

html body .imok-story .st-ph img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* a step without a photo: small round icon next to the line, never an empty box */
html body .imok-story .st-ph.st-ph--icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    aspect-ratio: auto;
    border-color: var(--c-cream-line);
    border-radius: 50%;
}

html body .imok-story .st-tl .st-it:nth-child(odd) .st-ph--icon {
    justify-self: start;
    margin-left: 40px;
}

html body .imok-story .st-tl .st-it:nth-child(even) .st-ph--icon {
    justify-self: end;
    margin-right: 40px;
}

/* ---------- "Ce ne definește" tiles ---------- */

html body .imok-story .st-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-5);
}

html body .imok-story .st-tile {
    padding: var(--s-6);
    border-radius: var(--r-card);
    background: var(--c-cream);
}

html body .imok-story .st-tile svg {
    display: block;
    margin-bottom: var(--s-3);
}

html body.imok-story-page .imok-story .st-tile h3 {
    margin: 0 0 var(--s-2);
    color: var(--c-ink);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

/* ---------- gallery: first photo large, the rest beside it ---------- */

html body .imok-story .st-gal {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-auto-rows: 200px;
    gap: var(--s-3);
}

html body .imok-story .st-gal > * {
    margin: 0;
    overflow: hidden;
    border-radius: var(--r-card);
    background: var(--c-cream);
}

html body .imok-story .st-gal > :first-child {
    grid-row: span 2;
}

/* four photos: the last one fills the second row beside the large one */
html body .imok-story .st-gal > :nth-child(4):last-child {
    grid-column: span 2;
}

html body .imok-story .st-gal img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

html body .imok-story .st-gal > :hover img {
    transform: scale(1.04);
}

/* ---------- "Vino să ne vezi" ---------- */

html body .imok-story .st-visit {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: var(--s-6);
    align-items: stretch;
    margin: 48px 0 var(--s-5);
}

html body .imok-story .st-visit-card {
    padding: 30px;
    border-radius: var(--r-lg);
    background: var(--c-ink);
    color: var(--c-dark-text);
}

html body.imok-story-page .imok-story .st-visit-card h2 {
    margin: 0 0 14px;
    color: var(--c-white);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.02em;
}

html body .imok-story .st-visit-rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

html body.imok-story-page .imok-story .st-visit-rows li {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    color: var(--c-dark-text);
    font-size: 15px;
    line-height: 1.5;
    list-style: none;
}

html body .imok-story .st-visit-rows svg {
    flex: 0 0 auto;
    margin-top: 1px;
}

html body.imok-story-page .imok-story .st-visit-rows span {
    color: var(--c-dark-text);
}

html body.imok-story-page .imok-story .st-visit-rows b,
html body.imok-story-page .imok-story .st-visit-rows a {
    color: var(--c-white);
    text-decoration: none;
}

html body.imok-story-page .imok-story .st-visit-rows a:hover {
    color: var(--c-orange);
}

html body .imok-story .st-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

html body.imok-story-page .imok-story .st-btn {
    display: inline-flex;
    align-items: center;
    height: 46px;
    padding: 0 var(--s-6);
    border: 1.5px solid var(--c-orange);
    border-radius: var(--r-pill);
    background: var(--c-orange);
    color: var(--c-white);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

html body.imok-story-page .imok-story .st-btn:hover {
    border-color: var(--c-orange-dark);
    background: var(--c-orange-dark);
    color: var(--c-white);
}

html body.imok-story-page .imok-story .st-btn.st-btn--sec {
    border-color: var(--c-white);
    background: transparent;
    color: var(--c-white);
}

html body.imok-story-page .imok-story .st-btn.st-btn--sec:hover {
    background: var(--c-white);
    color: var(--c-ink);
}

html body .imok-story .st-visit-ph {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 280px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid var(--c-line);
    border-radius: var(--r-lg);
    background: var(--c-cream);
}

html body .imok-story .st-visit-ph img {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: cover;
}

html body.imok-story-page .imok-story .st-visit-ph .st-visit-badge {
    position: relative;
    z-index: 1;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--c-white);
    color: var(--c-ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

/* ---------- "Povestea completă": the page's original text (SEO) ---------- */

html body .imok-story .st-more {
    margin: var(--s-2) 0 40px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-card);
    background: var(--c-white);
}

html body .imok-story .st-more summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 0 var(--s-5);
    color: var(--c-ink);
    font-size: 16px;
    font-weight: 700;
    list-style: none;
    cursor: pointer;
}

html body .imok-story .st-more summary::-webkit-details-marker {
    display: none;
}

html body .imok-story .st-more summary::after {
    content: "+";
    color: var(--c-orange);
    font-size: 22px;
    line-height: 1;
}

html body .imok-story .st-more[open] summary::after {
    content: "−";
}

html body .imok-story .st-more-body {
    padding: 0 var(--s-5) var(--s-5);
}

/* the old template's side heading, banner and two-column rows are not part of the text */
html body .imok-story .st-more-body .customSidebar,
html body .imok-story .st-more-body [id^="rev_slider"],
html body .imok-story .st-more-body .rev_slider_wrapper,
html body .imok-story .st-more-body .forcefullwidth_wrapper_tp_banner {
    display: none !important;
}

html body .imok-story .st-more-body .customMain {
    width: 100% !important;
    padding: 0 !important;
}

html body .imok-story .st-more-body .row {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
}

html body .imok-story .st-more-body .row::before {
    display: none !important;
}

html body.imok-story-page .imok-story .st-more-body p,
html body.imok-story-page .imok-story .st-more-body li {
    margin: 0 0 var(--s-3) !important;
    color: var(--c-text) !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 1.65 !important;
}

html body.imok-story-page .imok-story .st-more-body h2,
html body.imok-story-page .imok-story .st-more-body h3 {
    margin: var(--s-4) 0 var(--s-2) !important;
    color: var(--c-ink) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
}

/* ---------- tablet / phone (≤ 900px): one column, timeline line on the left ---------- */

@media (max-width: 900px) {
    html body .imok-story .st-hero {
        min-height: 420px;
    }

    html body .imok-story .st-hero .st-hero-in {
        padding: 26px 22px;
    }

    html body.imok-story-page .imok-story .st-hero h1 {
        font-size: 32px;
        line-height: 1.1;
    }

    html body .imok-story .st-stats {
        grid-template-columns: 1fr 1fr;
        gap: var(--s-3);
    }

    html body .imok-story .st-tl::before {
        left: 9px;
    }

    html body.imok-story-page .imok-story .st-tl .st-it {
        grid-template-columns: 1fr;
        gap: var(--s-3);
        padding-left: 34px;
    }

    html body .imok-story .st-tl .st-it::before {
        top: 28px;
        left: 9px;
        transform: translate(-50%, 0);
    }

    html body .imok-story .st-tl .st-it:nth-child(even) .st-txt {
        order: 1;
    }

    html body .imok-story .st-tl .st-it:nth-child(even) .st-ph {
        order: 2;
    }

    html body .imok-story .st-tl .st-it:nth-child(odd) .st-ph--icon,
    html body .imok-story .st-tl .st-it:nth-child(even) .st-ph--icon {
        justify-self: start;
        margin: 0;
    }

    html body .imok-story .st-tiles {
        grid-template-columns: 1fr;
        gap: var(--s-3);
    }

    html body .imok-story .st-gal {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 160px;
    }

    html body .imok-story .st-gal > :first-child {
        grid-column: span 2;
        grid-row: auto;
    }

    html body .imok-story .st-visit {
        grid-template-columns: 1fr;
    }
}

/* ---------- phone (≤ 700px) ---------- */

@media (max-width: 700px) {
    html body .imok-story .st-hero {
        min-height: 380px;
        margin-top: var(--s-3);
    }

    html body.imok-story-page .imok-story .st-hero h1 {
        font-size: 28px;
        line-height: 1.15;
    }

    html body.imok-story-page .imok-story .st-hero .st-lead {
        font-size: 15px;
    }

    html body .imok-story .st-stat {
        padding: 14px var(--s-4);
    }

    html body.imok-story-page .imok-story .st-stat b {
        font-size: 24px;
    }

    html body.imok-story-page .imok-story .st-h2 {
        margin-top: 40px;
        font-size: 24px;
        line-height: 1.2;
    }

    html body .imok-story .st-txt {
        padding: 18px var(--s-4);
    }

    html body.imok-story-page .imok-story .st-txt h3 {
        font-size: 18px;
    }

    html body .imok-story .st-gal {
        grid-auto-rows: 130px;
        gap: var(--s-2);
    }

    html body .imok-story .st-visit-card {
        padding: var(--s-6) var(--s-5);
    }

    html body.imok-story-page .imok-story .st-visit-card h2 {
        font-size: 24px;
    }

    html body .imok-story .st-visit-ph {
        min-height: 220px;
    }
}

/* ---------- motion off on request (guide §8) ---------- */

@media (prefers-reduced-motion: reduce) {
    html body .imok-story .st-gal img,
    html body.imok-story-page .imok-story .st-btn {
        transition: none;
    }

    html body .imok-story .st-gal > :hover img {
        transform: none;
    }
}

/* ==========================================================================
 * SC-034-FZ — a photo gallery per timeline step: thumbnail strip + lightbox (js/imok/imok-story.js).
 * The strip reuses the class .st-gal with data-gal="<slug>"; every rule below carries [data-gal] so it beats the
 * bottom "Din galeria noastră" grid rules above (big first photo, 200px rows) without touching them.
 * ========================================================================== */

/* ---------- thumbnail strip: 4 in a row, "+N" on the 4th when there are more ---------- */

html body .imok-story .st-gal[data-gal] {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: auto;
    gap: var(--s-2);
    margin: var(--s-4) 0 0;
}

html body .imok-story .st-gal[data-gal] > a:nth-child(n) {
    position: relative;
    display: block;
    grid-row: auto;
    grid-column: auto;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    background: var(--c-cream);
    cursor: zoom-in;
}

html body .imok-story .st-gal[data-gal] > a:nth-child(n+5) {
    display: none;
}

html body .imok-story .st-gal[data-gal] > a[data-more]::after {
    content: attr(data-more);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .55);
    color: var(--c-white);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .02em;
}

/* a step with several galleries (2016): a small label above each strip */
html body.imok-story-page .imok-story .st-txt .st-gal-h {
    margin: var(--s-4) 0 0;
    color: var(--c-muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .02em;
}

html body .imok-story .st-gal-h + .st-gal[data-gal] {
    margin-top: 6px;
}

/* portrait podium photo in a landscape frame: keep the cups and faces (upper part) in view */
html body .imok-story .st-ph.st-ph--top img {
    object-position: 50% 20%;
}

/* hero background = the 2026 podium (portrait): keep the cups and faces in the wide frame */
html body .imok-story .st-hero .st-hero-bg.st-hero-bg--top {
    object-position: 50% 22%;
}

/* ---------- lightbox (appended to <body>, outside .imok-story) ---------- */

html.st-lb-open,
html.st-lb-open body {
    overflow: hidden;
}

html body .st-lb {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 76px;
    background: rgba(12, 12, 12, .94);
    box-sizing: border-box;
}

html body .st-lb[hidden] {
    display: none;
}

html body .st-lb .st-lb-fig {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
}

html body .st-lb .st-lb-img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 150px);
    border-radius: 6px;
    object-fit: contain;
    transition: opacity .2s ease;
}

html body .st-lb.is-loading .st-lb-img {
    opacity: .35;
}

html body.imok-story-page .st-lb .st-lb-cap {
    margin: 12px 0 0;
    color: var(--c-white, #fff);
    font-size: 15px;
    font-style: normal;
    line-height: 1.45;
    text-align: center;
}

html body.imok-story-page .st-lb .st-lb-count {
    position: absolute;
    top: 22px;
    left: 22px;
    margin: 0;
    color: rgba(255, 255, 255, .8);
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    line-height: 1;
}

html body.imok-story-page .st-lb .st-lb-btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    min-width: 0;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: var(--c-white, #fff);
    font-family: inherit;
    font-size: 30px;
    font-weight: 400;
    line-height: 1;
    text-transform: none;
    cursor: pointer;
    transition: background-color .2s ease;
}

html body.imok-story-page .st-lb .st-lb-btn:hover {
    background: var(--c-orange, #ff701f);
}

html body.imok-story-page .st-lb .st-lb-btn:focus-visible {
    outline: 2px solid var(--c-orange, #ff701f);
    outline-offset: 2px;
}

html body.imok-story-page .st-lb .st-lb-close {
    top: 12px;
    right: 12px;
}

html body.imok-story-page .st-lb .st-lb-prev,
html body.imok-story-page .st-lb .st-lb-next {
    top: 50%;
    transform: translateY(-50%);
}

html body.imok-story-page .st-lb .st-lb-prev {
    left: 14px;
}

html body.imok-story-page .st-lb .st-lb-next {
    right: 14px;
}

html body.imok-story-page .st-lb.is-single .st-lb-prev,
html body.imok-story-page .st-lb.is-single .st-lb-next {
    display: none;
}

/* phone: small thumbnails, photo full width, prev/next at the bottom (thumb reach) */
@media (max-width: 700px) {
    html body .imok-story .st-gal[data-gal] {
        gap: 6px;
        margin-top: var(--s-3);
    }

    html body .imok-story .st-gal[data-gal] > a[data-more]::after {
        font-size: 15px;
    }

    html body .st-lb {
        padding: 64px 8px 84px;
    }

    html body .st-lb .st-lb-img {
        max-height: calc(100vh - 200px);
    }

    html body.imok-story-page .st-lb .st-lb-prev,
    html body.imok-story-page .st-lb .st-lb-next {
        top: auto;
        bottom: 16px;
        transform: none;
    }

    html body.imok-story-page .st-lb .st-lb-prev {
        left: calc(50% - 60px);
    }

    html body.imok-story-page .st-lb .st-lb-next {
        right: calc(50% - 60px);
    }
}

@media (prefers-reduced-motion: reduce) {
    html body .st-lb .st-lb-img,
    html body.imok-story-page .st-lb .st-lb-btn {
        transition: none;
    }
}

/* ==========================================================================
 * SC-034-FZ round 2 — split hero (prototype docs/design/story-proto/hero-split-*.png, hero-split-proto.cjs).
 * The 2026 podium photo is portrait (926×1279): as a full-width background only shirts and medals showed. Now
 * ≥ 900px: text column left (dark), photo column right, cover-cropped around --hero-focus; < 900px: the photo on top
 * (1 : 1.05), the text below. Same CMS markup (section.st-hero > img.st-hero-bg + .st-hero-in), no overlay.
 * --hero-focus (default 50% 12%, 50% 10% on phones) can be set inline on .st-hero by the admin, e.g.
 * <section class="st-hero" style="--hero-focus: 50% 0%">. The .st-hero-bg--top modifier (rule above) is kept for
 * the markup; in the split layout its focus comes from --hero-focus too. .st-ph--top (timeline photos) is untouched.
 * ========================================================================== */

html body .imok-story .st-hero {
    --hero-focus: 50% 12%;
}

@media (min-width: 900px) {
    html body .imok-story .st-hero {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
        grid-template-rows: auto;
        align-items: center;
        min-height: clamp(420px, 40vw, 600px);
    }

    html body .imok-story .st-hero::after {
        display: none;
    }

    /* absolutely placed in its grid column, so the portrait photo never sets the hero's height */
    html body .imok-story .st-hero .st-hero-bg,
    html body .imok-story .st-hero .st-hero-bg.st-hero-bg--top {
        position: absolute;
        inset: 0;
        grid-column: 2;
        grid-row: 1;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: var(--hero-focus, 50% 12%);
    }

    html body .imok-story .st-hero .st-hero-in {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
        max-width: none;
        padding: 48px;
    }

    html body.imok-story-page .imok-story .st-hero .st-lead {
        text-shadow: none;
    }
}

@media (max-width: 899.98px) {
    html body .imok-story .st-hero {
        --hero-focus: 50% 10%;
        display: block;
        min-height: 0;
    }

    html body .imok-story .st-hero::after {
        display: none;
    }

    html body .imok-story .st-hero .st-hero-bg,
    html body .imok-story .st-hero .st-hero-bg.st-hero-bg--top {
        position: relative;
        inset: auto;
        display: block;
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1.05;
        object-fit: cover;
        object-position: var(--hero-focus, 50% 10%);
    }

    html body .imok-story .st-hero .st-hero-in {
        max-width: none;
        padding: 24px 20px 28px;
    }

    html body.imok-story-page .imok-story .st-hero .st-lead {
        text-shadow: none;
    }
}

/* ==========================================================================
 * SC-045-FZ — archive slideshow: "Din galeria noastră" (CMS block imok_about_gallery) as an autoplay masonry
 * slideshow (prototype docs/design/gallery-merge/index.html). js/imok/imok-story.js groups the links of .st-show
 * into pages of 4 (.st-show-page), renders only the shown page and its neighbours (.is-near) and fades the shown
 * page (.is-on) in tile by tile. Same masonry as the old .st-gal grid above (which the timeline strips still use).
 * Without JS (.st-show without .is-ready): the first 4 photos in that masonry, the rest and the buttons hidden.
 * ========================================================================== */

/* ---------- heading row: title left, prev/next bottom-right ---------- */

html body .imok-story .st-show-hd {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s-4);
    margin: 48px 0 var(--s-6);
    scroll-margin-top: var(--s-4);
}

html body.imok-story-page .imok-story .st-show-hd .st-h2 {
    margin: 0 0 6px;
}

html body.imok-story-page .imok-story .st-show-hd .st-sub {
    margin: 0;
}

html body .imok-story .st-show-nav {
    display: none;
    flex: 0 0 auto;
    gap: var(--s-2);
}

html body .imok-story .st-show-hd.is-ready .st-show-nav {
    display: flex;
}

html body .imok-story .st-show-hd.is-single .st-show-nav {
    display: none;
}

html body .imok-story .st-show-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--c-line);
    border-radius: var(--r-pill);
    background: var(--c-white);
    color: var(--c-ink);
    box-shadow: none;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease;
}

html body .imok-story .st-show-nav button:hover {
    border-color: var(--c-orange);
    background: var(--c-white);
    color: var(--c-orange);
}

html body .imok-story .st-show-nav button:focus-visible {
    outline: 2px solid var(--c-orange);
    outline-offset: 2px;
}

html body .imok-story .st-show-nav svg {
    display: block;
}

/* ---------- tiles (no JS and slideshow alike) ---------- */

html body .imok-story .st-show {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-auto-rows: 200px;
    gap: var(--s-3);
}

html body .imok-story .st-show a {
    display: block;
    margin: 0;
    overflow: hidden;
    border-radius: var(--r-card);
    background: var(--c-cream);
    cursor: zoom-in;
}

html body .imok-story .st-show img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
    -webkit-user-drag: none;
}

html body .imok-story .st-show a:hover img {
    transform: scale(1.04);
}

/* no JS: today's masonry with the first 4 photos */
html body .imok-story .st-show:not(.is-ready) > a:first-child {
    grid-row: span 2;
}

html body .imok-story .st-show:not(.is-ready) > a:nth-child(4) {
    grid-column: span 2;
}

html body .imok-story .st-show:not(.is-ready) > a:nth-child(n+5) {
    display: none;
}

/* ---------- slideshow: pages stacked on a fixed-height stage (2 rows + gap), nothing jumps ---------- */

html body .imok-story .st-show.is-ready {
    display: block;
    position: relative;
    height: calc(400px + var(--s-3));
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
}

html body .imok-story .st-show-page {
    position: absolute;
    inset: 0;
    display: none;
    grid-template-columns: 2fr 1fr 1fr;
    grid-auto-rows: 200px;
    gap: var(--s-3);
    pointer-events: none;
    /* hidden pages: not focusable; the switch waits for the fade-out to end */
    visibility: hidden;
    transition: visibility 0s linear .9s;
}

html body .imok-story .st-show-page.is-near {
    display: grid;
}

html body .imok-story .st-show-page.is-on {
    z-index: 1;
    pointer-events: auto;
    visibility: visible;
    transition-delay: 0s;
}

html body .imok-story .st-show-page > a:first-child {
    grid-row: span 2;
}

html body .imok-story .st-show-page > a:nth-child(4):last-child {
    grid-column: span 2;
}

/* transition: the shown page fades in tile by tile, the old one fades out — no sliding */
html body .imok-story .st-show-page > a {
    opacity: 0;
    transform: scale(1.03);
    transition: opacity .9s ease, transform 1.4s cubic-bezier(.2, .7, .2, 1);
}

html body .imok-story .st-show-page.is-on > a {
    opacity: 1;
    transform: none;
}

html body .imok-story .st-show-page.is-on > a:nth-child(2) {
    transition-delay: .08s;
}

html body .imok-story .st-show-page.is-on > a:nth-child(3) {
    transition-delay: .16s;
}

html body .imok-story .st-show-page.is-on > a:nth-child(4) {
    transition-delay: .24s;
}

/* thin progress line: time left to the next change (width animated by the JS) */
html body .imok-story .st-show-prog {
    height: 3px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: var(--r-pill);
    background: var(--c-line);
}

html body .imok-story .st-show-prog i {
    display: block;
    width: 0;
    height: 100%;
    background: var(--c-orange);
}

html body .imok-story .st-show-prog i.is-run {
    width: 100%;
    transition-property: width;
    transition-timing-function: linear;
}

html body .imok-story .st-show.is-single + .st-show-prog {
    display: none;
}

/* desktop: the sticky header must not cover the heading when /despre-noi#galerie is opened */
@media (min-width: 701px) {
    html body .imok-story .st-show-hd {
        scroll-margin-top: 180px;
    }
}

/* ---------- tablet (≤ 900px): 2 columns, first photo full width — 3 rows of 160 ---------- */

@media (max-width: 900px) {
    html body .imok-story .st-show,
    html body .imok-story .st-show-page {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 160px;
    }

    html body .imok-story .st-show:not(.is-ready) > a:first-child,
    html body .imok-story .st-show-page > a:first-child {
        grid-column: span 2;
        grid-row: auto;
    }

    html body .imok-story .st-show.is-ready {
        height: calc(480px + 2 * var(--s-3));
    }
}

/* ---------- phone (≤ 700px): rows of 130, smaller gap and buttons ---------- */

@media (max-width: 700px) {
    html body .imok-story .st-show-hd {
        gap: var(--s-3);
        margin-top: 40px;
    }

    html body .imok-story .st-show-nav button {
        width: 40px;
        height: 40px;
    }

    html body .imok-story .st-show,
    html body .imok-story .st-show-page {
        grid-auto-rows: 130px;
        gap: var(--s-2);
    }

    html body .imok-story .st-show.is-ready {
        height: calc(390px + 2 * var(--s-2));
    }
}

/* ---------- motion off on request: no autoplay (JS), no scale, plain fade ---------- */

@media (prefers-reduced-motion: reduce) {
    html body .imok-story .st-show-page > a,
    html body .imok-story .st-show-page.is-on > a:nth-child(n) {
        transform: none;
        transition: opacity .3s ease;
        transition-delay: 0s;
    }

    html body .imok-story .st-show img,
    html body .imok-story .st-show-nav button {
        transition: none;
    }

    html body .imok-story .st-show a:hover img {
        transform: none;
    }

    html body .imok-story .st-show-prog {
        display: none;
    }
}
