/* Emergency Energy - Home Energy Resilience for Ontario Homeowners */
/* Color Palette: Dark Green #1b4332, White #ffffff, Amber #f59e0b */

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

:root {
  --green-dark: #1b4332;
  --green-mid: #2d6a4f;
  --green-light: #d8f3dc;
  --green-border: #52b788;
  --amber: #f59e0b;
  --amber-light: #fef3c7;
  --text: #1a1a1a;
  --text-muted: #555;
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --border: #e0e0e0;
  --max-w: 900px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

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

/* ── Header ── */
header {
  background: var(--green-dark);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
header .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-logo { color: #fff; text-decoration: none; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.5px; }
.site-logo span { color: var(--amber); }
nav a { color: rgba(255,255,255,0.88); text-decoration: none; font-size: 0.9rem; margin-left: 20px; transition: color 0.2s; }
nav a:hover { color: var(--amber); }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  color: #fff;
  padding: 72px 0 60px;
  text-align: center;
}
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 800; line-height: 1.25; margin-bottom: 18px; }
.hero p { font-size: 1.1rem; opacity: 0.9; max-width: 640px; margin: 0 auto 32px; }
.btn {
  display: inline-block;
  background: var(--amber);
  color: #1a1a1a;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.2s, transform 0.1s;
}
.btn:hover { background: #e08e0a; transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 2px solid var(--amber);
  color: var(--amber);
  margin-left: 12px;
}
.btn-outline:hover { background: var(--amber); color: #1a1a1a; }

/* ── Quick Answer Box ── */
.quick-answer {
  background: var(--green-light);
  border-left: 5px solid var(--green-border);
  border-radius: 0 8px 8px 0;
  padding: 20px 24px;
  margin: 32px 0;
}
.quick-answer strong { display: block; color: var(--green-dark); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.quick-answer p { margin: 0; color: var(--text); }

/* ── Warning Box ── */
.warning-box {
  background: #fff3cd;
  border-left: 5px solid #f59e0b;
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 24px 0;
}

/* ── Tip Box ── */
.tip-box {
  background: #e8f4fd;
  border-left: 5px solid #3b82f6;
  border-radius: 0 8px 8px 0;
  padding: 16px 20px;
  margin: 24px 0;
}

/* ── Sections ── */
section { padding: 56px 0; }
section:nth-child(even):not(.hero) { background: var(--bg-alt); }
section h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); color: var(--green-dark); margin-bottom: 20px; }
section h3 { font-size: 1.15rem; color: var(--green-dark); margin: 28px 0 10px; }

/* ── Article Layout ── */
.article-header {
  background: var(--green-dark);
  color: #fff;
  padding: 56px 0 48px;
}
.article-header h1 { font-size: clamp(1.5rem, 3.5vw, 2.3rem); font-weight: 800; line-height: 1.25; margin-bottom: 12px; }
.article-header .meta { opacity: 0.75; font-size: 0.9rem; }
.article-body { padding: 48px 0; }
.article-body p { margin-bottom: 18px; }
.article-body ul, .article-body ol { padding-left: 24px; margin-bottom: 18px; }
.article-body li { margin-bottom: 8px; }
.article-body h2 { font-size: 1.55rem; color: var(--green-dark); margin: 40px 0 16px; border-bottom: 2px solid var(--green-light); padding-bottom: 8px; }
.article-body h3 { font-size: 1.2rem; color: var(--green-mid); margin: 28px 0 10px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; margin: 24px 0; border-radius: 8px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th { background: var(--green-dark); color: #fff; text-align: left; padding: 12px 16px; font-weight: 600; }
td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: var(--bg-alt); }
.check { color: #16a34a; font-weight: 700; }
.cross { color: #dc2626; font-weight: 700; }
.partial { color: #d97706; font-weight: 700; }

/* ── Cards Grid ── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin-top: 32px; }
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  transition: box-shadow 0.2s, transform 0.15s;
}
.card:hover { box-shadow: 0 6px 24px rgba(27,67,50,0.12); transform: translateY(-2px); }
.card-icon { font-size: 2rem; margin-bottom: 12px; }
.card h3 { color: var(--green-dark); font-size: 1.05rem; margin: 0 0 8px; }
.card p { color: var(--text-muted); font-size: 0.93rem; margin: 0 0 16px; }
.card a { color: var(--green-mid); font-weight: 600; text-decoration: none; font-size: 0.93rem; }
.card a:hover { color: var(--green-dark); text-decoration: underline; }

/* ── Affiliate Product Box ── */
.product-box {
  display: flex;
  gap: 16px;
  background: var(--amber-light);
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 18px 20px;
  margin: 20px 0;
  align-items: flex-start;
}
.product-box .product-info { flex: 1; }
.product-box h4 { color: var(--green-dark); margin-bottom: 4px; font-size: 1rem; }
.product-box p { font-size: 0.9rem; color: var(--text-muted); margin: 0 0 10px; }
.product-box .btn { padding: 8px 16px; font-size: 0.9rem; }

/* ── FAQ ── */
.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { color: var(--green-dark); font-size: 1.05rem; margin: 0 0 10px; }
.faq-item p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

/* ── Breadcrumbs ── */
.breadcrumb { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-bottom: 16px; }
.breadcrumb a { color: rgba(255,255,255,0.8); text-decoration: none; }
.breadcrumb a:hover { color: var(--amber); }
.breadcrumb span { margin: 0 6px; }

/* ── Footer ── */
footer {
  background: var(--green-dark);
  color: rgba(255,255,255,0.75);
  padding: 48px 0 32px;
  font-size: 0.9rem;
}
footer .footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
footer h4 { color: #fff; font-size: 0.95rem; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
footer a { color: rgba(255,255,255,0.7); text-decoration: none; display: block; margin-bottom: 6px; }
footer a:hover { color: var(--amber); }
footer .footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 24px; text-align: center; font-size: 0.82rem; }
footer .disclaimer { font-size: 0.8rem; color: rgba(255,255,255,0.5); margin-top: 8px; }

/* ── Stat Badges ── */
.stat-bar { display: flex; flex-wrap: wrap; gap: 16px; margin: 32px 0; }
.stat { background: var(--green-light); border-radius: 8px; padding: 16px 20px; text-align: center; flex: 1; min-width: 140px; }
.stat strong { display: block; font-size: 1.8rem; color: var(--green-dark); line-height: 1.1; }
.stat span { font-size: 0.82rem; color: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 640px) {
  nav { display: none; }
  .hero { padding: 48px 0 40px; }
  .btn-outline { margin-left: 0; margin-top: 10px; }
  .product-box { flex-direction: column; }

  /* FIXED: Affiliate CTA buttons were ~33px tall (padding: 8px) — below 36px minimum tap target.
     product-recommendation is already column on mobile; bump btn padding to meet threshold. */
  .product-recommendation .btn,
  .product-box .btn {
    padding: 12px 20px;
    font-size: 1rem;
    display: block;
    text-align: center;
  }

  /* FIXED: Footer fine-print text below 14px */
  footer .footer-bottom { font-size: 0.875rem; }  /* was 0.82rem = 13.1px */
  footer .disclaimer    { font-size: 0.875rem; }  /* was 0.80rem = 12.8px */
}


/* ── Product Recommendation Cards ── */
.product-recommendation {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin: 20px 0;
}

.product-recommendation h4 {
  color: var(--green-dark);
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.product-recommendation p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.product-recommendation .btn {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.9rem;
}

/* ── FAQ Items ── */
.faq h3 {
  color: var(--green-dark);
  font-size: 1.05rem;
  margin: 0 0 8px;
}

.faq p {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── Comparison Table ── */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.9rem;
}

.comparison-table th {
  background: var(--green-dark);
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 600;
}

.comparison-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.comparison-table tr:nth-child(even) {
  background: var(--bg-alt);
}

/* ── Article container overrides for article pages ── */
.article-header {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  color: white;
  padding: 48px 0 36px;
}

.article-header h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.3rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
}

.article-header .meta {
  opacity: 0.75;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .product-recommendation {
    flex-direction: column;
  }
}

/* ===== UX READABILITY POLISH (2026-04-18) ===== */

/* 1. Base readability — bump from 17px to 18px */
body {
  font-size: 18px;
  line-height: 1.75;
}

p {
  margin-bottom: 1.25em;
}

h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

/* 2. Link styling — light theme, match dark green accent */
a {
  color: #2d6a4f;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
a:hover {
  border-bottom-color: currentColor;
  text-decoration: none;
}

/* 3. FAQ section styling — light theme */
.faq-item, .faq-section > div {
  border-bottom: 1px solid #e5e7eb;
  padding: 1.25rem 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-question, .faq-item h3, .faq-item strong {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.faq-answer, .faq-item p {
  line-height: 1.7;
  margin-top: 0.5rem;
}

/* 4. Mobile improvements */
@media (max-width: 768px) {
  body { font-size: 17px; line-height: 1.7; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
  .btn, button, a.btn, .cta-btn, [class*="btn"] {
    min-height: 48px;
    padding: 12px 24px;
  }
  section, .section {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* 5. Quick answer box refinement */
.quick-answer {
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  font-size: 1.05rem;
  line-height: 1.7;
}

.article-hero { width: 100%; height: 420px; overflow: hidden; background: var(--bg-alt, #f1f5f9); }
.article-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }

/* ── Nav Search ── */
.nav-search { position: relative; display: flex; align-items: center; }
.nav-search-toggle {
  background: none; border: none; cursor: pointer; padding: 4px 8px;
  color: var(--muted, #888); font-size: 1.1rem; line-height: 1;
  transition: color 0.2s; display: flex; align-items: center;
}
.nav-search-toggle:hover { color: var(--white, #fff); }
.nav-search-box {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 0;
  background: var(--mid, #1a2a2a); border: 1px solid var(--accent, #4caf50);
  border-radius: 6px; overflow: hidden;
  width: 0; opacity: 0; pointer-events: none;
  transition: width 0.25s ease, opacity 0.2s ease;
  white-space: nowrap;
}
.nav-search-box.open { width: 260px; opacity: 1; pointer-events: all; }
.nav-search-box input {
  flex: 1; border: none; outline: none; padding: 7px 12px;
  background: transparent; color: var(--text, #e2e8f0);
  font-size: 0.9rem; min-width: 0;
}
.nav-search-box input::placeholder { color: var(--muted, #888); }
.nav-search-box button {
  background: none; border: none; padding: 7px 10px;
  color: var(--muted, #888); cursor: pointer; font-size: 0.85rem;
}
.nav-search-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 200;
  background: var(--deep, #0f1a1a); border: 1px solid var(--accent, #4caf50);
  border-radius: 8px; width: 320px; max-height: 360px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); display: none;
}
.nav-search-dropdown a {
  display: block; padding: 0.6rem 1rem; text-decoration: none;
  color: var(--text, #e2e8f0); font-size: 0.88rem; border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.1s;
}
.nav-search-dropdown a:last-child { border-bottom: none; }
.nav-search-dropdown a:hover, .nav-search-dropdown a.nav-search-active { background: var(--mid, #1a2a2a); color: var(--accent, #4caf50); }
.nav-search-dropdown .ns-empty { padding: 0.75rem 1rem; opacity: 0.5; font-size: 0.85rem; }
mark.ns-hl { background: var(--accent, #4caf50); color: #fff; border-radius: 2px; padding: 0 2px; }
