@charset "utf-8";
/* =====================================================================
   Mathématiques Discrètes — ULiège · feuille de style principale
   Palette : #003135 · #024950 · #964734 · #0FA4AF · #AFDDE5
   ===================================================================== */

:root {
  --abyss: #003135;
  --deep: #024950;
  --copper: #964734;
  --teal: #0FA4AF;
  --mist: #AFDDE5;

  --bg: #f3f8f9;
  --surface: #ffffff;
  --ink: #0d2427;
  --muted: #4f6b6f;
  --line: rgba(2, 73, 80, .14);
  --stripe: rgba(175, 221, 229, .28);
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0, 49, 53, .05), 0 8px 28px -12px rgba(0, 49, 53, .18);
  --header-h: 68px;
  --wrap: 1180px;
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
::selection { background: var(--mist); color: var(--abyss); }

a { color: var(--deep); text-decoration: underline; text-decoration-color: rgba(15, 164, 175, .55); text-underline-offset: 3px; text-decoration-thickness: 1.5px; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--copper); text-decoration-color: var(--copper); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--copper); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ------------------------------ EN-TÊTE ------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(0, 49, 53, .92);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(175, 221, 229, .10);
  transition: box-shadow .25s, background .25s;
}
.site-header.is-scrolled { background: rgba(0, 49, 53, .97); box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .55); }
.bar { max-width: var(--wrap); margin: 0 auto; height: var(--header-h); padding: 0 24px; display: flex; align-items: center; gap: 24px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; flex-shrink: 0; }
.brand:hover { color: #fff; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(140deg, var(--teal), var(--deep)); }
.brand-mark svg { width: 22px; height: 22px; }
.brand-mark path { fill: none; stroke: var(--mist); stroke-width: 1.6; }
.brand-mark circle { fill: #fff; }
.brand-mark circle:last-of-type { fill: var(--copper); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-weight: 600; letter-spacing: .28em; font-size: 15px; color: #e8a58f; }
.brand-text small { font-size: 10.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--mist); opacity: .8; margin-top: 3px; }

.main-nav { margin-left: auto; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.nav-item { position: relative; }
.nav-top {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 14.5px; font-weight: 500; letter-spacing: .01em;
  color: rgba(255, 255, 255, .86); background: none; border: 0; cursor: pointer;
  padding: 9px 14px; border-radius: 999px; text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-top:hover, .nav-item.open > .nav-top { color: #fff; background: rgba(175, 221, 229, .12); }
.nav-top.is-active { color: #fff; }
.nav-top.is-active::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--copper); box-shadow: 0 0 0 2px rgba(150, 71, 52, .35); margin-left: 2px; }
.chev { width: 12px; height: 12px; transition: transform .2s; }
.chev path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.open .chev { transform: rotate(180deg); }

.panel {
  position: absolute; top: calc(100% + 12px); left: 50%;
  min-width: 260px; padding: 14px;
  background: #fff; color: var(--ink);
  border-radius: 18px; border: 1px solid var(--line);
  box-shadow: 0 24px 60px -20px rgba(0, 49, 53, .45);
  opacity: 0; visibility: hidden; transform: translate(-50%, 6px);
  transition: opacity .18s, transform .18s, visibility 0s .18s;
}
.panel::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; } /* pont de survol */
.nav-item.open > .panel { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .18s, transform .18s; }
.is-mega > .panel { width: min(780px, 92vw); }
.nav-item:last-child > .panel { left: auto; right: 0; transform: translate(0, 6px); }
.nav-item:last-child.open > .panel { transform: none; }

.panel-hint { margin: 2px 8px 10px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--teal); font-weight: 600; }
.panel ul { list-style: none; margin: 0; padding: 0; }
.panel ul a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: 10px; font-size: 14.5px; color: var(--ink); text-decoration: none;
}
.panel ul a:hover { background: var(--bg); color: var(--deep); }
.panel ul a.is-current { background: rgba(15, 164, 175, .12); color: var(--deep); font-weight: 600; }
.panel ul a.is-current::before { content: ""; width: 3px; align-self: stretch; border-radius: 3px; background: var(--copper); margin: -2px 8px -2px -4px; }
.panel ul a.is-current { justify-content: flex-start; }
.ext { font-size: 11px; color: var(--muted); }

.panel-cols { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 6px 14px; }
.panel-col { padding: 4px; }
.panel-col + .panel-col { border-left: 1px solid var(--line); padding-left: 14px; }
.col-title { margin: 4px 10px 8px; font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--copper); }


