/* Page « Le monde » (univers.html) : la carte et ses fils, les quatre manières de savoir, l’envoi vers la chronique.
   Propriété de l’agent de la page. Socle commun : monde.css (en-tête .m-hero, .sec-head, .chips, .lnk, ornement). */

/* =================================================
   LA CARTE — la carte se perd dans la nuit ; la fiche du pays se pose à côté, sur un filet d’or
   ================================================= */
.un-atlas { padding: 0 var(--gutter) clamp(72px, 9vw, 130px); background: radial-gradient(75% 55% at 40% 46%, #1a1713 0%, var(--night) 72%); overflow-x: clip; scroll-margin-top: var(--header-h); }
.un-atlas .sec-head { padding: clamp(40px, 5vw, 72px) 0 clamp(22px, 2.6vw, 38px); }
.un-threads { max-width: var(--maxw); margin: 0 auto clamp(18px, 2.4vw, 30px); justify-content: center; }
.un-map-wrap { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: clamp(28px, 3.2vw, 56px); align-items: start; scroll-margin-top: calc(var(--header-h) + 20px); }

/* La carte : pas de cadre, ses bords (table, parchemin déchiré) se fondent dans le fond */
.un-map { position: relative; }
.un-map > img, .un-map > .art-reserve { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%), linear-gradient(180deg, transparent 0, #000 7%, #000 93%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%), linear-gradient(180deg, transparent 0, #000 7%, #000 93%, transparent 100%);
  mask-composite: intersect; }

/* Les fils, tracés par univers.js à la taille réelle de la carte (en pixels) */
.un-thread-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
.un-route path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.un-route-halo { stroke: rgba(9, 8, 7, .72); stroke-width: 6.5; }
.un-route-ink { stroke: #f3cf93; stroke-width: 2.4; stroke-dasharray: 10 7; }
.un-route.is-star .un-route-halo { stroke-width: 7.5; stroke-dasharray: 0 10; }
.un-route.is-star .un-route-ink { stroke-width: 3.2; stroke-dasharray: 0 10; }
.un-route.is-closed .un-route-ink { stroke-dasharray: 3 6; opacity: .85; }
.un-route-x { stroke: #f3cf93; stroke-width: 2.6; }
.un-route-draw { fill: none; stroke: #fff; stroke-width: 24; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: un-draw 1.7s cubic-bezier(.45, .05, .3, 1) forwards; }
@keyframes un-draw { to { stroke-dashoffset: 0; } }

/* Les repères : le losange est exactement sur le lieu, le nom se pose à côté */
.un-pin { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; overflow: visible; z-index: 2; transition: opacity .35s; }
.un-pin::before { content: ""; position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; transform: rotate(45deg); background: #f5e6c6; border: 2px solid var(--gold-dark); box-shadow: 0 0 0 4px rgba(13, 14, 15, .42), 0 3px 10px rgba(0, 0, 0, .55); transition: transform .2s, background-color .2s, box-shadow .2s; }
.un-pin::after { content: ""; position: absolute; left: -20px; top: -20px; width: 40px; height: 40px; border-radius: 50%; }
.un-pin span { position: absolute; left: 15px; top: 0; transform: translateY(-54%); font-family: var(--font-tale); font-size: clamp(16px, 1.3vw, 19px); line-height: 1.1; color: #f8efdc; text-shadow: 0 1px 2px #000, 0 0 10px rgba(0, 0, 0, .95), 0 0 22px rgba(0, 0, 0, .6); white-space: nowrap; transition: color .2s, opacity .3s; }
.un-pin--left span { left: auto; right: 15px; }
.un-pin--home::before { left: -8px; top: -8px; width: 16px; height: 16px; background: var(--gold); border-color: #fff1d2; box-shadow: 0 0 0 5px rgba(13, 14, 15, .42), 0 0 18px rgba(224, 189, 130, .45); }
.un-pin--home span { left: 19px; font-size: clamp(17px, 1.45vw, 21px); }
.un-pin:hover::before, .un-pin.is-on::before { transform: rotate(45deg) scale(1.3); background: var(--gold-light); }
.un-pin:hover span, .un-pin.is-on span { color: #ffdcab; }
.un-pin:focus-visible { outline: none; }
.un-pin:focus-visible::before { box-shadow: 0 0 0 3px var(--night), 0 0 0 4px var(--gold-light); }
.un-map.has-thread .un-pin:not(.in-thread):not(.is-on) { opacity: .32; }
.un-chips { display: none; margin-top: 16px; justify-content: center; }

/* La fiche : pas de boîte, un filet d’or vertical, le texte sur la nuit */
.un-panel { position: sticky; top: calc(var(--header-h) + 28px); padding: 4px 0 8px clamp(26px, 2.6vw, 40px); scroll-margin-top: calc(var(--header-h) + 12px); }
.un-panel::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: linear-gradient(180deg, rgba(196, 154, 92, 0) 0%, var(--gold) 16%, rgba(196, 154, 92, .45) 70%, rgba(196, 154, 92, 0) 100%); }
.js .un-info:not(.is-on) { display: none; }
/* Arrivée par une ancre (#rives…) : le navigateur descend aussi à la fiche ; elle s’arrête sous l’en-tête, à hauteur de la carte */
.un-info { scroll-margin-top: calc(var(--header-h) + 24px); }
.un-info.is-on { animation: un-in .6s ease both; }
@keyframes un-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.un-info + .un-info { margin-top: 40px; }
.js .un-info + .un-info { margin-top: 0; }
.un-info .eyebrow { margin-bottom: 12px; font-size: 11px; letter-spacing: .28em; }
.un-info h3 { font-size: clamp(34px, 2.8vw, 44px); line-height: 1.02; margin-bottom: 18px; }
.un-info p { font-size: 19px; line-height: 1.62; margin-bottom: 14px; color: var(--body); }
.un-info dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px 16px; margin: 22px 0 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); font-size: 17px; line-height: 1.45; }
.un-info dt { font-family: var(--font-display); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); padding-top: 4px; white-space: nowrap; }
.un-info dd { margin: 0; color: var(--cream-2); }
.un-info a:not(.lnk) { color: var(--gold-light); border-bottom: 1px solid var(--line); transition: color .2s, border-color .2s; }
.un-info a:not(.lnk):hover { color: #fff3dc; border-color: var(--gold-light); }
.un-info .lnk { margin-top: 6px; }
/* Fiche d’un fil : une phrase de rappel et un lien ; le trait dessiné sur la carte sert de légende */
.un-info--thread .eyebrow { display: flex; align-items: center; gap: 12px; color: #f3cf93; }
.un-info--thread .eyebrow::before { content: ""; flex: none; width: 34px; border-top: 2px dashed currentColor; }
.un-info--thread h3 + p { margin-bottom: 20px; }
.un-key { display: inline-block; width: 26px; margin: 0 .45em; vertical-align: middle; border-top: 2px dashed #f3cf93; }
.un-key--star { border-top: 3px dotted #f3cf93; }

/* =================================================
   QUATRE MANIÈRES DE SAVOIR — une rose des vents, une manière par quartier
   ================================================= */
.un-truths { background: linear-gradient(180deg, var(--night) 0, var(--night-2) 200px, var(--night-2) 72%, var(--night) 100%); padding-bottom: clamp(84px, 10vw, 150px); }
.un-truths .sec-head { padding-bottom: clamp(20px, 2.4vw, 36px); }
.un-rose { position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.un-rose::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: linear-gradient(180deg, transparent 0, var(--line) 24%, var(--line) 76%, transparent 100%); }
.un-rose::after { content: ""; position: absolute; top: 50%; left: var(--gutter); right: var(--gutter); height: 1px; background: linear-gradient(90deg, transparent 0, var(--line) 24%, var(--line) 76%, transparent 100%); }
.un-rose-mark { position: absolute; left: 50%; top: 50%; z-index: 1; width: clamp(112px, 10vw, 144px); height: auto; aspect-ratio: 1; transform: translate(-50%, -50%); color: var(--gold); border-radius: 50%; background: radial-gradient(closest-side, var(--night-2) 74%, rgba(18, 19, 20, 0) 100%); }
.un-rose-hub { fill: var(--night-2); stroke: currentColor; stroke-width: .8; }
.un-truth { padding: clamp(36px, 4.4vw, 62px) clamp(86px, 8.4vw, 124px) clamp(36px, 4.4vw, 62px) 0; text-align: right; }
.un-truth:nth-of-type(even) { padding-left: clamp(86px, 8.4vw, 124px); padding-right: 0; text-align: left; }
.un-truth .un-truth-k { font-style: italic; font-size: clamp(25px, 2.1vw, 31px); line-height: 1.12; color: var(--gold-light); margin-bottom: 12px; }
.un-truth p { max-width: 27em; margin-left: auto; font-size: 19px; line-height: 1.62; color: var(--body); }
.un-truth:nth-of-type(even) p { margin-left: 0; }

/* L’envoi : une phrase, la chronique, et le chemin du retour vers la carte */
.un-coda { max-width: 780px; margin: clamp(64px, 8vw, 116px) auto 0; padding: 0 var(--gutter); text-align: center; }
.un-coda .ornament { margin-bottom: 28px; }
.un-coda-line { font-family: var(--font-tale); font-style: italic; font-size: clamp(23px, 2.1vw, 30px); line-height: 1.38; color: var(--tale); margin-bottom: 30px; text-wrap: balance; }
.un-coda-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 18px 30px; }
.un-coda .btn { padding: 13px 24px; }
.un-coda .lnk { margin-right: 0; }

@media (prefers-reduced-motion: reduce) {
  .un-info.is-on { animation: none; }
  .un-route-draw { animation: none; stroke-dashoffset: 0; }
}

/* =================================================
   Écrans moyens et petits
   ================================================= */
@media (max-width: 1180px) {
  .un-map-wrap { grid-template-columns: 1fr; gap: 0; }
  .un-panel { position: relative; top: auto; max-width: 720px; width: 100%; margin: clamp(28px, 4vw, 44px) auto 0; padding: 28px 0 0; }
  .un-panel::before { top: 0; bottom: auto; left: 0; right: 0; width: auto; height: 1px; background: linear-gradient(90deg, rgba(196, 154, 92, 0), var(--gold) 22%, var(--gold) 78%, rgba(196, 154, 92, 0)); opacity: .6; }
}
@media (max-width: 760px) {
  .un-rose { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .un-rose::before, .un-rose::after { display: none; }
  .un-rose-mark { position: relative; left: auto; top: auto; width: 92px; margin: 0 auto 8px; transform: none; }
  .un-truth, .un-truth:nth-of-type(even) { padding: 24px 0; text-align: left; border-top: 1px solid var(--line-soft); }
  .un-truth:first-of-type { border-top: 0; }
  .un-truth p { max-width: none; margin-left: 0; }
}
@media (max-width: 640px) {
  /* Sur téléphone, seul le nom du pays choisi s’affiche, au-dessus de son repère ; la liste des pays est sous la carte */
  .un-pin span { opacity: 0; pointer-events: none; }
  .un-pin.is-on span { opacity: 1; left: 50%; right: auto; top: -14px; transform: translate(-50%, -100%); font-size: 16px; }
  .un-pin--left.is-on span { left: auto; right: -10px; transform: translateY(-100%); }
  .un-chips { display: flex; }
  .un-info h3 { font-size: 34px; }
  .un-info p { font-size: 18px; }
  .un-info dl { grid-template-columns: 1fr; gap: 2px; }
  .un-info dt { padding-top: 10px; }
  .un-truth p { font-size: 18px; }
}
