/* =========================================================================
   Country Hub template — Mastercard-faithful country landing page.

   Reference: mastercard.com/ca/en/business/payments/consumer-payments.html

   Design discipline:
     • 2-column section header   — big headline LEFT, short subline RIGHT.
     • Stats                     — three huge white rounded cards on canvas,
                                   one number + one short sentence each.
     • Pillars                   — flat icon row, no card chrome.
     • Feature blocks            — oval container with thin coral outline,
                                   image + minimal copy + pill button.

   Inherits canvas (#f5f1ec), pill header and base hero from mc-opportunity.css
   via the shared .ao-mc-page body class. This file only adds the new
   country-hub components and their spacing rhythm.
   ========================================================================= */

/* ── 1. Hero CTA pair ───────────────────────────────────────────────────── */

.ao-country-hub__hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

.ao-country-hub__hero-ctas .ao-home-btn {
  font-size: 0.875rem;
}

/* ── 2. Shared 2-column section header ──────────────────────────────────── */
/* Mastercard places a big bold headline on the left and a short, muted
   subtitle to the right. Below ~900px the subtitle drops underneath. */

.ao-country-hub__sechead {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(var(--sp-6), 5vw, var(--sp-12));
  align-items: end;
  margin: 0 0 var(--sp-10);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid rgba(10, 10, 10, 0.10);
}

@media (max-width: 900px) {
  .ao-country-hub__sechead {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
    margin-bottom: var(--sp-8);
  }
}

.ao-country-hub__sechead-title {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: var(--fw-heading-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.034em;
  color: #0a0a0a;
  max-width: 16ch;
  text-wrap: balance;
}

.ao-country-hub__sechead-sub {
  margin: 0;
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  line-height: 1.5;
  color: #525252;
  max-width: 40ch;
  font-weight: 400;
  align-self: end;
  padding-bottom: 0.35em;
  text-wrap: pretty;
}

/* ── 3. Stats: huge white rounded cards on canvas ───────────────────────── */

body.ao-mc-page .ao-country-hub__stats {
  background: var(--ao-home-canvas);
  padding: clamp(var(--sp-16), 9vw, var(--sp-20)) 0 clamp(var(--sp-12), 7vw, var(--sp-16));
}

.ao-country-hub__stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
}

@media (max-width: 900px) {
  .ao-country-hub__stats-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }
}

.ao-country-hub__stat {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 280px;
  padding: clamp(var(--sp-6), 3vw, var(--sp-10));
  background: #ffffff;
  border-radius: 28px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

@media (max-width: 900px) {
  .ao-country-hub__stat {
    min-height: 220px;
  }
}

.ao-country-hub__stat-value {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: var(--fw-heading-display);
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: #0a0a0a;
}

.ao-country-hub__stat-desc {
  margin: var(--sp-6) 0 0;
  font-size: clamp(0.95rem, 1.3vw, 1.0625rem);
  line-height: 1.5;
  color: #404040;
  max-width: 28ch;
  font-weight: 400;
}

/* ── 4. Pillars: flat icon row, no card chrome ──────────────────────────── */

body.ao-mc-page .ao-country-hub__pillars {
  background: var(--ao-home-canvas);
  padding: 0 0 clamp(var(--sp-16), 9vw, var(--sp-20));
}

.ao-country-hub__pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(var(--sp-6), 4vw, var(--sp-10));
  margin-top: var(--sp-4);
}

@media (max-width: 900px) {
  .ao-country-hub__pillars-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-8);
  }
}

.ao-country-hub__pillar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: var(--sp-2) 0;
}

.ao-country-hub__pillar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-5);
  color: var(--c-accent, #ff5f00);
}

.ao-country-hub__pillar-icon svg {
  display: block;
}

.ao-country-hub__pillar-title {
  margin: 0 0 var(--sp-3);
  font-family: var(--font-sans);
  font-weight: var(--fw-heading);
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.024em;
  color: #0a0a0a;
  text-wrap: balance;
}

.ao-country-hub__pillar-body {
  margin: 0;
  font-size: clamp(0.95rem, 1.3vw, 1.0625rem);
  line-height: 1.55;
  color: #525252;
  max-width: 32ch;
  font-weight: 400;
}

