/* Responsive Improvements - Full Screen Coverage (All Devices)
   This file ensures excellent responsiveness across all screen sizes
   Load after main.min.css and desktop-enhancements.css
*/

/* ─────────────────────────────────────────────────────────────
   EXTRA LARGE SCREENS (1920px and above)
   Desktop refinements for ultra-wide displays
   ───────────────────────────────────────────────────────────── */

@media (min-width: 1920px) {
  :root {
    --page-gutter: clamp(20px, 3.5vw, 80px);
  }

  .container {
    max-width: 1400px !important;
  }

  body.page-home .welcome-grid {
    gap: clamp(72px, 8vw, 140px);
  }

  body.page-home .why-sikri-grid {
    gap: 24px !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   LARGE TABLETS (1024px - 1180px)
   Refined layout for iPad and similar devices in landscape
   ───────────────────────────────────────────────────────────── */

@media (min-width: 1024px) and (max-width: 1180px) {
  :root {
    --section-y: 56px;
    --section-y-compact: 44px;
  }

  body.page-home .welcome-grid {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }

  body.page-home .welcome-img-wrap {
    min-height: 500px;
  }

  body.page-home .prog-editorial__inner {
    min-height: 440px;
  }

  body.page-home .school-section {
    min-height: 540px;
  }

  body.page-home .school-img-side {
    min-height: 540px;
  }
}

/* ─────────────────────────────────────────────────────────────
   TABLETS & SMALL DESKTOPS (768px - 1023px)
   Optimize layout for iPad, tablet devices in portrait and landscape
   ───────────────────────────────────────────────────────────── */

@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --section-y: 48px;
    --section-y-compact: 36px;
    --page-gutter: clamp(16px, 4vw, 28px);
  }

  /* Stagger welcome section layout on tablets */
  body.page-home .welcome-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: center;
  }

  body.page-home .welcome-img-wrap {
    order: -1;
    min-height: 420px;
  }

  body.page-home .welcome-img-main {
    aspect-ratio: 16 / 9 !important;
  }

  body.page-home .welcome-text {
    align-self: auto;
  }

  body.page-home .welcome-text h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem) !important;
  }

  /* Simplify why-sikri grid on tablets */
  body.page-home .why-sikri-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px !important;
  }

  body.page-home .ws-card {
    min-height: auto;
  }

  body.page-home .ws-card-image {
    aspect-ratio: 3 / 2 !important;
  }

  /* Stack programme editorials on tablets */
  body.page-home .prog-editorial__inner {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    min-height: auto;
  }

  body.page-home .prog-editorial__text {
    order: 2;
    padding: clamp(32px, 4vw, 48px) !important;
  }

  body.page-home .prog-editorial__img {
    order: 1;
    min-height: 300px;
    aspect-ratio: 16 / 9 !important;
  }

  body.page-home .prog-editorial--reverse .prog-editorial__inner {
    grid-template-columns: 1fr !important;
  }

  body.page-home .prog-editorial--feature .prog-editorial__inner {
    grid-template-columns: 1fr !important;
  }

  body.page-home .prog-editorial--compact .prog-editorial__inner {
    grid-template-columns: 1fr !important;
  }

  body.page-home .prog-editorial--legacy .prog-editorial__inner {
    grid-template-columns: 1fr !important;
  }

  /* Stack school section on tablets */
  body.page-home .school-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    min-height: auto;
  }

  body.page-home .school-img-side {
    order: -1;
    min-height: 380px;
  }

  body.page-home .school-text {
    padding: clamp(40px, 4vw, 56px);
  }

  /* Adjust seo link hub for tablets */
  body.page-home .seo-link-hub__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
  }

  body.page-home .seo-link-hub__link {
    min-height: 160px;
    padding: 24px 20px;
    border-right: 1px solid rgba(26, 58, 92, 0.1);
    border-bottom: 1px solid rgba(26, 58, 92, 0.1);
  }

  body.page-home .seo-link-hub__link:nth-child(2n) {
    border-right: 0;
  }

  body.page-home .seo-link-hub__link:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  /* Improve typography on tablets */
  h1 {
    font-size: clamp(2rem, 5vw, 3rem) !important;
  }

  h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem) !important;
  }

  h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem) !important;
  }

  body.page-home .welcome-text p {
    font-size: 0.95rem;
  }

  p {
    line-height: 1.75;
  }
}

