/* ---------------------------------------------------------------
   hannahzell.com — Hannah Zell, MA, LPCC

   Image-led and warm: full-bleed hero, forest green on cream, a booking
   button that follows you down the page, practice areas as cards.

   Colour tokens live in :root below, with dark-mode overrides in the
   prefers-color-scheme block. Every pairing clears WCAG AA.

   Part 1: reset, accessibility scaffolding, image placeholders.
   Part 2: the design itself, from "Header" onward.
   --------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

/* height: auto keeps an image's proportions when max-width shrinks it;
   without it, the height attribute holds and the photo is squashed. */
img {
  max-width: 100%;
  height: auto;
}

/* --- Accessibility -------------------------------------------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius, 6px) 0;
}

.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* --- Image placeholder ----------------------------------------
   Stands in for a photo that hasn't been supplied yet. Describes the
   shot that belongs there rather than showing an empty grey box.
   None are in use now that all three photos exist; kept for future slots.
   To fill one, add the photo to PHOTOS (eleventy.config.js) and use
   {% photo "key" %} in place of m.placeholder(...), or `photo: "key"` in
   place of `placeholder` in INLINE_IMAGES.
   --------------------------------------------------------------- */

.ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  aspect-ratio: var(--ph-ratio, 3 / 2);
  width: 100%;
  padding: 1.25rem;
  text-align: center;
  color: var(--muted);
  background-color: var(--ph-bg, var(--surface));
  border: 1px dashed var(--ph-border, var(--border));
  border-radius: var(--radius, 6px);
  /* Faint diagonal hatch so a placeholder is never mistaken for a real
     photo or for a broken image. */
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0 10px,
    var(--ph-hatch, rgba(128, 128, 128, 0.05)) 10px 20px
  );
}

.ph-mark svg {
  width: 1.75rem;
  height: 1.75rem;
  opacity: 0.65;
}

.ph-label {
  max-width: 34ch;
  font-size: 0.8125rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

@media (max-width: 30rem) {
  .ph-label {
    font-size: 0.75rem;
  }
  .ph {
    padding: 1rem;
  }
}

/* --- Colour, type and layout tokens --------------------------- */

/* Primary is a deep forest green — hue ~141°, cooler and truer than the
   earlier olive-leaning green (#3c5b38, ~113°). Clay is its
   complement (red-orange, opposite green on the wheel) and is used sparingly as
   a secondary marker. Neutrals carry a faint green undertone so nothing in the
   page reads as a different family. */
:root {
  --bg: #f8f7f1;
  --surface: #ffffff;
  --sunk: #edefe4;
  --text: #2a2e26;
  --muted: #5b6154;
  --accent: #2d5e3e;
  --accent-hover: #214a30;
  --on-accent: #ffffff;
  --clay: #9a5a34;
  --border: #e0e1d2;

  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;

  --measure: 36rem;
  --wrap: 68rem;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(42, 46, 38, 0.04), 0 8px 24px rgba(42, 46, 38, 0.07);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191c17;
    --surface: #222620;
    --sunk: #131610;
    --text: #ecebe1;
    --muted: #a8ae9e;
    --accent: #8cc79d;
    --accent-hover: #a5d6b2;
    --on-accent: #0f2216;
    --clay: #d79a6e;
    --border: #353a31;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --ph-hatch: rgba(255, 255, 255, 0.04);
  }
}

body {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.68;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* --- Header --------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 2rem;
  padding-block: 0.9rem;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  margin-right: auto;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
}

