/* public/css/jurisdictions.css
   ---------------------------------------------------------------------------
   Jurisdictions landing page and country pages.

   Navy, white and restrained gold. Gold is an accent — markers, borders, small labels
   and calls to action — never large areas of text (§42). The photography and the map
   carry the premium feel; the type stays quiet.
   --------------------------------------------------------------------------- */

:root {
    --jx-navy:  #0B1626;
    --jx-navy2: #16243B;
    --jx-gold:  #C9A227;
    --jx-line:  #E3E7EE;
    --jx-muted: #6B7688;
    --jx-soft:  #F7F8FA;
    --jx-font:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
}

.page-jurisdictions { background: var(--jx-soft); font-family: var(--jx-font);
    -webkit-font-smoothing: antialiased; }

/* ── Explorer hero ────────────────────────────────────────────────────────── */

.jx {
    background:
        radial-gradient(1200px 600px at 50% -10%, #1B2E4A 0%, transparent 70%),
        var(--jx-navy);
    /* Brought up ~90px from the previous 5rem top: less empty navy above the map, so the
       heading and the map read as one connected hero (Simon, follow-up note). */
    padding: clamp(1.25rem, 2.4vw, 1.75rem) 1.5rem clamp(2rem, 4vw, 3rem);
    color: #fff;
}
.jx-inner { max-width: 1180px; margin: 0 auto; text-align: center; }

.jx-eyebrow {
    font: 700 .74rem/1 var(--jx-font); letter-spacing: .18em; text-transform: uppercase;
    color: var(--jx-gold); margin: 0 0 .8rem;
}
.jx-title {
    font: 800 clamp(1.9rem, 4vw, 3rem)/1.08 var(--jx-font);
    letter-spacing: -.028em; color: #fff; margin: 0 0 .8rem;
}
.jx-lead {
    font: 400 clamp(.95rem, 1.4vw, 1.06rem)/1.65 var(--jx-font);
    color: rgba(255,255,255,.78); max-width: 62ch;
    /* Tighter gap to the map so more of it sits above the fold (§7). */
    margin: 0 auto clamp(1rem, 2vw, 1.5rem);
}

/* ── The interactive map ──────────────────────────────────────────────────── */

.jx-map-wrap {
    position: relative; max-width: 1080px; margin: 0 auto;
    /* Shorter than before (was 16/8.4) and capped, so the map no longer swallows the first
       screen — the stats and the first cards below it stay in view (§7). Fixed ratio still
       prevents layout shift while the library initialises. */
    aspect-ratio: 16 / 6.6;
    max-height: 58vh;
}
@media (max-width: 760px) { .jx-map-wrap { aspect-ratio: 4 / 3; max-height: none; } }

.jx-map-canvas { width: 100%; height: 100%; }

/* jsVectorMap paints its own container; these keep it out of the way. */
.jx-map-canvas .jvm-container { background: transparent !important; }
.jx-map-canvas .jvm-tooltip { display: none !important; }   /* replaced by .jx-hover */

/* The active regions glow gently. Slow enough to read as illumination, not animation. */
.jx-map-canvas .jvm-region[fill="#C9A227"] {
    filter: drop-shadow(0 0 6px rgba(201,162,39,.45));
    transition: filter .25s ease;
}
.jx-map-canvas .jvm-region[fill="#E4BE45"] {
    filter: drop-shadow(0 0 14px rgba(201,162,39,.8));
    cursor: pointer;
}

/* Gold location markers with a restrained pulse — a live signal, not a flight tracker (§1). */
.jx-map-canvas .jvm-marker { cursor: pointer; animation: jx-marker-pulse 2.8s ease-in-out infinite; }
.jx-map-canvas .jvm-marker:hover { filter: drop-shadow(0 0 8px rgba(201,162,39,.9)); }
@keyframes jx-marker-pulse {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(201,162,39,.55)); }
    50%      { filter: drop-shadow(0 0 7px rgba(201,162,39,.95)); }
}
@media (prefers-reduced-motion: reduce) {
    .jx-map-canvas .jvm-marker { animation: none; filter: drop-shadow(0 0 4px rgba(201,162,39,.7)); }
}

/* ── Hover preview ────────────────────────────────────────────────────────── */

