/* ==========================================================================
   MindShift Guru — Responsive layer
   --------------------------------------------------------------------------
   Mobile-first intent expressed through progressive enhancement.
   Breakpoints:
     <= 1180px  tighten spacing, reduce multi-column density
     <= 1024px  switch editorial splits to a single column, 2-up grids
     <=  860px  navigation collapses to the drawer, 3-up -> 2-up
     <=  620px  single column, hero stacking, compact type
     <=  400px  very small phones (320-390px class)
   ========================================================================== */

/* ==========================================================================
   LARGE DESKTOP
   ========================================================================== */

@media (min-width: 1440px) {
  :root {
    --container: 1280px;
  }
}

/* ==========================================================================
   <= 1180px
   ========================================================================== */

@media (max-width: 1180px) {
  .site-footer__grid {
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
    gap: var(--space-lg);
  }

  /* The contact column drops onto its own full-width row at this width */
  .site-footer__contact {
    grid-column: 1 / -1;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border);
  }

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

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

/* ==========================================================================
   <= 1024px — editorial splits collapse
   ========================================================================== */

@media (max-width: 1024px) {
  .split,
  .split--wide-left,
  .section-head--split,
  .newsletter {
    grid-template-columns: minmax(0, 1fr);
  }

  .split--reverse > :first-child {
    order: 0;
  }

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

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

  .principle {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-md);
  }

  .principle__aside {
    position: static;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
  }

  .principle__anchor {
    margin-top: 0;
  }

  .article-aside {
    position: static;
    order: -1;
  }

  /* Table of contents becomes a compact collapsible-style block */
  .toc {
    padding: var(--space-sm);
  }

  .toc__list {
    columns: 2;
    column-gap: var(--space-md);
  }

  .toc__list li {
    break-inside: avoid;
  }

  .figure--ringed::before {
    width: 90px;
    height: 90px;
    top: -14px;
    right: -14px;
  }

  .figure--ringed::after {
    width: 58px;
    height: 58px;
    bottom: -12px;
    left: -12px;
  }
}

/* ==========================================================================
   <= 900px — navigation drawer
   ========================================================================== */

@media (max-width: 900px) {
  :root {
    --header-h: 68px;
  }

  /* Hide the desktop nav + header CTA; the drawer carries everything */
  .site-nav,
  .site-header__cta {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

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

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

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

/* ==========================================================================
   <= 860px
   ========================================================================== */

@media (max-width: 860px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .newsletter__form {
    padding: var(--space-sm);
  }
}

/* ==========================================================================
   <= 620px — single column
   ========================================================================== */

@media (max-width: 620px) {
  :root {
    --space-3xl: 4rem;
    --space-2xl: 3rem;
    --radius-xl: 28px;
    --radius-lg: 22px;
  }

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

  .toc__list {
    columns: 1;
  }

  /* --- Hero: designed stack, not a squeezed desktop --- */
  .hero {
    padding-block: 2.4rem 3rem;
  }

  .hero .split {
    gap: 2.2rem;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .portrait {
    padding: 0.85rem;
    border-radius: var(--radius-lg);
  }

  .portrait__caption {
    font-size: 0.74rem;
  }

  .figure--ringed::before,
  .figure--ringed::after {
    display: none;
  }

  .page-hero__deco {
    right: -140px;
    opacity: 0.5;
  }

  /* Buttons become comfortably tappable full-width blocks in tight spots */
  .empty-state__actions,
  .cta-band__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-band__actions .btn {
    width: 100%;
  }

  .card,
  .principle-card {
    padding: var(--space-sm) var(--space-md) var(--space-md);
  }

  .step {
    padding: var(--space-sm) var(--space-md) var(--space-md);
  }

  .statement {
    padding: var(--space-lg) var(--space-md);
    text-align: left;
  }

  .statement p {
    margin-inline: 0;
  }

  .statement__mark {
    margin-inline: 0;
  }

  .prose blockquote {
    padding: var(--space-sm) var(--space-md);
    font-size: 1.1rem;
  }

  .article-head__title {
    font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.4rem);
  }

  .newsletter {
    padding: var(--space-md) var(--space-sm);
  }

  .newsletter--stacked {
    text-align: left;
    justify-items: stretch;
  }

  .newsletter--stacked .newsletter__points {
    margin-inline: 0;
    text-align: left;
  }

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

  .site-footer__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-lg);
  }

  .site-footer__social {
    margin-top: var(--space-sm);
  }
}

/* ==========================================================================
   <= 400px — small phones (320-390px)
   ========================================================================== */

@media (max-width: 400px) {
  :root {
    --gutter: 1.05rem;
    --header-h: 64px;
  }

  body {
    font-size: 0.98rem;
  }

  .btn {
    min-height: 46px;
    padding: 0.7rem 1.15rem;
  }

  .site-header__inner {
    gap: 0.5rem;
  }

  .wordmark__mark {
    width: 34px;
    height: 36px;
  }

  .wordmark__name {
    font-size: 1.02rem;
  }

  .wordmark__tag {
    font-size: 0.55rem;
    letter-spacing: 0.16em;
  }

  .portrait__leaf {
    width: 100px;
    height: 100px;
    right: -22px;
    bottom: -22px;
  }

  .toc {
    padding: var(--space-xs) var(--space-sm);
  }

  .form-status {
    padding: 0.8rem 0.9rem;
  }

  /* Floating buttons stay icon-only so they cannot overflow a narrow screen */
  .fab-stack {
    right: 0.75rem;
    bottom: 0.75rem;
    gap: 0.5rem;
  }

  .fab {
    height: 46px;
    min-width: 46px;
  }

  /* Labels never expand on touch-first small screens */
  .fab:hover .fab__label,
  .fab:focus-visible .fab__label {
    max-width: 0;
    opacity: 0;
  }

  .fab:hover,
  .fab:focus-visible {
    padding-inline: 0;
    transform: none;
  }
}

/* ==========================================================================
   SHORT LANDSCAPE VIEWPORTS
   ========================================================================== */

@media (max-height: 520px) and (orientation: landscape) {
  .nav-drawer__panel {
    padding-top: calc(var(--header-h) + var(--space-xs));
  }

  .nav-drawer__link {
    padding: 0.65rem 0.2rem;
    font-size: 1.1rem;
  }
}

/* ==========================================================================
   PRINT — keep it legible on paper exports
   ========================================================================== */

@media print {
  .site-header,
  .nav-drawer,
  .fab-stack,
  .read-progress,
  .share-row,
  .newsletter,
  .site-footer__social {
    display: none !important;
  }

  body {
    background: #fff;
    color: #234d37;
    font-size: 11.5pt;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #42634d;
  }

  .section {
    padding-block: 1rem;
    break-inside: avoid;
  }
}
