/* TariffWise — global stylesheet */
:root {
  --bg: #FFFFFF; --bg-elev: #F7F8FA; --text: #0B0F14; --text-muted: #5B6573;
  --border: #E5E8EC; --brand: #0F4C81; --brand-2: #0A8A6E; --warn: #B8851E;
  --danger: #B23A2F; --accent: #6841C7; --ad-bg: #FAFBFC;
  --radius: 12px; --radius-sm: 8px; --container: 1200px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04); --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Source Serif Pro', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}
[data-theme="dark"] {
  --bg: #0B0F14; --bg-elev: #131822; --text: #E8EAED; --text-muted: #9AA3AD;
  --border: #1F2630; --brand: #4D8FCB; --brand-2: #2BB996; --warn: #E0B547;
  --danger: #E66457; --accent: #9277E0; --ad-bg: #0F151E;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-sans); font-size: 17px; line-height: 1.65; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: 820px; margin: 0 auto; padding: 0 20px; }
.skip-link { position: absolute; top: -40px; left: 0; background: var(--brand); color: #fff; padding: 8px 16px; z-index: 100; transition: top .2s; }
.skip-link:focus { top: 0; }

/* Header */
.site-header { position: sticky; top: 0; background: var(--bg); z-index: 50; border-bottom: 1px solid var(--border); backdrop-filter: blur(8px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--text); }
.brand-mark { color: var(--brand); font-size: 1.3rem; }
.brand-name { font-size: 1.1rem; letter-spacing: -0.01em; }
.primary-nav ul { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.primary-nav a { color: var(--text-muted); font-weight: 500; font-size: .95rem; }
.primary-nav a:hover { color: var(--text); text-decoration: none; }
.header-actions { display: flex; gap: 8px; }
.icon-btn { background: none; border: 1px solid transparent; cursor: pointer; width: 40px; height: 40px; border-radius: var(--radius-sm); font-size: 1.1rem; color: var(--text); }
.icon-btn:hover { background: var(--bg-elev); }
.mobile-only { display: none; }
.mobile-nav { position: fixed; top: 64px; left: 0; right: 0; bottom: 0; background: var(--bg); padding: 24px; overflow-y: auto; z-index: 49; }
.mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.mobile-nav li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.mobile-nav a { font-size: 1.1rem; font-weight: 500; color: var(--text); }
.mobile-nav .divider { border-bottom: none; height: 12px; }
.search-bar { border-top: 1px solid var(--border); padding: 12px 20px; }
.search-bar form { display: flex; gap: 8px; max-width: var(--container); margin: 0 auto; }
.search-bar input { flex: 1; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev); color: var(--text); font-size: 1rem; }
.search-bar button { padding: 12px 20px; background: var(--brand); color: #fff; border: 0; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; }

/* Hero */
.hero { padding: 64px 0 48px; text-align: center; }
.hero--narrow { padding: 48px 0 24px; text-align: left; }
.hero--narrow h1 { max-width: 760px; }
.hero--narrow .lede { max-width: 720px; margin: 0 0 16px; }
.lede { font-size: 1.2rem; color: var(--text-muted); max-width: 680px; margin: 0 auto 32px; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 32px; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 14px 24px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: all .15s; font-size: 1rem; font-family: inherit; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #0a3f6e; text-decoration: none; }
.btn-secondary { background: var(--bg-elev); color: var(--text); border-color: var(--border); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }
.hero-search { display: flex; max-width: 560px; margin: 0 auto; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.hero-search input { flex: 1; padding: 14px 18px; background: transparent; border: 0; color: var(--text); font-size: 1rem; }
.hero-search input:focus { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: var(--radius); }
.hero-search button { background: transparent; border: 0; padding: 0 18px; font-size: 1.1rem; cursor: pointer; color: var(--text); }
.trust-bar { margin-top: 24px; font-size: .9rem; color: var(--text-muted); }

/* Live strip */
.live-strip { background: rgba(184,133,30,0.08); border-top: 1px solid rgba(184,133,30,0.2); border-bottom: 1px solid rgba(184,133,30,0.2); padding: 10px 0; font-size: .92rem; }
.live-strip .dot { display: inline-block; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; margin-right: 8px; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

section { padding: 56px 0; }
section h2 { margin-bottom: 32px; }

/* Grids */
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-card { display: block; padding: 24px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); transition: all .15s; }
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.cat-card span { font-size: 1.6rem; display: block; margin-bottom: 8px; }
.cat-card h3 { margin-bottom: 4px; font-size: 1.05rem; }
.cat-card p { color: var(--text-muted); font-size: .9rem; margin: 0; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform .15s; }
.post-card:hover { transform: translateY(-2px); }
.post-card a { display: block; color: var(--text); }
.post-card a:hover { text-decoration: none; }
.post-thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--brand), var(--accent)); }
.post-card h3 { padding: 16px 16px 4px; font-size: 1.1rem; }
.post-meta { padding: 0 16px 16px; color: var(--text-muted); font-size: .85rem; margin: 0; }

/* Calculator preview */
.calc-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.calc-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.calc-row label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--text-muted); font-weight: 500; }
.calc-row select, .calc-row input { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-size: 1rem; font-family: inherit; }
.calc-result { margin-top: 16px; padding: 16px; background: var(--bg); border-radius: var(--radius-sm); font-size: 1.1rem; font-weight: 700; min-height: 32px; }
.calc-result.success { color: var(--brand-2); }
.calc-note { margin-top: 12px; font-size: .85rem; color: var(--text-muted); }

