/* =============================================================================
   EPA LANDING / LISTING LAYER   (loads BEFORE epa-mobile.css; safe to remove as a unit)
   -----------------------------------------------------------------------------
   Used by: Class 11-12 hub + program listings, CA Foundation hub + inner pages,
   college guides, and the legacy CBSE pages (cbse, cbse-programs, cbse-enroll,
   thank-you pages, courses, course-details).

   Reuses the shared components from epa-mobile.css (.crumbs, .prog-hero, .prog-list,
   .prog-faq, .prog-field, .prog-enrol, .epa-cta-bar) and only adds what those do not
   cover. Same language: navy leads, orange accent, serif headings, 4px corners,
   hairline rules, no gradients, no cards inside cards.
   ========================================================================== */

/* A grid cell may never be wider than the screen because of a table or long word. */
.grid > *, .prog-layout > *, .lp-split > * { min-width: 0; }

/* ---- Section rhythm on phones ------------------------------------------- */
@media (max-width: 768px) {
  .section-header { margin-bottom: 28px; }
  .section-header p { font-size: 1.0625rem; line-height: 1.6; }
  .section-header .overline { margin-bottom: 12px; }
  .section-header h2 { margin-bottom: 12px; }
  .content-section { padding-top: 32px; padding-bottom: 32px; }
}

/* ---- Hub hero: tidy the spacing the inline styles left out ---------------- */
.lp-lede { max-width: 62ch; margin: 0 auto 24px; }
.lp-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
@media (max-width: 480px) {
  .lp-actions { flex-direction: column; align-items: stretch; }
  .lp-actions .btn { width: 100%; justify-content: center; }
}

/* Trust chips under the hero actions (were three inline-styled boxes). */
.lp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding: 0; border: 0; }
.lp-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--epa-ink);
  text-decoration: none;
  background: var(--epa-white);
  border: 1px solid var(--epa-border);
  border-radius: var(--radius-md);
}
a.lp-chip { min-height: 44px; }
a.lp-chip:hover { border-color: var(--epa-border-dark); }
@media (max-width: 992px) { .lp-chips { justify-content: center; } }

/* ---- Hairline rows (replaces coloured-border boxes) ----------------------- */
.lp-rows { display: block; margin: 0; padding: 0; list-style: none; }
.lp-rows > * { padding: 14px 0; }
.lp-rows > * + * { border-top: 1px solid var(--epa-border); }
.lp-rows strong { display: block; color: var(--epa-ink); line-height: 1.4; }
.lp-rows p { margin: 4px 0 0; font-size: 15px; line-height: 1.55; color: var(--epa-text-muted); }

/* ---- Programme cards (listing + hub) -------------------------------------- */
.program-card { text-align: left; }
.lp-price {
  margin: 0 0 14px;
  font-size: clamp(1.6rem, 7vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--epa-ink);
  font-variant-numeric: tabular-nums;
}
.lp-price small { font-size: 1rem; font-weight: 400; color: var(--epa-text-muted); }
.lp-fee {
  margin: 0 0 16px;
  padding: 12px 0;
  border-top: 1px solid var(--epa-border);
  border-bottom: 1px solid var(--epa-border);
}
.lp-fee__label { font-size: 13px; line-height: 1.3; color: var(--epa-text-muted); }
.lp-fee__row { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.lp-fee__amt { font-size: 1.375rem; font-weight: 700; line-height: 1.2; color: var(--epa-ink); }
.lp-fee__row + .lp-fee__row .lp-fee__amt { font-size: 1.125rem; }
.lp-fee__mode { font-size: 14px; color: var(--epa-text-muted); }
.lp-intro { margin: 0 0 14px; font-size: 15px; line-height: 1.6; color: var(--epa-text-muted); }

@media (max-width: 768px) {
  .program-card__banner { height: auto; min-height: 0; justify-content: flex-start; padding: 10px 20px; }
  .program-card__badge { padding: 4px 10px; font-size: 12px; letter-spacing: 0.06em; box-shadow: none; }
  .program-card__body { padding: 20px; }
  .program-card__title { margin-bottom: 12px; font-size: 1.25rem; }
  .program-card__features { margin-bottom: 20px; }
  .program-card__features li { margin-bottom: 8px; font-size: 15px; line-height: 1.5; }
  .program-card__features li i { margin-top: 5px; }
  .program-card__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 16px;
  }
}

