/* Both editions are opt-in and scoped. Nothing here styles the approved atlas. */
.crg-terrain-atlas {
  --atlas-paper: var(--crg-theme-paper, oklch(98% .005 244));
  --atlas-ink: var(--crg-theme-ink, oklch(24% .035 250));
  --atlas-muted: var(--crg-theme-muted, oklch(43% .03 244));
  --atlas-line: oklch(84% .018 244);
  --atlas-accent: oklch(45% .08 50);
  --atlas-map-height: clamp(390px, calc(100svh - 450px), 620px);
  background: var(--atlas-paper); color: var(--atlas-ink);
  padding-block: clamp(38px, 5vw, 68px); overflow: clip;
  font-family: Lato, Arial, sans-serif;
}
.crg-terrain-atlas [hidden] { display: none !important; }
.crg-terrain-atlas * { box-sizing: border-box; }
.crg-terrain-atlas .crg-wrap { max-width: 1480px; }
.crg-terrain-atlas button, .crg-terrain-atlas a { -webkit-tap-highlight-color: transparent; }
.crg-terrain-atlas button {
  color: var(--atlas-ink); background: var(--atlas-paper); border: 1px solid var(--atlas-line);
  border-radius: 3px; min-width: 44px; min-height: 44px; padding: 10px 14px;
  font: 700 14px/1.3 Lato, Arial, sans-serif; cursor: pointer;
  box-shadow: none; text-transform: none; letter-spacing: normal;
}
.crg-terrain-atlas button:hover { background: oklch(93% .02 244); color: var(--atlas-ink); }
.crg-terrain-atlas button[aria-pressed="true"] { background: var(--atlas-ink); color: var(--atlas-paper); border-color: var(--atlas-ink); }
.crg-terrain-atlas button:disabled { cursor: not-allowed; opacity: .5; }
.crg-terrain-atlas :is(a, button, summary, [tabindex]):focus-visible { outline: 3px solid oklch(51% .14 240); outline-offset: 4px; }
.crg-terrain-atlas a { color: var(--atlas-ink); }
.crg-terrain-atlas a:hover { color: var(--atlas-accent); }
.crg-terrain-atlas__edition { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; font-size: 14px; }
.crg-terrain-atlas__edition > span { color: var(--atlas-muted); }
.crg-terrain-atlas__edition nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.crg-terrain-atlas__edition a { display: flex; align-items: center; min-height: 44px; text-decoration: none; border-bottom: 2px solid transparent; }
.crg-terrain-atlas__edition a[aria-current] { border-color: var(--atlas-accent); font-weight: 800; }
.crg-terrain-atlas__heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 30px; }
.crg-terrain-atlas__heading h2 { margin: 0 0 12px; max-width: 900px; font-size: clamp(29px, 3.15vw, 46px); font-weight: 700; line-height: 1.08; letter-spacing: -.035em; color: inherit; scroll-margin-top: 210px; }
.crg-terrain-atlas__heading p { margin: 0; max-width: 78ch; color: var(--atlas-muted); font-size: 17px; line-height: 1.5; }
.crg-terrain-atlas__heading > button { flex: 0 0 auto; display: flex; gap: 20px; align-items: center; }
.crg-terrain-atlas .crg-terrain-atlas__heading h2 { scroll-margin-top: 40px; }
.crg-terrain-atlas__workspace { position: relative; display: grid; grid-template-columns: clamp(140px, 13vw, 190px) minmax(0, 1fr) minmax(300px, .55fr); gap: clamp(18px, 2vw, 30px); }
.crg-terrain-atlas__workspace:not(:has(.crg-terrain-atlas__locator:not([hidden]))) { grid-template-columns: minmax(0, 1fr) minmax(300px, .43fr); }
.crg-terrain-atlas__map-shell { position: relative; isolation: isolate; height: var(--atlas-map-height); background: oklch(92% .018 240); overflow: hidden; }
.crg-terrain-atlas .crg-terrain-atlas__map { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; background: oklch(92% .018 240); }
body.crg-site .crg-terrain-atlas__map img { max-width: none; border-radius: 0; outline: 0; border: 0; box-shadow: none; }
body.crg-site .crg-terrain-atlas__locator img { outline: 0; }
.crg-terrain-atlas__static { width: 100%; height: 100%; object-fit: contain; padding: 25px; }
.crg-terrain-atlas__map-top { position: absolute; z-index: 3; inset: 18px 18px auto; display: flex; align-items: start; justify-content: flex-end; pointer-events: none; gap: 8px; }
.crg-terrain-atlas__map-top button { pointer-events: auto; }
.crg-terrain-atlas__map-top > button { display: flex; gap: 6px; align-items: center; }
[data-terrain-compass] { display: inline-block; font-size: 22px; }
.crg-terrain-atlas__map-modes { display: flex; gap: 6px; }
.crg-terrain-atlas__zoom { position: absolute; bottom: 48px; left: 18px; z-index: 3; display: flex; flex-direction: column; gap: 6px; }
.crg-terrain-atlas__zoom button { font-size: 22px; width: 44px; padding: 6px; }
.crg-terrain-atlas__status { position: absolute; left: 80px; right: 18px; bottom: 48px; z-index: 3; width: fit-content; max-width: calc(100% - 100px); padding: 8px 12px; background: var(--atlas-paper); color: var(--atlas-ink); font-size: 13px; line-height: 1.4; pointer-events: none; }
.crg-terrain-atlas__status:empty { display: none; }
.crg-terrain-atlas__retry { position: absolute; top: 78px; left: 18px; z-index: 4; }
.crg-terrain-atlas__details { display: flex; flex-direction: column; min-width: 0; height: var(--atlas-map-height); }
.crg-terrain-atlas__details article { min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--atlas-line) transparent; flex: 1; }
.crg-terrain-atlas__details figure { margin: 0; position: relative; height: clamp(140px, calc((100svh - 450px) * .34), 210px); overflow: hidden; }
.crg-terrain-atlas__details figure img { height: 100%; width: 100%; display: block; object-fit: cover; }
.crg-terrain-atlas__details figcaption { position: absolute; bottom: 0; left: 0; right: 0; padding: 8px 12px; color: oklch(98% .005 244); background: oklch(23% .045 250 / .92); font-size: 12px; line-height: 1.35; }
.crg-terrain-atlas__story { padding: 23px 2px 12px; }
.crg-terrain-atlas__story .crg-terrain-atlas__region { margin: 0 0 10px; color: var(--atlas-muted); font-size: 13px; line-height: 1.4; font-weight: 700; }
.crg-terrain-atlas__story h3 { font-size: clamp(25px, 2.1vw, 32px); line-height: 1.12; font-weight: 700; letter-spacing: -.025em; color: inherit; margin: 0 0 15px; }
.crg-terrain-atlas__story > p { margin: 0 0 18px; font-size: 16px; line-height: 1.6; color: var(--atlas-ink); }
.crg-terrain-atlas__story .crg-evidence-link { display: inline-flex; gap: 12px; padding-block: 7px; min-height: 44px; color: var(--atlas-ink); border-bottom: 1px solid var(--atlas-accent); text-decoration: none; font-size: 15px; line-height: 1.45; }
.crg-terrain-atlas__story .crg-evidence-link:is(:hover, :focus-visible) { color: var(--atlas-accent) !important; }
.crg-terrain-atlas__detail-footer { display: flex; justify-content: space-between; align-items: end; flex: 0 0 66px; padding-top: 10px; }
.crg-terrain-atlas__steps { display: flex; gap: 8px; }
.crg-terrain-atlas .crg-terrain-atlas__locator { position: relative; align-self: start; display: grid; place-items: start center; width: 100%; height: var(--atlas-map-height); padding: 0; border: 0; background: transparent; }
.crg-terrain-atlas__locator-frame { position: relative; display: block; height: auto; width: min(100%, calc(var(--atlas-map-height) * 230 / 860)); aspect-ratio: 230 / 860; }
.crg-terrain-atlas__locator picture { display: block; width: 100%; height: 100%; }
.crg-terrain-atlas__locator img { display: block; width: 100%; height: 100%; object-fit: contain; }
.crg-terrain-atlas__locator [data-terrain-locator-dot] { position: absolute; left: var(--locator-tall-x); top: var(--locator-tall-y); width: 10px; height: 10px; background: var(--atlas-accent); border: 2px solid var(--atlas-paper); border-radius: 50%; transform: translate(-50%, -50%); }
.crg-terrain-atlas__places { display: flex; gap: 0 clamp(16px, 2.2vw, 36px); margin-top: 23px; border-bottom: 1px solid var(--atlas-line); overflow-x: auto; scrollbar-width: thin; padding: 4px; }
.crg-terrain-atlas__places a { position: relative; flex: 0 0 auto; min-height: 52px; display: flex; align-items: center; text-decoration: none; font-size: 15px; line-height: 1.3; white-space: nowrap; border-bottom: 3px solid transparent; }
.crg-terrain-atlas__places a[aria-current] { border-color: var(--atlas-accent); font-weight: 800; }
.crg-terrain-atlas__notes { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 28px; color: var(--atlas-muted); font-size: 12px; line-height: 1.5; padding-top: 12px; }
.crg-terrain-atlas__notes p { margin: 0; }
.crg-terrain-atlas__notes details { flex: 0 1 380px; }
.crg-terrain-atlas__notes summary { cursor: pointer; min-height: 44px; padding: 8px 0; text-align: right; }
.crg-terrain-atlas__notes details p { padding-top: 10px; }
.crg-terrain-atlas__relief-note { color: var(--atlas-muted); font-size: 12px; line-height: 1.5; margin: 0; }
.crg-terrain-atlas[data-renderer="leaflet"] .crg-terrain-atlas__relief-note { display: none; }
.crg-terrain-atlas .leaflet-container { font-family: Lato, Arial, sans-serif; }
.crg-terrain-atlas :is(.leaflet-control-attribution, .maplibregl-ctrl-attrib) { background: oklch(98% .005 244 / .95); color: oklch(26% .03 244); font: 10px/1.35 Lato, Arial, sans-serif; max-width: 100%; padding: 3px 6px; }
.crg-terrain-atlas :is(.leaflet-control-attribution, .maplibregl-ctrl-attrib) a { color: oklch(26% .03 244); text-decoration: underline; }
.crg-terrain-atlas .leaflet-control-attribution { max-width: 440px; }
.crg-terrain-atlas .leaflet-control-container .leaflet-bottom { max-width: calc(100% - 6px); }
.crg-terrain-atlas__credits { position: absolute; bottom: 0; right: 0; z-index: 4; max-width: min(420px, 100%); color: oklch(26% .03 244); background: oklch(98% .005 244 / .96); font: 12px/1.5 Lato, Arial, sans-serif; }
.crg-terrain-atlas__credits summary { min-height: 44px; padding: 13px 12px; cursor: pointer; }
.crg-terrain-atlas__credits p { padding: 0 12px 12px; margin: 0; }
.crg-terrain-atlas__credits a { color: inherit; text-decoration: underline; }
.crg-terrain-atlas__pin { background: transparent !important; border: 0 !important; width: 44px; height: 44px; padding: 0 !important; color: var(--atlas-ink); cursor: pointer; position: relative; }
.crg-terrain-atlas__pin-core { display: block; position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; border-radius: 50%; background: oklch(26% .04 244); border: 3px solid oklch(98% .005 244); box-shadow: 0 1px 5px oklch(20% .02 244 / .45); }
.crg-terrain-atlas__pin[aria-pressed="true"] .crg-terrain-atlas__pin-core { background: oklch(48% .095 50); }
.crg-terrain-atlas__pin[aria-pressed="true"] .crg-terrain-atlas__pin-core::after { content: ''; position: absolute; inset: -7px; border: 1px solid oklch(98% .005 244); border-radius: 50%; animation: crg-terrain-breathe 3.6s ease-out infinite; }
.crg-terrain-atlas__pin-label { position: absolute; left: 38px; top: 8px; padding: 5px 9px; border-radius: 2px; white-space: nowrap; background: oklch(98% .005 244 / .96); color: oklch(22% .03 244); font: 700 13px/1.3 Lato, Arial, sans-serif; display: none; pointer-events: none; }
.crg-terrain-atlas__pin:is([aria-pressed="true"], :hover, :focus-visible) .crg-terrain-atlas__pin-label { display: block; }
@keyframes crg-terrain-breathe { 0%, 100% { transform: scale(.92); opacity: .65; } 55% { transform: scale(1.35); opacity: .12; } }
.crg-terrain-atlas.is-expanded { --atlas-map-height: 73svh; }
.crg-terrain-atlas:fullscreen { overflow-y: auto; padding: 18px 0; }
.crg-terrain-atlas:fullscreen .crg-terrain-atlas__edition { margin-bottom: 8px; }
.crg-terrain-atlas:fullscreen .crg-terrain-atlas__heading { margin-bottom: 16px; }
.crg-terrain-atlas:fullscreen .crg-terrain-atlas__heading h2 { font-size: 28px; }
.crg-terrain-atlas:fullscreen .crg-terrain-atlas__heading p { display: none; }
html[data-crg-motion="reduce"] .crg-terrain-atlas *, .crg-reduced-motion .crg-terrain-atlas *, .crg-terrain-atlas.is-paused *, .crg-terrain-atlas.is-paused *::after { animation: none !important; transition: none !important; }
html[data-crg-contrast="high"] .crg-terrain-atlas, html[data-crg-contrast="inverse"] .crg-terrain-atlas { --atlas-paper: var(--crg-paper); --atlas-ink: var(--crg-ink); --atlas-muted: var(--crg-ink); --atlas-accent: var(--crg-ink); --atlas-line: var(--crg-ink); }
@media (prefers-reduced-motion: reduce) { .crg-terrain-atlas *, .crg-terrain-atlas *::after { animation: none !important; transition: none !important; } }
@media (max-width: 1000px) {
  .crg-terrain-atlas__workspace { grid-template-columns: 110px minmax(0, 1fr) minmax(250px, .65fr); gap: 18px; }
  .crg-terrain-atlas__map-top { flex-wrap: wrap; }
  .crg-terrain-atlas__heading { align-items: start; }
  .crg-terrain-atlas__heading h2 { font-size: 34px; }
}
@media (max-width: 720px) {
  .crg-terrain-atlas { padding-block: 30px; --atlas-map-height: clamp(340px, 46svh, 420px); }
  .crg-terrain-atlas .crg-wrap { width: calc(100% - 32px); }
  .crg-terrain-atlas__edition { margin-bottom: 22px; display: block; }
  .crg-terrain-atlas__edition > span { display: none; }
  .crg-terrain-atlas__edition nav { gap: 12px; }
  .crg-terrain-atlas__edition a { font-size: 13px; }
  .crg-terrain-atlas__heading { display: block; margin-bottom: 20px; }
  .crg-terrain-atlas__heading h2 { font-size: 30px; scroll-margin-top: 160px; }
  .crg-terrain-atlas__heading p { font-size: 15px; }
  .crg-terrain-atlas__heading > button { margin-top: 16px; }
  .crg-terrain-atlas__workspace { display: flex; flex-direction: column; gap: 20px; }
  .crg-terrain-atlas .crg-terrain-atlas__locator { position: absolute; top: 72px; left: 12px; z-index: 5; width: 88px; height: auto; aspect-ratio: 520 / 760; background: var(--atlas-paper); border: 1px solid var(--atlas-line); }
  .crg-terrain-atlas__locator-frame { width: 100%; aspect-ratio: 520 / 760; }
  .crg-terrain-atlas__locator [data-terrain-locator-dot] { left: var(--locator-compact-x); top: var(--locator-compact-y); }
  .crg-terrain-atlas__map-shell { flex: 0 0 var(--atlas-map-height); }
  .crg-terrain-atlas__details { height: 510px; }
  .crg-terrain-atlas__details figure { height: 180px; }
  .crg-terrain-atlas__details article { flex: 1; }
  .crg-terrain-atlas__story { padding-top: 18px; }
  .crg-terrain-atlas__story h3 { font-size: 27px; }
  .crg-terrain-atlas__story > p { font-size: 15px; }
  .crg-terrain-atlas__map-top { inset: 12px 12px auto; }
  .crg-terrain-atlas__zoom { left: auto; right: 12px; bottom: 64px; }
  .crg-terrain-atlas__status { left: 12px; right: 66px; bottom: 65px; max-width: calc(100% - 78px); font-size: 12px; }
  .crg-terrain-atlas__places { gap: 20px; margin-top: 8px; }
  .crg-terrain-atlas__notes { display: block; }
  .crg-terrain-atlas__notes summary { text-align: left; }
  .crg-terrain-atlas.is-expanded { --atlas-map-height: 65svh; }
}
@media (forced-colors: active) {
  .crg-terrain-atlas { --atlas-paper: Canvas; --atlas-ink: CanvasText; --atlas-muted: CanvasText; --atlas-accent: Highlight; --atlas-line: CanvasText; }
  .crg-terrain-atlas__pin-core { forced-color-adjust: none; }
  .crg-terrain-atlas__places a[aria-current] { border-bottom-color: Highlight; }
}
