/* ==========================================================================
   Prime Bulletin Desk - main.css
   Mobile-first. Breakpoints: 480px, 768px, 1024px.
   Layout: CSS Grid with named areas (page) and named lines (content column).
   ========================================================================== */

:root {
  --ink: #111111;
  --text: #232323;
  --muted: #5c5c5c;
  --rule: #dddad4;
  --paper: #ffffff;
  --band: #f6f3ee;
  --accent: #1b6b2f;
  --accent-dark: #124d20;
  --tag-bg: #fdeedd;
  --tag-ink: #95480f;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;

  --gutter: 16px;
  --col: 720px;
  --chapter-pad: 2.25rem;
  --radius: 4px;
  --radius-card: 8px;
  --shadow-card: 0 2px 14px rgba(0, 0, 0, 0.1);

  /* One shared column definition: full-bleed bands, text in the named "content" track */
  --page-cols: [full-start] minmax(var(--gutter), 1fr) [content-start] minmax(0, var(--col)) [content-end] minmax(var(--gutter), 1fr) [full-end];
}

@media (min-width: 480px) {
  :root { --gutter: 20px; }
}

@media (min-width: 768px) {
  :root {
    --gutter: 24px;
    --chapter-pad: 3.25rem;
  }
}

@media (min-width: 1024px) {
  :root { --chapter-pad: 3.5rem; }
}

/* ---------- Reset / base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "masthead"
    "main"
    "footer";
  min-height: 100vh;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -80px;
  z-index: 40;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius);
}

.skip-link:focus { top: 8px; }

.read-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ---------- Masthead ---------- */

.masthead {
  grid-area: masthead;
  display: grid;
  grid-template-columns: var(--page-cols);
  padding-block: 0.6rem 0.9rem;
  background: var(--paper);
  border-top: 4px solid #dcdcdc;
  border-bottom: 4px double var(--ink);
}

.masthead > * { grid-column: content; min-width: 0; }

.masthead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 1.75rem;
}

.masthead-date {
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.weekday,
.date-full { display: none; }

.masthead-date { white-space: nowrap; }

@media (min-width: 480px) {
  .weekday,
  .date-full { display: inline; }
  .date-compact { display: none; }
  .masthead-date { font-size: 0.75rem; }
}

.masthead-label {
  flex: none;
  padding: 0.3rem 0.65rem;
  background: var(--tag-bg);
  color: var(--tag-ink);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  border-radius: var(--radius);
}

.masthead-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s;
}

.masthead-back:hover { color: var(--accent); text-decoration: underline; }

.masthead-title {
  margin: 0.25rem 0 0.2rem;
  text-align: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.75rem, 1.1rem + 3.2vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.masthead-title a {
  color: inherit;
  text-decoration: none;
}

.masthead-title a:focus-visible { outline-offset: 4px; }

.masthead-tagline {
  margin: 0;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.8125rem;
  color: var(--muted);
}

@media (min-width: 1024px) {
  .masthead { padding-block: 0.75rem 1.1rem; }
  .masthead-tagline { font-size: 0.9375rem; }
}

/* ---------- Main / chapters ---------- */

main { grid-area: main; min-width: 0; }

.chapter {
  display: grid;
  grid-template-columns: var(--page-cols);
  padding-block: var(--chapter-pad);
}

.chapter > * {
  grid-column: content;
  min-width: 0;
  margin: 0;
}

.chapter > * + * { margin-top: 1.1rem; }

.chapter > figure,
.chapter > .split,
.chapter > .figures,
.chapter > .pullquote,
.chapter > .cta-block,
.chapter > .faq { margin-top: 2rem; }

.chapter > .section-title { margin-top: 2.5rem; }
.chapter > .section-title:first-child { margin-top: 0; }

.chapter-tint { background: var(--band); }

/* Two plain chapters in a row share one calmer gap */
.chapter:not(.chapter-tint) + .chapter:not(.chapter-tint) {
  padding-top: calc(var(--chapter-pad) * 0.4);
}

.chapter.chapter-head + .chapter.chapter-intro:not(.chapter-tint) { padding-top: 1.75rem; }

.chapter p { color: var(--text); }

.split-text > * { margin: 0; }
.split-text > * + * { margin-top: 1.1rem; }

/* Story head: crumb, headline, dek, byline */

.chapter-head {
  padding-block: 1.75rem 0;
}

@media (min-width: 768px) {
  .chapter-head { padding-block: 2.5rem 0; }
}

.crumb {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted);
}

