/* ==========================================================================
   layout.css — utility strip, masthead (header), colophon (footer) and the
   floating "We're humans" contact button.
   All are injected by js/includes.js into #header and #footer.
   ========================================================================== */

/* ==========================================================================
   HEADER
   #header holds both the utility strip and the bar. It sticks with a
   negative top equal to the strip's height, so the strip scrolls away and
   the green bar is what stays pinned.
   ========================================================================== */

#header {
  position: sticky;
  top: calc(var(--util-h) * -1);
  z-index: 100;
  min-height: calc(var(--header-h) + var(--util-h));   /* no jump on load */
}

/* ---- Utility strip: "Have a question? Talk to a real person." ------------ */

.util {
  background: var(--pine-deep);
  color: rgba(255, 253, 248, 0.82);
  font-size: var(--step--1);
}

.util__inner {
  height: var(--util-h);
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-s) var(--space-l);
}

.util__msg strong { color: var(--paper); font-weight: 600; }

.util__links {
  display: flex;
  gap: var(--space-s);
}

.util__links li + li::before {
  content: "|";
  margin-right: var(--space-s);
  color: rgba(255, 253, 248, 0.3);
}

.util__links a {
  color: var(--brass);
  font-weight: 600;
  text-decoration: none;
}
.util__links a:hover { color: var(--paper); }

.util__hours { color: rgba(255, 253, 248, 0.6); }

@media (max-width: 760px) {
  .util__hours { display: none; }
}
@media (max-width: 480px) {
  .util__msg strong { display: none; }
}

/* ---- Bar ----------------------------------------------------------------- */

.masthead {
  position: relative;
  background: var(--pine);
  transition: box-shadow var(--speed) var(--ease);
}

#header.is-stuck .masthead { box-shadow: var(--shadow-l); }

.masthead__inner {
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--gutter);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
}

/* ---- Logo ---------------------------------------------------------------- */
/* Mobile: the mark sits on the green bar in cream. */

.masthead__logo {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  line-height: 0;
}

.masthead__logo img {
  height: 54px;
  width: auto;
  filter: brightness(0) invert(96%) sepia(8%) saturate(300%);
}

/* ---- Hamburger (mobile only) --------------------------------------------- */

.masthead__toggle {
  display: grid;
  place-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-right: calc(var(--space-2xs) * -1);
  border-radius: var(--radius-s);
}

.masthead__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--paper);
  border-radius: 2px;
  transition: transform var(--speed) var(--ease),
              opacity var(--speed) var(--ease);
}

.masthead__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.masthead__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.masthead__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Drawer: the whole right-hand group ---------------------------------- */
/* Mobile-first — a panel hanging off the bottom of the bar. */

.masthead__drawer {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--pine);
  border-top: 1px solid rgba(255, 253, 248, 0.12);
  box-shadow: var(--shadow-l);
  padding: var(--space-s) var(--gutter) var(--space-l);
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;

  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--speed) var(--ease),
              transform var(--speed) var(--ease),
              visibility var(--speed) var(--ease);
}

.masthead__drawer.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav__list { display: flex; flex-direction: column; }

.nav__item { border-bottom: 1px solid rgba(255, 253, 248, 0.12); }

.nav__link {
  display: block;
  padding: var(--space-s) 0;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--paper);
  text-decoration: none;
  transition: color var(--speed) var(--ease);
}

.nav__link:hover,
.nav__link[aria-current="page"] { color: var(--brass); }

.masthead__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  padding-top: var(--space-m);
}

.masthead__phone {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--step-1);
  color: var(--paper);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
}

.masthead__phone:hover { color: var(--brass); }
.masthead__phone svg { width: 16px; height: 16px; color: var(--brass); }

/* ==========================================================================
   HEADER — desktop (1200px and up)
   ========================================================================== */

@media (min-width: 1200px) {

  .masthead__toggle { display: none; }

  /* ---- Logo shelf --------------------------------------------------------
     A cream tab pinned to the top of the bar and taller than it, so the
     full-colour mark hangs below. The bar's own height is untouched. */
  .masthead__logo {
    position: relative;
    z-index: 2;
    align-self: flex-start;
    height: var(--logo-panel-h);
    margin-left: calc(var(--gutter) * -1);
    padding-left: var(--gutter);
    padding-right: var(--space-l);
    background: var(--paper);
    border-radius: 0 0 var(--radius-l) 0;
    box-shadow: 0 14px 30px -16px rgba(29, 42, 32, 0.55);
    transition: height var(--speed) var(--ease);
  }

  .masthead__logo img {
    height: var(--logo-h);
    filter: none;
    transition: height var(--speed) var(--ease);
  }

  /* Shelf tucks up once you're reading the page */
  #header.is-stuck .masthead__logo { height: calc(var(--header-h) + 12px); }
  #header.is-stuck .masthead__logo img { height: calc(var(--header-h) - 8px); }

  .masthead__drawer {
    position: static;
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
    max-height: none;
    overflow: visible;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: flex;
    align-items: center;
    gap: var(--space-l);
  }

  .nav__list {
    flex-direction: row;
    align-items: center;
    gap: var(--space-m);
  }

  .nav__item { border-bottom: 0; }

  .nav__link {
    padding: 0;
    font-size: 0.98rem;
    font-weight: 600;
    white-space: nowrap;
    color: rgba(255, 253, 248, 0.9);
  }

  .nav__link:hover { color: var(--brass); }

  /* Signature: the active page is marked with a gold peak, not an underline. */
  .nav__link[aria-current="page"] { color: var(--paper); }
  .nav__link[aria-current="page"]::after {
    content: "";
    display: block;
    width: 0;
    height: 0;
    margin: 6px auto 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid var(--brass);
  }

  .masthead__actions {
    flex-direction: row;
    align-items: center;
    gap: var(--space-m);
    padding-top: 0;
  }

  .masthead__phone { font-size: var(--step-0); white-space: nowrap; }
  .masthead__actions .btn { white-space: nowrap; }
}

