/* ==========================================================================
   Additions to the design stylesheet (site.css, kept verbatim from the
   design): elements the design did not cover. Same tokens, same restraint.
   ========================================================================== */

/* Draft banner */
.draft-banner{font-family:var(--sans);font-size:.88rem;color:var(--fg);border:1px solid var(--fg);
  padding:.45rem .8rem;margin:0 0 1.5rem}

/* One piece of math: grid of cards */
.op-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(15rem,1fr));gap:1.4rem;margin-top:2rem}
.op-card{display:flex;flex-direction:column;border:1px solid var(--rule);padding:.8rem .9rem .9rem}
.content .op-title{font-size:1rem;font-weight:600;margin:0 0 .2rem;border:0;padding:0;text-transform:none;
  letter-spacing:0;font-variant:normal;text-align:left}
.content .op-meta{font-family:var(--sans);font-size:.8rem;color:var(--mut);margin:0 0 .5rem;display:flex;
  gap:.8em;flex-wrap:wrap}
.content .op-desc{font-size:.88rem;line-height:1.45;text-align:left;hyphens:auto;margin:0 0 .8rem}
.op-media{margin-top:auto;display:block}
.op-media img,.op-media video{display:block;width:100%;height:auto;border:1px solid var(--rule)}

/* Equations with a label: anchor target, no extra spacing. */
.equation{scroll-margin-top:1rem}
.ref{white-space:nowrap}

/* Algorithms: ruled, caption on top (as with algorithm2e's "ruled"). */
figure.algorithm{border-top:1.5px solid var(--fg);border-bottom:1.5px solid var(--fg);padding:0 0 .3rem;margin:1.5rem 0}
figure.algorithm figcaption{border-bottom:1px solid var(--fg);padding:.25rem 0;margin:0 0 .4rem}
figure.algorithm ol{margin:.2rem 0}

/* Scans of historical articles: black ink on transparent paper, so they get
   a paper background (readable in dark mode too). */
.historical-figure img{background:#fdfcf8;padding:.5rem;border:1px solid var(--rule)}

/* Diagrams (SVG figures, black ink on transparent): inverted in dark mode,
   with a hue rotation that keeps their colours close to the originals. */
:root[data-theme="dark"] figure img[src*="svg"]{filter:invert(1) hue-rotate(180deg)}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) figure img[src*="svg"]{filter:invert(1) hue-rotate(180deg)}
}

/* One-column pages (about, course pages…): the design's .layout box is sized
   for a rail + the text column; without the rail, narrow it to the column so
   that it is centred. List pages set their own width (.layout--list). */
.layout--single:not(.layout--list){max-width:calc(var(--measure) + 3rem)}

/* News: one entry per block, its date as a permalink. */
.news-entry{padding:.9rem 0;border-bottom:1px solid var(--rule);scroll-margin-top:1rem}
.news-entry:last-child{border-bottom:0}
.content .news-date{font-family:var(--sans);font-size:.82rem;color:var(--mut);margin:0 0 .3rem}
.news-date a{color:inherit;text-decoration:none}
.news-date a:hover{text-decoration:underline}
.news-entry > :last-child{margin-bottom:0}
.news-entry:target{background:var(--surface)}

/* Map: groups of pages. */
.map-group{margin-top:2rem}
.map-list{margin:.4rem 0 0;padding-left:1.2rem}
.map-list li{margin:.15rem 0}
.map-list a{text-decoration:none}
.map-list a:hover{text-decoration:underline}
.map-group:first-of-type{margin-top:1.2rem}

/* Home, phone width: the design spans the last block of the identity card
   (it had three); with two, Affiliation and Contact sit side by side. */
@media (max-width: 780px){
  .profile dl > div:last-child{grid-column:auto}
  .profile dl > div:last-child:nth-child(odd){grid-column:1/-1}
}

/* CV (/about/, layout: cv): the home page grid, then a timeline */
.cv h2{font-family:var(--sans);font-variant:small-caps;letter-spacing:.05em;font-size:1.05rem;font-weight:600;
  border-bottom:1px solid var(--rule);padding-bottom:.4rem;margin:2.6rem 0 1.1rem}