.brand-cred {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  display: inline-block;
  padding: 0.4rem 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav a:hover {
  color: var(--text);
}

.nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

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

.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  min-height: 44px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-solid {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-solid:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.header-cta {
  padding: 0.6rem 1.15rem;
}

@media (max-width: 52rem) {
  /* Phones and small tablets: no header button (owner's choice). It would add
     a third row to the stacked header; booking is reached via Contact. */
  .header-cta {
    display: none;
  }
  .header-inner {
    justify-content: center;
    text-align: center;
  }
  .brand {
    margin-right: 0;
    width: 100%;
    justify-content: center;
  }
  .nav {
    justify-content: center;
  }
}

/* --- Hero ----------------------------------------------------- */

.hero {
  position: relative;
  background: var(--sunk);
  border-bottom: 1px solid var(--border);
}

/* The home photograph is shown whole, at its own 16:9 proportions, with the
   title beneath it rather than laid over it: Hannah stands in the centre of
   the frame, exactly where an overlay panel would sit.

   The one exception is a screen wide or short enough that the full photo
   would push the title out of view. There the height is capped — the screen
   height less room for the header and title (the 17rem) — and the photo
   fills by trimming top and bottom, anchored just above centre to keep her
   face and shoulders in frame. Tune object-position if the photo changes.
   The 20rem floor stops it collapsing to a sliver on very short windows.
   Remove max-height to never trim. */
.hero-media img {
  display: block;
  width: 100%;
  max-height: max(20rem, calc(100vh - 17rem));
  max-height: max(20rem, calc(100svh - 17rem));
  object-fit: cover;
  object-position: 50% 40%;
}

/* The home page's h1, directly under the photo, on the page colour. Its
   ::before is a fade from that colour up over the foot of the photo, so the
   picture dissolves into the page instead of ending on a hard edge. The text
   itself sits on solid page colour, so it keeps the usual contrast in light
   and dark mode. */
.hero-blurb {
  position: relative;
  padding-top: clamp(0.5rem, 1.5vw, 1rem);
  background: var(--bg);
  color: var(--text);
}

.hero-blurb::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 100%;
  height: clamp(3rem, 10vw, 8rem);
  background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none;
}

.hero-blurb .hero-inner {
  padding-block: 0;
  max-width: var(--measure);
  margin-inline: auto;
  text-align: center;
}

.hero-blurb h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.4rem, 3.2vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* A tagline, if home.md ever has one: a paragraph of only bold text right
   after the # heading. */
.hero-blurb p {
  margin: 0.5rem 0 0;
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 1.9vw, 1.25rem);
  line-height: 1.55;
  text-wrap: balance;
}

.hero-blurb p strong {
  font-weight: 400;
}

/* Home page: the booking button, moved here from the header. */
.hero-cta {
  /* The bottom padding separates the button from "Hi I'm Hannah," below.
     Only the home page has this element, so other pages are unaffected. */
  padding-block: clamp(1.25rem, 3vw, 1.75rem) clamp(1.75rem, 4.5vw, 3rem);
  text-align: center;
}

.hero-inner {
  position: relative;
  padding-block: clamp(3rem, 9vw, 6.5rem);
  max-width: 36rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

/* Interior pages have no hero photograph, so the banner is only a title bar.
   It gets a smaller title and a much shallower band than the home page, where
   the hero is doing the work of a first impression — here it would just push
   the actual content below the fold. */
.hero .hero-inner {
  padding-block: clamp(1.75rem, 4vw, 2.75rem);
  /* Same width and centring as .prose, so the page title lines up with the
     body copy beneath it instead of hanging off to the left. */
  max-width: var(--measure);
  margin-inline: auto;
}

.hero h1 {
  font-size: clamp(1.7rem, 3.6vw, 2.3rem);
  letter-spacing: -0.01em;
}

/* Set roman rather than italic, and only slightly above body size: the tagline
   is a full paragraph, and a long passage of large italic serif is tiring to
   read. Comfortable whether the copy runs to one line or ten. */
.hero p {
  margin: 1.5rem 0 0;
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 1.9vw, 1.2rem);
  line-height: 1.6;
  color: var(--muted);
}

.hero p strong {
  font-weight: 400;
}

/* --- Prose ---------------------------------------------------- */

main {
  flex: 1;
  padding-block: clamp(0.6875rem, 1.5vw, 1.125rem) clamp(3rem, 7vw, 5rem);
}

.prose {
  max-width: var(--measure);
  margin-inline: auto;
}

.prose > * {
  margin-block: 0 1.3rem;
}

.prose h1,
.prose h2,
.prose h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
}

.prose h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin-bottom: 1.5rem;
}

.prose h2 {
  font-size: clamp(1.4rem, 3vw, 1.7rem);
  margin-top: 3rem;
  clear: both;
}