/* Six nav items, a phone number and a button won't all fit the moment the
   desktop bar appears. The phone waits for room; it's still in the strip
   above, the floating button and the footer. */
@media (min-width: 1200px) and (max-width: 1519px) {
  .masthead__phone { display: none; }
}

body.nav-open { overflow: hidden; }

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

.colophon {
  position: relative;
  background: var(--pine-deep);
  color: var(--bone);
  margin-top: var(--space-3xl);
}

/* Signature: ridgeline along the top edge, echoing the logo's mountains. */
.colophon__ridge {
  position: absolute;
  bottom: calc(100% - 1px);
  left: 0;
  width: 100%;
  height: clamp(38px, 5vw, 64px);
  display: block;
  fill: var(--pine-deep);
  pointer-events: none;
}

.colophon__main {
  padding-block: var(--space-2xl) var(--space-xl);
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .colophon__main { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .colophon__main {
    grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
    gap: var(--space-l);
  }
}

.colophon__logo img {
  height: 84px;
  width: auto;
  filter: brightness(0) invert(96%) sepia(8%) saturate(300%);
  margin-bottom: var(--space-s);
}

.colophon__blurb {
  color: var(--sage-light);
  font-size: var(--step--1);
  line-height: 1.7;
  max-width: 34ch;
}

.colophon__title {
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--paper);
  margin-bottom: var(--space-s);
}

.colophon__list { display: grid; gap: var(--space-2xs); }

.colophon__list a,
.colophon__contact a {
  color: var(--sage-light);
  font-size: var(--step--1);
  text-decoration: none;
  transition: color var(--speed) var(--ease);
}

.colophon__list a:hover,
.colophon__contact a:hover { color: var(--brass); }

.colophon__contact { display: grid; gap: var(--space-s); }

.colophon__contact-item {
  display: flex;
  gap: var(--space-2xs);
  font-size: var(--step--1);
  color: var(--sage-light);
  line-height: 1.5;
}

.colophon__contact-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-top: 4px;
  stroke: var(--brass);
}

.colophon__contact strong {
  display: block;
  color: var(--paper);
  font-family: var(--font-display);
  font-size: var(--step-0);
}

.colophon__contact strong a { color: var(--paper); font-size: inherit; }

.colophon__base {
  border-top: 1px solid rgba(138, 174, 132, 0.22);
  padding-block: var(--space-m) calc(var(--space-m) + 64px);  /* clear the floating button */
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s) var(--space-m);
  align-items: center;
  justify-content: space-between;
  font-size: var(--step--1);
  color: var(--sage-light);
}

.colophon__legal { display: flex; flex-wrap: wrap; gap: var(--space-m); }
.colophon__legal a { color: var(--sage-light); text-decoration: none; }
.colophon__legal a:hover { color: var(--brass); }

.colophon__license {
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
}

/* ==========================================================================
   "WE'RE HUMANS" — floating contact button
   Bottom-right on every page. Opens a small card with call / text / email
   and hours. No chatbot, on purpose.
   ========================================================================== */

.humans {
  position: fixed;
  right: var(--space-m);
  bottom: var(--space-m);
  z-index: 90;                 /* under the header (100) so the drawer wins */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-s);
}

.humans__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0.85em 1.3em;
  border-radius: 999px;
  background: var(--pine);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 600;
  box-shadow: var(--shadow-l);
  border: 2px solid rgba(255, 253, 248, 0.14);
  transition: background-color var(--speed) var(--ease), transform var(--speed) var(--ease);
}

.humans__btn:hover { background: var(--pine-mid); transform: translateY(-2px); }
.humans__btn[aria-expanded="true"] { background: var(--pine-deep); }

.humans__wave { font-size: 1.15em; display: inline-block; transform-origin: 70% 80%; }

@media (prefers-reduced-motion: no-preference) {
  .humans__btn:hover .humans__wave { animation: wave 900ms var(--ease); }
}

@keyframes wave {
  0%, 100% { transform: rotate(0); }
  20%, 60% { transform: rotate(16deg); }
  40%, 80% { transform: rotate(-8deg); }
}

.humans__panel {
  width: min(320px, calc(100vw - 2 * var(--space-m)));
  background: var(--paper);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-l);
  border-top: 4px solid var(--brass);
  padding: var(--space-m);
}

.humans__panel:not([hidden]) { animation: pop 200ms var(--ease); }

@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.humans__title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  color: var(--pine);
  line-height: 1.2;
}

.humans__sub {
  margin-top: var(--space-3xs);
  font-size: var(--step--1);
  color: var(--ink-soft);
  line-height: 1.5;
}

.humans__opts { display: grid; gap: var(--space-2xs); margin-top: var(--space-s); }

.humans__opt {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  padding: var(--space-xs) var(--space-s);
  border-radius: var(--radius-m);
  background: var(--bone);
  color: var(--ink);
  text-decoration: none;
  font-size: var(--step--1);
  line-height: 1.35;
  transition: background-color var(--speed) var(--ease);
}

.humans__opt:hover { background: var(--bone-deep); }

.humans__opt svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--pine);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.humans__opt strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-0);
  color: var(--pine);
}

.humans__opt span { overflow-wrap: anywhere; color: var(--ink-soft); }

.humans__hours {
  margin-top: var(--space-s);
  text-align: center;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink-soft);
}

body.nav-open .humans { opacity: 0; visibility: hidden; }

@media (max-width: 640px) {
  .humans { right: var(--space-s); bottom: var(--space-s); }
}

@media print {
  .humans, .util { display: none; }
}
