/* preserved-l2.css
   Site-specific styling for the /preserved-locomotives L2 page.

   Wraps each H2 prose section in a brass-gold-bordered card that
   matches the homepage card aesthetic, alternating between two
   subtle surfaces (clean card / faintly tinted) so the four sections
   don't read as one block of white. Adds a thumbnail mini-card grid
   for the [preserved_loco_thumbs] shortcode.

   Uses the existing site-theme variables (--primary-color,
   --secondary-color, --card-bg, --background-alt, --border-color)
   so light (warm off-white + crimson + brass) and dark (navy + brass
   + crimson) themes are handled by the palette already in place.
   Brass gold border (#C9A84C) is used the same way as every other
   card / panel on the site. */


/* ---- Section card blocks ------------------------------------------ */

.enc-prose-block {
    /* Brass gold border matches every other card/panel on the site.
       Hard-coded #C9A84C (not var(--secondary-color)) because the dark
       theme SWAPS primary/secondary — in dark mode --secondary-color is
       crimson, which would make these borders red instead of gold. */
    border: 1px solid #C9A84C;
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
    margin: 1.75rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);

    /* Default surface: the site's card-bg (pure white in light, a
       slightly-lighter navy in dark). The :nth-of-type(even) rule
       below paints alternate sections with a subtle tint instead. */
    background: var(--card-bg, #ffffff);
    color: var(--text-color, inherit);
}

/* Alternate sections (2nd, 4th) get a subtle crimson wash overlaid on
   card-bg, the same treatment .home-finder uses on the homepage. This
   stops the page reading as four identical white boxes. */
.enc-prose-block:nth-of-type(even) {
    background:
        linear-gradient(135deg,
            rgba(139, 26, 26, 0.06),
            rgba(139, 26, 26, 0.02)),
        var(--card-bg, #ffffff);
}

/* Headings — pick up the Playfair Display family from the global
   h1-h4 rule in site-theme.css; the colour follows --primary-color
   (crimson in light, brass in dark). Brass divider line under each. */
.enc-prose-block > h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.45rem;
    line-height: 1.25;
    color: var(--primary-color, inherit);
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #C9A84C;   /* always brass — see note on .enc-prose-block */
}

.enc-prose-block > p {
    margin: 0.6rem 0 0.85rem;
    line-height: 1.65;
}

.enc-prose-block > p:last-child {
    margin-bottom: 0;
}

/* Dark theme — the light-crimson wash on the even sections would be
   almost invisible on a navy card surface, so swap to a brass-tinted
   gradient (the dark-theme accent) so the alternation reads through. */
[data-theme="dark"] .enc-prose-block:nth-of-type(even) {
    background:
        linear-gradient(135deg,
            rgba(201, 168, 76, 0.08),
            rgba(201, 168, 76, 0.02)),
        var(--card-bg, #1A2B42);
}


/* ---- CTA button (used at the end of a styled prose section) ------- */

.enc-prose-cta-row {
    margin: 1rem 0 0;
    text-align: left;
}

.enc-prose-cta {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    background: var(--primary-color, #8B1A1A);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    border-radius: 8px;
    border: 1px solid var(--primary-color, #8B1A1A);
    transition: filter 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.enc-prose-cta:hover,
.enc-prose-cta:focus-visible {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    outline: none;
    color: #ffffff;
    text-decoration: none;
}

/* In dark theme the primary colour is brass, so keep white text and
   the same filter-brightened hover. The button reads as a brass pill
   on the navy card, which is the same shape of accent the rest of
   the site uses (e.g. .home-finder-go does this transition). */
[data-theme="dark"] .enc-prose-cta {
    color: #ffffff;
}


/* ---- Mini-card thumbnail row ([preserved_loco_thumbs] shortcode) -- */

.preserved-loco-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin: 1.25rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #D4CEC6);
}

.preserved-loco-thumb {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border: 1px solid #C9A84C;   /* always brass — see note on .enc-prose-block */
    border-radius: 8px;
    overflow: hidden;
    background: var(--card-bg, #ffffff);
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.preserved-loco-thumb:hover,
.preserved-loco-thumb:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    outline: none;
}

.preserved-loco-thumb img {
    display: block;
    width: 100%;
    height: 110px;
    object-fit: cover;
    background: var(--background-alt, #EDE8E0);
}

.preserved-loco-thumb-label {
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--primary-color, inherit);
}


/* ---- Mobile tweaks ------------------------------------------------ */

@media (max-width: 600px) {
    .enc-prose-block {
        padding: 1.1rem 1.15rem;
        margin: 1.25rem 0;
    }
    .enc-prose-block > h2 {
        font-size: 1.25rem;
    }
    .preserved-loco-thumbs {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    .preserved-loco-thumb img {
        height: 95px;
    }
}
