/* ═══════════════════════════════════════════════
   Portail Recherche Dediĉi — style.css
   Cohérent avec la collection "Fraternité effective"
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400&family=Source+Sans+3:wght@400;500;600;700&display=swap');

/* ── Variables ── */
:root {
  --blue:    #2F6FDB;
  --red:     #D94A4A;
  --green:   #3FA66B;
  --black:   #111827;
  --yellow:  #eab308;
  --accent:  #1e3a7a;
  --ink:     #1A1A1A;
  --muted:   #5a6478;
  --paper:   #FBF6EC;
  --card:    #ffffff;
  --line:    #DDD5BE;
  --soft:    #f0eadb;
  --radius:  18px;
  --radius-sm: 12px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Source Sans 3', system-ui, sans-serif;
  line-height: 1.68;
  font-size: 1.04rem;
}

a { color: #1e3a7a; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Skip link ── */
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  background: #fff;
  padding: .5rem 1rem;
  z-index: 10;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* ── Topbar / Navigation ── */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 4;
  box-shadow: 0 2px 12px rgba(23,32,51,.05);
}

.navwrap {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.25rem;
}

.brand {
  font-family: 'Lora', Georgia, serif;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .01em;
  font-size: 1rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
}

.nav a {
  font-size: .88rem;
  font-weight: 500;
  padding: .32rem .6rem;
  border-radius: 999px;
  color: #2a3a5a;
  transition: background .15s, color .15s;
}

.nav a:hover,
.nav a.active {
  background: #e6edf8;
  color: var(--accent);
  text-decoration: none;
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #fff 0%, #edf4ff 60%, #fff8db 100%);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -8% -80px auto;
  width: 400px;
  height: 400px;
  background: conic-gradient(from 40deg, var(--blue), var(--red), var(--green), var(--black), var(--yellow), var(--blue));
  opacity: .07;
  border-radius: 50%;
}

.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3.8rem 1.25rem 2.8rem;
  position: relative;
}

.kicker {
  text-transform: uppercase;
  color: #4d6487;
  font-weight: 700;
  font-size: .76rem;
  letter-spacing: .12em;
  margin: 0 0 .6rem;
}

.hero h1 {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.07;
  margin: 0 0 .6rem;
  letter-spacing: -.02em;
  color: var(--ink);
}

.subtitle {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.22rem);
  color: #445;
  max-width: 820px;
  line-height: 1.5;
  margin: 0;
}

.color-strip {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--red), var(--green), var(--black), var(--yellow));
  margin: 1.4rem 0 0;
  max-width: 280px;
}

/* ── Main layout ── */
.main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ── Section card ── */
.section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  margin: 0 0 1.4rem;
  box-shadow: 0 4px 20px rgba(23,32,51,.04);
}

.section h2 {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  margin: 0 0 1rem;
  color: var(--ink);
  letter-spacing: -.01em;
}

.section p { margin: 0 0 1rem; line-height: 1.72; }
.section p:last-child { margin-bottom: 0; }

/* ── Lead text ── */
.lead {
  font-size: 1.1rem;
  color: #2a3a4a;
  line-height: 1.72;
}

/* ── Callout ── */
.callout {
  border-left: 5px solid var(--accent);
  background: #f0f4fb;
  padding: 1rem 1.2rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1rem 0;
}

.quote {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
}

/* ── Grid de cartes ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: 0 4px 16px rgba(23,32,51,.04);
  transition: box-shadow .18s, transform .18s;
  cursor: pointer;
}

.card:hover {
  box-shadow: 0 8px 28px rgba(23,32,51,.1);
  transform: translateY(-2px);
  text-decoration: none;
}

.card h3 {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.08rem;
  margin: 0 0 .45rem;
  color: var(--ink);
  line-height: 1.25;
}

.card p {
  margin: 0 0 .4rem;
  color: var(--muted);
  font-size: .96rem;
  line-height: 1.58;
}

.card p:last-child { margin-bottom: 0; }

/* ── Discipline card ── */
.discipline-card {
  display: block;
  color: inherit;
}

