/*
 * The site header and footer, the same on every page: the homepage, the
 * articles and their index, the area pages, the privacy policy and the 404
 * page. scripts/build_chrome.py writes the markup into each page and links
 * this file with ?v= (a hash of it), so edit it here and run `make check`.
 * The header comes first, the footer after it.
 *
 * Self-contained on purpose. It carries its own copy of the palette (the same
 * values as the :root tokens in index.html and article.css), because the
 * privacy and 404 pages define no tokens, and so a page's own styles cannot
 * change how the header or footer looks.
 *
 * Header widths:
 *   1200px up     full bar: wordmark and tagline, six links, phone and WhatsApp buttons
 *                 (the container stops growing at 1200px, so this is its widest).
 *                 Reviews, the least needed of the seven links, is never in the
 *                 bar: with Midwifery added the row would not fit. It is always
 *                 in the collapsed menu, and the reviews are on the homepage.
 *   under 1200px  snug: the gaps close up a little
 *   1140px down   collapsed: wordmark, phone and WhatsApp buttons, menu button; the
 *                 menu holds all seven links, then WhatsApp, phone and email
 *   640px down    the WhatsApp button loses its label and goes round
 *   560px down    the tagline goes, the gutter narrows to the homepage's 22px
 *   360px down    a little smaller again, so a 320px phone never scrolls sideways
 * Every step is a max-width, and each one is written as N.98px (so "1140px
 * down" is max-width: 1140.98px). Browser zoom and high-density screens can
 * give a viewport like 1140.5px wide, and a plain 1140px/1141px pair would
 * leave that width matching neither the full bar's rules nor the collapsed
 * ones, so the full bar would spill off the side.
 * header.js needs none of these numbers: it asks whether the menu button shows.
 */

/* The sticky bar would otherwise cover the heading an anchor link jumps to. */
html { scroll-padding-top: 96px; }

.skip-link {
  box-sizing: border-box;
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 6px;
  background: #2B1F1B;
  color: #FBF8F2;
  font: 500 14px/1.2 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.site-header {
  --hdr-cream: #FBF8F2;
  --hdr-ink: #2B1F1B;
  --hdr-ink-soft: #5C4A42;
  --hdr-muted: #6B5C53;       /* 5.7:1 on bone */
  --hdr-fill: #A35E48;        /* --terracotta-deep, for fills */
  --hdr-accent: #93523B;      /* --terracotta-text, 5.3:1 on bone for small text */
  --hdr-line: rgba(43, 31, 27, 0.12);
  --hdr-height: 76px;
  --hdr-gutter: 40px;         /* the homepage sections' side padding */

  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 241, 234, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(43, 31, 27, 0.14);
  box-shadow: 0 2px 16px rgba(43, 31, 27, 0.05);
  color: var(--hdr-ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.2;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}
.site-header *,
.site-header *::before,
.site-header *::after { box-sizing: border-box; }
.site-nav-links,
.site-nav-contact { list-style: none; margin: 0; padding: 0; }
.site-nav-links li,
.site-nav-contact li { margin: 0; color: inherit; }
.site-header a:focus-visible,
.site-header button:focus-visible {
  outline: 2px solid var(--hdr-fill);
  outline-offset: 3px;
}

.site-header-inner {
  max-width: 1200px;
  height: var(--hdr-height);
  margin: 0 auto;
  padding: 0 var(--hdr-gutter);
  display: flex;
  align-items: center;
  gap: 32px;
}

/* Wordmark: set like the hero heading and the footer brand. */
.site-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: none;
  margin-right: auto;
  color: var(--hdr-ink);
  font-weight: 400;
  text-decoration: none;
}
.site-brand-name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 27px;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1;
  white-space: nowrap;
}
.site-brand-name em {
  font-style: italic;
  font-weight: 400;
  color: var(--hdr-accent);
}
.site-brand-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--hdr-muted);
}

/* Section links: quiet, so the one filled button leads. */
.site-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-nav-links a {
  position: relative;
  display: block;
  padding: 10px 0;
  color: var(--hdr-ink-soft);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}
