/* ==========================================================================
   Apex Evergreen Pharma — Global Presence Page Styles
   --------------------------------------------------------------------------
   Self-contained page styles. Consumes tokens from design-system.css and
   builds on global.css. Redefines the shared homepage components (reveal,
   node-divider, media-frame, orbital-node icons, facts band) with identical
   values so this page looks like the same site without loading home.css.

   Sections:
     1. Intro   2. World-map slot   3. Summary stats
     4. Flag wall (centerpiece)   5. Market access   6. Closing CTA
   ========================================================================== */

/* ==========================================================================
   SHARED — GENERIC SCROLL REVEAL
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   SHARED — CONNECTIVE NODE DIVIDER
   ========================================================================== */
.node-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  padding-block: var(--space-2xl);
}
.node-divider--cream  { background-color: var(--color-cream); }
.node-divider--forest { background-color: var(--color-forest); }
.node-divider::before,
.node-divider::after {
  content: "";
  height: 1px;
  width: clamp(48px, 14vw, 180px);
  background: linear-gradient(to right, transparent, rgba(201, 169, 74, 0.45));
}
.node-divider::after { transform: scaleX(-1); }
.node-divider__mark {
  display: inline-flex;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}
.node-divider__mark svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  transform-box: fill-box;
  transform-origin: center;
}
.node-mark__ring { stroke: var(--color-gold); stroke-width: 1.25; opacity: 0.7; }
.node-mark__core { fill: var(--color-gold); transform-box: fill-box; transform-origin: center; }
@keyframes node-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.15); }
}
.node-mark__core { animation: node-pulse 3.2s var(--ease) infinite; }
@media (prefers-reduced-motion: reduce) {
  .node-mark__core { animation: none; }
}

/* ==========================================================================
   SHARED — MEDIA FRAME (labelled placeholder)
   ========================================================================== */
.media-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid rgba(201, 169, 74, 0.35);
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
}
.media-frame--wide { aspect-ratio: 16 / 9; }
.media-frame--dark {
  background: linear-gradient(160deg, rgba(30, 58, 42, 0.55), rgba(12, 26, 18, 0.35));
}
.media-frame::before,
.media-frame::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 1px solid var(--color-gold);
  opacity: 0.6;
  z-index: 1;
}
.media-frame::before {
  top: var(--space-md);
  left: var(--space-md);
  border-right: 0;
  border-bottom: 0;
}
.media-frame::after {
  bottom: var(--space-md);
  right: var(--space-md);
  border-left: 0;
  border-top: 0;
}
.media-frame__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl);
  max-width: 44ch;
}
.media-frame__icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-xs);
}
.media-frame__icon svg { width: 100%; height: 100%; overflow: visible; }
.media-frame__kicker {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-gold);
}
.media-frame__caption {
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text-muted-dark);
}
/* Shared orbital-node icon fills. */
.cap-icon__ring { stroke: var(--color-gold); stroke-width: 1.25; opacity: 0.8; }
.cap-icon__core,
.cap-icon__sats circle { fill: var(--color-gold); }
.cap-icon__sats circle { opacity: 0.9; }

/* ==========================================================================
   1. INTRO  (cream) — clears the fixed header
   ========================================================================== */
.gp-intro {
  background-color: var(--color-cream);
  color: var(--color-ink);
  padding-block: calc(var(--header-height) + var(--space-2xl)) var(--space-2xl);
}
.gp-intro__content { max-width: 60ch; }
.gp-intro__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw + 1rem, 4.25rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  margin-bottom: var(--space-lg);
  text-wrap: balance;
}
.gp-intro__lead {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1.05rem, 0.8vw + 0.9rem, 1.35rem);
  line-height: 1.6;
  color: var(--color-text-muted-light);
  max-width: 64ch;
}

/* ==========================================================================
   2. WORLD MAP SLOT  (forest)
   ========================================================================== */
.gp-map {
  background-color: var(--color-forest);
  color: var(--color-text-light);
  padding-block: var(--space-lg) var(--space-2xl);
}

/* ==========================================================================
   3. SUMMARY STATS  (cream) — large numbers with thin gold dividers
   ========================================================================== */
.gp-stats {
  background-color: var(--color-cream);
  color: var(--color-ink);
  padding-block: var(--space-lg) var(--space-2xl);
}
.facts__row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.facts__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-xl);
  border-left: 1px solid var(--color-cream-dark);
}
.facts__item:first-child {
  border-left: 0;
  padding-left: 0;
}
.facts__number {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3rem, 5vw + 1rem, 5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--color-evergreen);
  font-variant-numeric: tabular-nums;
}
.facts__label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--color-text-muted-light);
}
/* Fourth item: accreditation badges instead of a number. */
.facts__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}
.facts__badge {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--color-gold-deep);
  border: 1px solid var(--color-gold);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  white-space: nowrap;
}

