/* ============================================================
   GLOBAL COMPONENT TEMPLATE · Programs block · STRUCTURE ONLY
   ------------------------------------------------------------
   LAYOUT / GEOMETRY ONLY: display, grid/flex, gaps, padding,
   sizing, structural animation. NO colors, fonts, backgrounds,
   border colors or shadows: each academy supplies those in its own
   skin CSS, loaded AFTER this file, targeting the same class names.
   Spacing reads design-system tokens with a fallback, so a site
   without them still lays out. Holds at 390px with no sideways scroll.

   Reference skin: clients/bam-san-jose/site/programs-block.css
   ============================================================ */

.pb { width: 100%; min-width: 0; }
.pb *, .pb *::before, .pb *::after { box-sizing: border-box; }

/* screen-reader-only loading line */
.pb__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- the grid: one column on a phone, as many as fit above ---------- */
.pb__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--pb-gap, clamp(16px, 2vw, 28px));
}

/* ---------- a card ---------- */
.pb-card {
  display: flex; flex-direction: column; min-width: 0;
  padding: var(--pb-pad, clamp(22px, 2.4vw, 34px));
  gap: 14px;
}
.pb-card__who { overflow-wrap: anywhere; }
.pb-card__name { margin: 0; overflow-wrap: anywhere; }
.pb-card__facts { margin: 4px 0 0; padding: 0; display: grid; gap: 12px; }
.pb-card__fact { display: grid; gap: 4px; min-width: 0; }
.pb-card__fact dt, .pb-card__fact dd { margin: 0; }
.pb-card__fact dd { overflow-wrap: anywhere; }
.pb-card__time { display: block; }
/* 2+ classes at different days/times: one line per class (layout only). */
.pb-card__sched { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pb-card__sched-row { margin: 0; }
.pb-card__note { margin: 0; }
/* the button sits on the card's floor so a row of cards lines up */
.pb-card__cta { margin-top: auto; padding-top: 10px; display: flex; }
.pb-btn { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; text-align: center; white-space: normal; }
@media (max-width: 520px) { .pb-card__cta .pb-btn { width: 100%; } }

/* ---------- loading skeleton ---------- */
.pb-card--skeleton { min-height: 230px; }
.pb-skel { display: block; height: 14px; width: 60%; }
.pb-skel--who { width: 35%; height: 12px; }
.pb-skel--name { width: 75%; height: 34px; }
.pb-skel--line { width: 55%; }
.pb-skel--btn { margin-top: auto; width: 100%; height: 50px; }
@media (prefers-reduced-motion: no-preference) {
  .pb-skel { animation: pb-pulse 1.4s ease-in-out infinite; }
}
@keyframes pb-pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

/* ---------- empty + error ---------- */
.pb__msg { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding: var(--pb-pad, clamp(22px, 2.4vw, 34px)); }
.pb__msg-text { margin: 0; max-width: 56ch; }
.pb__msg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
@media (max-width: 520px) { .pb__msg-actions { flex-direction: column; align-items: stretch; width: 100%; } .pb__msg-actions .pb-btn { width: 100%; } }