.cv h2:first-of-type{margin-top:0}
.cv h3{font-family:var(--sans);font-size:.8rem;letter-spacing:.07em;text-transform:uppercase;color:var(--faint);font-weight:600;margin:1.6rem 0 .6rem}
.cv-places{display:grid;grid-template-columns:repeat(3,1fr);gap:.6rem;margin:0 0 1.6rem}
.cv-places figure{margin:0}
.cv-places img{aspect-ratio:4/3;object-fit:cover;width:100%;display:block;filter:grayscale(1)}
.cv-places figure:hover img{filter:none}
.cv-places figcaption{font-family:var(--sans);font-size:.78rem;color:var(--faint);margin-top:.3rem}
.cv-places figcaption b{color:var(--fg);font-weight:600;margin-right:.3rem}
.cv-when{font-family:var(--sans);font-size:.8rem;color:var(--faint);font-variant-numeric:tabular-nums;text-align:right;padding-top:.25rem;white-space:nowrap}
.cv-timeline{list-style:none;padding:0;margin:0;position:relative}
.cv-timeline::before{content:"";position:absolute;left:7.4rem;top:.4rem;bottom:.4rem;border-left:1px solid var(--rule)}
.cv-timeline li{display:grid;grid-template-columns:7rem 1fr;gap:0 1.4rem;padding:.55rem 0;position:relative}
.cv-timeline li::before{content:"";position:absolute;left:calc(7.4rem - 4px);top:1.05rem;width:7px;height:7px;border-radius:50%;
  background:var(--bg);border:1px solid var(--faint)}
.cv-timeline li.current::before{background:var(--fg);border-color:var(--fg)}
.cv-timeline li.current .cv-when{color:var(--fg);font-weight:600}
.cv-title{margin:0;font-weight:600}
.cv-french{font-weight:400;font-style:italic;color:var(--mut)}
.cv-place{margin:0;color:var(--mut);font-size:.95rem}
.cv-details{display:grid;grid-template-columns:max-content 1fr;gap:.1rem .8rem;margin:.35rem 0 0;font-size:.88rem;color:var(--mut)}
.cv-details dt{font-family:var(--sans);font-size:.72rem;letter-spacing:.06em;text-transform:uppercase;color:var(--faint);padding-top:.2rem}
.cv-details dd{margin:0}
.cv-team{margin:0;padding-left:1.2rem}
.cv-team li{margin:.35rem 0}
.cv-team b{font-weight:600}
.cv-service{list-style:none;padding:0;margin:0}
.cv-service li{display:grid;grid-template-columns:7rem 1fr;gap:0 1.4rem;padding:.4rem 0}
.cv-service p{margin:0}
@media (max-width: 780px){
  .cv-timeline::before{left:.2rem}
  .cv-timeline li{grid-template-columns:1fr;padding-left:1.2rem}
  .cv-timeline li::before{left:-2px}
  .cv-when{text-align:left}
  .cv-places{gap:.35rem}
  .cv-service li{grid-template-columns:1fr}
}

/* Footer: a discreet line of profiles under the name */
.site-footer .footer-profiles{flex-basis:100%;font-family:var(--sans);font-variant:normal;letter-spacing:0;font-size:.76rem;color:var(--faint)}
.site-footer .footer-profiles a{color:var(--faint)}
.site-footer .footer-profiles a:hover{color:var(--fg)}

/* Publications: the BibTeX copy button looks like the links next to it */
.pub-bibtex{font:inherit;font-variant:inherit;letter-spacing:inherit;color:var(--acc);background:none;border:0;padding:0;cursor:pointer}
.pub-bibtex:hover{text-decoration:underline;text-underline-offset:.18em;text-decoration-thickness:1px}

/* 404: the comic centered, its credit in small print below */
.not-found{text-align:center}
.not-found img{max-width:100%;height:auto}
.not-found figcaption{font-size:.75rem;color:var(--faint)}
