/*
 * Marblehead Housing Coalition. The palette is the harbour scheme shared
 * with the zoning map's rule explorer: harbour navy, sail cream and brass,
 * with Libre Caslon for headings. Red and green are kept out of the chrome,
 * since on the maps they mean "does not conform" and "conforms".
 */
:root {
  --ink: #13293d;
  --navy: #1b3a57;
  --sea: #2e5e7e;
  --muted: #56626c;
  --sail: #f6f1e7;
  --sand: #e6dcc8;
  --brass: #b08d3c;
  --brass-light: #d4b46a;
  --brass-dark: #7a5c1c;
  --white: #ffffff;
  --serif: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--sail);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sea); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--navy); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brass-light); outline-offset: 2px; border-radius: 3px; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--white); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- buttons */
.btn {
  display: inline-block; padding: .6em 1.15em; border-radius: 999px;
  font: 600 .95rem/1.2 var(--sans); text-decoration: none; letter-spacing: .01em;
  border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.btn-brass { background: var(--brass); color: var(--white); }
.btn-brass:hover { background: var(--brass-dark); color: var(--white); }
.btn-ghost { border-color: rgba(255,255,255,.7); color: var(--white); }
.btn-ghost:hover { background: var(--white); color: var(--navy); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--ink); color: var(--white); }
.link-arrow { font-weight: 600; text-decoration: none; color: var(--navy); }
.link-arrow::after { content: " →"; color: var(--brass); }
.link-arrow:hover { text-decoration: underline; }

/* ---------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 241, 231, .96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--sand);
  box-shadow: 0 1px 0 rgba(176, 141, 60, .35);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.brand img { width: 56px; height: auto; }
.brand-name { display: block; font: 700 1.25rem/1 var(--serif); letter-spacing: .01em; }
.brand-sub { display: block; font: 600 .72rem/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--brass-dark); margin-top: 3px; }
#site-nav > ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
#site-nav a:not(.btn) {
  display: block; padding: 8px 12px; border-radius: 6px;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: .98rem;
}
#site-nav a:not(.btn):hover { background: var(--sand); color: var(--navy); }
#site-nav a[aria-current="page"] { color: var(--navy); box-shadow: inset 0 -2px 0 var(--brass); border-radius: 6px 6px 0 0; }
#site-nav .btn { margin-left: 8px; }
.has-menu { position: relative; }
.has-menu > a::after { content: ""; display: inline-block; margin-left: 6px; border: 4px solid transparent; border-top-color: var(--brass); transform: translateY(2px); }
.menu {
  display: none; position: absolute; left: 0; top: 100%; min-width: 230px;
  list-style: none; margin: 0; padding: 6px; background: var(--white);
  border: 1px solid var(--sand); border-top: 3px solid var(--brass); border-radius: 0 0 8px 8px;
  box-shadow: 0 10px 24px rgba(19, 41, 61, .12);
}
.has-menu:hover .menu, .has-menu:focus-within .menu { display: block; }
.menu a { font-weight: 400 !important; }
.nav-toggle {
  display: none; font: 600 .95rem var(--sans); color: var(--navy);
  background: transparent; border: 1px solid var(--navy); border-radius: 999px; padding: 6px 14px; cursor: pointer;
}

@media (max-width: 900px) {
  :root { --header-h: 64px; }
  .brand img { width: 46px; }
  .nav-toggle { display: block; }
  #site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--sail); border-bottom: 1px solid var(--sand); box-shadow: 0 12px 24px rgba(19,41,61,.12); }
  #site-nav.open { display: block; }
  #site-nav > ul { flex-direction: column; align-items: stretch; padding: 8px 16px 16px; max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
  .menu { display: block; position: static; border: 0; box-shadow: none; background: transparent; padding: 0 0 0 14px; min-width: 0; }
  .has-menu > a::after { display: none; }
  #site-nav .btn { margin: 10px 0 0; text-align: center; }
  #site-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--brass); border-radius: 0 6px 6px 0; }
}

/* ---------- footer */
.site-footer { background: var(--ink); color: rgba(255,255,255,.8); padding: 52px 0 24px; border-top: 4px solid var(--brass); }
.section-navy + .site-footer { border-top-color: var(--brass-dark); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h2 { color: var(--brass-light); font: 600 .78rem/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; margin-bottom: 12px; }
.footer-brand { font: 700 1.3rem/1.2 var(--serif); color: var(--white); margin-bottom: 10px; }
.site-footer p { margin: 0; font-size: .97rem; }
.site-footer a { color: var(--white); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.footer-base { margin-top: 36px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem; color: rgba(255,255,255,.55); }

