/* ============================================
   ContainerCompass — Shared Stylesheet
   styles.css
   ============================================ */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #1B2B3B;
  --rust:       #D95A1A;
  --rust-light: #F0723A;
  --cream:      #F7F4EE;
  --white:      #FFFFFF;
  --muted:      #6B7A8A;
  --border:     #DDD8CE;
  --text:       #1B2B3B;
  --section-alt: #F0ECE4;
  --font-head:  'Barlow Condensed', sans-serif;
  --font-body:  'DM Sans', sans-serif;
  --max:        1140px;
  --radius:     6px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Layout ── */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.1;
  color: var(--navy);
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-head);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.05;
  color: var(--navy);
  margin-bottom: 48px;
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--rust);
  color: white;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 26px;
  border-radius: var(--radius);
  transition: background 0.15s, transform 0.1s;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
}
.btn-primary:hover { background: var(--rust-light); transform: translateY(-1px); color: white; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--navy);
  font-weight: 500;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
  font-family: var(--font-body);
}
.btn-secondary:hover { border-color: var(--navy); background: rgba(27,43,59,0.03); }

/* ── Badges ── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  margin-bottom: 10px;
}
.badge-buy    { background: #EBF3FA; color: #1B4F7A; }
.badge-homes  { background: #EDF5EA; color: #2A5E22; }
.badge-rent   { background: #FFF0E8; color: #A83D10; }
.badge-cost   { background: #F0ECE4; color: #5A4A35; }
.badge-guide  { background: #EEEDFE; color: #3C3489; }

/* ── Affiliate Disclosure Banner ── */
.disclosure-bar {
  background: var(--navy);
  color: rgba(255,255,255,0.65);
  font-size: 12px;
  text-align: center;
  padding: 8px 24px;
  letter-spacing: 0.01em;
}
.disclosure-bar a {
  color: rgba(255,255,255,0.9);
  text-decoration: underline;
}

/* ── Navigation ── */
nav.site-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}
.logo {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--rust);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo-mark svg { width: 18px; height: 18px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--navy); }
.nav-links a.active { color: var(--navy); }
.nav-cta {
  background: var(--rust) !important;
  color: white !important;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-weight: 600 !important;
  transition: background 0.15s !important;
}
.nav-cta:hover { background: var(--rust-light) !important; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: all 0.2s;
}

/* ── Page Header (inner pages) ── */
.page-header {
  background: var(--navy);
  padding: 56px 0 52px;
}
.page-header .breadcrumb {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-header .breadcrumb a { color: rgba(255,255,255,0.55); }
.page-header .breadcrumb a:hover { color: white; }
.page-header .breadcrumb span { color: rgba(255,255,255,0.25); }
.page-header h1 {
  font-family: var(--font-head);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 800;
  color: white;
  line-height: 0.95;
  margin-bottom: 16px;
}
.page-header .page-subtitle {
  font-size: 18px;
  color: rgba(255,255,255,0.6);
  font-weight: 300;
  max-width: 560px;
}
.page-header .page-meta {
  margin-top: 20px;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── Content Layout (article pages) ── */
.content-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  padding: 56px 0 80px;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.article-body {
  min-width: 0;
}
.article-body h2 {
  font-size: 30px;
  margin: 40px 0 16px;
}
.article-body h3 {
  font-size: 22px;
  margin: 28px 0 12px;
}
.article-body p {
  margin-bottom: 20px;
  line-height: 1.75;
}
.article-body ul, .article-body ol {
  padding-left: 24px;
  margin-bottom: 20px;
  line-height: 1.75;
}
.article-body li { margin-bottom: 8px; }
.article-body a { color: var(--rust); text-decoration: underline; text-underline-offset: 2px; }
.article-body a:hover { color: var(--navy); }

/* ── Table of Contents ── */
.toc {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 40px;
}
.toc-title {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.toc ol {
  padding-left: 20px;
  margin: 0;
}
.toc li { margin-bottom: 6px; }
.toc a {
  font-size: 14px;
  color: var(--rust);
  text-decoration: none;
}
.toc a:hover { color: var(--navy); }

/* ── Callout boxes ── */
.callout {
  border-radius: 8px;
  padding: 20px 24px;
  margin: 28px 0;
  border-left: 3px solid;
}
.callout-tip    { background: #EDF5EA; border-color: #3A7A30; }
.callout-warn   { background: #FFF0E8; border-color: var(--rust); }
.callout-info   { background: #EBF3FA; border-color: #185FA5; }
.callout-title  { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.callout p      { margin: 0; font-size: 14px; line-height: 1.6; }

/* ── Data Table ── */
.data-table-wrap { overflow-x: auto; margin: 28px 0; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.data-table th {
  background: var(--navy);
  color: white;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 12px 16px;
}
.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) td { background: #FAFAF8; }
.data-table td strong { font-weight: 600; }

/* ── Sidebar ── */
.sidebar { }
.sidebar-widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}
.sidebar-widget-head {
  background: var(--navy);
  padding: 16px 20px;
}
.sidebar-widget-head h3 {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  color: white;
}
.sidebar-widget-head p {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin-top: 3px;
}
.sidebar-widget-body { padding: 20px; }
.sidebar-widget-body p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 14px;
}
.sidebar-cta {
  display: block;
  background: var(--rust);
  color: white;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  transition: background 0.15s;
}
.sidebar-cta:hover { background: var(--rust-light); color: white; }
.sidebar-links { list-style: none; display: flex; flex-direction: column; gap: 1px; }
.sidebar-links li a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s;
}
.sidebar-links li:last-child a { border-bottom: none; }
.sidebar-links li a:hover { color: var(--rust); }
.sidebar-links li a::before { content: '→'; color: var(--rust); font-size: 12px; }

/* ── Footer ── */
footer.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  padding: 60px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand .logo { color: white; margin-bottom: 16px; }
.footer-brand p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,0.4);
  max-width: 260px;
}
.footer-col h4 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col ul a {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
  transition: color 0.15s;
}
.footer-col ul a:hover { color: rgba(255,255,255,0.9); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom a { color: rgba(255,255,255,0.35); transition: color 0.15s; }
.footer-bottom a:hover { color: rgba(255,255,255,0.8); }
.footer-legal-links { display: flex; gap: 20px; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .content-wrap { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 24px;
    gap: 16px;
    z-index: 99;
  }
}
@media (max-width: 600px) {
  .sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-legal-links { flex-direction: column; gap: 10px; }
}
