/* programs.css — public /programs/ listing + /program/<slug>/ detail.
   Uses site-wide tokens from redesign-v2.css (--rv2-*) for full visual continuity. */

.prg-detail-body, .prg-list-section, .prg-detail-section {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Local shorthand aliases for cleanliness — all map to site tokens */
.prg-detail-section, .prg-list-section {
  --prg-accent: var(--rv2-accent, #0057B7);
  --prg-accent-2: #003F87;
  --prg-text: var(--rv2-text, #0A1628);
  --prg-text-dim: var(--rv2-text-dim, #4A5568);
  --prg-text-mute: var(--rv2-text-mute, #8492A6);
  --prg-border: var(--rv2-border, #DDE2EB);
  --prg-bg: var(--rv2-bg-elev, #ffffff);
  --prg-bg-soft: var(--rv2-bg, #F4F6FA);
  --prg-shadow-sm: 0 1px 3px rgba(10,22,40,.05);
  --prg-shadow-md: 0 4px 16px rgba(10,22,40,.08);
  --prg-shadow-lg: 0 12px 36px rgba(10,22,40,.12);
}

/* ============ LISTING /programs/ ============ */
.prg-list-section { padding: 28px 0 60px; min-height: 60vh; background: var(--prg-bg-soft); }
.prg-list-section .container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.prg-list-title { font-size: clamp(28px, 4vw, 38px); font-weight: 800; margin: 0 0 8px; letter-spacing: -0.02em; color: var(--prg-text); }
.prg-list-sub { font-size: 15px; color: var(--prg-text-dim); margin: 0 0 28px; max-width: 720px; line-height: 1.5; }

.prg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.prg-card {
  display: block;
  background: var(--prg-bg);
  border: 1px solid var(--prg-border);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.prg-card:hover {
  border-color: var(--prg-accent);
  transform: translateY(-3px);
  box-shadow: var(--prg-shadow-lg);
}
/* Banner: natural-ratio (height follows image proportions). No top/bottom letterbox. */
.prg-card-banner { background: var(--prg-bg-soft); overflow: hidden; line-height: 0; }
.prg-card-banner img { width: 100%; height: auto; display: block; }
.prg-card-body { padding: 18px 20px; }
.prg-card-eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  font-weight: 700; color: var(--prg-accent); margin-bottom: 6px;
}
.prg-card-title { font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--prg-text); margin-bottom: 8px; }
.prg-card-meta { font-size: 12px; color: var(--prg-text-mute); display: flex; gap: 6px; flex-wrap: wrap; }
.prg-card-cta {
  margin-top: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--prg-accent);
}
.prg-card-cta svg { width: 14px; height: 14px; }
.prg-empty { text-align: center; padding: 80px 20px; color: var(--prg-text-mute); }
.prg-empty svg { width: 56px; height: 56px; opacity: .4; margin-bottom: 14px; }
.prg-empty-title { font-size: 18px; font-weight: 700; color: var(--prg-text); margin-bottom: 6px; }

/* ============ DETAIL /program/<slug>/ ============ */
.prg-detail-body { background: var(--prg-bg-soft); }
.prg-detail-section { padding: 24px 0 100px; min-height: 80vh; }
.prg-detail-section .container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.prg-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--prg-text-mute); text-decoration: none;
  margin-bottom: 18px;
  transition: color .15s;
}
.prg-back:hover { color: var(--prg-accent); }

.prg-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 980px) {
  .prg-layout { grid-template-columns: 1fr 340px; gap: 32px; align-items: start; }
}

/* ===== LEFT MAIN ===== */
.prg-main { min-width: 0; }
.prg-banner {
  background: var(--prg-bg);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--prg-border);
}
.prg-banner img { width: 100%; height: auto; display: block; }

.prg-hero-block {
  background: var(--prg-bg);
  border: 1px solid var(--prg-border);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 22px;
  box-shadow: var(--prg-shadow-sm);
}
.prg-eyebrow {
  display: inline-flex;
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  font-weight: 700; color: var(--prg-accent);
  background: rgba(0,87,183,.08);
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.prg-title {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800; line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--prg-text);
}
.prg-stat-row { display: flex; gap: 22px; flex-wrap: wrap; }
.prg-stat { display: flex; align-items: center; gap: 10px; }
.prg-stat-icon {
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  background: rgba(0,87,183,.08);
  color: var(--prg-accent);
  border-radius: 10px;
  flex-shrink: 0;
}
.prg-stat-icon svg { width: 18px; height: 18px; }
.prg-stat-val { font-size: 15px; font-weight: 800; color: var(--prg-text); }
.prg-stat-lbl { font-size: 11px; color: var(--prg-text-mute); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }

/* Description with parser */
.prg-description {
  background: var(--prg-bg);
  border: 1px solid var(--prg-border);
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 22px;
  box-shadow: var(--prg-shadow-sm);
  font-size: 15px; line-height: 1.65;
  color: var(--prg-text-dim);
}
.prg-description p { margin: 0 0 14px; }
.prg-description p:last-child { margin-bottom: 0; }
.prg-description .prg-h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--prg-text);
  margin: 22px 0 10px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.prg-description .prg-h3:first-child { margin-top: 0; }
.prg-description .prg-list { margin: 0 0 14px; padding-left: 22px; }
.prg-description .prg-list li { margin-bottom: 6px; }
.prg-description .prg-list-num { list-style: decimal; }
.prg-description ul.prg-list { list-style: none; padding-left: 0; }
.prg-description ul.prg-list li { position: relative; padding-left: 22px; }
.prg-description ul.prg-list li::before {
  content: ""; position: absolute; left: 4px; top: 10px;
  width: 6px; height: 6px;
  background: var(--prg-accent);
  border-radius: 50%;
}

/* Status card — existing application */
.prg-status-card {
  display: flex; gap: 14px; align-items: flex-start;
  border: 2px solid;
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 18px;
}
.prg-status-icon {
  flex-shrink: 0; width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fff;
}
.prg-status-icon svg { width: 20px; height: 20px; }
.prg-status-text { flex: 1; min-width: 0; }
.prg-status-title { font-size: 15px; font-weight: 800; color: var(--prg-text); margin-bottom: 6px; }
.prg-status-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--prg-text-dim); flex-wrap: wrap; }
.prg-status-badge {
  display: inline-flex; padding: 3px 10px;
  border-radius: 999px; color: #fff;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.prg-admin-note {
  margin-top: 10px; padding: 10px 12px;
  background: rgba(255,255,255,.6);
  border-radius: 8px; font-size: 13px; line-height: 1.5;
}

