/* Production Bittencourt Notes presentation, derived from the approved family v5 design. */
:root {
  color-scheme: light;
  --paper: #f4f1e9;
  --surface: #fffefb;
  --ink: #17242e;
  --muted: #647078;
  --line: #d7d4ca;
  --accent: #b3261e;
  --link: #1f4e79;
  --shadow: 0 18px 60px rgb(23 36 46 / 8%);
  --serif: "thimabi Newsreader", Georgia, serif;
  --sans: "thimabi Karla", system-ui, sans-serif;
  --mono: "thimabi Inconsolata", ui-monospace, monospace;
  --tmb-font-sans: var(--sans);
  --tmb-font-serif: var(--serif);
  --tmb-interactive: var(--link);
  --tmb-mark-surface: var(--surface);
  --tmb-notes-accent: var(--accent);
  --tmb-text-muted: var(--muted);
  --reading-width: 800px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #10161a;
    --surface: #1c252b;
    --ink: #edf0eb;
    --muted: #afbbc1;
    --line: #32424b;
    --accent: #e86b63;
    --link: #83b5e0;
    --shadow: 0 20px 70px rgb(0 0 0 / 24%);
  }
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 38%, transparent); text-underline-offset: .18em; }
a:hover { text-decoration-color: currentColor; }
button, summary { font: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 4px; }

.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; padding: 10px 14px; transform: translateY(-160%); border-radius: 8px; background: var(--ink); color: var(--surface); }
.skip-link:focus { transform: none; }
.family-header, .entry-header { display: grid; width: min(1180px, calc(100% - 48px)); min-height: 78px; grid-template-columns: minmax(300px, 1fr) auto minmax(190px, 1fr); align-items: center; gap: 28px; margin: 24px auto 0; padding: 0 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 10px 30px rgb(20 31 38 / 7%); }
.primary-nav { display: flex; gap: 28px; margin: 0; color: var(--muted); font-size: 15px; font-weight: 600; }
.primary-nav a { text-decoration: none; }
.family-header-actions { display: flex; align-items: center; justify-self: end; gap: 7px; }
.header-popover { position: relative; }
.header-popover summary { list-style: none; }
.header-popover summary::-webkit-details-marker { display: none; }
.header-language, .header-menu { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; cursor: pointer; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 11px; font-weight: 700; }
.header-menu { min-width: 42px; padding: 0; }
.site-menu { display: none; }
.lucide { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.menu-panel { position: absolute; z-index: 10; top: calc(100% + 9px); right: 0; display: grid; width: 172px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.menu-panel a { padding: 10px 12px; border-radius: 8px; text-decoration: none; }
.menu-panel a:hover { background: var(--paper); }
.site-menu-panel { width: 190px; }

main { display: block; }
.eyebrow { margin: 0 0 18px; color: var(--accent); font: 600 13px/1.2 var(--sans); letter-spacing: .11em; text-transform: uppercase; }
.latest-card { display: grid; width: min(1180px, calc(100% - 48px)); grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr); overflow: hidden; margin: clamp(28px, 3vw, 48px) auto; border: 1px solid var(--line); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); }
.latest-copy { align-self: center; padding: clamp(34px, 6vw, 74px); }
.latest-copy h1 { margin: 0; font: 500 clamp(39px, 5.2vw, 70px)/1.02 var(--serif); letter-spacing: -.045em; text-wrap: balance; }
.latest-copy h1 a { text-decoration: none; }
.deck { max-width: 660px; margin: 25px 0 0; color: var(--muted); font: 400 20px/1.55 var(--serif); }
.article-meta, .byline { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 34px 0 0; color: var(--muted); font: 13px/1.4 var(--mono); }
.latest-image { min-height: 420px; background: var(--paper); }
.latest-image img { width: 100%; height: 100%; object-fit: cover; }

