/* ==========================================================================
   Sistakaranaalu Community — Responsive Stylesheet
   Breakpoints:
     - Large laptop : <= 1200px
     - Tablet       : <= 992px
     - Large mobile : <= 768px
     - Mobile       : <= 576px
   ========================================================================== */

/* ---- Large laptop / small desktop --------------------------------------- */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .leaders-grid,
  .member-grid { grid-template-columns: repeat(3, 1fr); }
  .nav__link { padding: 0.5rem 0.6rem; font-size: 0.9rem; }
}

/* ---- Tablet -------------------------------------------------------------- */
@media (max-width: 992px) {
  :root { --space-xl: 4.5rem; }

  /* Mobile navigation */
  .nav-toggle { display: flex; }
  .primary-nav {
    position: fixed;
    top: 0; right: 0;
    width: min(330px, 88vw);
    height: 100vh;
    height: 100dvh;
    background: var(--color-bg);
    box-shadow: var(--shadow-lg);
    padding: calc(var(--header-height) + 1.5rem) 1.5rem 2rem;
    transform: translateX(100%);
    transition: transform var(--transition);
    overflow-y: auto;
    margin: 0;
    z-index: 1100;
  }
  .primary-nav.is-open { transform: translateX(0); }

  /* Close (X) button inside the drawer */
  .nav-close {
    display: grid;
    place-items: center;
    position: absolute;
    top: 1rem; right: 1rem;
    width: 44px; height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(30, 95, 168, 0.08);
    color: var(--color-maroon);
    font-size: 1.25rem;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), transform var(--transition);
  }
  .nav-close:hover { background: var(--color-maroon); color: #fff; transform: rotate(90deg); }
  .nav__list { flex-direction: column; gap: 0.25rem; }
  .nav__link { display: block; padding: 0.85rem 0.5rem; border-bottom: 1px solid var(--color-border); }
  .nav__link::after { display: none; }
  /* Force dark text inside the open mobile drawer */
  .site-header:not(.is-scrolled):not(.header--solid) .primary-nav .nav__link { color: var(--color-text); }

  /* Dropdown becomes an inline accordion inside the drawer */
  .has-dropdown { position: relative; }
  .nav__caret { display: none; }
  .dropdown-toggle {
    display: grid;
    place-items: center;
    position: absolute;
    top: 0; right: 0;
    width: 52px; height: 52px;
    color: var(--color-maroon);
  }
  .site-header:not(.is-scrolled):not(.header--solid) .primary-nav .dropdown-toggle { color: var(--color-maroon); }
  .dropdown-toggle i { transition: transform var(--transition); }
  .has-dropdown.is-open .dropdown-toggle i { transform: rotate(180deg); }
  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    margin: 0;
    padding: 0 0 0 0.75rem;
    background: transparent;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
  }
  .has-dropdown.is-open .dropdown { max-height: 460px; }
  .dropdown__link { border-bottom: 1px solid var(--color-border); }

  .nav-backdrop {
    position: fixed; inset: 0;
    background: rgba(42, 16, 16, 0.5);
    opacity: 0; visibility: hidden;
    transition: opacity var(--transition);
    z-index: 1050;
  }
  .nav-backdrop.is-open { opacity: 1; visibility: visible; }

  /* Hide secondary actions on tablet/mobile — they move into the drawer.
     Only the language switcher + hamburger remain in the header bar. */
  .header-actions .text-link { display: none; }
  .header-actions .btn { display: none; }

  /* In-drawer CTAs (Login + Join Community) */
  .nav-cta {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
  }
  .nav-cta__login {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-maroon);
    padding: 0.35rem 0.4rem;
  }
  .nav-cta__login:hover { color: var(--color-gold-dark); }
  .nav-cta .btn { font-size: 1rem; }

  /* Layout collapses */
  .about-grid,
  .donation-grid,
  .newsletter-grid,
  .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-media { max-width: 520px; margin: 0 auto; }

  .vision-grid,
  .news-grid,
  .achievement-row,
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .album-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-card.is-featured { transform: none; }

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

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

  .gallery-masonry { columns: 2; }

  /* Timeline becomes single column */
  .timeline::before { left: 18px; }
  .timeline-item { width: 100%; left: 0 !important; text-align: left !important; padding-left: 3.5rem; padding-right: 0; }
  .timeline-item::after { left: 9px !important; right: auto !important; }

  .newsletter-illustration { display: none; }
}

