/* MK Watson Homes — template shell (tokens / base / primitives / header / footer)
   Page section styles live in separate files (e.g. index.css).

   Brand palette — the authoritative rules live in readme.md.
   Deep navy #0B2D45 · Clear blue #1F6B8A · Warm ivory #F7F4EE · Charcoal #17212B
   Burnt orange #C84A00 (CTA) · Dark orange #B74300 (CTA hover) · Warm gold #E7B65A (accent)

   Fonts: Cormorant Garamond · Montserrat
*/

:root {
  /* —— Brand palette (do not add hues outside this set) —— */
  --navy: #0b2d45;          /* primary brand: header, footer, headings, overlays */
  --blue: #1f6b8a;          /* secondary: links, icons, active filters */
  --ivory: #f7f4ee;         /* main background */
  --charcoal: #17212b;      /* body copy, form labels */
  --cta: #c84a00;           /* primary CTA */
  --cta-hover: #b74300;     /* CTA hover / pressed */
  --gold: #e7b65a;          /* minor accent: stars, badges, small highlights */

  /* —— Derived tints of the palette (no new hues) —— */
  --navy-deep: #061e30;     /* footer base, hero gradient floor */
  --navy-soft: #143d5c;     /* raised surfaces on navy */
  --blue-deep: #175a75;     /* link hover on light backgrounds */
  --surface: #ffffff;       /* cards and panels on ivory */
  --ivory-dim: #efeae1;     /* alternating section band */

  --line: rgba(11, 45, 69, 0.14);
  --line-strong: rgba(11, 45, 69, 0.28);
  --muted: rgba(23, 33, 43, 0.68);

  --on-navy: rgba(247, 244, 238, 0.82);   /* body copy on navy */
  --on-navy-dim: rgba(247, 244, 238, 0.6);
  --line-on-navy: rgba(247, 244, 238, 0.18);

  --shadow-sm: 0 1px 2px rgba(11, 45, 69, 0.05), 0 6px 16px rgba(11, 45, 69, 0.07);
  --shadow-md: 0 14px 34px rgba(11, 45, 69, 0.12);
  --shadow-lg: 0 24px 60px rgba(11, 45, 69, 0.18);

  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Montserrat", system-ui, sans-serif;
  --max: 1120px;
  --header-h: 4.25rem;
  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--charcoal);
  background: var(--ivory);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--blue-deep);
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* —— Shared brand primitives ——
   Site-wide UI so every page inherits the same palette. Page CSS files
   should compose these, not restate their colors.
*/
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  color: var(--navy);
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(1.85rem, 3.5vw, 2.6rem);
  letter-spacing: 0.02em;
}

h3 {
  font-size: 1.35rem;
  font-weight: 600;
}

p {
  margin: 0 0 1rem;
}

.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.75rem;
}

/* Gold hairline divider — a small highlight, never a major surface. */
.gold-rule {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
}

.gold-rule::before,
.gold-rule::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  max-width: 4rem;
}

.gold-rule span {
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: var(--gold);
  flex-shrink: 0;
}

/* Buttons — burnt orange is reserved for primary calls to action. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.9rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
    border-color 0.25s var(--ease), transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: none;
}

/* Primary CTA: search, valuation, contact, lead capture. */
.btn-cta {
  background: var(--cta);
  border-color: var(--cta);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-cta:hover,
.btn-cta:focus-visible {
  background: var(--cta-hover);
  border-color: var(--cta-hover);
  color: #fff;
}

/* Secondary outline button on ivory surfaces. */
.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--line-strong);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  color: var(--navy);
  border-color: var(--navy);
  background: rgba(11, 45, 69, 0.05);
}

/* Secondary outline button on navy surfaces. */
.btn-outline-invert {
  background: transparent;
  color: var(--ivory);
  border-color: rgba(247, 244, 238, 0.45);
}

.btn-outline-invert:hover,
.btn-outline-invert:focus-visible {
  color: var(--navy);
  background: var(--ivory);
  border-color: var(--ivory);
}

