/* ==========================================================================
   Médiathèque Numérique de Paris — paris-mediatheque.com
   Design : moderne & chaleureux. Police système (aucune dépendance externe).
   Palette dérivée du logo (bleu marine profond) + tons crème / ambre.
   ========================================================================== */

:root {
  /* Couleurs de marque */
  --navy-900: #081e33;
  --navy-800: #0b2c4a;
  --navy-700: #0d3a63;   /* teinte principale du logo */
  --navy-600: #14507f;
  --navy-100: #e3edf5;

  --ink: #23262b;
  --ink-soft: #49525c;
  --muted: #77808b;

  /* « Cosy » : papier chaud & ambre */
  --paper: #faf6ee;
  --paper-2: #f3ecdd;
  --card: #ffffff;
  --line: #e5dcc9;
  --amber: #c98a2d;
  --amber-soft: #f4e3c2;

  /* Accent IA (violet discret) */
  --ai: #6a4f9e;
  --ai-soft: #ece6f6;

  /* Sémantique */
  --danger: #a33b2e;
  --danger-soft: #f7e3e0;
  --ok: #2e7d4f;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(11, 44, 74, .06), 0 2px 6px rgba(11, 44, 74, .05);
  --shadow-md: 0 6px 18px rgba(11, 44, 74, .10);
  --shadow-lg: 0 18px 44px rgba(11, 44, 74, .16);

  --container: 1140px;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-600); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--navy-800); }
h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--navy-800); line-height: 1.22; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }
small { font-size: .86rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 22px; }
.section { padding: clamp(2.6rem, 6vw, 4.6rem) 0; }
.section.tight { padding: clamp(1.6rem, 3vw, 2.6rem) 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--amber); border-radius: 2px; }
.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 60ch; }

.text-center { text-align: center; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-weight: 600; font-size: .98rem;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: background .15s, transform .1s, box-shadow .15s;
  line-height: 1.2; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy-700); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--navy-800); color: #fff; box-shadow: var(--shadow-md); }
