/* macdougal.com — one stylesheet, no framework.
   Colors echo the Make a Difference book cover: deep blue and gold. */

:root {
  --ink: #1d2433;
  --muted: #5a6274;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --tint: #f1eee5;
  --line: #e2ddd0;
  --blue: #1b2f6e;
  --blue-ink: #22408f;
  --gold: #c9a227;
  --gold-soft: #f3e7b8;
  --on-blue: #ffffff;
  --on-blue-muted: #c9d1ea;
  --focus: #c9a227;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure: 40rem;
  --wide: 72rem;
  --gutter: 1rem;
  --radius: 6px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e7e9ef;
    --muted: #a5adbf;
    --paper: #12161f;
    --surface: #1a1f2b;
    --tint: #1f2533;
    --line: #2e3546;
    --blue: #142453;
    --blue-ink: #9fb6ff;
    --gold: #d9b64a;
    --gold-soft: #3a3320;
    --on-blue-muted: #b4bedc;
  }
}

@media (min-width: 40rem) {
  :root { --gutter: 1.5rem; }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--serif);
  overflow-wrap: break-word;
}

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

a { color: var(--blue-ink); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { line-height: 1.2; font-weight: 600; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.5rem + 2.5vw, 3rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wide); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: calc(var(--measure) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.eyebrow {
  font: 600 0.8rem/1.3 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--blue-ink); text-decoration: underline; }

.skip-link {
  position: absolute; left: 0.5rem; top: -3rem; z-index: 10;
  background: var(--surface); color: var(--ink); padding: 0.5rem 0.75rem;
  font-family: var(--sans); border-radius: var(--radius);
}
.skip-link:focus { top: 0.5rem; }

/* ---------- Header and menu ---------- */

.site-header {
  background: var(--blue);
  color: var(--on-blue);
  border-bottom: 3px solid var(--gold);
  position: relative;
  z-index: 5;
}
.header-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 1.5rem; min-height: 4rem; padding-block: 0.5rem;
}
.wordmark {
  font: 600 1.5rem/1.1 var(--serif);
  color: var(--on-blue);
  text-decoration: none;
  letter-spacing: 0.005em;
}
.wordmark:hover { color: var(--gold-soft); }
@media (prefers-color-scheme: dark) { .wordmark:hover { color: var(--gold); } }

.menu-toggle {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font: 600 0.95rem var(--sans); color: var(--on-blue);
  background: transparent; border: 1px solid rgba(255,255,255,0.45); border-radius: var(--radius);
  padding: 0.5rem 0.8rem; min-height: 2.75rem; cursor: pointer;
}
.menu-toggle-bars, .menu-toggle-bars::before, .menu-toggle-bars::after {
  display: block; width: 1.1rem; height: 2px; background: currentColor; position: relative;
}
.menu-toggle-bars::before, .menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after { top: 6px; }

.site-nav { font-family: var(--sans); font-size: 0.95rem; flex-basis: 100%; }
.nav-list, .nav-sub { list-style: none; margin: 0; padding: 0; }

