/* =========================================================================
   Handled — shared chrome (nav dropdown + site footer)
   Works on every page; references the editorial CSS variables that each
   page defines, so it themes automatically.
   ========================================================================= */

/* ---- brand mark holds an SVG (layers icon) instead of a letter ---- */
/* 24px matches the icon's 24-unit grid exactly, so strokes land on whole
   pixels — fractional sizes (25/23px) made the mark render soft/jagged */
.mast-brand-mark svg { width: 24px; height: 24px; display: block; stroke-width: 2.5; }
.site-footer-brand .mast-brand-mark svg { width: 24px; height: 24px; }

/* ---- Services dropdown ---- */
.nav-dd { position: relative; }
.nav-dd-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: var(--sans); font-size: 13px; color: var(--ink-3);
  letter-spacing: -0.005em; line-height: 1;
  transition: color .15s;
}
.nav-dd-toggle svg { transition: transform .2s; }
.nav-dd:hover .nav-dd-toggle, .nav-dd.is-open .nav-dd-toggle { color: var(--ink); }
.nav-dd:hover .nav-dd-toggle svg, .nav-dd.is-open .nav-dd-toggle svg { transform: rotate(180deg); }
.nav-dd-menu {
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%) translateY(4px);
  min-width: 280px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 24px 60px -24px rgba(21,20,26,0.35);
  opacity: 0; visibility: hidden;
  transition: opacity .16s ease, transform .16s ease;
  z-index: 60;
}
.nav-dd:hover .nav-dd-menu, .nav-dd.is-open .nav-dd-menu {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(8px);
}
.nav-dd-menu a {
  display: block; padding: 10px 12px; border-radius: 9px;
  text-decoration: none; color: var(--ink-2);
  font-family: var(--serif); font-size: 15px; letter-spacing: -0.01em;
  transition: background .12s, color .12s;
}
.nav-dd-menu a:hover { background: var(--paper-warm); color: var(--ink); }
.nav-dd-menu a .d {
  display: block; font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-4); margin-top: 3px; letter-spacing: 0.02em;
  text-transform: none;
}
.nav-dd-sep { height: 1px; background: var(--line-soft); margin: 6px 6px; }

/* keep the bridge so the menu doesn't close in the hover gap */
.nav-dd::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 12px; }

/* ---- Site footer (mega) ---- */
.site-footer {
  background: var(--paper-warm);
  border-top: 1px solid var(--line);
  padding: 80px 0 0;
}
.site-footer-top {
  display: grid; gap: 48px 40px;
  grid-template-columns: 1fr;
  padding-bottom: 56px;
}
@media (min-width: 680px) { .site-footer-top { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .site-footer-top { grid-template-columns: 1.6fr repeat(4, 1fr); } }

.site-footer-brand { max-width: 320px; }
.site-footer-brand .mast-brand { margin-bottom: 18px; }
.site-footer-tag {
  font-family: var(--serif); font-size: 16px; line-height: 1.5;
  color: var(--ink-3); margin: 0 0 22px; text-wrap: pretty;
}
.footer-cta {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 20px; border-radius: 7px;
  background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  text-decoration: none; letter-spacing: -0.005em;
  transition: background .15s, transform .05s;
}
.footer-cta:hover { background: var(--accent-deep); }
.footer-cta:active { transform: translateY(1px); }
.footer-cta svg { width: 14px; height: 14px; }

.footer-col h4 {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.12em;
  margin: 0 0 18px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.footer-col ul a {
  font-family: var(--serif); font-size: 15px; letter-spacing: -0.01em;
  color: var(--ink-2); text-decoration: none; transition: color .12s;
}
.footer-col ul a:hover { color: var(--accent-warm); }

.site-footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px; flex-wrap: wrap;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.site-footer-bottom .footer-legal { display: inline-flex; gap: 18px; align-items: center; }
.site-footer-bottom .footer-legal a { color: inherit; text-decoration: none; }
.site-footer-bottom .footer-legal a:hover { color: var(--ink); text-decoration: underline; }
.site-footer-bottom .footer-coasts { display: inline-flex; gap: 18px; align-items: center; }
.site-footer-bottom .footer-coasts span::before { content: "·"; margin-right: 18px; color: var(--ink-4); }
.site-footer-bottom .footer-coasts span:first-child::before { content: none; }

/* Narrow-width footer: stack items so the fixed theme switcher and short spans
   don't collide, and give room at the bottom for the floating switcher. */
@media (max-width: 720px) {
  .site-footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding-bottom: 88px;
  }
  .site-footer-bottom .footer-coasts { gap: 12px; flex-wrap: wrap; justify-content: center; }
  .site-footer-bottom .footer-coasts span::before { margin-right: 12px; }
}

/* ==============================================================
   Mast — mobile hamburger + drawer (injected by chrome.js)
   ============================================================== */
.mast-burger {
  display: none;
  flex-direction: column;
  align-items: center; justify-content: center;
  width: 40px; height: 40px;
  padding: 0; margin: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.mast-burger:hover { border-color: var(--ink-3); }
.mast-burger span {
  display: block;
  width: 18px; height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  margin: 2.5px 0;
  transition: transform .18s ease, opacity .12s ease;
  transform-origin: center;
}
.mast-burger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.mast-burger.is-open span:nth-child(2) { opacity: 0; }
.mast-burger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mast-drawer {
  position: fixed; inset: 0;
  z-index: 90;
  background: var(--paper);
  padding-top: 82px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity .16s ease, visibility 0s linear .16s;
}
.mast-drawer.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .16s ease, visibility 0s;
}
.mast-drawer-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 24px 48px;
  display: flex; flex-direction: column;
}
.mast-drawer-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 4px;
  font-family: var(--serif); font-size: 22px; letter-spacing: -0.015em;
  color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--line-soft);
}
.mast-drawer-sublink {
  display: block;
  padding: 10px 4px 10px 22px;
  font-family: var(--serif); font-size: 15px; letter-spacing: -0.01em;
  color: var(--ink-3); text-decoration: none;
  border-bottom: 1px solid var(--line-soft);
}
.mast-drawer-cta {
  display: inline-flex; align-items: center; justify-content: center;
  align-self: stretch;
  margin-top: 28px;
  padding: 14px 22px;
  background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  border-radius: 7px; text-decoration: none;
  letter-spacing: -0.005em;
}
.mast-drawer-cta:hover { background: var(--accent-deep); }

body.mast-drawer-open { overflow: hidden; }

@media (max-width: 900px) {
  .mast-nav { display: none; }
  .mast-cta { display: none; }
  .mast-burger { display: inline-flex; }
}
