/* ==========================================================================
   RESPONSIVE STYLESHEET: SHRI HARI SHANKER BILWAL
   Comprehensive Mobile, Tablet, Laptop & Desktop Optimizations (320px to 1440px)
   ========================================================================== */

/* Prevent horizontal overflow on small mobile screens */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* ==========================================================================
   LARGE TABLET / SMALL LAPTOP (max-width: 1200px)
   ========================================================================== */
@media (max-width: 1200px) {
  .achievements-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .speeches-video-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 18px;
  }
}

/* ==========================================================================
   TABLET PORTRAIT & BELOW (max-width: 992px)
   ========================================================================== */
@media (max-width: 992px) {
  :root {
    --header-height: 68px;
  }

  .nav-menu {
    display: none;
  }

  .site-header {
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    overflow: visible;
  }

  .navbar-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 16px;
    height: var(--header-height);
    overflow: visible;
  }

  .brand-logo {
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 100;
  }

  .brand-logo img {
    height: 52px !important;
    max-width: 330px !important;
    width: auto !important;
    transform: scale(1.06);
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.16));
    transition: transform 0.2s ease, filter 0.2s ease;
  }

  .hero-name-text {
    font-size: clamp(1.15rem, 3.6vw, 1.8rem) !important;
    white-space: nowrap !important;
    line-height: 1.4 !important;
    padding-top: 0.22em !important;
    padding-bottom: 0.12em !important;
    margin-top: -0.22em !important;
    overflow: visible !important;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1050;
  }

  /* Hero Section */
  .backgroundTop::after {
    background: 
      linear-gradient(180deg, rgba(7, 13, 27, 0.92) 0%, rgba(9, 17, 34, 0.85) 48%, rgba(12, 21, 42, 0.55) 100%),
      linear-gradient(to top, rgba(7, 13, 27, 0.96) 0%, rgba(7, 13, 27, 0.2) 20%, transparent 40%);
  }

  .hero-layout {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 24px;
    padding-top: 15px;
  }

  .hero-content {
    padding: 10px 0 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-badge {
    margin-bottom: 24px !important;
  }

  .hero-title-main {
    font-size: 2.25rem !important;
    line-height: 1.25 !important;
  }

  .hero-sub-text {
    font-size: 1.05rem !important;
    max-width: 580px;
  }

  .hero-cta-btns {
    justify-content: center;
  }

  .hero-leader-img {
    justify-content: center;
    margin-top: 10px;
  }

  .hero-leader-img img {
    max-height: 380px;
    width: auto;
  }

  /* About Grid */
  .abt-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 30px;
  }

  .abt-content {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .abt-portrait {
    max-height: 360px;
  }

  /* Split Layouts (About, Journey, Vision, Youth) */
  .split-section {
    padding: 45px 0 !important;
  }

  .split-grid {
    grid-template-columns: 1fr !important;
    direction: ltr !important;
    gap: 28px !important;
  }

  .split-grid.reverse > * {
    direction: ltr !important;
  }

  .split-img-box img {
    height: 300px !important;
  }

  .split-title {
    font-size: 1.75rem !important;
  }

  /* Split Card Listing (Initiatives, Media, Videos) */
  .split-card-item {
    grid-template-columns: 1fr !important;
    direction: ltr !important;
    border-radius: 16px !important;
  }

  .split-card-item.reverse > * {
    direction: ltr !important;
  }

  .split-card-img {
    height: 240px !important;
    min-height: auto !important;
  }

  .split-card-body {
    padding: 24px !important;
  }

  .split-card-title {
    font-size: 1.4rem !important;
  }

  /* Speeches section */
  .home-speeches-section {
    padding: 55px 0 70px 0 !important;
  }

  .speeches-video-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px;
  }

  /* ==========================================================================
     HOMEPAGE LEADERSHIP MILESTONES TIMELINE (Mobile Full-Width Cards)
     Fixing narrow 50/50 split & microscopic images from mobile screenshots
     ========================================================================== */
  .timeline {
    position: relative !important;
    margin: 30px auto 0 auto !important;
    padding: 0 !important;
  }

  .timeline-line {
    display: none !important;
  }

  .timeline-dot {
    display: none !important;
  }

  .timeline-item,
  .timeline-item:nth-child(odd),
  .timeline-item:nth-child(even) {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    margin-bottom: 32px !important;
    background: #ffffff !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07) !important;
    padding: 0 !important;
  }

  .timeline-img {
    width: 100% !important;
    height: 220px !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  .timeline-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    max-height: none !important;
  }

  .timeline-content,
  .timeline-item:nth-child(odd) .timeline-content,
  .timeline-item:nth-child(even) .timeline-content {
    width: 100% !important;
    padding: 24px 20px 24px 20px !important;
    text-align: left !important;
  }

  .timeline-year-badge {
    display: inline-flex !important;
    align-items: center !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    margin-bottom: 12px !important;
  }

  .timeline-content h4 {
    font-size: 1.32rem !important;
    font-weight: 800 !important;
    color: #1e293b !important;
    line-height: 1.35 !important;
    margin-bottom: 10px !important;
  }

  .timeline-content p {
    font-size: 0.98rem !important;
    color: #475569 !important;
    line-height: 1.65 !important;
    margin-bottom: 0 !important;
  }
}