.discipline-card:hover { text-decoration: none; }

.small { font-size: .88rem; color: var(--muted); }

/* ── Cinq rôles ── */
.roles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .85rem;
  margin: 1rem 0;
}

.role {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .95rem 1rem;
  background: var(--card);
}

.role::before {
  content: "";
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-bottom: .55rem;
}

.role.blue::before   { background: var(--blue); }
.role.red::before    { background: var(--red); }
.role.green::before  { background: var(--green); }
.role.black::before  { background: var(--black); }
.role.yellow::before { background: var(--yellow); }

.role strong {
  display: block;
  font-family: 'Lora', Georgia, serif;
  font-size: .98rem;
  margin-bottom: .3rem;
  color: var(--ink);
}

/* ── Tags ── */
.tag {
  display: inline-block;
  border-radius: 999px;
  padding: .22rem .55rem;
  margin: .1rem;
  background: #eef2ff;
  color: #273b67;
  font-size: .82rem;
  font-weight: 500;
}

.tag.blue   { background: #dbeafe; color: #1e3a8a; }
.tag.red    { background: #fee2e2; color: #7f1d1d; }
.tag.green  { background: #dcfce7; color: #14532d; }
.tag.black  { background: #e5e7eb; color: #111827; }
.tag.yellow { background: #fef3c7; color: #713f12; }

/* ── Boutons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent);
  color: #fff !important;
  padding: .65rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .92rem;
  margin: .25rem .25rem .25rem 0;
  transition: background .15s, transform .15s;
  text-decoration: none !important;
}

.btn:hover {
  background: #162d60;
  transform: translateY(-1px);
  text-decoration: none !important;
}

.btn.secondary {
  background: #fff;
  color: var(--accent) !important;
  border: 1px solid var(--accent);
}

.btn.secondary:hover {
  background: #f0f4fb;
}

/* ── Schéma SVG ── */
.schema {
  display: block;
  max-width: 720px;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  margin: 1rem auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

/* ── Table des disciplines ── */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
}

.table th,
.table td {
  border: 1px solid var(--line);
  padding: .75rem 1rem;
  text-align: left;
  vertical-align: top;
  font-size: .96rem;
}

.table th {
  background: #f1f5f9;
  font-family: 'Lora', Georgia, serif;
  font-weight: 600;
}

/* ── Cahiers ── */
.cahier-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.cahier .code {
  font-weight: 800;
  color: var(--accent);
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: .35rem;
}

/* ── Resources ── */
.resource {
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}

.resource:first-child { border-top: 0; }

.resource h3 {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.05rem;
  margin: 0 0 .35rem;
}

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* ── Checklist ── */
ul.check {
  padding-left: 1.2rem;
  margin: .5rem 0;
}

ul.check li {
  margin: .4rem 0;
  line-height: 1.6;
}

/* ── TOC ── */
.toc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}

.toc a {
  display: block;
  padding: .38rem 0;
  border-bottom: 1px solid #eef0f4;
  color: #1e3a7a;
  font-size: .96rem;
}

.toc a:last-child { border-bottom: 0; }

/* ── Note ── */
.small-note {
  font-size: .88rem;
  color: var(--muted);
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 2rem 1.25rem;
  color: var(--muted);
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  font-size: .9rem;
  line-height: 1.7;
}

.footer-inner strong {
  font-family: 'Lora', Georgia, serif;
  color: var(--ink);
}

/* ── Responsive ── */
@media (max-width: 760px) {
  .navwrap {
    flex-direction: column;
    align-items: flex-start;
    gap: .6rem;
  }

  .hero-inner { padding: 2.5rem 1rem 2rem; }
  .main { padding: 1rem 1rem 3rem; }
  .section { padding: 1.2rem 1.1rem; }
  .table { font-size: .88rem; }

  .table th,
  .table td { padding: .5rem .6rem; }
}
