/* =============================================================================
   CUET FAMILY MOBILE LAYER
   Used by /cuet/ (hub), programs, colleges, faq and guide.
   Loads AFTER global-bundle.css and epa-mobile.css. Everything phone-specific is
   inside @media (max-width: 768px); desktop keeps the existing look.
   Language: the site's institutional system (navy ink, orange accent, serif
   headings, 4px corners, hairline rules). Rows and accordions instead of stacks
   of cards, 44px+ touch targets, no horizontal overflow at 320px.
   ========================================================================== */

/* ---- Hub components that used to be inline-styled (desktop look unchanged) ---- */
.hub-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1px solid var(--epa-border);
  border-radius: 8px;
  padding: 8px 13px;
  font-weight: 600;
  font-size: 14px;
  color: var(--epa-ink, #0f1535);
  text-decoration: none;
}
.hub-struct__list { display: flex; flex-direction: column; gap: var(--sp-4); }
.hub-struct__row {
  background: var(--epa-white);
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--epa-border);
}

/* ---- Guide: the current-page crumb was inheriting the faint separator colour ---- */
.cuet-guide .guide-breadcrumb .guide-breadcrumb-active { margin: 0; color: var(--epa-ink); font-weight: 600; }

/* ---- Guide: sections are <details>; always open and non-interactive on desktop ---- */
details.guide-section > summary { display: block; list-style: none; cursor: default; }
details.guide-section > summary::-webkit-details-marker { display: none; }
details.guide-section > summary h2 { margin-bottom: var(--sp-4); }

@media (max-width: 900px) {
  /* Phones and small tablets: the guide becomes a stack of tappable sections. */
  .cuet-guide details.guide-section {
    padding: 0 !important;
    border-bottom: 1px solid var(--epa-border);
  }
  .cuet-guide details.guide-section > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 60px;
    padding: 8px 0;
    cursor: pointer;
    touch-action: manipulation;
  }
  .cuet-guide details.guide-section > summary h2 {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.3;
  }
  .cuet-guide details.guide-section > summary::after {
    content: "+";
    flex: none;
    width: 28px;
    text-align: center;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    color: var(--epa-primary-dark);
  }
  .cuet-guide details.guide-section[open] > summary::after { content: "\2212"; }
  .cuet-guide details.guide-section > :not(summary):last-child { margin-bottom: 20px; }
  .cuet-guide details.guide-section > :not(summary):first-of-type { margin-top: 4px; }
}

/* =============================================================================
   PHONES
   ========================================================================== */