/* ---- Plan list (CBSE pages): hairline-bordered, price first ---------------- */
.lp-plans { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.lp-plan {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--epa-white);
  border: 1px solid var(--epa-border);
  border-radius: var(--radius-md);
}
.lp-plan[hidden] { display: none; }
.lp-plan--lead { border-color: var(--epa-primary); }
.lp-plan__tag {
  align-self: flex-start;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--epa-primary-dark);
  background: var(--epa-primary-light);
  border-radius: var(--radius-md);
}
.lp-plan h3 { margin: 0; font-size: 1.25rem; line-height: 1.3; }
.lp-plan__desc { margin: 0; font-size: 15px; line-height: 1.6; color: var(--epa-text-muted); }
.lp-plan__price { margin: 0; font-size: 1.5rem; font-weight: 700; line-height: 1.2; color: var(--epa-ink); font-variant-numeric: tabular-nums; }
.lp-plan__price small { font-size: 0.9rem; font-weight: 400; color: var(--epa-text-muted); }
.lp-plan .prog-checks { margin: 0; }
.lp-plan .prog-checks li { padding-top: 9px; padding-bottom: 9px; font-size: 15px; }
.lp-plan .prog-checks li::before { top: 10px; }
.lp-plan > .btn, .lp-plan > a.btn { margin-top: 4px; width: 100%; min-height: 48px; }
@media (min-width: 700px) {
  .lp-plans { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
}

/* ---- Filters (programs listing) ------------------------------------------- */
.lp-filters { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0 0 24px; }
.lp-filters .prog-field { margin: 0; }
@media (min-width: 560px) { .lp-filters { grid-template-columns: 1fr 1fr; max-width: 560px; } }

/* ---- Stacked table: real table on desktop, labelled rows on phones --------- */
.lp-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--epa-white);
  border: 1px solid var(--epa-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 15px;
}
.lp-table th, .lp-table td { padding: 12px 16px; text-align: left; vertical-align: top; line-height: 1.5; }
.lp-table thead th { background: var(--epa-bg-alt); color: var(--epa-ink); font-weight: 700; }
.lp-table tbody tr + tr { border-top: 1px solid var(--epa-border); }
.lp-table tbody th, .lp-table tbody td:first-child { font-weight: 600; color: var(--epa-ink); }
.lp-table td { color: var(--epa-text-muted); }
.lp-table .is-key { font-weight: 700; color: var(--epa-ink); }
@media (max-width: 640px) {
  .lp-table:not(.lp-table--keep), .lp-table:not(.lp-table--keep) tbody, .lp-table:not(.lp-table--keep) tr,
  .lp-table:not(.lp-table--keep) th, .lp-table:not(.lp-table--keep) td { display: block; width: auto; }
  .lp-table:not(.lp-table--keep) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .lp-table:not(.lp-table--keep) tbody tr { padding: 12px 0; }
  .lp-table:not(.lp-table--keep) th, .lp-table:not(.lp-table--keep) td { padding: 2px 16px; border: 0; }
  .lp-table:not(.lp-table--keep) td:first-child, .lp-table:not(.lp-table--keep) tbody th { padding-bottom: 6px; font-size: 16px; }
  .lp-table:not(.lp-table--keep) td[data-label]:not(:first-child)::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: var(--epa-ink);
  }
  .lp-table--keep th, .lp-table--keep td { padding: 10px 12px; font-size: 14px; }
}

