/* Shared narrow-screen layout for all three pages. */
@media(max-width:1150px){
  header{gap:12px}
  header .brand{flex:1;min-width:0;max-width:650px;width:auto}
  .menu-toggle{flex:none;min-width:44px;min-height:44px;line-height:1}
  header nav.open{max-height:calc(100dvh - 90px);overflow-y:auto;overscroll-behavior:contain}
  header nav a{min-height:44px;white-space:normal}
}
@media(max-width:900px){
  .hero{display:flex;flex-direction:column;min-height:0}
  .hero-copy{padding:32px 24px}
  .hero-gallery{height:auto;padding:24px;gap:22px}
  .hero-actions{flex-direction:row;flex-wrap:wrap;align-items:center}
  .hero h1{font-size:32px}
  .contact-layout,.events-layout{display:block}
  .contact-copy{margin-bottom:30px}
  .event-archive{margin-top:30px}
  .community-inner{flex-wrap:wrap;gap:28px}
  .why-layout{grid-template-columns:minmax(0,1fr);gap:20px}
  .section-side,.course-content,.contact-copy,.form-grid>*,.about-article{min-width:0}
  .course-layout{grid-template-columns:220px minmax(0,1fr)}
  .subject-grid{grid-template-columns:minmax(0,1fr)}
  .hero-carousel-controls{flex-wrap:wrap}
  .hero-carousel-controls button,.banner-controls button{min-width:44px;min-height:44px}
  .qr-list{flex-wrap:wrap}
  .about-layout{grid-template-columns:160px minmax(0,1fr)}
}
@media(max-width:600px){
  html{scroll-padding-top:88px}
  body{font-size:17px;overflow-wrap:break-word}
  header{padding:0 12px;height:72px}
  header .brand{max-width:calc(100% - 56px)}
  header nav{top:72px;padding:12px 16px}
  header nav.open{gap:4px 16px;max-height:calc(100dvh - 72px)}
  header nav a{font-size:16px;padding:10px 0}
  .wrap{width:calc(100% - 32px)}
  .hero-copy{padding:28px 20px}
  .hero .eyebrow{font-size:14px;letter-spacing:1.3px}
  .hero h1{font-size:30px}
  .hero-actions{gap:16px}
  .hero-actions .button{padding:12px 16px;gap:14px}
  .hero-tags{gap:12px;justify-content:space-between}
  .hero-gallery{padding:20px 16px}
  .hero-carousel-controls{gap:12px;justify-content:space-between}
  .hero-carousel-arrows{margin-left:auto}
  .hero-carousel-controls button{min-width:44px;min-height:44px}
  .hero-carousel figcaption{min-height:4.5em;overflow-wrap:anywhere}
  .notice>a{min-width:0}
  .course-layout{display:block}
  .course-tabs{grid-template-columns:repeat(2,minmax(0,1fr))}
  .course-tabs button{line-height:1.5;overflow-wrap:anywhere}
  .course-content{padding:22px 16px}
  .course-bottom>a{margin-left:0;min-height:44px;display:flex;align-items:center}
  .subject-link{min-height:48px}
  .contact-copy h2{font-size:28px}
  .phone{font-size:28px;letter-spacing:0}
  form{padding:24px 16px}
  .form-title{flex-wrap:wrap;gap:8px}
  .form-grid{grid-template-columns:minmax(0,1fr)}
  .degree-selects{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .form-grid input,.form-grid select{font-size:17px;max-width:100%}
  .form-grid input[type=hidden]{display:none}
  .activity-pagination{flex-wrap:wrap;gap:8px}
  .activity-pagination button{min-height:44px;padding:8px 12px}
  .activity-pagination span{font-size:16px}
  .archive-row{overflow-wrap:anywhere}
  .learning-actions>*{min-height:44px;max-width:100%}
  .about-layout{display:block}
  .about-contact{padding:20px 16px}
  .about-contact .button{max-width:100%;gap:12px}
  .about-article h2,.anniversary-article h2{font-size:25px}
  .anniversary-article{font-size:17px;padding-top:30px;padding-bottom:44px}
  .anniversary-article h3{font-size:21px}
  .footer-nav{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px;padding:24px 0}
  .footer-nav a{white-space:normal;min-height:44px;display:flex;align-items:center}
  .footer-legal{overflow-wrap:anywhere}
  .qr-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 16px;width:100%}
  .qr-list img{margin:auto;width:112px;height:112px}
  .float-tools{right:8px;bottom:calc(12px + env(safe-area-inset-bottom))}
  .float-tools button{width:44px;padding:8px 0}
  .float-tools>a{min-height:44px}
  #consult-panel{right:60px;bottom:calc(12px + env(safe-area-inset-bottom));width:min(280px,calc(100vw - 72px));padding:24px 16px;max-height:75dvh;overflow:auto}
  #consult-panel .button{padding:10px;white-space:normal}
  dialog{width:calc(100% - 20px);max-width:none;max-height:calc(100dvh - 24px);padding:18px;margin:auto;overscroll-behavior:contain;overflow-x:hidden;overflow-y:auto}
  #close-viewer{width:44px;height:44px}
  #viewer-content>h3{font-size:22px;padding-right:42px;overflow-wrap:anywhere}
  #viewer-content .direction-images{gap:14px}
  #viewer-content .direction-images img{width:100%}
  .activity-body{font-size:17px;overflow-wrap:anywhere}
  .activity-body iframe,.activity-body video{max-width:100%}
  .activity-body table{width:100%;overflow:auto}
  .learning-disciplines{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:380px){
  .hero-carousel-controls{flex-direction:column;align-items:stretch}
  .hero-dots{justify-content:center}
  .hero-carousel-arrows{justify-content:center;margin:0}
  .hero-tags{font-size:15px;gap:8px}
}