/* ─────────────────────────────────────────────────────────────
   PORTRAIT TABLETS (600px - 767px)
   Optimize for iPad in portrait, smaller tablets
   ───────────────────────────────────────────────────────────── */

@media (min-width: 600px) and (max-width: 767px) {
  :root {
    --section-y: 40px;
    --section-y-compact: 30px;
    --page-gutter: clamp(14px, 4vw, 22px);
  }

  /* Full-width stacked layout */
  body.page-home .welcome-grid,
  body.page-home .school-section,
  body.page-home .prog-editorial__inner {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 32px;
    align-items: center;
  }

  body.page-home .welcome-img-wrap {
    order: -1;
    min-height: 380px;
  }

  body.page-home .welcome-img-main {
    aspect-ratio: 16 / 9 !important;
  }

  /* Why sikri grid on small tablets */
  body.page-home .why-sikri-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px !important;
  }

  body.page-home .ws-card {
    min-height: auto;
    border: none !important;
  }

  body.page-home .ws-card-image {
    aspect-ratio: 16 / 9 !important;
  }

  body.page-home .ws-card-body {
    padding: 20px 16px;
    border: 1px solid rgba(26, 58, 92, 0.1);
  }

  /* Programme editorials */
  body.page-home .prog-editorial__text {
    order: 2;
    padding: clamp(24px, 4vw, 36px) !important;
  }

  body.page-home .prog-editorial__img {
    order: 1;
    min-height: 280px;
    aspect-ratio: 16 / 9 !important;
  }

  body.page-home .prog-editorial--feature .prog-editorial__text {
    background: var(--navy-dark, #0d2540);
  }

  body.page-home .prog-editorial--legacy .prog-editorial__text::before {
    font-size: clamp(3rem, 8vw, 5.5rem);
    top: 12px;
    right: 16px;
  }

  /* School section */
  body.page-home .school-img-side {
    order: -1;
    min-height: 340px;
  }

  body.page-home .school-text {
    padding: clamp(32px, 4vw, 44px);
  }

  body.page-home .school-text h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem) !important;
  }

  /* SEO link hub - 2 column */
  body.page-home .seo-link-hub__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
  }

  body.page-home .seo-link-hub__link {
    min-height: 140px;
    padding: 20px 16px;
  }

  body.page-home .seo-link-hub__link:nth-child(2n) {
    border-right: 0;
  }

  body.page-home .seo-link-hub__link:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  /* Typography adjustments */
  h1 {
    font-size: clamp(1.6rem, 4vw, 2.4rem) !important;
  }

  h2 {
    font-size: clamp(1.3rem, 3vw, 2rem) !important;
  }

  body.page-home .welcome-text h2 {
    font-size: clamp(1.4rem, 3vw, 2rem) !important;
  }

  p {
    font-size: 0.95rem;
  }
}

/* ─────────────────────────────────────────────────────────────
   LARGE PHONES (481px - 599px)
   Optimize for iPhone 12+, Pixel 5, Galaxy S21 in portrait
   ───────────────────────────────────────────────────────────── */

