/* ==========================================================================
   FAKHIR IMRAN - Responsive Breakpoints & Mobile Drawer
   ========================================================================== */

/* Universal Mobile Overflow Protection */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  position: relative;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* Mobile Navigation Toggle Button */
.mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-white);
  padding: 0.5rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.mobile-toggle svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Mobile Drawer Overlay & Panel */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.mobile-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 86vw);
  height: 100vh;
  height: 100dvh;
  background: #FFFFFF;
  border-left: 1px solid var(--border-card);
  z-index: 1600;
  padding: 0;
  display: none;
  flex-direction: column;
  justify-content: flex-start;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  box-shadow: -12px 0 35px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-drawer.open {
  display: flex !important;
  transform: translateX(0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid #E2E8F0;
  flex-shrink: 0;
  box-sizing: border-box;
}

.drawer-header .logo-wrapper {
  min-width: 0;
  flex: 1;
}

.drawer-header .logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0F172A;
  line-height: 1.2;
}

.drawer-header .logo-sub {
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-close {
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  color: #334155;
  cursor: pointer;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  transition: all 0.2s ease;
}

.drawer-close:hover {
  background: rgba(15, 118, 110, 0.1);
  color: #0F766E;
  border-color: #0F766E;
}

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem 1.15rem;
  flex-grow: 1;
  box-sizing: border-box;
}

.drawer-link {
  font-family: var(--font-heading);
  font-size: 1.025rem;
  font-weight: 600;
  color: #1E293B;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
  display: block;
}

.drawer-link:hover, .drawer-link.active {
  color: #0F766E;
  background: rgba(15, 118, 110, 0.08);
  font-weight: 700;
  padding-left: 1rem;
}

.drawer-footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.15rem 1.25rem 1.5rem;
  border-top: 1px solid #E2E8F0;
  background: #F8FAFC;
  margin-top: auto;
  flex-shrink: 0;
  box-sizing: border-box;
}

.drawer-footer .btn {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 0.75rem 1rem !important;
  font-size: 0.9rem !important;
  justify-content: center !important;
  text-align: center !important;
  white-space: normal !important;
}

/* --------------------------------------------------------------------------
   Responsive Media Queries
   -------------------------------------------------------------------------- */