/* ---- Large mobile -------------------------------------------------------- */
@media (max-width: 768px) {
  :root { --header-height: 84px; }

  /* Logo scales down to fit the shorter mobile header (transparent, no card) */
  .brand__logo-img { height: 66px; }
  .site-header.is-scrolled .brand__logo-img { height: 60px; }
  .footer-brand__logo { height: 70px; }

  /* Header bar now holds only the language switcher + search + hamburger — keep tidy */
  .header-actions { gap: 0.2rem; flex-shrink: 0; }
  .header-inner { gap: 0.5rem; }
  .site-header .header-inner { padding-inline: 0.75rem; }
  .lang-switch__btn { padding: 0 0.5rem; width: 38px; height: 38px; }
  .nav-toggle { flex-shrink: 0; width: 42px; height: 42px; }
  #searchToggle { width: 38px; height: 38px; font-size: 0.95rem; }
  .brand__logo-img { max-width: 180px; height: auto; }
  .site-header.is-scrolled .brand__logo-img { max-width: 160px; }

  .hero { min-height: 90vh; }
  .hero__content { padding-block: 7rem 4rem; }
  .hero__sub { font-size: 1.05rem; }
  .hero__actions .btn { flex: 1; justify-content: center; }
  .hero__shape--1 { width: 160px; height: 160px; }

  /* Hero image slider: hide arrows, rely on swipe + bullets */
  .hero-slider .swiper-button-prev,
  .hero-slider .swiper-button-next { display: none; }
  .hero-slide { height: clamp(220px, 60vw, 380px); }
  .hero-slide::before { filter: blur(20px) brightness(0.55) saturate(1.1); }

  .vision-grid,
  .pricing-grid,
  .achievement-row { grid-template-columns: 1fr; }

  .about-mini-stats { gap: 1.25rem; }
  .about-media__badge { right: 50%; transform: translateX(50%); bottom: -24px; }

  .section-head { margin-bottom: 2.5rem; }

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

/* ---- Mobile -------------------------------------------------------------- */
@media (max-width: 576px) {
  .container { padding-inline: 1rem; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid,
  .leaders-grid,
  .member-grid,
  .news-grid { grid-template-columns: 1fr; }
  .album-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .gallery-masonry { columns: 1; }

  .brand__name { font-size: 1.1rem; }
  .brand__tag { font-size: 0.62rem; }

  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; }

  .cta__actions { flex-direction: column; }
  .cta__actions .btn { width: 100%; justify-content: center; }

  .newsletter-form { flex-direction: column; }
  .newsletter-form .btn { width: 100%; justify-content: center; }

  .testimonial-card { padding: 1.75rem; }
  .donation-box { padding: 1.75rem; }

  .back-to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}

/* ---- Very small devices -------------------------------------------------- */
@media (max-width: 360px) {
  .brand__tag { display: none; }
  .brand__logo-img { height: 58px; }
  .lang-switch__btn { height: 40px; padding: 0 0.6rem; }
  .lang-switch__current { font-size: 0.8rem; }
  h1 { font-size: 1.9rem; }
}

/* ---- News ticker responsiveness ----------------------------------------- */
@media (max-width: 992px) {
  .news-ticker { height: 36px; font-size: 0.8rem; }
  .news-ticker__label { padding: 0 0.75rem; font-size: 0.7rem; }
  .site-header { top: 36px; }
  html { scroll-padding-top: calc(var(--header-height) + 36px); }
}
@media (max-width: 576px) {
  .news-ticker { height: 32px; font-size: 0.74rem; }
  .news-ticker__label { padding: 0 0.5rem; font-size: 0.65rem; gap: 0.25rem; }
  .site-header { top: 32px; }
  html { scroll-padding-top: calc(var(--header-height) + 32px); }
}
