/* ===== LANCASTER: documentary-style project page =====
   One column of article text, with figures that break out to a wide
   column or to the full width of the window. Colours are the set's own
   palette, sampled from the final palette render. */

.doc-page {
    --lanc-ink: #1b1916;        /* page ground, a shade under the charcoal */
    --lanc-charcoal: #332f2a;   /* RAL 080 20 05 */
    --lanc-cream: #ddc49b;      /* RAL 1014 */
    --lanc-gold: #d4a24f;       /* RAL 080 70 50 */
    --lanc-red: #6b1c22;        /* RAL 3004 */
    --lanc-text: #ece2d0;
    --lanc-muted: rgba(236, 226, 208, 0.62);
    --lanc-rule: rgba(212, 162, 79, 0.35);

    --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, 'Times New Roman', serif;
    --mono: 'Consolas', 'Monaco', 'Lucida Console', monospace;

    background: var(--lanc-ink);
    color: var(--lanc-text);
}

/* the shared navbar turns solid once scrolled; match it to this page */
.doc-page .navbar.scrolled {
    background: var(--lanc-ink);
}

/* ---------- the column ----------
   Everything sits in the same column as the navbar (.nav-container:
   1400px wide, 40px side padding, 20px at 768px, 15px at 480px), so
   text and pictures line up with the name and the last nav link. */

.doc {
    max-width: 1400px;
    margin-inline: auto;
    padding: 150px 40px 120px;
}

/* ---------- type ---------- */

/* Headings match the main page: h1 and h2 are its .section-title
   (styles.css), h3 to h5 its card headings (cards.css). */
.doc h1,
.doc h2 {
    font-family: var(--mono);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 300;
    text-align: center;
    color: var(--secondary-accent);
    margin: 120px 0 60px;
}

.doc > h1:first-child {
    margin-top: 0;
}

.doc h3,
.doc h4,
.doc h5 {
    font-family: var(--mono);
    color: var(--secondary-accent);
    margin-bottom: 15px;
}

.doc h3 { font-size: 1.4em; }
.doc h4 { font-size: 1.2em; }
.doc h5 { font-size: 1em; }

.doc-standfirst {
    font-family: var(--mono);
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    line-height: 1.55;
    color: var(--lanc-text);
    margin-bottom: 26px;
}

.doc-meta {
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--lanc-muted);
    padding-top: 18px;
    border-top: 1px solid var(--lanc-rule);
    margin-bottom: 72px;
}

.doc-meta span + span::before {
    content: '·';
    margin: 0 0.7em;
    color: var(--lanc-gold);
}


/* body text in the main page's font (body in styles.css) */
.doc p {
    font-family: var(--mono);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1.3em;
}

.doc p em {
    color: var(--lanc-cream);
}

.doc .ral {
    font-family: var(--mono);
    font-size: 0.92em;
    color: var(--lanc-gold);
    white-space: nowrap;
}

/* ---------- figures ---------- */

.doc figure {
    margin: 56px 0;
}

.doc figure img {
    display: block;
    width: 100%;
    height: auto;
    background: var(--lanc-charcoal);
}

.doc figcaption {
    font-family: var(--mono);
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--lanc-muted);
    margin-top: 14px;
}

/* rows of two or three pictures */
.doc .row {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
    align-items: start;
}

.doc .row > figure {
    margin: 0;
}

.doc figure.set {
    margin: 56px 0;
}

.doc figure.set > figcaption {
    margin-top: 18px;
}

/* the station photos are different shapes; crop them to one height */
.doc .row.even img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* the RAL chips are small, so they stay small */
.doc .chips {
    --cols: 3;
    max-width: 520px;
}

/* the artisan renders are on white; give them a frame of the same white */
.doc .artisans img {
    background: #fff;
}

/* a small figure on the left with its paragraph beside it on the right */
.doc .split {
    display: grid;
    grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
    margin: 56px 0;
}

.doc .split figure {
    margin: 0;
}

.doc .split > p,
.doc .split > div > p:last-child {
    margin-bottom: 0;
}

/* paragraph on the left, a small portrait figure on the right */
.doc .split.text-first {
    grid-template-columns: minmax(0, 1fr) 220px;
    margin: 0 0 1.3em;
}

/* the poster and its neighbour: poster tall on the left, text on the right */
.doc .poster {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 48px;
    align-items: center;
    margin: 72px 0;
}

.doc .poster figure {
    margin: 0;
}

.doc .poster p:last-child {
    margin-bottom: 0;
}

/* a band of the set's carpet pattern, used as a chapter break */
.doc .band {
    background: var(--lanc-red) url('../images/lancaster/web/carpet-1920.webp') center / cover;
    padding: 96px 40px;
    margin: 120px 0 0;
    text-align: center;
}

.doc .band p {
    font-family: var(--mono);
    font-size: clamp(1.15rem, 2.4vw, 1.6rem);
    line-height: 1.5;
    color: var(--lanc-cream);
    max-width: 760px;
    margin: 0 auto;
}

/* ---------- ending ---------- */

.doc .credits {
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--lanc-muted);
    margin-top: 40px;
    padding-top: 18px;
    border-top: 1px solid var(--lanc-rule);
}

/* a line in the designer's own words, set large between rules */
.doc .pull {
    margin: 48px 0;
    padding: 28px 0;
    border-block: 1px solid var(--lanc-rule);
}

.doc .pull p {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1.5rem, 3.2vw, 2.1rem);
    line-height: 1.4;
    color: var(--lanc-gold);
    margin: 0;
}

.doc .doc-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 40px;
}

.doc .back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    font-family: var(--mono);
    font-weight: 700;
    /* same colours as the carousel's .carousel-card__link */
    color: var(--secondary-accent);
    text-decoration: none;
    border: 1px solid var(--secondary-accent);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.doc .back:hover,
.doc .back:focus-visible {
    background: var(--secondary-accent);
    color: var(--primary-dark);
}

/* ---------- reveal on scroll ----------
   Only when the script has run (it adds .js to <html>), so the page
   reads fine without JavaScript. */

.js .doc .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.js .doc .reveal.is-in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .js .doc .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ---------- small screens ---------- */

@media (max-width: 768px) {
    .doc {
        padding: 110px 20px 80px;
    }

    .doc h2 {
        margin-top: 88px;
    }

    .doc p {
        font-size: 1rem;
    }

    .doc figure,
    .doc figure.set {
        margin: 40px 0;
    }

    .doc .row {
        --cols: 1;
    }

    .doc .chips {
        --cols: 3;
    }

    .doc .split {
        grid-template-columns: 1fr;
        gap: 28px;
        margin: 40px 0;
    }

    .doc .split.text-first {
        grid-template-columns: 1fr;
    }

    .doc .split.text-first figure {
        max-width: 220px;
    }

    .doc .poster {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .doc .poster figure {
        max-width: 420px;
    }

    .doc .band {
        padding: 64px 20px;
    }
}

@media (max-width: 480px) {
    .doc {
        padding-inline: 15px;
    }
}
