/* =============================================
   Responsive — Mobile-first media queries
   ============================================= */

/* --- Small devices (landscape phones, < 576px) --- */
@media (max-width: 575.98px) {
  :root {
    --fs-4xl: 2rem;
    --fs-3xl: 1.75rem;
    --fs-2xl: 1.5rem;
  }

  .hero {
    min-height: auto;
  }

  .hero__img--desktop {
    display: none;
  }

  .hero__img--mobile {
    display: block;
  }

  .hero__circle {
    display: none;
  }

  .hero__content {
    position: absolute;
    top: 15%;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0 var(--space-lg);
  }

  .hero__title {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--color-white);
    letter-spacing: -0.5px;
    text-transform: uppercase;
    margin-bottom: var(--space-md);
    line-height: 1.2;
  }

  .hero__subtitle {
    display: block;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
  }

  .join-movement__inner {
    flex-direction: column;
    text-align: center;
  }

  .join-movement__text {
    max-width: 100%;
  }

  .join-movement__form {
    width: 100%;
  }

  .join-movement__input {
    flex: 1;
    min-width: 0;
  }

  .join-movement__socials {
    justify-content: center;
  }

  .blog-row {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .blog-row__img-wrap {
    flex: none;
    max-width: 100%;
    width: 100%;
  }

  .blog-row__img {
    height: 220px;
  }

  .system-card {
    flex-direction: column;
  }

  .system-card__img-wrap {
    width: 100%;
  }

  .navbar-toggler__open,
  .navbar-toggler__close {
    font-size: 0;
  }

  .navbar-toggler__open i,
  .navbar-toggler__close i {
    font-size: var(--fs-xl);
  }

  .hero__btn {
    display: inline-flex;
    margin: var(--space-md) auto 0;
    font-size: var(--fs-xs);
    padding: 10px 22px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .section-padding {
    padding: var(--space-lg) 0;
  }

  .page-header {
    padding-top: calc(var(--navbar-height) + var(--space-2xl));
    padding-bottom: var(--space-2xl);
  }

  .card-custom {
    padding: var(--space-xl);
  }

  .stat__number {
    font-size: var(--fs-3xl);
  }

  .pre-footer__socials {
    justify-content: flex-start;
    margin-top: var(--space-xl);
  }

  .happening {
    padding: var(--space-lg) 0;
  }

  .our-work {
    padding: var(--space-lg) 0;
  }

  .sdgs {
    padding: var(--space-lg) 0;
  }

  .contributors {
    padding: var(--space-lg) 0;
  }

  .pre-footer {
    padding: var(--space-lg) 0;
  }

  .happening-card {
    min-height: 220px;
    padding: var(--space-lg);
  }

  .happening-card__heading {
    font-size: var(--fs-lg);
  }

  .happening__grid {
    display: none !important;
  }

  .happening__carousel {
    display: block;
  }

  .work-panels {
    flex-direction: column;
  }

  .work-panel {
    min-height: 200px;
  }

  .sdgs__grid {
    display: none;
  }

  .sdgs__carousel {
    display: block;
  }

  .sdgs__carousel .sdgs-card {
    padding: 0 var(--space-sm);
  }

  .sdgs__carousel .sdgs-card__img {
    height: 250px;
  }

  .contributors__grid:not(.contributors__grid--full) {
    display: none;
  }

  .contributors__grid--full {
    grid-template-columns: repeat(2, 1fr);
  }

  .contributors__carousel-mb {
    display: block;
  }

  .contributors__carousel-mb .contributor-card__img {
    height: 180px;
  }

  .contributors__viewall {
    display: none;
  }

  .cmodal__top {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .cmodal__socials {
    justify-content: center;
  }

  .cmodal__btns {
    justify-content: center;
  }

  .vision {
    padding: var(--space-lg) 0;
  }

  .vision__text {
    max-width: 100%;
  }

  .about-section {
    padding: var(--space-xl) 0;
  }

  .about-content__icon {
    width: 48px;
    height: 48px;
    font-size: var(--fs-lg);
  }

  .contact-section {
    padding-top: calc(var(--navbar-height) + var(--space-lg));
    padding-bottom: var(--space-xl);
  }

  .featured__card-img-wrap {
    height: 250px;
  }

  .community-hero__img-wrap {
    min-height: 250px;
  }

  .community-hero__body {
    padding: var(--space-xl);
  }

  .community-hero__title {
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
  }

  .community-hero__text {
    font-size: var(--fs-sm);
    line-height: var(--lh-base);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .qb-card {
    flex-direction: column;
  }

  .qb-card__img-wrap {
    width: 100%;
    height: 200px;
  }

  .qb-card__body {
    padding: var(--space-lg);
  }

  .contact-hero {
    padding-top: calc(var(--navbar-height) + var(--space-xl));
    padding-bottom: var(--space-xl);
  }

  .contact-content {
    padding: var(--space-xl) 0;
  }

  .contact-info-box {
    padding: var(--space-xl);
  }

  .harticle__hero {
    min-height: 350px;
  }

  .harticle__hero-full {
    margin-top: 5px;
  }

  .harticle__body {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .harticle__title {
    font-size: 1.75rem;
  }

  .harticle__share-btn span,
  .harticle__share-btn {
    font-size: var(--fs-xs);
    padding: 6px 10px;
  }

  .harticle__sidebar {
    position: static;
  }

  .harticle__content p:first-child::first-letter {
    font-size: 2.5rem;
  }
}

/* --- Medium devices (tablets, 576px - 767px) --- */
@media (min-width: 576px) and (max-width: 767.98px) {
  :root {
    --fs-4xl: 2.25rem;
    --fs-3xl: 2rem;
  }

  .hero {
    min-height: 85vh;
    align-items: center;
  }

  .hero__circle {
    display: none;
  }

  .hero__content {
    align-items: center;
    padding-bottom: 0;
  }

  .hero__title {
    text-align: center;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .work-panels {
    flex-wrap: wrap;
  }

  .work-panel {
    flex: 1 1 calc(50% - 2px);
    min-height: 220px;
  }

  .sdgs__grid {
    grid-template-columns: repeat(2, 1fr);
  }

}

/* --- Large devices (desktops, 768px - 991px) --- */
@media (min-width: 768px) and (max-width: 991.98px) {
  :root {
    --fs-4xl: 2.5rem;
  }

  .hero {
    min-height: auto;
  }

  .work-panel {
    min-height: 300px;
  }
}

/* --- Extra large (1200px+) --- */
@media (min-width: 1200px) {
  .hero__title {
    font-size: 4rem;
    color: var(--color-white);
    font-weight: 600;
    letter-spacing: -1px;
    line-height: 1.1;
  }
}

/* Mobile mega menu */
@media (max-width: 767.98px) {
  .mega-menu {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    padding: var(--space-xl);
  }

  .mega-menu__stories,
  .mega-menu__featured {
    display: none;
  }

  .mega-menu__link {
    display: block;
    width: 100%;
    font-size: var(--fs-base);
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
  }

  .mega-menu__dropdown {
    width: 100%;
  }

  .mega-menu__dropdown > .mega-menu__link {
    display: flex;
    width: 100%;
    justify-content: space-between;
  }

  .mega-menu__dropdown-item {
    padding: 10px 0;
    padding-left: var(--space-md);
    border-bottom: 1px solid var(--color-border);
  }

  .mega-menu__dropdown-item:hover {
    padding-left: 10px;
  }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }
}