.story-title {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.5rem);
  line-height: 1.17;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: pretty;
}

.chapter > .story-title { margin-top: 0.85rem; }

.story-dek {
  font-style: italic;
  font-size: clamp(1.0625rem, 0.95rem + 0.55vw, 1.25rem);
  line-height: 1.55;
  color: #444444;
}

.chapter > .story-dek { margin-top: 1rem; }

.byline {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
}

.chapter > .byline { margin-top: 1.25rem; }

.byline-author { color: var(--ink); font-weight: 700; }

.byline span {
  white-space: nowrap;
}

.byline span::before {
  content: "\00b7";
  margin-inline: 0.45rem;
}

/* Section titles: bold, upper-case, news-desk style */

.section-title {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(1.125rem, 1.02rem + 0.55vw, 1.45rem);
  line-height: 1.25;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  color: var(--ink);
  text-wrap: balance;
}

/* ---------- Media ---------- */

figure { margin: 0; }

.caption {
  margin: 0.6rem 0 0;
  font-size: 0.8125rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--muted);
}

.media-photo {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
  background: #e9e6e0;
}

.clip {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #e9e6e0;
}

.clip-portrait { aspect-ratio: 1 / 1; }
.clip-wide { aspect-ratio: 1200 / 630; }

.clip-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 62%;
}

.clip-wide .clip-video { object-position: 50% 50%; }

/* Text + clip pairing, driven by container width */

.split { container-type: inline-size; }

.split-inner {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "text"
    "media";
}

.split-text { grid-area: text; min-width: 0; }
.split-media { grid-area: media; min-width: 0; }

@container (min-width: 34rem) {
  .split-inner {
    gap: 2rem;
    align-items: start;
    grid-template-columns: 16.5rem minmax(0, 1fr);
    grid-template-areas: "media text";
  }

  .split-reverse .split-inner {
    grid-template-columns: minmax(0, 1fr) 16.5rem;
    grid-template-areas: "text media";
  }

  .split .clip-portrait { aspect-ratio: 4 / 5; }
}

/* ---------- Links and calls to action ---------- */

.story-link {
  font-weight: 700;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  transition: color 0.18s, background-color 0.18s;
}

.story-link:hover {
  color: var(--accent-dark);
  background: rgba(27, 107, 47, 0.08);
}

.cta-block { display: flex; }

.cta-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.25rem;
  padding: 0.8rem 1.5rem;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  border-radius: 6px;
  box-shadow: 0 2px 0 var(--accent-dark);
  transition: background-color 0.18s, transform 0.18s, box-shadow 0.18s;
}

.cta-button::after {
  content: "\2192";
  font-size: 1.15em;
  transition: transform 0.18s;
}

.cta-button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(18, 77, 32, 0.3);
}

.cta-button:hover::after { transform: translateX(3px); }

.cta-button:focus-visible { outline-offset: 4px; }

@media (min-width: 480px) {
  .cta-button {
    display: inline-flex;
    width: auto;
    min-width: 17rem;
    padding-inline: 2rem;
    font-size: 1.0625rem;
  }
}

/* ---------- How it works: numbered steps ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  column-gap: 0.9rem;
  padding-block: 1rem;
  border-top: 1px solid var(--rule);
}

.steps li:last-child { border-bottom: 1px solid var(--rule); }

.steps li::before {
  content: counter(step);
  grid-row: 1 / span 2;
  font-family: var(--serif);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}

.steps-title {
  grid-column: 2;
  font-weight: 800;
  line-height: 1.35;
  color: var(--ink);
}

.steps-text {
  grid-column: 2;
  margin-top: 0.2rem;
  font-size: 0.9688rem;
  line-height: 1.55;
  color: var(--text);
}

/* ---------- Figures strip (numbers from the provider facts) ---------- */

.figures {
  padding: 0;
  border-block: 1px solid var(--rule);
}

.figures > div {
  padding-block: 1rem;
}

.figures > div + div { border-top: 1px solid var(--rule); }

.figures dt {
  font-family: var(--serif);
  font-size: clamp(2rem, 1.6rem + 1.8vw, 2.75rem);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}