@media (min-width: 481px) and (max-width: 599px) {
  :root {
    --section-y: 32px;
    --section-y-compact: 24px;
    --page-gutter: clamp(12px, 3.5vw, 18px);
  }

  /* Ensure full-width stacking */
  body.page-home .welcome-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  body.page-home .welcome-img-wrap {
    order: -1;
    min-height: 340px;
  }

  body.page-home .welcome-img-main {
    aspect-ratio: 16 / 9 !important;
  }

  body.page-home .welcome-img-accent {
    width: 32%;
    right: -16px;
    bottom: -16px;
    border-width: 6px;
  }

  body.page-home .welcome-badge {
    right: -12px;
    top: 16px;
    padding: 12px 14px;
    font-size: 0.7rem;
  }

  body.page-home .welcome-text h2 {
    font-size: clamp(1.2rem, 3.5vw, 1.8rem) !important;
  }

  body.page-home .welcome-text p {
    font-size: 0.9rem;
  }

  /* Why sikri grid - full stack on small screens */
  body.page-home .why-sikri-grid {
    grid-template-columns: 1fr;
    gap: 8px !important;
    border: none;
  }

  body.page-home .ws-card {
    border: 1px solid rgba(26, 58, 92, 0.1);
    border-right: none;
    min-height: auto;
    padding: 0;
  }

  body.page-home .ws-card:last-child {
    border-right: none;
  }

  body.page-home .ws-card-image {
    aspect-ratio: 16 / 9 !important;
    height: 180px;
  }

  body.page-home .ws-card-body {
    padding: 16px 14px;
    border-top: none;
  }

  body.page-home .ws-card-body h3 {
    font-size: 1.1rem;
  }

  body.page-home .ws-card-body > p {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
  }

  /* Programme editorials - single column */
  body.page-home .prog-editorial__inner {
    grid-template-columns: 1fr !important;
    min-height: auto;
    gap: 0 !important;
  }

  body.page-home .prog-editorial__text {
    order: 2;
    padding: clamp(20px, 3.5vw, 28px) !important;
  }

  body.page-home .prog-editorial__img {
    order: 1;
    min-height: 240px;
    aspect-ratio: 16 / 9 !important;
  }

  body.page-home .prog-editorial--feature .prog-editorial__img {
    min-height: 240px;
  }

  body.page-home .prog-editorial--compact .prog-editorial__img {
    min-height: 240px;
  }

  body.page-home .prog-editorial--legacy .prog-editorial__img {
    min-height: 240px;
  }

  body.page-home .prog-editorial--legacy .prog-editorial__text::before {
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    top: 8px;
    right: 12px;
  }

  body.page-home .prog-editorial__title {
    font-size: clamp(1.4rem, 3vw, 1.8rem) !important;
  }

  /* School section stacking */
  body.page-home .school-section {
    grid-template-columns: 1fr;
    gap: 0;
    min-height: auto;
  }

  body.page-home .school-img-side {
    order: -1;
    min-height: 300px;
  }

  body.page-home .school-text {
    padding: clamp(24px, 3.5vw, 32px);
  }

  body.page-home .school-text h2 {
    font-size: clamp(1.3rem, 3.5vw, 1.8rem) !important;
  }

  /* SEO link hub - single column on tiny screens */
  body.page-home .seo-link-hub__grid {
    grid-template-columns: 1fr;
    gap: 0;
    border: none;
  }

  body.page-home .seo-link-hub__link {
    min-height: 120px;
    padding: 18px 14px;
    border: 1px solid rgba(26, 58, 92, 0.1);
    border-bottom: none;
    border-right: none;
  }

  body.page-home .seo-link-hub__link:last-child {
    border-bottom: none;
  }

  body.page-home .seo-link-hub__link strong {
    font-size: 1rem;
  }

  /* Global typography adjustments for large phones */
  h1 {
    font-size: clamp(1.5rem, 4vw, 2.2rem) !important;
  }

  h2 {
    font-size: clamp(1.2rem, 3vw, 1.8rem) !important;
  }

  h3 {
    font-size: clamp(1rem, 2.5vw, 1.3rem) !important;
  }

  p {
    font-size: 0.9rem;
    line-height: 1.7;
  }
}