/* ---- Forms ----------------------------------------------------------------- */
.lp-form { display: grid; gap: 14px; margin: 0; }
.lp-form .prog-field { margin: 0; }
.lp-form .prog-field label span { font-weight: 400; color: var(--epa-text-muted); }
.lp-form .btn { width: 100%; min-height: 52px; margin-top: 4px; }
.prog-enrol h3 { margin: 0 0 16px; font-size: 1.375rem; line-height: 1.25; text-align: left; }
.lp-card-form { padding: 20px; background: var(--epa-white); border: 1px solid var(--epa-border-dark); border-radius: var(--radius-md); }
.lp-card-form h3 { margin: 0 0 16px; font-size: 1.375rem; line-height: 1.25; text-align: left; }
@media (min-width: 700px) { .lp-card-form { padding: 28px; } }

/* ---- Contact block: tappable rows ------------------------------------------ */
.lp-split { display: grid; gap: 32px; align-items: start; }
@media (min-width: 900px) { .lp-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; } }
.lp-contact { display: grid; gap: 4px; margin: 20px 0 0; padding: 0; list-style: none; }
.lp-contact li, .lp-contact a { display: flex; align-items: center; gap: 12px; min-height: 44px; line-height: 1.4; }
.lp-contact i { width: 20px; text-align: center; color: var(--epa-primary-dark); }
.lp-contact a { color: var(--epa-ink); font-weight: 600; text-decoration: none; }
.lp-contact a:hover { color: var(--epa-primary-dark); }

/* ---- Stat strip: 2 x 2 on phones instead of four tall rows ------------------ */
@media (max-width: 480px) {
  .stat-bar { padding: 28px 0; }
  .stat-bar__inner { grid-template-columns: 1fr 1fr; gap: 24px 12px; }
  .stat-bar__value { font-size: 2rem; }
  .stat-bar__label { font-size: 0.875rem; }
}

/* ---- Lists inside centred sections stay left-aligned --------------------- */
.prog-list, .prog-faq, .lp-rows, .lp-plans { text-align: left; }

/* ---- College guides --------------------------------------------------------- */
.college-hero { margin-top: 0 !important; background: var(--epa-bg-light) !important; }
.college-badge { background: var(--epa-ink) !important; border-radius: var(--radius-md) !important; font-size: 13px !important; letter-spacing: 0.04em; }
.college-hero h1 { margin-bottom: 16px; }
.college-hero p { margin: 0 auto 24px; max-width: 62ch; }
@media (max-width: 768px) {
  .college-hero { padding: 24px 0 32px !important; }
  .stat-card { padding: 16px 12px; }
  .feature-card { padding: 20px !important; }
  .feature-card:hover { transform: none !important; }
  .table-responsive { overflow: visible; }
}

/* ---- Thank-you pages -------------------------------------------------------- */
.ty-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px var(--epa-gutter, 16px);
  background: var(--epa-bg-light);
}
.ty-card {
  width: 100%;
  max-width: 520px;
  padding: 32px 24px;
  text-align: center;
  background: var(--epa-white);
  border: 1px solid var(--epa-border);
  border-radius: var(--radius-md);
}
.ty-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  font-size: 24px;
  color: var(--epa-primary-dark);
  background: var(--epa-primary-light);
  border-radius: var(--radius-md);
}
.ty-card h1 { margin: 0 0 12px; font-size: clamp(1.6rem, 7vw, 2rem); line-height: 1.2; }
.ty-card p { margin: 0 0 20px; line-height: 1.6; color: var(--epa-text-secondary); }
.ty-card .btn { width: 100%; min-height: 48px; margin-top: 10px; }
.ty-steps { margin: 0 0 20px; padding: 0; list-style: none; text-align: left; }
.ty-steps h2 { margin: 0 0 4px; font-size: 1.125rem; }
.ty-steps li { padding: 10px 0 10px 28px; position: relative; line-height: 1.5; color: var(--epa-text-secondary); border-top: 1px solid var(--epa-border); }
.ty-steps li::before { content: "\f00c"; position: absolute; left: 2px; top: 11px; font: 900 14px/1.5 "Font Awesome 6 Free"; color: var(--epa-primary-dark); }
.ty-card__home { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; font-weight: 600; color: var(--epa-ink); }

