/* Les couleurs de Bivio, tirées de son icône : l'eau (le fond), le ciel, le soleil (l'accent),
   le sable, la route et le blanc (le texte). La police : celle du système partout (San Francisco chez Apple).
   À l'écran seulement : l'impression garde le papier blanc. */
@media screen {
html.bivio {
  --eau: #1F4456; --eau-claire: #285468; --eau-ligne: #3C6A7E;
  --ciel: #9BD0E3; --soleil: #F5BE55; --soleil-hi: #FFD27A; --sable: #E8D7AE; --route: #F3EBDC;
  --ground: var(--eau); --surface: var(--eau-claire); --line: var(--eau-ligne);
  --ink: #FFFFFF; --muted: #C7DDE6; --accent: var(--soleil); --accent-hi: var(--soleil-hi);
  --plein: var(--soleil); --sur-plein: #17323F;
  --bleu: #2B7393;
  /* Le fond de carte : la mer plus profonde que la page, les terres couleur de l'eau claire. */
  --mer: #132C38; --terre: #3D6B7D; --cote: #6E9AAB; --frontiere: #9CC2D0;
  --serif: "Twemoji Country Flags", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sans: "Twemoji Country Flags", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
html.bivio body { background: var(--eau); color: var(--ink); }
html.bivio a:hover { color: var(--soleil-hi); }
html.bivio h1, html.bivio h2 { color: var(--route); font-weight: 600; }
html.bivio header.marque strong span, html.bivio .marque h1 span { color: var(--soleil); }
html.bivio .chapeau, html.bivio .compte, html.bivio footer { color: var(--muted); }
html.bivio .etoiles, html.bivio .note { color: var(--sable); }
html.bivio input, html.bivio select { background: var(--eau-claire); color: var(--ink); border-color: var(--eau-ligne); }

/* La recherche : des rectangles, la carte à gauche et le texte à droite, autant par ligne que
   la largeur le permet. */
html.bivio main { max-width: 1360px; }
html.bivio #resultats { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 18px; align-content: start; }
html.bivio #resultats > li.vide { grid-column: 1 / -1; }
html.bivio #resultats > li { display: flex; margin: 0; min-width: 0; }
html.bivio a.ligne-voyage { flex: 1; min-width: 0; flex-direction: row; align-items: stretch; gap: 14px; margin: 0; padding: 12px;
  border-radius: 16px; overflow: hidden; transition: transform .15s ease, border-color .15s ease; }
html.bivio a.ligne-voyage:hover { transform: translateY(-2px); border-color: var(--soleil); }
html.bivio a.ligne-voyage .carte-mini, html.bivio a.ligne-voyage svg.trace { order: -1; flex: 0 0 46%; width: 46%; height: auto;
  aspect-ratio: 20 / 13; align-self: center; border-radius: 10px; }
html.bivio a.ligne-voyage .texte { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
html.bivio a.ligne-voyage h2 { font-size: 17px; line-height: 1.25; margin: 0 0 6px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
html.bivio a.ligne-voyage .meta { margin: 0 0 4px; }
html.bivio a.ligne-voyage .villes { color: var(--muted); margin: 0 0 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 560px) {
  html.bivio #resultats { grid-template-columns: 1fr; gap: 12px; }
  html.bivio a.ligne-voyage { gap: 10px; padding: 10px; }
  html.bivio a.ligne-voyage .carte-mini, html.bivio a.ligne-voyage svg.trace { flex-basis: 40%; width: 40%; }
  html.bivio a.ligne-voyage h2 { font-size: 15px; }
  html.bivio a.ligne-voyage .meta, html.bivio a.ligne-voyage .villes { font-size: 13px; }
}
}
/* Le nom « Bivio. » et « communauté » gardent leur police à empattements, comme le logo. */
@media screen {
  html.bivio header.marque strong, html.bivio header.marque em, html.bivio header.marque h1 {
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; }
  /* L'étoile et la note, discrètes sous le titre. */
  html.bivio a.ligne-voyage .etoiles { font-size: 13px; letter-spacing: 0; margin: 2px 0 0; }
}
@media screen {
  html.bivio a.ligne-voyage .pays { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ciel); margin: 0 0 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.bivio a.ligne-voyage .auteur { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
}

/* Le choix de la langue : un drapeau en haut à droite, la liste des 13 langues dessous. */
header.marque { position: relative; }
header.marque .langues { margin-inline-start: auto; position: relative; z-index: 30; }
header.marque .langues summary { list-style: none; cursor: pointer; font-size: 22px; line-height: 1; padding: 6px 8px;
  border-radius: 10px; font-family: "Twemoji Country Flags", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
header.marque .langues summary::-webkit-details-marker { display: none; }
header.marque .langues summary:hover, header.marque .langues[open] summary { background: rgba(255, 255, 255, .12); }
header.marque .langues ul { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  min-width: 220px; max-height: 70vh; overflow-y: auto; background: var(--surface, #2A4E60); border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
header.marque .langues a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--ink, #fff); text-decoration: none; font: 15px/1.3 var(--sans); }
header.marque .langues a:hover { background: rgba(255, 255, 255, .1); }
header.marque .langues a[aria-current] { font-weight: 600; background: rgba(255, 255, 255, .08); }
header.marque .langues .drapeau { font-size: 20px; font-family: "Twemoji Country Flags", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
@media print { header.marque .langues { display: none; } }

/* Le centre d'aide (src/aide.ts) : l'index en cartes, l'article en colonne de lecture. */
@media screen {
  html.bivio main.aide-page { max-width: 1040px; }
  html.bivio main.aide-page > h1 { margin-top: 28px; }
  html.bivio main.aide-page .chapeau { font-size: 18px; line-height: 1.5; max-width: 62ch; }
  html.bivio ul.aide-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
  html.bivio ul.aide-grille li { display: flex; }
  html.bivio ul.aide-grille a.carte, html.bivio .aide-suite a.carte { flex: 1; display: flex; flex-direction: column; gap: 6px; margin: 0;
    padding: 16px 18px; border-radius: 16px; transition: transform .15s ease, border-color .15s ease; }
  html.bivio ul.aide-grille a.carte:hover, html.bivio .aide-suite a.carte:hover { transform: translateY(-2px); border-color: var(--soleil); }
  html.bivio ul.aide-grille strong, html.bivio .aide-suite strong { font: 600 17px/1.3 var(--sans); color: var(--soleil); }
  html.bivio ul.aide-grille span { color: var(--muted); font-size: 15px; line-height: 1.45; }
  html.bivio .aide-article { max-width: 720px; margin: 0 auto; }
  html.bivio .aide-article .fil { margin: 24px 0 0; font-size: 15px; }
  html.bivio .aide-article .fil a { text-decoration: none; }
  html.bivio .aide-article h1 { font-size: 34px; margin: 12px 0 8px; }
  html.bivio .aide-article .chapeau { font-size: 19px; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--eau-ligne); max-width: none; }
  html.bivio .aide-article > p:not(.fil):not(.chapeau) { font-size: 17px; line-height: 1.65; margin: 0 0 18px; }
  html.bivio .aide-suite { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 40px; }
  html.bivio .aide-suite span { color: var(--muted); font-size: 13px; }
  html.bivio .aide-suite a.apres { text-align: end; }
  html.bivio main.aide-page footer { max-width: 720px; margin-inline: auto; padding-top: 16px; border-top: 1px solid var(--eau-ligne); font-size: 14px; }
  html.bivio main.aide-page > ul.aide-grille + footer { max-width: none; }
  @media (max-width: 560px) {
    html.bivio .aide-article h1 { font-size: 28px; }
    html.bivio .aide-suite { grid-template-columns: 1fr; }
    html.bivio .aide-suite a.apres { text-align: start; }
    html.bivio .aide-suite > span { display: none; }
  }
  /* Les pages de lecture (connecteur, lien d'import) : une colonne, pas toute la largeur de l'écran. */
  html.bivio main.doc { max-width: 820px; }
  html.bivio main.doc header.marque a { display: flex; align-items: center; color: inherit; text-decoration: none; }
}
@media screen and (min-width: 640px) { html.bivio table.outils td:first-child code { white-space: nowrap; } }
/* Un article : le logo s'aligne sur la colonne de lecture. */
@media screen { html.bivio main.aide-page:has(.aide-article) { max-width: 752px; } }