/* ─────────────────────────────────────────────────────────────
   SMALL PHONES (320px - 480px)
   Optimize for iPhone SE, small Android phones
   ───────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  :root {
    --section-y: 24px;
    --section-y-compact: 18px;
    --page-gutter: 12px;
  }

  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* Hero section */
  body.page-home .block-hero {
    height: 100vh;
    min-height: 480px;
  }

  body.page-home .block-hero-content {
    padding: 0 12px 48px;
  }

  body.page-home .block-hero-title {
    font-size: clamp(1.4rem, 5vw, 2.2rem) !important;
    margin-bottom: 1rem;
  }

  body.page-home .block-hero-tag {
    font-size: 0.6rem;
    margin-bottom: 0.5rem;
  }

  /* Welcome section - full stacking */
  body.page-home .welcome-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
  }

  body.page-home .welcome-img-wrap {
    order: -1;
    min-height: 280px;
    margin: 0 -12px;
    width: calc(100% + 24px);
  }

  body.page-home .welcome-img-main {
    aspect-ratio: 16 / 9 !important;
    width: 100%;
  }

  body.page-home .welcome-img-accent {
    display: none;
  }

  body.page-home .welcome-badge {
    display: none;
  }

  body.page-home .welcome-text {
    padding: 0;
  }

  body.page-home .welcome-text h2 {
    font-size: clamp(1.1rem, 4vw, 1.6rem) !important;
    margin-bottom: 1rem;
  }

  body.page-home .welcome-text p {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }

  body.page-home .welcome-text .btn-primary {
    width: 100%;
    margin-top: 0.5rem;
  }

  /* Why sikri section */
  body.page-home .why-sikri-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px !important;
    border: none;
  }

  body.page-home .ws-card {
    border: 1px solid rgba(26, 58, 92, 0.1);
    border-bottom: none;
    min-height: auto;
  }

  body.page-home .ws-card:last-child {
    border-bottom: 1px solid rgba(26, 58, 92, 0.1);
  }

  body.page-home .ws-card-image {
    aspect-ratio: 16 / 9 !important;
    height: 160px;
  }

  body.page-home .ws-card-body {
    padding: 14px 12px;
  }

  body.page-home .ws-card-body h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  body.page-home .ws-card-body > p {
    font-size: 0.8rem;
  }

  /* Programme editorials */
  body.page-home .prog-editorial {
    border-top: none;
    margin: 0 -12px !important;
    width: calc(100% + 24px);
    padding: 0 !important;
  }

  body.page-home .prog-editorial__inner {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    min-height: auto;
  }

  body.page-home .prog-editorial__text {
    order: 2;
    padding: clamp(16px, 3.5vw, 20px) !important;
    background: #fff;
    border: none;
  }

  body.page-home .prog-editorial__img {
    order: 1;
    min-height: 220px;
    aspect-ratio: 16 / 9 !important;
  }

  body.page-home .prog-editorial--feature .prog-editorial__text {
    background: var(--navy-dark, #0d2540);
  }

  body.page-home .prog-editorial--feature .prog-editorial__img {
    min-height: 220px;
  }

  body.page-home .prog-editorial--compact .prog-editorial__text {
    border-left: none;
    border-top: 4px solid var(--red, #c8102e);
  }

  body.page-home .prog-editorial--legacy .prog-editorial__text::before {
    font-size: clamp(2rem, 6vw, 3.5rem);
    top: 6px;
    right: 10px;
  }

  body.page-home .prog-editorial__title {
    font-size: clamp(1.2rem, 3vw, 1.6rem) !important;
    margin-bottom: 0.75rem;
  }

  body.page-home .prog-editorial__body {
    max-width: 100%;
  }

  body.page-home .prog-editorial__body > p {
    font-size: 0.85rem;
  }

  /* School section */
  body.page-home .school-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    min-height: auto;
    margin: 0 -12px !important;
    width: calc(100% + 24px);
    padding: 0 !important;
  }

  body.page-home .school-img-side {
    order: -1;
    min-height: 260px;
  }

  body.page-home .school-text {
    padding: clamp(20px, 3.5vw, 24px);
    background: #fff;
  }

  body.page-home .school-text h2 {
    font-size: clamp(1.1rem, 3.5vw, 1.6rem) !important;
    margin-bottom: 0.75rem;
  }

  body.page-home .school-text p {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }

  /* SEO link hub */
  body.page-home .seo-link-hub {
    padding-top: 24px !important;
    padding-bottom: 24px !important;
  }

  body.page-home .seo-link-hub__grid {
    grid-template-columns: 1fr;
    gap: 0;
    border: 1px solid rgba(26, 58, 92, 0.1);
  }

  body.page-home .seo-link-hub__link {
    min-height: 110px;
    padding: 16px 12px;
    border: none;
    border-bottom: 1px solid rgba(26, 58, 92, 0.1);
  }

  body.page-home .seo-link-hub__link:last-child {
    border-bottom: none;
  }

  body.page-home .seo-link-hub__link strong {
    font-size: 0.95rem;
    display: block;
    margin-bottom: 0.4rem;
  }

  body.page-home .seo-link-hub__link p {
    font-size: 0.75rem;
  }

  /* Global typography */
  h1 {
    font-size: clamp(1.3rem, 4.5vw, 2rem) !important;
    margin-bottom: 0.75rem;
  }

  h2 {
    font-size: clamp(1.1rem, 3vw, 1.6rem) !important;
    margin-bottom: 0.6rem;
  }

  h3 {
    font-size: clamp(0.95rem, 2.5vw, 1.2rem) !important;
    margin-bottom: 0.5rem;
  }

  h4 {
    font-size: 0.95rem;
  }

  p {
    font-size: 0.85rem;
    line-height: 1.65;
    margin-bottom: 0.75rem;
  }

  /* Ensure all buttons are touch-friendly */
  .btn,
  .nav-enquire,
  .mob-cta,
  button,
  a.btn {
    min-height: 44px;
    padding: 12px 16px;
    font-size: 0.85rem;
  }

  /* Improve footer on small screens */
  .footer-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-top-col {
    padding: 20px 0;
    border: none;
  }

  .footer-top-col h4 {
    margin-bottom: 0.75rem;
  }

  .footer-top-col a,
  .footer-top-col p {
    font-size: 0.8rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
  }

  /* Ensure hero scroll indicator is visible */
  .block-hero a[aria-label="Scroll down"] {
    display: flex;
    font-size: 0.5rem;
  }
}

