/* ARCHE layout standard: the single source of truth for page width, gutters, type scale and vertical rhythm.
   Loaded last by Base.astro on every page, so the older per-page sheets (atlas.css, country-profile.css, country-profile-app.css, ...)
   keep their component styling but no longer decide widths, heading sizes or section spacing. !important is used on purpose
   for the handful of properties this file owns. To change the look of every page at once, change a token here. */
:root{
  --content:1200px;                       /* one content width for every page */
  --gutter:clamp(16px,4vw,24px);          /* one side margin for every page */
  --fs-h1:clamp(36px,4.4vw,60px);         /* page title (also the image heroes) */
  --fs-h2:clamp(26px,3vw,40px);           /* section title */
  --fs-h3:22px;                           /* card / panel title */
  --fs-lead:18px;
  --fs-eyebrow:11px;
  --section-pad:clamp(48px,6vw,72px);     /* vertical space of a plain section */
  --card-pad:28px;                        /* padding of a card, panel or chapter */
  --card-gap:24px;                        /* space between stacked cards */
}

/* ---- shell: same width and same left edge everywhere ---- */
.container,.wrap,.arche-site-nav__inner{width:min(100% - 2 * var(--gutter),var(--content))!important;max-width:none!important;margin-inline:auto!important;padding-inline:0!important}
.status-bar .container,footer .container{padding-block:8px}
footer .container{padding-block:24px}
main.wrap{padding-bottom:var(--section-pad)!important}

/* heroes with an image: the text and the record card sit on the same edges as the page content */
.arche-place-hero{max-width:none!important}
.arche-place-hero .arche-place-hero__content{margin-left:max(var(--gutter),calc((100% - var(--content)) / 2))!important;padding-inline:0!important;max-width:min(680px,calc(100% - 2 * var(--gutter)))!important}
.arche-place-hero .arche-place-hero__registry{right:max(var(--gutter),calc((100% - var(--content)) / 2))!important}

/* ---- type scale ---- */
h1,.hero h1,.cp-hero h1,.entity-hero h1,.directory-head h1,.preview-hero h1,.arche-place-hero h1{font-size:var(--fs-h1)!important;line-height:1.02!important;letter-spacing:-.045em!important;font-weight:700!important;font-family:inherit!important;margin:0 0 .35em!important}
h2,.section-head h2,.cp-chapter h2,.arche-signature h2,.arche-sig2__block h2,.about-h{font-size:var(--fs-h2)!important;line-height:1.1!important;letter-spacing:-.035em!important;font-weight:700!important;font-family:inherit!important;margin:0 0 .3em!important}
/* card-level titles */
.panel h2,.cp-panel h2,.preview-card h2,.about-card h2,.entity-neighbours h2,details h2,.dir-modern h2,.arche-place-hero__registry h2{font-size:var(--fs-h3)!important;line-height:1.2!important;letter-spacing:-.02em!important}
.lead,.hero .lead,.cp-hero .lead,.entity-hero .lead,.section-head .lead,.hero-copy .lead{font-size:var(--fs-lead)!important;line-height:1.55!important;max-width:70ch!important;margin:12px 0 0!important}
.eyebrow,.cp-kicker,.arche-signature__kicker,.arche-sig2__kicker{font-size:var(--ds-fs-label)!important;letter-spacing:.14em!important;font-weight:800!important;margin:0 0 10px!important}

/* h3: one card title for every page (the editorial serif titles of Method and Histories included) */
main h3:not(.sd h3){font-size:var(--ds-fs-h3)!important;line-height:1.25!important;letter-spacing:-.015em!important;font-weight:700!important;font-family:inherit!important;margin:0 0 .35em!important}

/* body text: prose is 15px, small print (sources, credits, legends) is 12px, everywhere */
main p,main li{font-size:var(--ds-fs-body)}
.method-card p,.story-card p,.story-detail p,.arche-sig2__lead,.arche-sig2__caption,.cp-note,.cp-fm-meta,.cp-fm-hint,.cp-evidence-context,.cp-scope__note,.notice,.dir-notes,.about-card p,.hd-note,.macro-note{font-size:var(--ds-fs-body)!important;line-height:1.55!important}
.cp-source,.dir-credits,.entity-research-map__source,.arche-sig2__src,.sd__refs,.hd-source,.macro-source,.hs-source,.xp-foot p,.hd-keyline,.macro-facts-note{font-size:var(--ds-fs-caption)!important;line-height:1.5!important}

/* ---- vertical rhythm ---- */
.section{padding-block:var(--section-pad)!important}
.section-head{margin-bottom:28px!important}
.cp-chapter,.panel,.cp-panel,.arche-signature,.preview-card{padding:var(--card-pad)!important;margin-block:0 var(--card-gap)!important}
.preview-main .preview-hero,.directory-head,.hero,.entity-hero,.cp-hero{padding:var(--section-pad) 0 32px!important}

/* ---- small screens ---- */
@media(max-width:640px){
  :root{--card-pad:18px;--card-gap:16px}
  .section-head{display:block!important}
}

