/*
Theme Name: Tactia
Theme URI: https://tactia.fr
Author: Tactia
Description: Thème éditorial pour Tactia, le comparateur des outils et services pour entreprendre. Comparatifs, verdicts, liens partenaires gérés via /go/.
Version: 1.1.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: tactia
*/

/* ---------- Fonts (auto-hébergées, licence SIL OFL, voir assets/fonts) ---------- */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(assets/fonts/fraunces-latin-opsz-normal.woff2) format("woff2-variations");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url(assets/fonts/fraunces-latin-opsz-italic.woff2) format("woff2-variations");
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(assets/fonts/manrope-latin-wght-normal.woff2) format("woff2-variations");
}

/* ---------- Tokens ---------- */
:root {
  --ink: #12312f;          /* vert profond, texte et fonds sombres */
  --ink-2: #1f4a47;
  --paper: #f7f3ea;        /* crème */
  --paper-2: #efe8d9;
  --line: #d9d0bd;
  --accent: #e4572e;       /* brique */
  --accent-2: #c8451f;
  --gold: #d9a441;
  --ok: #2f7d5a;
  --ko: #b23a2c;
  --muted: #5d6b69;
  --radius: 14px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 72ch;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  font-variation-settings: "opsz" 144, "SOFT" 30;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-top: 2.2em; }
h3 { font-size: 1.35rem; margin-top: 1.8em; font-variation-settings: "opsz" 48, "SOFT" 30; letter-spacing: 0; }
p { margin: 0 0 1.2em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.4em; }
blockquote { margin: 1.5em 0; padding: 0.5em 1.2em; border-left: 4px solid var(--gold); font-family: var(--font-display); font-size: 1.15rem; }
code { background: var(--paper-2); padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.wrap { width: min(100% - 2rem, 1120px); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2rem, 780px); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--ink);
  display: grid; place-items: center;
  color: var(--paper);
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem;
  position: relative;
}
.brand__mark::after {
  content: ""; position: absolute; right: -4px; bottom: -4px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--paper);
}
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; letter-spacing: -0.02em; }
.brand__tag { display: none; color: var(--muted); font-size: 0.85rem; margin-left: 0.5rem; }
@media (min-width: 900px) { .brand__tag { display: inline; } }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.2rem; flex-wrap: wrap; }
.nav a { text-decoration: none; padding: 0.45rem 0.7rem; border-radius: 8px; font-weight: 600; font-size: 0.95rem; }
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem 0.7rem; font: inherit; cursor: pointer; }
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; width: 100%; }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; padding-bottom: 0.6rem; }
  .site-header__inner { flex-wrap: wrap; }
}

/* ---------- Hero ---------- */
.hero { padding: 4rem 0 3rem; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: auto -10% -60% auto; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(228,87,46,0.18), transparent 70%); pointer-events: none;
}
.hero__kicker { font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; margin-bottom: 1rem; }
.hero h1 { max-width: 16ch; }
.hero h1 em { font-style: italic; color: var(--accent); font-variation-settings: "opsz" 144, "SOFT" 100; }
.hero p { max-width: 58ch; font-size: 1.15rem; color: var(--ink-2); }
.hero__actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.25rem; border-radius: 999px; font-weight: 700; text-decoration: none;
  border: 2px solid var(--ink); color: var(--ink); background: transparent; cursor: pointer; font-size: 0.98rem;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.btn:hover { transform: translateY(-1px); background: var(--ink); color: var(--paper); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn--small { padding: 0.5rem 0.95rem; font-size: 0.9rem; }
.btn--block { width: 100%; }

/* ---------- Category strip ---------- */
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.9rem; margin: 2rem 0 3rem; }
.cat {
  display: block; text-decoration: none; padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; transition: border-color 0.12s ease, transform 0.12s ease;
}
.cat:hover { border-color: var(--ink); transform: translateY(-2px); color: var(--ink); }
.cat__icon { font-size: 1.4rem; margin-bottom: 0.4rem; }
.cat__name { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; display: block; font-variation-settings: "opsz" 36, "SOFT" 30; letter-spacing: 0; }
.cat__count { color: var(--muted); font-size: 0.85rem; }