.prose h3 {
  font-size: 1.1rem;
  margin-top: 2rem;
  color: var(--muted);
  font-weight: 500;
}

.prose a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.prose a:hover {
  color: var(--accent-hover);
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

/* --- Portrait ------------------------------------------------- */

.portrait {
  float: right;
  width: 15rem;
  max-width: 42%;
  margin: 1.5rem 0 1.5rem 2rem;
}

.portrait .ph,
.portrait img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Drawn at the photo's own 2:3 proportions. If the width changes here, update
   the portrait's `sizes` in PHOTOS (eleventy.config.js) to match. */
.portrait picture,
.portrait img {
  display: block;
  width: 100%;
}

.portrait + h2 {
  clear: none;
  margin-top: 3rem;
}

/* Home page: the article opens right under the booking button, which already
   has space below it. Drop the top margins the portrait and first heading
   would otherwise add on top of that. */
.hero-cta + main .prose > .portrait:first-child,
.hero-cta + main .prose > .portrait:first-child + h2 {
  margin-top: 0;
}

/* Contact page: the home portrait again, under the details. Portrait-orientation
   (2:3), so capped at 24rem like .closing-photo rather than the full text
   width. If the cap changes, update the contact photo's `sizes` in PHOTOS
   (eleventy.config.js) to match. */
.contact-photo {
  margin: 2.5rem 0 0;
  max-width: 24rem;
}

.contact-photo img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* No portrait on phones: the hero photo is already directly above. It isn't
   downloaded either — see `hideBelow` in PHOTOS (eleventy.config.js), which
   must use the same width as this query. */
@media (max-width: 38rem) {
  .portrait {
    display: none;
  }
  /* First content under the title band starts at the same point on every
     page: About (heading after the hidden photo), Fees (opens on a heading),
     Contact (opens on a paragraph). A little air, not the full 3rem. */
  .portrait + h2,
  .prose > h2:first-child,
  .prose > p:first-child {
    margin-top: 1rem;
  }
}

/* --- Call to action ------------------------------------------- */

.prose p.cta {
  margin-top: 1.75rem;
}

.prose p.cta > a {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  min-height: 44px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.95rem; /* same as .btn; keeps the Contact button on one line at 320px */
  font-weight: 500;
  transition: background-color 0.15s ease;
}

@media (max-width: 24rem) {
  /* Smallest phones: narrower side padding so the button label stays on one line. */
  .prose p.cta > a {
    padding-inline: 1.25rem;
  }
}

.prose p.cta > a:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

/* --- Practice areas as cards ----------------------------------- */

#practice-areas ~ ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin-top: 1.75rem;
}

#practice-areas ~ ul li {
  margin: 0;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--clay);
  border-radius: var(--radius);
  font-size: 0.95rem;
  line-height: 1.35;
  box-shadow: var(--shadow);
}

/* --- Closing band --------------------------------------------- */

.closing-band {
  background: var(--sunk);
  border-top: 1px solid var(--border);
  padding-block: clamp(3rem, 7vw, 5rem);
}

/* The photo is portrait-orientation (2:3), so its column is capped at 24rem:
   at half the page it would stand over 700px tall beside a few lines of text.
   If the cap changes, update the closing photo's `sizes` in PHOTOS
   (eleventy.config.js) to match. */
.closing-inner {
  display: grid;
  grid-template-columns: minmax(0, 24rem) minmax(0, 30rem);
  justify-content: center;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.closing-photo {
  display: block;
  width: 100%;
  max-width: 24rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.closing-text address {
  font-style: normal;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.closing-lead {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  line-height: 1.25;
  margin: 0 0 1rem;
  text-wrap: balance;
}

@media (max-width: 48rem) {
  .closing-inner {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
}

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

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-block: 2.75rem 2rem;
  font-size: 0.925rem;
  color: var(--muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.75rem;
  align-items: start;
}

.site-footer p,
.site-footer address {
  margin: 0 0 0.4rem;
  font-style: normal;
}

.footer-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--text);
}

.site-footer a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

.footer-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.copyright {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}
