/* style.css — PetitBob
   v1.1 — 2026-04-21
   Design : typographie sérieuse, style dictionnaire académique
   Palette minimaliste, liens rouge brique, switch jour/nuit
*/

/* ── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,600;1,400&family=JetBrains+Mono:wght@400&display=swap');

/* ── Variables ────────────────────────────────────────────────────────────── */
:root {
  --bg:        #ffffff;
  --bg-alt:    #f7f6f3;
  --bg-rule:   #ece9e2;
  --fg:        #111111;
  --fg-2:      #444444;
  --fg-3:      #888888;
  --red:       #9b1c1c;      /* liens, accents */
  --red-soft:  #fdf2f2;
  --border:    #d4d0c8;
  --border-2:  #e8e5de;
  --mono:      'JetBrains Mono', monospace;
  --serif:     'EB Garamond', Georgia, serif;
  --sz:        19px;
  --lh:        1.72;
  --w:         720px;
}

[data-theme="dark"] {
  --bg:        #141414;
  --bg-alt:    #1c1c1c;
  --bg-rule:   #252525;
  --fg:        #e8e6e0;
  --fg-2:      #aaa8a0;
  --fg-3:      #666460;
  --red:       #e07070;
  --red-soft:  #1f1212;
  --border:    #333330;
  --border-2:  #282826;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: var(--sz); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--serif);
  line-height: var(--lh);
  color: var(--fg);
  background: var(--bg);
  min-height: 100vh;
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
[x-cloak] { display: none !important; }

/* ── En-tête ──────────────────────────────────────────────────────────────── */
header {
  border-bottom: 2px solid var(--fg);
  background: var(--bg);
  padding: 1rem 0 0;
}

.site-header {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 1.25rem .75rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.site-name {
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -.01em;
}
.site-name:hover { text-decoration: none; color: var(--red); }

.site-tagline {
  font-size: .78rem;
  color: var(--fg-3);
  font-style: italic;
  flex: 1;
}

.btn-theme {
  background: none; border: 1px solid var(--border);
  color: var(--fg-3); cursor: pointer; padding: .15rem .45rem;
  font-size: .8rem; border-radius: 2px; transition: color .15s;
}
.btn-theme:hover { color: var(--fg); border-color: var(--fg); }

/* Recherche */
.search-wrap {
  max-width: var(--w);
  margin: 0 auto;
  padding: .5rem 1.25rem .6rem;
  border-top: 1px solid var(--border-2);
}

.search-box {
  position: relative;
  display: flex;
  gap: .4rem;
}

.search-box input[type=search] {
  flex: 1;
  padding: .4rem .7rem;
  font-family: var(--serif);
  font-size: .95rem;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  border-radius: 2px;
  outline: none;
  appearance: none;
}
.search-box input:focus { border-color: var(--red); }

.search-box button {
  padding: .4rem 1rem;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--serif);
  font-size: .9rem;
  border: none; border-radius: 2px; cursor: pointer;
}
.search-box button:hover { background: var(--red); }

/* Suggestions */
.suggestions {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-top: none; list-style: none; z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.suggestions li {
  padding: .35rem .7rem; cursor: pointer; font-size: .92rem;
}
.suggestions li:hover { background: var(--red-soft); color: var(--red); }

.search-filtres {
  display: flex; gap: 1.5rem;
  margin-top: .35rem;
  font-size: .75rem; color: var(--fg-3);
}
.search-filtres label { display: flex; align-items: center; gap: .3rem; }
.search-filtres select {
  font-family: var(--mono); font-size: .72rem;
  border: 1px solid var(--border); background: var(--bg); color: var(--fg);
  padding: .1rem .3rem; border-radius: 2px;
}

/* ── Barre stats ──────────────────────────────────────────────────────────── */
.stats-bar {
  border-bottom: 1px solid var(--border-2);
  background: var(--bg-alt);
  font-size: .72rem; font-family: var(--mono);
  color: var(--fg-3);
  padding: .3rem 0;
  overflow-x: auto; white-space: nowrap;
}
.stats-bar > span {
  display: inline-block;
  padding: 0 .9rem;
  border-right: 1px solid var(--border-2);
}
.stats-bar > span:last-child { border-right: none; }

/* ── Fil d'ariane ─────────────────────────────────────────────────────────── */
.breadcrumb {
  max-width: var(--w); margin: .6rem auto;
  padding: 0 1.25rem;
  font-size: .78rem; color: var(--fg-3);
}
.breadcrumb a { color: var(--fg-3); }
.breadcrumb a:hover { color: var(--red); text-decoration: none; }
.breadcrumb .sep { margin: 0 .3rem; }

/* ── Contenu principal ────────────────────────────────────────────────────── */
main {
  max-width: var(--w);
  margin: 1.2rem auto 4rem;
  padding: 0 1.25rem;
}

.loading { color: var(--fg-3); font-style: italic; padding: 1rem 0; }
.no-result { color: var(--fg-3); font-style: italic; padding: 1rem 0; }
.error { color: var(--red); padding: 1rem 0; }

.results-info {
  font-size: .78rem; color: var(--fg-3); font-family: var(--mono);
  margin-bottom: .8rem;
}

/* ── Liste de notices ────────────────────────────────────────────────────── */
.notice-list { }

.notice-row {
  padding: .8rem 0;
  border-bottom: 1px solid var(--border-2);
  cursor: pointer;
}
.notice-row:hover { background: var(--red-soft);
  margin: 0 -1.25rem; padding-left: 1.25rem; padding-right: 1.25rem; }

.notice-row-header {
  display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap;
}
.vedette { font-size: 1.05rem; font-weight: 600; color: var(--red); }
.gram    { font-size: .72rem; font-family: var(--mono); color: var(--fg-3); }
.annee   { font-size: .78rem; color: var(--fg-3); font-style: italic; }
.ns      { font-size: .68rem; font-family: var(--mono);
           background: var(--fg); color: var(--bg);
           padding: .05rem .3rem; border-radius: 2px; }
.variantes { font-style: italic; color: var(--fg-2); font-size: .88rem; margin-top: .1rem; }
.sens      { color: var(--fg); font-size: .95rem; margin-top: .1rem; line-height: 1.5; }

/* ── Notice complète ─────────────────────────────────────────────────────── */
.notice-article { padding: .3rem 0; }

.notice-vedette {
  font-size: 1.9rem; font-weight: 600; color: var(--fg);
  line-height: 1.15; margin-bottom: .3rem;
  letter-spacing: -.02em;
}

.notice-meta {
  font-size: .8rem; font-family: var(--mono); color: var(--fg-3);
  margin-bottom: .6rem;
}
.meta-gram { font-variant: small-caps; font-family: var(--serif); font-style: italic; }
.meta-reg  { }
.meta-att  { }
.meta-ns   { background: var(--fg); color: var(--bg); padding: .05rem .3rem; border-radius: 2px; }

.notice-variantes { font-style: italic; color: var(--fg-2); margin-bottom: .4rem; }
.notice-sens      { font-size: 1.05rem; margin-bottom: .8rem; }

/* Sections encyclopédiques */
.notice-section {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-2);
}

.notice-section h2 {
  font-size: .68rem; font-family: var(--mono); font-weight: normal;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--fg-3); margin-bottom: .5rem;
}