/* ==========================================================================
   MOBILE PHONES (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .section-padding {
    padding: 50px 0 !important;
  }

  .mainHeading {
    font-size: 1.9rem;
    line-height: 1.3;
  }

  .section-title {
    font-size: 1.85rem !important;
    line-height: 1.25 !important;
  }

  .page-banner {
    padding: 40px 16px 30px 16px !important;
  }

  .page-banner .section-title {
    font-size: 1.9rem !important;
  }

  .achievements-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  /* Speeches Section on Mobile: 1 Column or Clean 2-Column */
  .home-speeches-section {
    padding: 45px 0 65px 0 !important;
  }

  .speeches-video-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .speeches-video-grid .video-card {
    aspect-ratio: 16 / 9;
    border-radius: 12px;
  }

  /* Filter Tabs Swipeable on Mobile */
  .filter-tabs {
    display: flex !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    scrollbar-width: none;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    font-size: 0.84rem !important;
    padding: 7px 16px !important;
  }

  /* Split Cards Footer Mobile */
  .split-card-footer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .split-card-footer .btn {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }

  /* Contact Page on Mobile */
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .contact-info-card, .form-card {
    padding: 24px 18px !important;
    border-radius: 14px !important;
  }

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

  /* Join Us Modal Popup */
  .join-popup {
    width: 94% !important;
    max-width: 94% !important;
    padding: 24px 16px !important;
    border-radius: 14px !important;
  }

  .join-row {
    flex-direction: column !important;
    gap: 10px !important;
    margin-bottom: 8px !important;
  }

  .join-popup h2 {
    font-size: 20px;
    margin-bottom: 16px;
  }

  /* Footer on Mobile */
  .footer-section, .site-footer {
    padding: 45px 0 25px 0 !important;
  }

  .footer-logo {
    max-width: 320px !important;
    height: 56px !important;
    width: auto !important;
    margin: 0 auto 16px auto !important;
    display: block !important;
  }

  .footer-bio-text {
    font-size: 0.88rem !important;
    padding: 0 12px;
  }

  .footer-copy-text {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    font-size: 0.82rem !important;
    line-height: 1.6 !important;
    text-align: center !important;
  }

  .footer-sep {
    display: none !important;
  }

  /* Floating Action Buttons Mobile Offset */
  .whatsapp-float {
    bottom: 18px !important;
    right: 16px !important;
    width: 48px !important;
    height: 48px !important;
    font-size: 24px !important;
  }

  .scroll-top-btn {
    bottom: 74px !important;
    right: 16px !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 18px !important;
  }

  .d-none-mobile {
    display: none !important;
  }
}

/* ==========================================================================
   SMALL MOBILE SCREENS (max-width: 480px)
   ========================================================================== */
@media (max-width: 480px) {
  :root {
    --header-height: 64px;
  }

  .brand-logo img {
    height: 46px !important;
    max-width: 295px !important;
    width: auto !important;
    transform: scale(1.08);
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.16));
  }

  .hero-name-text {
    font-size: clamp(0.92rem, 4.4vw, 1.28rem) !important;
    white-space: nowrap !important;
    letter-spacing: -0.3px !important;
    line-height: 1.4 !important;
    padding-top: 0.22em !important;
    padding-bottom: 0.12em !important;
    margin-top: -0.22em !important;
    overflow: visible !important;
  }

  .footer-logo {
    max-width: 290px !important;
    height: 52px !important;
    width: auto !important;
    margin: 0 auto 14px auto !important;
    display: block !important;
  }

  .mainHeading {
    font-size: 1.65rem;
  }

  .hero-title-main {
    font-size: 1.8rem !important;
  }

  .hero-sub-text {
    font-size: 0.95rem !important;
  }

  .hero-leader-img img {
    max-height: 300px !important;
  }

  .hero-cta-btns {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .hero-cta-btns .btn {
    width: 100%;
    justify-content: center;
  }

  .split-section {
    padding: 35px 0 !important;
  }

  .split-img-box img {
    height: 220px !important;
  }

  .split-title {
    font-size: 1.45rem !important;
  }

  .split-lead {
    font-size: 0.98rem !important;
  }

  .split-text {
    font-size: 0.92rem !important;
  }

  .split-card-img {
    height: 190px !important;
  }

  .split-card-title {
    font-size: 1.22rem !important;
  }

  .btn-main, .btn-dark-main, .btn-primary {
    padding: 10px 18px !important;
    font-size: 14px !important;
  }

  .section-bottom-action {
    margin-top: 28px !important;
  }

  .section-bottom-action .btn {
    width: 100% !important;
    max-width: 320px !important;
    justify-content: center !important;
  }
}