.figures dd {
  margin: 0.35rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--muted);
}

@media (min-width: 480px) {
  .figures > div {
    display: grid;
    grid-template-columns: 8rem minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
  }

  .figures dd { margin: 0; }
}

@media (min-width: 768px) {
  .figures {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .figures > div {
    display: block;
    padding: 1.4rem 1.25rem;
  }

  .figures > div:first-child { padding-left: 0; }

  .figures > div + div {
    border-top: 0;
    border-left: 1px solid var(--rule);
  }

  .figures dd { margin-top: 0.5rem; }
}

/* ---------- Common mistakes ---------- */

.mistake-title {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--sans);
  font-size: clamp(1.1875rem, 1.08rem + 0.5vw, 1.4rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
}

.chapter > .mistake-title { margin-top: 2.25rem; }

.mistake-no {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--ink);
  color: #ffffff;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  border-radius: 50%;
}

.fix {
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
}

.fix-label {
  font-weight: 800;
  color: var(--accent);
}

/* Quote card: soft card, large opening mark */

.pullquote {
  position: relative;
  padding: 1.5rem 1.25rem 1.5rem 3.4rem;
  background: var(--paper);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.pullquote::before {
  content: "\201C";
  position: absolute;
  left: 1rem;
  top: 0.5rem;
  font-family: var(--serif);
  font-size: 3.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}

.pullquote p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1875rem, 1.05rem + 0.6vw, 1.4rem);
  line-height: 1.45;
  color: var(--ink);
}

@media (min-width: 768px) {
  .pullquote { padding: 1.75rem 2rem 1.75rem 4.25rem; }
  .pullquote::before { left: 1.4rem; top: 0.6rem; font-size: 4.5rem; }
}

/* ---------- Needs list ---------- */

.needs {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.needs li {
  position: relative;
  padding-left: 2rem;
}

.needs li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.42em;
  width: 0.9rem;
  height: 0.5rem;
  border-left: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  transform: rotate(-45deg);
}

/* ---------- FAQ accordion ---------- */

.faq {
  background: var(--paper);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.faq-item + .faq-item { border-top: 1px solid var(--rule); }

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  transition: background-color 0.18s;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  flex: none;
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1;
  color: var(--accent);
}

.faq-item[open] summary::after { content: "\2212"; }

.faq-item summary:hover { background: #faf8f4; }

.faq-item summary:focus-visible { outline-offset: -3px; }

.faq-item p {
  margin: 0;
  padding: 0 1.25rem 1.25rem;
  font-size: 0.9688rem;
  line-height: 1.6;
}

/* ---------- Closing call to action ---------- */

.chapter-close { text-align: center; }

.chapter-close > .cta-block { justify-content: center; }

.chapter-close > .section-title { text-wrap: balance; }

/* ---------- Legal and about documents ---------- */

.doc {
  display: grid;
  grid-template-columns: var(--page-cols);
  padding-block: 2rem 3rem;
}

.doc > * {
  grid-column: content;
  min-width: 0;
  margin: 0;
}

.doc > * + * { margin-top: 1rem; }

.doc-title {
  font-family: var(--sans);
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.doc-meta {
  font-size: 0.875rem;
  color: var(--muted);
}

.doc h2 {
  margin-top: 2.25rem;
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
}

.doc ul,
.doc ol { padding-left: 1.25rem; }

.doc li + li { margin-top: 0.4rem; }

.doc a {
  font-weight: 700;
  text-decoration-thickness: 2px;
  transition: color 0.18s;
}

.doc a:hover { color: var(--accent-dark); }

.doc address {
  font-style: normal;
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
}

/* ---------- Footer (publisher imprint) ---------- */

.page-end {
  grid-area: footer;
  display: grid;
  grid-template-columns: var(--page-cols);
  padding-block: 2.5rem 3.5rem;
  background: var(--paper);
  color: #595959;
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.page-end > * {
  grid-column: content;
  min-width: 0;
  margin: 0;
}

.page-end > * + * { margin-top: 1.25rem; }

.company p { margin: 0; }

.company strong { color: #2f2f2f; }

.legal_links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal_links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #3a3a3a;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.18s;
}

.legal_links a:hover { color: var(--accent); }

.end_line { max-width: 46rem; }
