/* ===========================================================
   The Mortgage Dock — Shared Site Styles  v2
   Aligned to the locked TMD Brand Kit (2026-08-05).
   For sub-pages: /florida-keys/, /investors/, /loan-programs/, /blog/, etc.

   CHANGES FROM v1
   - Palette snapped to the locked brand kit values.
   - Added Keys Water #2EC4B6 (the tagline signature) and Sand #F4EDE0.
   - Body font moved from Inter to DM Sans. DM Mono added for figures.
   - Fixed contrast failures: gold buttons had white text at 2.4:1 (unreadable).
     Gold now carries navy text at 7.0:1. Teal buttons use an accessible deep
     teal at 5.3:1 instead of white-on-#1A9B8A at 3.4:1.
   - Hardcoded hero and glow colors replaced with tokens.
   - Mobile nav no longer hides every link. It scrolls instead.
   =========================================================== */

:root {
  /* ---- BRAND TOKENS (locked, do not edit) ---- */
  --ocean-deep:   #0A1628;  /* dark backgrounds */
  --navy:         #0D2240;  /* PRIMARY: headers, panels, buttons */
  --ocean-surface:#1A3A5C;  /* cards, borders on dark */
  --teal:         #1A9B8A;  /* SECONDARY */
  --teal-light:   #22C5B0;  /* hovers, highlights */
  --keys:         #2EC4B6;  /* HIGHLIGHT: the word "Edge", water imagery */
  --gold:         #C9A84C;  /* ACCENT: CTAs, emphasis */
  --gold-light:   #E8C96A;  /* secondary highlights */
  --sand:         #F4EDE0;  /* light bg, body text on dark */

  /* ---- ACCESSIBLE DERIVATIVES ----
     Brand teal is too light to carry white text. These keep the brand hue
     while passing WCAG AA. Use them for text and button fills, never as
     a substitute for the brand tokens above in logos or brand marks. ---- */
  --teal-deep:    #15796D;  /* white text passes at 5.3:1 */
  --teal-deeper:  #116759;  /* white text passes at 6.8:1 */

  /* ---- NEUTRALS ---- */
  --white:        #ffffff;
  --off-white:    #f8f9fc;
  --light-gray:   #edf0f5;
  --text:         #1a2332;
  --text-light:   #4a5568;
  --text-muted:   #5F7185;  /* was #718096, which failed AA at 4.0:1 */
  --border:       #e2e8f0;

  /* ---- LEGACY ALIASES ----
     Kept so any page still referencing the old names keeps working
     while it gets migrated. Remove once every page is on v2. ---- */
  --navy-mid:     var(--navy);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.14), 0 4px 16px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-lg: 20px;
  --max-width: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
.font-serif { font-family: 'Playfair Display', Georgia, serif; }
.font-mono  { font-family: 'DM Mono', ui-monospace, SFMono-Regular, monospace; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4 { font-family: 'Playfair Display', Georgia, serif; color: var(--navy); line-height: 1.18; }
h1 { font-size: clamp(34px, 5vw, 56px); margin-bottom: 18px; }
h2 { font-size: clamp(28px, 4vw, 42px); margin-bottom: 14px; }
h3 { font-size: 22px; margin-bottom: 10px; }
p  { margin-bottom: 16px; color: var(--text-light); font-size: 17px; }

/* ===== TAGLINE SIGNATURE (locked brand treatment) =====
   Usage: <p class="tmd-tagline">The <span class="edge">Edge</span> Behind Every Coastal Closing</p>
   "Edge" is always Keys Water. Rest is white on dark, navy on light. */
.tmd-tagline { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; color: var(--navy); }
.section-dark .tmd-tagline, .page-hero .tmd-tagline, .cta-band .tmd-tagline, .tmd-footer .tmd-tagline { color: var(--white); }
.edge { color: var(--keys); }

/* ===== ACCESSIBILITY BASELINE ===== */
:focus-visible { outline: 3px solid var(--keys); outline-offset: 2px; border-radius: 4px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--gold); color: var(--navy); padding: 12px 20px;
  font-weight: 600; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===== NAV ===== */
.tmd-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,22,40,0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.tmd-nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px; max-width: var(--max-width);
  margin: 0 auto; padding: 0 24px;
}
.tmd-nav a { color: rgba(255,255,255,0.88); font-size: 14px; font-weight: 500; padding: 8px 14px; border-radius: 6px; transition: all 0.2s; white-space: nowrap; }
.tmd-nav a:hover { color: var(--white); background: rgba(255,255,255,0.08); }
.tmd-nav .nav-brand { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 20px; color: var(--white); }
.tmd-nav .nav-brand span { color: var(--gold); }
.tmd-nav-links { display: flex; gap: 4px; align-items: center; }
/* Gold CTA now carries navy text. White on gold was 2.4:1 and failed WCAG. */
.tmd-nav-cta { background: var(--gold); color: var(--navy) !important; font-weight: 600; padding: 10px 18px !important; }
.tmd-nav-cta:hover { background: var(--gold-light); color: var(--navy) !important; }

