/**
 * SMYLE FASHION INSTITUTE - Responsive Adjustments
 * Breakpoints: Tablet (<= 1024px), Mobile (<= 768px), Small (<= 480px)
 * Phase 2: Touch Safety & Responsive Stage Heights
 */

/* ==================================================
   TABLET BREAKPOINT (<= 1024px)
   ================================================== */
@media screen and (max-width: 1024px) {
  .container {
    padding-left: var(--gutter-tablet);
    padding-right: var(--gutter-tablet);
  }

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

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

  /* Tablet Hero Adjustments */
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    align-items: center;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-media-box {
    aspect-ratio: 4 / 3;
  }

  /* Testimonials Stage Tablet */
  .testimonials-stage {
    height: 520px;
  }

  /* Gallery Stage Tablet */
  .gallery-stage {
    height: 380px;
  }
}

/* ==================================================
   MOBILE BREAKPOINT (<= 768px)
   ================================================== */
@media screen and (max-width: 768px) {
  body {
    padding-bottom: calc(var(--mobile-bottom-bar-height) + env(safe-area-inset-bottom, 0px));
  }

  .container {
    padding-left: var(--gutter-mobile);
    padding-right: var(--gutter-mobile);
  }

  .section {
    padding-block: clamp(2.25rem, 5vw, 3rem);
  }

  /* Compact editorial mobile hero */
  .section-hero {
    padding-top: var(--space-sm);
    padding-bottom: var(--space-xl);
  }

  /* Single-column stacked hero with semantic natural ordering */
  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
  }

  .hero-content {
    display: contents;
  }

  .hero-content .overline {
    order: 1;
    margin-bottom: var(--space-2xs);
  }

  .hero-content .display-title {
    order: 2;
    margin-bottom: var(--space-sm);
    font-size: clamp(2.15rem, 1.8rem + 2vw, 2.75rem);
    line-height: 1.18;
    max-width: 100%;
  }

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

  .hero-visual {
    order: 3;
    width: 100%;
    margin-bottom: var(--space-xs);
  }

  .hero-media-box {
    width: 100%;
    aspect-ratio: 4 / 3;
  }

  .hero-lead {
    order: 4;
    margin-top: 0;
    margin-bottom: var(--space-md);
    font-size: var(--text-body);
    line-height: 1.6;
    max-width: 100%;
  }

  .hero-cta-group {
    order: 5;
    width: 100%;
    display: flex;
    gap: var(--space-xs);
  }

  /* Structural grids convert to single column */
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  /* Header adjustments */
  .site-header {
    height: var(--header-height-mobile);
  }

  .nav-desktop,
  .header-cta {
    display: none;
  }

  .nav-dropdown-menu {
    display: none;
  }

  .hamburger-btn {
    display: flex;
  }

  /* Mobile Navigation Drawer */
  .mobile-drawer {
    position: fixed;
    top: var(--header-height-mobile);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height-mobile));
    background-color: var(--color-bg-primary);
    padding: var(--space-xl) var(--gutter-mobile);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition-normal), opacity var(--transition-normal);
    z-index: 999;
    overflow-y: auto;
  }

  .mobile-drawer.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
  }

  .mobile-nav-link {
    font-family: var(--font-serif);
    font-size: var(--text-h3);
    color: var(--color-text-primary);
    display: block;
    padding: var(--space-2xs) 0;
    border-bottom: 1px solid var(--color-border);
  }

  .mobile-nav-link.active {
    color: var(--color-accent);
  }

  .mobile-nav-group {
    border-bottom: 1px solid var(--color-border);
  }

  .mobile-nav-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    border-bottom: none;
  }

  .mobile-nav-toggle.active {
    color: var(--color-accent);
  }

  .mobile-nav-arrow {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    line-height: 1;
    transition: transform var(--transition-fast);
  }

  .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-arrow {
    transform: rotate(45deg);
  }

  .mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
  }

  .mobile-nav-group.is-open .mobile-submenu {
    max-height: 320px;
  }

  .mobile-submenu-link {
    display: block;
    padding: 8px 0 8px 18px;
    color: var(--color-text-secondary);
    font-size: var(--text-small);
  }

  .mobile-submenu-link:hover,
  .mobile-submenu-link:focus-visible {
    color: var(--color-accent);
  }

  /* Interactive Stage Mobile Sizing */
  .showcase-item {
    flex: 0 0 240px;
    width: 240px;
  }

  .testimonials-stage {
    height: 480px;
  }

  .testimonial-card {
    width: clamp(240px, 68vw, 290px);
  }

  .testimonial-card.is-prev {
    transform: translate3d(-75%, 0, -80px) scale(0.85) rotateY(12deg);
  }

  .testimonial-card.is-next {
    transform: translate3d(75%, 0, -80px) scale(0.85) rotateY(-12deg);
  }

  .gallery-stage {
    height: 300px;
  }

  .coverflow-item {
    width: clamp(240px, 78vw, 360px);
  }

  .coverflow-item.is-prev {
    transform: translate3d(-60%, 0, -60px) scale(0.85) rotateY(16deg);
  }

  .coverflow-item.is-next {
    transform: translate3d(60%, 0, -60px) scale(0.85) rotateY(-16deg);
  }

  /* Online Course ₹99 Showcase Module Mobile Sizing */
  .online-showcase-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .online-showcase-visual {
    width: 100%;
  }

  .online-showcase-visual .media-box {
    width: 100%;
    aspect-ratio: 4 / 3;
  }

  .online-showcase-visual .media-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Footer adjustments */
  .footer-top {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }

  /* ==================================================
     MOBILE ACTION BAR (STICKY BOTTOM)
     ================================================== */
  .mobile-action-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--mobile-bottom-bar-height);
    background-color: var(--color-bg-primary);
    border-top: 1px solid var(--color-border);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 16px rgba(24, 22, 21, 0.06);
  }

  .action-bar-btn,
  .mobile-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    height: 100%;
    border-right: 1px solid var(--color-border);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
  }

  .action-bar-btn:last-child,
  .mobile-action:last-child {
    border-right: none;
  }

  /* Enquire CTA in Action Bar */
  .action-bar-btn.btn-enquire,
  .mobile-action.enquire-action {
    background-color: var(--color-accent);
    color: var(--color-text-inverse);
  }

  .action-bar-btn:active,
  .mobile-action:active {
    opacity: 0.85;
  }
}

