/*
 * Your Website — Unified public responsive layer
 * Version: 2026-11-08-rs1
 * Additive presentation rules only. Existing page markup, CMS data and behaviour stay intact.
 */
:root {
  --rs-content-gutter: clamp(12px, 2.4vw, 32px);
  --rs-section-gap: clamp(16px, 2.4vw, 28px);
  --rs-control-height: 42px;
}
html { max-width: 100%; overflow-x: clip; }
body { min-width: 320px; max-width: 100%; overflow-x: clip; }
*, *::before, *::after { box-sizing: border-box; }
img, video, iframe { max-width: 100%; }
input, select, textarea, button { max-width: 100%; }

/* Prevent long labels, URLs and data values from forcing the page wider. */
.cms-public-main, .cms-public-full, main, section, article, .page-panel,
.school-layout, .events, .gallery-section, .services-container,
.footer-container, .post-card, .service-row, .profile-card {
  min-width: 0;
}
.cms-public-main, .cms-public-article, .cms-article-content { overflow-wrap: anywhere; }

/* Large-screen content uses fluid widths instead of fixed viewport assumptions. */
.banner { width: min(calc(100% - 32px), 1720px); height: clamp(260px, 29vw, 460px); margin-left: auto; margin-right: auto; }
.banner img { width: 100%; height: 100%; object-fit: cover; }
.school-layout { width: min(calc(100% - 32px), 1720px); max-width: 1720px; }
.profile-card img { width: min(100%, 300px); height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.gallery-section { height: auto; min-height: 0; }
.gallery-container { max-width: 100%; }
.gallery-track img { max-width: calc(100vw - 48px); }
.events-photo img { max-width: 100%; height: auto; object-fit: cover; }
.footer-container { width: min(100%, 1720px); }
.footer-section { min-width: 0; overflow-wrap: anywhere; }

/* Tablet: 768–1024px. Keep the desktop information architecture, reduce density. */
@media (min-width: 769px) and (max-width: 1024px) {
  .main-header { min-height: 86px !important; padding: 10px 18px !important; }
  .logo-section { left: 18px !important; }
  .logo-section .logo { max-width: 132px !important; max-height: 58px !important; height: auto !important; }
  .info-section { max-width: calc(100% - 190px) !important; margin: 0 auto !important; }
  .info-section h1 { font-size: clamp(21px, 2.8vw, 28px) !important; line-height: 1.15 !important; }
  .info-section h3 { font-size: clamp(11px, 1.45vw, 15px) !important; line-height: 1.3 !important; }
  .info-section h4 { font-size: 11px !important; }
  .header-subtitle-element, .header-location { font-size: 11px !important; }

  #menu.menu { gap: 6px !important; padding: 5px 8px !important; min-height: 52px !important; }
  #menu.menu .menu-left { flex: 0 0 42px !important; min-width: 42px !important; }
  #menu.menu .menu-center { flex: 1 1 auto !important; min-width: 0 !important; overflow-x: auto !important; overflow-y: visible !important; justify-content: flex-start !important; scrollbar-width: thin; }
  #menu.menu .menu-right { flex: 0 0 auto !important; min-width: 0 !important; }
  #menu.menu .nm-menu-link { padding: 8px 6px !important; font-size: clamp(9px, 1.05vw, 11px) !important; }
  #menu.menu .nm-menu-label { max-width: 112px !important; }
  #menu.menu .menu-account-link { padding: 8px 7px !important; font-size: 10px !important; }

  .banner { height: clamp(250px, 34vw, 350px) !important; }
  .motion-text { font-size: clamp(2rem, 4.2vw, 3.2rem) !important; }
  .school-layout { display: grid !important; grid-template-columns: minmax(0, 1.35fr) minmax(220px, .65fr) !important; align-items: start !important; gap: 20px !important; padding: 22px !important; }
  .left-section, .right-section { min-width: 0 !important; width: auto !important; }
  .right-section { align-items: stretch !important; }
  .profile-card img { max-width: 240px !important; }
  .events, .gallery-section { padding: 20px !important; margin-left: 16px !important; margin-right: 16px !important; }
  .gallery-track img { width: clamp(220px, 30vw, 300px) !important; height: clamp(170px, 23vw, 230px) !important; margin: 0 9px !important; }
  .hexagon-gallery-section { max-width: calc(100% - 24px) !important; }
  .footer-container { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 22px !important; }
}

/* Mobile: single-column reading flow, full-width controls and safe touch targets. */
@media (max-width: 768px) {
  .main-header { width: 100% !important; min-height: 0 !important; padding: 12px 54px 13px 12px !important; gap: 7px !important; }
  .main-header .logo-section { margin: 0 auto 4px !important; left: auto !important; position: relative !important; }
  .main-header .logo-section .logo { width: auto !important; height: auto !important; max-width: 112px !important; max-height: 42px !important; }
  .main-header .info-section { width: 100% !important; max-width: 100% !important; text-align: center !important; }
  .main-header .info-section h1 { font-size: clamp(17px, 5vw, 22px) !important; line-height: 1.16 !important; margin: 0 0 3px !important; }
  .main-header .info-section h3 { font-size: clamp(10px, 3vw, 12px) !important; line-height: 1.25 !important; }
  .main-header .info-section h4 { font-size: 10px !important; margin-top: 3px !important; }
  .main-header .hamburger { top: 16px !important; right: 12px !important; min-width: 40px !important; min-height: 40px !important; justify-content: center !important; align-items: center !important; }
  .main-header .header-subtitle-element, .main-header .header-location { display: none !important; }

  .banner { width: calc(100% - 20px) !important; height: clamp(190px, 58vw, 280px) !important; margin: 12px auto 18px !important; border-radius: 16px !important; }
  .banner img { object-fit: cover !important; }
  .banner-welcome-text { width: calc(100% - 24px) !important; font-size: clamp(19px, 6vw, 30px) !important; letter-spacing: .04em !important; }
  .motion-text { font-size: clamp(20px, 6vw, 30px) !important; white-space: normal !important; }

  .school-layout { display: flex !important; flex-direction: column !important; width: calc(100% - 20px) !important; max-width: none !important; margin: 14px auto !important; padding: 16px !important; gap: 16px !important; }
  .left-section, .right-section { width: 100% !important; flex: 1 1 auto !important; min-width: 0 !important; }
  .left-section h2 { font-size: clamp(18px, 5vw, 22px) !important; line-height: 1.3 !important; }
  .left-section p { font-size: 14px !important; line-height: 1.65 !important; text-align: left !important; overflow-wrap: anywhere !important; }
  .right-section { align-items: stretch !important; gap: 14px !important; }
  .profile-card { width: 100% !important; padding: 13px !important; }
  .profile-card img { width: min(100%, 230px) !important; height: auto !important; aspect-ratio: 1 / 1 !important; }

  .events, .gallery-section, .hexagon-gallery-section { width: calc(100% - 20px) !important; max-width: none !important; margin: 16px auto !important; padding: 15px !important; height: auto !important; min-height: 0 !important; }
  .events-photo { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 9px !important; }
  .events-photo img { display: block !important; width: 100% !important; height: auto !important; aspect-ratio: 4 / 3 !important; margin: 0 !important; }
  .gallery-container { overflow: hidden !important; }
  .gallery-track img { width: clamp(190px, 70vw, 270px) !important; height: clamp(145px, 52vw, 205px) !important; margin: 0 7px !important; }
  .hexagon-gallery-section h2 { font-size: clamp(18px, 5vw, 24px) !important; margin-bottom: 18px !important; }

  .footer { padding: 24px 0 14px !important; }
  .footer-container { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; width: calc(100% - 28px) !important; padding: 0 !important; gap: 18px !important; }
  .footer-section { width: 100% !important; min-width: 0 !important; }
  .footer-section iframe { width: 100% !important; max-width: 100% !important; }

  .cms-public-main, .cms-public-full { width: 100% !important; max-width: 100% !important; padding-left: 10px !important; padding-right: 10px !important; }
  .cms-public-article, .cms-public-article * { max-width: 100%; }
  .cms-public-article img, .cms-public-article video, .cms-public-article iframe { height: auto; }
  .cms-public-article table { display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cms-public-article pre, .cms-public-article code { overflow-wrap: anywhere; white-space: pre-wrap; }

  .pagination-container { max-width: 100%; overflow-x: auto; justify-content: flex-start !important; padding: 0 10px; }
  button, .button, .btn, input, select { touch-action: manipulation; }
}

@media (max-width: 420px) {
  .school-layout, .events, .gallery-section, .hexagon-gallery-section { width: calc(100% - 14px) !important; padding: 12px !important; }
  .events-photo { gap: 7px !important; }
  .footer-container { width: calc(100% - 22px) !important; }
  .main-header .hamburger { right: 8px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-track, .motion-text, .logo-section .logo { animation: none !important; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
