/* ============================================================
   MMH Consulting — Responsive Styles
   v0.1.33
   ============================================================ */


/* ── Large Tablet: ≤ 1100px ───────────────────────────────────── */
@media (max-width: 1100px) {

  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .experience-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-footer__top {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }
}


/* ── Tablet: ≤ 900px ─────────────────────────────────────────── */
@media (max-width: 900px) {

  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-process__layout {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .section-personal__layout {
    max-width: 100%;
  }
}


/* ── Mobile: ≤ 768px ─────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Remove backdrop-filter on mobile — it creates a CSS containing block
     for position:fixed children, trapping the nav inside the header
     instead of positioning it relative to the viewport. */
  .site-header.scrolled {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.98);
  }

  /* Show hamburger; give it a clear right margin from the container edge */
  .site-nav__mobile-toggle {
    display: flex;
    margin-right: var(--space-xs);
  }

  /* Mobile nav: full-width panel below the header.
     The nav element lives outside <header> in the HTML, so position:fixed
     is always relative to the viewport — no parent can create a containing
     block that traps it. */
  .site-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    height: auto;
    flex-direction: column;
    background: var(--color-charcoal);
    padding: var(--space-sm) var(--space-lg) var(--space-lg);
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(75, 74, 68, 0.22);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-nav__list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .site-nav__list li:last-child {
    border-bottom: none;
  }

  .site-nav__link {
    display: block;
    padding: var(--space-md) 0;
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.8);
  }

  .site-nav__link:hover,
  .site-nav__link:focus {
    color: var(--color-gold-light);
  }

  /* Logo: smaller on mobile, still fits header without clipping */
  .site-logo img {
    height: 104px;
    max-width: min(280px, 62vw);
  }

  /* Intro: collapse two-col to single column */
  .section-intro__two-col {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .section-intro__statement {
    position: static;
  }

  .grid--2,
  .two-column {
    grid-template-columns: 1fr;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  /* Hero: keep glow centred on tablet */
  .section-hero__glow {
    right: auto;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    width:  min(90vw, 520px);
    height: min(90vw, 520px);
  }

  .experience-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .experience-credentials {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .site-footer__nav {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ── Mobile Small: ≤ 560px ───────────────────────────────────── */
@media (max-width: 560px) {

  .container {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .section {
    padding-top:    var(--section-padding-mobile);
    padding-bottom: var(--section-padding-mobile);
  }

  .section-tight {
    padding-top:    calc(var(--section-padding-mobile) * 0.6);
    padding-bottom: calc(var(--section-padding-mobile) * 0.6);
  }

  .section-hero {
    padding-top: calc(var(--header-height) + var(--space-md));
  }

  .section-hero__cta {
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
  }

  .section-hero__cta .button {
    width: 100%;
    justify-content: center;
  }

  .grid--3 {
    grid-template-columns: 1fr;
  }

  /* Process pipeline: single column on small mobile */
  .process-pipeline {
    grid-template-columns: 1fr;
  }

  .process-pipeline__step {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: var(--space-md);
    text-align: left;
    padding: var(--space-md) 0;
    border-bottom: var(--border-thin);
  }

  .process-pipeline__step:last-child {
    border-bottom: none;
  }

  .process-pipeline__num {
    margin: 0;
  }

  /* Hide horizontal connector line — meaningless in single-column layout */
  .process-pipeline::before {
    display: none;
  }

  .process-pipeline__desc {
    grid-column: 1 / -1;  /* span both columns so text isn't squashed into 52px */
    max-width: none;
    margin: 0;
    padding-top: var(--space-xs);
  }

  .experience-stats {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .stat-item {
    background: var(--color-white);
  }

  .process-step {
    grid-template-columns: 52px 1fr;
    gap: var(--space-md);
  }

  .process-step__number {
    font-size: var(--text-3xl);
  }

  .site-footer__nav {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .site-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }

  .site-footer__legal {
    text-align: left;
  }

  .section-cta__actions {
    flex-direction: column;
    align-items: center;
  }

  .section-cta__actions .button {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }

  .contact-form__row--split {
    grid-template-columns: 1fr;
  }

  /* Scroll-to-top: sit lower on small screens so it clears the CTA button */
  .scroll-top {
    bottom: 1rem;
    right: 2rem;
  }
}
