/* =========================================================
   Tuvinieku akadēmija — responsive overrides
   Mobile-first base lives in styles.css; this file layers on
   tablet (>=768px) and desktop (>=1024px / >=1280px) changes.
   ========================================================= */

/* ---------- Tablet: 768px+ ---------- */
@media (min-width: 48em) {
  .hero__grid {
    padding-block: 4rem;
  }

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

  .topic-grid {
    /* Uniform 2-column grid: every card takes exactly 50% of the available
       width (minus gap). No per-card spans or individual widths. */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    /* Cards in the same row stretch to equal height; the CTA is pinned to
       the bottom via margin-top:auto (see .topic-card__body .card__cta). */
    align-items: stretch;
  }

  /* Dynamic layout: if the card count is odd, the single leftover card in
     the last row spans both columns. Purely structural — no fixed class on
     any specific card, so it keeps working if cards are added/removed. */
  .topic-grid > .topic-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

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

  .topic-grid--index .topic-card {
    grid-column: span 1;
  }

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

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

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

  .relative-support {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    padding: 3rem;
  }

  .patient-academy-panel {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

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

  .site-footer__bottom-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .detail-hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
  }

  .detail-layout {
    grid-template-columns: 1fr 300px;
  }

  .hero__actions {
    flex-direction: row;
    align-items: center;
  }
}

/* ---------- Desktop: 1024px+ (nav switches from hamburger) ---------- */
@media (min-width: 64em) {
  .site-nav {
    display: block;
  }

  .patient-academy-badge--header {
    display: inline-flex;
  }

  .menu-toggle,
  .mobile-nav {
    display: none;
  }

  .hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: stretch;
    padding-block: 5.5rem;
  }

  /* The left column (text + CTA) defines the row height. Stretching the
     grid makes the image column match that height exactly, so the image
     fills from the top of the row down to the CTA row's bottom edge. The
     image bottom therefore lines up structurally with the CTA bottom at
     every desktop width, without pixel nudges or absolute positioning. */
  .hero__image {
    height: 100%;
    /* On desktop the fixed height drives the box; drop the mobile
       aspect-ratio so object-fit can crop to the column height. */
    aspect-ratio: auto;
  }

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

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

  .site-footer__grid {
    grid-template-columns: 1.1fr repeat(3, 1fr);
  }
}

/* ---------- Large desktop: 1280px+ ---------- */
@media (min-width: 80em) {
  .container {
    padding-inline: 2rem;
  }
}