/* ─────────────────────────────────────────────────────────────
   ULTRA-SMALL SCREENS (Below 320px)
   Safety fallback for very old/small devices
   ───────────────────────────────────────────────────────────── */

@media (max-width: 319px) {
  :root {
    --page-gutter: 8px;
  }

  .container {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  h1 {
    font-size: 1.2rem !important;
  }

  h2 {
    font-size: 1rem !important;
  }

  p {
    font-size: 0.8rem;
  }

  body.page-home .welcome-img-wrap,
  body.page-home .school-img-side {
    min-height: 240px;
  }
}

/* ─────────────────────────────────────────────────────────────
   ORIENTATION-SPECIFIC TWEAKS
   Optimize for device orientation changes
   ───────────────────────────────────────────────────────────── */

@media (orientation: landscape) and (max-height: 600px) {
  body.page-home .block-hero {
    min-height: 480px;
    height: auto;
  }

  body.page-home .welcome-img-wrap,
  body.page-home .prog-editorial__img,
  body.page-home .school-img-side {
    min-height: 300px;
  }
}

@media (orientation: portrait) and (max-width: 480px) {
  body.page-home .block-hero {
    height: 100vh;
    min-height: 500px;
  }
}

/* ─────────────────────────────────────────────────────────────
   REDUCED MOTION SUPPORT
   Respect user preferences for motion and animations
   ───────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  .reveal.active {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   DARK MODE SUPPORT (Optional)
   Add if implementing dark mode
   ───────────────────────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
  /* Maintain light theme for now, but can be extended */
  /* body { background: #1a1a1a; color: #f0f0f0; } */
}

/* ─────────────────────────────────────────────────────────────
   HIGH DPI SCREEN OPTIMIZATION
   Better rendering on high-resolution displays
   ───────────────────────────────────────────────────────────── */

@media (min-resolution: 2dppx) {
  img {
    image-rendering: crisp-edges;
  }

  body.page-home .block-hero-bg {
    image-rendering: optimizeQuality;
  }
}

