/* ============================================================
   BYINSURED — DESIGN SYSTEM & BASE STYLES
   Admin panel will override :root variables from DB in Phase 2.
   ============================================================ */

/* NOTE: Google Fonts are loaded via <link> in header.php.
   The @import was removed — it caused a render-blocking chain
   (HTML → style.css → @import → font CSS → font files = 5 serial round trips).
   The <link rel="preload"> in header.php loads fonts non-blocking. */

:root {
  /* === Brand colours === */
  --color-primary:      #0B2540;   /* deep navy — trust */
  --color-primary-700:  #143459;
  --color-accent:       #2563EB;   /* action blue */
  --color-accent-50:    #EFF4FF;   /* light blue tint */
  --color-teal:         #0EA5A4;   /* secondary highlight */
  --color-amber:        #F59E0B;   /* warnings / buyer-beware */
  --color-success:      #16A34A;
  --color-danger:       #DC2626;

  /* === Surfaces === */
  --color-bg:           #F7F8FA;
  --color-surface:      #FFFFFF;
  --color-line:         #E5E7EB;
  --color-line-soft:    #EEF0F3;

  /* === Text === */
  --color-text:         #0F172A;
  --color-text-2:       #475569;
  --color-text-3:       #94A3B8;

  /* === Typography === */
  --font-heading: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* === Radii === */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  14px;
  --r-xl:  20px;
  --radius: var(--r-lg);

  /* === Shadows === */
  --sh-1: 0 1px 2px rgba(15,23,42,.05), 0 1px 1px rgba(15,23,42,.04);
  --sh-2: 0 4px 14px rgba(15,23,42,.06), 0 2px 4px rgba(15,23,42,.04);
  --sh-3: 0 12px 32px rgba(15,23,42,.10);
  --shadow: var(--sh-2);

  /* === Layout === */
  --max-width: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01","cv11";
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--color-accent); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: var(--font-body); cursor: pointer; }
input, textarea, select { font-family: var(--font-body); }

/* ===== Layout primitives ===== */
.bi-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

/* ===== Typography ===== */
.bi-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.bi-h1 {
  font-family: var(--font-heading);
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: -.02em;
  font-weight: 600;
  margin: 0;
  color: var(--color-text);
}

.bi-h2 {
  font-family: var(--font-heading);
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: -.015em;
  font-weight: 600;
  margin: 0;
  color: var(--color-text);
}

.bi-h3 {
  font-family: var(--font-heading);
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
  margin: 0;
  color: var(--color-text);
}

.bi-lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--color-text-2);
  margin: 0;
}

.bi-body {
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text-2);
  margin: 0;
}

.bi-meta {
  font-size: 13px;
  color: var(--color-text-3);
  margin: 0;
}

/* ===== Buttons ===== */
.bi-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  line-height: 1;
}

.bi-btn--primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.bi-btn--primary:hover {
  background: var(--color-primary-700);
  border-color: var(--color-primary-700);
  color: #fff;
}

.bi-btn--ghost {
  background: #fff;
  color: var(--color-text);
  border-color: var(--color-line);
}
.bi-btn--ghost:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

.bi-btn--blue {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.bi-btn--blue:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

/* ===== Cards ===== */
.bi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--r-lg);
  transition: box-shadow .2s ease;
}
.bi-card:hover { box-shadow: var(--sh-2); }

/* ===== Tags / pills ===== */
.bi-tag {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-accent-50);
  color: var(--color-accent);
  white-space: nowrap;
}
.bi-tag--gray   { background: #F1F5F9; color: var(--color-text-2); }
.bi-tag--amber  { background: #FEF3C7; color: #92400E; }
.bi-tag--green  { background: #DCFCE7; color: #166534; }

/* ===== Icon wrapper ===== */
.bi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ===== Ad slot — empty state placeholder ===== */
.ad-slot {
  position: relative;
  background: repeating-linear-gradient(135deg, #FAFAFC 0 12px, #F1F2F6 12px 24px);
  border: 1px dashed #CBD2DD;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  min-height: 90px;
  text-align: center;
}
.ad-slot::before {
  content: "ADVERTISEMENT";
  position: absolute;
  top: 6px;
  left: 10px;
  font-size: 10px;
  color: #B7BDC9;
  letter-spacing: .2em;
  background: #fff;
  padding: 1px 6px;
  border-radius: 4px;
}
.ad-slot .ad-meta { font-size: 11px; color: #94A3B8; margin-top: 4px; }
.ad-slot--leaderboard  { min-height: 100px; }
.ad-slot--rectangle    { min-height: 280px; }
.ad-slot--sidebar      { min-height: 600px; }
.ad-slot--in-article   { min-height: 260px; margin: 28px 0; }

/* ===== Navbar ===== */
.bi-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-line);
  position: sticky;
  top: 0;
  z-index: 30;
}

.bi-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 72px;
}

.bi-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--color-primary);
  font-size: 18px;
  letter-spacing: -.01em;
  text-decoration: none;
  flex-shrink: 0;
}
.bi-logo:hover { color: var(--color-primary); }

.bi-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 17px;
  flex-shrink: 0;
}

.bi-nav-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  list-style: none;
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
}

.bi-nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-2);
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.bi-nav-links a.active,
.bi-nav-links a:hover {
  color: var(--color-text);
}
.bi-nav-links a.active {
  border-color: var(--color-accent);
}

.bi-nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

/* Mobile hamburger (hidden by default) */
.bi-nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-line);
  border-radius: var(--r-sm);
  padding: 8px;
  cursor: pointer;
  color: var(--color-text);
}

/* ===== Footer ===== */
.bi-footer {
  background: var(--color-primary);
  color: #CBD5E1;
  padding: 56px 0 24px;
  margin-top: 72px;
}
.bi-footer h4 {
  color: #fff;
  font-size: 14px;
  margin: 0 0 14px;
  font-weight: 600;
}
.bi-footer a {
  font-size: 14px;
  color: #CBD5E1;
  display: block;
  padding: 4px 0;
  transition: color .15s ease;
}
.bi-footer a:hover { color: #fff; }

.bi-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
}

.bi-footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  letter-spacing: -.01em;
  text-decoration: none;
}

.bi-footer-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fff;
  color: var(--color-primary);
  display: grid;
  place-items: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 17px;
  flex-shrink: 0;
}

.bi-footer-social {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.bi-footer-social a {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  display: grid;
  place-items: center;
  padding: 0;
  transition: background .15s ease;
}
.bi-footer-social a:hover { background: rgba(255,255,255,.16); }

.bi-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 40px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #94A3B8;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== Section spacing helpers ===== */
.section-py-sm  { padding-top: 32px; padding-bottom: 32px; }
.section-py-md  { padding-top: 48px; padding-bottom: 48px; }
.section-py-lg  { padding-top: 64px; padding-bottom: 64px; }
.section-py-xl  { padding-top: 72px; padding-bottom: 72px; }

/* ===== Nav list reset ===== */
.bi-nav-links li { display: contents; }   /* make <li> transparent so <a> is the flex item */
.bi-nav-links.is-open li { display: flex; flex-direction: column; }

/* ===== Link cards (a.bi-card) ===== */
a.bi-card { text-decoration: none; color: inherit; display: block; }

/* ===== Utility ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