/* ==========================================================================
   4. FLAG WALL  (forest) — the centerpiece
   ========================================================================== */
.gp-wall {
  background-color: var(--color-forest);
  color: var(--color-text-light);
  padding-block: var(--space-lg) var(--space-2xl);
}
.gp-wall .eyebrow { color: var(--color-gold); }
.gp-wall__header {
  max-width: 52ch;
  margin-bottom: var(--space-2xl);
}
.gp-wall__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 3vw + 0.75rem, 3rem);
  line-height: 1.12;
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
}
.gp-wall__hint {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text-muted-dark);
}
.gp-wall__noscript {
  font-family: var(--font-body);
  color: var(--color-text-muted-dark);
}

/* ---- Region block ---- */
.region-block {
  margin-block: var(--space-xl);
}
.region-block:first-child { margin-top: 0; }
.region-block__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
/* Gold orbital-node accent beside the region name. */
.region-block__mark {
  position: relative;
  align-self: center;
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-gold);
}
.region-block__mark::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid var(--color-gold);
  border-radius: 50%;
  opacity: 0.4;
}
.region-block__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 1.5vw + 1rem, 1.75rem);
  line-height: 1.15;
  color: var(--color-text-light);
}
.region-block__count {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold);
}

/* ---- Flag grid ---- */
.flag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: var(--space-md);
}
.flag {
  position: relative;
  cursor: default;
  outline: none;
}
.flag__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid rgba(245, 240, 228, 0.16);
  box-shadow: 0 2px 8px rgba(12, 26, 18, 0.35);
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
}
.flag:hover .flag__img,
.flag:focus-visible .flag__img {
  transform: translateY(-4px);
  border-color: var(--color-gold);
  box-shadow: 0 10px 24px rgba(12, 26, 18, 0.55);
}
.flag:focus-visible {
  border-radius: 6px;
  box-shadow: 0 0 0 2px var(--color-gold);
}

/* Country-name tooltip — fades in below the flag on hover / focus / tap. */
.flag__name {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  z-index: 5;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background-color: rgba(12, 26, 18, 0.96);
  border: 1px solid rgba(201, 169, 74, 0.4);
  color: var(--color-text-light);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}
.flag:hover .flag__name,
.flag:focus .flag__name,
.flag:focus-within .flag__name {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Thin divider between regions. */
.region-sep {
  height: 1px;
  background: linear-gradient(
    to right,
    rgba(201, 169, 74, 0.28),
    rgba(201, 169, 74, 0.06)
  );
  margin-block: var(--space-2xl);
}

/* ==========================================================================
   5. MARKET ACCESS  (cream)
   ========================================================================== */
.gp-access {
  background-color: var(--color-cream);
  color: var(--color-ink);
  padding-block: var(--space-lg) var(--space-2xl);
}
.gp-access__content { max-width: 62ch; }
.gp-access__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 3vw + 0.75rem, 2.75rem);
  line-height: 1.14;
  color: var(--color-ink);
  margin-bottom: var(--space-md);
}
.gp-access__body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1rem, 0.5vw + 0.9rem, 1.15rem);
  line-height: 1.7;
  color: var(--color-text-muted-light);
  max-width: 64ch;
}

/* ==========================================================================
   6. CLOSING CTA  (forest, flows into footer)
   ========================================================================== */
.gp-closing {
  position: relative;
  overflow: hidden;
  background-color: var(--color-forest);
  color: var(--color-text-light);
  padding-block: var(--space-2xl) var(--space-3xl);
}
.gp-closing__inner { text-align: center; }
.gp-closing .eyebrow { color: var(--color-gold); }
.gp-closing__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4vw + 0.75rem, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
  text-wrap: balance;
}
.gp-closing__line {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1rem, 0.7vw + 0.9rem, 1.2rem);
  line-height: 1.6;
  color: color-mix(in srgb, var(--color-text-light) 70%, var(--color-text-muted-dark) 30%);
  max-width: 56ch;
  margin-inline: auto;
  margin-bottom: var(--space-xl);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  /* Summary stats: 2 x 2 */
  .facts__row {
    grid-template-columns: repeat(2, 1fr);
    row-gap: var(--space-xl);
  }
  .facts__item { padding: var(--space-sm) var(--space-lg); }
  .facts__item:nth-child(2n + 1) { border-left: 0; padding-left: 0; }
  .facts__item:nth-child(2n) { border-left: 1px solid var(--color-cream-dark); }
}

@media (max-width: 560px) {
  .facts__row { grid-template-columns: 1fr; row-gap: 0; }
  .facts__item {
    border-left: 0 !important;
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--color-cream-dark);
  }
  .facts__item:first-child { border-top: 0; padding-top: 0; }
  /* Slightly smaller flags on phones so rows stay tidy. */
  .flag-grid {
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: var(--space-sm);
  }
  .gp-closing__cta .btn { width: 100%; }
}