/* ==================================================
   SMALL PHONES (<= 480px)
   ================================================== */
@media screen and (max-width: 480px) {
  .btn {
    padding: 12px 18px;
    font-size: var(--text-xs);
  }

  .hero-cta-group {
    flex-direction: column;
  }

  .hero-cta-group .btn {
    width: 100%;
  }

  .testimonials-stage {
    height: 440px;
  }

  .gallery-stage {
    height: 250px;
  }
}

/* Phase 1 — header fits the logo and Student Login without overflow */
@media screen and (max-width: 1180px) {
  .site-header {
    height: var(--header-height-mobile);
  }

  .nav-desktop {
    display: none;
  }

  .header-cta {
    display: flex;
    align-items: stretch;
    align-self: stretch;
    height: 100%;
    margin-left: auto;
    gap: 0;
  }

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

  .header-cta .student-login-link {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 100%;
    min-height: 44px;
    min-width: 44px;
    padding: 0 10px;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
  }

  .hamburger-btn {
    display: flex;
    margin-left: 2px;
  }

  .mobile-drawer {
    position: fixed;
    top: var(--header-height-mobile);
    left: 0;
    width: 100%;
    height: calc(100dvh - var(--header-height-mobile));
    background-color: var(--color-bg-primary);
    padding: var(--space-xl) var(--gutter-mobile);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition-normal), opacity var(--transition-normal);
    z-index: 999;
    overflow-y: auto;
  }

  .mobile-drawer.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}

@media screen and (max-width: 768px) {
  .brand-logo-img {
    height: 36px;
    max-width: calc(100vw - 210px);
  }
}

@media screen and (max-width: 414px) {
  .site-header .brand-logo {
    flex-shrink: 1;
    min-width: 0;
  }

  .brand-logo-img {
    height: auto;
    max-height: 32px;
    max-width: calc(100vw - 210px);
  }
}
