/* ============================================================
   UVCCM ARDHI UNIVERSITY — RESPONSIVE STYLESHEET
   Covers: 375px → 480px → 640px → 768px → 900px → 1024px → 1280px
   ============================================================ */

/* ─── Fluid Base Helpers ─── */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

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

table {
  width: 100%;
}

/* Prevent text overflow on all elements */
h1, h2, h3, h4, h5, h6, p, a, span, li {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Hero must never cause horizontal scroll */
.hero {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Container safety */
.container, .container-lg {
  max-width: 100%;
  box-sizing: border-box;
}

/* ─── BREAKPOINT: ≤1280px (Large tablet / small laptop) ─── */
@media (max-width: 1280px) {
  .hero-content {
    padding: 60px 32px;
    gap: 40px;
  }

  .about-split {
    gap: 48px;
  }

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

  .activities-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}

/* ─── BREAKPOINT: ≤1024px (Tablet landscape) ─── */
@media (max-width: 1024px) {
  :root { --nav-h: 68px; }

  .hero-content {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    padding: 50px 24px;
  }

  .hero-title {
    font-size: clamp(2.4rem, 5vw, 4.5rem);
  }

  .hero-card-stack {
    scale: 0.9;
  }

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

  .stat-item {
    padding: 30px 20px;
  }

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

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

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

  .news-featured .activity-img {
    height: 240px;
  }

  .about-split {
    gap: 36px;
  }

  .section { padding: 70px 0; }
  .membership-cta { padding: 80px 0; }

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

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

  /* About page */
  .about-hero-visual { height: 380px; }
  .value-prop-card { padding: 22px; }
  .team-photo-grid { grid-template-columns: repeat(3, 1fr); }

  /* Contact page map */
  .map-container { height: 280px; }
}

/* ─── BREAKPOINT: ≤900px (Tablet portrait — existing breakpoint extended) ─── */
@media (max-width: 900px) {
  /* Hero adjustments beyond existing rules */
  .hero {
    min-height: 100svh; /* safe viewport height */
  }

  .hero-content {
    padding: 48px 20px 60px;
  }

  .hero-title {
    font-size: clamp(2.2rem, 7vw, 4rem);
  }

  .hero-tagline {
    font-size: 0.95rem;
    margin: 16px 0 28px;
  }

  .hero-ctas {
    gap: 10px;
  }

  .btn-hero-primary,
  .btn-hero-secondary {
    padding: 12px 22px;
    font-size: 0.82rem;
  }

  .hero-stats {
    gap: 20px;
    margin-top: 32px;
    flex-wrap: wrap;
  }

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

  .stat-number { font-size: 2.8rem; }
  .stat-item { padding: 28px 16px; }

  .section { padding: 60px 0; }
  .section-header { margin-bottom: 40px; }
  .section-title { font-size: clamp(1.8rem, 5vw, 3rem); }

  /* About split — visual goes full width, then content */
  .about-image-accent { right: -12px; bottom: -12px; width: 100px; height: 100px; }
  .about-image-counter { right: -12px; top: 16px; padding: 12px 14px; }
  .about-counter-num { font-size: 1.5rem; }

  .membership-steps {
    gap: 20px;
    flex-wrap: wrap;
  }

  .mem-step { max-width: 140px; }

  .membership-cta { padding: 60px 0; }
  .membership-cta h2 { font-size: clamp(2rem, 6vw, 3.5rem); }

  /* Footer */
  .footer-top { padding: 48px 0 0; }
  .footer-grid { gap: 28px; }

  /* Nav */
  .nav-container { padding: 0 16px; gap: 16px; }

  /* Announcement bar */
  .announcement-bar { font-size: 0.75rem; padding: 6px 0; }

  /* Forum */
  .forum-thread-meta { flex-wrap: wrap; gap: 6px; }

  /* Page header */
  .page-header { padding: 100px 0 40px; }
  .page-header-title { font-size: clamp(1.8rem, 5vw, 3rem); }
}

/* ─── BREAKPOINT: ≤768px (Large phone / small tablet) ─── */
@media (max-width: 768px) {
  :root { --nav-h: 62px; }

  /* Navigation */
  .nav-container { padding: 0 14px; }

  .nav-actions {
    gap: 8px;
  }

  .lang-toggle { padding: 3px 6px; gap: 3px; }
  .lang-btn { font-size: 0.68rem; }
  .lang-divider { font-size: 0.65rem; }

  .theme-toggle { width: 32px; height: 32px; font-size: 0.78rem; }

  /* Hero — single column */
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 40px 16px 60px;
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 3.5rem);
  }

  .hero-badge {
    justify-content: center;
    font-size: 0.68rem;
  }

  .hero-tagline {
    font-size: 0.9rem;
  }

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

  .hero-stats {
    justify-content: center;
    gap: 16px;
  }

  .hero-slider-dots { bottom: 50px; }
  .hero-slider-arrows { padding: 0 10px; }
  .hero-arrow { width: 38px; height: 38px; font-size: 0.8rem; }

  /* Stats section */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2px;
  }
  .stat-number { font-size: 2.4rem; }
  .stat-item { padding: 24px 12px; }
  .stat-icon { font-size: 1.6rem; margin-bottom: 8px; }
  .stat-label { font-size: 0.7rem; }

  /* Activities */
  .activities-grid {
    grid-template-columns: 1fr;
  }

  .activity-img { height: 180px; }
  .activity-body { padding: 18px; }

  /* About split */
  .about-split {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .about-visual { max-width: 420px; margin: 0 auto; width: 100%; }
  .about-image-frame { aspect-ratio: 3/2; font-size: 5rem; }
  .about-image-accent { display: none; }
  .about-image-counter { right: 12px; top: 12px; }

  /* Pillars */
  .pillars {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .pillar { padding: 14px; }
  .pillar-icon { font-size: 1.2rem; }

  /* Leaders */
  .leaders-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .leader-card { padding: 20px 16px; }
  .leader-avatar { width: 70px; height: 70px; font-size: 2rem; }

  /* Membership section */
  .membership-steps {
    flex-direction: column;
    align-items: center;
  }
  .mem-step { max-width: 100%; width: 100%; max-width: 260px; }

  /* News */
  .news-grid { grid-template-columns: 1fr; }
  .news-featured .activity-img { height: 200px; }

  /* Section */
  .section { padding: 50px 0; }
  .section-header { margin-bottom: 32px; }
  .section-desc { font-size: 0.92rem; }

  /* Forms */
  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 20px 16px; }
  .form-input, .form-select, .form-textarea { font-size: 16px; } /* prevents iOS zoom */

  /* Page header */
  .page-header { padding: 88px 0 36px; }
  .page-header-title { font-size: clamp(1.6rem, 6vw, 2.5rem); }
  .page-header-sub { font-size: 0.9rem; }
  .breadcrumb { font-size: 0.75rem; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr !important; }
  .contact-info-panel { order: 2; }
  .contact-form-panel { order: 1; }
  .map-container { height: 220px; }

  /* Forum */
  .forum-thread { padding: 16px; }
  .forum-thread-meta { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 0.75rem; }
  .forum-stats-row { flex-wrap: wrap; gap: 8px; }

  /* About page */
  .about-hero-visual { height: 260px; }
  .about-stat-bar { flex-direction: column; align-items: flex-start; gap: 4px; }
  .about-stat-value { font-size: 1.3rem; }
  .team-photo-grid { grid-template-columns: repeat(2, 1fr); }
  .value-prop-card { padding: 18px; }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .footer-top { padding: 40px 0 0; }
  .footer-col { padding-bottom: 0; }
  .footer-about { padding-bottom: 24px; border-bottom: 1px solid var(--border); }
  .footer-socials { justify-content: flex-start; }
  .footer-bottom-inner { flex-direction: column; gap: 8px; text-align: center; }

  /* Auth / Login */
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-form-side { padding: 40px 20px; }

  /* Success card */
  .success-card { padding: 32px 16px; }

  /* Back to top */
  .back-to-top { bottom: 16px; right: 16px; width: 38px; height: 38px; font-size: 0.8rem; }

  /* Flash messages */
  .flash-message { right: 12px; left: 12px; top: 70px; font-size: 0.85rem; }

  /* Grid utilities */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ─── BREAKPOINT: ≤640px (Phone landscape) ─── */
@media (max-width: 640px) {
  .hero-title { font-size: clamp(1.9rem, 9vw, 3rem); }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-number { font-size: 2.1rem; }

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

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

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

  /* Step wizard */
  .step-wizard [data-step-label] { font-size: 0.65rem; }

  /* Constitution page */
  .constitution-content { font-size: 0.9rem; }

  /* Resources page */
  .resource-grid { grid-template-columns: 1fr !important; }

  /* Forum show page */
  .reply-form .form-row { grid-template-columns: 1fr; }
}

/* ─── BREAKPOINT: ≤480px (Standard phone portrait) ─── */
@media (max-width: 480px) {
  :root { --nav-h: 58px; }

  /* Body base */
  body { font-size: 15px; }

  /* Container padding */
  .container, .container-lg { padding: 0 14px; }

  /* Navigation */
  .logo-main { font-size: 1.2rem; }
  .logo-sub { font-size: 0.55rem; }
  .logo-emblem { width: 38px; height: 38px; }
  .nav-container { gap: 10px; }

  /* Hero */
  .hero-content { padding: 36px 14px 56px; }
  .hero-title { font-size: clamp(1.8rem, 10vw, 2.8rem); }
  .hero-tagline { font-size: 0.88rem; margin: 14px 0 24px; }
  .hero-badge { font-size: 0.62rem; padding: 5px 10px; }

  .btn-hero-primary,
  .btn-hero-secondary {
    padding: 11px 18px;
    font-size: 0.8rem;
    border-radius: 8px;
  }

  .hero-ctas { gap: 8px; }
  .hero-ctas a { width: 100%; justify-content: center; }

  .hero-stats { gap: 12px; margin-top: 24px; }
  .hero-stat-num { font-size: 1.6rem; }
  .hero-stat-label { font-size: 0.62rem; }

  .hero-slider-dots { bottom: 36px; }
  .hero-arrow { width: 34px; height: 34px; }

  /* Stats section */
  .stats-section { padding: 40px 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 2px; }
  .stat-number { font-size: 1.9rem; }
  .stat-suffix { font-size: 1.3rem; }
  .stat-item { padding: 20px 10px; }
  .stat-icon { font-size: 1.4rem; margin-bottom: 6px; }

  /* Sections */
  .section { padding: 40px 0; }
  .section-header { margin-bottom: 28px; }
  .section-title { font-size: clamp(1.6rem, 7vw, 2.5rem); }
  .section-eyebrow { font-size: 0.65rem; }

  /* Cards */
  .activity-card { border-radius: 12px; }
  .activity-img { height: 160px; }
  .activity-body { padding: 14px; }
  .activity-title { font-size: 0.95rem; }
  .activity-excerpt { font-size: 0.82rem; }

  /* Leaders */
  .leaders-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .leader-card { padding: 16px 12px; }
  .leader-avatar { width: 60px; height: 60px; font-size: 1.6rem; }
  .leader-name { font-size: 0.88rem; }
  .leader-title { font-size: 0.68rem; }
  .leader-bio { font-size: 0.78rem; }

  /* Membership CTA */
  .membership-cta { padding: 48px 0; }
  .membership-cta h2 { font-size: clamp(1.8rem, 8vw, 3rem); }
  .membership-cta p { font-size: 0.9rem; }
  .mem-step-num { width: 42px; height: 42px; font-size: 1.2rem; }

  /* Forms */
  .form-card { padding: 18px 14px; border-radius: 12px; }
  .form-label { font-size: 0.82rem; }
  .form-input, .form-select, .form-textarea {
    padding: 10px 12px;
    font-size: 16px; /* prevent iOS zoom */
    border-radius: 8px;
  }
  .form-textarea { min-height: 100px; }
  .btn-primary, .btn-secondary { padding: 11px 20px; font-size: 0.85rem; }

  /* Page header */
  .page-header { padding: 80px 0 28px; }
  .page-header-title { font-size: clamp(1.5rem, 7vw, 2.2rem); }

  /* Contact */
  .contact-info-item { flex-direction: column; gap: 6px; }
  .contact-info-icon { flex-shrink: 0; }
  .map-container { height: 200px; border-radius: 10px; }

  /* Forum thread list */
  .forum-thread { padding: 14px; border-radius: 10px; }
  .forum-thread-title { font-size: 0.95rem; }

  /* News */
  .news-card .activity-body { padding: 14px; }
  .news-card .activity-title { font-size: 0.95rem; }

  /* About */
  .about-hero-visual { height: 220px; border-radius: 16px; }
  .about-stat-bar { padding: 12px 14px; }
  .about-stat-label { font-size: 0.78rem; }
  .about-stat-value { font-size: 1.1rem; }
  .value-prop-icon { width: 46px; height: 46px; font-size: 1.2rem; }
  .value-prop-card { padding: 16px; }

  /* Footer */
  .footer-logo-main { font-size: 1.3rem; }
  .footer-logo-sub { font-size: 0.62rem; }
  .footer-desc { font-size: 0.82rem; }
  .footer-heading { font-size: 0.78rem; }
  .footer-links a, .footer-contact-list li { font-size: 0.82rem; }
  .footer-bottom { padding: 16px 0; font-size: 0.75rem; }

  /* Auth */
  .auth-form-side { padding: 32px 14px; }
  .auth-form-box { max-width: 100%; }

  /* Member card preview */
  .member-card-preview { transform: scale(0.85); transform-origin: top center; }

  /* Success card */
  .success-card { padding: 28px 14px; border-radius: 12px; }

  /* Announcement bar */
  .announcement-bar { font-size: 0.7rem; }
}

/* ─── BREAKPOINT: ≤375px (Narrow phone — iPhone SE, Galaxy A01) ─── */
@media (max-width: 375px) {
  .container, .container-lg { padding: 0 12px; }

  .hero-content { padding: 32px 12px 52px; }
  .hero-title { font-size: clamp(1.6rem, 11vw, 2.4rem); }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-number { font-size: 1.7rem; }
  .stat-item { padding: 16px 8px; }

  .leaders-grid { grid-template-columns: 1fr; max-width: 280px; margin: 0 auto; }

  .btn-hero-primary, .btn-hero-secondary { font-size: 0.78rem; padding: 10px 14px; }

  .section { padding: 36px 0; }
  .section-title { font-size: clamp(1.5rem, 8vw, 2rem); }

  .footer-grid { padding: 0 12px; }

  .form-card { padding: 14px 12px; }
  .page-header-title { font-size: clamp(1.4rem, 8vw, 2rem); }

  /* Hide decorative elements to reduce clutter */
  .hero-particles { display: none; }
  .about-image-counter { display: none; }
}

/* ─── SPECIAL: Touch devices — improve tap targets ─── */
@media (hover: none) and (pointer: coarse) {
  .btn-primary, .btn-secondary,
  .btn-hero-primary, .btn-hero-secondary,
  .btn-nav-portal, .btn-nav-login, .btn-nav-join {
    min-height: 44px;
  }

  .desk-nav > li > a { padding: 10px 12px; }

  .form-input, .form-select { min-height: 44px; }

  .hero-arrow { width: 44px; height: 44px; }

  .social-link { min-width: 40px; min-height: 40px; }

  /* Disable hover transforms on touch — prevents stuck hover states */
  .activity-card:hover,
  .leader-card:hover,
  .value-prop-card:hover {
    transform: none;
  }
}

/* ─── SPECIAL: Reduce motion preference ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-particles { display: none; }
  [data-aos] { opacity: 1 !important; transform: none !important; }
}

/* ─── SPECIAL: High-DPI screens — sharper borders ─── */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .stats-grid { gap: 1px; }
}

