/* ============================================================
   ALASKA FROZEN — iwocaPay credit banner component
   File: css/iwocapay-banner.css
   Namespace: .iwp*  (no collisions with brand.css)

   Load AFTER css/brand.css so the design tokens resolve:
     <link rel="stylesheet" href="/css/iwocapay-banner.css?v=1">

   Tokens are this site's own: --accent, --ink, --line, --muted,
   --paper-2, --font. (--ice exists only in wow.css, which the
   homepage alone loads, so its fallback is the same value.)

   Variants
     .iwp.iwp--wide       full-bleed light band, sits BETWEEN sections
                          (provides its own inner wrapper — do NOT nest in .container)
     .iwp.iwp--contained  sits INSIDE an existing .container
     .iwp.iwp--rail       optional 160x600 skyscraper for the category sidebar
                          (auto-hides below 1000px)

   Artwork tiers — the artwork is never stretched or upscaled past its
   intrinsic width, because the baked-in offer text must stay legible:
     < 700px            970x250  (billboard, fills the column)
     700 - 999px        728x90   (leaderboard, near native size)
     1000 - 1399px      970x250  (billboard, near native size)
     >= 1400px          1920x90  (full strip — .iwp--wide only)
   ============================================================ */

/* ---------- Shell ---------- */
.iwp {
  --iwp-cap: 970px;               /* max rendered artwork width for this tier */
  --iwp-radius: 14px;
  position: relative;
  font-family: var(--font, "Inter", sans-serif);
  text-align: center;
}

/* full-bleed band: light surface so it never fights the sections around it */
.iwp--wide {
  background: var(--ice, #F2F8FC);
  border-top: 1px solid var(--line, #E4E3E2);
  border-bottom: 1px solid var(--line, #E4E3E2);
  padding-block: clamp(26px, 3.6vw, 46px);
}
.iwp--wide .iwp-inner {
  width: min(1680px, 100%);
  margin-inline: auto;
  padding-inline: clamp(16px, 3vw, 40px);
}

/* contained: no surface of its own, just rhythm inside the parent .container */
.iwp--contained {
  margin-block: clamp(30px, 4vw, 56px);
}

/* ---------- Artwork link ---------- */
.iwp-art {
  display: block;
  width: 100%;
  max-width: var(--iwp-cap);
  margin-inline: auto;
  border-radius: var(--iwp-radius);
  overflow: hidden;
  background: var(--paper-2, #F7F7F6);   /* light placeholder, no dark flash */
  box-shadow: 0 14px 34px -20px rgba(10, 60, 100, .45);
  transition: transform .3s cubic-bezier(.22, .7, .3, 1), box-shadow .3s;
  -webkit-tap-highlight-color: rgba(10, 111, 168, .18);
}
.iwp-art:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px -20px rgba(10, 60, 100, .5);
}
.iwp-art:focus-visible {
  outline: 3px solid var(--accent, #0A6FA8);
  outline-offset: 4px;
}
/* fallback for engines without :focus-visible */
.iwp-art:focus { outline: 3px solid var(--accent, #0A6FA8); outline-offset: 4px; }
.iwp-art:focus:not(:focus-visible) { outline: none; }

.iwp-art picture { display: block; }
.iwp-art img {
  display: block;
  width: 100%;
  height: auto;
  /* `auto <ratio>` = use the real intrinsic ratio once loaded, the stated
     ratio only as the pre-load placeholder. Guarantees zero layout shift
     AND zero distortion even if a tier is served out of step. */
  aspect-ratio: auto 970 / 250;
  object-fit: contain;
}

/* ---------- Tiers ---------- */
@media (min-width: 700px) {
  .iwp { --iwp-cap: 728px; }
  .iwp-art img { aspect-ratio: auto 728 / 90; }
}
@media (min-width: 1000px) {
  .iwp { --iwp-cap: 970px; --iwp-radius: 16px; }
  .iwp-art img { aspect-ratio: auto 970 / 250; }
}
@media (min-width: 1400px) {
  /* only the full-bleed variant is wide enough to read the 1920x90 strip;
     the contained variant stays on the 970x250 billboard */
  .iwp--wide { --iwp-cap: 1920px; }
  .iwp--wide .iwp-art img { aspect-ratio: auto 1920 / 90; }
}

/* ---------- Text row (offer must not be image-only) ---------- */
.iwp-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 18px;
  margin: 12px auto 0;
  max-width: var(--iwp-cap);
  font-size: .82rem;
  line-height: 1.5;
}
.iwp-more {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  font-weight: 700;
  color: var(--accent, #0A6FA8);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color .2s;
}
.iwp-more:hover { color: var(--ink, #171516); }
.iwp-more:focus-visible {
  outline: 3px solid var(--accent, #0A6FA8);
  outline-offset: 3px;
  border-radius: 6px;
}
.iwp-more svg {
  width: 14px; height: 14px; flex: 0 0 auto;
  transition: transform .25s cubic-bezier(.22, .7, .3, 1);
}
.iwp-more:hover svg { transform: translateX(3px); }
.iwp-small { color: var(--muted, #6E6A6B); font-size: .76rem; }

/* Real-text offer line. Shown only on small screens, where the artwork's
   baked-in text renders at ~0.35 scale. Wording is iwoca-approved:
   interest-free applies to the 30-day and 3-month options only. */
.iwp-offer {
  flex: 1 0 100%;
  order: -1;
  color: var(--ink, #171516);
  font-size: .84rem;
  font-weight: 600;
  text-wrap: balance;
}
@media (min-width: 700px) { .iwp-offer { display: none; } }

/* ---------- Optional sidebar skyscraper (category pages) ---------- */
.iwp--rail { display: none; }
@media (min-width: 1000px) {
  .iwp--rail {
    display: block;
    --iwp-cap: 160px;
    margin-top: 18px;
  }
  .iwp--rail .iwp-art img { aspect-ratio: auto 160 / 600; }
  .iwp--rail .iwp-foot { font-size: .75rem; flex-direction: column; gap: 4px; }
}

/* ---------- Motion / print / high contrast ---------- */
@media (prefers-reduced-motion: reduce) {
  .iwp-art, .iwp-more, .iwp-more svg { transition: none; }
  .iwp-art:hover { transform: none; }
  .iwp-more:hover svg { transform: none; }
}
@media (forced-colors: active) {
  .iwp-art { box-shadow: none; border: 1px solid CanvasText; }
}
@media print {
  .iwp { display: none; }
}