.article-index { width: min(980px, calc(100% - 48px)); margin: 0 auto 90px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0; font: 500 33px/1.2 var(--serif); }
.section-heading a { color: var(--link); font-size: 14px; }
.article-list { padding: 0; margin: 0; list-style: none; }
.article-list li { border-bottom: 1px solid var(--line); }
.article-list article { display: grid; grid-template-columns: 64px 1fr; gap: 28px; padding: 28px 0; }
.article-list time { padding-top: 5px; color: var(--muted); font: 13px var(--mono); }
.article-list h3 { margin: 0; font: 500 27px/1.16 var(--serif); letter-spacing: -.02em; }
.article-list h3 a { text-decoration: none; }
.article-list p { max-width: 680px; margin: 8px 0 0; color: var(--muted); line-height: 1.5; }

.article-header { width: min(var(--reading-width), calc(100% - 42px)); margin: 12px auto 0; padding: clamp(40px, 5vw, 64px) 0 clamp(28px, 3vw, 40px); text-align: left; }
.article-header h1 { margin: 0; font: 520 clamp(48px, 6.4vw, 74px)/1.03 var(--serif); letter-spacing: -.052em; text-wrap: balance; }
.article-deck { margin: 24px 0 0; color: var(--muted); font: 400 22px/1.5 var(--serif); }
.byline { justify-content: flex-start; margin-top: 30px; }
.translation-links { display: flex; justify-content: flex-start; gap: 12px; margin-top: 25px; font-size: 14px; }
.translation-links a { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.article-body { width: min(var(--reading-width), calc(100% - 42px)); margin: 0 auto clamp(104px, 12vw, 150px); font: 400 24px/1.68 var(--serif); }
.article-body > p { margin: 0 0 1.55em; }
.article-body hr { width: min(116px, 26%); height: 1px; margin: 2.6em auto; border: 0; background: var(--line); }
.article-body h2 { margin: 1.65em 0 .68em; font: 600 35px/1.18 var(--serif); letter-spacing: -.025em; }
.article-body h3 { margin: 1.7em 0 .62em; font: 600 27px/1.25 var(--serif); }
.article-body a { color: var(--link); }
.article-body a,
.article-body code { overflow-wrap: anywhere; word-break: break-word; }
.article-body code { max-width: 100%; white-space: normal; }
.article-body pre code { overflow-wrap: normal; word-break: normal; white-space: pre; }
.article-body blockquote:not(.pullquote) { box-sizing: border-box; width: 76%; max-width: 100%; margin: 2.5em 0 2.5em 24%; padding: 2px 0 2px 25px; border: 0; border-left: 2px solid color-mix(in srgb, var(--line) 72%, var(--ink)); background: transparent; color: color-mix(in srgb, var(--ink) 88%, var(--muted)); font-size: .82em; line-height: 1.62; }
.article-body blockquote p { margin-top: 0; }
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body .pullquote { box-sizing: border-box; width: 100%; max-width: 100%; margin: 2.7em 0; padding: 30px clamp(26px, 4vw, 44px); border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line)); border-left: 5px solid var(--accent); border-radius: 0 16px 16px 0; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); color: var(--ink); }
.article-body .pullquote p { margin-bottom: 0; font: 500 clamp(29px, 3vw, 36px)/1.38 var(--serif); letter-spacing: -.02em; }
.article-body blockquote cite { display: block; margin-top: 14px; color: var(--muted); font: 600 11px/1.4 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.article-body ul, .article-body ol { padding-left: 1.4em; }
.article-body li { margin: .45em 0; }
.article-body table { display: block; width: 100%; margin: 2.2em 0; overflow-x: auto; border-collapse: collapse; font: 16px/1.4 var(--sans); }
.article-body th, .article-body td { padding: 12px 14px; border: 1px solid var(--line); text-align: left; }
.article-body th { background: var(--surface); }
.article-page[data-presentation="election-results"] table:nth-of-type(-n + 2) td:nth-child(2),
.article-page[data-presentation="election-results"] table:nth-of-type(3) td:nth-child(2),
.article-page[data-presentation="election-results"] table:nth-of-type(3) td:nth-child(4) { color: #315fb5; }
.article-page[data-presentation="election-results"] table:nth-of-type(-n + 2) td:nth-child(3),
.article-page[data-presentation="election-results"] table:nth-of-type(3) td:nth-child(3),
.article-page[data-presentation="election-results"] table:nth-of-type(3) td:nth-child(5) { color: #b82d28; }
.bn-figure { width: 100%; max-width: none; margin: 3em auto; text-align: center; }
.article-page:not(.content-page) .article-body > .bn-figure:first-child { margin-top: 0; }
.bn-figure img { display: block; width: 100%; height: auto; margin: 0 auto; border-radius: 16px; background: var(--surface); }
.bn-figure--small img { max-width: 520px; }
.bn-figure--medium img { max-width: 760px; }
.bn-figure--wide img { width: min(1120px, calc(100vw - 42px)); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.bn-figure figcaption { box-sizing: border-box; width: 100%; max-width: 100%; margin: 10px 0 0; color: var(--muted); font: 12px/1.45 var(--mono); text-align: center; }

.archive-header, .archive-list { width: min(900px, calc(100% - 48px)); margin-inline: auto; }
.archive-header { margin-top: 12px; padding: clamp(40px, 5vw, 64px) 0 clamp(28px, 3vw, 40px); }
.archive-header h1 { margin: 0; font: 520 clamp(48px, 6.4vw, 74px)/1.03 var(--serif); letter-spacing: -.052em; }
.archive-list { margin-bottom: clamp(104px, 12vw, 150px); }
.archive-list section { display: grid; grid-template-columns: 100px 1fr; gap: 28px; border-top: 1px solid var(--line); }
.archive-list section:last-child { border-bottom: 1px solid var(--line); }
.archive-list h2 { position: sticky; top: 24px; align-self: start; margin: 28px 0; color: var(--accent); font: 500 28px var(--serif); }
.archive-list ol { padding: 0; margin: 0; list-style: none; }
.archive-list li { display: grid; grid-template-columns: 88px 1fr; gap: 20px; padding: 27px 0; }
.archive-list li + li { border-top: 1px solid var(--line); }
.archive-list time { color: var(--muted); font: 13px var(--mono); }
.archive-list a { font: 500 23px/1.2 var(--serif); text-decoration: none; }
.empty-state { width: min(700px, calc(100% - 48px)); margin: 12px auto 100px; padding: clamp(44px, 8vw, 74px); border: 1px solid var(--line); border-radius: 26px; background: var(--surface); text-align: center; }
.empty-state-mark { --mark-size: 64px; margin: 0 auto 28px; }
.empty-state h1 { margin: 0; font: 500 36px var(--serif); }
.empty-state p { margin: 12px auto 0; color: var(--muted); font-size: 18px; }
.empty-edition { display: grid; min-height: calc(100svh - 174px); place-items: center; padding: 28px 0; }
.empty-edition .empty-state { margin: 0 auto; }

.family-footer { display: flex; width: min(1180px, calc(100% - 48px)); min-height: 72px; align-items: center; justify-content: space-between; gap: 20px; margin: 0 auto; padding: 18px 0; border-top: 1px solid var(--line); color: var(--muted); font: 12px var(--mono); letter-spacing: .04em; }

.entry-body { display: grid; min-height: 100svh; grid-template-rows: auto 1fr auto; }
.entry-header { grid-template-columns: 1fr; }
.language-entry { width: min(1000px, calc(100% - 48px)); align-self: center; margin: 70px auto; text-align: center; }
.entry-signature { display: flex; justify-content: center; margin-bottom: 30px; }
.entry-mark { --mark-size: 82px; }
.language-entry h1 { margin: 0; font: 500 clamp(58px, 10vw, 112px)/.95 var(--serif); letter-spacing: -.06em; }
.entry-intro { margin: 26px 0 40px; color: var(--muted); font: 22px var(--serif); }
.edition-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.edition-grid a { display: grid; align-content: center; min-height: 150px; gap: 9px; padding: 25px; text-align: left; text-decoration: none; }
.edition-grid a + a { border-left: 1px solid var(--line); }
.edition-grid a:hover { background: color-mix(in srgb, var(--paper) 58%, transparent); }
.edition-grid strong { font: 500 25px var(--serif); }
.edition-grid span { color: var(--muted); font-size: 14px; line-height: 1.4; }

@media (max-width: 840px) {
  .family-header { grid-template-columns: 1fr auto; gap: 14px; }
  .primary-nav { display: none; }
  .family-header-actions { grid-column: 2; }
  .site-menu { display: block; }
  .latest-card { grid-template-columns: 1fr; }
  .latest-image { min-height: 320px; grid-row: 1; }
  .edition-grid { grid-template-columns: 1fr 1fr; }
  .edition-grid a + a { border-left: 0; }
  .edition-grid a:nth-child(even) { border-left: 1px solid var(--line); }
  .edition-grid a:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .family-header, .entry-header { width: calc(100% - 24px); min-height: 70px; margin-top: 12px; padding: 0 14px; border-radius: 18px; }
  .notes-mark.empty-state-mark { --mark-size: 64px; }
  .header-language { width: 42px; padding: 0; }
  .header-language span { display: none; }
  .latest-card { width: calc(100% - 24px); border-radius: 21px; }
  .latest-copy { padding: 30px 24px 34px; }
  .latest-copy h1 { font-size: 39px; }
  .deck { font-size: 18px; }
  .latest-image { min-height: 230px; max-height: 320px; }
  .article-index { width: calc(100% - 32px); }
  .section-heading { align-items: end; }
  .section-heading h2 { font-size: 28px; }
  .article-list article { grid-template-columns: 1fr; gap: 8px; padding: 23px 0; }
  .article-list h3 { font-size: 24px; }
  .article-list p { display: none; }
  .article-header { width: calc(100% - 42px); padding-top: 40px; text-align: left; }
  .article-header h1 { font-size: 44px; }
  .article-deck { font-size: 19px; }
  .byline, .translation-links { justify-content: flex-start; }
  .article-body { width: calc(100% - 42px); font-size: 20px; line-height: 1.7; }
  .article-body h2 { font-size: 30px; }
  .article-body blockquote:not(.pullquote) { width: 100%; margin: 2.2em 0; padding-left: 20px; font-size: .9em; }
  .article-body .pullquote { margin: 2.2em 0; padding: 24px 22px; }
  .article-body .pullquote p { font-size: 27px; line-height: 1.4; }
  .bn-figure--wide img { width: calc(100vw - 24px); }
  .bn-figure img { border-radius: 11px; }
  .bn-figure figcaption { font-size: 11px; }
  .archive-header, .archive-list { width: calc(100% - 32px); }
  .archive-header { padding: 40px 0 32px; }
  .archive-list section { grid-template-columns: 1fr; gap: 0; }
  .archive-list h2 { position: static; margin-bottom: 4px; }
  .archive-list li { grid-template-columns: 68px 1fr; gap: 12px; padding: 22px 0; }
  .archive-list a { font-size: 20px; }
  .family-footer { width: calc(100% - 24px); min-height: 0; margin-top: 12px; padding: 16px 0 22px; }
  .empty-edition { min-height: calc(100svh - 142px); padding: 22px 0; }
  .language-entry { width: calc(100% - 32px); margin: 54px auto; }
  .entry-mark { --mark-size: 66px; }
  .language-entry h1 { font-size: 54px; }
  .edition-grid { grid-template-columns: 1fr; }
  .edition-grid a { min-height: 110px; }
  .edition-grid a:nth-child(even) { border-left: 0; }
  .edition-grid a:nth-child(n + 2) { border-top: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