/* ─── RESPONSIVE TABLE WRAPPER ─── */
/* Wrap tables on small screens to prevent layout breaks */
@media (max-width: 640px) {
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--border);
  }

  .table-responsive table {
    min-width: 480px;
  }
}

/* ─── RESPONSIVE HERO SLIDER DOTS (small screens) ─── */
@media (max-width: 480px) {
  .hero-slider-dots { gap: 6px; bottom: 30px; }
  .hero-dot { width: 6px; height: 6px; }
  .hero-dot.active { width: 18px; }
}

/* ─── PORTAL RESPONSIVE ADDITIONS ─── */
/* Fill gaps in portal.css for very small screens */
@media (max-width: 480px) {
  .portal-topbar-brand { font-size: 0.82rem; }
  .portal-card-header { flex-wrap: wrap; gap: 8px; }
  .portal-section-title { font-size: 1rem; }
  .member-card-preview { max-width: 100%; }
  .profile-grid { grid-template-columns: 1fr !important; }
}

/* ─── LOGIN PAGE RESPONSIVE ─── */
@media (max-width: 480px) {
  .auth-page { min-height: 100dvh; }
  .auth-form-side { padding: 28px 12px; }
  .auth-form-logo { margin-bottom: 22px; }
  .auth-form-logo-icon { width: 38px; height: 38px; font-size: 1.2rem; }
  .attempts-warning { font-size: 0.78rem; }
}

