/* ==========================================================================
   Resources / Mortgage Glossary — Page-Specific Styles
   Extends landing.css patterns  ·  Flexbox-first  ·  Fully responsive
   ========================================================================== */

/* ---- Index Grid ---- */
.res-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
}

/* ---- Index Card ---- */
.res-card{
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 20px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.res-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow2);
}
.res-card h3{
  font-size: 15px;
  margin-bottom: 4px;
}
.res-card p{
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ---- Letter Badge ---- */
.res-card-letter{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(15,23,42,.04);
  border: 1px solid rgba(15,23,42,.08);
  font-weight: 900;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
  flex-shrink: 0;
}

/* ---- Illustration ---- */
.res-illustration{
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}
.res-illustration img{
  width: 100%;
  max-width: 640px;
  height: auto;
  border-radius: var(--radius2);
  border: 1px solid var(--border);
}

/* ---- Breadcrumb ---- */
.res-breadcrumb{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 14px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.res-breadcrumb a{
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(11,18,32,.25);
}
.res-breadcrumb a:hover{
  color: var(--text);
  text-decoration-color: rgba(11,18,32,.60);
}
.res-breadcrumb-sep{
  opacity: .4;
}

/* ---- Term Page Hero ---- */
.res-term-hero{
  padding: 40px 0 32px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.res-term-hero h1{
  font-size: clamp(28px, 3.8vw, 44px);
}
.res-tagline{
  margin-top: 8px;
  font-size: 16px;
  color: var(--text-muted);
}

/* ---- Content Sections ---- */
.res-section{
  padding: 36px 0;
}
.res-section h2{
  font-size: clamp(20px, 2.5vw, 28px);
  margin-bottom: 12px;
}
.res-section p{
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}
.res-section--bordered{
  border-top: 1px solid var(--border);
}

/* ---- Key Facts ---- */
.res-facts{
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}
.res-facts li{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  font-size: 14px;
  line-height: 1.55;
  border-bottom: 1px solid rgba(15,23,42,.06);
}
.res-facts li:last-child{
  border-bottom: none;
}
.res-facts li::before{
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #111;
  flex-shrink: 0;
  margin-top: 7px;
}

/* ---- Example Callout ---- */
.res-example-card{
  padding: 24px;
  background: rgba(15,23,42,.025);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  border-left: 3px solid rgba(15,23,42,.15);
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
  margin-top: 12px;
}

/* ---- Language Visibility ---- */
.lang-es-only{ display: none; }
[data-lang="es"] .lang-es-only{ display: block; }

/* ---- Spanish Section ---- */
.res-espanol{
  padding: 24px;
  background: rgba(15,23,42,.02);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  margin-top: 12px;
}
.res-espanol p{
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  font-style: italic;
}
.res-espanol-label{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 10px;
  letter-spacing: .4px;
  text-transform: uppercase;
  background: rgba(15,23,42,.04);
  border: 1px solid rgba(15,23,42,.08);
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ---- Related Terms Grid ---- */
.res-related-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 880px){
  .res-grid{
    grid-template-columns: repeat(2, 1fr);
  }
  .res-section{
    padding: 28px 0;
  }
  .res-term-hero{
    padding: 32px 0 24px;
  }
}
@media (max-width: 640px){
  .res-grid{
    grid-template-columns: 1fr;
  }
  .res-related-grid{
    grid-template-columns: 1fr;
  }
  .res-term-hero{
    padding: 24px 0 20px;
  }
  .res-term-hero h1{
    font-size: 26px;
  }
  .res-tagline{
    font-size: 14px;
  }
  .res-section{
    padding: 24px 0;
  }
  .res-section h2{
    font-size: 20px;
  }
  .res-breadcrumb{
    font-size: 12px;
    padding: 10px 0;
  }
  .res-example-card{
    padding: 18px;
  }
  .res-espanol{
    padding: 18px;
  }
  .res-card{
    padding: 16px;
  }
}

/* ═══════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════ */
[data-theme="dark"] .res-card{
  background: var(--card);
  border-color: rgba(255,255,255,.08);
}
[data-theme="dark"] .res-card:hover{
  box-shadow: 0 10px 26px rgba(0,0,0,.35);
}
[data-theme="dark"] .res-card-letter{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
}

[data-theme="dark"] .res-breadcrumb a{
  color: rgba(228,228,228,.55);
  text-decoration-color: rgba(228,228,228,.25);
}
[data-theme="dark"] .res-breadcrumb a:hover{
  color: #e4e4e4;
  text-decoration-color: rgba(228,228,228,.60);
}

[data-theme="dark"] .res-term-hero{
  border-bottom-color: rgba(255,255,255,.08);
}

[data-theme="dark"] .res-facts li{
  border-bottom-color: rgba(255,255,255,.06);
}
[data-theme="dark"] .res-facts li::before{
  background: #e4e4e4;
}

[data-theme="dark"] .res-example-card{
  background: rgba(255,255,255,.025);
  border-color: rgba(255,255,255,.08);
  border-left-color: rgba(255,255,255,.15);
}

[data-theme="dark"] .res-espanol{
  background: rgba(255,255,255,.02);
  border-color: rgba(255,255,255,.08);
}
[data-theme="dark"] .res-espanol-label{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
}

[data-theme="dark"] .res-illustration img{
  border-color: rgba(255,255,255,.08);
}

[data-theme="dark"] .res-section--bordered{
  border-top-color: rgba(255,255,255,.08);
}
