/*
 * zkSecurity Newsletter
 * Layout + chrome use Tailwind (CDN) with the zero-security site's
 * header/footer partials. This file only carries the accent tokens,
 * the nav scroll / mobile-menu behavior, and prose styling for
 * rendered markdown.
 */
:root {
  --accent-300: #fcd34d;
  --accent-400: #fbbf24;
  --accent-500: #f59e0b;
  --accent-600: #d97706;
  --accent-700: #b45309;
}

body {
  color: #0f172a;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #ffffff;
}

/* ── Navigation (zero-security header) ───────────────────────── */
#main-nav.scrolled {
  height: 64px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
#main-nav.scrolled img { height: 2rem; }

#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, opacity 0.2s ease-out;
  opacity: 0;
}
#mobile-menu.open {
  max-height: 640px; /* zero-security uses 400px, which clips the 8-link menu */
  opacity: 1;
  transition: max-height 0.4s ease-in, opacity 0.2s ease-in;
}

/* ── Prose (rendered markdown: editorial intro + blurbs) ─────── */
.prose { color: #334155; font-size: 16px; line-height: 1.7; }
.prose p { margin: 0 0 1.1em; }
.prose h2 { font-size: 1.4rem; font-weight: 700; color: #0f172a; margin: 1.6em 0 0.5em; }
.prose h3 { font-size: 1.15rem; font-weight: 700; color: #0f172a; margin: 1.4em 0 0.4em; }
.prose a { color: var(--accent-700); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--accent-600); }
.prose ul { margin: 0 0 1.1em 1.3em; list-style: disc; }
.prose ol { margin: 0 0 1.1em 1.3em; list-style: decimal; }
.prose li { margin: 0.3em 0; }
.prose strong { color: #0f172a; }
.prose blockquote {
  border-left: 3px solid var(--accent-500);
  padding: 4px 0 4px 16px;
  margin: 1.2em 0;
  color: #475569;
}
.prose code { background: #f1f5f9; padding: 2px 6px; border-radius: 6px; font-size: 0.9em; }
.prose pre {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  margin: 1.2em 0;
}
.prose pre code { background: none; padding: 0; }
.prose .admonition {
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--accent-500);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 1.2em 0;
  background: #fffbeb;
}
.prose .admonition-title { font-weight: 700; color: #0f172a; margin-bottom: 4px; }
.codehilite { background: transparent; }

/* ── Print / PDF (used by `newsletter pdf`) ──────────────────── */
@media print {
  /* A4 with even margins; the renderer prefers this over its own size. */
  @page { size: A4; margin: 16mm 14mm; }

  html, body { background: #ffffff !important; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* Drop the site chrome: nav, its spacer, the subscribe block, the footer,
     and the "All issues" back-link at the top of an issue. */
  #main-nav,
  .h-20,
  #subscribe,
  footer,
  main a[href="/"] {
    display: none !important;
  }

  /* Let the article fill the page instead of sitting in a centered card. */
  main {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  article {
    max-width: none !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  /* Keep individual items and highlight cards intact across page breaks. */
  li,
  .rounded-xl {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  /* Keep a section's eyebrow + heading together, and with its first item,
     so an eyebrow never strands at the bottom of a page. */
  section > .mb-5 {
    break-inside: avoid;
    page-break-inside: avoid;
    break-after: avoid;
    page-break-after: avoid;
  }
  h1, h2, h3 {
    break-after: avoid;
    page-break-after: avoid;
  }
  p { orphans: 3; widows: 3; }
}
