/* The Deltan — shared story blocks, loaded on every page: kicker, standfirst, story cards and
   their grids, section bands, the Spotlight band and promo, newsletter blocks, advertising slots.
   Markup comes from the helpers in inc/template-tags.php; area stylesheets place these blocks and
   may tune them through the custom properties noted below, but should not restyle them. */

/* ---------- Kicker, standfirst, meta ---------- */
.kicker { margin: 0 0 4px; font: 500 13px/1.4 var(--font-ui); color: var(--deltan-red-ink); }
.kicker a { color: inherit; }
.kicker a:hover, .kicker a:focus-visible { color: var(--deltan-red-press); }
.standfirst { margin: 0; font: 400 18px/1.5 var(--font-reading); color: var(--ink-soft); }
@media (max-width: 767px) { .standfirst { font-size: 17px; } }

/* ---------- Story card ---------- */
/* Headline size: set --story-title-size (and --story-title-lh) on the card or any ancestor
   instead of overriding the font, e.g. 23px for a "second" story on the home page. */
.story { min-width: 0; }
.story__media { display: block; overflow: hidden; background: #f1f1f1; }
.story__image { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.story__title {
    margin: 0; font: 600 var(--story-title-size, 19px)/var(--story-title-lh, 1.22) var(--font-heading);
    color: var(--ink); overflow-wrap: break-word;
}
/* The underline is always there but transparent, so it can fade in (motion 1). */
.story__title a {
    color: inherit; text-decoration: underline; text-decoration-color: transparent;
    text-decoration-thickness: .06em; text-underline-offset: .16em;
}
.story__title a:hover, .story__title a:focus-visible,
.story:has(.story__media:hover) .story__title a { color: var(--deltan-red-ink); text-decoration-color: currentColor; }
.story__standfirst { margin-top: 8px; }
.story__meta { margin: 8px 0 0; font: 400 13px/1.4 var(--font-ui); color: var(--ink-muted); }
.story__byline + time::before { content: " \00b7  "; }

/* lead: large image, kicker, big headline, standfirst, date */
.story--lead .story__media { margin-bottom: 16px; }
.story--lead .story__kicker { margin-bottom: 6px; }
.story--lead .story__title { font-size: var(--story-title-size, 40px); line-height: var(--story-title-lh, 1.12); }
.story--lead .story__standfirst, .story--lead .story__meta { margin-top: 12px; }
/* card: 16:9 image, kicker, headline; a smaller standfirst when one is asked for */
.story--card .story__media { margin-bottom: 10px; }
.story--card .story__standfirst { font-size: 15px; line-height: 1.45; }
/* a card whose story has no picture reads as a text item under a hairline */
.story--card.story--no-image { padding-top: 14px; border-top: 1px solid var(--rule); }
/* compact: headline and date left, 110x82 thumbnail right */
.story--compact, .story--text { --story-title-size: 18px; --story-title-lh: 1.25; }
.story--compact { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 14px; align-items: start; }
.story--compact .story__media { grid-column: 2; grid-row: 1; }
.story--compact .story__body { grid-column: 1; grid-row: 1; }
.story--compact .story__image { aspect-ratio: 110 / 82; }
.story--compact.story--no-image { display: block; }

@media (max-width: 767px) {
    .story--lead .story__media { margin-bottom: 14px; }
    .story--lead .story__title { font-size: var(--story-title-size-phone, 28px); line-height: 1.14; }
    .story--lead .story__standfirst, .story--lead .story__meta { margin-top: 10px; }
    .story--compact { grid-template-columns: minmax(0, 1fr) 104px; }
}

/* ---------- Story layouts ---------- */
/* .story-grid: equal columns of cards. --2 / --3 / --4 set the desktop count. */
.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 28px; align-items: start; }
.story-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.story-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* .story-columns: three columns divided by hairlines (the home page's section bands). */
.story-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.story-columns > * { padding: 0 24px; border-left: 1px solid var(--rule); }
.story-columns > :first-child { padding-left: 0; border-left: 0; }
.story-columns > :last-child { padding-right: 0; }
/* .story-stack: items one under another, separated by hairlines. */
.story-stack > * + * { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rule); }
@media (max-width: 1024px) {
    .story-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
    .story-columns { grid-template-columns: minmax(0, 1fr); }
    .story-columns > * { padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--rule); margin-top: 16px; }
    .story-columns > :first-child { padding-top: 0; border-top: 0; margin-top: 0; }
    .story-stack > * + * { margin-top: 16px; padding-top: 16px; }
}
@media (max-width: 544px) {
    .story-grid, .story-grid--2, .story-grid--4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Arrow links ---------- */
/* .arrow-link on a link whose text ends with <span class="arrow">: the arrow nudges 3px right on
   hover (motion 5). .more-link is the small red "All of … →" link. */
.arrow { display: inline-block; }
.arrow-link:hover .arrow, .arrow-link:focus-visible .arrow { transform: translateX(3px); }
.more-link { display: inline-flex; align-items: center; min-height: 44px; font: 500 14px/1.3 var(--font-ui); color: var(--deltan-red-ink); }
.more-link:hover, .more-link:focus-visible { color: var(--deltan-red-press); }

/* ---------- Section band ---------- */
.band { margin-top: 40px; }
.band__head {
    display: flex; justify-content: space-between; align-items: baseline; gap: 4px 16px;
    padding-top: 10px; border-top: 2px solid var(--rule-strong);
}
.band__title { margin: 0; font: 700 22px/1.2 var(--font-heading); color: var(--ink); }
.band__title a { color: inherit; }
.band__title a:hover, .band__title a:focus-visible { color: var(--deltan-red-ink); }
.band__note { margin: 0; font: 400 13px/1.4 var(--font-ui); color: var(--ink-muted); text-align: right; }
.band__body { margin-top: 18px; }
@media (max-width: 767px) {
    .band { margin-top: 32px; }
    .band__title { font-size: 21px; }
    .band__note { display: none; } /* the phone layout carries the title alone */
    .band__body { margin-top: 16px; }
}

/* ---------- Tap targets on phones ---------- */
/* Stand-alone text links get a 44px-tall touch area. Vertical padding on an inline link widens
   what a finger can hit without moving a single line of text. The amounts differ above and below
   so that the areas of a label, the headline under it and a band title never overlap: a label
   reaches up into the gap above it, a headline down over its own date line. */
@media (max-width: 767px) {
    .kicker a { padding-block: 24px 5px; }
    .story__title a { padding-block: 5px 17px; }
    .band__title a { padding-block: 10px; }
}

/* ---------- The Spotlight ---------- */
.spotlight-label {
    display: block; margin: 0; font: 700 13px/1.4 var(--font-ui); letter-spacing: .14em;
    text-transform: uppercase; color: var(--deltan-red-on-dark);
}
/* Full-width dark band (home). */
.spotlight-band { margin-top: 40px; background: var(--ink); color: #fff; }
.spotlight-band__inner {
    max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter);
    display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: stretch;
}
.spotlight-band__media { display: block; min-height: 400px; overflow: hidden; background: #2a2a2a; }
.spotlight-band__image { width: 100%; height: 100%; object-fit: cover; }
.spotlight-band__body { padding: 48px 0 48px 48px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 16px; }
.spotlight-band__title { margin: 0; font: 600 40px/1.12 var(--font-heading); color: #fff; overflow-wrap: break-word; }
.spotlight-band__title a { color: inherit; text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: .06em; text-underline-offset: .16em; }
.spotlight-band__title a:hover, .spotlight-band__title a:focus-visible { color: #fff; text-decoration-color: currentColor; }
.spotlight-band__title a:focus-visible { outline-color: #fff; }
.spotlight-band__standfirst { color: #d9d9d9; }
.spotlight-band--no-image .spotlight-band__inner { grid-template-columns: minmax(0, 1fr); }
.spotlight-band--no-image .spotlight-band__body { padding-left: 0; max-width: 760px; }
@media (max-width: 1024px) {
    .spotlight-band__body { padding: 36px 0 36px 32px; }
    .spotlight-band__title { font-size: 32px; }
    .spotlight-band__media { min-height: 320px; }
}
@media (max-width: 767px) {
    .spotlight-band { margin-top: 28px; }
    .spotlight-band__inner { grid-template-columns: minmax(0, 1fr); padding: 0; }
    .spotlight-band__media { min-height: 0; aspect-ratio: 3 / 2; }
    .spotlight-band__body, .spotlight-band--no-image .spotlight-band__body { padding: 22px var(--gutter) 28px; gap: 12px; }
    .spotlight-band__title { font-size: 27px; line-height: 1.15; }
    .spotlight-band .spotlight-label { font-size: 12px; }
}
/* Dark card for rails (3:2 picture) and for "More from" rows next to story cards (16:9). */
.spotlight-promo { display: block; min-width: 0; background: var(--ink); color: #fff; }
.spotlight-promo:hover, .spotlight-promo:focus-visible { color: #fff; }
.spotlight-promo__media { display: block; overflow: hidden; background: #2a2a2a; }
.spotlight-promo__image { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.spotlight-promo__body { display: block; padding: 16px 18px 20px; }
.spotlight-promo .spotlight-label { font-size: 12px; }
.spotlight-promo__title {
    display: block; margin-top: 8px; font: 600 21px/1.2 var(--font-heading); color: #fff; overflow-wrap: break-word;
    text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: .06em; text-underline-offset: .16em;
}
.spotlight-promo:hover .spotlight-promo__title, .spotlight-promo:focus-visible .spotlight-promo__title { text-decoration-color: currentColor; }
.spotlight-promo--16x9 .spotlight-promo__image { aspect-ratio: 16 / 9; }
.spotlight-promo--16x9 .spotlight-promo__body { padding: 12px 14px 16px; }
.spotlight-promo--16x9 .spotlight-promo__title { margin-top: 6px; font-size: 18px; line-height: 1.22; }

/* ---------- Newsletter block ---------- */
/* Links to the sign-up form on the Newsletters page. "band" closes a page; "box" sits in a rail
   (it stacks there) or under an article (wide enough for text and button to share a row). */
.newsletter-block { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; background: var(--paper-warm); }
.newsletter-block__title { margin: 0; font: 700 26px/1.2 var(--font-heading); color: var(--ink); }
.newsletter-block__intro { margin: 6px 0 0; font: 400 17px/1.5 var(--font-reading); color: var(--ink-soft); }
.newsletter-block__cta { flex: none; }
.newsletter-block--band { margin-top: 40px; padding: 32px; gap: 24px; }
.newsletter-block--band .newsletter-block__text { flex: 1 1 420px; max-width: 680px; }
.newsletter-block--box { padding: 20px; gap: 12px 16px; }
.newsletter-block--box .newsletter-block__text { flex: 1 1 220px; }
.newsletter-block--box .newsletter-block__title { font-size: 20px; }
.newsletter-block--box .newsletter-block__intro { margin-top: 6px; font: 400 14px/1.5 var(--font-ui); }
@media (max-width: 767px) {
    .newsletter-block--band { margin-top: 32px; padding: 22px 18px; gap: 14px; }
    .newsletter-block--band .newsletter-block__text { flex-basis: 100%; }
    .newsletter-block--band .newsletter-block__title { font-size: 22px; }
    .newsletter-block--band .newsletter-block__intro { font-size: 16px; }
    .newsletter-block--band .newsletter-block__cta { width: 100%; min-height: 48px; }
}

/* ---------- Advertising slots (dormant) ---------- */
/* deltan_ad_slot() prints these only when an advert is supplied; the frame is then held at the
   position's fixed size so nothing on the page moves when the advert arrives. */
.ad-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ad-slot__label { font: 400 11px/1.4 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.ad-slot__frame { display: flex; align-items: center; justify-content: center; width: 100%; max-width: 970px; height: 90px; overflow: hidden; }
.ad-slot--leaderboard { padding-top: 20px; }
.ad-slot--billboard { margin-top: 40px; padding: 20px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.ad-slot--billboard .ad-slot__frame { height: 250px; }
.ad-slot--rail .ad-slot__frame, .ad-slot--article .ad-slot__frame { max-width: 300px; height: 250px; }
.ad-slot--article { margin: 32px 0; padding: 16px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
@media (max-width: 767px) {
    .ad-slot--leaderboard .ad-slot__frame, .ad-slot--billboard .ad-slot__frame { max-width: 320px; height: 100px; }
    .ad-slot--billboard { margin-top: 16px; padding: 14px 0; }
}

/* ---------- Motion ---------- */
/* Numbers refer to the motion plan in docs/REDESIGN.md. Nothing here runs under "reduce motion". */
@media (prefers-reduced-motion: no-preference) {
    /* 1: headline colour, and its underline fading in */
    .story__title a, .spotlight-band__title a, .spotlight-promo__title, .band__title a {
        transition: color var(--motion-fast) linear, text-decoration-color var(--motion-fast) linear;
    }
    /* 2: a story's picture and headline answer together, whichever of the two is pointed at or focused */
    .story__image, .spotlight-promo__image { transition: transform var(--motion-slow) var(--ease-out); }
    .story:has(a:hover) .story__image, .story:has(a:focus-visible) .story__image,
    .spotlight-promo:hover .spotlight-promo__image, .spotlight-promo:focus-visible .spotlight-promo__image { transform: scale(1.03); }
    /* 5: arrows move 3px right */
    .arrow { transition: transform var(--motion-fast) var(--ease-out); }
    /* 11: the Spotlight band's picture grows very slightly while any of the band's links is pointed at */
    .spotlight-band__image { transition: transform var(--motion-slow) var(--ease-out); }
    .spotlight-band:has(a:hover) .spotlight-band__image, .spotlight-band:has(a:focus-visible) .spotlight-band__image { transform: scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
    .arrow-link:hover .arrow, .arrow-link:focus-visible .arrow { transform: none; }
}