/* Blockquotes (attestations, citations) */
blockquote.quote-att, .citation blockquote {
  border-left: 2px solid var(--red);
  padding: .45rem .85rem;
  background: var(--bg-alt);
  font-size: .9rem; line-height: 1.65;
  color: var(--fg);
}
.citation { margin-bottom: .7rem; }
.citation cite {
  display: block; font-style: italic;
  font-size: .75rem; color: var(--fg-3);
  padding-left: .85rem; margin-top: .1rem;
}
.lien-ext { font-style: normal; }

/* Tags */
.tag-list { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .3rem; }
.tag {
  font-family: var(--mono); font-size: .7rem;
  padding: .18rem .5rem; border-radius: 2px;
  background: var(--bg-alt); border: 1px solid var(--border);
  color: var(--fg-2); transition: all .1s;
}
a.tag:hover {
  background: var(--red-soft); border-color: var(--red);
  color: var(--red); text-decoration: none;
}

/* Notices similaires */
.notice-similaires { opacity: .5; }
.similaires-ph { font-style: italic; color: var(--fg-3); font-size: .85rem; }

/* ── Accueil — grille connexions ─────────────────────────────────────────── */
.cx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .6rem;
  margin-top: 1.2rem;
}
.cx-card {
  display: block;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  text-decoration: none;
  background: var(--bg-alt);
  transition: border-color .12s, background .12s;
}
.cx-card:hover {
  border-color: var(--red); background: var(--red-soft);
  text-decoration: none;
}
.cx-card-label { font-weight: 600; color: var(--fg); font-size: .95rem; }
.cx-card-desc  { font-size: .75rem; color: var(--fg-3); margin-top: .2rem; }

/* ── Pages connexion ─────────────────────────────────────────────────────── */
.page-title {
  font-size: 1.5rem; font-weight: 600; color: var(--fg);
  margin-bottom: .3rem; letter-spacing: -.01em;
}
.page-desc { font-style: italic; color: var(--fg-2); margin-bottom: .6rem; }

.cx-list { margin-top: .4rem; }
.cx-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: .55rem 0; border-bottom: 1px solid var(--border-2);
  cursor: pointer;
}
.cx-row:hover {
  background: var(--red-soft);
  margin: 0 -1.25rem; padding-left: 1.25rem; padding-right: 1.25rem;
}
.cx-row-titre { color: var(--red); font-size: .95rem; }
.cx-row-count { font-family: var(--mono); font-size: .7rem; color: var(--fg-3); }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination {
  display: flex; gap: .6rem;
  margin-top: 1.5rem; padding-top: 1rem;
  border-top: 1px solid var(--border-2);
}
.pagination button {
  padding: .4rem .9rem;
  background: var(--bg-alt); border: 1px solid var(--border);
  color: var(--fg); font-family: var(--serif); font-size: .9rem;
  cursor: pointer; border-radius: 2px; transition: all .12s;
}
.pagination button:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }

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

/* ── Pied de page ────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem; padding: .8rem 0;
  font-size: .75rem; color: var(--fg-3);
}
.footer-inner { max-width: var(--w); margin: 0 auto; padding: 0 1.25rem; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  :root { --sz: 17px; --w: 100%; }
  .site-tagline { display: none; }
  .cx-grid { grid-template-columns: 1fr 1fr; }
}
