/* Promotions in the new design (APEX; redesign release 3-4). The same markup and the same stored values as the current design
   (promotion_banner() and article_next_rail_promotions(): the click tag, the promotion id, rel="sponsored", the framing classes and
   the phone switch are untouched), drawn in the new design's language: the card's radius and line, the kerb before the heading,
   the outline badge, the type scale, the red button, and both reading modes. promotions.css, which every page loads, still
   draws the current design's banners and is unchanged. Loaded only by the new design's pages (header.php): the new homepage and
   the new article page. The panel never loads it; its promotion editor and preview are release 3-3's, unchanged (owner).

   Where it applies:
   - the homepage banners, layouts A (Split View), B (Banner View) and C (Compact View), inside .promo-apex: the new homepage's
     five promotion slots carry it (templates/home.php);
   - the card beside the article, layout D (Card View; .promotion-card), on the new article page.

   Every banner rule here is prefixed with .promo-apex, one class heavier than promotions.css's own (which loads first, and whose
   container query at 700 px still applies inside the same container), so the new look wins in every state without touching that
   file; the phone switch is restated at the same weight (below). The pictures keep promotions.css's framing (the
   --promotion-image-* and --promotion-mobile-* properties its classes set).
   Rules kept: every colour a token; no text under 12 px; the owner's words are never cut (title, description and note show
   whole, and the card grows); the whole card is the button's target, as on the mockup and the card beside the article, while the
   description and the note sit above that target, so their text (a coupon code) can be selected. One link per card, one click. */

/* ------------------------------------------------------------------ the homepage banners: what the three layouts share */
.promo-apex .home-promotions{gap:var(--s5)}
.promo-apex .promotion{position:relative;isolation:isolate;display:grid;min-width:0;overflow:hidden;border:1px solid var(--line);border-radius:var(--r-lg);background:var(--surface);color:var(--text);transition:border-color .15s}
.promo-apex .promotion:hover{border-color:var(--line-strong)}
.promo-apex .promotion-photo{position:relative;overflow:hidden;min-width:0;background:var(--surface-2)}
/* A picture that does not load: the tile's colour, never the browser's broken-image mark and the words beside it. Only a picture
   that failed draws this box (a loaded one has no ::after). A published banner always names its picture; this is for a file gone
   missing. */
.promo-apex .promotion-photo img::after,.promotion-card-media img::after{content:"";position:absolute;inset:0;background:linear-gradient(135deg,var(--surface-2),var(--surface))}
.promo-apex .promotion-copy{display:flex;flex-direction:column;align-items:flex-start;min-width:0;z-index:auto}
.promo-apex .promotion-kicker,.promotion-card-kicker{display:flex;flex-wrap:wrap;align-items:center;gap:var(--s2) var(--s3);margin:0 0 var(--s3);font:600 var(--fs-label)/1.3 var(--font-text);letter-spacing:.07em;color:var(--text-muted)}
/* The eyebrow takes the new design's kerb, as every section heading does; the badge is the outline badge. */
.promo-apex .promotion-kicker > span:not(.promotion-badge),.promotion-card-kicker > span:not(.promotion-card-badge){display:inline-flex;align-items:flex-start;gap:var(--s3);min-width:0;overflow-wrap:anywhere}
.promo-apex .promotion-kicker > span:not(.promotion-badge)::before,.promotion-card-kicker > span:not(.promotion-card-badge)::before{content:"";display:inline-block;width:20px;height:12px;flex-shrink:0;background:repeating-linear-gradient(90deg,var(--accent) 0 5px,var(--kerb-light) 5px 10px);transform:skewX(-20deg);border-radius:1px;margin-top:1px}
.promo-apex .promotion-badge,.promotion-card-badge{display:inline-flex;align-items:center;min-height:24px;padding:2px var(--s2);border:1px solid var(--line-control);border-radius:var(--r-sm);font:700 var(--fs-label)/1.2 var(--font-text);letter-spacing:.06em;color:var(--text);overflow-wrap:anywhere}
.promo-apex .promotion h2{margin:0;font:var(--weight-heading) var(--fs-h2)/1.1 var(--font-heading);letter-spacing:-.01em;color:var(--text-strong);text-wrap:balance;overflow-wrap:anywhere}
.promo-apex .promotion .promotion-description{position:relative;z-index:2;max-width:62ch;margin:var(--s3) 0 0;font-size:var(--fs-body);line-height:1.55;color:var(--text-muted);white-space:pre-line;overflow-wrap:anywhere;cursor:text}
.promo-apex .promotion-action{display:flex;flex-wrap:wrap;align-items:center;gap:var(--s2) var(--s4);min-width:0;z-index:1}
.promo-apex .promotion-action .button,.promo-apex .promotion-c .promotion-action .button{display:inline-flex;align-items:center;justify-content:center;gap:var(--s2);max-width:100%;min-height:48px;margin:0;padding:var(--s2) var(--s5);border:1px solid transparent;border-radius:var(--r-md);background:var(--accent-surface);color:var(--on-accent);font:700 var(--fs-small)/1.25 var(--font-text);letter-spacing:0;white-space:normal;text-align:center;overflow-wrap:anywhere;transition:background-color .15s}
.promo-apex .promotion-action .button:hover,.promo-apex .promotion:hover .promotion-action .button{background:var(--accent-hover);color:var(--on-accent)}
.promo-apex .promotion-action .button:focus-visible{outline:2px solid var(--focus);outline-offset:3px}
/* The whole card is the button's target, as on the mockup; the button's own ring shows where the keyboard is. */
.promo-apex .promotion-action .button::after{content:"";position:absolute;inset:0;z-index:1}
.promo-apex .promotion-button-text{min-width:0;margin:0}
.promo-apex .promotion .promotion-note{position:relative;z-index:2;margin:0;font-size:var(--fs-caption);line-height:1.45;color:var(--text-faint);white-space:pre-line;overflow-wrap:anywhere;cursor:text}
/* "Show on phones and tablets" off (S-14): promotions.css hides such a banner on a touch device with a rule of the same weight as
   the display above, which loads after it and would win; restated here one class heavier, so a banner kept off phones stays off
   them also when it shares its slot with one that shows (release 3-4 review). The block of only such banners goes with it. */
