/*
Theme Name:   Car Insurance Decoded
Theme URI:    https://carinsurancedecoded.com
Description:  Lightweight, SEO-first child theme of GeneratePress for CarInsuranceDecoded.com. Adds trust elements (disclaimer, affiliate notice, last-updated date, author box), editorial blocks (Key takeaways, Insider tip, FAQ, state minimums) and CLS-safe ad slots.
Author:       Car Insurance Decoded
Template:     generatepress
Version:      1.0.1
Requires at least: 6.4
Requires PHP: 7.4
License:      GPL-2.0-or-later
Text Domain:  cid
*/

/* ---------- Design tokens ---------- */
:root {
	--cid-ink: #14213d;          /* titres, texte fort */
	--cid-text: #2b3445;         /* texte courant */
	--cid-muted: #5b6577;        /* méta, légendes */
	--cid-line: #e3e7ee;         /* bordures */
	--cid-bg: #ffffff;
	--cid-soft: #f5f7fa;         /* fonds d'encadrés */
	--cid-brand: #1d4ed8;        /* liens, accents */
	--cid-brand-dark: #1e3a8a;
	--cid-tip: #b45309;          /* encadré Insider tip */
	--cid-tip-bg: #fff8eb;
	--cid-ok: #047857;
	--cid-ok-bg: #ecfdf5;
	--cid-radius: 10px;
	--cid-measure: 720px;        /* largeur de lecture */
	--cid-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base typography (police système = 0 requête) ---------- */
body {
	font-family: var(--cid-font);
	font-size: 18px;
	line-height: 1.65;
	color: var(--cid-text);
	background: var(--cid-bg);
	-webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
	color: var(--cid-ink);
	font-family: var(--cid-font);
	line-height: 1.25;
	font-weight: 700;
	letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: .5em; }
.entry-content h2 { font-size: clamp(1.45rem, 3vw, 1.8rem); margin: 2em 0 .6em; }
.entry-content h3 { font-size: 1.25rem; margin: 1.6em 0 .5em; }
.entry-content p, .entry-content li { font-size: 1.05rem; }
a { color: var(--cid-brand); text-underline-offset: 3px; }
a:hover, a:focus { color: var(--cid-brand-dark); }
:focus-visible { outline: 3px solid var(--cid-brand); outline-offset: 2px; }

/* ---------- Reading width ---------- */
.single .inside-article,
.page .inside-article { max-width: calc(var(--cid-measure) + 80px); margin-left: auto; margin-right: auto; }
.single .entry-content > *,
.page .entry-content > * { max-width: var(--cid-measure); margin-left: auto; margin-right: auto; }
.single .entry-content > .alignwide { max-width: 1000px; }

/* ---------- Header / navigation ---------- */
.site-header { border-bottom: 1px solid var(--cid-line); }
.main-title a { color: var(--cid-ink); font-weight: 800; letter-spacing: -0.02em; }
.main-navigation .main-nav ul li a { font-weight: 600; min-height: 48px; display: flex; align-items: center; }

/* ---------- Breadcrumb ---------- */
.cid-breadcrumb { font-size: .875rem; color: var(--cid-muted); margin-bottom: 1rem; }
.cid-breadcrumb a { color: var(--cid-muted); }

/* ---------- Trust bar (date, auteur, relecteur) ---------- */
.cid-trustbar {
	display: flex; flex-wrap: wrap; gap: .4rem 1.2rem;
	font-size: .9rem; color: var(--cid-muted);
	padding: .75rem 0; margin-bottom: 1.25rem;
	border-top: 1px solid var(--cid-line); border-bottom: 1px solid var(--cid-line);
}
.cid-trustbar strong { color: var(--cid-ink); font-weight: 600; }
.cid-trustbar .cid-reviewed::before { content: "✓ "; color: var(--cid-ok); font-weight: 700; }

/* ---------- Notices (disclaimer, affiliation) ---------- */
.cid-notice {
	font-size: .875rem; line-height: 1.5; color: var(--cid-muted);
	background: var(--cid-soft); border-radius: var(--cid-radius);
	padding: .8rem 1rem; margin: 0 auto 1.5rem;
}
.cid-notice strong { color: var(--cid-ink); }

/* ---------- Editorial boxes ---------- */
.cid-box {
	border-radius: var(--cid-radius);
	padding: 1.25rem 1.4rem;
	margin: 1.75rem auto;
	border: 1px solid var(--cid-line);
	background: var(--cid-soft);
}
.cid-box > :first-child { margin-top: 0; }
.cid-box > :last-child { margin-bottom: 0; }
.cid-box .cid-box__title {
	font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
	margin: 0 0 .6rem; color: var(--cid-ink);
}
.cid-takeaways { background: var(--cid-ok-bg); border-color: #a7f3d0; }
.cid-takeaways .cid-box__title { color: var(--cid-ok); }
.cid-takeaways ul { margin: 0 0 0 1.1rem; }
.cid-takeaways li { margin-bottom: .35rem; }
.cid-insider { background: var(--cid-tip-bg); border-color: #fcd34d; border-left: 5px solid var(--cid-tip); }
.cid-insider .cid-box__title { color: var(--cid-tip); }
.cid-insider .cid-box__title::before { content: "🔍 "; }

/* ---------- FAQ (details/summary, sans JavaScript) ---------- */
.cid-faq details {
	border: 1px solid var(--cid-line); border-radius: var(--cid-radius);
	padding: 0 1rem; margin-bottom: .6rem; background: var(--cid-bg);
}
.cid-faq summary {
	cursor: pointer; font-weight: 600; color: var(--cid-ink);
	padding: .9rem 0; min-height: 48px; list-style-position: outside;
}
.cid-faq details[open] summary { border-bottom: 1px solid var(--cid-line); margin-bottom: .6rem; }
.cid-faq details > :last-child { padding-bottom: .9rem; margin-bottom: 0; }

/* ---------- Tables (comparatifs, minimums par État) ---------- */
.entry-content .wp-block-table,
.entry-content .cid-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.entry-content th, .entry-content td { padding: .65rem .75rem; border-bottom: 1px solid var(--cid-line); text-align: left; vertical-align: top; }
.entry-content thead th { background: var(--cid-ink); color: #fff; font-weight: 600; border-bottom: 0; }
.entry-content tbody tr:nth-child(even) { background: var(--cid-soft); }
.cid-state-table caption { caption-side: bottom; font-size: .8rem; color: var(--cid-muted); padding-top: .5rem; text-align: left; }

/* ---------- Table of contents (Easy TOC / Rank Math TOC) ---------- */
#ez-toc-container, .wp-block-rank-math-toc-block {
	background: var(--cid-soft) !important; border: 1px solid var(--cid-line) !important;
	border-radius: var(--cid-radius) !important; padding: 1rem 1.25rem !important;
	width: 100% !important; box-shadow: none !important;
}

/* ---------- Ad slots: hauteur réservée = pas de CLS ---------- */
.cid-ad { margin: 2rem auto; text-align: center; contain: layout; }
.cid-ad::before { content: "Advertisement"; display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #9aa3b2; margin-bottom: .3rem; }
.cid-ad--top { min-height: 280px; }
.cid-ad--mid { min-height: 280px; }
.cid-ad--bottom { min-height: 250px; }
@media (min-width: 769px) {
	.cid-ad--top { min-height: 100px; }
}
.cid-ad:empty::before { display: none; }

/* ---------- Author box ---------- */
.cid-author {
	display: grid; grid-template-columns: 72px 1fr; gap: 1rem; align-items: start;
	border: 1px solid var(--cid-line); border-radius: var(--cid-radius);
	padding: 1.25rem; margin: 2.5rem auto 1.5rem; max-width: var(--cid-measure);
}
.cid-author img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.cid-author__name { font-weight: 700; color: var(--cid-ink); margin: 0 0 .25rem; }
.cid-author__bio { font-size: .95rem; color: var(--cid-muted); margin: 0; }

/* ---------- Related (même silo) ---------- */
.cid-related { max-width: var(--cid-measure); margin: 2rem auto; }
.cid-related h2 { font-size: 1.3rem; margin-bottom: .8rem; }
.cid-related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.cid-related li a {
	display: block; padding: .85rem 1rem; border: 1px solid var(--cid-line);
	border-radius: var(--cid-radius); text-decoration: none; font-weight: 600; color: var(--cid-ink);
}
.cid-related li a:hover { border-color: var(--cid-brand); color: var(--cid-brand); }
.cid-pillar-link { font-weight: 600; }

/* ---------- Blog archive cards ---------- */
.blog .inside-article, .archive .inside-article {
	border: 1px solid var(--cid-line); border-radius: var(--cid-radius); padding: 1.5rem;
}
.blog .entry-title, .archive .entry-title { font-size: 1.35rem; }

/* ---------- Footer ---------- */
.site-info { font-size: .85rem; color: var(--cid-muted); }
.cid-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.2rem; margin-bottom: .5rem; }
.cid-footer-links a { color: var(--cid-muted); min-height: 48px; display: inline-flex; align-items: center; }

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
	body { font-size: 17px; }
	.single .inside-article, .page .inside-article { padding-left: 16px; padding-right: 16px; }
	.cid-author { grid-template-columns: 56px 1fr; }
	.cid-author img { width: 56px; height: 56px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
