/* Petipedia - feuille de style commune. Palette institutionnelle WCAG AA. */
:root {
  --primary: #134e4a;
  --primary-deep: #0c3a37;
  --link: #0f6b66;
  --accent: #b45309;
  --accent-text: #92400e;
  --accent-bg: #fff8ed;
  --ink: #1f2937;
  --muted: #4b5563;
  --bg: #f7f6f2;
  --surface: #ffffff;
  --border: #d9d6cd;
  --border-soft: #e7e4dc;
  --max: 760px;
  --max-wide: 1080px;
  --radius: 8px;
  --space: 1rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--primary-deep); }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--primary);
  color: #fff; padding: .6rem 1rem; z-index: 100; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .75rem 1.25rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: .55rem; text-decoration: none; }
.brand strong { color: var(--primary); font-size: 1.3rem; letter-spacing: -.01em; }
.brand span { color: var(--muted); font-size: .82rem; }
.main-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1rem; margin: 0; padding: 0; }
.main-nav a { color: var(--ink); text-decoration: none; font-size: .95rem; font-weight: 500; padding: .25rem 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--accent); }
.lang-switch { display: flex; gap: .35rem; align-items: center; font-size: .85rem; }
.lang-switch a { text-decoration: none; padding: .2rem .5rem; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); }
.lang-switch a[aria-current="true"] { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Layout */
main { display: block; }
.container { max-width: var(--max); margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.container-wide { max-width: var(--max-wide); margin: 0 auto; padding: 2rem 1.25rem 3rem; }

.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 1.25rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: .4rem; color: var(--border); }
.breadcrumb a { color: var(--link); text-decoration: none; }

h1 { font-size: 2rem; line-height: 1.2; color: var(--primary); letter-spacing: -.015em; margin: .2rem 0 .9rem; }
h2 { font-size: 1.4rem; line-height: 1.25; color: var(--primary-deep); margin: 2.2rem 0 .7rem; }
h3 { font-size: 1.12rem; color: var(--primary-deep); margin: 1.6rem 0 .5rem; }
p { margin: 0 0 1rem; }

.updated { display: inline-block; font-size: .82rem; color: var(--muted); margin-bottom: 1.4rem; }
.updated time { font-weight: 600; color: var(--accent-text); }
.byline { font-size: .9rem; color: var(--muted); margin-bottom: 1.4rem; }

/* Lead / answer capsule */
.lead, .quick-answer {
  font-size: 1.12rem;
  background: var(--surface);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.2rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 0 0 1.6rem;
}
.quick-answer p:last-child, .lead p:last-child { margin-bottom: 0; }

/* Blocks */
.block { margin: 1.4rem 0; }
.block-label {
  display: inline-block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent-text); font-weight: 700; margin-bottom: .5rem;
}

/* Tables */
.table-wrap { overflow-x: auto; margin: 1.2rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; background: var(--surface); }
caption { text-align: left; font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }
th, td { text-align: left; padding: .6rem .75rem; border: 1px solid var(--border-soft); vertical-align: top; }
thead th { background: var(--primary); color: #fff; font-weight: 600; border-color: var(--primary); }
tbody tr:nth-child(even) { background: #faf9f5; }

/* Note / aside */
.note {
  background: var(--accent-bg); border: 1px solid #f3ddb8; border-radius: var(--radius);
  padding: 1rem 1.2rem; margin: 1.4rem 0; font-size: .97rem;
}
.note strong { color: var(--accent-text); }
.ymyl-disclaimer { font-size: .85rem; color: var(--muted); font-style: italic; margin: 1rem 0; }

/* TOC */
.toc { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 0 0 1.8rem; }
.toc p { font-weight: 600; color: var(--primary-deep); margin: 0 0 .5rem; }
.toc ul { margin: 0; padding-left: 1.1rem; }
.toc li { margin: .25rem 0; }

/* Related / links */
.related { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin: 1.8rem 0; }
.related h2 { margin-top: 0; font-size: 1.15rem; }
.related ul { margin: 0; padding-left: 1.1rem; }
.related li { margin: .35rem 0; }

/* Card grids (hubs, home) */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin: 1.4rem 0; }
@media (min-width: 620px) { .card-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 920px) { .card-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; text-decoration: none; color: var(--ink); display: block;
  transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin: 0 0 .4rem; color: var(--primary); }
.card p { margin: 0; font-size: .92rem; color: var(--muted); }
.card .count { font-size: .78rem; color: var(--accent-text); font-weight: 600; }

/* Hero */
.hero { background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%); border-bottom: 1px solid var(--border); }
.hero-inner { max-width: var(--max-wide); margin: 0 auto; padding: 3rem 1.25rem 2.4rem; }
.hero h1 { font-size: 2.4rem; max-width: 18ch; }
.hero .tagline { font-size: 1.2rem; color: var(--muted); max-width: 60ch; }
.hero .definition { font-size: 1.1rem; background: var(--surface); border-left: 4px solid var(--accent); padding: 1rem 1.2rem; border-radius: 0 var(--radius) var(--radius) 0; max-width: 70ch; margin-top: 1.6rem; }