/* ── 5. Statement spacing tweak (compact on country-hub) ────────────────── */

body.ao-mc-page .ao-country-hub__statement {
  padding: clamp(var(--sp-12), 7vw, var(--sp-16)) 0;
}

/* ── 6. Feature blocks: oval container with coral outline ───────────────── */

body.ao-mc-page .ao-country-hub__features {
  background: var(--ao-home-canvas);
  padding: clamp(var(--sp-16), 9vw, var(--sp-20)) 0;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.ao-country-hub__features-list {
  display: flex;
  flex-direction: column;
  gap: clamp(var(--sp-8), 4vw, var(--sp-12));
}

/* The block itself is the oval — wraps the image + content with the
   thin coral outline. 50 / 50 columns like Mastercard. A fixed block
   height keeps every oval visually identical regardless of copy length. */
.ao-feature-block {
  --ao-feature-block-h: 480px;
  display: grid;
  /* Image column 60%, content column 40% (image always larger, regardless of order). */
  grid-template-columns: 3fr 2fr;
  gap: clamp(var(--sp-8), 4vw, var(--sp-12));
  align-items: center;
  height: var(--ao-feature-block-h);
  /* Mastercard: generous inset so image + copy never hug the coral outline */
  padding-block: clamp(var(--sp-6), 2.6vw, var(--sp-10));
  padding-inline: clamp(var(--sp-8), 3.5vw, var(--sp-12));
  border: 1px solid var(--c-accent, #ff5f00);
  border-radius: 9999px;
  background: var(--ao-home-canvas);
  transition: transform var(--t-base) var(--ease-smooth);
}

@media (max-width: 1200px) {
  .ao-feature-block {
    --ao-feature-block-h: 400px;
  }
}

@media (max-width: 900px) {
  .ao-feature-block,
  .ao-feature-block--reverse {
    grid-template-columns: 1fr;
    height: auto;
    gap: var(--sp-6);
    padding: clamp(var(--sp-5), 4vw, var(--sp-8));
    border-radius: 36px;
  }

  .ao-feature-block__content,
  .ao-feature-block--reverse .ao-feature-block__content,
  .ao-feature-block:not(.ao-feature-block--reverse) .ao-feature-block__content {
    padding-inline: clamp(var(--sp-4), 3vw, var(--sp-6));
    padding-block: 0;
  }

  .ao-feature-block__title,
  .ao-feature-block__body {
    max-width: none;
  }

  /* Pill-open clip anim is for wide stadium columns; on stack it reads as a thin sliver */
  .ao-feature-block__media.ao-reveal--pill-open,
  .ao-feature-block__media.ao-reveal--visible.ao-reveal--pill-open {
    -webkit-clip-path: none;
    clip-path: none;
  }
}

@media (max-width: 767px) {
  .ao-feature-block,
  .ao-feature-block--reverse {
    border-radius: clamp(20px, 5vw, 28px);
  }

  .ao-feature-block__media {
    aspect-ratio: 16 / 10;
    border-radius: clamp(14px, 3vw, 22px);
    align-self: auto;
  }
}

.ao-feature-block:hover {
  transform: translateY(-2px);
}

/* Image side — Mastercard stadium mask: fills its 50% column edge-to-edge
   and stretches to the block’s fixed height. */
.ao-feature-block__media {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0; /* grid: allow stretch + % heights to resolve predictably */
  border-radius: 9999px;
  overflow: hidden;
  background: #e8e0d4;
  align-self: stretch;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04);
}

@media (max-width: 900px) {
  .ao-feature-block__media {
    height: auto;
    aspect-ratio: 5 / 4;
    border-radius: 9999px;
  }
}

/* Pull the bitmap out of normal flow so global `img { height: auto }` and
   intrinsic aspect-ratio cannot leave a short in-flow box (beige gap under
   the pill curve). Cover always fills the stadium mask. */
.ao-feature-block__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
  transition: transform 600ms var(--ease-smooth);
}

.ao-feature-block:hover .ao-feature-block__media img {
  transform: scale(1.03);
}