.site-nav-links a:hover { color: var(--hdr-accent); }
.site-nav-links a[aria-current="page"] { color: var(--hdr-accent); }
.site-nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
/* Phone and email live in the collapsed menu (and the footer), not the bar. */
.site-nav-contact { display: none; }

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.site-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px 11px 16px;
  border-radius: 999px;
  background: var(--hdr-fill);
  color: var(--hdr-cream);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}
.site-whatsapp:hover { background: var(--hdr-ink); }
.site-whatsapp svg { display: block; width: 18px; height: 18px; flex: none; }

.site-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--hdr-line);
  border-radius: 999px;
  color: var(--hdr-accent);
  font-weight: 400;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.site-call:hover { background: var(--hdr-fill); border-color: var(--hdr-fill); color: var(--hdr-cream); }
.site-call svg { display: block; width: 18px; height: 18px; }

.site-menu-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  flex: none;
  /* Line the bars up with the gutter; the button keeps its 44px target. */
  margin-right: -11px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--hdr-ink);
  cursor: pointer;
}
.site-menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* Reviews stays out of the full bar (see the widths above); the collapsed
   rules below bring it back into the menu. Snug laptop widths close up a little. */
.site-nav-snug { display: none; }
@media (max-width: 1199.98px) {
  .site-header-inner { gap: 28px; }
  .site-nav-links { gap: 24px; }
}

/* Collapsed: the links move into a menu under the bar. */
@media (max-width: 1140.98px) {
  .site-header { --hdr-height: 68px; }
  .site-header-inner { gap: 16px; }
  .site-nav-snug { display: block; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--hdr-height));
    /* dvh leaves out the iOS Safari toolbar, so the menu's end stays in view. */
    max-height: calc(100dvh - var(--hdr-height));
    overflow-y: auto;
    padding: 8px 0 20px;
    background: var(--hdr-cream);
    border-bottom: 1px solid var(--hdr-line);
    box-shadow: 0 18px 30px rgba(43, 31, 27, 0.08);
  }
  .site-header-open .site-nav { display: block; }

  .site-nav-links { display: block; }
  .site-nav-links a {
    padding: 14px var(--hdr-gutter);
    color: var(--hdr-ink);
    font-size: 16px;
  }
  .site-nav-links a[aria-current="page"] { color: var(--hdr-accent); }
  /* The menu scrolls, so it clips anything outside it: draw the focus ring
     inside the full-width link rather than lose its sides. */
  .site-header .site-nav-links a:focus-visible {
    outline-offset: -4px;
    border-radius: 6px;
  }
  /* A short bar just left of the current section, instead of an underline. */
  .site-nav-links a[aria-current="page"]::after {
    top: 13px;
    bottom: 13px;
    left: calc(var(--hdr-gutter) - 14px);
    right: auto;
    width: 3px;
    height: auto;
  }

  .site-nav-contact {
    display: block;
    margin: 10px var(--hdr-gutter) 0;
    padding-top: 12px;
    border-top: 1px solid var(--hdr-line);
  }
  .site-nav-contact a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    color: var(--hdr-accent);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
  }
  .site-nav-contact a:hover { text-decoration: underline; text-underline-offset: 3px; }
  .site-nav-contact span { min-width: 0; overflow-wrap: anywhere; }
  .site-nav-contact svg { display: block; width: 18px; height: 18px; flex: none; }

  .site-menu-toggle { display: flex; }
  .site-header-open .site-menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .site-header-open .site-menu-toggle span:nth-child(2) { opacity: 0; }
  .site-header-open .site-menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* Phones: WhatsApp becomes a round button like the phone one. */
