/* ============================================================
  Responsive (breakpoint ≥768px, tablet + desktop)
   ============================================================ */

@media (min-width: 768px) {
  .container {
    padding-inline: 36px;
  }

  /* Menu open/close is intentionally mobile-only:
     desktop always shows the inline nav bar */
  .menu-toggle {
    display: none;
  }

  /* Desktop header: 1fr | auto | 1fr grid keeps nav perfectly centered */
  .site-header {
    padding: 0;
    border-radius: 0;
  }

  .site-header__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    padding-inline: 36px;
    align-items: center;
  }

  .site-header__group {
    gap: 12px;
  }

  .site-header__actions {
    display: flex;
    justify-content: flex-end;
  }

  /* Desktop navigation replaces mobile panel */
  .site-nav {
    display: flex;
  }

  .site-nav__link {
    font-size: 1.0625rem;
    line-height: 24px;
  }

  /* Main grid: 12 columns — content 8, sidebar 4 */
  .main-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--gutter);
    padding-block: 32px;
  }

  .col-primary {
    grid-column: span 8;
  }

  /* Pages without a sidebar use the full 12 columns */
  .main-grid--full > .col-primary {
    grid-column: span 12;
  }

  .col-sidebar {
    grid-column: span 4;
  }

  /* Hero media grows */
  .hero__media {
    height: 384px;
  }

  /* Article cards: 2 columns on tablet, 3 on desktop */
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card--wide {
    grid-column: span 2;
  }

  .card--wide .card__link {
    flex-direction: row;
  }

  .card__media--wide {
    width: 40%;
    height: auto;
    min-height: 240px;
    min-width: 0;
  }

  .card__content--wide {
    width: 60%;
    padding: 28px 32px;
    justify-content: center;
    min-width: 0;
  }

  /* Hero content padding grows */
  .hero__content {
    padding: 32px;
  }

  /* Sidebar stacks widgets */
  .col-sidebar {
    gap: 32px;
  }

  /* Footer: 2-col on tablet */
  .site-footer__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    padding-block: 48px 36px;
  }

  .site-footer__brand {
    grid-column: span 2;
    text-align: center;
    padding-bottom: 0;
    border-bottom: none;
  }

  .site-footer__brand .site-footer__social {
    justify-content: center;
  }

  .site-footer__links:nth-of-type(1) {
    grid-column: span 1;
  }

  .site-footer__links:nth-of-type(2) {
    grid-column: span 1;
  }

  .site-footer__contact {
    grid-column: span 1;
  }

  .site-footer__company {
    grid-column: span 1;
  }

  .site-footer__bottom-inner {
    padding-inline: 36px;
  }

  /* Sidebar stack sticks below the header on scroll — being
     in-flow (sticky, not fixed) keeps it exactly aligned with
     its grid column (no scrollbar-width offset).
     Stretch the sidebar across the full grid row so the sticky
     stack has room to travel and actually engages. */
  body:not(.is-landing) .col-sidebar {
    align-self: stretch;
  }

  body:not(.is-landing) .sidebar-stack {
    position: sticky;
    top: calc(var(--header-total) + 16px);
  }

  body:not(.is-landing) .widget--list,
  body:not(.is-landing) .widget--sticky {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

/* Fixed sidebar is desktop-only */
@media (max-width: 767px) {
  .col-sidebar {
    position: static;
  }

  .container {
    padding-inline: 16px;
  }

  .page__figure img {
    height: 200px;
  }

  .page__map iframe {
    height: 250px;
  }

  .card__content {
    padding: 16px 16px 20px;
  }

  .card__media {
    height: 200px;
  }

  .card__media--wide {
    height: 160px;
    min-height: 0;
  }

  .card__media--sm {
    height: 160px;
  }

  .iconStyle {
    height: 72px;
    bottom: 88px;
    right: 16px;
  }

  .bamboo-info-container {
    padding: 1.5rem 1rem 2rem;
  }

  .bamboo-info-card {
    padding: 1rem;
  }

  .bamboo-info-title {
    font-size: 1.5rem;
  }

  .bamboo-info-badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
  }

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

  .news_subtitle {
    font-size: 1.15rem;
  }

  .whatsapp-float {
    width: 46px;
    height: 46px;
    font-size: 22px;
    right: 14px;
    bottom: 24px;
  }
}

/* Small mobile: single column footer */
@media (max-width: 375px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
  }

  .site-footer__brand {
    grid-column: span 1;
  }
}

/* Landing page: popular + notice widgets are combined in one
   .sidebar-stack div which sticks below the header on scroll */
@media (min-width: 768px) {
  body.is-landing .col-sidebar {
    align-self: stretch;
  }

  body.is-landing .sidebar-stack {
    position: sticky;
    top: calc(var(--header-total) + 16px);
  }

  body.is-landing .widget--list,
  body.is-landing .widget--sticky {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

/* 992+ base rules first; small-laptop overrides follow so they win
   in the overlapping range. */

@media (min-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .container {
    padding-inline: var(--margin-desktop);
  }

  /* Footer: 4-column layout on desktop */
  .site-footer__grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
  }

  .site-footer__brand {
    grid-column: span 1;
    text-align: left;
  }

  .site-footer__brand .site-footer__social {
    justify-content: flex-start;
  }
}

/* ============================================================
   Small laptops: 768–1280px (13", 1366x768, short viewports).
   Placed last so these win over the generic 992+ rules above.
   ============================================================ */
@media (min-width: 768px) and (max-width: 1280px) {
  .container {
    padding-inline: 28px;
  }

  .site-header__inner {
    padding-inline: 28px;
    gap: 16px;
  }

  .site-nav {
    gap: 4px;
  }

  .site-nav__link {
    font-size: 0.95rem;
    padding: 8px 10px;
  }

  .main-grid {
    gap: 20px;
    padding-block: 24px;
  }

  /* Hero: cap height on short laptop screens */
  .gallery__slide {
    height: auto;
    min-height: 480px;
    max-height: 660px;
  }

  .gallery__title {
    font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem);
  }

  .gallery__slogan {
    font-size: 1rem;
    max-width: 540px;
  }

  /* Keep 2 columns until there is room for 3 */
  .blog-grid,
  .card-grid,
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .programs__layout {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 20px;
  }

  .card--wide {
    grid-column: span 2;
  }

  /* Prevent sideways scroll from wide tables/embeds */
  img, video, iframe {
    max-width: 100%;
  }

  table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }
}

@media (min-width: 992px) and (max-width: 1280px) {
  .container {
    padding-inline: 32px;
  }

  .site-header__inner {
    padding-inline: 32px;
  }

  /* 5-col footer is cramped here — 3 columns instead */
  .site-footer__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .site-footer__brand {
    grid-column: span 3;
    text-align: center;
  }

  .site-footer__brand .site-footer__social {
    justify-content: center;
  }

  .plant-show__card {
    grid-template-columns: 1fr 1fr;
  }

  .hero__media {
    height: 320px;
  }
}

/* Short-height laptops (e.g. 1366x768): reduce vertical chrome */
@media (min-width: 768px) and (max-height: 800px) {
  .gallery__slide {
    min-height: 400px;
    max-height: 560px;
  }

  .gallery__overlay {
    gap: 12px;
  }

  .main-grid {
    padding-block: 20px;
  }
}