/* =========================================================
   STORY DETAIL — SHARED
   ========================================================= */

.story-page {
    background: var(--color-bg-light);
    color: var(--color-text-dark);
}

.story-kicker {
    margin: 0 0 clamp(1.4rem, 2.5vw, 2.2rem);
    color: rgba(27, 23, 19, 0.62);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    line-height: 1.6;
    text-transform: uppercase;
}

.story-kicker span {
    margin: 0 0.35rem;
}


/* Breadcrumb */

.story-breadcrumb {
    margin: 0 0 clamp(1.5rem, 2.5vw, 2.25rem);
}

.story-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;

    margin: 0;
    padding: 0;
    list-style: none;
}

.story-breadcrumb li {
    color: rgba(27, 23, 19, 0.64);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    line-height: 1.5;
    text-transform: uppercase;
}

.story-breadcrumb li[aria-current="page"] {
    color: rgba(27, 23, 19, 0.72);
}

.story-breadcrumb a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.story-breadcrumb a:hover,
.story-breadcrumb a:focus-visible {
    color: var(--color-text-dark);
    border-bottom-color: currentColor;
}


/* =========================================================
   OPENING
   ========================================================= */

.story-opening {
    background: var(--color-bg-white);
}

.story-opening-inner {
    width: min(92%, 1440px);
    margin: 0 auto;

    display: grid;
    grid-template-columns:
        minmax(0, 0.96fr)
        minmax(320px, 0.72fr);
    gap: clamp(3rem, 7vw, 7rem);
    align-items: center;

    padding:
        clamp(4rem, 6vw, 6rem)
        0
        clamp(4.5rem, 7vw, 7rem);
}

.story-opening-copy {
    max-width: 47rem;
    padding-left: clamp(0rem, 3vw, 3rem);
}

.story-opening h1 {
    max-width: 10ch;
    margin: 0;
    font-size: clamp(3.5rem, 6.3vw, 6.7rem);
    font-weight: 400;
    line-height: 0.96;
    letter-spacing: -0.045em;
}

.story-opening-subtitle {
    max-width: 18ch;
    margin: clamp(1.6rem, 3vw, 2.5rem) 0 0;
    font-family: var(--font-heading);
    font-size: clamp(1.7rem, 2.8vw, 2.6rem);
    font-style: italic;
    line-height: 1.25;
}

.story-opening-intro {
    max-width: 38rem;
    margin: clamp(1.8rem, 3vw, 2.6rem) 0 0;
    color: var(--color-text-medium);
    font-size: clamp(1rem, 1.25vw, 1.08rem);
    line-height: 1.82;
}

.story-opening-image {
    width: min(100%, 520px);
    margin: 0 0 0 auto;
}

.story-opening-image picture,
.story-opening-image img {
    display: block;
    width: 100%;
}

.story-opening-image img {
    height: auto;
}


/* =========================================================
   STORY BODY — BLOCK SYSTEM
   ========================================================= */

.story-body {
    background: var(--color-bg-light);
}

.story-block {
    margin: 0;
}

.story-block figure {
    margin: 0;
}

.story-block picture,
.story-block img {
    display: block;
    width: 100%;
}

.story-block img {
    height: auto;
}

.story-block figcaption {
    margin-top: 0.75rem;
    color: var(--color-text-medium);
    font-size: 0.72rem;
    line-height: 1.6;
}


/* Text */

.story-block--text {
    padding:
        clamp(3.5rem, 6vw, 5.5rem)
        0;
}

.story-block-text-inner {
    width: min(84%, 760px);
    margin: 0 auto;
}

.story-block--text:nth-child(4n + 1) .story-block-text-inner {
    margin-left: max(8%, calc((100% - 1180px) / 2));
}

.story-block--text:nth-child(4n + 3) .story-block-text-inner {
    margin-right: max(8%, calc((100% - 1180px) / 2));
}

.story-block--text p {
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(1.3rem, 1.8vw, 1.75rem);
    line-height: 1.55;
}


/* Image pair */

.story-block--pair {
    width: min(90%, 1280px);
    margin: 0 auto;
    padding:
        clamp(1.5rem, 3vw, 3rem)
        0
        clamp(4.5rem, 7vw, 7rem);
}

.story-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.5rem, 3vw, 3rem);
    align-items: start;
}

.story-pair figure:nth-child(2) {
    margin-top: clamp(2.5rem, 5vw, 4.5rem);
}


/* Wide image */

.story-block--wide {
    width: min(94%, 1500px);
    margin: 0 auto;
    padding:
        clamp(1.5rem, 3vw, 3rem)
        0
        clamp(4.5rem, 7vw, 7rem);
}


/* Single image */

.story-block--image {
    width: min(88%, 1180px);
    margin: 0 auto;
    padding:
        clamp(1.5rem, 3vw, 3rem)
        0
        clamp(4.5rem, 7vw, 7rem);
}

.story-block--image figure {
    width: min(58%, 620px);
}

.story-block--image-left figure {
    margin-right: auto;
}

.story-block--image-right figure {
    margin-left: auto;
}


/* Quote */

