/* ==========================================================================
   Para Commando Physical Academy Palampur - responsive layer
   Verified at 320 / 375 / 390 / 430 / 768 / 1024 / 1280 / 1440 / 1920.
   Layouts are re-composed for small screens, not merely compressed.
   ========================================================================== */

/* ------------------------------------------------- >= 1441px : large desktop */
@media (min-width: 1441px) {
  :root { --container: 1320px; }
}

/* ------------------------------------------------------- <= 1180px : laptop */
@media (max-width: 1180px) {
  .nav { gap: 0; }
  .nav__link { padding-inline: var(--s-2); font-size: 0.9rem; }
  .footer__grid { grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); }
}

/* -------------------------------------------------- <= 1024px : small laptop */
@media (max-width: 1024px) {
  :root { --header-h: 68px; }

  .hero__grid { grid-template-columns: 1fr; gap: var(--s-6); }
  .hero__aside { padding-bottom: 0; }
  .hero__title { max-width: 18ch; }

  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { border-bottom: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-last-child(-n+2) { border-bottom: 0; }

  .step { grid-template-columns: minmax(0, 64px) minmax(0, 1fr); gap: var(--s-4) var(--s-5); }
  .step__text { grid-column: 2; }

  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-7) var(--s-6); }
  .footer__about { grid-column: 1 / -1; max-width: 52ch; }
}

/* ------------------------------------------------ <= 900px : tablet / mobile */
@media (max-width: 900px) {
  /* nav switches to drawer */
  .nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .header__actions .btn--desktop-only { display: none; }

  .split,
  .split--wide-left,
  .split--wide-right { grid-template-columns: 1fr; gap: var(--s-6); }
  .split .split__media { order: -1; }
  .split--media-last .split__media { order: 0; }

  .sec-head { grid-template-columns: 1fr; align-items: start; gap: var(--s-4); }
  .sec-head__aside { padding-bottom: 0; }

  .page-head__grid { grid-template-columns: 1fr; gap: var(--s-5); }

  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .spec-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec { border-bottom: 1px solid var(--line); padding-block: var(--s-4); }
  .spec:nth-child(2n) { border-right: 0; }
  .spec:nth-last-child(-n+2) { border-bottom: 0; }
  .spec:nth-child(2n+1) { padding-left: 0; }
  .spec:nth-child(2n) { padding-left: var(--s-5); }

  .gallery__item,
  .gallery__item--wide,
  .gallery__item--half { grid-column: span 6; }

  /* sticky bottom actions - mobile only */
  .sticky-cta { display: block; }
  body { padding-bottom: 60px; }
  .footer { padding-bottom: var(--s-7); }
}

/* -------------------------------------------------------- <= 720px : phones */
@media (max-width: 720px) {
  :root {
    --header-h: 64px;
    --gutter: 20px;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--header-h) + 56px);
  }
  .hero__inner { padding-bottom: var(--s-6); }
  .hero__title { max-width: 100%; }
  .hero__lead { font-size: 1.02rem; }
  .hero__media img { object-position: center 30%; }

  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; gap: var(--s-4); }

  .trustbar__inner { gap: var(--s-3) var(--s-5); padding-block: var(--s-4); }
  .trust-item { font-size: var(--t-xs); }

  .stat-row { grid-template-columns: 1fr; }
  .stat { border-right: 0; padding: var(--s-5) 0; }
  .stat + .stat { padding-left: 0; }
  .stat:last-child { border-bottom: 0; }

  .prog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prog { min-height: 132px; padding: var(--s-5) var(--s-3); gap: var(--s-2); }
  .prog__name { font-size: 0.82rem; letter-spacing: 0.07em; }
  .prog__meta { font-size: 0.75rem; line-height: 1.4; }

  .spec-strip { grid-template-columns: 1fr; }
  .spec { border-right: 0; padding-left: 0 !important; }
  .spec:last-child { border-bottom: 0; }

  .step { grid-template-columns: 1fr; gap: var(--s-3); }
  .step__num { padding-top: 0; }
  .step__text { grid-column: 1; }

  .gallery { gap: var(--s-3); }
  .gallery__item,
  .gallery__item--wide,
  .gallery__item--half,
  .gallery__item--full { grid-column: span 12; }

  .btn { width: 100%; }
  .btn--auto, .btn--sm, .btn--ghost { width: auto; }
  .btn-row { gap: var(--s-3); }
  .btn-row--inline { flex-direction: row; }
  .btn-row--inline .btn { width: auto; flex: 1; }

  .cta-block { padding: var(--s-6) var(--s-5); }
  .footer__grid { grid-template-columns: 1fr; gap: var(--s-6); }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: var(--s-3); }

  .spec-list li { grid-template-columns: 1fr; gap: 2px; padding: var(--s-3) 0; }
}