@media (prefers-reduced-motion: reduce) {
  .program-card, .btn { transition: none; }
}

/* ---- Small shared bits ---------------------------------------------------- */
.lp-status {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--epa-primary-dark);
  background: var(--epa-primary-light);
  border-radius: var(--radius-md);
}
.lp-note {
  margin: 0 0 20px;
  padding: 10px 0;
  font-weight: 600;
  line-height: 1.4;
  color: var(--epa-ink);
  border-top: 1px solid var(--epa-border);
  border-bottom: 1px solid var(--epa-border);
}
.lp-choice { padding: 24px; }
.lp-choice .prog-list__icon { margin-bottom: 16px; }
.lp-choice h2 { margin: 0 0 8px; }
.lp-choice .prog-checks { margin: 16px 0 24px; text-align: left; }
.lp-choice .btn { width: 100%; min-height: 48px; }
@media (min-width: 700px) { .lp-choice { padding: 32px; } }

/* Quick links list inside the side panel */
.lp-links { margin: 0; padding: 0; list-style: none; }
.lp-links a { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; color: var(--epa-primary-dark); text-decoration: none; }
.lp-links a:hover { color: var(--epa-ink); }
.lp-links i { font-size: 12px; }

/* Section heading + lede on legacy pages (left aligned, readable measure) */
.lp-head { max-width: 62ch; margin: 0 0 20px; }
.lp-head h2 { margin: 0 0 8px; font-size: clamp(1.4rem, 5.6vw, 1.75rem); line-height: 1.2; }
.lp-head p { margin: 0; line-height: 1.65; color: var(--epa-text-secondary); }
.lp-contact small { display: block; font-size: 13px; font-weight: 400; color: var(--epa-text-muted); line-height: 1.2; }

/* ---- Enrolment configurator (cbse-enroll) ------------------------------------ */
.lp-step { margin: 0 0 8px; padding: 20px 0; border: 0; border-top: 1px solid var(--epa-border); min-width: 0; }
.lp-step:first-of-type { border-top: 0; padding-top: 4px; }
.lp-step legend { float: left; width: 100%; margin: 0 0 12px; padding: 0; font-size: 1.0625rem; font-weight: 700; line-height: 1.35; color: var(--epa-ink); }
.lp-step legend + * { clear: both; }
.lp-step__hint { display: block; margin: -6px 0 12px; font-size: 14px; line-height: 1.4; color: var(--epa-text-muted); }
.lp-step__flag { display: inline-block; margin-left: 8px; padding: 2px 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--epa-primary-dark); background: var(--epa-primary-light); border-radius: var(--radius-md); vertical-align: middle; }
.lp-chips-choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.lp-choice-opt { position: relative; display: block; margin: 0; cursor: pointer; }
.lp-choice-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.lp-choice-opt span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 12px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  color: var(--epa-ink);
  background: var(--epa-white);
  border: 1px solid var(--epa-border-dark);
  border-radius: var(--radius-md);
}
.lp-choice-opt:hover span { border-color: var(--epa-ink); }
.lp-choice-opt input:checked + span { color: #fff; background: var(--epa-ink); border-color: var(--epa-ink); }
.lp-choice-opt input:focus-visible + span { outline: 3px solid var(--epa-primary); outline-offset: 2px; }
.lp-choice-opt--wide { grid-column: 1 / -1; }
.lp-summary { margin: 0 0 4px; }
.lp-summary > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; }
.lp-summary > div + div { border-top: 1px solid var(--epa-border); }
.lp-summary dt { color: var(--epa-text-muted); }
.lp-summary dd { margin: 0; font-weight: 600; text-align: right; color: var(--epa-ink); }
.prog-enrol .summary-title { margin: 0 0 8px; }
.lp-hero-figure { display: none; margin: 0; }
.lp-hero-figure img { display: block; width: 100%; height: auto; border-radius: var(--radius-md); }
.lp-hero-figure figcaption { margin-top: 10px; font-weight: 600; color: var(--epa-ink); }
@media (min-width: 992px) { .lp-hero-figure { display: block; } }
.ty-steps ul { margin: 0; padding: 0; list-style: none; }
.ty-steps h2 { margin: 0 0 8px; font-size: 1.125rem; }