/* ---------- Post cards ---------- */
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--ink); padding-bottom: 0.5rem; margin: 0 0 1.5rem; }
.section-title h2 { margin: 0; font-size: 1.6rem; }
.section-title a { font-size: 0.9rem; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.4rem; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(18,49,47,0.08); }
.card__media { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--ink), var(--ink-2)); position: relative; overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media--placeholder { display: grid; place-items: center; color: var(--paper); font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; }
.card__media--placeholder span { opacity: 0.85; }
.card__body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.card__cat { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); }
.card__title { font-size: 1.25rem; margin: 0; font-variation-settings: "opsz" 36, "SOFT" 30; letter-spacing: 0; }
.card__title a { text-decoration: none; }
.card__title a:hover { color: var(--accent-2); }
.card__excerpt { color: var(--muted); font-size: 0.95rem; margin: 0; }
.card__meta { margin-top: auto; font-size: 0.8rem; color: var(--muted); padding-top: 0.6rem; }

/* ---------- Article ---------- */
.article-header { padding: 3rem 0 1.5rem; }
.article-header .card__cat { margin-bottom: 0.6rem; display: block; }
.article-header h1 { max-width: 22ch; }
.article-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; color: var(--muted); font-size: 0.9rem; margin-top: 0.8rem; }
.article-meta strong { color: var(--ink); }
.article-hero { margin: 2rem 0 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.article-hero img { display: block; width: 100%; height: auto; }
.article-lede { font-size: 1.2rem; color: var(--ink-2); max-width: 62ch; margin-top: 1rem; }
.article-body { max-width: var(--measure); }
.article-body > p, .article-body > ul, .article-body > ol { max-width: 68ch; }
.article-body p:empty, .product p:empty, .verdict p:empty, .callout p:empty { display: none; }
.article-body h2 { scroll-margin-top: 90px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; padding-bottom: 4rem; }
@media (min-width: 1000px) { .article-layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.sidebar { position: sticky; top: 90px; align-self: start; display: grid; gap: 1.2rem; }
.toc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; font-size: 0.92rem; }
.toc__title { font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: var(--muted); margin-bottom: 0.6rem; }
.toc ol { margin: 0; padding-left: 1.1em; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ---------- Comparison components ---------- */
.disclosure {
  background: var(--paper-2); border-left: 4px solid var(--gold); border-radius: 0 10px 10px 0;
  padding: 0.8rem 1rem; font-size: 0.9rem; color: var(--ink-2); margin: 1.5rem 0;
}
.verdict {
  background: var(--ink); color: var(--paper); border-radius: var(--radius); padding: 1.4rem 1.6rem; margin: 2rem 0;
  position: relative; overflow: hidden;
}
.verdict::before { content: "★"; position: absolute; right: 1rem; top: 0.2rem; font-size: 4rem; color: rgba(217,164,65,0.25); font-family: var(--font-display); }
.verdict__title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; margin: 0 0 0.6rem; color: var(--gold); }
.verdict p:last-child { margin-bottom: 0; }
.verdict a { color: var(--paper); }
.verdict .btn { border-color: var(--paper); color: var(--paper); }
.verdict .btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }

.product {
  display: grid; grid-template-columns: 1fr; gap: 1rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; margin: 1.8rem 0;
}
@media (min-width: 720px) { .product { grid-template-columns: minmax(0,1fr) 220px; } }
.product--best { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(228,87,46,0.08); }
.product__badge { display: inline-block; background: var(--accent); color: #fff; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.25rem 0.6rem; border-radius: 999px; margin-bottom: 0.6rem; }
.product__name { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 0.2rem; }
.product__tagline { color: var(--muted); margin: 0 0 0.8rem; }
.product__price { font-weight: 800; font-size: 1.1rem; margin: 0 0 0.4rem; }
.product__price small { font-weight: 500; color: var(--muted); }
.product__rating { color: var(--gold); letter-spacing: 0.05em; font-size: 1rem; margin-bottom: 0.6rem; }
.product__rating span { color: var(--muted); font-size: 0.85rem; letter-spacing: 0; margin-left: 0.4rem; }
.product__lists { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; font-size: 0.93rem; }
@media (max-width: 520px) { .product__lists { grid-template-columns: 1fr; } }
.product__lists ul { list-style: none; padding: 0; margin: 0; }
.product__lists li { padding-left: 1.4em; position: relative; margin-bottom: 0.3em; }
.product__lists .pros li::before { content: "+"; position: absolute; left: 0; font-weight: 900; color: var(--ok); }
.product__lists .cons li::before { content: "-"; position: absolute; left: 0; font-weight: 900; color: var(--ko); }
.product__side { display: flex; flex-direction: column; gap: 0.6rem; justify-content: center; }
.product__side small { text-align: center; color: var(--muted); font-size: 0.78rem; }

.table-wrap { overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.compare { border-collapse: collapse; width: 100%; font-size: 0.93rem; min-width: 640px; }
table.compare th, table.compare td { padding: 0.75rem 0.9rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.compare thead th { background: var(--ink); color: var(--paper); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.03em; }
table.compare tbody tr:nth-child(even) { background: #fbf9f4; }
table.compare tbody th { font-weight: 700; white-space: nowrap; }
table.compare td.ok { color: var(--ok); font-weight: 700; }
table.compare td.ko { color: var(--ko); font-weight: 700; }
table.compare .btn { white-space: nowrap; }

.faq { margin: 2rem 0; }
.faq details { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0.8rem 1.1rem; margin-bottom: 0.6rem; }
.faq summary { font-weight: 700; cursor: pointer; font-family: var(--font-display); font-size: 1.05rem; }
.faq details[open] summary { margin-bottom: 0.5rem; }
.faq p:last-child { margin: 0; }

.callout { background: #fff; border: 1px dashed var(--line); border-radius: 10px; padding: 1rem 1.2rem; margin: 1.5rem 0; }
.callout--key { border: 2px solid var(--ink); border-style: solid; }
.callout__title { font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: var(--accent); margin-bottom: 0.4rem; }
.updated { display: inline-block; font-size: 0.8rem; color: var(--muted); background: var(--paper-2); padding: 0.2rem 0.6rem; border-radius: 999px; }

/* ---------- Method block ---------- */
.method { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; margin: 3rem 0; display: grid; gap: 1.5rem; }
@media (min-width: 800px) { .method { grid-template-columns: 1.2fr 1fr; align-items: center; } }
.method h2 { margin-top: 0; }
.method ol { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.method li { counter-increment: step; position: relative; padding-left: 2.6rem; margin-bottom: 0.9rem; }
.method li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 0.05em; font-family: var(--font-display); font-weight: 700; color: var(--accent); font-size: 1.3rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--paper); margin-top: 4rem; padding: 3rem 0 2rem; }
.site-footer a { color: var(--paper); }
.site-footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.site-footer h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); margin-top: 0; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.4rem; font-size: 0.95rem; }
.site-footer__brand .brand__name { color: var(--paper); }
.site-footer__brand .brand__mark { background: var(--paper); color: var(--ink); }
.site-footer__brand .brand__mark::after { border-color: var(--ink); }
.site-footer__bottom { border-top: 1px solid rgba(247,243,234,0.18); margin-top: 2rem; padding-top: 1.2rem; font-size: 0.82rem; color: rgba(247,243,234,0.7); display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }

/* ---------- Archive ---------- */
.archive-header { padding: 3rem 0 1.5rem; }
.archive-header p { color: var(--muted); max-width: 60ch; }
.pagination { display: flex; gap: 0.4rem; justify-content: center; margin: 2.5rem 0; }
.pagination .page-numbers { padding: 0.5rem 0.9rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; background: #fff; }
.pagination .current { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Page ---------- */
.page-content { padding: 3rem 0 4rem; }
.page-content h1 { margin-bottom: 1.5rem; }

/* WordPress core alignment helpers */
.alignwide { width: min(100% - 2rem, 1120px); margin-inline: auto; }
.wp-block-table table { width: 100%; }
