/* ==========================================================================
   NUDISIRI SPEECH AND DEVELOPMENT CENTRE
   Responsive Stylesheet (Mobile & Tablet)
   ========================================================================== */

/* --- Tablet Devices (<= 1024px) --- */
@media (max-width: 1024px) {
  .container,
  .container-narrow {
    padding-left: var(--gutter-tablet);
    padding-right: var(--gutter-tablet);
  }

  .heading-1 {
    font-size: 38px;
    letter-spacing: -0.8px;
  }

  .heading-2 {
    font-size: 28px;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .process-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .feature-split {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .feature-split.reverse {
    direction: ltr;
  }
}

/* --- Mobile Devices (<= 768px) --- */
@media (max-width: 768px) {
  .container,
  .container-narrow {
    padding-left: var(--gutter-mobile);
    padding-right: var(--gutter-mobile);
  }

  /* Header & Navigation Drawer */
  .header-inner {
    height: 72px;
  }

  .site-header .logo-wrapper .logo-img,
  .site-header .brand-logo .site-logo-img,
  .site-logo-img,
  .logo-img {
    height: 56px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
  }

  .logo-title {
    font-size: 17px;
  }

  .logo-sub {
    font-size: 10px;
  }

  .nav-menu {
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    height: calc(100vh - 72px);
    background-color: var(--bg-surface);
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 24px;
    gap: 20px;
    border-top: 1px solid var(--border-light);
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  }

  .nav-menu.open {
    transform: translateX(0);
  }

  .nav-link {
    font-size: 18px;
    width: 100%;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
  }

  .nav-link.active::after {
    bottom: -1px;
  }

  .header-actions {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }

  /* Typography */
  .heading-1 {
    font-size: 32px;
    line-height: 1.2;
  }

  .heading-2 {
    font-size: 26px;
    line-height: 1.25;
  }

  .subtitle-large {
    font-size: 18px;
  }

  .lead-text {
    font-size: 16px;
  }

  /* Grids */
  .grid-2,
  .grid-3,
  .grid-4,
  .process-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .modal-backdrop,
  .modal-overlay {
    padding: 12px;
  }

  .modal-window,
  .modal-container,
  .modal-card {
    max-height: 94vh;
    border-radius: var(--radius-md);
  }

  .modal-header {
    padding: 16px 20px 14px;
  }

  .modal-body {
    padding: 20px 18px 24px;
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px; /* Prevents auto-zoom in iOS Safari */
    padding: 11px 14px;
  }

  .btn-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .trust-badges {
    flex-direction: column;
    gap: 12px;
  }

  /* Footer */
  .footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  /* Hero & Visuals */
  .hero-section {
    padding: 28px 0 !important;
  }

  .hero-graphic-box {
    order: -1;
    margin-bottom: 24px;
  }

  .cta-banner-card {
    padding: 24px 18px;
  }

  .cta-banner-card .cta-title {
    font-size: 26px;
  }
}
/* Header logo alignment */
.header-inner {
  display: flex;
  align-items: center;
}

.logo-wrapper,
.brand-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.site-header .logo-wrapper .logo-img,
.site-header .logo-wrapper .site-logo-img,
.site-header .brand-logo .logo-img,
.site-header .brand-logo .site-logo-img {
  height: 88px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  transition: transform var(--transition-fast, 0.2s ease);
}

.logo-wrapper:hover .logo-img,
.logo-wrapper:hover .site-logo-img,
.brand-logo:hover .logo-img,
.brand-logo:hover .site-logo-img {
  transform: scale(1.02);
}

/* Therapy Options hero: stack image and text on tablet and mobile */
@media (max-width: 1024px) {
  .hero-section .hero-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 28px;
  }

  .hero-section .hero-content,
  .hero-section .hero-graphic-box {
    min-width: 0;
    width: 100%;
  }
}

/* Keep the image label from covering too much of the image on phones */
@media (max-width: 600px) {
  .hero-section .feature-tag {
    left: 10px;
    bottom: 10px;
    max-width: calc(100% - 20px);
    padding: 6px 10px;
    font-size: 10px;
  }
}

/* Fix Contact and Services hero layout on phones */
@media (max-width: 768px) {
  .hero-section .hero-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 24px !important;
  }

  .hero-section .hero-content,
  .hero-section .hero-graphic-box {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    order: initial;
  }

  .hero-section .hero-graphic-box {
    margin: 0;
  }

  .hero-section .feature-image-wrapper {
    width: 100%;
    min-height: 220px;
    aspect-ratio: 4 / 3;
  }

  .hero-section .feature-image-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
  }
}