/* Reverse variant: image right, text left (alternates per-block).
   Also flip the column ratio so the IMAGE column stays 60% regardless of side. */
@media (min-width: 901px) {
  .ao-feature-block--reverse {
    grid-template-columns: 2fr 3fr;
  }
}

.ao-feature-block--reverse .ao-feature-block__media {
  order: 2;
}

.ao-feature-block--reverse .ao-feature-block__content {
  order: 1;
}

@media (max-width: 900px) {
  .ao-feature-block--reverse .ao-feature-block__media,
  .ao-feature-block--reverse .ao-feature-block__content {
    order: initial;
  }
}

.ao-feature-block__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(var(--sp-4), 2vw, var(--sp-6)) clamp(var(--sp-6), 3.5vw, var(--sp-10));
}

/* Text on the left (odd blocks): extra air from the capsule’s straight edge */
.ao-feature-block--reverse .ao-feature-block__content {
  padding-left: clamp(var(--sp-8), 4.5vw, var(--sp-12));
  padding-right: clamp(var(--sp-4), 2vw, var(--sp-6));
}

/* Image on the left (even blocks): mirror inset from outer border */
.ao-feature-block:not(.ao-feature-block--reverse) .ao-feature-block__content {
  padding-right: clamp(var(--sp-6), 3vw, var(--sp-10));
}

.ao-feature-block__title {
  margin: 0 0 var(--sp-4);
  font-family: var(--font-sans);
  font-weight: var(--fw-heading);
  font-size: clamp(1.5rem, 2.6vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.028em;
  color: #0a0a0a;
  max-width: 18ch;
  text-wrap: balance;
}

.ao-feature-block__body {
  margin: 0 0 var(--sp-5);
  font-size: clamp(0.95rem, 1.35vw, 1.0625rem);
  line-height: 1.55;
  color: #404040;
  max-width: 42ch;
  font-weight: 400;
}

.ao-feature-block__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  padding: 0.7rem 1.25rem;
  background: transparent;
  border: 1.5px solid #0a0a0a;
  border-radius: var(--r-full);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: #0a0a0a;
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.ao-feature-block__cta:hover {
  background: #0a0a0a;
  color: #ffffff;
  border-color: #0a0a0a;
  transform: translateY(-1px);
}

.ao-feature-block__cta svg {
  transition: transform var(--t-fast);
}

.ao-feature-block__cta:hover svg {
  transform: translate(2px, -2px);
}

.ao-feature-block__cta:focus-visible {
  outline: 2px solid var(--c-accent, #ff5f00);
  outline-offset: 3px;
}

/* ── 7. Closing: align related-link pills to the left, like Mastercard ──── */

body.ao-mc-page .ao-country-hub__closing .ao-mc-opp-related {
  justify-content: flex-start;
}

/* ── 8. Shared a11y polish for .ao-mc-page family ──────────────────────────
   One coherent focus treatment across all interactive elements introduced by
   the country-hub + country-subpage templates. The accent ring sits OUTSIDE
   the element on transparent / outlined buttons, INSIDE on pill-shaped
   inverted buttons (so the ring stays inside the rounded shape). */

body.ao-mc-page a:focus-visible,
body.ao-mc-page button:focus-visible {
  outline: 2px solid var(--c-accent, #ff5f00);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Pill / capsule buttons get a tighter inner ring so the round shape stays
   visually intact. */
body.ao-mc-page .ao-home-btn:focus-visible,
body.ao-mc-page .ao-country-subpage__imageband-cta:focus-visible,
body.ao-mc-page .ao-country-subpage__darkcard-cta:focus-visible {
  outline-offset: 4px;
  border-radius: 9999px;
}

/* Native form-control accent color (anchors against any future inputs). */
body.ao-mc-page { accent-color: var(--c-accent, #ff5f00); }

/* ── 9. Reduced motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  body.ao-mc-page *,
  body.ao-mc-page *::before,
  body.ao-mc-page *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ao-feature-block,
  .ao-feature-block:hover,
  .ao-feature-block:hover .ao-feature-block__media img,
  .ao-feature-block__cta:hover,
  .ao-feature-block__cta:hover svg {
    transform: none;
  }
}
