/* HCSE site-wide responsive safeguards */
html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

*, *::before, *::after { box-sizing: border-box; }

:where(main, section, header, footer, nav, article, aside, form, fieldset, div) { min-width: 0; }

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

:where(iframe, embed, object) { max-width: 100%; }

:where(input, select, textarea, button) {
  max-width: 100%;
  font: inherit;
}

.privacy-consent { display: grid !important; grid-template-columns: 18px minmax(0, 1fr) !important; gap: 9px !important; align-items: start; font-size: 12px !important; font-weight: 500 !important; line-height: 1.45; }
.privacy-consent input { width: 17px !important; height: 17px; margin: 1px 0 0; accent-color: #019a98; }
.privacy-consent a { color: #006d70; font-weight: 800; }

:where(h1, h2, h3, h4, p, li, a, strong, span) {
  overflow-wrap: break-word;
}

table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.wrap {
  width: min(calc(100% - 32px), 1400px);
  margin-inline: auto;
}

.live-map-frame > iframe {
  width: 100%;
  height: 100%;
}

@media (min-width: 1600px) {
  .wrap { max-width: 1400px; }
  .hero-grid { margin-inline: auto; }
  .hero-copy { max-width: 760px; }
}

@media (max-width: 1180px) {
  :where(.hero-grid, .about-grid, .contact-grid, .intro-grid, .admissions-grid, .enquiry-grid, .sectors) {
    gap: clamp(28px, 4vw, 52px);
  }

  :where(.services-grid, .training-grid, .standards-grid, .service-grid, .process-list, .grid3) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .wrap { padding-inline: clamp(16px, 4.5vw, 34px); }

  :where(.hero-grid, .about-grid, .contact-grid, .intro-grid, .admissions-grid, .enquiry-grid, .sectors, .contact-row) {
    grid-template-columns: minmax(0, 1fr);
  }

  :where(.hero-copy, .hero-visual, .campus-frame, .proof, .admit-card, .student-form) {
    width: 100%;
    max-width: 100%;
  }

  :where(.hero-media, .hero-city-frame, .campus-frame img) {
    min-height: 0;
    height: auto;
  }

  .campus-frame img { aspect-ratio: 16 / 10; object-fit: cover; }
  .live-map-frame { height: clamp(340px, 57vw, 540px); }
}

@media (max-width: 720px) {
  :where(.services-grid, .training-grid, .standards-grid, .service-grid, .process-list, .grid3, .grid2, .program-grid, .facts, .sector-list) {
    grid-template-columns: minmax(0, 1fr);
  }

  :where(.actions, .cta-row, .bridge-row, .contact-row, .footer-row, .foot) {
    align-items: stretch;
    flex-direction: column;
  }

  :where(.actions .btn, .cta-row .btn, .bridge-row .btn, .contact-row .button) {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .student-form { grid-template-columns: minmax(0, 1fr); }
  .student-form :where(label, label.full, .btn, .form-note) { grid-column: 1; }
}

@media (max-width: 560px) {
  .wrap {
    width: 100%;
    padding-inline: 16px;
  }

  :where(h1, .hero h1) {
    max-width: 100%;
    font-size: clamp(2.2rem, 11vw, 3.15rem);
    line-height: 1.04;
  }

  :where(.section-head h2, .intro h2, .programs h2, .admissions h2, .enquiry h2, .cta h2, .bridge h2) {
    font-size: clamp(1.9rem, 8.5vw, 2.8rem);
  }

  :where(.card, .service-card, .program, .step, .proof div, .admit-card, .student-form) {
    min-height: 0;
    padding: 22px 20px;
  }

  :where(input, select, textarea) { width: 100%; min-width: 0; font-size: 16px; }
  .live-map-heading { flex-direction: column; align-items: stretch; }
  .live-map-heading > a { width: 100%; text-align: center; }
  .live-map-frame { height: clamp(300px, 105vw, 430px); }

  .event-float {
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    max-width: calc(100vw - 16px);
  }

  .hcse-chat-panel {
    right: 8px;
    bottom: max(76px, calc(76px + env(safe-area-inset-bottom)));
    left: 8px;
    width: auto;
    max-width: none;
  }
}

@media (max-width: 360px) {
  .wrap { padding-inline: 12px; }
  :where(.btn, .button) { padding-inline: 14px; }
  .live-map-frame { height: 300px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .event-float { display: none; }
  .consultation-dialog, .event-dialog { max-height: calc(100dvh - 12px); overflow-y: auto; }
}

@media print {
  .event-float, .hcse-chat-widget, .hcse-chat-launcher { display: none !important; }
  body { overflow: visible; }
}