/* --------------------------------------------------- <= 400px : small phones */
@media (max-width: 400px) {
  :root { --gutter: 16px; }
  .brand__name { font-size: 0.875rem; }
  .sticky-cta__btn { font-size: 0.625rem; letter-spacing: 0.04em; }
  .badge { font-size: 0.625rem; }
}

/* ------------------------------------------------------- short viewports */
@media (max-height: 620px) and (min-width: 901px) {
  .hero { min-height: 0; padding-block: calc(var(--header-h) + 64px) 0; }
}

/* --------------------------------------------------------- coarse pointers */
@media (hover: none) {
  .card--hover:hover,
  .course-card:hover,
  .btn:hover { transform: none; }
  .gallery__item:hover img { transform: none; }
}

/* ==========================================================================
   MOBILE-PRIORITY LAYER
   ~99% of this academy's visitors arrive on a phone. The rules below treat
   the phone as the primary design, not a compressed desktop: thumb-reachable
   actions, 48px+ targets, less vertical scrolling, native-feeling swipe rows.
   ========================================================================== */

/* Kill the blue flash on tap, keep our own :active states */
a, button, [role="button"], input, select, textarea, label {
  -webkit-tap-highlight-color: transparent;
}

/* Horizontal swipe rows - used instead of tall stacks where a set of cards
   would otherwise force a long scroll. Desktop keeps the normal grid. */
.swipe { --swipe-min: 78vw; }

@media (max-width: 900px) {
  .swipe {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(var(--swipe-min), 1fr);
    grid-template-columns: none !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    padding-inline: var(--gutter);
    margin-inline: calc(var(--gutter) * -1);
    padding-bottom: var(--s-3);
    scrollbar-width: none;
  }
  .swipe::-webkit-scrollbar { display: none; }
  .swipe > * { scroll-snap-align: start; }
  .swipe::after {
    content: "";
    width: 1px;
    scroll-snap-align: start;
  }

  .swipe-hint {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-size: var(--t-xs);
    color: var(--fg-3);
    margin-top: var(--s-3);
  }
}
@media (min-width: 901px) { .swipe-hint { display: none; } }

@media (max-width: 720px) {
  /* Two-up data strip keeps the hero short enough to see a CTA on load */
  .spec-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: var(--s-4) var(--s-4) var(--s-4) 0 !important;
  }
  .spec:nth-child(2n) { border-right: 0; padding-left: var(--s-4) !important; }
  .spec:nth-last-child(-n+2) { border-bottom: 0; }
  .spec__value { font-size: 1.3rem; }
  .spec__label { font-size: 0.75rem; }

  /* Comfortable, unmistakable tap targets */
  .mobile-nav__link { min-height: 60px; }
  .footer__list a,
  .kv-list li,
  .breadcrumb a { display: inline-flex; align-items: center; min-height: 40px; }
  .footer__list li { margin-bottom: 0; }
  .radio-pill span { min-height: 50px; padding-inline: var(--s-4); }
  .acc-btn { padding-block: var(--s-4); min-height: 60px; }

  /* Never let body copy drop below comfortable reading size on a phone */
  body { font-size: 1.0625rem; line-height: 1.6; }
  .small { font-size: 1rem; }
  .xs { font-size: 0.875rem; }
  .card__text, .check-list li, .step__text, .acc-panel__inner { font-size: 1rem; }

  /* Section rhythm: tighter, so the page does not feel endless on a phone */
  .section { padding-block: 56px; }
  .section--tight { padding-block: 44px; }

  /* Cards sit edge to edge with a little more breathing room inside */
  .card { padding: 22px 20px; }

  /* Primary action always full width and thumb-reachable */
  .btn--lg { min-height: 56px; }
}

/* Notch / home-indicator safety */
@supports (padding: max(0px)) {
  @media (max-width: 900px) {
    .sticky-cta__inner { padding-bottom: max(0px, env(safe-area-inset-bottom)); }
    body { padding-bottom: calc(60px + max(0px, env(safe-area-inset-bottom))); }
    .container { padding-left: max(var(--gutter), env(safe-area-inset-left));
                 padding-right: max(var(--gutter), env(safe-area-inset-right)); }
  }
}

/* iOS: inputs must stay >= 16px or Safari zooms the whole page on focus */
@media (max-width: 900px) {
  .input, .select, .textarea { font-size: 16px; min-height: 54px; }
  .textarea { min-height: 120px; }
}

/* Landscape phones - reclaim vertical space */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .hero { padding-top: calc(var(--header-h) + 32px); }
  .mobile-nav { padding-block: var(--s-4); }
  .mobile-nav__link { min-height: 48px; font-size: 1.05rem; }
}

