/*
Theme Name: Henry
Theme URI: https://travelswithhenry.com/
Author: Travels with Henry
Description: Calm, low-glare reading theme for the Travels with Henry sleep story site. Dark by default because the site is opened at night, in bed. Works alongside Elementor: any page can be rebuilt visually without touching the theme.
Version: 1.2.1
Requires at least: 6.0
Requires PHP: 8.0
License: Proprietary
Text Domain: henry
*/

/* === VERSION: 1.0.0 ===
   Last change: Created 2026-07-31. Port of the approved static site visual system
   (henry_site/static/style.css v0.1.0) to the WordPress theme. Requested by SoboL. */

/* === TOKENS ===
   Dark by default: this site is opened at night, in bed, in the dark. A light theme
   follows the system setting for daytime browsing but is not the primary case. */

:root {
  --ink: #0d1218;
  --ink-2: #141b23;
  --ink-3: #1b242e;
  --paper: #e8e2d6;
  --paper-dim: #a8a396;
  --gold: #c9a55c;
  --gold-dim: #8a7340;
  --line: #26313d;
  --measure: 34rem;
  --wide: 60rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --ink: #f6f2e9;
    --ink-2: #efe9dc;
    --ink-3: #e6dfd0;
    --paper: #22282e;
    --paper-dim: #5d6670;
    --gold: #8a6d2c;
    --gold-dim: #a08a55;
    --line: #d8cfbd;
  }
}

/* === BASE === */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

main { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem 5rem; }
main.wide { max-width: var(--wide); }

h1, h2, h3 { font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin: 0 0 1rem; }
h2 { font-size: 1.4rem; margin: 3rem 0 1rem; }
h3 { font-size: 1.12rem; margin: 2rem 0 .5rem; }

p { margin: 0 0 1.25rem; }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--paper); }
ul { padding-left: 1.1rem; }
li { margin-bottom: .6rem; }
strong { font-weight: 600; }
img { max-width: 100%; height: auto; }
figure { margin: 0; }

.lede { font-size: 1.15rem; color: var(--paper-dim); }
.eyebrow {
  font-family: var(--sans); font-size: .72rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold-dim); margin: 0 0 .75rem;
}

/* Skip link, visible only on keyboard focus */
.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 1rem; top: 1rem; z-index: 10; background: var(--gold); color: var(--ink);
  padding: .6rem 1rem; font-family: var(--sans); font-size: .85rem; border-radius: 2px;
}

/* === HEADER / FOOTER === */

header.site {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  align-items: baseline; justify-content: space-between;
  max-width: var(--wide); margin: 0 auto; padding: 1.75rem 1.25rem 2.5rem;
}
.brand { text-decoration: none; color: var(--paper); display: block; }
.brand-name { display: block; font-size: 1.1rem; letter-spacing: .01em; }
.brand-sub {
  display: block; font-family: var(--sans); font-size: .72rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--gold-dim);
}
header.site nav ul {
  display: flex; flex-wrap: wrap; gap: 1.25rem; list-style: none; margin: 0; padding: 0;
  font-family: var(--sans); font-size: .85rem;
}
header.site nav li { margin: 0; }
header.site nav a { color: var(--paper-dim); text-decoration: none; }
header.site nav a:hover,
header.site nav .current-menu-item > a { color: var(--gold); }

footer.site {
  border-top: 1px solid var(--line); max-width: var(--wide);
  margin: 4rem auto 0; padding: 2rem 1.25rem 4rem;
  font-family: var(--sans); font-size: .85rem; color: var(--paper-dim);
}
footer.site a { color: var(--paper-dim); }
footer.site a:hover { color: var(--gold); }
footer.site .fine { font-size: .78rem; line-height: 1.6; max-width: 40rem; }

/* === BUTTONS === */

.button {
  display: inline-block; margin: .35rem .5rem .35rem 0; padding: .7rem 1.35rem;
  font-family: var(--sans); font-size: .9rem; text-decoration: none;
  background: var(--gold); color: var(--ink); border-radius: 2px;
}
.button:hover { background: var(--paper); color: var(--ink); }
.button.ghost { background: transparent; color: var(--paper); border: 1px solid var(--line); }
.button.ghost:hover { border-color: var(--gold); color: var(--gold); background: transparent; }