/* Newsletter */
.newsletter { background: var(--bg-elev); text-align: center; }
.newsletter-form { display: flex; max-width: 480px; margin: 24px auto 0; gap: 8px; }
.newsletter-form input { flex: 1; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-size: 1rem; }
.micro { font-size: .8rem; color: var(--text-muted); margin-top: 12px; }

/* Ad slots */
.ad-slot { background: var(--ad-bg); border: 1px dashed var(--border); border-radius: var(--radius-sm); margin: 32px auto; max-width: var(--container); display: flex; align-items: center; justify-content: center; }
.ad-slot--leaderboard { min-height: 90px; }
.ad-slot--in-feed { min-height: 260px; }
.ad-slot--multiplex { min-height: 360px; }
.ad-placeholder { color: var(--text-muted); font-size: .8rem; }

/* Article */
.article { max-width: 760px; margin: 0 auto; padding: 48px 20px; }
.article .breadcrumb { font-size: .85rem; color: var(--text-muted); margin-bottom: 16px; }
.article .byline { color: var(--text-muted); font-size: .9rem; margin-bottom: 32px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.article h2 { margin-top: 48px; padding-top: 16px; }
.article h3 { margin-top: 32px; font-size: 1.15rem; }
.article table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: .95rem; }
.article th, .article td { padding: 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.article th { background: var(--bg-elev); font-weight: 600; }
.article blockquote { border-left: 4px solid var(--brand); padding: 8px 20px; background: var(--bg-elev); margin: 24px 0; font-family: var(--font-serif); }
.article ul, .article ol { padding-left: 24px; }
.article li { margin-bottom: 8px; }
.article code { background: var(--bg-elev); padding: 2px 6px; border-radius: 4px; font-family: var(--font-mono); font-size: .9em; }
.article pre { background: var(--bg-elev); padding: 16px; border-radius: var(--radius-sm); overflow-x: auto; }
.article pre code { background: transparent; padding: 0; }
.toc { background: var(--bg-elev); padding: 20px 24px; border-radius: var(--radius); margin: 24px 0; }
.toc h4 { margin: 0 0 12px; font-size: 1rem; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 4px; }
.toc a { color: var(--text); }
.callout { background: rgba(184,133,30,0.08); border-left: 4px solid var(--warn); padding: 14px 18px; margin: 24px 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .95rem; }
.affiliate-box { background: rgba(184,133,30,0.08); border-left: 4px solid var(--warn); padding: 12px 16px; margin: 24px 0; font-size: .92rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Team grid (about) */
.team-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin: 32px 0; }
.team-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.team-card img { border-radius: 50%; margin-bottom: 12px; width: 120px; height: 120px; object-fit: cover; }
.team-card .role { color: var(--brand); font-weight: 600; font-size: .9rem; margin: 4px 0 12px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; margin: 32px 0; }
.contact-form { display: grid; gap: 16px; max-width: 600px; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: .9rem; }
.contact-form input, .contact-form select, .contact-form textarea { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font: inherit; }
.contact-form .consent { flex-direction: row; align-items: flex-start; gap: 12px; font-size: .9rem; font-weight: 400; }

/* FAQ details */
details { padding: 20px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; }
details summary { font-weight: 600; font-size: 1.05rem; cursor: pointer; }
details[open] summary { margin-bottom: 12px; }

/* Footer */
.site-footer { background: var(--bg-elev); border-top: 1px solid var(--border); padding: 48px 0 24px; margin-top: 64px; }
.footer-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 32px; }
.footer-grid h4 { font-size: .95rem; margin-bottom: 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { padding: 4px 0; }
.footer-grid a { color: var(--text-muted); font-size: .9rem; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { padding-top: 32px; margin-top: 32px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--text-muted); text-align: center; }
.footer-legal { margin-top: 12px; font-size: .85rem; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.footer-legal a, .footer-legal button { color: var(--text-muted); text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }

/* Cookie banner */
.cookie-banner { position: fixed; bottom: 16px; left: 16px; right: 16px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; box-shadow: var(--shadow-md); z-index: 60; flex-wrap: wrap; }
.cookie-banner p { margin: 0; font-size: .9rem; }
.cookie-banner div { display: flex; gap: 8px; }

.mono { font-family: var(--font-mono); }

/* Related list */
.related-list { list-style: none; padding: 0; margin: 16px 0 0; }
.related-list li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.related-list a { color: var(--text); font-weight: 500; }

/* Responsive */
@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .primary-nav { display: none; }
  .mobile-only { display: inline-flex; }
  .card-grid, .post-grid { grid-template-columns: 1fr; }
  .calc-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 40px 0 32px; }
  .newsletter-form { flex-direction: column; }
  body { font-size: 16px; }
  .team-grid, .contact-grid { grid-template-columns: 1fr; }
  .article { padding: 32px 16px; }
  .article table { font-size: .85rem; }
}
@media print {
  .site-header, .site-footer, .ad-slot, .cookie-banner, .newsletter { display: none; }
  body { font-size: 12pt; color: #000; background: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