/* ─── MEMBERSHIP REGISTRATION RESPONSIVE ─── */
@media (max-width: 640px) {
  /* Step wizard labels — truncate on tiny screens */
  .step-indicator > div:last-child {
    font-size: 0.62rem;
    letter-spacing: 0;
  }

  /* Connector line between steps */
  .step-indicator [style*="height:2px"] {
    top: 18px;
  }
}

/* ─── NAVIGATION RESPONSIVE OVERFLOW GUARD ─── */
@media (max-width: 900px) {
  /* Ensure mobile nav doesn't exceed viewport */
  .desk-nav.open {
    max-height: 100dvh;
    max-height: 100vh;
    overflow-y: auto;
  }

  /* Overlay must be above everything except the drawer itself */
  .mobile-overlay.open {
    z-index: 1040;
  }

  /* Dropdown inside mobile nav */
  .has-dropdown.open .dropdown {
    margin-top: 0;
    padding: 4px 0;
  }

  /* Prevent body scroll when drawer open */
  body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }
}

/* ─── FOOTER RESPONSIVE REFINEMENTS ─── */
@media (max-width: 480px) {
  .footer-top { padding: 32px 0 0; }
  .footer-grid { gap: 24px; }
  .footer-col { border-bottom: 1px solid var(--border); padding-bottom: 20px; }
  .footer-col:last-child { border-bottom: none; }

  .social-link {
    width: 36px; height: 36px;
    font-size: 0.9rem;
  }
}

