/* Region and topic hubs: the chapter locator (fly-to map, chapter index,
   Long Arc mini timeline) and the topic dossier. src/features/hubs/atlas.js,
   motion in public/assets/js/hubs-atlas.js. Prefix hx-. */

.hx-loc, .hx-dossier {
  --hx-night: #160C2A;
  --hx-ink: #2A1B45;
  --hx-lilac: #C7B1E5;
  --hx-lilac-soft: #DBCCEE;
  --hx-lilac: #C9B8DE;
}
.hx-anchor { scroll-margin-top: 6rem; }

/* ---------------------------------------------------------- Locator */

.hb-map-inline[data-hx-wrap] { max-width: none; margin: 0; }
.hx-loc {
  position: relative;
  margin: 0 0 var(--s-5);
  padding: clamp(1rem, 2.4vw, 1.6rem);
  border-radius: 6px;
  color: #EDE6F5;
  background:
    radial-gradient(90% 70% at 15% 0%, rgba(110, 66, 166, 0.45), transparent 60%),
    radial-gradient(60% 50% at 100% 100%, rgba(199, 177, 229, 0.12), transparent 70%),
    linear-gradient(160deg, #2A1B45 0%, #1B1030 60%, #140A26 100%);
  box-shadow: inset 0 0 0 1px rgba(219, 204, 238, 0.16), 0 30px 60px -36px rgba(20, 10, 38, 0.8);
  scroll-margin-top: 6rem;
}
.hx-loc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.9rem; }
.hx-loc-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.2rem 1rem; }
.hx-loc-head .hx-h { margin: 0; }

.hx-fig { margin: 0; }
.hx-stage {
  position: relative;
  aspect-ratio: 1.25;
  overflow: hidden;
  border-radius: 4px;
  background: var(--hx-night);
  box-shadow: 0 0 0 1px rgba(219, 204, 238, 0.25), 0 18px 40px -20px rgba(0, 0, 0, 0.9);
}
.hx-loc .hb-map .hm-svg { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; transition: opacity 0.9s ease; }
.hx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transition: opacity 0.9s ease; }
.hx-stage.is-armed .hm-svg { opacity: 0; }
.hx-stage.is-settled .hm-svg { opacity: 1; }
.hx-stage.is-settled .hx-canvas { opacity: 0; }
.hx-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(10, 4, 22, 0.55) 100%);
}