@media (max-width: 768px) {
  .feature-split > .feature-image-wrapper {
    order: -1;
  }
}

@media (max-width: 860px) {
  .hero-section .hero-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .hero-section .hero-grid > .hero-visual-wrapper,
  .hero-section .hero-grid > .hero-visual,
  .hero-section .hero-grid > .hero-graphic-box {
    order: -1;
  }

  .hero-section .hero-grid > .hero-content {
    order: 0;
  }
}

@media (max-width: 768px) {
  .floating-call-btn {
    right: 20px !important;
    bottom: 88px !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    padding: 0 !important;
    gap: 0 !important;
    border-radius: 50% !important;
  }

  .floating-call-btn span {
    display: none !important;
  }

  .floating-call-btn svg {
    width: 20px !important;
    height: 20px !important;
  }
}

/* Mobile layout fixes for About, Therapy Options, and Contact */
@media (max-width: 768px) {
  .hero-section .hero-grid,
  #about-hero .hero-grid,
  #who-we-are .about-grid,
  #mission-vision .mission-vision-grid,
  #values .values-top-grid,
  #values .values-bottom-grid,
  #approach .process-steps-grid,
  .feature-split,
  .feature-split.reverse,
  .grid-2,
  .grid-3,
  .grid-4,
  .process-grid,
  .cta-contact-cards-grid,
  .features-2x2-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 20px !important;
  }

  .hero-section .hero-grid > .hero-visual-wrapper,
  .hero-section .hero-grid > .hero-visual,
  .hero-section .hero-grid > .hero-graphic-box,
  .feature-split > .feature-image-wrapper,
  .feature-split.reverse > .feature-image-wrapper,
  #who-we-are .about-grid > :last-child {
    order: -1 !important;
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .hero-section .hero-grid > .hero-content,
  .feature-split > *,
  .feature-split.reverse > *,
  #who-we-are .about-grid > * {
    min-width: 0 !important;
    width: 100% !important;
  }

  .feature-image-wrapper {
    height: auto !important;
    aspect-ratio: 4 / 3;
  }

  .feature-image-wrapper img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
  }

  #about-hero .hero-photo-card img,
  #who-we-are img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
  }
}

/* ---------- Services page mobile fixes ---------- */

.service-subnav {
  position: sticky;
  top: 100px;
  z-index: 900;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.service-subnav .container {
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

@media (max-width: 768px) {
  .container,
  .container-narrow {
    padding-left: 20px;
    padding-right: 20px;
  }

  .header-inner {
    min-height: 72px;
    position: relative;
  }

  .logo-img {
    height: 56px;
    max-width: 130px;
  }

  .mobile-toggle {
    display: flex;
  }

  .header-actions .btn-header-cta {
    display: none;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: #fff;
    padding: 8px 20px 16px;
    box-shadow: 0 12px 24px rgba(0, 20, 40, 0.08);
  }

  .nav-menu.active,
  .nav-menu.open,
  .nav-menu.show {
    display: flex;
  }

  .nav-menu .nav-link {
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
  }

  .service-subnav {
    top: 72px;
  }

  .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .hero-graphic-box {
    order: -1;
  }

  .hero-content h1 br {
    display: none;
  }

  .heading-1 {
    font-size: 30px;
  }
  .heading-2 {
    font-size: 26px;
  }

  .feature-split,
  .feature-split.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: 20px;
    margin-bottom: 40px;
    scroll-margin-top: 150px;
  }

  .feature-split .feature-image-wrapper {
    order: -1;
  }

  .btn-group {
    flex-direction: column;
    align-items: stretch;
  }

  .trust-badges {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .hero-grid {
    display: flex !important;
    flex-direction: column-reverse !important; /* image first, text second */
    gap: 24px !important;
  }
}
