/* ============================================================================
   MAIN STREET COMMERCIAL PARTNERS — base styles
   Direction: Lake Flato-leaning editorial warmth on the MSCP Swiss system.
   Warm ivory paper, hairline rules instead of boxes, light sentence-case
   display type, tiny tracked-caps labels, photography given room to breathe.
   Brand: charcoal #373A36 · teal #045C66 · brass #A2712C accent
   Type: Univers (drop licensed WOFF2 files in /assets/fonts/univers/ and
   uncomment the @font-face rules). Falls back to Helvetica Neue meanwhile.
   ========================================================================== */

/*
@font-face { font-family: "Univers"; src: url("/assets/fonts/univers/UniversLTStd-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Univers"; src: url("/assets/fonts/univers/UniversLTStd-Roman.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Univers"; src: url("/assets/fonts/univers/UniversLTStd-Bold.woff2")  format("woff2"); font-weight: 700; font-display: swap; }
*/

:root {
  --charcoal: #373A36;
  --ink: #34322B;
  --stone: #75705F;
  --mist: #EDE8DC;
  --paper: #FAF7F0;
  --sand: #F1EDE2;
  --hairline: #E3DDCE;
  --brass: #A2712C;
  --teal: #045C66;
  --teal-dark: #04454C;
  --footer: #2E2D27;
  --rule: var(--hairline);
  --slate: var(--stone); /* legacy alias */
  --sans: "Univers", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --cond: "Univers", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
::selection { background: #EADFC4; color: var(--ink); }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--teal); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--teal); color: #fff;
  padding: 10px 18px; z-index: 100; font-size: 14px;
}
.skip-link:focus { left: 0; }

/* ---------------- header / nav — quiet, light, hairline ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 18px 4vw;
  background: rgba(250, 247, 240, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.nav .brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.nav .brand .mark { height: 40px; width: auto; }
.nav .brand .word { height: 30px; width: auto; }
.nav .nav-links { margin-left: auto; display: flex; gap: 34px; }
.nav a {
  color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
}

/* mobile nav toggle — hidden on desktop; the ≤760px query below reveals it
   and turns .nav-links into a dropdown panel (July 10 round) */
.nav-toggle {
  display: none; margin-left: auto; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; border: none; background: none;
  color: var(--ink); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; display: block; }
.nav-toggle svg.icon-close { display: none; }
.nav.is-open .nav-toggle svg.icon-open { display: none; }
.nav.is-open .nav-toggle svg.icon-close { display: block; }
.nav-toggle:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.nav a:hover, .nav a:focus-visible { color: var(--teal); }

/* ---------------- project hero ---------------- */
.hero { position: relative; min-height: 64vh; display: flex; align-items: flex-end; color: #fff; }
.hero .hero-img { position: absolute; inset: 0; }
.hero .hero-img img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(38,34,26,.10) 0%, rgba(38,34,26,0) 28%, rgba(38,34,26,.42) 62%, rgba(38,34,26,.82) 100%);
}
.hero-inner { text-shadow: 0 1px 14px rgba(30,26,18,.45); }
.hero-inner { position: relative; z-index: 2; padding: 0 4vw 48px; max-width: 1200px; }
.hero .kicker {
  font-size: 11.5px; letter-spacing: .3em; text-transform: uppercase; color: #E8E2D2;
}
.hero h1 {
  font-weight: 300;
  font-size: clamp(42px, 6vw, 80px);
  line-height: 1.02; letter-spacing: -0.01em;
  margin: 14px 0 16px;
}
.hero .sub { font-size: clamp(15px, 1.5vw, 18px); font-weight: 300; color: #F1EDE1; max-width: 58ch; }

/* ---------------- sections ---------------- */
.section { padding: 78px 4vw; }
.section-tight { padding: 42px 4vw; }
.measure { max-width: 1280px; margin: 0 auto; }

.eyebrow {
  font-size: 11.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--stone);
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
}
.eyebrow::after { content: ""; height: 1px; background: var(--brass); flex: 0 0 42px; opacity: .65; }

