/**
 * Responsive Breakpoints
 *
 * All media queries in one file — easy to audit and maintain.
 * Breakpoints match Elementor's defaults exactly so Elementor
 * responsive controls and this CSS never produce conflicting results.
 *
 * Breakpoints:
 *   Desktop:  > 1024px  (default styles, no media query needed)
 *   Tablet:   ≤ 1024px  (laptop/tablet landscape)
 *   Mobile L: ≤ 768px   (tablet portrait / large phone)
 *   Mobile S: ≤ 480px   (phone)
 *
 * @package EthicalInfrastructure
 */

/* ═══════════════════════════════════════════════════════════════════════════
   TABLET — ≤ 1024px
   ═══════════════════════════════════════════════════════════════════════════ */

@media screen and (max-width: 1024px) {

  /* ── Container ──────────────────────────────────────────────────────────── */
  .ei-container,
  .ei-container--fluid,
  .ei-hero__content,
  .ei-hero__stat-bar,
  .ei-footer__inner {
    padding-left: var(--space-8); /* 64px → 48px */
    padding-right: var(--space-8);
  }

  /* ── Typography scale ───────────────────────────────────────────────────── */
  :root {
    --fs-display-lg:  52px;  /* 64 → 52 */
    --fs-headline-xl: 40px;  /* 48 → 40 */
    --fs-headline-lg: 28px;  /* 32 → 28 */
  }

  /* ── Navigation ─────────────────────────────────────────────────────────── */
  .ei-nav {
    display: none; /* hide desktop nav */
  }

  .ei-nav-toggle {
    display: flex; /* show hamburger */
  }

  .ei-header__inner {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
    height: 72px;
  }

  /* ── Hero ───────────────────────────────────────────────────────────────── */
  .ei-hero {
    min-height: 70vh;
  }

  .ei-hero--split {
    grid-template-columns: 1fr;
  }

  .ei-hero--split .ei-hero__image {
    min-height: 350px;
    order: -1; /* image above text on tablet */
  }

  .ei-hero--split .ei-hero__text {
    padding: var(--space-8) var(--space-8);
  }

  /* ── Contact Split ──────────────────────────────────────────────────────── */
  .ei-contact-split {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .ei-contact-split__panel {
    padding: var(--space-8) var(--space-8);
  }

  .ei-contact-split__panel--form {
    border-left: none;
    border-top: 1px solid var(--color-outline-variant);
  }

  /* ── Cards grid ─────────────────────────────────────────────────────────── */
  .ei-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* ── Policy rows ────────────────────────────────────────────────────────── */
  .ei-policy-row {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .ei-policy-row--reverse {
    direction: ltr;
  }

  .ei-policy-row__image {
    height: 320px;
  }

  /* ── Grid ───────────────────────────────────────────────────────────────── */
  .ei-col-3 { grid-column: span 6; }
  .ei-col-4 { grid-column: span 6; }
  .ei-col-5 { grid-column: span 6; }
  .ei-col-7 { grid-column: span 6; }
  .ei-col-8 { grid-column: span 12; }
  .ei-col-9 { grid-column: span 12; }

  /* ── About doc layout ───────────────────────────────────────────────────── */
  .ei-doc-layout {
    grid-template-columns: 1fr;
  }

  .ei-doc-sidebar {
    display: none; /* hide sidebar on tablet */
  }

  /* ── Bento ──────────────────────────────────────────────────────────────── */
  .ei-bento {
    grid-template-columns: 1fr;
  }

  /* ── Footer ─────────────────────────────────────────────────────────────── */
  .ei-footer__brand   { grid-column: span 12; }
  .ei-footer__col     { grid-column: span 3; }
  .ei-footer__hq      { grid-column: span 6; }

  /* ── Section padding ────────────────────────────────────────────────────── */
  :root {
    --space-section-gap: 60px;
  }

  .ei-pullquote {
    padding: var(--space-8);
  }

  .ei-pullquote__text {
    font-size: var(--fs-headline-lg);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE LARGE — ≤ 768px
   ═══════════════════════════════════════════════════════════════════════════ */

@media screen and (max-width: 768px) {

  /* ── Container ──────────────────────────────────────────────────────────── */
  .ei-container,
  .ei-container--fluid,
  .ei-container--narrow,
  .ei-hero__content,
  .ei-hero__stat-bar,
  .ei-footer__inner,
  .ei-contact-split__panel,
  .ei-hero--split .ei-hero__text {
    padding-left: var(--space-margin-mobile);
    padding-right: var(--space-margin-mobile);
  }

  /* ── Typography ─────────────────────────────────────────────────────────── */
  :root {
    --fs-display-lg:  32px;
    --fs-headline-xl: 26px;
    --fs-headline-lg: 22px;
    --fs-headline-md: 18px;
    --fs-body-lg:     16px;
    --space-section-gap: 48px;
    --space-card-padding: 24px;
  }

  /* ── Navigation ─────────────────────────────────────────────────────────── */
  .ei-header__inner {
    height: 64px;
    padding: 0 20px;
  }

  .ei-header__logo img {
    height: 32px;
  }

  /* Mobile nav panel */
  .ei-nav-mobile {
    top: 64px;
    padding: 48px 24px 48px;
    gap: 0;
  }

  .ei-nav-close {
    top: 12px;
    right: 16px;
  }

  .ei-nav-mobile__link {
    font-size: 2.2rem;
    padding: 10px 0;
  }

  /* ── Hero ───────────────────────────────────────────────────────────────── */
  .ei-hero {
    min-height: 60vh;
  }

  .ei-hero__content {
    padding-top: 48px;
    padding-bottom: 40px;
  }

  .ei-hero__stat-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  /* ── Cards ──────────────────────────────────────────────────────────────── */
  .ei-cards-grid {
    grid-template-columns: 1fr;
  }

  /* ── Grid ───────────────────────────────────────────────────────────────── */
  .ei-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .ei-col-3,
  .ei-col-4,
  .ei-col-5,
  .ei-col-6,
  .ei-col-7,
  .ei-col-8,
  .ei-col-9,
  .ei-col-12 {
    grid-column: span 1;
  }

  /* ── Buttons ────────────────────────────────────────────────────────────── */
  .ei-btn {
    padding: 14px 24px;
  }

  /* ── CTA form inline ────────────────────────────────────────────────────── */
  .ei-form-inline {
    flex-direction: column;
    max-width: 100%;
  }

  .ei-form-inline__submit {
    padding: 16px 24px;
    width: 100%;
  }

  /* CF7 inline forms — stack on mobile */
  .ep-cta-centered .wpcf7 .cf7-field-group {
    flex-direction: column;
    border: none;
    border-bottom: 1px solid rgba(13,31,60,0.2);
    gap: 0;
  }

  .ep-cta-centered .wpcf7 input[type="email"] {
    text-align: left !important;
    padding: 16px 0 !important;
  }

  .ep-cta-centered .wpcf7 input[type="submit"] {
    width: 100% !important;
    margin-top: 16px;
    text-align: center;
    padding: 16px !important;
  }

  /* Research dark CTA form — keep inline but tighten */
  .ep-dark-cta-form--cf7 .wpcf7 .cf7-field-group {
    padding-bottom: 8px;
  }

  /* ── Bento grid — single column ─────────────────────────────────────────── */
  .ep-bento-grid {
    grid-template-columns: 1fr !important;
  }

  /* ── Contact page — stack panels ───────────────────────────────────────── */
  .ei-contact-page {
    flex-direction: column !important;
    min-height: auto !important;
  }

  .ei-contact-panel {
    width: 100% !important;
    padding: 48px 20px !important;
  }

  .ei-contact-panel--right {
    border-left: none !important;
    border-top: 1px solid var(--color-outline-variant);
  }

  /* ── Section arrows ─────────────────────────────────────────────────────── */
  .ei-scroll-arrows {
    display: none;
  }

  /* ── Footer ─────────────────────────────────────────────────────────────── */
  .ei-footer {
    padding: 48px 0;
  }

  .ei-footer__brand,
  .ei-footer__col,
  .ei-footer__hq {
    grid-column: span 12;
  }

  .ei-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .ei-footer__legal {
    flex-wrap: wrap;
    gap: 12px;
  }

  /* ── Stat grid ──────────────────────────────────────────────────────────── */
  .ei-stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* ── Pullquote ──────────────────────────────────────────────────────────── */
  .ei-pullquote {
    padding: 40px 20px;
  }

  .ei-pullquote__mark {
    font-size: 48px;
  }

  .ei-pullquote__text {
    font-size: var(--fs-headline-md);
  }

  /* ── Policy rows ────────────────────────────────────────────────────────── */
  .ei-policy-row__image {
    height: 220px;
  }

  .ei-policy-row__number {
    font-size: 40px;
  }

  /* ── Contact split ──────────────────────────────────────────────────────── */
  .ei-contact-split {
    grid-template-columns: 1fr;
  }

  .ei-contact-split__panel {
    padding: 40px 20px;
    min-height: auto;
  }

  /* ── Dark CTA section — reduce padding ──────────────────────────────────── */
  .ei-section--navy .ep-dark-cta {
    flex-direction: column !important;
    gap: 40px;
  }

  .ep-dark-cta__right {
    width: 100% !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE SMALL — ≤ 480px
   ═══════════════════════════════════════════════════════════════════════════ */

@media screen and (max-width: 480px) {

  /* ── Typography ─────────────────────────────────────────────────────────── */
  :root {
    --fs-display-lg:  30px;
    --fs-headline-xl: 24px;
    --fs-headline-lg: 20px;
    --space-section-gap: 48px;
  }

  /* ── Header ─────────────────────────────────────────────────────────────── */
  .ei-header__inner {
    padding: 0 var(--space-2);
  }

  /* ── Hero ───────────────────────────────────────────────────────────────── */
  .ei-hero {
    min-height: 50vh;
  }

  /* ── Stat grid ──────────────────────────────────────────────────────────── */
  .ei-stat-grid {
    grid-template-columns: 1fr;
  }

  /* ── CTA ────────────────────────────────────────────────────────────────── */
  .ei-cta__headline {
    font-size: var(--fs-headline-xl);
  }

  /* ── Footer ─────────────────────────────────────────────────────────────── */
  .ei-footer__legal {
    flex-direction: column;
    gap: var(--space-2);
  }

  /* ── Buttons full-width on smallest screens ─────────────────────────────── */
  .ei-hero .ei-btn,
  .ei-cta .ei-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════════════════════════ */

@media print {
  .ei-header,
  .ei-nav-toggle,
  .ei-nav-mobile,
  .ei-footer,
  .ei-scroll-arrows,
  .ei-cta,
  .ei-form-inline,
  .ei-form-underline__submit {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  .ei-container {
    max-width: 100%;
    padding: 0;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 10pt;
    color: #555;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }
}