/* === HOME === */

.promise-list { list-style: none; padding: 0; }
.promise-list li {
  border-left: 2px solid var(--line); padding: 0 0 0 1.1rem; margin-bottom: 1.1rem;
}
.promise-list strong { color: var(--gold); }

.hero-full {
  position: relative;
  margin: -1rem calc(50% - 50vw) 2.5rem;
  width: 100vw;
  max-width: 100vw;
}
.hero-full img {
  display: block;
  width: 100%;
  height: clamp(15rem, 56vw, 34rem);
  object-fit: cover;
  object-position: center 45%;
}
.hero-full::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.12) 0%, rgba(0,0,0,.05) 35%, rgba(0,0,0,.62) 100%);
}
.hero-text {
  position: absolute;
  z-index: 1;
  left: 0; right: 0; bottom: 0;
  padding: 0 1.25rem 1.75rem;
  max-width: var(--wide);
  margin: 0 auto;
}
.hero-text h1 {
  margin: 0;
  color: #f4efe4;
  font-size: clamp(1.5rem, 4.2vw, 2.5rem);
  line-height: 1.2;
  text-shadow: 0 2px 18px rgba(0,0,0,.55);
}

.intro .lede { font-size: 1.2rem; color: var(--paper); }
.first-episode {
  margin-top: 3rem; padding: 1.75rem;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 3px;
}
.first-episode h2 { margin-top: 0; }
.meta-line { font-family: var(--sans); font-size: .8rem; color: var(--paper-dim); }
.soon { margin-top: 3rem; }

/* === EPISODE LIST === */

.rows { border-top: 1px solid var(--line); margin-top: 2rem; }
.row {
  display: flex; gap: 1.25rem; align-items: baseline;
  padding: 1.1rem .25rem; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--paper);
}
.row:hover { background: var(--ink-2); }
.row-num { font-family: var(--sans); font-size: .8rem; color: var(--gold-dim); }
.row-main em {
  display: block; font-style: normal; font-family: var(--sans);
  font-size: .8rem; color: var(--paper-dim);
}

/* === EPISODE PAGE === */

.video {
  position: relative; aspect-ratio: 16/9; margin: 2rem 0 1.25rem;
  background: var(--ink-2); border: 1px solid var(--line);
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.meta-row {
  display: flex; flex-wrap: wrap; gap: 1.25rem;
  font-family: var(--sans); font-size: .78rem; color: var(--paper-dim);
  padding-bottom: 1.5rem; border-bottom: 1px solid var(--line);
}

.chapters ul { list-style: none; padding: 0; }
.chapters li { display: flex; gap: .9rem; margin-bottom: .35rem; }
.ts { font-family: var(--sans); font-size: .8rem; color: var(--gold-dim); min-width: 3.4rem; }

.transcript .note { font-family: var(--sans); font-size: .85rem; color: var(--paper-dim); }
.transcript p:first-of-type::first-letter {
  float: left; font-size: 3.1rem; line-height: .82; padding: .12em .09em 0 0; color: var(--gold);
}

/* Images spaced through the transcript. Full measure width, breathing room either side. */
figure.beat { margin: 2.25rem calc(50% - 50vw) 2.25rem; width: 100vw; max-width: 100vw; }
figure.beat img { display: block; width: min(100%, var(--wide)); margin: 0 auto; border-radius: 2px; }

.cta {
  margin-top: 3.5rem; padding: 1.75rem; background: var(--ink-2);
  border: 1px solid var(--line); border-radius: 3px;
}
.cta h2 { margin-top: 0; }

.prose { padding-top: 1rem; }

/* === MOTION === */

@media (prefers-reduced-motion: no-preference) {
  a, .row { transition: color .18s ease, background-color .18s ease, border-color .18s ease; }
}

/* === ELEMENTOR COEXISTENCE ===
   Elementor injects its own container widths. Keep its sections full-bleed inside main
   so a page rebuilt visually is not squeezed into the reading measure. */

main .elementor { width: 100%; }
