/* Crescent School — shared mobile / tablet optimizations */
html{
  overflow-x:hidden;
  -webkit-text-size-adjust:100%;
}
body{
  overflow-x:hidden;
}
img,video,iframe,svg{
  max-width:100%;
}
button,a,input,textarea,select{
  -webkit-tap-highlight-color:transparent;
}

/* hamburger is injected by mobile-nav.js */
.mobile-nav-toggle{
  display:none;
  width:44px;
  height:44px;
  border:0;
  border-radius:9px;
  background:#f5f5f5;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  flex:0 0 auto;
}
.mobile-nav-toggle span,
.mobile-nav-toggle::before,
.mobile-nav-toggle::after{
  content:"";
  display:block;
  width:21px;
  height:2px;
  border-radius:2px;
  background:#555;
  transition:transform .2s ease,opacity .2s ease;
}
.mobile-nav-toggle span{margin:5px 0}
.mobile-nav-toggle.open span{opacity:0}
.mobile-nav-toggle.open::before{transform:translateY(7px) rotate(45deg)}
.mobile-nav-toggle.open::after{transform:translateY(-7px) rotate(-45deg)}

@media(max-width:900px){
  nav{
    padding:8px 18px !important;
  }
  .nav-links{
    gap:24px !important;
  }

  .about-content{
    padding:42px 28px !important;
    gap:34px !important;
  }

  .about-video-section{
    padding:28px 28px 54px !important;
  }

  .contact-content{
    padding:50px 28px !important;
  }

  .album-grid-content{
    padding:34px 28px !important;
  }
}

@media(max-width:720px){
  nav{
    position:sticky !important;
    top:0 !important;
    min-height:64px;
    padding:7px 14px !important;
    overflow:visible !important;
  }
  .nav-logo{
    min-width:0;
  }
  .nav-logo a{
    display:flex;
    align-items:center;
  }
  .nav-logo svg{
    width:auto !important;
    height:44px !important;
    max-width:130px !important;
  }
  .mobile-nav-toggle{
    display:flex;
    flex-direction:column;
    z-index:103;
  }
  .nav-links{
    position:absolute !important;
    top:100%;
    left:0;
    right:0;
    display:none !important;
    flex-direction:column !important;
    gap:0 !important;
    padding:8px 14px 14px;
    background:#fff;
    border-top:1px solid #eee;
    box-shadow:0 12px 24px rgba(0,0,0,.12);
    z-index:102;
  }
  .nav-links.mobile-open{
    display:flex !important;
  }
  .nav-links a{
    display:block;
    width:100%;
    min-height:44px;
    padding:12px 8px;
    font-size:.92rem !important;
  }

  /* Latest-updates ticker */
  .latest-updates-ticker{
    min-height:38px;
  }
  .ticker-label{
    padding:0 10px !important;
    font-size:.58rem !important;
  }
  .ticker-item{
    padding:0 15px !important;
    font-size:.72rem !important;
  }

  /* Homepage hero */
  .home-hero{
    height:auto !important;
    min-height:calc(100svh - 64px);
    padding:48px 18px 88px !important;
  }
  .hero-title-wrap{
    padding:50px 28px !important;
    max-width:100%;
  }
  .hero-title .crescent{
    font-size:clamp(2.65rem,15vw,4.5rem) !important;
    line-height:1.05;
  }
  .hero-title .sub{
    font-size:clamp(1.35rem,8vw,2.2rem) !important;
  }
  .splash-top-right{
    width:120px !important;
    right:-10px !important;
    top:10px !important;
  }
  .splash-bottom-left{
    width:150px !important;
    left:-18px !important;
    bottom:52px !important;
  }
  .splash-top-left,
  .splash-bottom-right{
    width:62px !important;
  }

  .home-teal-body{
    padding:26px 20px 34px !important;
  }
  .home-teal-body p{
    font-size:.92rem !important;
    line-height:1.7;
  }

  .home-carousel-section{
    padding:28px 0 !important;
  }
  .carousel-slide{
    width:165px !important;
    padding:7px 8px !important;
  }
  .reel-card{
    border-radius:10px !important;
  }
  .reel-play{
    width:44px !important;
    height:44px !important;
    font-size:1.05rem !important;
  }

  .home-video-section{
    padding:0 10px 26px !important;
  }
  .video-frame-wrap{
    padding:11px !important;
  }

  /* About */
  .about-content{
    grid-template-columns:1fr !important;
    padding:30px 18px !important;
    gap:24px !important;
    max-width:620px !important;
  }
  .about-photo{
    width:100%;
    max-width:520px;
    margin:0 auto;
  }
  .about-text{
    padding-top:0 !important;
  }
  .about-text p{
    font-size:.94rem !important;
    line-height:1.75 !important;
  }
  .about-video-section{
    padding:16px 12px 42px !important;
  }
  .about-slideshow{
    border-radius:4px !important;
  }
  .about-slideshow .slide{
    padding:11px !important;
  }
  .slide-nav{
    width:38px !important;
    height:38px !important;
    font-size:1.6rem !important;
  }
  .slide-nav.prev{left:9px !important}
  .slide-nav.next{right:9px !important}
  .slide-dots{
    bottom:10px !important;
  }

  /* Gallery / albums */
  .album-grid-content{
    padding:24px 14px 38px !important;
  }
  .album-grid-content .back-btn{
    margin-bottom:18px !important;
  }
  .photo-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:8px !important;
  }
  .lb-close{
    top:12px !important;
    right:14px !important;
    font-size:2rem !important;
  }
  .lb-nav{
    width:42px !important;
    height:42px !important;
    font-size:2rem !important;
  }
  .lb-nav.prev{left:7px !important}
  .lb-nav.next{right:7px !important}
  .lightbox-overlay img{
    max-width:94vw !important;
    max-height:82vh !important;
  }

  /* Contact */
  .contact-content{
    padding:36px 18px 48px !important;
  }
  .contact-content h2{
    font-size:1.35rem !important;
  }
  .contact-intro{
    font-size:.94rem !important;
    line-height:1.7 !important;
    margin-bottom:28px !important;
  }
  .form-row{
    grid-template-columns:1fr !important;
    gap:18px !important;
  }
  .form-field input,
  .form-field textarea{
    font-size:16px !important; /* avoids iOS input zoom */
    min-height:46px;
  }
  .submit-btn{
    width:100%;
    min-height:46px;
  }

  footer{
    padding:16px 14px !important;
    font-size:.76rem !important;
  }

  .float-instagram{
    width:46px !important;
    height:46px !important;
    right:16px !important;
    bottom:16px !important;
  }
  .float-instagram svg{
    width:23px !important;
    height:23px !important;
  }
}

@media(max-width:420px){
  .ticker-label{
    max-width:76px;
    white-space:normal !important;
    line-height:1.15;
  }
  .carousel-slide{
    width:148px !important;
  }
  .photo-grid{
    gap:6px !important;
  }
}

/* Respect users who ask for less motion. */
@media(prefers-reduced-motion:reduce){
  *,
  *::before,
  *::after{
    scroll-behavior:auto !important;
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.01ms !important;
  }
}
