/* GotIt — feuille de style principale
   Palette chaude et claire, typographie système, aucune dépendance externe. */

:root {
  color-scheme: light;

  /* Fonds : ivoire chaud plutôt que blanc pur */
  --bg: #F4F1EA;
  --bg-warm: #EDE8DD;
  --surface: #FBF9F5;
  --surface-2: #F2EDE3;
  --line: #E2DBCC;
  --line-strong: #D3C9B5;

  /* Textes : brun très sombre, jamais de noir pur */
  --text: #23221F;
  --text-dim: #5F5B52;
  --text-faint: #8C877B;

  /* Accents : terre cuite en principal, sauge et ardoise en secondaires */
  --accent: #C3623F;
  --accent-soft: #F0DDD3;
  --sage: #6C8168;
  --sage-soft: #E6EDE2;
  --slate: #6B7486;
  --slate-soft: #E8EAEF;
  --warn: #A8792F;
  --danger: #A8483A;

  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1060px;
  --shadow: 0 10px 30px -18px rgba(60, 48, 32, .45);
  --ease: cubic-bezier(.22, .61, .36, 1);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }

h1, h2, h3, .card-title, .brand { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }

/* ---------- En-tête ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(244, 241, 234, .86);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.14rem;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 30px; height: 30px;
  display: block;
  color: var(--accent); /* la bulle reprend la couleur d'accent */
  flex: none;
}
.brand-mark svg { width: 100%; height: 100%; display: block; }

/* Le nom d'un bloc, pour que le « ! » reste collé malgré le gap du flex */
.brand-word { white-space: nowrap; }
.brand .bang { color: var(--accent); }

.site-nav { margin-left: auto; display: flex; gap: 18px; align-items: center; }
.site-nav a { color: var(--text-dim); font-size: .94rem; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }

/* ---------- Hero ---------- */

.hero { padding: 66px 0 30px; }

.hero h1 {
  font-size: clamp(2.1rem, 5.6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  margin: 0 0 16px;
  font-weight: 500;
}
.hero h1 em { font-style: italic; color: var(--accent); }

.hero p.lead {
  font-size: clamp(1rem, 2.1vw, 1.14rem);
  color: var(--text-dim);
  max-width: 60ch;
  margin: 0;
}

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit; font-size: .94rem; font-weight: 500;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s;
}
.btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #FBF9F5;
}
.btn-primary:hover { background: #AE5637; border-color: #AE5637; color: #FBF9F5; }

/* ---------- Recherche ---------- */

.search-bar { margin: 6px 0 4px; position: relative; }
.search-bar input {
  width: 100%;
  padding: 14px 18px 14px 46px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.search-bar input::placeholder { color: var(--text-faint); }
.search-bar input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-bar .icon {
  position: absolute; left: 17px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); pointer-events: none;
}
.search-hint { color: var(--text-faint); font-size: .86rem; margin: 10px 2px 0; }

/* ---------- Navigation du catalogue ---------- */

.section { padding: 16px 0 60px; }

.crumbs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 26px 0 18px; font-size: .9rem; color: var(--text-faint);
}
.crumbs button {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; color: var(--text-dim); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: var(--line-strong);
}
.crumbs button:hover { color: var(--accent); }
.crumbs .sep { opacity: .6; }
.crumbs .here { color: var(--text); }

.view-head { margin: 30px 0 20px; }
.view-head h2 { font-size: 1.7rem; margin: 0 0 6px; font-weight: 500; }
.view-head p { color: var(--text-dim); margin: 0; max-width: 66ch; }

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }
.cards-wide { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  display: flex; flex-direction: column; gap: 7px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.card:hover {
  text-decoration: none;
  border-color: var(--line-strong);
  background: #FFFDF8;
  box-shadow: var(--shadow);
}
.card .card-title { font-size: 1.14rem; }
.card .card-sum { color: var(--text-dim); font-size: .92rem; line-height: 1.5; }
.card .card-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; align-items: center; }
.card .card-path { font-size: .78rem; color: var(--text-faint); letter-spacing: .01em; }

.card-family { padding: 24px; }
.card-family .card-title { font-size: 1.42rem; }
.card-family .card-count { color: var(--accent); font-size: .84rem; font-weight: 600; }

.card-topics { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.card-topics li {
  font-size: .78rem; color: var(--text-dim);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 2px 9px; border-radius: 999px;
}

.tag {
  font-size: .74rem; letter-spacing: .02em;
  padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-dim);
}
.tag-level-1 { color: var(--sage); border-color: #C7D6C2; background: var(--sage-soft); }
.tag-level-2 { color: var(--accent); border-color: #E6C4B4; background: var(--accent-soft); }
.tag-level-3 { color: var(--slate); border-color: #C9CEDA; background: var(--slate-soft); }

.card.card-soon { opacity: .62; pointer-events: none; }

.empty-state { color: var(--text-dim); padding: 26px 0; }

.results-count { color: var(--text-faint); font-size: .88rem; margin: 0 0 14px; }

/* ---------- Pied de page ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 48px;
  color: var(--text-faint);
  font-size: .88rem;
}
.site-footer .wrap { display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }

/* ---------- Accessibilité ---------- */

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #FBF9F5; padding: 10px 16px; border-radius: 0 0 10px 0; z-index: 99;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

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

@media (max-width: 620px) {
  body { font-size: 16px; }
  .hero { padding: 40px 0 22px; }
  .cards { grid-template-columns: 1fr; }
}