/* CTA card (anon) */
.prg-cta-card {
  display: flex; gap: 18px; align-items: center;
  background: linear-gradient(135deg, rgba(0,87,183,.06) 0%, rgba(0,87,183,.12) 100%);
  border: 1px solid rgba(0,87,183,.20);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 18px;
}
.prg-cta-icon {
  flex-shrink: 0; width: 56px; height: 56px;
  display: grid; place-items: center;
  background: var(--prg-accent); color: #fff;
  border-radius: 14px;
}
.prg-cta-icon svg { width: 28px; height: 28px; }
.prg-cta-text h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; color: var(--prg-text); }
.prg-cta-text p { margin: 0 0 14px; font-size: 14px; color: var(--prg-text-dim); line-height: 1.5; }

/* Primary button */
.prg-btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--prg-accent); color: #fff;
  padding: 12px 22px; border-radius: 10px;
  text-decoration: none; font-weight: 700; font-size: 14px;
  border: 0; cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  font-family: inherit;
  min-height: 44px;
  box-shadow: 0 4px 12px rgba(0,87,183,.18);
}
.prg-btn-primary:hover { background: var(--prg-accent-2); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,87,183,.24); }
.prg-btn-primary:active { transform: translateY(0); }
.prg-btn-primary[disabled] { opacity: .65; cursor: progress; transform: none; }
.prg-btn-primary svg { width: 16px; height: 16px; }

/* ===== FORM ===== */
.prg-form {
  background: var(--prg-bg);
  border: 1px solid var(--prg-border);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: var(--prg-shadow-sm);
}
.prg-form-head { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--prg-border); }
.prg-form-title { font-size: 22px; font-weight: 800; margin: 0 0 4px; color: var(--prg-text); letter-spacing: -0.01em; }
.prg-form-sub { font-size: 14px; color: var(--prg-text-dim); margin: 0; }
.prg-req { color: #DC2626; }

.prg-group { margin-bottom: 26px; }
.prg-group:last-of-type { margin-bottom: 0; }
.prg-group-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.prg-group-num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: inline-grid; place-items: center;
  background: rgba(0,87,183,.08);
  color: var(--prg-accent);
  border-radius: 50%;
  font-weight: 800;
  font-size: 12.5px;
}
.prg-group-title { font-size: 16px; font-weight: 800; color: var(--prg-text); letter-spacing: -0.01em; }
.prg-group-help { font-size: 13px; color: var(--prg-text-dim); margin-top: 2px; line-height: 1.5; }

.prg-fields { display: grid; gap: 16px; }
@media (min-width: 640px) { .prg-fields { grid-template-columns: 1fr 1fr; } }
.prg-field { display: flex; flex-direction: column; }
.prg-field label {
  font-size: 13px; font-weight: 600; color: var(--prg-text);
  margin-bottom: 6px;
}
.prg-field input, .prg-field textarea {
  width: 100%; box-sizing: border-box;
  padding: 11px 13px;
  border: 1px solid var(--prg-border);
  border-radius: 9px;
  background: var(--prg-bg);
  color: var(--prg-text);
  font-size: 14px;
  font-family: inherit;
  outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.prg-field input:focus, .prg-field textarea:focus {
  border-color: var(--prg-accent);
  box-shadow: 0 0 0 3px rgba(0,87,183,.10);
}
.prg-field input.has-error, .prg-field textarea.has-error {
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.08);
}
.prg-help { font-size: 12px; color: var(--prg-text-mute); margin-top: 5px; line-height: 1.4; }
.prg-error { color: #DC2626; font-size: 12px; margin-top: 5px; font-weight: 600; }

.prg-form-footer { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--prg-border); display: flex; flex-direction: column; gap: 10px; }
.prg-form-status { font-size: 13px; font-weight: 600; }