/* ---- Legacy course listing (courses.html) ---------------------------------- */
.courses-grid-layout { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
@media (max-width: 768px) {
  .course-hero { padding: calc(var(--header-height, 70px) + 28px) 0 32px; }
  .course-hero h1 { font-size: clamp(1.75rem, 7.4vw, 2.25rem); margin-bottom: 12px; }
  .course-hero p { font-size: 1.0625rem; }
  .course-filters { gap: 8px; margin-bottom: 24px; }
  .filter-btn { min-height: 44px; padding: 10px 18px; }
  .course-item:hover { transform: none; }
  .course-body { padding: 20px; }
  .course-footer { flex-wrap: wrap; }
  .course-footer .btn { min-height: 44px; }
  .cta-strip { margin-top: 40px; padding: 36px 0; }
  .cta-strip .cta-content { flex-direction: column; align-items: flex-start; gap: 20px; }
  .cta-strip .btn { width: 100%; }
}

/* ---- Round-1 refinements ---------------------------------------------------- */
/* Hub hero: left aligned on phones/tablets (the bundle centres it, which left icon lists half-centred). */
@media (max-width: 992px) {
  .hero__inner { text-align: left; }
  .hero__inner .hero__desc { margin-left: 0; margin-right: 0; }
  .hero__inner .hero__features { align-items: flex-start; }
  .hero__inner .hero__features li { align-items: flex-start; text-align: left; }
  .hero__inner .hero__features li i { margin-top: 2px; }
  .hero__inner .hero__actions, .hero__inner .lp-chips { justify-content: flex-start; }
  .hero__inner .hero__image { margin-top: 28px; }
}
.lp-hero-title { display: block; max-width: 800px; margin: 0 auto 16px; }

/* Programme cards: one accent for the ticks, secondary action reads as a button, not a disabled bar. */
.program-card__features li i { color: var(--epa-primary-dark); }
.program-card__cta { border: 1px solid var(--epa-border-dark); background: var(--epa-white); }
.program-card__cta:hover { border-color: var(--epa-primary); }
.program-card--popular .program-card__cta { border-color: var(--epa-primary); }

/* College guides: bootstrap's blue text-primary clashed with the one accent. */
.content-section .text-primary { color: var(--epa-primary-dark) !important; }

/* Legacy template heading banner: the original photo is a grey placeholder, use the site navy. */
.td_page_heading.td_heading_bg { background-color: var(--epa-ink) !important; background-image: none !important; }
@media (max-width: 768px) {
  .td_page_heading { margin-top: var(--header-height, 70px); min-height: 0 !important; padding: 40px 0 36px !important; }
  .td_page_heading h1 { font-size: clamp(1.75rem, 8vw, 2.25rem) !important; }
  .course-thumb { height: auto; }
  .course-thumb > div[style*="aspect-ratio"] { aspect-ratio: auto !important; min-height: 96px; border-radius: 0 !important; }
  .course-thumb .badge-new { top: 12px; left: 12px; }
}

/* Bootstrap row gutters (30px) are wider than the 14px phone gutter below 340px. */
@media (max-width: 340px) { .td_row_gap_30 { margin-left: -14px; margin-right: -14px; } .td_row_gap_30 > * { padding-left: 14px; padding-right: 14px; } }
@media (max-width: 768px) {
  .td_card_category { display: inline-flex; align-items: center; min-height: 40px; }
}
