/* ==========================================================================
   KINDWEAVE | Charity and Non-profit HTML Template
   File: assets/css/responsive.css (tablet and phone layouts)

   01. Small laptops   up to 1100px
   02. Tablets         up to 900px   (mobile menu starts here)
   03. Phones          up to 640px
   ========================================================================== */


/* ==========================================================================
   01. SMALL LAPTOPS (up to 1100px)
   ========================================================================== */
@media (max-width: 1100px) {
  .nav__link {
    padding-inline: 10px;
  }

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

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

  .with-sidebar {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 36px;
  }

  .donate-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 36px;
  }
}


/* ==========================================================================
   02. TABLETS (up to 900px)
   ========================================================================== */
@media (max-width: 900px) {
  :root {
    --header-height: 68px;
  }

  .topbar {
    display: none;
  }

  /* Mobile menu: slides in from the right */
  .nav-toggle {
    display: grid;
  }

  .nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 110;
    width: min(340px, 86vw);
    padding: 88px 24px 32px;
    background: var(--white);
    overflow-y: auto;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.45s var(--ease), visibility 0.45s;
  }

  .nav.is-open {
    transform: translateX(0);
    visibility: visible;
    box-shadow: -30px 0 60px -30px rgba(19, 25, 69, 0.5);
  }

  .nav-toggle {
    position: relative;
    z-index: 120;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .nav__link {
    display: flex;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 1.0625rem;
  }

  /* Dropdowns are always open inside the mobile menu */
  .dropdown {
    position: static;
    min-width: 0;
    margin: 0 0 6px 16px;
    padding: 0 0 0 12px;
    border: 0;
    border-left: 2px dashed var(--line);
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: inherit;
    transform: none;
  }

  .nav__link .icon {
    display: none;
  }

  .header-actions .btn {
    padding: 11px 18px;
    font-size: 0.9375rem;
  }

  /* Stack two column layouts */
  .hero__inner,
  .split,
  .events-layout,
  .testimonials,
  .with-sidebar,
  .donate-layout,
  .event-feature {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-collage {
    margin-inline: auto;
  }

  .split--reverse .split__media {
    order: 0;
  }

  .events-layout__media {
    max-width: 420px;
    aspect-ratio: 600 / 520;
  }

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

  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .steps::before {
    top: 0;
    bottom: 0;
    left: 31px;
    right: auto;
    border-top: 0;
    border-left: 2px dashed #c3c9e6;
  }

  .step {
    padding-left: 92px;
    min-height: 64px;
  }

  .step__number {
    position: absolute;
    top: 0;
    left: 0;
  }

  .cta {
    grid-template-columns: minmax(0, 1fr);
  }

  .cta__media {
    justify-self: start;
    width: 200px;
    order: -1;
  }

  .summary {
    position: static;
  }

  .photo-badge {
    left: 12px;
  }
}


/* ==========================================================================
   03. PHONES (up to 640px)
   ========================================================================== */
@media (max-width: 640px) {
  body {
    font-size: 1rem;
  }

  .grid--2,
  .grid--3,
  .grid--4,
  .form-grid,
  .footer-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .counters {
    gap: 28px 18px;
  }

  .counter {
    padding-left: 14px;
  }

  .logo img {
    height: 36px;
  }

  /* Keep only the heart in the header donate button on very small screens */
  .header-actions .btn span {
    display: none;
  }

  .header-actions .btn {
    width: 46px;
    height: 46px;
    padding: 0;
  }

  .hero {
    padding-bottom: 130px;
  }

  .hero-card {
    width: 66%;
    padding: 14px 16px;
  }

  .hero-card__title {
    font-size: 0.9375rem;
  }

  .hero-card .progress-meta {
    font-size: 0.8125rem;
  }

  .hero__trust {
    margin-top: 30px;
  }

  .btn-row .btn {
    flex: 1 1 auto;
  }

  .event-row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 16px;
  }

  .event-row .btn {
    grid-column: 2;
    justify-self: start;
  }

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

  .author-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .comment--reply {
    margin-left: 24px;
  }

  .newsletter__form {
    flex-direction: column;
  }

  .footer-main {
    padding-block: 48px;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .map {
    aspect-ratio: 4 / 3;
  }

  .back-to-top {
    right: 14px;
    bottom: 14px;
  }
}