/* ---------------------------------------------- mobile header fit + hero */
@media (max-width: 900px) {
  /* The hero's tertiary Call / WhatsApp row is redundant on phones - the
     sticky bottom bar carries those actions permanently. */
  .hide-on-mobile { display: none !important; }

  /* Placeholder artwork must never compete with the headline on a small,
     bright-outdoors screen. */
  .hero__scrim {
    background:
      linear-gradient(180deg, rgba(11,12,12,0.90) 0%, rgba(11,12,12,0.72) 30%,
                              rgba(11,12,12,0.88) 68%, #0B0C0C 100%);
  }
}

@media (max-width: 600px) {
  .header__inner { gap: var(--s-4); }
  .header__actions { gap: var(--s-2); }
  .brand__mark { width: 28px; height: 28px; }
  .brand__name { font-size: 0.8125rem; letter-spacing: 0.01em; }
  .brand__sub { font-size: 0.5625rem; letter-spacing: 0.14em; margin-top: 3px; }
  .header .btn--sm { padding-inline: var(--s-4); font-size: 0.8125rem; min-height: 40px; }
  .nav-toggle { width: 40px; height: 40px; }
}

@media (max-width: 360px) {
  .brand__sub { display: none; }
  .header .btn--sm { padding-inline: var(--s-3); }
}

/* The hero plate must read as a photograph on a phone, not a letterbox slot. */
@media (max-width: 720px) {
  .hero__plate { padding: 6px; margin-top: clamp(28px, 5vw, 44px); }
  .hero__plate img { aspect-ratio: 4 / 3; }
  .hero { padding-bottom: 0; }
  .hero__crest { width: 62px; height: 62px; }
}

/* Small phones: keep two programme tiles across rather than an endless column */
@media (max-width: 359px) {
  .prog__name { font-size: 0.76rem; }
  .prog__meta { display: none; }
}

/* ---------------------------------------------- hero + composition, mobile */
@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: 1fr; gap: clamp(28px, 5vw, 44px); }
  .hero__panel { max-width: 560px; }
  .hero__frame img { aspect-ratio: 4 / 3; }
  .hero__ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger-item { border-bottom: 1px solid var(--line); padding-block: var(--s-4); }
  .ledger-item:nth-child(2n) { border-right: 0; padding-left: var(--s-5); }
  .ledger-item:nth-last-child(-n+2) { border-bottom: 0; }
  .head { grid-template-columns: 1fr; align-items: start; }
  .head__aside { padding-bottom: 0; }
  .feature-row { grid-template-columns: 1fr; }
  .feature-row--flip > .feature-row__media { order: 0; }
  .sticky-col { position: static; }
}

@media (max-width: 720px) {
  .hero { padding-top: calc(var(--header-h) + 32px); }
  .hero__title { max-width: 100%; }
  .hero__panel { max-width: none; margin-top: var(--s-2); }
  .hero__frame { padding: 6px; }
  .plaque {
    position: static;
    max-width: none;
    margin-top: var(--s-4);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px var(--s-3);
  }
  .plaque__stars { margin-bottom: 0; }
  .plaque__label { margin: 0; flex: 1 0 100%; }
  .hero__ledger { grid-template-columns: 1fr; margin-top: var(--s-6); }
  .ledger-item { border-right: 0; padding: var(--s-4) 0 !important; }
  .ledger-item:last-child { border-bottom: 0; }
  .forces__list { justify-content: flex-start; padding-block: var(--s-3); }
  .forces__list li { font-size: 0.72rem; padding-inline: 10px; letter-spacing: 0.1em; }
  .method__item { grid-template-columns: minmax(0, 44px) minmax(0, 1fr); gap: var(--s-2) var(--s-4); }
  .feature-row { padding-block: var(--s-6); }
}

/* ==========================================================================
   MOBILE LEGIBILITY
   Small-caps labels that read fine at 11px on a monitor are genuinely hard
   work on a phone held at arm's length in daylight. Since almost every
   visitor arrives on a phone, the label sizes step up rather than down.
   ========================================================================== */
@media (max-width: 900px) {
  :root { --t-micro: 0.75rem; }          /* 11px -> 12px */

  .badge { font-size: 0.75rem; letter-spacing: 0.1em; }
  .btn--sm { font-size: 0.75rem; letter-spacing: 0.1em; }
  .sticky-cta__btn { font-size: 0.6875rem; letter-spacing: 0.08em; }
  .brand__sub { font-size: 0.625rem; letter-spacing: 0.18em; }
  .forces__list li { font-size: 0.75rem; }
  .kicker { letter-spacing: 0.18em; }
  .figure figcaption { font-size: 0.75rem; }
  .ledger-item__key { font-size: 0.75rem; }
  .feature-row__tag { font-size: 0.75rem; }
  .footer__title { font-size: 0.75rem; }
  .contact-card__label, .field__label, .spec-list .k, .card__index { font-size: 0.75rem; }
}

@media (max-width: 600px) {
  .brand__sub { font-size: 0.625rem; letter-spacing: 0.16em; }
}
