/* ════════════════════════════════════════════════════════════════
   PROGRAMS GRID (kit section). Pairs with program-grid.jsx. Moved out of
   site.css on 2026-11-24 so a site can load the section without copying it.
   Reads theme tokens only (DESIGN-GUIDE section 1).
   ════════════════════════════════════════════════════════════════ */
/* ---------- PROGRAMS (the section heading, .programs__head/__eyebrow/__title, stays in site.css: program pages use it too) ---------- */
/* Columns follow the card count, so no count leaves an empty cell (DESIGN-GUIDE
   section 5). program-grid.jsx sets the attributes from the cards it renders (the
   map of counts to layouts is there):
     data-layout   one | two | three | lead
     data-primary  present when exactly one card is the owner's main program
                   (that card has .progcard--primary)
     data-lone     "tablet" and/or "desktop": widths where one card is left alone
                   in the last row
   12 tracks: a card spans 6 (two per row) or 4 (three per row). Phones: one
   column in list order.
   Emphasis only ever goes to the main program: with a primary, a lone card's
   row is taken by the primary as a WIDE card on top (order:-1, the rest keep
   their order); without one, the lone card stays normal size, centered.
   A WIDE card fills its row with the photo beside the text, always this line (W):
   grid-column:1/-1;flex-direction:row;align-items:center;--pc-media:relative;--pc-shade:none;--pc-body-flex:1 1 0;--pc-pad:clamp(32px,4vw,60px); */
.programgrid{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;}
@media(min-width:761px){
  .programgrid{grid-template-columns:repeat(12,minmax(0,1fr));}
  .programgrid>.progcard{grid-column:span 6;}
  .programgrid[data-layout="one"]>.progcard{grid-column:1/-1;flex-direction:row;align-items:center;--pc-media:relative;--pc-shade:none;--pc-body-flex:1 1 0;--pc-pad:clamp(32px,4vw,60px);}
}
/* tablet: two per row. Lone last card: centered, or the primary goes wide on top */
@media(min-width:761px) and (max-width:960px){
  .programgrid[data-lone~="tablet"]:not([data-primary])>.progcard:last-child{grid-column:4/span 6;}
  .programgrid[data-lone~="tablet"][data-primary]>.progcard--primary{order:-1;grid-column:1/-1;flex-direction:row;align-items:center;--pc-media:relative;--pc-shade:none;--pc-body-flex:1 1 0;--pc-pad:clamp(32px,4vw,60px);}
}
/* desktop: three per row. A last row of two is centered; a lone last card is
   centered, or the primary goes wide on top */
