/* AI Security Study Guide · drmelfenner.com
   Change the colors here to match the rest of the site. */
:root {
  --ink: #1b2430;
  --ink-soft: #4a5565;
  --line: #e2e6ec;
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --brand: #0f2742;        /* header and headings */
  --accent: #1d6fb8;       /* links and active states */
  --accent-soft: #e8f1fa;
  --tip: #b7791f;          /* "On the exam" callouts */
  --tip-soft: #fdf6e7;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1rem; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 10; }

/* Header */
.site-header { background: var(--brand); color: #fff; }
.header-inner { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-top: 18px; flex-wrap: wrap; }
.brand { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.guide-link { color: #c9d8ea; text-decoration: none; font-size: 0.95rem; }
.guide-link:hover { color: #fff; }
.domain-nav { display: flex; gap: 6px; padding: 14px 0 16px; overflow-x: auto; scrollbar-width: none; }
.domain-nav::-webkit-scrollbar { display: none; }
.domain-nav a {
  flex: none; color: #dbe6f3; text-decoration: none; font-size: 0.9rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.25);
}
.domain-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.domain-nav a.active { background: #fff; color: var(--brand); border-color: #fff; }

/* Layout */
.layout { display: grid; grid-template-columns: 1fr; gap: 40px; padding-top: 32px; padding-bottom: 56px; }
@media (min-width: 1000px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr); }
  .sidebar { position: sticky; top: 20px; align-self: start; max-height: calc(100vh - 40px); overflow-y: auto; }
}
@media (max-width: 999px) { .sidebar { display: none; } }

.toc { font-size: 0.9rem; border-left: 2px solid var(--line); padding-left: 14px; }
.toc-title { font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.75rem; margin: 0 0 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0 0 6px; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--accent); }

/* Article */
.prose { max-width: 760px; min-width: 0; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 6px; }
.prose h1 { color: var(--brand); font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.2; margin: 0 0 10px; }
.byline { color: var(--ink-soft); font-size: 0.95rem; margin: 0 0 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.prose h2 { color: var(--brand); font-size: 1.55rem; line-height: 1.3; margin: 2.6rem 0 0.8rem; padding-top: 0.4rem; }
.prose h3 { color: var(--brand); font-size: 1.15rem; margin: 1.8rem 0 0.5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose li { margin-bottom: 0.4rem; }
.prose li > p { margin: 0; }
.prose strong { color: #111a26; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1.2rem 0 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.93rem; line-height: 1.5; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { background: var(--bg-soft); color: var(--brand); font-weight: 700; }
.prose tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) { .prose td, .prose th { min-width: 150px; } }

/* Diagrams */
.diagram { margin: 1.6rem 0 1.8rem; }
.diagram img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.diagram figcaption { color: var(--ink-soft); font-size: 0.85rem; margin-top: 8px; }

/* "On the exam" callouts */
.exam-tip { background: var(--tip-soft); border-left: 4px solid var(--tip); border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 18px; margin: 1.6rem 0 2rem; }
.exam-tip .tip-label { font-weight: 700; color: var(--tip); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.78rem; margin: 0 0 4px; }
.exam-tip p:last-child { margin-bottom: 0; }

/* Practice questions */
.prose ol > li > ul { list-style: none; padding-left: 0.4rem; margin-top: 0.4rem; }
.prose ol > li > ul > li { margin-bottom: 0.2rem; }
.answers { background: var(--accent-soft); border-radius: var(--radius); padding: 14px 18px; margin: 1.2rem 0 2rem; }
.answers summary { cursor: pointer; font-weight: 700; color: var(--brand); }
.answers[open] summary { margin-bottom: 0.8rem; }
.answers ol { margin-bottom: 0; }

/* Previous / next */
.prev-next { display: flex; justify-content: space-between; gap: 16px; margin-top: 3rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.prev-next a { display: block; max-width: 48%; text-decoration: none; font-weight: 600; font-size: 0.95rem; line-height: 1.4; }
.prev-next a span { display: block; color: var(--ink-soft); font-weight: 400; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.prev-next .next { text-align: right; margin-left: auto; }

/* Footer */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.88rem; padding: 24px 0 32px; }
.site-footer p { margin: 0 0 6px; max-width: 760px; }

@media print {
  .site-header, .sidebar, .prev-next, .site-footer { display: none; }
  .answers { background: none; }
  body { font-size: 12pt; }
}