@media (max-width: 900px) {
  /* v1 hid every link below 760px, leaving the site unnavigable on phones.
     Links now scroll horizontally instead of disappearing. */
  .tmd-nav-inner { height: auto; padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .tmd-nav-links {
    order: 3; width: 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 2px;
  }
  .tmd-nav-links::-webkit-scrollbar { display: none; }
  .tmd-nav a { padding: 8px 10px; font-size: 13.5px; }
}

/* ===== HERO ===== */
.page-hero {
  background: linear-gradient(135deg, var(--ocean-deep) 0%, var(--navy) 50%, #0A4A5E 100%);
  color: var(--white);
  padding: 80px 0 70px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(46,196,182,0.20) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 85% 80%, rgba(201,168,76,0.12) 0%, transparent 60%);
  pointer-events: none;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { color: var(--white); }
.page-hero p { color: rgba(255,255,255,0.88); max-width: 700px; margin: 0 auto 28px; font-size: 19px; }
.eyebrow {
  display: inline-block;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--keys);
  margin-bottom: 16px;
  font-weight: 600;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 8px;
  font-family: inherit;
  font-size: 15px; font-weight: 600; cursor: pointer;
  border: none; transition: all 0.2s ease;
  text-align: center;
}
/* Teal fill uses the accessible deep teal so white label text passes AA. */
.btn-primary { background: var(--teal-deep); color: var(--white); }
.btn-primary:hover { background: var(--teal-deeper); transform: translateY(-1px); box-shadow: var(--shadow-md); }
/* Gold is an accent, not a dark surface. Navy text, 7.0:1. */
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-light); color: var(--navy); }
.btn-outline { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,0.6); }
.btn-outline:hover { background: rgba(255,255,255,0.12); border-color: var(--white); }
.btn-outline-dark { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.btn-outline-dark:hover { background: var(--navy); color: var(--white); }

/* ===== SECTIONS ===== */
section { padding: 70px 0; }
.section-light { background: var(--off-white); }
.section-dark { background: var(--navy); color: var(--sand); }
.section-dark h1, .section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark p { color: rgba(244,237,224,0.82); }
.section-dark a:not(.btn) { color: var(--keys); }

.section-header { text-align: center; max-width: 760px; margin: 0 auto 50px; }
.section-header p { font-size: 18px; color: var(--text-light); }

/* ===== GRIDS ===== */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 26px; }
.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-card .icon { font-size: 28px; margin-bottom: 12px; }
.feature-card h3 { font-size: 20px; }
.section-dark .feature-card { background: var(--ocean-surface); border-color: rgba(46,196,182,0.22); }
.section-dark .feature-card h3 { color: var(--white); }
.section-dark .feature-card p { color: rgba(244,237,224,0.78); }

/* ===== FAQ ACCORDION =====
   Matches the homepage FAQ pattern so sub-pages render identically.
   Markup:
     <div class="faq-list">
       <details class="faq-item">
         <summary class="faq-q">Question?</summary>
         <p class="faq-a">Answer.</p>
       </details>
     </div>
   Pair every FAQ block with FAQPage schema in the head. */
.faq-list { max-width: 820px; margin: 0 auto; }
.faq-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color .18s, box-shadow .18s;
}
.faq-item[open] { border-color: var(--teal); box-shadow: var(--shadow-sm); }
.faq-q {
  cursor: pointer;
  list-style: none;
  padding: 20px 52px 20px 24px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--navy);
  position: relative;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: '';
  position: absolute; right: 24px; top: 50%;
  width: 9px; height: 9px;
  border-right: 2px solid var(--teal-deep);
  border-bottom: 2px solid var(--teal-deep);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .2s;
}
.faq-item[open] .faq-q::after { transform: translateY(-30%) rotate(-135deg); }
.faq-q:hover { color: var(--teal-deep); }
.faq-a {
  padding: 0 24px 22px;
  margin: 0;
  color: var(--text-light);
  font-size: 16px;
  line-height: 1.72;
}
.faq-a + .faq-a { padding-top: 14px; }
.section-light .faq-item { background: var(--white); }
.section-dark .faq-item { background: var(--ocean-surface); border-color: rgba(46,196,182,0.22); }
.section-dark .faq-q { color: var(--white); }
.section-dark .faq-a { color: rgba(244,237,224,0.82); }