/* Large Tablets & Small Laptops (max-width: 1024px) */
@media (max-width: 1024px) {
  .nav-links {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3.5rem;
    text-align: center;
  }

  .hero-content {
    align-items: center;
  }

  .role-badge {
    margin-inline: auto;
  }

  .hero-subtitle {
    margin-inline: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-metrics-bar {
    width: 100%;
    grid-template-columns: repeat(4, 1fr);
  }

  .story-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

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

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

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

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

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

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 2.5rem;
  }

  .stat-item:nth-child(2)::after {
    display: none;
  }

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

/* Mobile Devices (max-width: 767px) */
@media (max-width: 767px) {
  .top-bar {
    display: none;
  }

  .container {
    padding-inline: 1rem !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .section {
    padding-block: 3.5rem;
  }

  .navbar {
    height: 4.25rem;
  }

  .navbar .container {
    padding-inline: 1rem !important;
  }

  .logo-wrapper {
    max-width: calc(100% - 60px);
  }

  .logo-sub {
    font-size: 0.68rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero-section {
    padding-top: 2rem;
    padding-bottom: 3rem;
  }

  .hero-title {
    font-size: clamp(1.85rem, 6.5vw, 2.35rem) !important;
    line-height: 1.22 !important;
  }

  .hero-metrics-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .portrait-card {
    max-width: 320px;
    margin-inline: auto;
  }

  .floating-badge {
    padding: 0.5rem 0.75rem;
  }

  .badge-top-right {
    top: -10px;
    right: -10px;
  }

  .badge-bottom-left {
    bottom: -15px;
    left: -10px;
  }

  /* Universal Single-Column Stacking for ALL Card Grids on Mobile */
  .grid-2,
  .grid-3,
  .grid-4,
  .track-record-grid,
  .services-grid,
  .case-studies-grid,
  .events-grid,
  .testimonials-grid,
  .services-detail-grid,
  .services-clean-grid,
  .contact-page-grid,
  .how-it-works-grid,
  .phase-sessions-grid,
  .phase-sessions-3col,
  .stats-three-strip,
  .program-glance-bar,
  .recognition-grid,
  .photo-gallery-grid,
  .reasons-bracket-grid,
  .story-grid,
  .journey-section-grid,
  .story-chapter-grid,
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* Event Cards on Mobile */
  .event-card-page {
    width: 100% !important;
    margin-bottom: 0.5rem;
  }

  .event-card-page .event-thumb {
    width: 100% !important;
    height: 220px !important;
    object-fit: cover !important;
  }

  /* Mentorship Sessions on Mobile */
  .phase-sessions-grid,
  .phase-sessions-3col {
    padding: 1.25rem 1rem !important;
    gap: 1.25rem !important;
  }

  .session-box {
    width: 100% !important;
    padding: 1.35rem 1.15rem !important;
  }

  /* Track Record Grid on Mobile */
  .track-record-grid {
    gap: 2.25rem !important;
  }

  .track-card {
    padding: 1.1rem 1.15rem !important;
  }

  /* Global Feature Box on Mobile (Founders Live) */
  .global-feature-box {
    grid-template-columns: 1fr !important;
    text-align: center !important;
    padding: 2rem 1.25rem !important;
    gap: 1.75rem !important;
  }

  .global-feature-box .section-badge {
    margin-inline: auto !important;
  }

  .global-feature-box > div:last-child {
    margin-inline: auto !important;
  }

  .stats-banner {
    padding: 2.25rem 1.25rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .stat-item::after {
    display: none !important;
  }

  /* CTA Banners on Mobile */
  .cta-banner {
    padding: 2rem 1.15rem !important;
    border-radius: var(--radius-lg) !important;
  }

  .cta-split-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .cta-left-col {
    width: 100% !important;
    text-align: center !important;
    align-items: center !important;
  }

  .cta-title {
    font-size: clamp(1.6rem, 5.5vw, 2.1rem) !important;
    line-height: 1.25 !important;
    word-break: break-word !important;
  }

  .cta-buttons-wrap,
  .cta-banner-actions,
  .cta-banner-btns {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.75rem !important;
    align-items: stretch !important;
  }

  .cta-buttons-wrap .btn,
  .cta-banner-actions .btn,
  .cta-banner-btns .btn,
  .hero-actions .btn,
  .btn {
    white-space: normal !important;
    word-break: break-word !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .cta-buttons-wrap .btn,
  .cta-banner-actions .btn,
  .cta-banner-btns .btn,
  .hero-actions .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 0.85rem 1rem !important;
    font-size: 0.925rem !important;
    text-align: center !important;
  }

  .cta-personal-card {
    width: 100% !important;
    padding: 1.5rem 1.15rem !important;
    box-sizing: border-box !important;
  }

  /* Contact Page on Mobile */
  .contact-info-col {
    width: 100% !important;
    max-width: 100% !important;
  }

  .contact-form-panel {
    padding: 1.5rem 1.15rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .contact-card {
    padding: 1.25rem 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1.25rem;
    text-align: center;
  }

  .modal-box {
    padding: 1.75rem 1.25rem;
    width: 92vw;
    max-width: 480px;
  }

  .page-hero-title {
    font-size: clamp(1.85rem, 6vw, 2.35rem) !important;
    line-height: 1.22 !important;
    word-break: break-word !important;
  }

  .page-hero-subtitle {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
  }

  .case-metrics-banner {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .journey-media-col {
    position: static;
    max-width: 100%;
    margin: 0 auto;
    order: -1;
  }

  .story-stats-strip {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .story-chapter-card {
    padding: 1.75rem 1.25rem;
  }
}

/* Extra Small Devices (max-width: 575px) */
@media (max-width: 575px) {
  .header-actions .btn {
    display: none;
  }

  .hero-metrics-bar {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

  .journey-acc-header {
    padding: 1rem 1.15rem;
    font-size: 0.95rem;
  }

  .journey-acc-inner {
    padding: 1.25rem 1.15rem;
    font-size: 0.925rem;
  }

  .story-chapter-card {
    padding: 1.35rem 1rem;
  }

  .story-chapter-title {
    font-size: 1.25rem;
  }

  .story-chapter-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}
