/* Not Done Living - one small stylesheet for the whole site.
   Replaces sites.css + main_style.css + all the JavaScript. */

:root {
  --bg: #000;
  --text: #fff;
  --muted: #999;           /* nav and footer links, on black */
  --box-bg: #d5d5d5;       /* the grey content boxes */
  --box-text: #2a2a2a;
  --box-link: #0a4f6b;     /* links inside grey boxes (was #999: about 2:1 contrast) */
  --accent: #3996b8;       /* blue "Project" tag */
  --width: 1140px;         /* content width; the page gutter comes on top of this */
  --gutter: 30px;
  --gap: 70px;             /* space between boxes */
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font);
}

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

a { color: var(--muted); text-decoration: none; }
a:hover, a:focus { color: var(--text); }


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

.site-header {
  position: relative;      /* so the dropdown draws on top of the hero */
  z-index: 10;
  padding: 32px 16px 24px;
  text-align: center;
}

.site-title {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--text);
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

nav { position: relative; }
nav ul { margin: 0; padding: 0; list-style: none; }
nav > ul { display: flex; flex-wrap: wrap; justify-content: center; }
nav li { position: relative; }

nav a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
nav a[aria-current] { color: var(--text); }

/* Dropdown under ME/CFS. Opens on hover, and on keyboard focus. */
nav li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 90vw;
  padding: 6px 0;
  background: var(--bg);
  box-shadow: 0 0 8px #444;
  text-align: left;
}
nav li:hover > ul,
nav li:focus-within > ul { display: block; }

nav li ul a {
  padding: 10px 20px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.6);
}
nav li ul a:hover, nav li ul a:focus { color: var(--text); }


/* ---------- Home page banner ---------- */

.hero {
  display: flex;
  align-items: flex-end;
  min-height: 430px;
  margin-bottom: 50px;
  background: url(../hero.jpg) center top / cover no-repeat;
}

.hero h1 {
  width: 100%;
  max-width: calc(var(--width) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) 80px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-align: right;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);   /* keeps it readable over the pale part of the photo */
}


/* ---------- Article page title banner ---------- */
/* The photo is optional: save it as src/banner.jpg (plain black shows if it is missing). */

.banner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 230px;
  margin-bottom: 50px;
  padding: 40px 20px;
  background: #000 url(../banner.jpg) center / cover no-repeat;
  text-align: center;
}

.banner h1 {
  min-width: 0;
  max-width: var(--width);
  margin: 0;
  overflow-wrap: break-word;
  color: #d5d5d5;
  font-size: clamp(2rem, 6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}


/* ---------- Grey boxes ---------- */
/* Every box is a <section class="card"> holding an optional image plus a <div> of text.
   Whatever comes first in the HTML shows first (left on wide screens, top on narrow). */

.card {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  width: min(var(--width), calc(100% - 2 * var(--gutter)));
  margin: 0 auto var(--gap);
  padding: 50px 20px;
  background: var(--box-bg);
  color: var(--box-text);
  font-size: 18px;
}
.card > * { flex: 1 1 0; min-width: 0; }   /* equal columns */

.card a { color: var(--box-link); text-decoration: underline; }
.card a:hover, .card a:focus { color: #000; }

.card p { margin: 0 0 30px; }

.card h2 {
  margin: 0 0 30px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  /* If the heading starts with a .tag, the tag sits beside the title text
     (the text becomes the second column) rather than the title wrapping under it. */
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 24px;
  align-items: baseline;
}

.card ul { margin: 0 0 30px; padding-left: 2em; }
.card li { margin: 0 0 8px; }
.card li:last-child { margin-bottom: 0; }
.card p + ul { margin-top: -18px; }    /* pulls a list up under the sentence that introduces it */

.card h3 {                             /* sub-headings such as AUDIBLE / ALEXA / YOUTUBE */
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Photos live in <div class="pics">. Beside the text (a direct child of the card) they stack in a
   narrow column. Inside the text, a pair sits side by side and a lone photo shows at natural size. */
.pics { display: flex; align-items: flex-start; gap: 20px; margin: 0 0 30px; }
.pics img { flex: 0 1 auto; min-width: 0; margin: 0 auto; }
.pics img:not(:only-child) { flex: 1 1 0; margin: 0; }
.card > .pics { flex: 0 0 34%; flex-direction: column; margin: 0; }
.card > .pics img { flex: none; width: 100%; margin: 0; }

.tag {
  padding: 0 16px;
  background: var(--accent);
  color: var(--box-bg);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.card div > :last-child { margin-bottom: 0; }


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

.site-footer {
  padding: 30px var(--gutter);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
}
.site-footer p { max-width: var(--width); margin: 0 auto; }

/* ---------- Just Invisible section: green banner (no photo) ---------- */

.banner-green { background: #017100; }


/* Centred callout, e.g. the COVID/telehealth note on the Just Invisible page */
.note {
  max-width: var(--width);
  margin: -20px auto 0;
  padding: 40px 20px;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

/* Download / report-link buttons */
.buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block;
  padding: 14px 26px;
  background: #999;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.card a.btn, .card a.btn:hover, .card a.btn:focus { text-decoration: none; color: #fff; }
.btn:hover, .btn:focus { background: #b3b3b3; color: #fff; }


/* ---------- Narrow screens ---------- */

@media (max-width: 700px) {
  :root { --gutter: 20px; --gap: 40px; }
  nav a { padding: 10px 12px; }
  nav li { position: static; }   /* dropdown centres under the whole menu, so it can't run off the edge */
  .hero h1 { padding-bottom: 40px; font-size: 26px; }
  .card { flex-direction: column; gap: 20px; padding: 30px 20px; }
  .card > *, .card > .pics { flex: none; width: 100%; }
  .pics { flex-direction: column; }
  .pics img, .pics img:not(:only-child) { flex: none; width: 100%; margin: 0; }
  .banner { min-height: 160px; margin-bottom: 30px; padding: 30px 20px; }
  .card h2 { grid-template-columns: 1fr; row-gap: 10px; }   /* tag above the title, not beside it */
  .tag { justify-self: start; }
}