/* Site-wide responsive container system: keeps desktop layouts broad without stretching text. */
:root {
  --page-gutter: clamp(16px, 3vw, 32px);
  --container-max: 1320px;
  --content-max: var(--container-max);
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

.container,
.nav-inner,
.footer-inner,
.hero-inner,
.hero-container,
.cta-band-inner {
  width: min(calc(100% - (2 * var(--page-gutter))), var(--container-max)) !important;
  max-width: var(--container-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.section-rule {
  width: min(calc(100% - (2 * var(--page-gutter))), var(--container-max));
  max-width: var(--container-max);
}

body > .img-strip,
body > .about-split,
.section > .img-strip,
.section > .about-split,
main > .img-strip,
main > .about-split,
.about-split,
.bh-split {
  width: min(calc(100% - (2 * var(--page-gutter))), var(--container-max)) !important;
  max-width: var(--container-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

body.page-about-design:not(.gallery-page) .prog-editorial__inner,
.page-about .about-editorial .prog-editorial__inner,
.page-about .about-editorial--reverse .prog-editorial__inner {
  width: min(calc(100% - (2 * var(--page-gutter))), var(--container-max)) !important;
  max-width: var(--container-max) !important;
}

body.page-about-design:not(.gallery-page) .prog-editorial__img,
body.page-about-design:not(.gallery-page) .prog-editorial:is(.prog-editorial--reverse, .prog-editorial--flip) .prog-editorial__img,
body.page-about-design:not(.gallery-page) .about-editorial--reverse .prog-editorial__img {
  width: 100% !important;
  max-width: 100% !important;
}

.page-intro h1,
.page-intro p,
.page-banner h1,
.page-banner p,
.page-header h1,
.page-header p,
.bh-banner h1,
.bh-banner p,
.section-intro,
.prog-intro-text,
.prog-editorial__body,
.bh-prose,
.content-grid p,
.card-grid p,
.resource-grid p,
.values-row p,
.mv-grid p {
  max-width: 720px;
}

.page-intro .container,
.page-banner .container,
.page-header .container,
.bh-banner .container,
.merit-banner .container {
  display: block;
}

@media (min-width: 1200px) {
  .offerings-grid,
  .prog-offers-grid,
  .resources-grid,
  .resource-grid,
  .bh-resources,
  .card-grid,
  .level-card-grid,
  .programme-grid,
  .values-row,
  .facilities-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  body.page-home .why-sikri-grid,
  body.page-home .results-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

@media (min-width: 1440px) {
  .container,
  .nav-inner,
  .footer-inner,
  .hero-inner,
  .hero-container,
  .cta-band-inner {
    width: min(calc(100% - 64px), var(--container-max)) !important;
  }

  .main-nav .nav-links {
    gap: 0;
  }
}

@media (min-width: 1920px) {
  :root {
    --page-gutter: 32px;
  }

  .container {
    max-width: var(--container-max) !important;
  }
}

@media (max-width: 767px) {
  :root {
    --page-gutter: 16px;
  }

  .container,
  .nav-inner,
  .footer-inner,
  .hero-inner,
  .hero-container,
  .cta-band-inner {
    width: calc(100% - 32px) !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

@media (max-width: 340px) {
  :root {
    --page-gutter: 12px;
  }

  .container,
  .nav-inner,
  .footer-inner,
  .hero-inner,
  .hero-container,
  .cta-band-inner {
    width: calc(100% - 24px) !important;
  }
}

/* Final mobile drawer overflow guard: hidden closed state does not expand body width. */
.mob-drawer {
  right: 0 !important;
  transform: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.25s ease, visibility 0.25s ease !important;
}

.mob-drawer.open {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Small-screen stats strips must not keep fixed multi-column widths. */
@media (max-width: 480px) {
  .stats-strip,
  .bh-stats {
    width: 100% !important;
    max-width: 100% !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    overflow: hidden !important;
  }

  .stat-block,
  .bh-stat {
    min-width: 0 !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

@media (max-width: 340px) {
  .stats-strip,
  .bh-stats {
    grid-template-columns: 1fr !important;
  }
}

/* Footer should paint full-bleed on wide screens while its content stays on the site grid. */
.footer {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  background: var(--navy-dark, #0d2540) !important;
}

.footer-top {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding-left: max(var(--page-gutter), calc((100vw - var(--container-max)) / 2)) !important;
  padding-right: max(var(--page-gutter), calc((100vw - var(--container-max)) / 2)) !important;
  background: var(--navy-dark, #0d2540) !important;
  box-sizing: border-box !important;
}

.footer-bottom {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding-left: max(var(--page-gutter), calc((100vw - var(--container-max)) / 2)) !important;
  padding-right: max(var(--page-gutter), calc((100vw - var(--container-max)) / 2)) !important;
  box-sizing: border-box !important;
}

@media (max-width: 760px) {
  .footer-top,
  .footer-bottom {
    padding-left: var(--page-gutter) !important;
    padding-right: var(--page-gutter) !important;
  }
}