/* ─── MEMBERSHIP STEPS RESPONSIVE ─── */
@media (max-width: 640px) {
  .membership-steps {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .mem-step {
    max-width: 280px;
    width: 100%;
  }

  .mem-step-arrow { display: none; }
}

/* ─── CONSTITUTION PAGE RESPONSIVE ─── */
@media (max-width: 768px) {
  .constitution-toc { display: none; }
  .constitution-body { margin-left: 0; }
}

/* ─── SAFE AREA SUPPORT (iPhone notch / dynamic island) ─── */
@supports (padding: env(safe-area-inset-bottom)) {
  .navbar {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  .footer-bottom {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .mobile-nav-open .desk-nav.open {
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
  }
}

/* ─── NAV OVERFLOW FIX: ensure nav-actions never wraps ─── */
@media (max-width: 480px) {
  .nav-container {
    padding: 0 12px;
    gap: 8px;
  }
  .nav-logo {
    gap: 7px;
    flex-shrink: 0;
    min-width: 0;
  }
  .nav-actions {
    gap: 6px;
    flex-shrink: 0;
  }
  .lang-toggle {
    padding: 2px 5px;
    gap: 2px;
  }
  .lang-btn { font-size: 0.65rem; padding: 1px 3px; }
  .theme-toggle { width: 28px; height: 28px; font-size: 0.72rem; flex-shrink: 0; }
  .hamburger { padding: 4px; flex-shrink: 0; }
  .hamburger span { width: 20px; }
}

/* ─── NAV OVERFLOW FIX: 375px and below ─── */
@media (max-width: 375px) {
  .nav-container { padding: 0 10px; gap: 6px; }
  .logo-emblem { width: 32px; height: 32px; flex-shrink: 0; }
  .logo-main { font-size: 1.1rem; }
  .logo-sub { display: none; }
  .lang-toggle { padding: 2px 4px; }
  .lang-btn { font-size: 0.62rem; }
  .theme-toggle { width: 26px; height: 26px; font-size: 0.68rem; }
}

/* ─── GENERAL CONTENT FIT FIXES ─── */

/* Prevent hero-card-stack from causing overflow on mid-size tablets */
@media (max-width: 900px) {
  .hero-card-stack { display: none; }
  .hero-visual { display: none; }
}

/* Fix hero at exactly 768px - 900px where single column but card still shows */
@media (min-width: 769px) and (max-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-ctas { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-badge { justify-content: center; }
}

/* Fix about-split on 769px - 1024px (two columns but can overflow) */
@media (min-width: 769px) and (max-width: 1024px) {
  .about-split {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

/* Ensure footer-grid columns don't shrink too narrow on 768-1024 */
@media (min-width: 769px) and (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

/* ─── HORIZONTAL SCROLL PREVENTION ─── */
/* Catch any element that might bleed outside viewport */
* { box-sizing: border-box; }

.hero-slider,
.hero-slide,
.hero-slide-overlay,
.hero-slider-arrows,
.hero-slider-dots {
  max-width: 100%;
}

/* ─── FLASH MESSAGE FIX (mobile) ─── */
@media (max-width: 380px) {
  .flash-message {
    right: 8px;
    left: 8px;
    font-size: 0.8rem;
    padding: 10px 12px;
  }
}

/* ─── ANNOUNCEMENT BAR + NAV STACKING ─── */
/* Make sure body padding accounts for both announcement bar and nav */
@media (max-width: 480px) {
  .announcement-bar {
    font-size: 0.68rem;
    padding: 5px 0;
  }
  .announcement-bar .container {
    padding: 0 12px;
  }
}

/* ─── MEMBERSHIP CARD PREVIEW ─── */
@media (max-width: 400px) {
  .member-card-preview {
    transform: scale(0.8);
    transform-origin: top center;
  }
}

/* ─── STEP WIZARD FIX (very small screens) ─── */
@media (max-width: 400px) {
  .step-wizard {
    gap: 0;
  }
  .step-wizard [data-step-label] {
    display: none;
  }
}

/* ================================================================
   NEW MOBILE NAVIGATION SYSTEM
   Completely separate from desktop nav — no shared state issues
   ================================================================ */

/* ── mob-nav-right: theme + hamburger shown only on mobile ── */
.mob-nav-right {
  display: none !important;
}

/* ── mob-overlay ── */
.mob-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1040;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.mob-overlay.is-open {
  display: block;
  opacity: 1;
}

/* ── mob-drawer ── */
.mob-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 82vw);
  background: var(--bg-card);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.mob-drawer.is-open {
  transform: translateX(0);
}

/* ── Drawer header ── */
.mob-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--ccm-green-dark), var(--ccm-green));
  flex-shrink: 0;
}
.mob-drawer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mob-drawer-emblem {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.mob-drawer-name {
  font-family: var(--font-display, 'Bebas Neue', sans-serif);
  font-size: 1.15rem;
  color: var(--ccm-yellow, #f5c518);
  letter-spacing: 0.06em;
  line-height: 1.1;
}
.mob-drawer-sub {
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}
.mob-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.mob-drawer-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ── Drawer nav links ── */
.mob-drawer-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}
.mob-nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mob-nav-link:last-child {
  border-bottom: none;
}
.mob-nav-link:hover,
.mob-nav-link--active {
  background: var(--ccm-green-pale, #e8f5ee);
  color: var(--ccm-green);
}
.mob-nav-icon {
  width: 18px;
  text-align: center;
  color: var(--ccm-green);
  flex-shrink: 0;
  font-size: 0.88rem;
}

/* ── Membership accordion ── */
.mob-nav-accordion {
  justify-content: space-between;
}
.mob-nav-accordion > span {
  display: flex;
  align-items: center;
  gap: 14px;
}
.mob-acc-arrow {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.mob-nav-accordion[aria-expanded="true"] .mob-acc-arrow {
  transform: rotate(180deg);
}
.mob-acc-panel {
  display: none;
  background: var(--bg-alt, #f8faf8);
  border-bottom: 1px solid var(--border);
}
.mob-acc-panel.is-open {
  display: block;
}
.mob-acc-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 22px 13px 54px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-sec);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
}
.mob-acc-link:last-child {
  border-bottom: none;
}
.mob-acc-link:hover {
  background: var(--ccm-green-pale, #e8f5ee);
  color: var(--ccm-green);
}

/* ── Drawer footer ── */
.mob-drawer-foot {
  flex-shrink: 0;
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-card);
}
.mob-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  min-height: 46px;
  transition: all 0.2s;
  text-align: center;
  letter-spacing: 0.03em;
}
.mob-cta--portal {
  background: var(--ccm-green);
  color: white;
}
.mob-cta--portal:hover { background: var(--ccm-green-dark); }

.mob-cta--login {
  background: transparent;
  color: var(--text-main);
  border: 1.5px solid var(--border);
}
.mob-cta--login:hover {
  border-color: var(--ccm-green);
  color: var(--ccm-green);
}
.mob-cta--join {
  background: var(--ccm-yellow, #f5c518);
  color: #111;
}
.mob-cta--join:hover { background: #dba800; }

.mob-lang {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 0 2px;
}
.mob-lang-btn {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
}
.mob-lang-btn--active,
.mob-lang-btn:hover {
  color: var(--ccm-green);
  background: var(--ccm-green-pale, #e8f5ee);
}
.mob-lang-div {
  color: var(--border);
  font-size: 0.7rem;
}

/* ── Body lock when drawer open ── */
body.mob-menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* ── SHOW mobile nav system, HIDE desktop links on ≤900px ── */
@media (max-width: 900px) {
  /* Show mobile right controls */
  .mob-nav-right {
    display: flex !important;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  /* Solid opaque navbar on mobile */
  .navbar {
    background: rgba(255, 255, 255, 0.99) !important;
  }
  [data-theme="dark"] .navbar {
    background: rgba(12, 20, 16, 0.99) !important;
  }

  /* Hide ALL desktop-only nav elements */
  .desk-nav,
  .nav-actions {
    display: none !important;
  }
}

/* ── Safe-area padding for iPhone notch ── */
@supports (padding: env(safe-area-inset-bottom)) {
  .mob-drawer {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mob-drawer-foot {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}