@media (max-width: 640.98px) {
  .site-whatsapp { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .site-whatsapp-label { display: none; }
}

@media (max-width: 560.98px) {
  .site-header { --hdr-height: 64px; --hdr-gutter: 22px; }
  .site-header-inner { gap: 10px; }
  .site-brand-name { font-size: 23px; }
  .site-brand-tag { display: none; }
}

/* The smallest phones keep the 22px gutter, so the wordmark still lines up
   with the page below; the room comes from the wordmark and the buttons. */
@media (max-width: 360.98px) {
  .site-header-inner { gap: 8px; }
  .site-header-actions { gap: 4px; }
  .site-brand-name { font-size: 20px; }
  .site-call,
  .site-whatsapp { width: 36px; height: 36px; }
}

/* ==========================================================================
 * The site footer, after <main> on every page. Full width and dark, in the
 * same 1200px container and gutters as the header, so its wordmark lines up
 * with the one in the bar.
 *
 * Footer widths (max-widths written as N.98px, for the reason given above):
 *   1200px up     the wordmark and tagline, then Explore, Contact, Follow and
 *                 Credentials, all in one row
 *   under 1200px  the wordmark and tagline on their own row, the four
 *                 columns spread out below
 *   900px down    Explore on the left; Contact on the right, with Follow and
 *                 Credentials under it
 *   560px down    one column, Follow and Credentials side by side; 44px tap
 *                 targets, and the gutter narrows to the header's 22px
 * On a touch screen (pointer: coarse) the links get 44px tap targets at every
 * width, so a tablet or a phone held sideways gets what a phone does.
 *
 * Contrast on the dark ground, all solid colours (no opacity): headings and
 * the wordmark 15:1, links 10.3:1, other text 7.1:1, the italic 7.5:1.
 * ========================================================================== */
.site-footer {
  --ftr-ground: #2B1F1B;      /* --ink */
  --ftr-bright: #FBF8F2;      /* --cream: headings, the wordmark, link hover */
  --ftr-link: #E8C9BD;        /* --terracotta-soft */
  --ftr-text: #C2A79D;
  --ftr-accent: #DDA58F;      /* the wordmark's italic, as the bar's terracotta */
  --ftr-line: rgba(232, 201, 189, 0.16);
  --ftr-gutter: 40px;         /* the header's and the homepage sections' */
  --ftr-link-pad: 5px;        /* above and below each column link */

  box-sizing: border-box;
  background: var(--ftr-ground);
  color: var(--ftr-text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.6;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}
.site-footer *,
.site-footer *::before,
.site-footer *::after { box-sizing: border-box; }
/* The pages give bare p, ul, li and a their own margins, sizes and colours.
   :where keeps this reset at one class's weight, so the rules below it win. */
.site-footer :where(p, ul, li) {
  margin: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  list-style: none;
}
.site-footer a {
  color: var(--ftr-link);
  font-weight: 400;
  text-decoration: none;
  transition: color 0.2s;
}
.site-footer a:hover {
  color: var(--ftr-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer a:focus-visible {
  outline: 2px solid var(--ftr-bright);
  outline-offset: 3px;
  border-radius: 2px;
}
/* The page you are on: bright and underlined, as the bar marks its section. */
.site-footer a[aria-current="page"] {
  color: var(--ftr-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* No single word left alone on the last line. */
.site-footer-tag,
.site-footer-bottom p,
.site-footer-legal { text-wrap: pretty; }

.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px var(--ftr-gutter) 36px;
}

.site-footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(4, auto);
  grid-template-areas: "about explore contact follow credentials";
  align-items: start;
  gap: 40px 56px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--ftr-line);
}
.site-footer-about { grid-area: about; }
.site-footer-explore { grid-area: explore; }
.site-footer-contact { grid-area: contact; }
.site-footer-follow { grid-area: follow; }
.site-footer-credentials { grid-area: credentials; }

/* Set like the wordmark in the bar. */
.site-footer-brand {
  margin-bottom: 14px;
  color: var(--ftr-bright);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.site-footer-brand em {
  color: var(--ftr-accent);
  font-style: italic;
  font-weight: 400;
}
.site-footer-tag { max-width: 300px; }

/* Styled paragraphs, not headings, so the footer stays out of each page's
   outline. */
.site-footer-heading {
  margin-bottom: 12px;
  color: var(--ftr-bright);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}
.site-footer-col li + li { margin-top: 2px; }
.site-footer-col a {
  display: inline-block;
  padding: var(--ftr-link-pad) 0;
}
/* Plain text, not links: small letter-spaced capitals on one line, so they
   read as a row of memberships rather than a list of things to tap. The top
   padding keeps them level with the Instagram link beside them. */
.site-footer-credentials ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding-top: calc(var(--ftr-link-pad) - 4px);
}
.site-footer-credentials li {
  padding: 5px 0;
  font-size: 13px;
  letter-spacing: 0.08em;
}
.site-footer-credentials li + li { margin-top: 0; }  /* the gap spaces them */
/* The email address breaks rather than push the page sideways. */
.site-footer-contact a { overflow-wrap: anywhere; }
.site-footer-external {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 5px;
  vertical-align: 0;
}
.site-footer-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.site-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  padding-top: 28px;
  font-size: 13px;
}
/* The Companies House trading disclosure. */
.site-footer-legal {
  max-width: 640px;
  margin-top: 12px;
  font-size: 12.5px;
}

@media (max-width: 1199.98px) {
  .site-footer-top {
    grid-template-columns: repeat(4, auto);
    grid-template-areas:
      "about about about about"
      "explore contact follow credentials";
    justify-content: space-between;
    column-gap: 40px;
  }
}

@media (max-width: 900.98px) {
  .site-footer { --ftr-link-pad: 7px; }
  .site-footer-inner { padding-top: 60px; }
  .site-footer-top {
    /* Explore is never narrower than its longest link, so "Lactation
       consultant in Clapham" stays on one line. */
    grid-template-columns: minmax(max-content, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "about about about"
      "explore contact contact"
      "explore follow credentials";
    justify-content: normal;
    gap: 36px 28px;
    padding-bottom: 40px;
  }
  .site-footer-bottom { flex-direction: column; gap: 4px; }
}

/* Touch screens: 44px tap targets at every width (the phone rules below set
   their own). */
@media (pointer: coarse) {
  .site-footer { --ftr-link-pad: 11px; }
  .site-footer-col li + li { margin-top: 0; }
  .site-footer-heading { margin-bottom: 4px; }
}

@media (max-width: 560.98px) {
  .site-footer { --ftr-gutter: 22px; --ftr-link-pad: 10px; }
  .site-footer-inner { padding-top: 52px; padding-bottom: 32px; }
  .site-footer-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "about about"
      "explore explore"
      "contact contact"
      "follow credentials";
    gap: 32px 24px;
    padding-bottom: 36px;
  }
  .site-footer-brand { font-size: 23px; }
  .site-footer-heading { margin-bottom: 4px; }
  .site-footer-col li + li { margin-top: 0; }
  .site-footer-col a {
    display: block;
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav-links a,
  .site-whatsapp,
  .site-call,
  .site-menu-toggle span,
  .site-footer a { transition: none; }
}

/* ==========================================================================
 * The phone action bar: WhatsApp and Book, fixed to the bottom of the screen.
 * Hidden above 640px, where the header's buttons are always in view. It slides
 * in when header.js adds .is-shown; visibility keeps it out of the tab order
 * while it is away. The page gets room at the bottom so the bar never covers
 * the end of the footer.
 * ========================================================================== */
.site-actionbar { display: none; }

@media (max-width: 640.98px) {
  .site-actionbar {
    --bar-fill: #A35E48;
    --bar-accent: #93523B;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: flex;
    gap: 10px;
    padding: 10px 22px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(246, 241, 234, 0.97);
    border-top: 1px solid rgba(43, 31, 27, 0.14);
    box-shadow: 0 -2px 16px rgba(43, 31, 27, 0.06);
    transform: translateY(110%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
  }
  .site-actionbar.is-shown {
    transform: none;
    visibility: visible;
    transition: transform 0.25s ease;
  }
  .site-actionbar a {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
  }
  .site-actionbar-whatsapp { border: 1px solid var(--bar-fill); color: var(--bar-accent); background: #FBF8F2; }
  .site-actionbar-whatsapp svg { display: block; width: 18px; height: 18px; flex: none; }
  .site-actionbar-book { background: var(--bar-fill); color: #FBF8F2; }
  .site-actionbar-short { display: none; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 379.98px) {
  .site-actionbar { gap: 8px; padding-left: 16px; padding-right: 16px; }
  .site-actionbar-long { display: none; }
  .site-actionbar-short { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  .site-actionbar,
  .site-actionbar.is-shown { transition: none; }
}