/* ===== BREADCRUMBS ===== */
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--teal-deep); }
.breadcrumb a:hover { text-decoration: underline; }

/* ===== CTA BAND ===== */
.cta-band {
  background: linear-gradient(135deg, var(--ocean-deep) 0%, var(--navy) 100%);
  color: var(--white);
  padding: 70px 24px;
  text-align: center;
}
.cta-band h2 { color: var(--white); }
.cta-band p { color: rgba(255,255,255,0.88); max-width: 600px; margin: 0 auto 28px; }

/* ===== ARTICLE / PROSE ===== */
.prose { max-width: 760px; margin: 0 auto; font-size: 18px; }
.prose h2 { margin-top: 38px; font-size: 30px; }
.prose h3 { margin-top: 26px; font-size: 22px; color: var(--navy); }
.prose p { font-size: 17.5px; line-height: 1.75; margin-bottom: 18px; color: var(--text); }
.prose ul, .prose ol { margin: 0 0 22px 22px; }
.prose li { margin-bottom: 8px; font-size: 17px; line-height: 1.7; }
.prose blockquote {
  border-left: 4px solid var(--teal);
  background: var(--off-white);
  padding: 20px 24px;
  margin: 24px 0;
  font-style: italic;
  color: var(--text);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.prose strong { color: var(--navy); }
.prose a { color: var(--teal-deep); border-bottom: 1px dotted var(--teal-deep); }
.prose a:hover { color: var(--teal-deeper); }
/* Buttons inside prose must not inherit the link treatment.
   `.prose a` (0,1,1) outranks `.btn-primary` (0,1,0), which made button labels
   render in the same colour as their own background. These restore the button
   colours at matching specificity. */
.prose a.btn { border-bottom: none; }
.prose a.btn-primary { color: var(--white); }
.prose a.btn-primary:hover { color: var(--white); }
.prose a.btn-gold { color: var(--navy); }
.prose a.btn-gold:hover { color: var(--navy); }
/* Outline buttons carry a real border on all four sides. The rule above clears
   the dotted link underline, so the full border has to be restored here or the
   frame loses its bottom edge. */
.prose a.btn-outline { color: var(--white); border: 2px solid rgba(255,255,255,0.6); }
.prose a.btn-outline:hover { color: var(--white); border-color: var(--white); }
.prose a.btn-outline-dark { color: var(--navy); border: 2px solid var(--navy); }
.prose a.btn-outline-dark:hover { color: var(--white); border-color: var(--navy); }
.prose .lede { font-size: 21px; line-height: 1.5; color: var(--text); margin-bottom: 30px; }
.prose-meta {
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 24px; padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
/* Figures and rates read better in mono */
.prose .figure, .stat-num { font-family: 'DM Mono', ui-monospace, monospace; font-weight: 500; }

/* ===== BLOG GRID ===== */
.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }
.post-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex; flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.post-card .post-tag {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--teal-deep); font-weight: 600; margin-bottom: 10px;
}
.post-card h3 { font-size: 22px; margin-bottom: 8px; }
.post-card p { color: var(--text-muted); flex: 1; font-size: 15px; margin-bottom: 14px; }
.post-card .read-more { color: var(--teal-deep); font-weight: 600; font-size: 14px; }

/* ===== FOOTER ===== */
.tmd-footer {
  background: var(--ocean-deep);
  color: rgba(244,237,224,0.72);
  padding: 50px 24px 30px;
  font-size: 14px;
}
.tmd-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(46,196,182,0.18);
}
.tmd-footer h4 { color: var(--white); font-size: 16px; margin-bottom: 14px; font-family: 'DM Sans', sans-serif; font-weight: 600; }
.tmd-footer ul { list-style: none; }
.tmd-footer li { margin-bottom: 8px; }
.tmd-footer a { color: rgba(244,237,224,0.68); transition: color 0.15s; }
.tmd-footer a:hover { color: var(--keys); }
.tmd-footer-legal {
  max-width: var(--max-width);
  margin: 24px auto 0;
  padding-top: 24px;
  font-size: 12px;
  color: rgba(244,237,224,0.55);
  text-align: center;
  line-height: 1.7;
}
/* Equal Housing mark, required on public pages */
.tmd-eho { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.tmd-eho svg { width: 15px; height: 15px; fill: currentColor; }

/* Logo image in nav */
.nav-brand img { height: 48px; width: auto; display: block; }
.nav-brand { display: flex; align-items: center; }

/* ===== PRINT ===== */
@media print {
  .tmd-nav, .cta-band, .hero-cta { display: none; }
  body { color: #000; background: #fff; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 11px; }
}