/* The region map in night colours, to match the flight. */
.hx-loc .hm-sea { fill: var(--hx-night); }
.hx-loc .hm-land { fill: #34254F; stroke: #54437A; stroke-width: 0.5px; }
.hx-loc .hm-rel { fill: #6A47A0; stroke: #C9B8DE; stroke-width: 0.8px; }
.hx-loc .hm-pak { fill: var(--hx-lilac); stroke: #EDE7F5; stroke-width: 1px; }
.hx-loc .hm-disputed-base { fill: #997EBD; stroke: var(--hx-lilac); }
.hx-loc .hm-hatch-line { stroke: #F6F3FA; stroke-opacity: 0.7; }
.hx-loc .hm-line { stroke: var(--hx-lilac-soft); }
.hx-loc .hm-label { fill: #E6DDF2; stroke: rgba(22, 12, 42, 0.85); }
.hx-loc .hm-label.is-pak { fill: #2A1B45; stroke: rgba(229, 219, 240, 0.95); }

.hx-pin .hx-dot { fill: #F6F3FA; stroke: #8356BF; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.hx-pin .hx-ring { fill: none; stroke: var(--hx-lilac-soft); stroke-width: 1.5px; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; opacity: 0; }
.hx-stage:not(.is-armed) .hx-ring, .hx-stage.is-settled .hx-ring { animation: hx-ping 3.2s cubic-bezier(.2, .7, .3, 1) infinite; }
.hx-stage .hx-ring-2 { animation-delay: 1.6s !important; }
.hx-loc.is-off .hx-ring { animation-play-state: paused; }
@keyframes hx-ping { 0% { opacity: 0.95; transform: scale(0.35); } 80%, 100% { opacity: 0; transform: scale(1.6); } }

.hx-loc .hb-map figcaption { color: #BDB0D0; }
.hx-loc .hb-key-rel { background: #6A47A0; box-shadow: 0 0 0 1px #C9B8DE; }
.hx-loc .hb-key-pak { background: var(--hx-lilac); }
.hx-loc .hb-key-disp { background: #997EBD; }

.hx-kicker { margin: 0 0 0.35rem; font: 700 0.72rem/1 var(--font); letter-spacing: 0.16em; text-transform: uppercase; color: var(--hx-lilac-soft); }
.hx-h { margin: 0 0 0.6rem; font-family: var(--font-serif); font-weight: 560; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.1; letter-spacing: -0.015em; color: #fff; }
.hx-sum { margin: 0 0 1rem; font-size: 0.86rem; line-height: 1.5; color: #BDB0D0; }

.hx-chapters { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid rgba(219, 204, 238, 0.2); border-bottom: 1px solid rgba(219, 204, 238, 0.2); }
.hx-chapters li + li { border-left: 1px solid rgba(219, 204, 238, 0.2); }
.hx-chapters a {
  display: grid; grid-template-columns: 2rem minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 0.3rem; height: 100%; align-content: start;
  padding: 0.7rem 0.5rem 0.7rem 0.2rem; color: #fff; text-decoration: none;
  transition: background-color 0.25s, padding-left 0.25s;
}
.hx-chapters a:hover, .hx-chapters a:focus-visible { background: linear-gradient(180deg, rgba(199, 177, 229, 0.16), transparent); }
.hx-num { grid-row: 1 / 3; align-self: start; font-family: var(--font-serif); font-style: italic; font-size: 1.25rem; color: var(--hx-lilac); text-align: center; }
.hx-ch { font-family: var(--font-serif); font-size: 1.12rem; font-weight: 500; line-height: 1.2; }
.hx-chapters .hx-meta { font-size: 0.78rem; color: #A99BBE; }

/* Long Arc mini timeline */
.hx-arc { margin-top: clamp(1.1rem, 2.4vw, 1.6rem); padding-top: 1rem; border-top: 1px solid rgba(219, 204, 238, 0.2); }
.hx-arc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 1rem; }
.hx-arc-h { margin: 0; font: 700 0.72rem/1 var(--font); letter-spacing: 0.16em; text-transform: uppercase; color: var(--hx-lilac-soft); }
.hx-arc-sub { margin: 0; font-size: 0.84rem; color: #BDB0D0; }
.hx-axis { position: relative; height: 3.1rem; margin: 0.6rem 0.6rem 0; }
.hx-axis-line { position: absolute; left: 0; right: 0; top: 1.15rem; height: 1px; background: linear-gradient(90deg, rgba(219, 204, 238, 0.15), rgba(219, 204, 238, 0.6), rgba(219, 204, 238, 0.15)); }
.hx-tick { position: absolute; top: 0.9rem; width: 1px; height: 0.55rem; background: rgba(219, 204, 238, 0.4); }
.hx-tick span { position: absolute; top: 0.85rem; left: 50%; transform: translateX(-50%); font-size: 0.66rem; letter-spacing: 0.04em; color: #8F81A6; font-variant-numeric: tabular-nums; }
.hx-ev {
  position: absolute; top: 1.15rem; width: 0.5rem; height: 0.5rem; margin: -0.25rem 0 0 -0.25rem; border-radius: 50%;
  background: var(--c, var(--hx-lilac)); box-shadow: 0 0 0 1.5px #1B1030, 0 0 8px var(--c, var(--hx-lilac));
  opacity: 0.9;
}
.hx-sig-3 { width: 0.75rem; height: 0.75rem; margin: -0.375rem 0 0 -0.375rem; }
.hx-sig-1 { width: 0.36rem; height: 0.36rem; margin: -0.18rem 0 0 -0.18rem; opacity: 0.7; }
.hx-axis.is-empty .hx-axis-line { opacity: 0.4; }
.hx-loc.is-flown .hx-ev { animation: hx-pop 0.5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes hx-pop { from { transform: scale(0); } to { transform: scale(1); } }

.hx-arc-list { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 0.5rem 1rem; }
.hx-arc-list a { display: grid; gap: 0.1rem; padding-left: 0.7rem; border-left: 2px solid var(--c, var(--hx-lilac)); color: #EDE6F5; text-decoration: none; font-size: 0.86rem; line-height: 1.35; }
.hx-arc-list a:hover span { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.hx-arc-list time { font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--hx-lilac-soft); }
.hx-arc-more { margin: 0.9rem 0 0; font-size: 0.86rem; }
.hx-arc-more a, .hx-loc .hb-map figcaption a { color: var(--hx-lilac-soft); }
.hx-arc-more a:hover { color: #fff; }

@media (max-width: 760px) {
  .hx-chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hx-chapters li:nth-child(3) { border-left: 0; }
  .hx-chapters li:nth-child(n+3) { border-top: 1px solid rgba(219, 204, 238, 0.2); }
  .hx-tick:nth-of-type(even) span { display: none; }
}

/* ----------------------------------------------------------- Dossier */

.hx-dossier { margin: 0 0 var(--s-5); scroll-margin-top: 6rem; }
.hx-dossier-head { margin-bottom: 0.9rem; }
.hx-dossier .hx-kicker { color: #825FB1; }
.hx-dossier-h { margin: 0 0 0.3rem; font-family: var(--font-serif); font-weight: 560; font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.1; letter-spacing: -0.015em; color: var(--hx-ink); }
.hx-dossier .hx-sum { color: var(--hb-grey, #6A6672); margin: 0; }

.hx-tabs { display: flex; gap: 0.3rem; padding: 0 0.8rem; overflow-x: auto; scrollbar-width: none; position: relative; z-index: 1; }
.hx-tabs::-webkit-scrollbar { display: none; }
.hx-tab {
  flex: 0 0 auto; display: inline-flex; align-items: baseline; gap: 0.45rem;
  margin-bottom: -1px; padding: 0.7rem 1.1rem 0.6rem;
  border: 1px solid #D2C6E3; border-bottom: 0; border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #E8E1F3, #DED3ED);
  color: #5B407F; font: 600 0.86rem/1 var(--font); cursor: pointer;
  transform: translateY(4px); transition: transform 0.25s, background 0.25s, color 0.25s;
}
.hx-tab:hover { transform: translateY(1px); color: var(--hx-ink); }
.hx-tab[aria-selected="true"] { transform: none; background: #F7F5FB; color: var(--hx-ink); box-shadow: 0 -4px 10px -6px rgba(42, 27, 69, 0.35); }
.hx-tab:focus-visible { outline: 2px solid var(--accent, #6E42A6); outline-offset: 2px; }
.hx-tab-n { font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.45rem; border-radius: 99px; background: rgba(110, 66, 166, 0.12); color: var(--accent-dark, #5A3689); }

.hx-folder {
  position: relative;
  padding: clamp(1rem, 2.4vw, 1.6rem);
  border: 1px solid #D2C6E3;
  border-radius: 4px 10px 10px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 3rem),
    #F7F5FB;
  box-shadow: 0 1px 0 #fff inset, 0 3px 0 -1px #EBE5F4, 0 6px 0 -2px #DED3ED, 0 24px 40px -28px rgba(42, 27, 69, 0.55);
}
.hx-folder::after {
  content: "CUPA"; position: absolute; right: 1.1rem; top: -2.3rem;
  font: 700 0.62rem/1 var(--font); letter-spacing: 0.3em; color: rgba(176, 68, 58, 0.55);
  padding: 0.3rem 0.4rem 0.3rem 0.7rem; border: 1.5px solid rgba(176, 68, 58, 0.45); border-radius: 3px; transform: rotate(4deg);
  pointer-events: none;
}
.hx-panel + .hx-panel { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px dashed #D2C6E3; }
.hx-panel-h { margin: 0 0 0.8rem; font-family: var(--font-serif); font-weight: 560; font-size: 1.25rem; color: var(--hx-ink); }
.hx-panel-n { font: 600 0.78rem/1 var(--font); color: #825FB1; }
.hx-tabbed .hx-panel + .hx-panel { margin-top: 0; padding-top: 0; border-top: 0; }
.hx-tabbed .hx-panel-h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hx-tabbed .hx-panel[hidden] { display: none; }
.hx-tabbed .hx-panel.is-in { animation: hx-sheet 0.45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes hx-sheet { from { opacity: 0; transform: translateY(8px) rotate(-0.4deg); } to { opacity: 1; transform: none; } }

.hx-docs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 0.8rem; }
.hx-docs li { padding: 0.8rem 0.9rem; background: #fff; border-radius: 2px; box-shadow: 0 1px 0 rgba(130, 95, 177, 0.25), 0 6px 12px -10px rgba(42, 27, 69, 0.5); border-top: 3px solid var(--accent, #6E42A6); }
.hx-eyebrow { margin: 0 0 0.3rem; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #825FB1; }
.hx-t { margin: 0 0 0.3rem; font-size: 1rem; line-height: 1.3; font-weight: 600; }
.hx-t.hx-serif { font-family: var(--font-serif); font-weight: 500; font-size: 1.1rem; }
.hx-t a, .hx-term a { color: var(--hx-ink); text-decoration: none; }
.hx-t a:hover, .hx-term a:hover { color: var(--accent-dark, #5A3689); text-decoration: underline; text-underline-offset: 3px; }
.hx-meta { margin: 0; font-size: 0.82rem; color: #6A6672; line-height: 1.45; }
.hx-dossier .hx-meta { color: #6A6672; }
.hx-terms { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 0.8rem; }
.hx-terms li {
  padding: 0.8rem 0.9rem; border-radius: 2px;
  background: linear-gradient(180deg, transparent 2.3rem, rgba(176, 68, 58, 0.3) 2.3rem 2.36rem, transparent 2.36rem), #fff;
  box-shadow: 0 1px 0 rgba(130, 95, 177, 0.25), 0 6px 12px -10px rgba(42, 27, 69, 0.5);
}
.hx-term { margin: 0 0 0.6rem; font-family: var(--font-serif); font-size: 1.08rem; font-weight: 560; }
.hx-terms p { margin: 0; font-size: 0.84rem; line-height: 1.45; color: #4A4552; }
.hx-none { margin: 0; padding: 1rem; border: 1px dashed #D2C6E3; border-radius: 3px; color: #6A6672; font-size: 0.9rem; background: rgba(255, 255, 255, 0.5); }
.hx-panel-more { margin: 0.9rem 0 0; font-size: 0.88rem; font-weight: 600; }
.hx-panel-more a { color: var(--accent-dark, #5A3689); }

@media (max-width: 760px) { .hx-folder::after { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .hx-ring, .hx-stage .hx-ring { animation: none !important; opacity: 0.6; transform: scale(1); }
  .hx-loc.is-flown .hx-ev, .hx-tabbed .hx-panel.is-in { animation: none; }
  .hx-tab, .hx-chapters a, .hm-svg, .hx-canvas { transition: none; }
}
@media print {
  .hx-loc { background: none; color: #000; box-shadow: none; }
  .hx-tabs { display: none; }
}