.jx-hover {
    position: absolute; z-index: 5; pointer-events: none;
    min-width: 210px; max-width: 250px;
    padding: .85rem 1rem;
    background: #fff; color: var(--jx-navy);
    border-radius: 12px; border: 1px solid var(--jx-line);
    box-shadow: 0 20px 44px rgba(6,14,26,.38);
    display: flex; flex-direction: column; gap: .12rem;
    animation: jx-card-in .16s ease-out;
}
@keyframes jx-card-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.jx-hover-name   { font: 700 .98rem/1.25 var(--jx-font); }
.jx-hover-region { font: 500 .74rem/1.3 var(--jx-font); color: var(--jx-muted);
    letter-spacing: .05em; text-transform: uppercase; }
.jx-hover-count  { font: 600 .84rem/1.4 var(--jx-font); color: var(--jx-gold); margin-top: .3rem; }
.jx-hover-cats   { font: 400 .78rem/1.5 var(--jx-font); color: var(--jx-muted); }
.jx-hover-cats:empty { display: none; }
.jx-hover-go     { font: 700 .8rem/1 var(--jx-font); margin-top: .55rem; }

@media (max-width: 760px) {
    /* Hover means nothing on touch, and a tap navigates. §10. */
    .jx-hover { display: none !important; }
}

/* ── Statistics ───────────────────────────────────────────────────────────── */

.jx-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem; max-width: 820px; margin: clamp(2rem, 4vw, 3rem) auto 0;
}
.jx-stats div { text-align: center; }
.jx-stats dd { font: 800 clamp(1.6rem, 3vw, 2.2rem)/1 var(--jx-font);
    color: var(--jx-gold); margin: 0 0 .3rem; letter-spacing: -.02em; }
.jx-stats dt { font: 500 .78rem/1.3 var(--jx-font); color: rgba(255,255,255,.6);
    letter-spacing: .04em; text-transform: uppercase; }

/* ── Region filter ────────────────────────────────────────────────────────── */

.jx-regions { max-width: 1180px; margin: 0 auto; padding: 2.5rem 1.5rem 0; }
.jx-regions h2 { font: 700 1.4rem/1.2 var(--jx-font); color: var(--jx-navy);
    letter-spacing: -.02em; margin: 0 0 1rem; }