.narrative { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 5vw; align-items: start; }
.narrative h2 {
  font-weight: 300;
  font-size: clamp(30px, 3.4vw, 46px); line-height: 1.12;
  letter-spacing: -0.005em;
  margin-bottom: 28px; color: var(--ink);
}
.narrative .lede { font-size: 19px; font-weight: 300; line-height: 1.65; color: var(--ink); }
.narrative p + p { margin-top: 20px; }

/* key details — warm card so it reads as its own object */
.facts {
  background: var(--sand);
  border: 1px solid #D8D0BC;
  border-top: 3px solid var(--brass);
  padding: 10px 22px 14px;
  box-shadow: 0 16px 30px -26px rgba(70, 60, 38, .45);
}
.facts dl div {
  display: flex; justify-content: space-between; gap: 18px;
  padding: 14px 0; border-bottom: 1px solid var(--hairline); font-size: 14.5px;
}
.facts dl div:last-child { border-bottom: none; }
.facts dt { color: var(--stone); }
.facts dd { text-align: right; color: var(--ink); }

/* demographics — carded band with huge quiet numerals */
.demo-strip {
  margin-top: 52px; padding: 36px 3vw 30px;
  background: var(--sand);
  border: 1px solid #D8D0BC;
  border-top: 3px solid var(--brass);
  box-shadow: 0 16px 30px -26px rgba(70, 60, 38, .45);
}
.demo-strip .demo-grid { display: grid; grid-template-columns: 220px repeat(3, 1fr); gap: 22px 32px; max-width: 1280px; margin: 0 auto; }
.demo-strip .lbl { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--stone); align-self: center; }
.demo-strip b { font-size: clamp(24px, 2.6vw, 34px); font-weight: 300; color: var(--ink); }
.demo-strip .ring { font-size: 10.5px; color: var(--stone); letter-spacing: .18em; text-transform: uppercase; }
.demo-strip .src { grid-column: 1 / -1; font-size: 11.5px; color: var(--stone); margin-top: 6px; }

/* photo band — deliberately uneven */
.photos { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; }
.photos figure:first-child { grid-row: span 2; }
.photos img { width: 100%; height: 100%; object-fit: cover; }

/* download links — quiet text links, not buttons */
.dl-list { list-style: none; display: flex; gap: 8px 40px; flex-wrap: wrap; }
.dl-link {
  display: inline-block; padding: 10px 0; color: var(--ink); text-decoration: none;
  font-size: 14.5px; border-bottom: 1px solid var(--ink);
}
.dl-link::after { content: " ↓"; color: var(--brass); }
.dl-link:hover { color: var(--teal); border-color: var(--teal); }

