/* Nordelle typography — Poppins everywhere, one family for the whole site.
   Loaded last in every page so it wins over each page's own font stacks. */
html, body, *, *::before, *::after {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* Un mot trop long pour sa boîte se coupe au lieu de déborder : l'allemand
   (Familienzusammenführung, Textverarbeitungsprogramm) et les URL le demandent.
   break-word ne coupe que quand le mot ne tient pas seul sur sa ligne. */
body { overflow-wrap: break-word; }

/* Poppins runs wider than the old stacks: keep controls and wide tables inside small screens */
select, input, textarea { max-width: 100%; }
@media (max-width: 560px) {
  .plans th, .att th { letter-spacing: 0; font-size: .68rem; padding: .5rem .4rem; }
  .plans, .att { table-layout: fixed; }
  .plans th, .plans td, .att th, .att td { overflow-wrap: anywhere; }
  .plans td, .att td { padding: .5rem .4rem; font-size: .8rem; }
}

/* ===== One knob for the size of every letter on the site =====
   Every text size in the pages is written in rem, so this single value sets them
   all. 20px instead of the browser's 16px is a quarter bigger everywhere, down to
   the smallest label — and since the cards, the pills and their padding are in em
   and rem too, the boxes grow with the words inside them. */
html { font-size: 20px; }
@media (max-width: 700px) { html { font-size: 18.5px; } }
@media (max-width: 400px) { html { font-size: 17.5px; } }

/* bigger letters want more air between the lines */
main p, main li, .wrap p, .wrap li, .art p, .art li, .page p, .page li { line-height: 1.6; }

/* ===== Layout: use the screen, don't leave margins on either side ===== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, video, canvas { max-width: 100%; }

/* the page keeps the width it had: the letters got bigger, not the margins.
   .fu is the shell of the B2.2 lessons: it was capped at 900px, so its tables
   had 820px to live in and the third column was cut off by the box's overflow. */
.wrap, main, .hero-inner, .scorebar .inner, .navpills, footer, .app, .fu {
  max-width: min(1440px, 100%) !important;
  padding-left: clamp(10px, 2.2vw, 22px) !important;
  padding-right: clamp(10px, 2.2vw, 22px) !important;
}
/* lists of cards (level pages, lesson lists) can use the whole screen */
footer, .hero-inner, .navpills, main:has(.grid) { max-width: min(1760px, 100%) !important; }

/* fewer cards per row, each one bigger — the same span of screen, in larger pieces */
@media (min-width: 1000px) { main .grid { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)) !important; } }

/* the index at the top of a lesson: wider tiles, so a title of three words
   stops breaking into three lines now that the letters are bigger */
@media (min-width: 900px) {
  .wrap .toc { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
}

/* the older 'browser window' reading pages and the A2 lesson shell */
.browser-frame, .flag-stripe, .shell { max-width: min(1440px, 100%) !important; }
.browser-body .wrap { max-width: none !important; }

/* phones */
@media (max-width: 600px) {
  .card, .art { padding: 14px !important; }
  h1 { overflow-wrap: anywhere; }
  .toc, .grid, .sujets { gap: 8px; }
  .hero, .shell, .browser-body { padding-left: 10px !important; padding-right: 10px !important; }
  .page { padding-left: 10px !important; padding-right: 10px !important; }
  body { margin: 0; }
  /* the language switcher sits bottom-right on phones, so sticky bars no longer need room for it */
  html body .bar { padding-right: 12px !important; gap: 8px; }
  .browser-body, .shell .page, .page .browser-body { padding-left: 6px !important; padding-right: 6px !important; }
  .browser-body .wrap, .page .wrap { padding-left: 0 !important; padding-right: 0 !important; }
}

/* The site's language switcher floats at the top right of every page, above
   everything. The lessons' sticky bar ends with its own buttons in that same
   corner, so the globe sat on top of them: the language select and the
   light/dark toggle lived under the pill. The switcher now carries six
   languages (ES EN FR DE KO ZH). Measured on the deployed page it is 265px
   wide at desktop sizes — the 223px it shows below 561px is the phone rule's
   smaller buttons — so with its 12px of margin, 285px keeps the bar's buttons
   clear of it. The bar's progress track is flex:1 and gives up the space,
   so nothing opens a hole. Below 561px the switcher moves to the bottom right and
   the phone rule above hands the padding back — this block comes after it so that
   between 561 and 600px, where the switcher is still up there, the room is kept. */
@media (min-width: 561px) {
  html body .bar { padding-right: 285px !important; }
}
/* Same corner, other pages: the row of tabs at the top of a lesson or a section is
   centred, so it only reaches the switcher on middle-sized screens — from 561px,
   where the switcher is still up there, to about 880px, where the row has stopped
   growing and the switcher has moved away. In that band a full-width spacer as the
   row's first flex item drops the tabs onto the line below the pill. */
@media (min-width: 561px) and (max-width: 899px) {
  nav.tabs::before, nav.sitenav::before { content: ""; flex-basis: 100%; width: 100%; height: 30px; }
}

/* keep long article paragraphs at a readable line length on very wide screens */
.art p, .art .chapo { max-width: 100ch; }

/* phones: wide content tables scroll inside themselves instead of widening the page,
   and long words in headings wrap */
@media (max-width: 600px) {
  table:not(.plans):not(.att):not(.match) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  h1, h2, h3, h4 { overflow-wrap: break-word; flex-wrap: wrap; }
}

/* footer: legal notice links */
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 1.2rem; width: 100%; flex-basis: 100%; margin-top: .9rem; font-size: .82rem; }
.legal-links a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.legal-links a:hover { color: #378EF6; }