.story-block--quote {
    margin:
        clamp(2rem, 4vw, 4rem)
        0
        clamp(7rem, 11vw, 11rem);
    padding:
        clamp(4rem, 6vw, 6rem)
        0;

    background: var(--color-bg-dark);
    color: var(--color-text-light);
}

.story-block--quote blockquote {
    width: min(82%, 980px);
    margin: 0 auto;
}

.story-block--quote p {
    max-width: 28ch;
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 3vw, 3rem);
    font-style: italic;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.story-block--quote footer {
    margin-top: 2rem;
    color: rgba(245, 239, 232, 0.6);
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}


/* =========================================================
   STORY FOOTER
   ========================================================= */

.story-footer {
    background: var(--color-bg-white);
    border-top: 1px solid rgba(27, 23, 19, 0.09);
}

.story-footer-inner {
    width: min(86%, 1180px);
    margin: 0 auto;

    display: grid;
    grid-template-columns:
        minmax(280px, 0.9fr)
        minmax(300px, 0.8fr);
    gap: clamp(4rem, 9vw, 9rem);
    align-items: end;

    padding:
        clamp(5.5rem, 9vw, 8rem)
        0
        clamp(6rem, 10vw, 9rem);
}

.story-footer-copy h2 {
    max-width: 12ch;
    margin: 0;
    font-size: clamp(2.6rem, 4.2vw, 4.4rem);
    font-weight: 400;
    line-height: 1.04;
    letter-spacing: -0.03em;
}

.story-footer-links {
    display: grid;
}

.story-footer-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    padding: 1.15rem 0;

    color: var(--color-text-dark);
    font-size: 0.84rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-decoration: none;
    border-bottom: 1px solid rgba(27, 23, 19, 0.18);
}

.story-footer-links a span {
    transition: transform 180ms ease;
}

.story-footer-links a:hover span,
.story-footer-links a:focus-visible span {
    transform: translateX(0.3rem);
}


/* =========================================================
   404
   ========================================================= */

.story-missing {
    min-height: 60svh;
    display: grid;
    place-items: center;
    background: var(--color-bg-light);
}

.story-missing-inner {
    width: min(86%, 760px);
    padding:
        clamp(5rem, 10vw, 9rem)
        0;
}

.story-missing h1 {
    margin: 0;
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.04em;
}

.story-missing p:not(.story-kicker) {
    margin: 1.5rem 0 0;
    color: var(--color-text-medium);
}

.story-missing a {
    display: inline-flex;
    gap: 0.5rem;
    margin-top: 2rem;
    color: var(--color-text-dark);
    text-decoration: none;
    border-bottom: 1px solid currentColor;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {

    .story-opening-inner,
    .story-footer-inner {
        width: min(88%, 720px);
    }

    .story-opening-inner {
        grid-template-columns: 1fr;
        gap: 3.5rem;
    }

    .story-opening-copy {
        padding-left: 0;
    }

    .story-opening h1 {
        font-size: clamp(3.2rem, 12vw, 5.2rem);
    }

    .story-opening-image {
        width: 80%;
        margin-left: auto;
    }

    .story-block--text:nth-child(n) .story-block-text-inner {
        width: min(88%, 680px);
        margin-left: auto;
        margin-right: auto;
    }

    .story-block--pair,
    .story-block--wide,
    .story-block--image {
        width: min(90%, 760px);
    }

    .story-block--image figure {
        width: 76%;
    }

    .story-footer-inner {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .story-footer-links {
        max-width: 42rem;
    }

}

@media (max-width: 620px) {

    .story-breadcrumb ol {
        gap: 0.4rem;
    }

    .story-breadcrumb li {
        font-size: 0.68rem;
        letter-spacing: 0.06em;
    }

    .story-breadcrumb li[aria-current="page"] {
        max-width: 18rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .story-opening-inner,
    .story-footer-inner {
        width: min(90%, 560px);
    }

    .story-opening-image {
        width: 92%;
    }

    .story-pair {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .story-pair figure,
    .story-pair figure:nth-child(2) {
        width: 92%;
        margin-top: 0;
    }

    .story-pair figure:nth-child(2) {
        margin-left: auto;
    }

    .story-block--image figure {
        width: 92%;
    }

    .story-block--quote blockquote {
        width: min(88%, 560px);
    }

    .story-block--quote p {
        font-size: clamp(1.8rem, 8.5vw, 2.8rem);
    }

}

@media (prefers-reduced-motion: reduce) {

    .story-footer-links a span {
        transition: none;
    }

}

/* Authenticated Gallery Manager draft preview only. */
.story-preview-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.9rem clamp(1rem, 4vw, 3rem);
    background: #171310;
    color: #f5f1ea;
    border-top: 1px solid rgba(255,255,255,.08);
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.story-preview-banner > div {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    flex-wrap: wrap;
}
.story-preview-banner strong {
    font-family: var(--font-body, sans-serif);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}
.story-preview-banner span {
    color: rgba(245,241,234,.7);
    font-size: 0.76rem;
}
.story-preview-banner a {
    flex: 0 0 auto;
    color: #f5f1ea;
    text-decoration: none;
    font-size: 0.7rem;
    border-bottom: 1px solid rgba(245,241,234,.36);
    padding-bottom: 0.15rem;
}
@media (max-width: 700px) {
    .story-preview-banner {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.65rem;
    }
}