/* ---------------- footer ---------------- */
footer.site-footer { background: var(--footer); color: #C6C1B0; margin-top: 72px; }
.footer-main {
  display: flex; flex-wrap: wrap; gap: 48px; justify-content: space-between;
  padding: 52px 4vw 42px; max-width: 1380px; margin: 0 auto;
}
.footer-main img { height: 80px; display: block; margin-bottom: 24px; }
.footer-main h4 { color: #F3EFE3; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; margin-bottom: 16px; font-weight: 400; }
.footer-main a { color: #DAD5C4; text-decoration: none; font-size: 14px; }
.footer-main a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.footer-main li { list-style: none; margin: 8px 0; }
.footer-legal {
  border-top: 1px solid #45443C; padding: 22px 4vw 30px; font-size: 12px;
  display: flex; flex-wrap: wrap; gap: 10px 34px; max-width: 1380px; margin: 0 auto;
  color: #97927F;
}
.footer-legal a { color: #B8B3A0; }

/* newsletter signup — footer column panel (dark context, subtle brass-topped
   inset so the eye lands here without breaking the footer's calm) */
.footer-signup {
  flex: 0 0 auto; width: 290px; align-self: flex-start;
  background: rgba(255,255,255,.05); border-top: 3px solid var(--brass);
  padding: 18px 20px 20px;
}
/* the signup column's header reads as one of the footer's other column
   headers (Explore, Texas Real Estate Commission) — it used to opt out of
   the tracked-caps treatment and looked like a bolt-on. Everything but the
   spacing now comes from .footer-main h4. */
.footer-signup h4 { margin-bottom: 8px; }
.footer-signup .nl-sub { color: #B8B3A0; font-size: 12px; line-height: 1.5; margin-bottom: 13px; }

/* ============ Constant Contact signup widget, dressed for the footer ======
   The widget injects its own DOM at runtime PLUS TWO separate stylesheets,
   both landing in <head> after ours:
     1. the static signup-form-widget.css (shipped defaults — white card,
        28px bold header, grey button)
     2. a per-instance <style id="ctct-form-styles_0"> GENERATED FROM THE
        ACCOUNT'S DASHBOARD THEME (John's "Sign Up to Receive Emails!" form
        config) — confirmed live: it sets .ctct-form-defaults{background-
        color:#fff} and .ctct-form-button{background-color:#999;border:1px
        solid #999;color:#fff} (+ :hover/:active), i.e. it just RESTATES the
        same white/grey CC ships as defaults, dashboard-side.
   That second stylesheet is generated per-form and account-editable — its
   selector pattern (`.ctct-form-embed.form_0 …`) and specificity aren't a
   stable contract, and its colors change the moment anyone touches the CC
   dashboard theme picker. Out-specificing it selector-by-selector would be
   fragile and silent-fail-prone, so the properties it actually sets
   (background-color on the card, background-color/border/color on the
   button, in every state) carry !important here — nothing else does; this
   list is exactly what that generated stylesheet touches, checked against
   the live DOM (`document.getElementById('ctct-form-styles_0').textContent`
   on staging), not guessed.

   :empty keeps the wrapper invisible if the widget never fills it (account
   offline, form unpublished), so the footer degrades to heading + sub-text
   instead of an empty box. */
.ctct-inline-form:empty { display: none; }

/* card → nothing: the footer column IS the card. background-color carries
   !important — it's the exact property both CC stylesheets set to #fff. */
.site-footer .footer-signup div.ctct-form-embed div.ctct-form-defaults {
  background-color: transparent !important;
  padding: 0; border-radius: 0;
  font-family: inherit; font-size: 13px; line-height: 1.55; color: #C6C1B0;
}

/* CC's own header + description restate the column's h4 and sub-text, so
   they're suppressed rather than duplicated. Scoped to the form's direct
   children so the SUCCESS message keeps its heading and copy. */
.site-footer .footer-signup form.ctct-form-custom > h2.ctct-form-header,
.site-footer .footer-signup form.ctct-form-custom > p.ctct-form-text { display: none !important; }

/* field + label: the site's tiny tracked-caps label language */
.site-footer .footer-signup div.ctct-form-embed form.ctct-form-custom div.ctct-form-field {
  margin: 0 0 12px 0;
}
.site-footer .footer-signup div.ctct-form-embed form.ctct-form-custom label.ctct-form-label {
  font-family: inherit; font-size: 10px; font-weight: 400;
  letter-spacing: .18em; text-transform: uppercase;
  color: #ABA595; margin-bottom: 7px;
}
/* CC hangs the required mark at left:-12px, which would sit outside the
   column once the card padding is gone — inline it, in brass not red */
.site-footer .footer-signup div.ctct-form-embed form.ctct-form-custom .ctct-form-required:before {
  position: static; color: var(--brass); margin-right: 5px;
}

/* email field: translucent on the charcoal rather than a white slab */
.site-footer .footer-signup div.ctct-form-embed form.ctct-form-custom input.ctct-form-element {
  font-family: inherit; font-size: 14px;
  height: auto; padding: 11px 12px;
  color: #F3EFE3;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 0; box-shadow: none;
}
.site-footer .footer-signup div.ctct-form-embed form.ctct-form-custom input.ctct-form-element::placeholder {
  color: #8F8A7C;
}
.site-footer .footer-signup div.ctct-form-embed form.ctct-form-custom input.ctct-form-element:focus {
  outline: 2px solid var(--brass); outline-offset: 1px;
  border-color: var(--brass); background: rgba(255, 255, 255, .10);
}
/* browser autofill would otherwise repaint the field pale blue on the dark footer */
.site-footer .footer-signup div.ctct-form-embed form.ctct-form-custom input.ctct-form-element:-webkit-autofill {
  -webkit-text-fill-color: #F3EFE3;
  -webkit-box-shadow: 0 0 0 1000px #3A3931 inset;
}

/* consent copy → collapsed; attribution link → kept, per CC's requirement.
   .ctct-gdpr-text is ONE <p> holding a bare disclaimer TEXT NODE followed
   by the required "Emails are serviced by Constant Contact." <a> (verified
   against the live DOM — no wrapping element around the disclaimer text to
   target directly). font-size can't be set on a text node, but it inherits
   from its containing block, so zeroing it on the paragraph shrinks the
   disclaimer's rendered glyphs AND the line-height it drives (unitless
   1.55 is a RATIO, so it re-multiplies against whatever font-size is
   actually in effect) to ~nothing — then the <a> rule below restores a
   real font-size on itself only, so it renders and clicks normally at
   its own line-height (1.55 × its own restored size), unaffected by its
   zeroed sibling text. !important on font-size because that's the one
   property doing the collapsing; nothing else here needs it. */
.site-footer .footer-signup div.ctct-form-embed div.ctct-form-defaults p.ctct-gdpr-text {
  font-family: inherit; font-size: 0 !important; line-height: 1.55;
  color: #ABA595; margin-bottom: 10px;
}
.site-footer .footer-signup div.ctct-form-embed div.ctct-form-defaults p.ctct-gdpr-text a {
  font-size: 10.5px !important; line-height: inherit;
  color: #DAD5C4; text-decoration: underline; text-underline-offset: 2px;
}
.site-footer .footer-signup div.ctct-form-embed div.ctct-form-defaults p.ctct-gdpr-text a:hover {
  color: #fff;
}

/* submit → the site's primary button language, matching .cf-submit on
   Contact exactly (same brass fill, same #8c6224 hover/focus darken) rather
   than approximating it. background-color/border/color carry !important —
   the account's dashboard-generated stylesheet sets exactly these three
   properties, in every state, to CC's own grey defaults. */
.site-footer .footer-signup div.ctct-form-embed form.ctct-form-custom button.ctct-form-button {
  font-family: inherit; font-size: 12px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  padding: 14px 20px; border-radius: 0;
  background-color: var(--brass) !important;
  border: 1px solid var(--brass) !important;
  color: #fff !important;
  transition: background-color .2s ease, border-color .2s ease;
}
.site-footer .footer-signup div.ctct-form-embed form.ctct-form-custom button.ctct-form-button:hover,
.site-footer .footer-signup div.ctct-form-embed form.ctct-form-custom button.ctct-form-button:focus-visible {
  background-color: #8c6224 !important; border-color: #8c6224 !important;
}
/* CC's own dashboard theme has no separate active/pressed distinction from
   hover; this site's brand buttons don't either (.cf-submit), but a
   pressed state reads better on a large flat fill, so it steps one shade
   further down the same hue */
.site-footer .footer-signup div.ctct-form-embed form.ctct-form-custom button.ctct-form-button:active {
  background-color: #704E1C !important; border-color: #704E1C !important;
}
/* teal, not another brass, so the ring reads as a ring against a brass
   button rather than disappearing into it */
.site-footer .footer-signup div.ctct-form-embed form.ctct-form-custom button.ctct-form-button:focus-visible {
  outline: 2px solid var(--teal); outline-offset: 2px;
}

/* CC's white wordmark: drop the dark pill it wears on white, keep it quiet */
.site-footer .footer-signup div.ctct-form-embed div.ctct-form-defaults p.ctct-form-footer {
  text-align: left; padding-top: 2px;
}
/* height:auto because `.footer-main img` pins 80px for the MSCP wordmark,
   which would otherwise stretch this 166×29 SVG into a tall empty box */
.site-footer .footer-signup div.ctct-form-embed div.ctct-form-defaults p.ctct-form-footer a img.ctct-form-footer-img {
  background: none; padding: 0; width: 92px; height: auto; opacity: .45;
  transition: opacity .2s ease;
}
.site-footer .footer-signup div.ctct-form-embed div.ctct-form-defaults p.ctct-form-footer a:hover img.ctct-form-footer-img {
  opacity: .75;
}

/* post-submit confirmation, same treatment as the column it replaces */
.site-footer .footer-signup div.ctct-form-embed div.ctct-form-defaults div.ctct-form-success {
  min-height: 0;
}
.site-footer .footer-signup div.ctct-form-embed div.ctct-form-defaults div.ctct-form-success h2.ctct-form-header {
  font-family: inherit; font-size: 13px; font-weight: 400; letter-spacing: .01em;
  color: #F3EFE3; margin-bottom: 6px;
}
.site-footer .footer-signup div.ctct-form-embed div.ctct-form-defaults div.ctct-form-success p.ctct-form-text {
  font-family: inherit; font-size: 12px; line-height: 1.55; color: #ABA595;
}

/* CC marks its error colour !important, so matching it is the only way to
   lift the red off the charcoal into a legible one */
.site-footer .footer-signup div.ctct-form-embed form.ctct-form-custom .ctct-form-errorMessage {
  font-family: inherit; font-size: 12px; color: #F08C82 !important;
}

/* footer columns reflow: 2×2 on tablet, stacked on mobile */
@media (max-width: 900px) {
  .footer-main { gap: 34px 40px; }
  .footer-main > div { flex: 1 1 calc(50% - 20px); }
  .footer-signup { width: auto; }
}
@media (max-width: 560px) {
  .footer-main > div { flex-basis: 100%; }
}

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  .narrative { grid-template-columns: 1fr; gap: 34px; }
  .photos { grid-template-columns: 1fr; }
  .demo-strip .demo-grid { grid-template-columns: 1fr 1fr; }
  .hero { min-height: 60vh; }
  .section { padding: 54px 5vw; }
  .nav .nav-links { gap: 20px; }
}

/* mobile nav: brandmark + hamburger, ribbon collapses into a dropdown panel. */
@media (max-width: 760px) {
  /* brandmark trimmed + wordmark sized to fit beside it and the hamburger on
     one row; flex:0 0 auto on both stops them being squeezed/distorted by
     flexbox shrink under space pressure (the earlier "squished stripe" bug —
     an unconstrained flex item can be shrunk below its intrinsic width even
     with height+width:auto set, and an <img> just renders squeezed into it). */
  .nav .brand .mark { height: 34px; flex: 0 0 auto; }
  .nav .brand .word { height: 24px; width: auto; flex: 0 0 auto; }
  .nav-toggle { display: flex; }
  /* When OPEN, .nav needs to outrank page overlays like Who We Are's bio
     slide-over (.bio-panel/.bio-backdrop, z-index 95/90) so the dropdown
     never renders under them — z-index on .nav-links alone can't do this:
     .nav is itself a stacking context (position:sticky + z-index), so a
     child's z-index only ranks it among .nav's own children, never against
     siblings of .nav elsewhere in the document. Scoped to is-open only —
     .nav must stay BELOW the bio panel the rest of the time, or the sticky
     bar covers the panel's own close button at the top of the viewport. */
  .nav.is-open { z-index: 100; }
  .nav .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    margin-left: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--hairline);
    padding: 6px 4vw 14px;
    box-shadow: 0 18px 30px -22px rgba(56, 48, 30, .35);
  }
  .nav.is-open .nav-links { display: flex; }
  .nav .nav-links a { padding: 13px 0; border-top: 1px solid var(--hairline); }
  .nav .nav-links a:first-child { border-top: none; }
}
