/* Avery Finch theme: the glue between WordPress blocks and the design system (wf.css).
   Layout and look come from tokens.css and wf.css; this file only adapts the block markup. */

:root { color-scheme: only light; }
body { margin: 0; background: var(--bg-page); }
.wp-site-blocks { background: var(--bg-page); color: var(--text-body); font: 400 16px/26px var(--font-text); overflow-x: clip; }
.wp-site-blocks > *, .af-main, .af-main > .entry-content { margin: 0; padding: 0; }
.af-hdr-wrap { position: sticky; top: 0; z-index: 50; }

/* Paragraph wrappers made for runs of inline content and for links that sit in a layout row. */
p.c { display: contents; }

/* Lists turned into groups (items with headings and paragraphs keep their look). */
.x-ul, .x-ol, .x-dl { margin: 0; padding: 0; list-style: none; }
.x-dt, .x-dd { margin: 0; }

/* Core block classes that carry no look of their own here. */

/* Wordmark as inline SVG. */
.wm { display: block; width: auto; color: var(--text-primary); }
.hdr .logo .wm { height: 22px; color: var(--ultramar-600); } /* Primary wordmark, Ultramar on Paper, as in the wireframe (Tiago, 26 Nov 2026). */
.ftr .brand .wm { height: 32px; margin-bottom: 16px; }
@media (min-width: 720px) { .ftr .brand .wm { height: 40px; } }
@media (min-width: 1080px) { .hdr .logo .wm { height: 30px; } }

/* Skip link. */
.skip { position: absolute; left: 16px; top: -48px; z-index: 100; padding: 8px 12px; background: var(--action-primary, #3A49AC); color: #fff; border-radius: 4px; }
.skip:focus { top: 8px; }

/* Quote form: what a working form adds to the wireframe. */
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.drop label.btn { cursor: pointer; }
.drop input[type=file]:focus-visible + .help, .drop:focus-within label.btn { outline: 2px solid var(--focus-ring, #3A49AC); outline-offset: 2px; }
.err { color: var(--danger-text, #A3261D); font: var(--text-body-s); margin: 8px 0 0; }
.f.is-invalid input, .f.is-invalid select { border-color: var(--danger-border, #A3261D); }
.form button.btn { border: 0; cursor: pointer; justify-self: start; }
.form button.btn[disabled] { opacity: .6; cursor: progress; }
.cf-turnstile:empty { display: none; }

/* The language switch in the phone menu keeps its place. */
.mnav__panel .lang { margin-top: 8px; }

/* Paper 2 sections (decision of 17 Nov 2026: sections alternate between Paper, Paper 2,
   Deep Ink and Ultramar). The wireframe marks them data-theme="paper2" but draws them on Paper. */
:is([data-theme="paper2"], .theme-paper2) { --bg-page: #efede6; background: #efede6; }
.sec:is([data-theme="paper2"], .theme-paper2) { background: #efede6; }
/* On a Paper 2 section, highlight panels (figures, record cards, callouts) rise in Paper,
   so they never melt into a ground of the same colour (Tiago, 25 Nov 2026). */
:is([data-theme="paper2"], .theme-paper2) { --surface-highlight: #f7f6f2; }

/* Feed sections (rendered by the theme once the first post exists). */
.u-mt-auto { margin-top: auto; }
.u-lead-s { font-size: 17px; line-height: 27px; }
.u-posts-top { margin-top: 16px; border-top: 2px solid var(--rule-key); }
.u-post-1col { grid-template-columns: minmax(0, 1fr); }
.photo.has-img { background: none; }
.photo.has-img::after { content: none; }
.photo.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.u-flush { border-top: 0; padding-top: 0; }
.u-flush-top { border-top: 0; }

/* Operations and news list: below 1080 px the key facts sit under the text column (the wireframe board leaves them to wrap). */
@media (max-width: 1079.98px) { .post > .photo { grid-row: 1 / span 2; } .post .facts { grid-column: 2; margin-top: 0; align-self: start; } }

/* Spacing of the feed pages, from the tokens (review F-35: no inline styles in the theme's PHP). */
.u-mt-6 { margin-top: var(--space-6) !important; }
.u-pt-0 { padding-top: 0 !important; }
.u-bt-0 { border-top: 0 !important; }
.u-p-0 { padding: 0 !important; }
.u-px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.u-m-0 { margin: 0 !important; }
.af-editor-note { padding: var(--space-5); border: 1px dashed var(--border-strong); }

/* Home hero on phone and tablet (Tiago, 28 Nov 2026, option B): below 1080 px the order is the short
   eyebrow (Project logistics · Marine operations; the words marked u-wide only on desktop), title,
   the illustrative record, the lead, the actions. The record keeps its first row (the cargo) and its
   last two rows (the governing constraint and the decision); the rows between are hidden.
   Home only: the inner pages keep their hero as it is. Desktop is unchanged. The buttons keep
   the full width of the column. */
@media screen and (max-width: 1079.98px) { /* screen only: a print from a desktop keeps the desktop hero (review C5-01) */
  .home .hero .split--wide { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .home .hero .split--wide > :first-child { display: contents; }
  .home .hero .split--wide .eyebrow { order: 1; }
  .home .hero .split--wide h1 { order: 2; margin-bottom: var(--space-6); }
  .home .hero .split--wide > .fx { order: 3; margin: 0 0 12px; } /* 12 px plus the lead's 20 px: 32 px, the same as above the figure. */
  .home .hero .split--wide .lead { order: 4; }
  .home .hero .split--wide .actions { order: 5; align-self: stretch; }
  .home .hero .split--wide .actions .btn { flex: 1 1 100%; }
  .home .hero .u-wide { display: none; }
  .home .hero .fx__rows > div:nth-child(n+2):nth-last-child(n+3) { display: none; }
}