.btn-amber { background: var(--amber); color: #fff; box-shadow: var(--shadow-sm); }
.btn-amber:hover { background: #b67820; color: #fff; box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; color: var(--navy-700); border-color: rgba(13, 58, 99, .35); }
.btn-ghost:hover { background: var(--navy-100); color: var(--navy-800); }
.btn-light { background: rgba(255,255,255,.94); color: var(--navy-800); }
.btn-light:hover { background: #fff; color: var(--navy-900); }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn .btn-sm { padding: 7px 14px; font-size: .9rem; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.navbar { display: flex; align-items: center; gap: 18px; height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand-logo { width: 46px; height: 46px; border-radius: 12px; object-fit: contain; }
.brand-name { font-family: var(--font-serif); font-size: 1.16rem; font-weight: 700; color: var(--navy-800); line-height: 1.05; }
.brand-name small { display: block; font-family: var(--font-sans); font-size: .62rem; font-weight: 600; letter-spacing: .12em; color: var(--amber); text-transform: uppercase; margin-top: 2px; }

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 9px 13px; border-radius: 999px; text-decoration: none;
  color: var(--ink-soft); font-weight: 600; font-size: .96rem; transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--navy-100); color: var(--navy-800); }
.nav-links a[aria-current="page"] { background: var(--navy-700); color: #fff; }
.nav-cta { display: flex; align-items: center; gap: 8px; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; border-radius: 8px; color: var(--navy-800); }
.nav-toggle svg { display: block; }

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .nav-links, .nav-cta {
    display: none; position: absolute; top: 74px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: #fff; border-bottom: 1px solid var(--line); padding: 12px 16px 18px; box-shadow: var(--shadow-md);
  }
  .nav-links.open, .nav-cta.open { display: flex; }
  .nav-links a { border-radius: 10px; padding: 12px 14px; }
  .nav-cta .btn { justify-content: center; }
}
@media (min-width: 961px) { .nav-links, .nav-cta { display: flex !important; } }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--navy-900); color: #c9d6e2; margin-top: 0; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 34px;
  padding: clamp(2.4rem, 5vw, 3.6rem) 0 2rem;
}
.footer-grid h4 { color: #fff; font-size: 1.02rem; margin-bottom: 14px; }
.footer-brand .brand-name { color: #fff; }
.footer-brand .brand-name small { color: var(--amber); }
.footer-brand p { font-size: .95rem; color: #aab9c9; margin-top: 12px; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 9px; }
.footer-links a { color: #c9d6e2; text-decoration: none; font-size: .96rem; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-contact p { font-size: .95rem; margin-bottom: 8px; color: #aab9c9; }
.footer-contact a { color: #fff; }
.footer-motto { font-family: var(--font-serif); font-style: italic; font-size: 1.02rem; color: #e8d9b8; margin: 0 0 10px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0 26px;
  display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: space-between;
  font-size: .84rem; color: #8fa3b5;
}
.footer-bottom a { color: #c9d6e2; }
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Héro ---------- */
.hero { position: relative; background: linear-gradient(180deg, var(--navy-800), var(--navy-900)); color: #fff; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(560px 340px at 88% -10%, rgba(201,138,45,.28), transparent 60%),
    radial-gradient(480px 320px at 6% 110%, rgba(106,79,158,.35), transparent 60%);
}
.hero .container { position: relative; z-index: 1; padding-top: clamp(3rem, 7vw, 5.5rem); padding-bottom: clamp(3rem, 7vw, 5.5rem); }
.hero h1 { color: #fff; max-width: 20ch; }
.hero .lead { color: #dbe7f1; max-width: 58ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.hero .chip { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.22); color: #fff; }
.hero .chip strong { color: var(--amber); }

.hero-search { margin-top: 34px; max-width: 640px; }
.searchbar {
  display: flex; align-items: center; gap: 6px; background: #fff; border-radius: 999px;
  padding: 6px 6px 6px 20px; box-shadow: var(--shadow-lg);
}
.searchbar input {
  flex: 1; border: 0; outline: 0; font-size: 1rem; font-family: var(--font-sans); color: var(--ink);
  background: transparent; padding: 8px 0; min-width: 0;
}
.searchbar .btn { flex-shrink: 0; }
.search-hint { margin-top: 12px; font-size: .86rem; color: #bcd0e0; }
.search-hint button {
  background: none; border: 0; color: var(--amber); cursor: pointer; text-decoration: underline;
  font-size: inherit; padding: 0; margin-left: 4px; font-family: inherit;
}

/* ---------- Bandeaux & cartes génériques ---------- */
.band {
  border-radius: var(--radius); padding: 26px; margin: 18px 0;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.band-navy { background: var(--navy-800); color: #fff; border-color: transparent; }
.band-navy h2, .band-navy h3 { color: #fff; }
.band-amber { background: var(--amber-soft); border-color: #e8cf9f; }
.band-ai { background: var(--ai-soft); border-color: #d5c9ea; }
.band-soft { background: var(--paper-2); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 22px; height: 100%;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .12s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card .card-tag { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--amber); }
.card h3 { margin-bottom: 4px; }
.card p { color: var(--ink-soft); font-size: .97rem; margin-bottom: 6px; flex: 1; }
.card .card-meta { font-size: .84rem; color: var(--muted); }

/* Grilles */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* Cartes ressources (catalogue) */
.res-card { flex-direction: row; gap: 16px; align-items: flex-start; }
.res-cover {
  width: 58px; height: 80px; border-radius: 6px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); color: #fff; font-weight: 700; font-size: .68rem; text-align: center; line-height: 1.3; padding: 6px;
  background: linear-gradient(160deg, var(--navy-600), var(--navy-800));
}
.res-cover.audio, .res-cover.video, .res-cover.media { background: linear-gradient(160deg, #8a5a2a, var(--amber)); }
.res-cover.text { background: linear-gradient(160deg, var(--ai), #4b3a78); }
.res-cover.press { background: linear-gradient(160deg, #5b7a54, #38603a); }
.res-card .res-body { flex: 1; min-width: 0; }
.res-card h3 { margin: 0 0 3px; font-size: 1.05rem; }
.res-card .res-type { font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.res-card .res-meta { font-size: .86rem; color: var(--muted); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600;
  padding: 5px 12px; border-radius: 999px; background: var(--navy-100); color: var(--navy-700);
  border: 1px solid transparent; text-decoration: none;
}
.chip.violet { background: var(--ai-soft); color: var(--ai); }
.chip.amber { background: var(--amber-soft); color: #8a5a1e; }
.chip a { color: inherit; text-decoration: none; }
.tag { font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--paper-2); color: var(--ink-soft); }

/* Illustration / figures */
.illus { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat { text-align: center; padding: 20px 12px; }
.stat b { display: block; font-family: var(--font-serif); font-size: clamp(1.7rem, 3.4vw, 2.4rem); color: var(--navy-700); }
.stat span { font-size: .9rem; color: var(--muted); }
@media (max-width: 760px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Page interne : entête de page ---------- */
.page-head { background: linear-gradient(180deg, var(--navy-800), var(--navy-900)); color: #fff; padding: clamp(2.4rem,5vw,3.6rem) 0; }
.page-head h1 { color: #fff; margin-bottom: 6px; }
.page-head .lead { color: #d6e2ee; margin-bottom: 0; }
.page-head .crumb { font-size: .84rem; color: #9fb6cc; margin-bottom: 12px; }
.page-head .crumb a { color: var(--amber); text-decoration: none; }

/* ---------- Sommaire / bandeaux info IA ---------- */
.two-col { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; }
.two-col.flip > :first-child { order: 2; }
@media (max-width: 880px) { .two-col { grid-template-columns: 1fr; } .two-col.flip > :first-child { order: 0; } }

.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.info-list li { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.info-ico {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center;
  background: var(--navy-100); color: var(--navy-700); font-size: 1.25rem;
}
.info-list h4 { margin: 0 0 2px; font-size: 1.04rem; }
.info-list p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------- Bandeau accès refusé ---------- */
.denied-banner {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--danger-soft); color: #7c2a20; border: 1px solid #e3b7b0;
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 22px;
}
.denied-banner .ico { font-size: 1.5rem; line-height: 1; }
.denied-banner h3 { color: #7c2a20; margin: 0 0 3px; font-size: 1.08rem; }
.denied-banner p { margin: 0; font-size: .96rem; }
.denied-banner code { background: rgba(163,59,46,.08); padding: 1px 6px; border-radius: 5px; font-size: .9em; }

/* ---------- Formulaires ---------- */
.form-shell { max-width: 520px; margin: 0 auto; }
.form-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 28px;
}
.form-grid { display: grid; gap: 16px; }
.field label { display: block; font-size: .9rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field .req { color: var(--danger); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; font-size: 1rem; font-family: var(--font-sans);
  border: 1px solid #d4cbb8; border-radius: var(--radius-sm); background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(13,58,99,.35); border-color: var(--navy-600); }
.field textarea { min-height: 130px; resize: vertical; }
.field .help { font-size: .82rem; color: var(--muted); margin-top: 5px; }
.form-note { text-align: center; font-size: .9rem; color: var(--muted); margin-top: 16px; }
.form-note a { color: var(--navy-600); }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ---------- Filtres du catalogue ---------- */
.filterbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 26px; }
.filterbar .searchbar { flex: 1; min-width: 260px; max-width: 480px; box-shadow: var(--shadow-sm); }
.filter-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); font-weight: 600;
  padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: .9rem; font-family: var(--font-sans);
}
.filter-btn:hover { border-color: var(--navy-600); color: var(--navy-700); }
.filter-btn.active { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.results-count { font-size: .9rem; color: var(--muted); margin-bottom: 8px; }
.no-result { text-align: center; padding: 40px 0; color: var(--muted); }

/* ---------- Citations, onglets, listes ---------- */
blockquote {
  margin: 24px 0; padding: 8px 0 8px 26px; border-left: 4px solid var(--amber);
  font-family: var(--font-serif); font-style: italic; font-size: 1.25rem; color: var(--navy-800);
}
blockquote footer { font-family: var(--font-sans); font-style: normal; font-size: .9rem; color: var(--muted); margin-top: 8px; }
.tick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tick-list li { padding-left: 30px; position: relative; }
.tick-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--ok); font-weight: 700; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.timeline li { position: relative; padding-left: 30px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.timeline b { color: var(--navy-800); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); font-size: .95rem; }
table.data th, table.data td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
table.data thead th { background: var(--navy-800); color: #fff; font-size: .86rem; text-transform: uppercase; letter-spacing: .05em; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:nth-child(even) { background: var(--paper); }

/* ---------- Alerte (message générique) ---------- */
.alert { border-radius: var(--radius-sm); padding: 12px 16px; font-size: .95rem; margin: 14px 0; }
.alert-danger { background: var(--danger-soft); color: #7c2a20; border: 1px solid #e6b7b0; }
.alert-ok { background: #e2f0e7; color: #1e5a38; border: 1px solid #b9d7c5; }
.alert-info { background: var(--navy-100); color: var(--navy-800); border: 1px solid #c2d6e8; }

details.faq { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow-sm); }
details.faq summary { cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--navy-800); list-style: none; position: relative; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--amber); }
details.faq[open] summary::after { content: "–"; }
details.faq .faq-body { padding: 0 20px 16px; color: var(--ink-soft); font-size: .97rem; }

.breadcrumb { font-size: .86rem; color: var(--muted); margin: 18px 0 -6px; }
.breadcrumb a { color: var(--navy-600); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: 10px 16px; z-index: 100; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Section entête assortie de fond crème pour pages internes de contenu */
.content-prose { max-width: 760px; }
.content-prose p, .content-prose li { color: var(--ink-soft); }
.content-prose p a, .content-prose li a { text-decoration: underline; }