/* ---- shared alpha notice and footer ---- */
.alpha-bar{background:#e5f1ee;color:#24565b;font-size:var(--ds-fs-caption);border-top:1px solid var(--ds-line);margin-top:0}
.alpha-bar .container{display:flex;gap:10px;align-items:flex-start;padding-block:10px!important}
.alpha-bar strong{letter-spacing:.1em;font-size:var(--ds-fs-label);white-space:nowrap;padding-top:2px}
@media(max-width:610px){.alpha-bar .container{display:block}.alpha-bar strong{display:block;white-space:normal;margin-bottom:5px}.alpha-bar span{display:block}}
.about-goals{max-width:none!important}
footer,.footer{background:#071c27!important;color:#c3d4d6!important;padding:32px 0!important;font-size:var(--ds-fs-caption)!important;border:0!important;margin:0!important}
footer .container,footer .wrap,.footer .wrap{display:flex!important;justify-content:space-between;gap:25px;flex-wrap:wrap}
footer p,.footer p{margin:0!important;max-width:760px;font-size:var(--ds-fs-caption)!important;line-height:1.55!important;color:#c3d4d6!important}
footer a,.footer a{color:#9fd2dc!important}
select,input[type=search]{max-width:100%}
/* ---- first block under the menu: no rule, little space ---- */
main > .section:first-child,main > section.section:first-of-type{border-top:0!important;padding-top:32px!important}
.preview-main .preview-hero,.directory-head,.hero,.entity-hero,.cp-hero,.xp-top{padding-top:32px!important}
.arche-place-hero{margin-bottom:var(--card-gap)!important}
/* the 'loading the atlas' placeholder above the first section must not add space */
main > .container:has(> #atlas-loading){padding:0!important;margin:0!important}
#atlas-loading{padding:0!important;margin:0!important}
#atlas-loading[hidden]{display:none}
/* the last block of every page leaves exactly one section gap before the alpha notice */
main.wrap > :last-child{margin-bottom:0!important}
main.wrap{padding-bottom:var(--section-pad)!important}

/* ---- square corners everywhere (photos, cards, panels, charts, buttons). Only true circles stay round: the logo mark and data dots. ---- */
*,*::before,*::after{border-radius:0!important}
.brand-mark,.macro-dot,.hd-dot,.cp-fm-dot{border-radius:50%!important}
svg rect{rx:0!important;ry:0!important}

/* directory pages: action row under the lead */
.dir-actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px 18px;margin-top:20px}
.dir-actions p{margin:0;max-width:60ch;color:var(--muted)}
.dir-actions__link{margin-left:auto;font-size:var(--ds-fs-small);color:var(--ds-link)}
@media(max-width:640px){.dir-actions__link{margin-left:0}}
.dir-actions .button{display:inline-flex;align-items:center;min-height:42px;padding:8px 18px;background:var(--ds-action);color:var(--ds-action-text)!important;font-weight:700;text-decoration:none}
.dir-actions .button:hover,.dir-actions .button:focus-visible{background:var(--ds-link);outline:none}

/* directory filter bar (countries and entities) */
.dir-bar{display:flex;flex-wrap:wrap;gap:10px 22px;align-items:center;margin:14px 0 10px}
.dir-group{display:inline-flex;flex-wrap:wrap;gap:6px;align-items:center}.dir-group>span:first-child{font-size:var(--ds-fs-caption);font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin-right:2px}
.dir-btn{min-height:36px;border:1px solid #8aa19b;background:var(--ds-surface);padding:4px 14px;font:inherit;font-size:var(--ds-fs-control);color:var(--ink);cursor:pointer}.dir-btn:hover{background:#e3ecee}.dir-btn[aria-pressed=true]{background:var(--ds-action);border-color:var(--ds-action);color:var(--ds-action-text)}.dir-btn:focus-visible,.dir-bar input:focus-visible{outline:3px solid var(--ds-link);outline-offset:2px}
.dir-bar input[type=search]{font:inherit;font-size:var(--ds-fs-control);min-height:38px;width:230px;padding:6px 12px;border:1px solid #8aa19b;background:var(--ds-surface);color:var(--ink)}
.dir-count{font-size:var(--ds-fs-small);color:var(--muted);margin:6px 0 12px}.dir-empty{padding:24px;color:var(--muted)}
.dir-card[hidden]{display:none!important}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}

/* ---- site footer ---- */
.site-footer .container{display:block!important}
.site-footer__top{display:grid;grid-template-columns:minmax(220px,1.4fr) repeat(3,minmax(130px,1fr));gap:28px 32px;padding-bottom:26px;border-bottom:1px solid #1d3b47}
.site-footer__brand .brand{display:inline-flex;align-items:center;gap:9px;font-weight:800;letter-spacing:.08em;font-size:.9rem;color:var(--ds-action-text)!important;text-decoration:none}
.site-footer__brand p{margin:10px 0 0!important;font-size:var(--ds-fs-small)!important;line-height:1.55;color:#a9c3c6!important;max-width:34ch}.site-footer__alpha{color:var(--ds-sun)!important}
.site-footer__col h2{font-size:var(--ds-fs-caption)!important;letter-spacing:.12em!important;text-transform:uppercase;color:#7fe0ee!important;margin:0 0 12px!important;font-weight:800!important;line-height:1.2!important}
.site-footer__col ul{list-style:none;margin:0;padding:0;display:grid;gap:8px}.site-footer__col a{font-size:var(--ds-fs-control);color:#dff1f3!important;text-decoration:none}.site-footer__col a:hover,.site-footer__col a:focus-visible{text-decoration:underline;outline:none}.site-footer__col a:focus-visible{outline:2px solid #7fe0ee;outline-offset:3px}
.site-footer__note{padding-top:18px}.site-footer__note p{margin:0 0 8px!important;max-width:110ch!important;font-size:var(--ds-fs-caption)!important;color:#a9c3c6!important}.site-footer__note:empty{display:none}
.site-footer__bottom{display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px 24px;margin-top:18px;padding-top:0;font-size:var(--ds-fs-caption);color:#8fa9ad}
@media(max-width:980px){.site-footer__top{grid-template-columns:repeat(2,minmax(0,1fr))}.site-footer__brand{grid-column:1/-1}}
@media(max-width:700px){.site-footer__top{grid-template-columns:minmax(0,1fr);gap:18px}.site-footer__brand{grid-column:auto}.site-footer__col{border-top:1px solid #1d3b47;padding-top:18px}.site-footer__bottom{display:grid}}
.site-footer__mail{margin:18px 0 0!important;font-size:var(--ds-fs-small)!important;color:#dff1f3!important}.site-footer__mail a{color:#7fe0ee!important}

/* ---- About pages ---- */
.about-layout{display:grid;gap:32px}@media(min-width:900px){.about-layout{grid-template-columns:230px minmax(0,1fr)}}
.about-subnav{align-self:start}@media(min-width:900px){.about-subnav{position:sticky;top:84px}}
.about-subnav ul{list-style:none;margin:6px 0 0;padding:0;display:grid;gap:2px}.about-subnav a{display:block;padding:8px 12px;color:var(--ink);text-decoration:none;font-size:var(--ds-fs-control);border-left:3px solid transparent}
.about-subnav a:hover,.about-subnav a:focus-visible{background:#e3ecee;outline:none}.about-subnav a[aria-current=page]{border-left-color:var(--ds-violet);background:var(--ds-surface);font-weight:700}
.about-body{min-width:0;max-width:78ch}.about-body>p{margin:0 0 14px;color:var(--ink)}
.about-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px;margin:26px 0 8px}
.about-tile{display:grid;gap:6px;padding:16px 18px;background:var(--ds-surface);border:1px solid var(--line);color:var(--ink);text-decoration:none}.about-tile:hover,.about-tile:focus-visible{background:#e3ecee;outline:none}.about-tile b{font-size:var(--ds-fs-lede)}.about-tile span{font-size:var(--ds-fs-control);color:var(--muted)}
.about-pager{display:flex;justify-content:space-between;gap:14px;margin-top:40px;padding-top:20px;border-top:1px solid var(--line)}
.about-pager a{display:grid;gap:2px;padding:10px 16px;border:1px solid var(--line);background:var(--ds-surface);color:var(--ink);text-decoration:none;min-width:150px}.about-pager a:hover,.about-pager a:focus-visible{background:#e3ecee;outline:none}.about-pager small{font-size:var(--ds-fs-label);letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:700}.about-pager__next{text-align:right;margin-left:auto}
.about-list{margin:0 0 14px;padding-left:22px;display:grid;gap:8px}
.about-body .about-goals{max-width:none}
.about-body .about-h{font-size:var(--ds-fs-h2-compact)!important;margin:30px 0 8px!important}
.about-body .lead{margin-bottom:6px!important}

.skip-link{position:absolute;left:8px;top:-60px;z-index:1000;padding:10px 16px;background:var(--ds-surface);color:var(--ds-ink);border:2px solid var(--ds-link);font-weight:700;text-decoration:none}.skip-link:focus{top:8px}
[data-skip-target]:focus{outline:none}
/* Mobile polish: touch targets and legibility (audited at 390 px) */
@media(max-width:700px){
  a.brand{min-height:44px}
  summary{padding-block:10px}
  button.dir-btn{min-height:40px;padding-inline:12px}
  button.cp-era-chip{min-height:40px}
  .hp-linkbtn{padding-block:10px}
  .dir-modern__country,.dir-actions__link{display:inline-flex;align-items:center;min-height:40px}
  input[type=checkbox],input[type=radio]{width:20px;height:20px}
  small{font-size:max(11px,.8em)}
  #map3d-annotation-kicker,#map3d-time-start,#map3d-time-end{font-size:11px}
  #heatmap svg text.hm-n{font-size:10px!important}
  .ca-cards--reliability .ca-card__eyebrow{font-size:11px!important}
}
/* Compact footer on phones */
@media(max-width:700px){.site-footer__col ul{display:flex;flex-wrap:wrap;gap:0 18px}.site-footer__col a{display:inline-block;padding:10px 0}.site-footer__col h2{margin:0 0 2px!important}.site-footer__col{padding-top:12px}.site-footer__top{gap:6px}}