@media(min-width:961px){
  .programgrid[data-layout="three"]>.progcard{grid-column:span 4;}
  .programgrid[data-layout="three"]>.progcard:nth-child(3n+1):nth-last-child(2){grid-column:3/span 4;}
  .programgrid[data-lone~="desktop"]:not([data-primary])>.progcard:last-child{grid-column:5/span 4;}
  .programgrid[data-lone~="desktop"][data-primary]>.progcard--primary{order:-1;grid-column:1/-1;flex-direction:row;align-items:center;--pc-media:relative;--pc-shade:none;--pc-body-flex:1 1 0;--pc-pad:clamp(32px,4vw,60px);}
}
/* five, 'lead': the primary large + four. Under 1200px the primary goes wide on top */
@media(min-width:761px) and (max-width:1199px){
  .programgrid[data-layout="lead"]>.progcard--primary{order:-1;grid-column:1/-1;flex-direction:row;align-items:center;--pc-media:relative;--pc-shade:none;--pc-body-flex:1 1 0;--pc-pad:clamp(32px,4vw,60px);}
}
@media(min-width:1200px){
  .programgrid[data-layout="lead"]{grid-template-columns:repeat(4,minmax(0,1fr));}
  .programgrid[data-layout="lead"]>.progcard{grid-column:span 1;}
  .programgrid[data-layout="lead"]>.progcard--primary{order:-1;grid-column:span 2;grid-row:span 2;}
}
.progcard{border-radius:var(--radius,0px);position:relative;min-height:420px;display:flex;flex-direction:column;justify-content:flex-end;overflow:hidden;background:var(--bg-deep);border:1px solid var(--border);color:var(--fg);transition:transform .4s var(--ease),border-color .3s,box-shadow .4s;text-align:left;container-type:inline-size;}
.progcard__media{position:var(--pc-media,absolute);inset:0;z-index:0;overflow:hidden;flex:0 0 54%;align-self:stretch;}
.progcard__media img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:var(--focal,50% 30%);filter:grayscale(0.2) contrast(1.05) brightness(var(--card-photo,0.7));transition:transform .6s var(--ease),filter .4s;}
.progcard::before{content:'';display:var(--pc-shade,block);position:absolute;inset:0;z-index:1;background:linear-gradient(180deg,color-mix(in srgb,var(--bg-deep) 10%,transparent) 0%,color-mix(in srgb,var(--bg-deep) 40%,transparent) 50%,color-mix(in srgb,var(--bg-deep) 90%,transparent) 100%);}
.progcard__body{position:relative;z-index:2;padding:var(--pc-pad,clamp(26px,2.4vw,38px));display:flex;flex-direction:column;gap:14px;flex:var(--pc-body-flex,0 1 auto);}
.progcard__grade{font-family:var(--font-body);font-size:11px;font-weight:700;letter-spacing:0.2em;text-transform:uppercase;color:var(--accent);}
.progcard__name{font-family:var(--font-display);font-size:clamp(32px,3.4vw,48px);font-size:min(clamp(32px,3.4vw,48px),11cqi);line-height:0.9;text-transform:uppercase;}
/* min(): the name never outgrows a narrow card (three per row); two per row and phones keep the clamp */
.progcard__desc{font-size:15px;line-height:1.55;color:color-mix(in srgb,var(--fg) 82%,transparent);max-width:40ch;}
.progcard__cta{display:inline-flex;align-items:center;gap:9px;margin-top:6px;font-family:var(--font-display);font-size:13px;letter-spacing:0.16em;text-transform:uppercase;color:var(--accent);}
.progcard__cta span{transition:transform .25s;}
.progcard:hover{transform:translateY(-4px);border-color:color-mix(in srgb,var(--accent) 55%,transparent);box-shadow:0 24px 60px rgba(0,0,0,0.55);}
.progcard:hover .progcard__media img{transform:scale(1.05);filter:grayscale(0.05) brightness(0.82);}
.progcard:hover .progcard__cta span{transform:translateX(5px);}

/* Contain card: a screenshot or app mockup shown whole, never cropped or
   shaded (from BAM GTA's Virtual Academy card, so text and phone never
   overlap). Wide card: image on the right, text on the left. Narrow card:
   image on top, text below. The mask only reads alpha, so --fg is just "solid". */
.progcard--contain{background:var(--bg-deep);}
.progcard--contain .progcard__media{left:46%;-webkit-mask-image:linear-gradient(90deg,transparent 0,var(--fg) 22%);mask-image:linear-gradient(90deg,transparent 0,var(--fg) 22%);}
.progcard--contain .progcard__media img{filter:none;object-fit:contain;object-position:center;}
.progcard--contain::before{background:none;}
.progcard--contain .progcard__body{max-width:50%;}
@media(max-width:960px){
  .progcard--contain{min-height:660px;}
  .progcard--contain .progcard__media{left:0;bottom:auto;height:58%;-webkit-mask-image:none;mask-image:none;}
  .progcard--contain .progcard__media img{object-position:center top;}
  .progcard--contain::before{background:linear-gradient(180deg,transparent 40%,var(--bg-deep) 60%);}
  .progcard--contain .progcard__body{max-width:none;}
}

/* Phone focal point: a photo can set --focal-m for the tall phone crop; it falls back to --focal (DESIGN-GUIDE section 3) */
@media(max-width:760px){
.progcard__media img{object-position:var(--focal-m,var(--focal,50% 30%));}
}