/* Sources */
.sources { font-size: .85rem; color: var(--muted); border-top: 1px solid var(--border); margin-top: 2.4rem; padding-top: 1rem; }
.sources h2 { font-size: 1rem; margin-top: 0; }

/* Footer */
.site-footer { background: var(--primary-deep); color: #d6e4e2; margin-top: 3rem; }
.footer-inner { max-width: var(--max-wide); margin: 0 auto; padding: 2.4rem 1.25rem; display: grid; grid-template-columns: 1fr; gap: 1.6rem; }
@media (min-width: 720px) { .footer-inner { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h2 { color: #fff; font-size: 1rem; margin: 0 0 .6rem; }
.site-footer a { color: #bfe0dc; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: .3rem 0; font-size: .9rem; }
.footer-legal { border-top: 1px solid #1d5b57; font-size: .82rem; color: #9cc4c0; }
.footer-legal div { max-width: var(--max-wide); margin: 0 auto; padding: 1rem 1.25rem; }

/* 404 */
.error-page { text-align: center; padding: 4rem 1.25rem; max-width: 640px; margin: 0 auto; }
.error-page .code { font-size: 4rem; color: var(--primary); font-weight: 700; }

/* Glossary entry */
.term-meta { font-size: .85rem; color: var(--muted); margin-bottom: 1.2rem; }
.alt-names { font-size: .9rem; color: var(--muted); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

@media (max-width: 560px) {
  h1 { font-size: 1.7rem; }
  .hero h1 { font-size: 2rem; }
  .header-inner { padding: .6rem 1rem; }
}


/* generator additions */
.link-list { list-style: none; padding: 0; margin: 1rem 0; }
.link-list li { margin: .4rem 0; border-bottom: 1px solid var(--border-soft); padding-bottom: .35rem; }
.link-list a { text-decoration: none; }
.link-list.cols { columns: 1; }
@media (min-width: 720px){ .link-list.cols { columns: 2; column-gap: 2rem; } }
.capsule { background: var(--surface); border-left: 3px solid var(--link); padding: .8rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; }
section#faq, section#guides { margin-top: 2rem; }
.card-grid.cols-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 720px){ .card-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.tool { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin: 1.4rem 0; }
.tool form { display: grid; gap: .9rem; }
.tool .field { display: grid; gap: .3rem; }
.tool .field label { font-weight: 600; }
.tool .field .unit { font-weight: 400; color: var(--muted, #5a6b69); }
.tool input, .tool select { padding: .5rem .6rem; border: 1px solid var(--border-soft); border-radius: 6px; font: inherit; width: 100%; max-width: 22rem; }
.tool .hint { font-size: .85rem; color: var(--muted, #5a6b69); margin: .1rem 0 0; }
.tool-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .3rem; }
.btn { background: var(--link, #134e4a); color: #fff; border: 0; border-radius: 6px; padding: .55rem 1.1rem; font: inherit; cursor: pointer; }
.btn.secondary { background: transparent; color: var(--link, #134e4a); border: 1px solid var(--link, #134e4a); }
.tool .result { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border-soft); }
.tool .result dl { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; }
.tool .result dt { color: var(--muted, #5a6b69); }
.tool .result dd { margin: 0; font-weight: 600; text-align: right; }
.formula { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface); padding: .7rem .9rem; border-radius: 6px; font-size: .92rem; }
.data-link { font-size: .9rem; }
