/**
 * THE ORIGIN - Fully Responsive & Mobile-Optimized Stylesheet
 * Engineered to eliminate overflow, broken alignment, overlapping elements,
 * and extra spacing across all screen sizes (320px to 1440px+).
 */

/* ========================================================
   GLOBAL CONTAINER & BASE FIXES
   ======================================================== */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  position: relative;
}

/* Base Gallery Grid Class (Replaces inline style) */
.home-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* ========================================================
   TABLET & INTERMEDIATE DESKTOPS (<= 1024px)
   ======================================================== */
@media (max-width: 1024px) {
  /* Layout Spacing */
  .hero-section {
    padding: 50px 0 60px 0;
  }
  .founder-section,
  .why-section,
  .batches-section,
  .courses-section,
  .stories-section,
  .faq-section {
    padding: 55px 0;
  }
  .stats-section {
    padding: 36px 0;
  }

  /* Grid Reductions */
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .founder-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }

  .founder-img {
    max-width: 320px;
    width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
  }

  .founder-quote {
    text-align: left;
  }

  .founder-credentials {
    justify-content: center;
    flex-wrap: wrap;
  }

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

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .courses-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .batches-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .stories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .home-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

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

  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
  }
}

/* ========================================================
   STANDARD MOBILE SCREENS (<= 768px)
   ======================================================== */
@media (max-width: 768px) {
  /* Container Breathing Room */
  .container {
    padding-left: 18px;
    padding-right: 18px;
  }

  /* Section Vertical Spacing (Tight, Clean & Balanced) */
  .hero-section {
    padding: 38px 0 46px 0;
  }
  .founder-section,
  .why-section,
  .batches-section,
  .courses-section,
  .stories-section,
  .faq-section {
    padding: 42px 0;
  }
  .stats-section {
    padding: 28px 0;
  }

  /* Section Header Alignment */
  .section-header {
    margin-bottom: 28px;
  }
  .section-title {
    font-size: 1.65rem;
    line-height: 1.25;
  }
  .section-desc {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  /* Header & Navigation Fixes */
  .top-bar {
    display: none;
  }

  .site-header {
    height: auto;
  }

  .nav-container {
    height: 68px;
  }

  .brand-logo img,
  .brand-logo svg {
    height: 44px;
    max-width: 180px;
    width: auto;
  }

  .nav-links,
  .nav-actions .btn-accent {
    display: none !important;
  }

  .nav-actions {
    gap: 8px;
  }

  .nav-actions .btn-secondary {
    padding: 6px 12px;
    font-size: 12.5px;
    border-radius: var(--radius-sm);
  }

  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    width: 40px;
    height: 40px;
  }

  /* Hero Section Typography & Spacing */
  .hero-title {
    font-size: 2.1rem;
    line-height: 1.22;
    margin-bottom: 14px;
    letter-spacing: -0.3px;
  }

  .hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.45;
    margin-bottom: 12px;
  }

  .hero-desc {
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 24px;
  }

  .hero-highlights {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
  }

  .highlight-box {
    display: flex;
    align-items: baseline;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .highlight-box h4 {
    font-size: 1.2rem;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .highlight-box p {
    font-size: 0.82rem;
    margin-bottom: 0;
  }

  .hero-card {
    padding: 20px 16px;
  }

  .hero-card-title {
    font-size: 1.2rem;
  }

  /* Founder Section */
  .founder-name {
    font-size: 1.95rem;
  }

  .founder-designation {
    font-size: 1.05rem;
    margin-bottom: 14px;
  }

  .founder-bio {
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: left;
    margin-bottom: 18px;
  }

  .founder-quote {
    font-size: 0.9rem;
    line-height: 1.55;
    padding: 12px 16px;
    margin-bottom: 20px;
  }

  .founder-credentials {
    gap: 8px;
    margin-bottom: 22px;
  }

  .cred-box {
    padding: 7px 12px;
    font-size: 12px;
  }

  .founder-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .founder-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Stats Section 2x2 Grid (Compact & Perfectly Balanced) */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 18px 12px;
  }

  .stat-number {
    font-size: 2rem;
    line-height: 1.1;
  }

  .stat-label {
    font-size: 0.8rem;
    margin-top: 4px;
  }

  /* Why Choose Us & Batches Single Column */
  .features-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .feature-card {
    padding: 20px 16px;
  }

  .batch-filters {
    gap: 6px;
    margin-bottom: 18px;
  }

  .filter-btn {
    padding: 7px 13px;
    font-size: 12.5px;
  }

  .sub-filter-row {
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .sub-filter-btn {
    padding: 5px 12px;
    font-size: 12px;
  }

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

  .batch-card {
    padding: 20px 16px;
  }

  .batch-info-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.82rem;
  }

  /* Stories Single Column */
  .stories-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .story-card {
    padding: 20px 16px;
  }

  /* FAQ Accordion on Mobile */
  .faq-header {
    padding: 16px 14px;
    font-size: 14px;
    line-height: 1.4;
    gap: 10px;
  }

  .faq-content {
    padding: 0 14px 16px 14px;
    font-size: 13.5px;
    line-height: 1.55;
  }

  /* CTA Banner on Mobile */
  .cta-banner {
    padding: 42px 0;
  }

  .cta-banner h2 {
    font-size: 1.7rem;
    line-height: 1.25;
    margin-bottom: 10px;
  }

  .cta-banner p {
    font-size: 0.92rem;
    margin-bottom: 22px;
  }

  .cta-banner .btn {
    width: 100%;
    justify-content: center;
    padding: 12px 18px;
    font-size: 14px;
  }

  /* Registration Form & Admin Forms */
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .reg-container {
    margin: 16px 0;
    border-radius: var(--radius-md);
  }

  .reg-header {
    padding: 20px 16px;
  }

  .reg-form-body {
    padding: 20px 16px;
  }

  /* Footer on Mobile */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

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

/* ========================================================
   SMALL SMARTPHONES (<= 480px, e.g. iPhone SE, 360px - 430px)
   ======================================================== */
@media (max-width: 480px) {
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }

  .hero-section {
    padding: 30px 0 38px 0;
  }

  .hero-title {
    font-size: 1.75rem;
    line-height: 1.24;
  }

  .hero-badge {
    font-size: 11px;
    padding: 4px 12px;
    white-space: normal;
  }

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

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 14px;
  }

  .founder-img {
    max-width: 250px;
  }

  .founder-name {
    font-size: 1.65rem;
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .stat-label {
    font-size: 0.74rem;
  }

  .batch-info-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .batch-footer {
    flex-direction: column;
    gap: 8px;
  }

  .batch-footer .btn {
    width: 100%;
    justify-content: center;
  }

  .home-gallery-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .btn-lg {
    padding: 12px 18px;
    font-size: 14px;
  }
}