@media (max-width: 768px) {

  /* ---- Page rhythm shared by the secondary CUET pages ---- */
  .cuet-page main {
    padding-top: calc(var(--header-height, 70px) + 4px) !important;
    padding-bottom: 48px !important;
  }
  .cuet-page .section { padding-top: 32px; padding-bottom: 32px; }
  .cuet-page .section.pb-0 { padding-bottom: 0; }
  .cuet-page .section-header {
    text-align: left;
    margin: 0 0 24px;
  }
  .cuet-page .section-header .overline { padding: 4px 10px; font-size: 12px; margin-bottom: 10px; }
  .cuet-page .section-header h2 { margin-bottom: 8px; }
  .cuet-page .section-header p { font-size: 1rem; line-height: 1.6; margin-bottom: 0; }
  .cuet-page .btn--lg { width: 100%; }

  /* ---- Hub: hero ---- */
  .cuet-hub .hero { padding: calc(var(--header-height, 70px) + 16px) 0 28px; }
  .cuet-hub .hero__inner { gap: 20px; text-align: left; }
  .cuet-hub .hero .badge { margin-bottom: 12px; padding: 6px 12px; }
  .cuet-hub .hero__title {
    font-size: clamp(1.75rem, 8.2vw, 2.25rem);
    line-height: 1.14;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
  }
  .cuet-hub .hero__desc { font-size: 1rem; line-height: 1.6; margin-bottom: 16px; }
  .cuet-hub .hero__features { align-items: flex-start; gap: 8px; margin-bottom: 20px; }
  .cuet-hub .hero__features li { text-align: left; align-items: flex-start; }
  .cuet-hub .hero__features li i { margin-top: 3px; }
  .cuet-hub .hero__actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .cuet-hub .hero__trust { margin-top: 20px !important; padding-top: 16px; gap: 8px !important; }
  .cuet-hub .hero__trust { justify-content: flex-start; }
  .cuet-hub .hub-chip { font-size: 13px; padding: 7px 11px; }
  .cuet-hub a.hub-chip { min-height: 44px; }
  .cuet-hub .container.text-center { text-align: left; }
  .cuet-hub .container.text-center > p { margin-left: 0 !important; margin-right: 0 !important; }
  .cuet-hub .container.text-center > div[style*="justify-content:center"] { justify-content: stretch !important; }

  /* The faculty photo: no glass card, just the picture and its label. */
  .cuet-hub .hero__image-card {
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .cuet-hub .hero__image-label {
    position: static;
    transform: none;
    width: max-content;
    max-width: 100%;
    margin: 8px auto 0;
    padding: 8px 14px;
    font-size: 13px;
    box-shadow: none;
    border: 1px solid var(--epa-border);
  }

  /* ---- Hub: exam facts, 2 x 2 ---- */
  .cuet-hub .stat-bar { padding: 24px 0; }
  .cuet-hub .stat-bar__inner { grid-template-columns: 1fr 1fr; gap: 20px 12px; }
  .cuet-hub .stat-bar__inner .stat-bar__item:not(:last-child)::after { display: none; }
  .cuet-hub .stat-bar__value { font-size: 1.875rem; }
  .cuet-hub .stat-bar__label { font-size: 0.8125rem; line-height: 1.35; }

  /* ---- Hub: shared inline grids lose their 48px gutter ---- */
  .cuet-hub .grid[style*="var(--sp-12)"] { gap: 28px !important; }
  .cuet-hub .body-lg { font-size: 1rem; line-height: 1.6; }

  /* ---- Hub: exam structure becomes a flat list ---- */
  .cuet-hub .hub-struct { padding: 0; border: 0; box-shadow: none; background: none !important; }
  .cuet-hub .hub-struct h3 { margin-bottom: 4px; }
  .hub-struct__list { gap: 0; }
  .hub-struct__row {
    background: none;
    border-left: 0;
    border-top: 1px solid var(--epa-border);
    border-radius: 0;
    padding: 14px 0;
  }
  .hub-struct__row:first-child { border-top: 0; }
  .hub-struct__row .caption { font-size: 0.9375rem; line-height: 1.5; color: var(--epa-text-muted); }

  /* ---- Hub: programs ---- */
  .cuet-hub .cuet-controls { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 20px; }
  .cuet-hub .cuet-seg { display: flex; width: 100%; }
  .cuet-hub .cuet-seg button { flex: 1; min-height: 48px; padding: 0 8px; }
  .hub-programs { gap: 16px !important; }
  .hub-programs .program-card__banner {
    height: auto;
    min-height: 0;
    padding: 10px 16px;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
  .hub-programs .program-card__badge { padding: 5px 12px; box-shadow: none; }
  .hub-programs .program-card__body { padding: 18px 16px 16px; }
  .hub-programs .program-card__title { font-size: 1.25rem; margin-bottom: 6px; }
  .hub-programs .program-card__body > .body-sm { margin-bottom: 10px; }
  .hub-programs .cuet-price { margin-bottom: 12px; }
  .hub-programs .cuet-price strong { font-size: 1.625rem; }
  .hub-programs .program-card__features { margin-bottom: 16px; }
  .hub-programs .program-card__features li { margin-bottom: 8px; line-height: 1.45; }
  .hub-programs .program-card__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
  }

  /* ---- Hub + colleges page: universities ---- */
  .hub-colleges { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .hub-colleges .college-card { padding: 14px 12px; text-align: left; border-radius: var(--radius-md); }
  .hub-colleges .college-card__logo { width: 44px; height: 44px; margin: 0 0 10px; font-size: 18px; }
  .hub-colleges .college-card__name { font-size: 0.9375rem; line-height: 1.3; margin-bottom: 2px; }
  .hub-colleges .college-card__location { font-size: 0.8125rem; }

  /* ---- Hub: why EPA, as icon rows ---- */
  .hub-why { gap: 0 !important; }
  .hub-why .card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 14px;
    align-items: start;
    padding: 16px 0;
    background: none;
    border: 0;
    border-top: 1px solid var(--epa-border);
    border-radius: 0;
    box-shadow: none;
  }
  .hub-why .card:first-child { border-top: 0; padding-top: 4px; }
  .hub-why .card__icon { grid-row: span 2; width: 44px; height: 44px; margin: 0; font-size: 18px; }
  .hub-why .card__title { margin: 0 0 4px; font-size: 1.0625rem; line-height: 1.3; }
  .hub-why .card__text { margin: 0; font-size: 0.9375rem; line-height: 1.55; }

  /* ---- Hub: closing blocks ---- */
  .cuet-hub .cta-block { padding: 28px 18px; }
  .cuet-hub .cta-block .btn { width: 100%; }
  .cuet-hub .prog-faq { margin-top: 0; }
  .cuet-hub .btn--ghost { min-height: 48px; }

  /* ---- Hub: contact ---- */
  .hub-contact .card { padding: 20px 16px; }
  .hub-contact .hub-form-row { flex-direction: column; }
  .hub-contact input,
  .hub-contact select { min-height: 48px; font-size: 16px; }
  .hub-contact a[href^="tel:"] { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--epa-ink); }

  /* ---- Programs page ---- */
  .pg-filters { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px !important; margin-bottom: 24px !important; }
  .pg-filters select { min-width: 0 !important; width: 100%; min-height: 48px; padding: 0 12px !important; font-size: 16px; }
  #program-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 16px !important; }
  .cuet-programs .program-card__banner { height: auto; padding: 10px 16px; justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
  .cuet-programs .program-card__badge { margin-left: 0 !important; padding: 5px 12px; box-shadow: none; }
  .cuet-programs .program-card__body { padding: 18px 16px 16px; }
  .cuet-programs .program-card__title { font-size: 1.25rem; margin-bottom: 10px; }
  .cuet-programs .program-card__features { margin-bottom: 16px; }
  .cuet-programs .program-card__features li { margin-bottom: 8px; line-height: 1.45; }
  .cuet-programs .program-card__cta { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 16px; border-radius: var(--radius-md); }
  .cuet-programs #no-results { padding: 32px 0 !important; }

  /* ---- Colleges page: compact rows ---- */
  .cuet-colleges .col-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 0 !important; }
  .cuet-colleges .college-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 14px;
    align-items: start;
    padding: 16px 0;
    text-align: left;
    background: none;
    border: 0;
    border-top: 1px solid var(--epa-border);
    border-radius: 0;
    box-shadow: none;
  }
  .cuet-colleges .college-card:first-child { border-top: 0; padding-top: 4px; }
  .cuet-colleges .college-card__logo { grid-row: span 3; width: 48px; height: 48px; margin: 0; font-size: 20px; }
  .cuet-colleges .college-card__name { margin: 0; font-size: 1.0625rem; line-height: 1.3; }
  .cuet-colleges .college-card__location { margin: 0 0 4px; }
  .cuet-colleges .college-card hr { display: none; }
  .cuet-colleges .college-card .body-sm { margin: 0; font-size: 0.9375rem; line-height: 1.55; }
  .cuet-colleges .mt-12,
  .cuet-faq .mt-12 { margin-top: 32px; }

  /* ---- FAQ page ---- */
  .cuet-faq h3.h3 { font-size: 1.2rem; margin: 32px 0 4px; }
  .cuet-faq .prog-faq { margin-top: 4px; }

  /* ---- Guide: hero, tables, regions ---- */
  .cuet-guide main { padding-top: var(--header-height, 70px) !important; padding-bottom: 0 !important; }
  .cuet-guide .guide-hero { padding-top: 8px; padding-bottom: 24px; }
  .cuet-guide .guide-hero .container { text-align: left; }
  .cuet-guide .guide-hero .badge { margin-bottom: 12px; }
  .cuet-guide .guide-hero h1 { margin-bottom: 12px; }
  .cuet-guide .guide-hero-text { margin: 0 !important; font-size: 1rem !important; line-height: 1.6; }
  .cuet-guide .guide-layout-grid .card.p-8 { padding: 4px 16px 8px !important; border-radius: var(--radius-md) !important; }
  .cuet-guide .section.pt-8 { padding-top: 16px; padding-bottom: 32px; }
  .cuet-guide .guide-breadcrumb { padding: 12px var(--epa-gutter, 16px); overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .cuet-guide .guide-breadcrumb::-webkit-scrollbar { display: none; }
  .cuet-guide .guide-breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; }
  .cuet-guide .h4 { font-size: 1.0625rem; }
  .cuet-guide .guide-list { margin-bottom: 16px !important; }
  .cuet-guide .guide-list li { line-height: 1.6; }
  .cuet-guide .guide-card { padding: 16px; }
  .cuet-guide .guide-region-grid { gap: 12px; }
  .cuet-guide .guide-mobile-nav-btn { min-height: 44px; background: var(--epa-primary-dark); box-shadow: 0 4px 14px rgba(15, 21, 53, 0.25); }
  .cuet-guide .guide-mobile-drawer-close { width: 44px; height: 44px; }
  .cuet-guide .guide-mobile-drawer .guide-nav-link { padding: 12px 4px; font-size: 16px; min-height: 44px; }
  .cuet-guide .guide-cta-block { background: var(--epa-ink); }
  .cuet-guide .faq-accordion details summary { padding: 14px 16px; min-height: 52px; display: flex; align-items: center; }

  /* Tables: stacked rows (label beside value) instead of sideways scrolling.
     One 5-column table with merged cells (rowspan) stays a scrollable table. */
  .cuet-guide .table-responsive { margin-bottom: 16px; }
  .cuet-guide .table-responsive:has(> .is-stacked) { overflow: visible; border: 0; margin-bottom: 16px; }
  .cuet-guide .epa-table.is-stacked,
  .cuet-guide .epa-table.is-stacked tbody,
  .cuet-guide .epa-table.is-stacked tr,
  .cuet-guide .epa-table.is-stacked td,
  .cuet-guide .epa-table.is-stacked th { display: block; width: auto; min-width: 0; }
  .cuet-guide .epa-table.is-stacked { border: 0; background: none; }
  .cuet-guide .epa-table.is-stacked thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cuet-guide .epa-table.is-stacked tr { padding: 12px 0; border-top: 1px solid var(--epa-border); }
  .cuet-guide .epa-table.is-stacked tbody tr:first-child { border-top: 0; }
  .cuet-guide .epa-table.is-stacked td,
  .cuet-guide .epa-table.is-stacked th {
    padding: 3px 0 !important;
    border: 0 !important;
    background: none;
    font-size: 14px !important;
    line-height: 1.5;
  }
  .cuet-guide .epa-table.is-stacked td[data-label] {
    display: grid;
    grid-template-columns: minmax(84px, 34%) minmax(0, 1fr);
    gap: 10px;
    padding: 3px 0 !important;
    border: 0 !important;
    background: none;
    font-size: 14px !important;
    line-height: 1.5;
  }
  .cuet-guide .epa-table.is-stacked td::before {
    content: attr(data-label);
    font-size: 13px;
    font-weight: 600;
    color: var(--epa-text-muted);
  }
  .cuet-guide .epa-table.is-stacked td:first-child,
  .cuet-guide .epa-table.is-stacked th:first-child {
    display: block;
    padding-bottom: 4px !important;
    font-size: 15px !important;
    font-weight: 700;
    color: var(--epa-ink);
  }
  .cuet-guide .epa-table.is-stacked td:first-child::before { display: none; }
}