.site-nav a, .site-nav summary {
  color: var(--on-blue);
  text-decoration: none;
  display: block;
  padding: 0.7rem 0.25rem;
  cursor: pointer;
}
.site-nav summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; }
.site-nav summary::-webkit-details-marker { display: none; }
.site-nav summary::after {
  content: ""; width: 0.45em; height: 0.45em; flex: none;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform 0.15s;
}
.site-nav details[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.site-nav a:hover, .site-nav summary:hover { color: var(--gold-soft); }
.site-nav [aria-current="page"], .nav-item.is-active > a, .nav-item.is-active > details > summary { color: var(--gold); }

/* Phone: collapsible stacked menu (only collapsed when JS is available). */
@media (max-width: 55.99rem) {
  .nav-list { border-top: 1px solid rgba(255,255,255,0.18); }
  .nav-item { border-bottom: 1px solid rgba(255,255,255,0.12); }
  .nav-sub { padding: 0 0 0.5rem 1rem; }
  .nav-sub a { padding-block: 0.55rem; color: var(--on-blue-muted); }
  .js .site-nav:not(.is-open) { display: none; }
}

/* Desktop: one row with dropdown panels. */
@media (min-width: 56rem) {
  .menu-toggle { display: none !important; }
  .site-nav { flex-basis: auto; }
  .nav-list { display: flex; align-items: center; gap: 0.25rem; }
  .nav-item { position: relative; }
  .site-nav a, .site-nav summary { padding: 0.6rem 0.6rem; border-radius: var(--radius); }
  .nav-sub {
    position: absolute; top: calc(100% + 0.35rem); left: 0; min-width: 16rem; max-width: 24rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(10, 20, 50, 0.18); padding: 0.4rem;
  }
  .nav-item:last-child .nav-sub, .nav-item:nth-last-child(2) .nav-sub { left: auto; right: 0; }
  .nav-sub a { color: var(--ink); padding: 0.5rem 0.7rem; line-height: 1.35; }
  .nav-sub a:hover { background: var(--tint); color: var(--blue-ink); }
  .nav-sub [aria-current="page"] { color: var(--blue-ink); font-weight: 600; }
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: 0.55rem 1.1rem;
  font: 600 0.95rem/1.2 var(--sans);
  background: var(--blue); color: var(--on-blue);
  border: 2px solid var(--blue); border-radius: var(--radius);
  text-decoration: none; text-align: center;
}
.button:hover { background: var(--blue-ink); border-color: var(--blue-ink); color: var(--on-blue); }
.button-quiet { background: transparent; color: var(--blue-ink); border-color: currentColor; }
.button-quiet:hover { background: var(--tint); color: var(--blue-ink); border-color: currentColor; }
@media (prefers-color-scheme: dark) {
  .button { background: var(--gold); border-color: var(--gold); color: #1a1a1a; }
  .button:hover { background: var(--gold-soft); border-color: var(--gold); color: var(--ink); }
  .button-quiet { background: transparent; color: var(--blue-ink); border-color: currentColor; }
}
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* ---------- Home ---------- */

.hero { padding-block: 2.5rem 3rem; background: var(--tint); border-bottom: 1px solid var(--line); }
.hero-inner { display: grid; gap: 1.75rem; align-items: start; }
.portrait { margin: 0; justify-self: start; width: min(15.5rem, 60vw); }
.portrait img {
  border-radius: var(--radius);
  box-shadow: 0 0 0 6px var(--surface), 0 12px 30px rgba(20, 30, 60, 0.2);
}
.hero h1 { margin-bottom: 0.75rem; }
.lede { font-size: 1.125rem; max-width: 44rem; }
@media (min-width: 48rem) {
  .hero { padding-block: 3.5rem 4rem; }
  .hero-inner { grid-template-columns: 15.5rem 1fr; gap: 3rem; }
  .portrait { width: 15.5rem; }
}

.book { background: var(--blue); color: var(--on-blue); padding-block: 3rem; }
.book-inner { display: grid; gap: 2rem; }
.book-cover { justify-self: center; width: 13rem; }
.book-cover img { filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.35)); }
.book h2 { color: var(--gold); letter-spacing: 0.06em; margin-bottom: 0.4rem; }
.book-subtitle { color: var(--on-blue-muted); }
.book-subtitle strong { color: var(--on-blue); font-size: 1.15rem; }
.book blockquote {
  margin: 1.5rem 0; padding-left: 1.1rem; border-left: 3px solid var(--gold);
  font-style: italic; font-size: 1.08rem;
}
.book blockquote p { margin-bottom: 0.4rem; }
.book blockquote footer { font: normal 0.9rem/1.4 var(--sans); color: var(--on-blue-muted); }
.book blockquote footer strong { font-weight: 600; }
.book .button { background: var(--gold); border-color: var(--gold); color: #1a1a1a; }
.book .button:hover { background: var(--gold-soft); border-color: var(--gold-soft); }
.book .button-quiet { background: transparent; color: var(--on-blue); border-color: rgba(255,255,255,0.6); }
.book .button-quiet:hover { background: rgba(255,255,255,0.1); color: var(--on-blue); }
@media (min-width: 48rem) {
  .book { padding-block: 4rem; }
  .book-inner { grid-template-columns: 13rem 1fr; gap: 3.5rem; align-items: start; }
  .book-cover { justify-self: start; }
}

.reviews { padding-block: 3rem 1rem; }
.review-list {
  list-style: none; margin: 1.25rem 0 0; padding: 0;
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}
.review-list li {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; display: flex; flex-direction: column; justify-content: space-between;
}
.review-list li > p:first-child { font-size: 1.1rem; font-style: italic; }
.review-by { margin: 0; font: 0.85rem/1.4 var(--sans); color: var(--muted); }
.review-by strong { color: var(--ink); font-weight: 600; margin-right: 0.35em; }

.writing { padding-block: 2.5rem 4rem; }
.list-grid { display: grid; gap: 2rem 3rem; margin-top: 1.5rem; }
@media (min-width: 56rem) {
  .list-grid { grid-template-columns: 1fr 1fr; }
  .link-list-wide { grid-row: span 3; }
}
.link-list h3 {
  font: 600 0.8rem/1.3 var(--sans); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); padding-bottom: 0.6rem; border-bottom: 2px solid var(--gold); margin-bottom: 0.25rem;
}
.link-list ul { list-style: none; margin: 0; padding: 0; }
.link-list li { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.link-list li a { font-size: 1.08rem; font-weight: 600; text-decoration: none; line-height: 1.35; display: inline-block; }
.link-list li a:hover { text-decoration: underline; }
.link-list .meta { display: block; font: 0.85rem/1.4 var(--sans); color: var(--muted); margin-top: 0.2rem; }

/* ---------- Article ---------- */

.article, .page { padding-block: 2.5rem 4rem; }
.article-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.dek { font-size: 1.25rem; line-height: 1.45; color: var(--muted); font-style: italic; }
.byline { font: 0.9rem/1.4 var(--sans); color: var(--muted); margin: 0; }
.byline .sep { margin-inline: 0.15em; }

.prose { font-size: 1.125rem; line-height: 1.7; }
.prose p { margin-bottom: 1.15em; }
.prose em { color: var(--muted); }

.lead-figure { margin: 0 0 1.5rem; }
.lead-figure img { border-radius: var(--radius); width: 100%; }
@media (min-width: 48rem) {
  .lead-figure { float: right; width: 20rem; margin: 0.35rem -4rem 1rem 2rem; }
}

.original-clipping { clear: both; margin-top: 2.5rem; }
.original-clipping a {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.9rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); font: 600 1rem/1.35 var(--sans);
}
.original-clipping a:hover { border-color: var(--blue-ink); color: var(--blue-ink); }
.original-clipping picture { flex: none; width: 5.5rem; }
.original-clipping img { border: 1px solid var(--line); background: #fff; }
.original-clipping small { font-weight: normal; color: var(--muted); }

/* Original header lines of reprinted articles (publication, date, copyright, byline). */
.source-lines span { display: block; }
.source-lines span + span { margin-top: 0.1rem; }

.prose h2 { font-size: 1.35rem; margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.4rem; }
.prose figure { margin: 2rem 0; }
.prose figcaption { font: 0.85rem/1.45 var(--sans); color: var(--muted); margin-top: 0.5rem; }
.page-figure img { margin-inline: auto; border-radius: 2px; }
.page.wrap .page-figure img { box-shadow: 0 2px 14px rgba(20, 30, 60, 0.15); }

/* Thumbnail of a newspaper clipping, linking to the original scan or PDF. */
.clipping { margin: 0 0 1.5rem; }
.clipping a { display: block; text-decoration: none; color: var(--ink); }
.clipping img { border: 1px solid var(--line); background: #fff; border-radius: 2px; margin-inline: auto; }
.clipping figcaption { font: 600 0.85rem/1.4 var(--sans); color: var(--blue-ink); text-align: center; margin-top: 0.5rem; }
.clipping figcaption small { font-weight: normal; color: var(--muted); }
.clipping a:hover figcaption { text-decoration: underline; }
@media (min-width: 48rem) {
  .clipping { float: right; max-width: 16rem; margin: 0.35rem -4rem 1rem 2rem; }
}

hr.page-break { clear: both; border: 0; height: 1px; background: var(--line); margin: 2.5rem auto; width: 40%; }

.video { position: relative; aspect-ratio: 16 / 9; margin: 1rem 0 2rem; background: #000; border-radius: var(--radius); overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-date { font: 600 0.85rem/1.3 var(--sans); color: var(--muted); letter-spacing: 0.04em; margin-bottom: 0.5rem; }

.prose table { border-collapse: collapse; width: 100%; font-size: 1rem; margin: 1.5rem 0; }
.prose td { padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose td:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.prose td:empty { padding: 0; }

.prose .link-list ul { padding-left: 0; }
.prose .link-list li { margin: 0; }

/* Contact page: form, with the mailing address beside it on wide screens. */
.contact-layout { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 56rem) {
  .contact-layout { grid-template-columns: minmax(0, 40rem) 20rem; gap: 3.5rem; }
}
.contact-main h2 { margin-top: 0; }
.contact-mail {
  background: var(--tint); border-left: 3px solid var(--gold); border-radius: var(--radius);
  padding: 1.1rem 1.3rem; font-size: 1.05rem; line-height: 1.6;
}
.contact-mail p { margin: 0; }

.contact-form { font-family: var(--sans); font-size: 1rem; text-align: left; }
.contact-form .field { margin-bottom: 1.4rem; }
.contact-form label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.contact-form input, .contact-form textarea {
  display: block; width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid #cfc9ba; border-radius: var(--radius); padding: 0.7rem 0.8rem; min-height: 2.9rem;
}
@media (prefers-color-scheme: dark) { .contact-form input, .contact-form textarea { border-color: var(--line); } }
.contact-form input { max-width: 28rem; }
.contact-form textarea { min-height: 18rem; resize: vertical; line-height: 1.5; }
.contact-form input:focus, .contact-form textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--blue-ink); }
.contact-form .hint { display: block; font-size: 0.82rem; line-height: 1.4; color: var(--muted); margin-top: 0.4rem; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.form-actions .hint { margin-top: 0; }
.contact-form button[disabled] { opacity: 0.6; cursor: progress; }
.form-status { font-weight: 600; color: var(--blue-ink); margin-top: 1rem; }
.form-status.is-error { color: #b42318; }
@media (prefers-color-scheme: dark) { .form-status.is-error { color: #ff8a80; } }
/* Spam trap: also has the hidden attribute, so it stays hidden without CSS. */
.hp { display: none !important; }

.article-footer { clear: both; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-family: var(--sans); }
.back-link::before { content: "← "; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--tint); border-top: 1px solid var(--line);
  padding-block: 2rem 2.5rem; font: 0.85rem/1.55 var(--sans); color: var(--muted);
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-bottom: 1rem; }
.footer-nav a { color: var(--ink); font-weight: 600; }
.license { max-width: 52rem; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