.jx-region-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.jx-region-tab {
    display: inline-block; padding: .5rem 1.1rem; border-radius: 40px;
    border: 1px solid var(--jx-line); background: #fff;
    font: 600 .85rem/1 var(--jx-font); color: var(--jx-navy); text-decoration: none;
    cursor: pointer;
}
.jx-region-tab:hover { border-color: var(--jx-gold); color: var(--jx-navy); }
.jx-region-tab.is-active { background: var(--jx-navy); border-color: var(--jx-navy); color: #fff; }

/* ── Country cards ────────────────────────────────────────────────────────── */

.jx-countries {
    display: grid; gap: 1.2rem; max-width: 1180px; margin: 0 auto;
    padding: 0 1.5rem clamp(3rem, 6vw, 5rem);
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.jx-country {
    background: #fff; border: 1px solid var(--jx-line); border-radius: 14px;
    overflow: hidden; text-decoration: none; display: flex; flex-direction: column;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.jx-country:hover {
    border-color: var(--jx-gold); transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(11,22,38,.10);
}
.jx-country-media { position: relative; aspect-ratio: 16 / 9; background: var(--jx-navy); overflow: hidden; }
.jx-country-media img { width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform .5s ease; }
.jx-country:hover .jx-country-media img { transform: scale(1.04); }
.jx-country-flag {
    position: absolute; left: .8rem; bottom: .8rem; width: 30px; height: 21px;
    border-radius: 3px; box-shadow: 0 2px 8px rgba(0,0,0,.35);
    /* flag-icons sprite: fill the badge, no baseline gap. */
    background-size: cover; background-position: 50%; line-height: 21px;
}
.jx-country-body { padding: 1.1rem 1.25rem 1.3rem; display: flex; flex-direction: column; flex: 1; }
.jx-country-region { font: 600 .7rem/1 var(--jx-font); letter-spacing: .07em;
    text-transform: uppercase; color: var(--jx-muted); }
.jx-country-name { font: 700 1.12rem/1.25 var(--jx-font); color: var(--jx-navy);
    margin: .35rem 0 .3rem; letter-spacing: -.015em; }
.jx-country-tag { font: 400 .86rem/1.5 var(--jx-font); color: var(--jx-muted); margin: 0 0 .8rem; }
.jx-country-count { font: 700 .85rem/1 var(--jx-font); color: var(--jx-gold); margin-bottom: .5rem; }
.jx-country-cats { font: 400 .8rem/1.5 var(--jx-font); color: var(--jx-muted); margin: 0 0 1rem; }
.jx-country-go { margin-top: auto; font: 700 .85rem/1 var(--jx-font); color: var(--jx-navy); }
.jx-country:hover .jx-country-go { color: var(--jx-gold); }

/* ── Mobile ───────────────────────────────────────────────────────────────── */

@media (max-width: 760px) {
    /* Hover cards are useless on touch, and a marker tap should simply navigate — §8 and
       §31's "no hover-only functionality". The map stays as an illustration; the cards
       below are the navigation. */
    .jx-card { display: none; }
    .jx-map { aspect-ratio: 2 / 1; max-width: 100%; }
    .jx-marker { width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; }
    .jx-countries { grid-template-columns: 1fr; }
}

/* §9 and §37 — reduced motion is respected rather than approximated. */
@media (prefers-reduced-motion: reduce) {
    .jx-dot { animation: none; }
    .jx-country, .jx-country-media img, .jx-dot, .jx-card { transition: none; }
    .jx-country:hover { transform: none; }
    .jx-country:hover .jx-country-media img { transform: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   COUNTRY PAGE
   One template for every jurisdiction, so the styling carries no country's
   assumptions — a page with three sections and one with nine both have to read
   as finished.
   ═══════════════════════════════════════════════════════════════════════════ */

.cy-hero { position: relative; background: var(--jx-navy); overflow: hidden;
    padding: clamp(3.5rem, 7vw, 6rem) 1.5rem clamp(3rem, 6vw, 5rem); }

.cy-hero.has-image::before {
    content: ""; position: absolute; inset: 0;
    background-image: var(--hero); background-size: cover; background-position: center;
    filter: saturate(.9) contrast(1.05);
}

/* Same fixed scrim as the listing hero — text contrast must not depend on which
   photograph a jurisdiction happens to have. */
.cy-hero-scrim {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(11,22,38,.42) 0%, rgba(11,22,38,.58) 45%,
    rgba(11,22,38,.74) 100%);
}

.cy-hero-inner {
    position: relative; max-width: 1180px; margin: 0 auto;
    display: grid; grid-template-columns: 1.4fr .8fr; gap: 3rem; align-items: center;
}
@media (max-width: 900px) { .cy-hero-inner { grid-template-columns: 1fr; gap: 2rem; } }

.cy-hero-eyebrow {
    display: flex; align-items: center; gap: .6rem;
    font: 700 .78rem/1 var(--jx-font); letter-spacing: .16em;
    color: var(--jx-gold); margin: 0 0 1.1rem;
}
.cy-flag { border-radius: 2px; display: block; }

.cy-hero-title {
    font: 800 clamp(1.9rem, 4vw, 3rem)/1.1 var(--jx-font); letter-spacing: -.028em;
    color: #fff; margin: 0 0 1rem; text-shadow: 0 2px 18px rgba(11,22,38,.45);
}
.cy-hero-lead {
    font: 400 clamp(.95rem, 1.4vw, 1.08rem)/1.65 var(--jx-font);
    color: rgba(255,255,255,.86); max-width: 56ch; margin: 0 0 1.4rem;
    text-shadow: 0 1px 12px rgba(11,22,38,.5);
}
.cy-hero-counts { font: 400 .95rem/1 var(--jx-font); color: rgba(255,255,255,.75); margin: 0 0 1.8rem; }
.cy-hero-counts strong { color: var(--jx-gold); font-weight: 700; }

.cy-hero-cta { display: flex; gap: .7rem; flex-wrap: wrap; }
.cy-btn {
    display: inline-block; background: var(--jx-gold); color: #1A1204;
    font: 700 .9rem/1 var(--jx-font); padding: .85rem 1.6rem; border-radius: 8px;
    text-decoration: none; transition: transform .15s ease, box-shadow .15s ease;
}
.cy-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(201,162,39,.32); color: #1A1204; }
.cy-btn-ghost {
    background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35);
}
.cy-btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; box-shadow: none; }

/* The country outline — a design element, not a navigation map. */
.cy-hero-map { display: flex; justify-content: center; }
.cy-hero-map img {
    max-width: 100%; max-height: 320px; width: auto; display: block;
    opacity: .85;
    /* Gold, whatever colour the source SVG happens to be — one filter rather than a
       recoloured file per country. */
    filter: brightness(0) saturate(100%) invert(72%) sepia(48%) saturate(560%)
    hue-rotate(2deg) brightness(92%) contrast(88%)
    drop-shadow(0 0 26px rgba(201,162,39,.35));
}
@media (max-width: 900px) { .cy-hero-map { display: none; } }

/* ── Sections ─────────────────────────────────────────────────────────────── */

.cy-section { padding: clamp(2.5rem, 5vw, 4rem) 1.5rem 0; }
.cy-inner { max-width: 1180px; margin: 0 auto; }
.cy-section h2 {
    font: 700 clamp(1.3rem, 2.2vw, 1.7rem)/1.2 var(--jx-font);
    color: var(--jx-navy); letter-spacing: -.022em; margin: 0 0 1.4rem;
}

/* At a glance */
.cy-facts-section { background: transparent; }
.cy-facts {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1px; background: var(--jx-line); border: 1px solid var(--jx-line);
    border-radius: 14px; overflow: hidden; margin: 0;
}
.cy-facts > div { background: #fff; padding: 1.15rem 1.3rem; }
.cy-facts dt {
    font: 600 .7rem/1.3 var(--jx-font); letter-spacing: .06em; text-transform: uppercase;
    color: var(--jx-muted); margin-bottom: .3rem;
}
.cy-facts dd { font: 600 1rem/1.4 var(--jx-font); color: var(--jx-navy); margin: 0; }
.cy-checked { font: 400 .75rem/1 var(--jx-font); color: var(--jx-muted); margin: .8rem 0 0; }

/* Service categories */
.cy-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .7rem; }
.cy-cat {
    background: #fff; border: 1px solid var(--jx-line); border-radius: 12px;
    padding: 1rem 1.2rem; text-decoration: none; display: block;
    transition: border-color .2s ease, transform .2s ease;
}
.cy-cat:hover { border-color: var(--jx-gold); transform: translateY(-2px); }
.cy-cat.is-active { border-color: var(--jx-navy); background: var(--jx-navy); }
.cy-cat.is-active .cy-cat-name { color: #fff; }
.cy-cat.is-active .cy-cat-count { color: var(--jx-gold); }
.cy-cat-name { display: block; font: 700 .95rem/1.3 var(--jx-font); color: var(--jx-navy); }
.cy-cat-count { display: block; font: 600 .8rem/1 var(--jx-font); color: var(--jx-gold); margin-top: .3rem; }
.cy-cat-clear { display: flex; align-items: center; justify-content: center;
    font: 600 .88rem/1 var(--jx-font); color: var(--jx-muted); }

/* Listing cards */
.cy-listings { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; }
.cy-listing {
    background: #fff; border: 1px solid var(--jx-line); border-radius: 14px;
    overflow: hidden; text-decoration: none; display: flex; flex-direction: column;
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.cy-listing:hover { border-color: var(--jx-gold); transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(11,22,38,.10); }
.cy-listing-media { display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--jx-soft); }
.cy-listing-media img { width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform .5s ease; }
.cy-listing:hover .cy-listing-media img { transform: scale(1.04); }
.cy-listing-body { padding: 1rem 1.15rem 1.15rem; display: flex; flex-direction: column; flex: 1; }
.cy-listing-cat { font: 600 .68rem/1 var(--jx-font); letter-spacing: .07em;
    text-transform: uppercase; color: var(--jx-muted); }
.cy-listing-name { font: 700 1rem/1.35 var(--jx-font); color: var(--jx-navy); margin: .4rem 0 .35rem; }
.cy-listing-desc { font: 400 .84rem/1.5 var(--jx-font); color: var(--jx-muted); margin-bottom: .8rem; }
.cy-listing-go { margin-top: auto; font: 700 .84rem/1 var(--jx-font); color: var(--jx-navy); }
.cy-listing:hover .cy-listing-go { color: var(--jx-gold); }

/* Why this jurisdiction */
.cy-why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.cy-why-block {
    background: #fff; border: 1px solid var(--jx-line); border-left: 3px solid var(--jx-gold);
    border-radius: 12px; padding: 1.2rem 1.4rem;
}
.cy-why-block h3 { font: 700 1rem/1.3 var(--jx-font); color: var(--jx-navy); margin: 0 0 .5rem; }
.cy-why-block p { font: 400 .9rem/1.6 var(--jx-font); color: #33405A; margin: 0; }

/* Guides */
.cy-guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem;
    margin-bottom: 1rem; }
.cy-guide {
    background: #fff; border: 1px solid var(--jx-line); border-radius: 12px;
    padding: 1.2rem 1.3rem; text-decoration: none; display: block;
}
.cy-guide:hover { border-color: var(--jx-gold); }
.cy-guide-kind { font: 700 .66rem/1 var(--jx-font); letter-spacing: .1em;
    text-transform: uppercase; color: var(--jx-gold); }
.cy-guide-name { display: block; font: 600 1rem/1.35 var(--jx-font); color: var(--jx-navy);
    margin: .5rem 0 .4rem; }
.cy-guide-desc { font: 400 .84rem/1.55 var(--jx-font); color: var(--jx-muted); }
.cy-more { display: inline-block; font: 700 .88rem/1 var(--jx-font);
    color: var(--jx-gold); text-decoration: none; }
.cy-more:hover { text-decoration: underline; }

/* Related jurisdictions */
.cy-nearby { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.cy-nearby-card {
    background: #fff; border: 1px solid var(--jx-line); border-radius: 12px;
    padding: 1rem 1.2rem; text-decoration: none; display: flex; align-items: center; gap: .7rem;
}
.cy-nearby-card:hover { border-color: var(--jx-gold); }
.cy-nearby-name { font: 700 .95rem/1.2 var(--jx-font); color: var(--jx-navy); }
.cy-nearby-count { margin-left: auto; font: 600 .78rem/1 var(--jx-font); color: var(--jx-gold); }

.cy-pagination { margin-top: 1.6rem; }

/* Adviser CTA */
.cy-cta { background: var(--jx-navy); margin-top: clamp(3rem, 6vw, 5rem);
    padding: clamp(3rem, 6vw, 4.5rem) 1.5rem; }
.cy-cta-inner { max-width: 680px; margin: 0 auto; text-align: center; }
.cy-cta h2 { font: 800 clamp(1.5rem, 2.6vw, 1.9rem)/1.2 var(--jx-font); color: #fff;
    letter-spacing: -.022em; margin: 0 0 .9rem; }
.cy-cta p { font: 400 .98rem/1.7 var(--jx-font); color: rgba(255,255,255,.78); margin: 0 0 1.7rem; }
.cy-cta .cy-hero-cta { justify-content: center; }

@media (prefers-reduced-motion: reduce) {
    .cy-btn, .cy-cat, .cy-listing, .cy-listing-media img { transition: none; }
    .cy-btn:hover, .cy-cat:hover, .cy-listing:hover { transform: none; }
    .cy-listing:hover .cy-listing-media img { transform: none; }
}


/* ── Motion — §9 ──────────────────────────────────────────────────────────────
   Restrained: short distances, quick durations, once each. The register is an
   institutional financial site, where movement should feel like the interface
   settling rather than performing.
   ─────────────────────────────────────────────────────────────────────────── */

.jx-reveal { opacity: 0; transform: translateY(14px); }
.jx-reveal.is-in {
    opacity: 1; transform: none;
    transition: opacity .5s ease, transform .5s cubic-bezier(.22,.61,.36,1);
}

/* Staggered along each row, so a grid arrives as a sequence rather than a block. */
.jx-country:nth-child(2n).is-in { transition-delay: .05s; }
.jx-country:nth-child(3n).is-in { transition-delay: .1s; }
.jx-country:nth-child(4n).is-in { transition-delay: .15s; }

.jx-region-tab { transition: background-color .18s ease, border-color .18s ease, color .18s ease; }

@media (prefers-reduced-motion: reduce) {
    .jx-reveal, .jx-reveal.is-in { opacity: 1; transform: none; transition: none; }
    .jx-hover { animation: none; }
    .jx-map-canvas .jvm-region { transition: none; filter: none; }
}
