/* bamrg.com theme: direction C "Warm New England" (approved by Fred 2026-10-30).
   Shared by every page: fonts, colors, buttons, header, mobile menu, phone action bar, footer.
   Load order: homepage = theme.css + home.css. Inner pages = site.css + theme.css + pages.css.
   Rules here also neutralize the old site.css header/footer, so they must load after it.
   COMPLIANCE (kept from site.css): every .agent-id__line is the same size and weight, so the supervising-broker
   line in the footer matches Fred's name; the header name stays visible at body size or smaller. */

@font-face { font-family: "Overpass"; src: url("/assets/fonts/overpass-latin-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --red: #B40101;
  --red-dark: #8A0101;
  --ink: #2B2C31;
  --charcoal: #393A40;
  --muted: #5D5B57;
  --bg: #FBF8F3;
  --alt: #F1EBE1;
  --card: #FFFFFF;
  --line: #E3DBCD;
  --font: "Overpass", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --wrap: 74rem;
  --gut: clamp(1rem, 4vw, 2rem);
  --space: clamp(3.5rem, 2rem + 5vw, 6.5rem);
  --radius: 18px;
  --radius-sm: 14px;
  --shadow: 0 20px 50px -25px rgba(57, 58, 64, .35);
  --shadow-sm: 0 10px 30px -18px rgba(57, 58, 64, .3);
  --header-h: 72px;

  /* site.css tokens, remapped so the old components pick up the new palette and font */
  --black: var(--ink);
  --paper: var(--alt);
  --gray: var(--muted);
  --rule: var(--line);
  --cream: var(--bg);
  --font-alt: var(--font);
  --font-serif: var(--font);
  --gutter: var(--gut);
}
@media (max-width: 75em) { :root { --header-h: 60px; } }
@media (min-width: 75.01em) and (max-width: 92em) { :root { --header-h: 117px; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
body { margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.6; color: var(--ink); background: var(--bg); }
img, svg { max-width: 100%; height: auto; display: block; }
:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font); line-height: 1.1; letter-spacing: -.025em; font-weight: 700; margin: 0 0 .6em; }
h3 { letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: .5rem; top: -4rem; background: var(--ink); color: #fff; padding: .75rem 1rem; z-index: 100; border-radius: 8px; }
.skip:focus { top: .5rem; color: #fff; }
.muted { color: var(--muted); }
.kicker { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: 1rem; }

/* compliance: identical size and weight on every line (same as site.css) */
.agent-id__line { font-size: 1.0625rem !important; font-weight: 400 !important; line-height: 1.5; margin: 0; color: inherit; }
.agent-id__line * { font-size: inherit !important; font-weight: inherit !important; }

/* pre-launch slots stay in the source, hidden in launch mode (same rule as site.css) */
.needs-fred { border: 2px dashed var(--muted); background: var(--alt); border-radius: var(--radius-sm); padding: 1rem; }
.needs-fred__tag { display: block; font-size: .85rem; font-weight: 700; text-transform: uppercase; color: var(--red); }
.status { display: inline-block; font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .05rem .5rem; margin-left: .5rem; vertical-align: middle; line-height: 1.5; }
html.launch .needs-fred, html.launch .launch-hide { display: none !important; }

/* ---------- buttons and links ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; padding: .75em 1.4em; font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2; text-align: center; text-decoration: none; border: 2px solid transparent; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .15s; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-ghost { border-color: currentColor; color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-dark, .btn-black { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.btn-dark:hover, .btn-black:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 1.5rem 0; }
.arrow-link { display: inline-flex; align-items: center; gap: .4em; min-height: 44px; font-weight: 700; color: var(--red); text-decoration: none; }
.arrow-link::after { content: "\2192"; transition: transform .15s; }
.arrow-link:hover::after { transform: translateX(3px); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; list-style: none; }
.chips li { margin: 0; }
.chips a { display: inline-flex; align-items: center; min-height: 44px; padding: .4em 1.1em; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; background: var(--card); text-decoration: none; font-weight: 600; font-size: .95rem; }
.chips a:hover { border-color: var(--red); color: var(--red); background: var(--card); }
.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 1.8em; margin-bottom: .8em; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .4em; width: .8em; height: .45em; border-left: 3px solid var(--red); border-bottom: 3px solid var(--red); transform: rotate(-45deg); }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(251, 248, 243, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 1.25rem; min-height: 72px; padding-top: 0; padding-bottom: 0; }
.brand { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: .75rem; flex-shrink: 0; }
.lockup { display: flex; align-items: center; gap: .6rem; min-height: 0; text-decoration: none; }
.lockup img { height: 36px; width: auto; background: transparent; }
.lockup__divider { width: 1px; height: 28px; align-self: center; margin: 0; background: var(--line); }
.brand__name { font-weight: 800; font-size: 1rem; line-height: 1.25; color: var(--ink); white-space: nowrap; }
.mainnav { order: 0; flex-basis: auto; margin: 0 0 0 auto; padding: 0; border: 0; overflow: visible; -webkit-mask-image: none; mask-image: none; }
.mainnav > ul { display: flex; flex-wrap: nowrap; align-items: center; gap: .1rem; list-style: none; margin: 0; padding: 0; white-space: nowrap; }
.mainnav > ul > li { margin: 0; position: relative; }
.mainnav a, .mainnav summary { display: flex; align-items: center; min-height: 44px; padding: 0 .7rem; color: var(--ink); font-weight: 600; font-size: .95rem; text-decoration: none; white-space: nowrap; border-radius: 999px; cursor: pointer; }
.mainnav a:hover, .mainnav summary:hover { color: var(--red); }
.mainnav a[aria-current="page"] { color: var(--red); box-shadow: none; background: rgba(180, 1, 1, .07); }
.mainnav details { position: relative; }
.mainnav summary { list-style: none; gap: .4rem; }
.mainnav summary::-webkit-details-marker { display: none; }
.mainnav summary::after { content: ""; width: .4rem; height: .4rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -.2rem 0 0; }
.mainnav details[open] summary::after { transform: rotate(-135deg); margin: .2rem 0 0; }
.menu { position: absolute; z-index: 20; left: -1rem; top: calc(100% + .5rem); width: min(92vw, 26rem); background: var(--card); border: 0; border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 1.25rem; white-space: normal; }
.menu ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .25rem; }
.menu li { margin: 0; padding: 0; }
.menu a { padding: .25rem .6rem; min-height: 40px; white-space: normal; border-radius: 10px; }
.menu a:hover { background: var(--alt); }
.menu .villages { display: block; font-size: .85rem; font-weight: 400; color: var(--muted); padding: 0 .6rem .4rem; }
.menu .menu-group { margin: 0 0 .5rem; font-weight: 800; }
.menu .menu-group a { font-weight: 800; }
.towns-mobile { display: none; }
.header-actions { order: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: .6rem; margin: 0; }
.header-actions .tel { order: 0; margin: 0; min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.header-actions .btn { order: 0; min-height: 42px; padding: .5em 1.1em; font-size: .9rem; white-space: nowrap; }
.no-home-ctas .header-actions .btn-ghost[href="/home-value/"] { display: none; }
.menu-btn { display: none; margin-left: auto; align-items: center; gap: .5rem; min-height: 44px; padding: 0 1rem; font: inherit; font-weight: 700; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.menu-btn__bars { position: relative; width: 18px; height: 12px; }
.menu-btn__bars::before, .menu-btn__bars::after, .menu-btn__bars span { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: currentColor; transition: transform .2s, opacity .2s; }
.menu-btn__bars::before { top: 0; }
.menu-btn__bars span { top: 5px; }
.menu-btn__bars::after { bottom: 0; }
.nav-open .menu-btn__bars::before { transform: translateY(5px) rotate(45deg); }
.nav-open .menu-btn__bars span { opacity: 0; }
.nav-open .menu-btn__bars::after { transform: translateY(-5px) rotate(-45deg); }

/* 1201-1472px: nav drops to its own row so the name, phone and buttons always fit */
@media (min-width: 75.01em) and (max-width: 92em) {
  .header-row { flex-wrap: wrap; gap: 0 1.25rem; }
  .header-actions { margin-left: auto; }
  .mainnav { order: 3; flex-basis: 100%; margin: 0 0 0 -.7rem; }
}
@media (max-width: 82em) { .header-actions .tel { display: none; } }
@media (max-width: 75em) {
  :root { --header-h: 60px; }
  /* Closed header stays one row; only open nav may wrap below. */
  .header-row { min-height: 60px; gap: .5rem; flex-wrap: nowrap; }
  .nav-open .header-row { flex-wrap: wrap; }
  .brand { gap: .5rem; min-width: 0; flex: 1 1 auto; }
  .lockup { gap: .4rem; flex-shrink: 0; }
  .lockup img { height: 28px; width: auto; }
  .lockup__divider { height: 20px; }
  .brand__name { font-size: .85rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .menu-btn { display: inline-flex; flex-shrink: 0; margin-left: auto; gap: .35rem; min-height: 36px; padding: 0 .7rem; font-size: .85rem; }
  .menu-btn__bars { width: 16px; height: 11px; }
  .menu-btn__bars span { top: 4.5px; }
  .nav-open .menu-btn__bars::before { transform: translateY(4.5px) rotate(45deg); }
  .nav-open .menu-btn__bars::after { transform: translateY(-4.5px) rotate(-45deg); }
  .mainnav, .header-actions { display: none; }
  .towns-desktop { display: none; }
  .towns-mobile { display: block; }
  .nav-open .mainnav { display: block; order: 3; flex-basis: auto; width: 100%; margin: 0; }
  .nav-open .mainnav > ul { flex-direction: column; align-items: stretch; gap: 0; padding: 0; border-top: 1px solid var(--line); }
  .nav-open .mainnav a { min-height: 52px; padding: 0; font-size: 1.1rem; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
  .nav-open .header-actions { display: grid; order: 4; width: 100%; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); padding: 1rem 0 1.25rem; }
  .nav-open .header-actions .tel { display: none; }
  .nav-open .header-actions .btn { min-height: 48px; }
}
/* Phones (~iPhone width): smaller logos so KW + pin + name + Menu stay on one row. */
@media (max-width: 30em) {
  :root { --header-h: 56px; }
  .header-row { min-height: 56px; gap: .4rem; }
  .brand { gap: .4rem; }
  .lockup { gap: .3rem; }
  .lockup img { height: 26px; }
  .lockup__divider { height: 18px; }
  .brand__name { font-size: .8rem; }
  .menu-btn { min-height: 34px; padding: 0 .55rem; gap: .3rem; font-size: .8rem; }
}
@media (max-width: 24em) {
  .brand__name { font-size: .75rem; }
  .menu-btn { padding: 0 .5rem; }
  .menu-btn__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
}

/* ---------- sticky phone action bar ---------- */
.actionbar { display: none; }
@media (max-width: 60em) {
  .actionbar { display: grid; grid-template-columns: 68px 68px 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .08); padding: .5rem .5rem calc(.5rem + env(safe-area-inset-bottom)); }
  .actionbar--short { grid-template-columns: 1fr 1fr; }
  .actionbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; color: var(--ink); font-weight: 700; font-size: .8rem; text-decoration: none; border-radius: 999px; }
  .actionbar svg { width: 20px; height: 20px; }
  .actionbar .actionbar__cta { flex-direction: row; margin-left: .25rem; background: var(--red); color: #fff; font-size: .95rem; white-space: nowrap; }
  body:has(.actionbar) { padding-bottom: 76px; }
}

/* ---------- footer ---------- */
.site-footer { margin-top: var(--space); padding: clamp(3rem, 6vw, 5rem) 0 2rem; color: #E9E6E0; background: var(--charcoal); }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #F3B9B9; }
.site-footer :focus-visible { outline-color: #fff; }
.footer-top { display: grid; grid-template-columns: 1.1fr 1.9fr; gap: clamp(2rem, 5vw, 4rem); padding-bottom: 2.5rem; border-bottom: 1px solid rgba(255, 255, 255, .15); }
.footer-legal { margin: 0; padding: 0; border: 0; }
.footer-legal .agent-id__line + .agent-id__line { margin-top: 0; }
.footer-legal .agent-id__broker { margin-top: .75rem !important; }
.footer-legal .agent-id__fine { margin-top: .75rem !important; color: #C9C5BD; }
.footer-legal a { display: inline-block; padding: .3rem 0; }
.footer-logos { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; margin: 1.75rem 0 0; color: #fff; }
.footer-logos img { background: transparent; }
.footer-logos .eho-logo { width: 56px; }
.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin: 0; }
.footer-cols h2 { margin-bottom: .9rem; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: #C9C5BD; }
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-cols li { margin: 0 0 .2rem; }
.footer-cols a { display: inline-flex; align-items: center; min-height: 36px; font-size: .95rem; text-decoration: none; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; padding-top: 1.75rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; list-style: none; padding: 0; margin: 0; }
.footer-links li { margin: 0; }
.footer-links a { display: inline-flex; align-items: center; min-height: 36px; font-size: .9rem; }
.footer-small { margin: 0 0 .35rem; font-size: .85rem; color: #C9C5BD; }
.footer-small a { display: inline-block; padding: .35rem 0; }
@media (max-width: 60em) { .footer-top { grid-template-columns: 1fr; } }
@media (max-width: 36em) { .footer-cols { grid-template-columns: 1fr 1fr; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
@media print { .site-header, .actionbar, .skip { display: none; } }