@media (hover:none),(pointer:coarse){
  .promo-apex .promotion.promotion-desktop-only{display:none}
}

/* ------------------------------------------------------------------ A, Split View: the words beside the picture */
.promo-apex .promotion-a{grid-template-columns:minmax(0,5fr) minmax(0,6fr);grid-template-rows:minmax(0,1fr) auto auto minmax(0,1fr);grid-template-areas:'. photo' 'copy photo' 'action photo' '. photo';min-height:360px}
.promo-apex .promotion-a .promotion-photo{grid-area:photo}
.promo-apex .promotion-a .promotion-copy{grid-area:copy;padding:var(--s7) var(--s7) 0}
.promo-apex .promotion-a .promotion-action{grid-area:action;padding:var(--s5) var(--s7) var(--s7)}

/* ------------------------------------------------------------------ B, Banner View: the words over the picture
   The photograph fills the card under one-colour veils, so the words are the photo viewer's light inks in both themes (as release
   3-3's fix set them). */
.promo-apex .promotion-b{grid-template-columns:minmax(0,1fr);grid-template-rows:1fr auto;grid-template-areas:'copy' 'action';min-height:440px;color:var(--viewer-ink)}
.promo-apex .promotion-b .promotion-photo{position:absolute;inset:0;grid-area:auto;z-index:-1}
.promo-apex .promotion-b .promotion-photo::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,var(--promo-veil-1),var(--promo-veil-2) 35%,var(--promo-veil-3) 70%,var(--promo-veil-4)),linear-gradient(0deg,var(--promo-veil-5),transparent)}
.promo-apex .promotion-b .promotion-copy{grid-area:copy;align-self:end;max-width:680px;padding:var(--s8) var(--s7) 0}
.promo-apex .promotion-b h2{font:var(--weight-display) var(--fs-h1)/1.02 var(--font-display);letter-spacing:-.015em;color:var(--viewer-ink)}
.promo-apex .promotion-b .promotion-kicker,.promo-apex .promotion-b .promotion-description,.promo-apex .promotion-b .promotion-note{color:var(--viewer-status-ink)}
.promo-apex .promotion-b .promotion-badge{border-color:var(--viewer-button-line);color:var(--viewer-ink)}
.promo-apex .promotion-b .promotion-kicker > span:not(.promotion-badge)::before{background:repeating-linear-gradient(90deg,var(--accent) 0 5px,var(--viewer-ink) 5px 10px)}
.promo-apex .promotion-b .promotion-action{grid-area:action;padding:var(--s5) var(--s7) var(--s7)}

/* ------------------------------------------------------------------ C, Compact View: picture, words, action (the mockup's row) */
.promo-apex .promotion-c{grid-template-columns:200px minmax(0,1fr) 260px;grid-template-rows:auto;grid-template-areas:'photo copy action';gap:0;min-height:180px;align-items:stretch}
.promo-apex .promotion-c .promotion-photo{grid-area:photo;align-self:stretch;min-height:180px}
.promo-apex .promotion-c .promotion-copy{grid-area:copy;align-self:center;padding:var(--s5) var(--s6)}
.promo-apex .promotion-c .promotion-kicker{margin-bottom:var(--s2)}
.promo-apex .promotion-c h2{font:var(--weight-heading) var(--fs-h3)/1.2 var(--font-heading)}
.promo-apex .promotion-c .promotion-description{margin-top:var(--s2);font-size:var(--fs-small)}
.promo-apex .promotion-c .promotion-action{grid-area:action;flex-direction:column;align-items:stretch;justify-content:center;padding:var(--s5);border-left:1px solid var(--line)}
.promo-apex .promotion-c .promotion-action .button{width:100%}
.promo-apex .promotion-c .promotion-note{text-align:center}

/* ------------------------------------------------------------------ narrow: the banner's container under 700 px (a phone, a
   tablet's column, the panel's phone preview). The same container query as promotions.css, so it replaces its compact rules. */
