/* ============================================================
   SHARED BASE STYLESHEET — All 8 Affiliate Sites
   Each site overrides CSS custom properties for unique branding.
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
  color: var(--clr-text, #1a1a2e);
  background: var(--clr-bg, #ffffff);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--clr-accent, #2563eb); text-decoration: none; transition: color .2s; }
a:hover { color: var(--clr-accent-hover, #1d4ed8); }

/* --- Typography --- */
h1, h2, h3, h4 { font-family: var(--font-heading, 'Inter', system-ui, sans-serif); color: var(--clr-heading, #0f172a); line-height: 1.25; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: .6em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin: 1.6em 0 .5em; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); margin: 1.2em 0 .4em; }
p { margin-bottom: 1em; }

/* --- Layout --- */
.container { width: 92%; max-width: 1140px; margin: 0 auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* --- Header / Nav --- */
.site-header {
  background: var(--clr-header-bg, #ffffff);
  border-bottom: 1px solid var(--clr-border, #e2e8f0);
  position: sticky; top: 0; z-index: 100;
  padding: .8rem 0;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.site-logo { font-size: 1.35rem; font-weight: 800; color: var(--clr-accent); letter-spacing: -.02em; }
.site-logo span { color: var(--clr-heading); }
.nav-links { display: flex; gap: 1.6rem; list-style: none; }
.nav-links a { font-size: .92rem; font-weight: 500; color: var(--clr-text); }
.nav-links a:hover { color: var(--clr-accent); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; }
.nav-toggle svg { width: 26px; height: 26px; stroke: var(--clr-heading); }
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; flex-direction: column; position: absolute;
    top: 100%; left: 0; right: 0; background: var(--clr-header-bg, #fff);
    padding: 1rem 4%; border-bottom: 1px solid var(--clr-border);
  }
  .nav-links.open { display: flex; }
}

/* --- Hero --- */
.hero {
  background: var(--clr-hero-bg, linear-gradient(135deg, #0f172a 0%, #1e293b 100%));
  color: var(--clr-hero-text, #f8fafc);
  padding: 4rem 0 3.5rem;
  text-align: center;
}
.hero h1 { color: var(--clr-hero-text, #f8fafc); font-size: clamp(2rem, 5vw, 3rem); }
.hero p { font-size: 1.1rem; max-width: 640px; margin: 0 auto 1.5em; opacity: .9; }
.btn {
  display: inline-block; padding: .75rem 1.8rem; border-radius: 6px;
  font-weight: 600; font-size: .95rem; transition: all .2s;
  background: var(--clr-accent); color: #fff; border: none; cursor: pointer;
}
.btn:hover { background: var(--clr-accent-hover); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 2px solid var(--clr-accent); color: var(--clr-accent); }
.btn-outline:hover { background: var(--clr-accent); color: #fff; }

/* --- Section --- */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--clr-section-alt, #f8fafc); }
.section-title { text-align: center; margin-bottom: 2rem; }

/* --- Card --- */
.card {
  background: #fff; border: 1px solid var(--clr-border, #e2e8f0);
  border-radius: 10px; padding: 1.5rem; transition: box-shadow .25s;
}
.card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.card h3 { margin-top: 0; }
.card .tag {
  display: inline-block; font-size: .75rem; font-weight: 600;
  background: var(--clr-tag-bg, #eff6ff); color: var(--clr-accent);
  padding: .2rem .6rem; border-radius: 4px; margin-bottom: .6rem;
}

/* --- Sponsored Block --- */
.sponsored-section { border: 2px solid var(--clr-accent); border-radius: 10px; padding: 1.5rem; margin: 2rem 0; position: relative; }
.sponsored-label {
  position: absolute; top: -12px; left: 16px;
  background: var(--clr-accent); color: #fff;
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  padding: .2rem .7rem; border-radius: 4px; letter-spacing: .05em;
}

/* --- Comparison Table --- */
.comparison-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .92rem; }
.comparison-table th {
  background: var(--clr-accent); color: #fff;
  padding: .75rem 1rem; text-align: left; font-weight: 600;
}
.comparison-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--clr-border); }
.comparison-table tr:hover td { background: var(--clr-section-alt, #f8fafc); }
.comparison-table .cta-cell a { font-weight: 600; color: var(--clr-accent); }

/* --- Author Box --- */
.author-box {
  display: flex; gap: 1rem; align-items: center;
  background: var(--clr-section-alt, #f8fafc);
  border-radius: 10px; padding: 1.2rem; margin: 2rem 0;
}
.author-box .avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--clr-accent); display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 1.3rem; flex-shrink: 0;
}
.author-box .author-name { font-weight: 700; }
.author-box .author-role { font-size: .85rem; color: #64748b; }

/* --- Key Takeaways --- */
.key-takeaways {
  background: var(--clr-takeaway-bg, #fffbeb); border-left: 4px solid var(--clr-takeaway-border, #f59e0b);
  border-radius: 0 8px 8px 0; padding: 1.2rem 1.5rem; margin: 1.5rem 0;
}
.key-takeaways h4 { margin-bottom: .5rem; color: var(--clr-takeaway-border, #f59e0b); }
.key-takeaways ul { padding-left: 1.2rem; }
.key-takeaways li { margin-bottom: .3rem; }

/* --- TOC --- */
.toc {
  background: var(--clr-section-alt, #f8fafc); border: 1px solid var(--clr-border);
  border-radius: 8px; padding: 1.2rem 1.5rem; margin: 1.5rem 0;
}
.toc h4 { margin-bottom: .5rem; font-size: .95rem; }
.toc ol { padding-left: 1.2rem; }
.toc li { margin-bottom: .25rem; }
.toc a { font-size: .9rem; }

/* --- Newsletter --- */
.newsletter {
  background: var(--clr-hero-bg, linear-gradient(135deg, #0f172a 0%, #1e293b 100%));
  color: #f8fafc; padding: 3rem 0; text-align: center;
}
.newsletter h2 { color: #f8fafc; }
.newsletter p { opacity: .85; max-width: 500px; margin: 0 auto 1.2em; }
.newsletter-form { display: flex; gap: .5rem; max-width: 420px; margin: 0 auto; }
.newsletter-form input {
  flex: 1; padding: .7rem 1rem; border: none; border-radius: 6px;
  font-size: .95rem;
}
.newsletter-form .btn { flex-shrink: 0; }
@media (max-width: 480px) { .newsletter-form { flex-direction: column; } }

/* --- Footer --- */
.site-footer {
  background: var(--clr-footer-bg, #0f172a); color: #94a3b8;
  padding: 2.5rem 0 1.5rem; font-size: .88rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #e2e8f0; margin-bottom: .8rem; font-size: .95rem; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: .4rem; }
.site-footer a { color: #94a3b8; }
.site-footer a:hover { color: #e2e8f0; }
.footer-bottom { border-top: 1px solid #1e293b; padding-top: 1rem; text-align: center; font-size: .82rem; }
.footer-bottom a { color: #94a3b8; margin: 0 .5rem; }

/* --- Article Layout --- */
.article-content { max-width: 760px; margin: 0 auto; padding: 2rem 0; }
.article-content h1 { margin-bottom: .3em; }
.article-meta { color: #64748b; font-size: .88rem; margin-bottom: 1.5rem; }

/* --- Inline Recommended Callout --- */
.callout-recommended {
  background: var(--clr-section-alt, #f0fdf4); border: 1px solid var(--clr-accent);
  border-radius: 8px; padding: 1rem 1.2rem; margin: 1.5rem 0;
  display: flex; gap: 1rem; align-items: center;
}
.callout-recommended .callout-badge {
  background: var(--clr-accent); color: #fff; font-size: .7rem; font-weight: 700;
  padding: .2rem .6rem; border-radius: 4px; white-space: nowrap; text-transform: uppercase;
}

/* --- Breadcrumb --- */
.breadcrumb { font-size: .85rem; color: #64748b; padding: .8rem 0; }
.breadcrumb a { color: var(--clr-accent); }
.breadcrumb span { margin: 0 .4rem; }

/* --- Affiliate Disclosure Banner --- */
.affiliate-banner {
  background: #fef3c7; border: 1px solid #fbbf24; border-radius: 6px;
  padding: .6rem 1rem; font-size: .82rem; color: #92400e; margin-bottom: 1.5rem;
}

/* --- Utility --- */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; } .mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; } .mb-2 { margin-bottom: 2rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