/* ===== STICKY SIDE ===== */
.prg-side {
  min-width: 0;
}
@media (min-width: 980px) {
  .prg-side { position: sticky; top: 24px; }
}
.prg-side-card {
  background: var(--prg-bg);
  border: 1px solid var(--prg-border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--prg-shadow-md);
}
.prg-side-logo {
  width: 56px; height: 56px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--prg-bg-soft);
  display: grid; place-items: center;
}
.prg-side-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prg-side-logo-mark {
  background: linear-gradient(180deg, #3B82F6 0%, #2563EB 100%);
  color: #fff;
  font-weight: 800;
  font-size: 22px;
}
.prg-side-title {
  font-size: 16px; font-weight: 800;
  color: var(--prg-text); line-height: 1.3;
  margin-bottom: 14px;
}
.prg-side-meta {
  display: flex; flex-direction: column; gap: 10px;
  padding-bottom: 16px; margin-bottom: 16px;
  border-bottom: 1px solid var(--prg-border);
}
.prg-side-meta-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--prg-text-dim);
}
.prg-side-meta-row strong { color: var(--prg-text); font-weight: 700; }
.prg-meta-icon {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px;
  background: var(--prg-bg-soft);
  border-radius: 8px;
  color: var(--prg-text-mute);
}
.prg-meta-icon svg { width: 14px; height: 14px; }

.prg-side-status {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  display: flex; flex-direction: column; gap: 2px;
  font-size: 13px;
}
.prg-side-status strong { font-size: 14px; font-weight: 800; }
.prg-side-status span { color: var(--prg-text-mute); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }

.prg-side-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--prg-accent); color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700; font-size: 14px;
  width: 100%; box-sizing: border-box;
  transition: background .15s;
  min-height: 44px;
}
.prg-side-cta:hover { background: var(--prg-accent-2); }
.prg-side-cta svg { width: 16px; height: 16px; }

.prg-participants {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--prg-border);
}
.prg-participants-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--prg-text-mute); font-weight: 700;
  margin-bottom: 10px;
}
.prg-participants-strip {
  display: flex; flex-wrap: wrap;
}
.prg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: #fff;
  display: inline-grid; place-items: center;
  font-weight: 700; font-size: 12px;
  margin-left: -8px;
  box-shadow: 0 1px 3px rgba(10,22,40,.10);
  cursor: default;
  transition: transform .15s, z-index .15s;
}
.prg-avatar:first-child { margin-left: 0; }
.prg-avatar:hover { transform: translateY(-2px) scale(1.05); z-index: 2; }
.prg-avatar-more {
  background: var(--prg-bg-soft);
  color: var(--prg-text-dim);
  font-size: 10.5px;
  border: 2px solid var(--prg-border);
}
.prg-avatar:nth-child(odd) { background: linear-gradient(135deg, #0057B7 0%, #003F87 100%); }
.prg-avatar:nth-child(3n) { background: linear-gradient(135deg, #1F7A4D 0%, #166040 100%); }
.prg-avatar:nth-child(4n) { background: linear-gradient(135deg, #B17F0A 0%, #8C6308 100%); }

/* ===== MOBILE STICKY CTA ===== */
.prg-mobile-cta {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 70;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--prg-border);
}
.prg-mobile-cta .prg-btn-primary {
  width: 100%; justify-content: center;
}
@media (max-width: 979px) {
  .prg-mobile-cta { display: block; }
  body.prg-detail-body { padding-bottom: 90px; }
  /* Hide sticky-side CTA on mobile to avoid dup */
  .prg-side-cta { display: none; }
  /* Bring side card before description on mobile, but visually compact */
  .prg-side { order: -1; }
}

/* ===== MOBILE COMPACT ===== */
@media (max-width: 640px) {
  .prg-detail-section { padding: 12px 0 100px; }
  .prg-detail-section .container, .prg-list-section .container { padding: 12px; }
  .prg-hero-block { padding: 18px 18px; border-radius: 14px; }
  .prg-stat-row { gap: 14px; }
  .prg-description { padding: 18px 18px; border-radius: 14px; font-size: 14.5px; }
  .prg-description .prg-h3 { font-size: 15px; }
  .prg-form { padding: 18px 18px; border-radius: 14px; }
  .prg-form-title { font-size: 18px; }
  .prg-side-card { padding: 18px; }
  .prg-cta-card { padding: 18px; gap: 14px; }
  .prg-cta-icon { width: 44px; height: 44px; }
  .prg-cta-icon svg { width: 22px; height: 22px; }
  /* iOS no-zoom */
  .prg-field input, .prg-field textarea { font-size: 16px; }
  .prg-grid { grid-template-columns: 1fr; gap: 14px; }
  .prg-title { font-size: 22px; }
}