@container (max-width:700px){
  .promo-apex .promotion-a{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto;grid-template-areas:'photo' 'copy' 'action';min-height:0}
  .promo-apex .promotion-a .promotion-photo{aspect-ratio:16/9}
  .promo-apex .promotion-copy,.promo-apex .promotion-a .promotion-copy{padding:var(--s5) var(--s5) 0}
  .promo-apex .promotion-action,.promo-apex .promotion-a .promotion-action{padding:var(--s4) var(--s5) var(--s5)}
  .promo-apex .promotion h2{font-size:var(--fs-h2);letter-spacing:-.01em}
  .promo-apex .promotion .promotion-description{font-size:var(--fs-small)}
  .promo-apex .promotion-action .button{width:100%}
  .promo-apex .promotion-kicker,.promo-apex .promotion .promotion-note,.promo-apex .promotion-c .promotion-kicker{font-size:var(--fs-label)}
  .promo-apex .promotion .promotion-note{font-size:var(--fs-caption)}
  .promo-apex .promotion-b{min-height:460px}
  .promo-apex .promotion-b .promotion-copy{padding:184px var(--s5) 0}
  .promo-apex .promotion-b .promotion-action{padding:var(--s4) var(--s5) var(--s5)}
  .promo-apex .promotion-b h2{font-size:var(--fs-h2);line-height:1.05}
  .promo-apex .promotion-b .promotion-photo::after{background:linear-gradient(0deg,var(--promo-veil-6),var(--promo-veil-7) 55%,var(--promo-veil-8))}
  .promo-apex .promotion-c{grid-template-columns:104px minmax(0,1fr);grid-template-areas:'photo copy' 'action action';gap:0;min-height:0}
  .promo-apex .promotion-c .promotion-photo{min-height:128px}
  .promo-apex .promotion-c .promotion-copy{align-self:center;padding:var(--s4)}
  .promo-apex .promotion-c h2{font:var(--weight-title) var(--fs-h4)/1.3 var(--font-title);letter-spacing:0}
  .promo-apex .promotion-c .promotion-description{font-size:var(--fs-caption)}
  .promo-apex .promotion-c .promotion-action{padding:var(--s4);border-left:0;border-top:1px solid var(--line)}
}

/* ------------------------------------------------------------------ D, Card View: the card beside the article (D10)
   Picture, kicker and badge, title, description, the red button and the note, at the rail's 300 px (or the width of the column
   under the article on a phone). Moved here from article-next.css. Kept off phones by article-next.css's own rule (.ar-art-promos
   .promotion-desktop-only, heavier than .promotion-card). */
.promotion-card{position:relative;display:flex;flex-direction:column;margin:0;overflow:hidden;border-radius:var(--r-lg);border:1px solid var(--line);background:var(--surface);color:var(--text);transition:border-color .15s}
.promotion-card:hover{border-color:var(--line-strong)}
.promotion-card-media{position:relative;overflow:hidden;aspect-ratio:16/10;background:var(--surface-2)}
.promotion-card-media img{position:absolute;inset:0;width:100%;height:100%;object-fit:var(--promotion-image-fit,cover);object-position:var(--promotion-image-x,50%) var(--promotion-image-y,50%);transform:scale(var(--promotion-image-zoom,1));transform-origin:var(--promotion-image-x,50%) var(--promotion-image-y,50%)}
.promotion-card-media .promotion-image-empty{position:absolute;inset:0;display:grid;place-items:center;margin:0;padding:var(--s4);text-align:center;font-size:var(--fs-label);color:var(--text-muted)}
.promotion-card-body{display:flex;flex-direction:column;gap:var(--s2);padding:var(--s4);min-width:0}
.promotion-card-kicker{margin:0}
.promotion-card-title,.promotion-card-body > h3{margin:0;font:var(--weight-title) var(--fs-h4)/1.3 var(--font-title);color:var(--text-strong);overflow-wrap:anywhere}
.promotion-card-description{position:relative;z-index:1;margin:0;font-size:var(--fs-small);line-height:1.55;color:var(--text-muted);white-space:pre-line;overflow-wrap:anywhere;cursor:text}
.promotion-card-action{display:grid;gap:var(--s2);margin-top:var(--s2)}
.promotion-card-button{display:flex;align-items:center;justify-content:center;min-height:44px;padding:var(--s2) var(--s5);border-radius:var(--r-md);background:var(--accent-surface);color:var(--on-accent);font:700 var(--fs-small)/1.25 var(--font-text);text-align:center;overflow-wrap:anywhere;transition:background-color .15s}
.promotion-card-button:hover,.promotion-card:hover .promotion-card-button{background:var(--accent-hover);color:var(--on-accent)}
/* The whole card is the button's target, as on the mockup */
.promotion-card-button::after{content:"";position:absolute;inset:0}
.promotion-card-note{position:relative;z-index:1;margin:0;font-size:var(--fs-label);line-height:1.5;color:var(--text-faint);text-align:center;white-space:pre-line;overflow-wrap:anywhere;cursor:text}