.burger { display: none; margin-left: auto; width: 44px; height: 44px; border: 0; border-radius: 12px; background: rgba(175, 221, 229, .1); cursor: pointer; position: relative; }
.burger span { position: absolute; left: 12px; right: 12px; height: 2px; border-radius: 2px; background: #fff; transition: transform .25s, opacity .2s, top .25s; }
.burger span:nth-child(1) { top: 15px; } .burger span:nth-child(2) { top: 21px; } .burger span:nth-child(3) { top: 27px; }
.nav-open .burger span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-open .burger span:nth-child(2) { opacity: 0; }
.nav-open .burger span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* ----- menu mobile ----- */
@media (max-width: 980px) {
  .burger { display: block; }
  .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--abyss); }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 0 0; margin: 0;
    background: var(--abyss); overflow-y: auto; overscroll-behavior: contain;
    padding: 12px 18px 40px;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .2s, transform .2s, visibility 0s .2s;
  }
  .nav-open .main-nav { opacity: 1; visibility: visible; transform: none; transition: opacity .2s, transform .2s; }
  .nav-open body { overflow: hidden; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-item { border-bottom: 1px solid rgba(175, 221, 229, .12); }
  .nav-top { width: 100%; justify-content: space-between; font-size: 20px; font-weight: 300; padding: 16px 6px; border-radius: 0; }
  .nav-top:hover, .nav-item.open > .nav-top { background: none; }
  .nav-top.is-active::after { margin-left: auto; margin-right: 10px; }
  .chev { width: 16px; height: 16px; }
  .panel, .is-mega > .panel, .nav-item:last-child > .panel {
    position: static; width: auto; min-width: 0; transform: none; opacity: 1; visibility: visible;
    background: transparent; border: 0; box-shadow: none; border-radius: 0; padding: 0 0 14px;
    display: none; transition: none;
  }
  .nav-item.open > .panel, .nav-item:last-child.open > .panel { display: block; transform: none; }
  .panel::before { display: none; }
  .panel-hint { color: var(--teal); margin: 0 6px 8px; }
  .panel-cols { grid-template-columns: 1fr; gap: 14px; }
  .panel-col + .panel-col { border: 0; padding-left: 4px; }
  .col-title { color: #e8a58f; margin-left: 6px; }
  .panel ul a { color: rgba(255, 255, 255, .86); font-size: 16px; padding: 10px 10px; }
  .panel ul a:hover { background: rgba(175, 221, 229, .08); color: #fff; }
  .panel ul a.is-current { background: rgba(15, 164, 175, .2); color: #fff; }
  .ext { color: var(--mist); }
          }

/* ---------------------------- EN-TÊTE DE PAGE ---------------------------- */
.page-hero {
  position: relative; overflow: hidden; isolation: isolate;
  color: #fff;
  background:
    radial-gradient(120% 140% at 85% 120%, rgba(15, 164, 175, .55) 0%, rgba(15, 164, 175, 0) 55%),
    radial-gradient(60% 80% at 10% -10%, rgba(175, 221, 229, .22) 0%, rgba(175, 221, 229, 0) 60%),
    linear-gradient(160deg, var(--abyss) 0%, var(--deep) 70%, #036570 100%);
}
.page-hero::after { /* ondes */
  content: ""; position: absolute; z-index: -1; right: -120px; bottom: -260px; width: 760px; height: 520px; border-radius: 50%;
  background: repeating-radial-gradient(ellipse at center, rgba(175, 221, 229, .16) 0 1px, transparent 1px 34px);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 70%);
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 70%);
}
.hero-inner { max-width: var(--wrap); margin: 0 auto; padding: 56px 24px 52px; }
.eyebrow { margin: 0 0 14px; font-size: 12px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--mist); }
.eyebrow::before { content: "\2022"; color: #e8a58f; margin-right: 10px; }
.page-hero h1 { margin: 0; font-weight: 200; font-size: clamp(34px, 5.2vw, 60px); line-height: 1.04; letter-spacing: -.025em; }
.page-hero .lead { margin: 14px 0 0; max-width: 640px; font-size: 17px; font-weight: 300; color: rgba(255, 255, 255, .78); }

/* accueil */
.page-hero.home .hero-inner { padding: 92px 24px 96px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 40px; }
.page-hero.home h1 { font-size: clamp(46px, 8.6vw, 112px); line-height: .96; letter-spacing: -.04em; }
.page-hero.home h1 .arrow { font-weight: 200; color: var(--mist); font-size: .5em; vertical-align: .55em; margin-left: .25em; }
.page-hero.home .lead { font-size: 19px; }
.hero-meta { display: flex; flex-direction: column; gap: 8px; text-align: right; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--mist); }
.hero-meta a { color: #fff; text-decoration-color: rgba(232, 165, 143, .7); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 999px; font-size: 15px; font-weight: 500; text-decoration: none; transition: transform .15s, background .15s, color .15s; }
.btn-primary { background: var(--copper); color: #fff; }
.btn-primary:hover { background: #a9553f; color: #fff; transform: translateY(-1px); }
.btn-ghost { color: #fff; border: 1px solid rgba(175, 221, 229, .45); }
.btn-ghost:hover { background: rgba(175, 221, 229, .12); color: #fff; }
@media (max-width: 760px) {
  .page-hero.home .hero-inner { grid-template-columns: 1fr; padding: 64px 22px 60px; }
  .hero-meta { text-align: left; }
}


/* accueil : bannière d'origine */
.home-banner { max-width: var(--wrap); margin: 0 auto; padding: 28px 24px 0; }
.banner-card {
  display: flex; justify-content: center; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 24px;
  border-bottom: 3px solid var(--teal);
}
.banner-card img { display: block; width: 100%; max-width: 673px; height: auto; }

/* sections dépliables */
details.fold { margin: 1.6em 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
details.fold > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border-radius: 14px; transition: background .15s;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary:hover { background: rgba(175, 221, 229, .18); }
details.fold > summary::before {
  content: ""; flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--deep) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 4l4 4-4 4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
  transition: transform .2s, background-color .2s;
}
details.fold[open] > summary::before { transform: rotate(90deg); background-color: var(--copper); }
details.fold > summary h3 { margin: 0 !important; font-size: 20px; }
details.fold > summary h3::after { display: none; }
.fold-title { font-size: 17px; color: var(--abyss); font-weight: 500; }
.fold-note { margin-left: auto; font-size: 12px; letter-spacing: .06em; color: var(--muted); background: var(--bg); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.fold-body { padding: 0 20px 16px; }
details.fold-inner { margin: 10px 0; }
@media (max-width: 640px) { .fold-body { padding: 0 8px 12px; } details.fold > summary { padding: 14px 12px; } .fold-note { display: none; } }

/* ------------------------------ CONTENU ------------------------------ */
.page { max-width: var(--wrap); margin: 0 auto; padding: 28px 24px 72px; }

/* l'ancienne grille en tableau devient une mise en page fluide */
table.layout, table.layout > tbody { display: block; width: 100%; border: 0; }
table.layout > tbody > tr, table.layout > tr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; margin-bottom: 24px; }
table.layout > tbody > tr > td, table.layout > tr > td { display: block; flex: 1 1 560px; min-width: 0; padding: 0; }
table.layout > tbody > tr > td + td, table.layout > tr > td + td { flex: 0 1 300px; position: sticky; top: calc(var(--header-h) + 20px); }

.divitem, .divitem2 {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 3.2vw, 36px);
  color: var(--ink);
  overflow-wrap: anywhere;
}
.divitem + .divitem { margin-top: 24px; }
.divitem2 {
  font-size: 15px;
  background: linear-gradient(170deg, #fff 0%, #f6fbfc 100%);
  border-top: 3px solid var(--teal);
}
.divitem > :first-child, .divitem2 > :first-child { margin-top: 0; }
.divitem > :last-child, .divitem2 > :last-child { margin-bottom: 0; }

.divitem h3, .divitem2 h3 { font-size: 22px; font-weight: 400; letter-spacing: -.01em; color: var(--abyss); margin: 1.6em 0 .7em; }
.divitem h3::after { content: ""; display: block; width: 36px; height: 2px; background: var(--copper); margin-top: 10px; border-radius: 2px; }
table.layout td > h4, .divitem h4 {
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--deep); margin: 36px 4px 14px; line-height: 1.5;
}
table.layout td > h4:first-child { margin-top: 8px; }
table.layout td > h4 a, .divitem h4 a { color: var(--copper); }
.divitem p { margin: 0 0 1em; }
.divitem ul { padding-left: 1.2em; }
.divitem li { margin: .25em 0; }
.divitem li::marker { color: var(--teal); }
.divitem ul[style*="none"] li { padding: 7px 0; margin: 0; border-bottom: 1px solid var(--line); }
.divitem ul[style*="none"] { padding-left: 0; }
.divitem ul ul { margin: .4em 0 1em; }
.divitem em { color: var(--muted); }
.divitem hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
center { text-align: center; }

/* tableaux de contenu (journal, listes de documents) */
.divitem table, .divitem2 table { width: 100% !important; border-collapse: separate; border-spacing: 0; border: 0; font-size: 15px; }
.divitem td, .divitem th { border: 0; border-bottom: 1px solid var(--line); padding: 11px 12px; vertical-align: top; text-align: left; }
.divitem tr:last-child > td { border-bottom: 0; }
.divitem td:first-child { white-space: nowrap; width: 1%; color: var(--muted); }
.divitem td:first-child b { color: var(--abyss); font-weight: 600; margin-right: 4px; }
.divitem tr:hover > td { background: rgba(175, 221, 229, .16); }
.divitem tr[style*="B5B5CC"], .divitem tr[style*="b5b5cc"] { background: var(--stripe) !important; }
.divitem td[style*="FF9999"], .divitem td[style*="ff9999"] { background: rgba(150, 71, 52, .1) !important; color: var(--copper); border-radius: 8px 0 0 8px; }
.divitem td[style*="FF9999"] b { color: var(--copper); }
@media (max-width: 640px) {
  .divitem td { padding: 9px 8px; font-size: 14.5px; }
  .divitem td:first-child { white-space: normal; width: 5.2em; }
}

/* anciennes couleurs de texte */
font[color="#ff4040"], font[color="#FF4040"] { color: var(--copper); font-weight: 500; }
font[color="#4040ff"], font[color="#4040FF"] { color: #0b7f88; font-weight: 500; }
font[color="#409940"] { color: #2f7d5b; font-weight: 500; }

/* icônes de fichiers -> badges */
a:has(> img[src*="pdf_icon"]), a:has(> img[src*="nb.gif"]), a:has(> img[src*="terre_orbi"]), a:has(> img[src*="python.svg"]) {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 26px; padding: 0 8px; border-radius: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-decoration: none;
  background: var(--copper); color: #fff; vertical-align: middle;
  transition: transform .15s, background .15s;
}
a:has(> img[src*="pdf_icon"])::after { content: "PDF"; }
a:has(> img[src*="nb.gif"]) { background: var(--deep); }
a:has(> img[src*="nb.gif"])::after { content: "NB"; }
a:has(> img[src*="terre_orbi"]) { background: var(--teal); color: var(--abyss); }
a:has(> img[src*="terre_orbi"])::after { content: "ORBi"; }
a:has(> img[src*="pdf_icon"]):hover, a:has(> img[src*="nb.gif"]):hover, a:has(> img[src*="terre_orbi"]):hover { transform: translateY(-1px); color: #fff; }
a > img[src*="pdf_icon"], a > img[src*="nb.gif"], a > img[src*="terre_orbi"] {
  position: absolute; width: 1px !important; height: 1px !important; opacity: 0; overflow: hidden;
}
@supports not selector(:has(a)) {
  a > img[src*="pdf_icon"], a > img[src*="nb.gif"], a > img[src*="terre_orbi"] { position: static; width: auto !important; height: auto !important; opacity: 1; }
}
img[src*="get_adobe_reader"] { border-radius: 6px; }

/* accueil : couvertures de livres */
.covers { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 28px !important; padding-top: 24px; border-top: 1px solid var(--line); }
.covers a { display: block; border-radius: 6px; box-shadow: 0 10px 24px -12px rgba(0, 49, 53, .55); transition: transform .2s, box-shadow .2s; line-height: 0; }
.covers a:hover { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 18px 30px -14px rgba(0, 49, 53, .6); }
.covers img { border-radius: 6px; height: 150px; width: auto; }
.books p { padding-left: 16px; border-left: 2px solid var(--mist); }
.books p:hover { border-left-color: var(--copper); }
.mam-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; }
.mam-card center { line-height: 0; }
.mam-card img { border-radius: 10px; }
@media (max-width: 760px) { .mam-card { grid-template-columns: 1fr; } }

/* noscript */
.noscript-nav { max-width: var(--wrap); margin: 0 auto; padding: 14px 24px; background: var(--abyss); color: var(--mist); font-size: 14px; }
.noscript-nav a { color: #fff; margin-right: 12px; }

@media (max-width: 860px) {
  table.layout > tbody > tr > td + td, table.layout > tr > td + td { position: static; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .skip { display: none !important; }
  .page-hero { background: none; color: #000; }
  .divitem, .divitem2 { box-shadow: none; border: 0; padding: 0; }
}

/* code Python */
a:has(> img[src*="python.svg"]) {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 26px; padding: 0 8px; border-radius: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-decoration: none;
  background: #3672a4; color: #ffd845; vertical-align: middle; transition: transform .15s;
}
a:has(> img[src*="python.svg"])::after { content: "PY"; }
a:has(> img[src*="python.svg"]):hover { transform: translateY(-1px); color: #ffd845; }
a > img[src*="python.svg"] { position: absolute; width: 1px !important; height: 1px !important; opacity: 0; overflow: hidden; }
@supports not selector(:has(a)) { a > img[src*="python.svg"] { position: static; width: 24px !important; height: 24px !important; opacity: 1; } }

/* rayures régulières dans les sous-rubriques */
.fold-body tr:nth-child(odd) > td { background: var(--stripe); }