/* —— Header —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  border-bottom: 1px solid var(--line-on-navy);
  transition: box-shadow 0.3s var(--ease);
}

.site-header.is-scrolled {
  box-shadow: 0 10px 30px rgba(6, 30, 48, 0.22);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding-block: 0.65rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: inherit;
  line-height: 0;
}

.brand:hover {
  color: inherit;
  opacity: 0.95;
}

.brand-logo {
  display: block;
  width: auto;
  height: 2.75rem;
  max-width: min(11.5rem, 42vw);
  object-fit: contain;
}

/* Scoped to the header: IDX Broker injects Bootstrap `.nav` markup, which
   must not inherit the site nav's reversed-out styling. */
.site-header .nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.site-header .nav a {
  position: relative;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ivory);
}

.site-header .nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.4rem;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}

.site-header .nav a:not(.nav-cta):hover::after,
.site-header .nav a[aria-current="page"]:not(.nav-cta)::after {
  transform: scaleX(1);
}

.site-header .nav a:hover {
  color: var(--ivory);
}

/* Phone in the header is a lead action — primary CTA colour. */
.nav-cta {
  padding: 0.62rem 1.1rem;
  border-radius: var(--radius);
  background: var(--cta);
  color: #fff !important;
  font-weight: 600;
  transition: background-color 0.25s var(--ease);
}

.nav-cta:hover,
.nav-cta:focus-visible {
  background: var(--cta-hover);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(247, 244, 238, 0.4);
  color: var(--ivory);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 1.1rem;
  height: 2px;
  margin: 4px auto;
  background: var(--ivory);
}

/* —— Footer —— */
.site-footer {
  padding: 3rem 0 2.5rem;
  background: var(--navy-deep);
  color: var(--on-navy);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line-on-navy);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ivory);
  letter-spacing: 0.04em;
}

.footer-brand-logo {
  display: block;
  width: auto;
  height: 3rem;
  object-fit: contain;
}

.footer-brand-text span {
  color: var(--gold);
  font-weight: 600;
}

.footer-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.75rem;
}

.footer-logo-link,
.footer-logo-eho {
  display: inline-flex;
  align-items: center;
  opacity: 0.92;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.footer-logo-link:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.footer-logo-link img,
.footer-logo-eho img {
  width: auto;
  height: 3rem;
  object-fit: contain;
}

.footer-logo-real img {
  height: 3.35rem;
}

.footer-logo-eho img {
  height: 3rem;
}

/* Footer quick links — site paths plus the two IDX pages people ask for most. */
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line-on-navy);
}

.footer-nav a {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ivory);
}

.footer-nav a:hover {
  color: var(--gold);
}

.footer-compliance {
  max-width: 52rem;
  font-size: 0.78rem;
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--on-navy-dim);
}

.footer-compliance p {
  margin: 0 0 0.55rem;
  color: inherit;
  font-size: inherit;
}

.footer-compliance strong {
  color: var(--on-navy);
  font-weight: 600;
}

/* Clear blue only reaches ~2.4:1 on navy, so links on dark use ivory/gold. */
.footer-compliance a {
  color: var(--ivory);
  text-decoration: underline;
  text-decoration-color: rgba(231, 182, 90, 0.5);
  text-underline-offset: 3px;
}

.footer-compliance a:hover {
  color: var(--gold);
  text-decoration-color: var(--gold);
}

.footer-disclaimer {
  margin-top: 0.85rem !important;
}

.footer-copy {
  margin-top: 1rem !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(247, 244, 238, 0.45) !important;
}

/* Mobile nav — the drawer takes over early enough that six links plus the
   phone CTA never crowd the brand. */
@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }

  .site-header .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1rem 1.1rem;
    background: var(--navy);
    border-bottom: 1px solid var(--line-on-navy);
    box-shadow: 0 18px 30px rgba(6, 30, 48, 0.25);
    display: none;
  }

  .site-header .nav.is-open {
    display: flex;
  }

  .site-header .nav a {
    padding: 0.85rem 0.5rem;
    border-bottom: 1px solid var(--line-on-navy);
  }

  .site-header .nav a:not(.nav-cta)::after {
    display: none;
  }

  .nav-cta {
    margin-top: 0.85rem;
    text-align: center;
    justify-content: center;
    border-bottom: 0;
  }

  .footer-compliance {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .footer-brand-text {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .site-header,
  .site-header .nav a,
  .site-header .nav a::after,
  .btn,
  .footer-logo-link {
    transition: none !important;
  }
}
