/* Smoke N Mirrors — phones & tablets
   Loaded sitewide; overrides cramped nav / 360px caps without editing Elementor HTML. */

html:has(.smoke-page),
html:has(.sm-page),
body:has(.smoke-page),
body:has(.sm-page) {
  overflow-x: clip !important;
  max-width: 100% !important;
}

.smoke-page,
.sm-page {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  overflow-x: clip;
}

.smoke-page img,
.sm-page img,
.smoke-page video,
.sm-page video,
.smoke-page iframe,
.sm-page iframe {
  max-width: 100% !important;
  height: auto;
}

.smoke-page iframe,
.sm-page iframe {
  width: 100% !important;
}

.smoke-page .wrap,
.sm-page .sm-wrap,
.sm-wrap {
  width: min(1180px, calc(100% - 32px)) !important;
  max-width: calc(100% - 32px) !important;
  box-sizing: border-box;
}

/* ---- Shared mobile menu chrome ---- */
.snm-menu-toggle {
  display: none;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(216, 174, 93, 0.55);
  background: rgba(18, 19, 23, 0.92);
  color: #f4efe7;
  border-radius: 999px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  margin: 0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  z-index: 2;
}

.snm-menu-toggle:focus-visible {
  outline: 2px solid #d7ad5b;
  outline-offset: 3px;
}

.snm-menu-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  width: 16px;
}

.snm-menu-toggle__bars span {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.snm-nav-open .snm-menu-toggle__bars span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
.snm-nav-open .snm-menu-toggle__bars span:nth-child(2) {
  opacity: 0;
}
.snm-nav-open .snm-menu-toggle__bars span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* Home header row for toggle */
.smoke-page .nav,
.sm-page .sm-nav {
  position: relative;
}

.smoke-page .nav .snm-nav-top,
.sm-page .sm-nav .snm-nav-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ========== Tablet (and below) ========== */
@media (max-width: 1024px) {
  .snm-menu-toggle {
    display: inline-flex;
  }

  /* Collapse menus until opened */
  .smoke-page .nav-links,
  .sm-page .sm-nav-links {
    display: none !important;
  }

  .smoke-page.snm-nav-open .nav-links,
  .sm-page.snm-nav-open .sm-nav-links,
  .site-header.snm-nav-open .nav-links,
  .sm-header.snm-nav-open .sm-nav-links {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: none !important;
    margin: 8px 0 0 !important;
    gap: 6px !important;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(8, 9, 11, 0.96);
  }

  .smoke-page .nav-links a,
  .sm-page .sm-nav-links a {
    width: 100% !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 10px 14px !important;
    font-size: 0.95rem !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    border-radius: 8px;
  }

  .smoke-page .nav,
  .sm-page .sm-nav {
    flex-direction: column !important;
    align-items: stretch !important;
    min-height: 0 !important;
    padding: 12px 0 !important;
    width: min(1180px, calc(100% - 24px)) !important;
    max-width: calc(100% - 24px) !important;
    gap: 0 !important;
  }

  .smoke-page .brand,
  .sm-page .sm-brand {
    width: min(46vw, 170px) !important;
    align-self: flex-start !important;
  }

  .smoke-page .hero {
    min-height: auto !important;
    padding: 120px 0 48px !important;
  }

  .sm-page .sm-hero {
    min-height: auto !important;
    padding: 120px 0 48px !important;
  }

  .smoke-page h1,
  .sm-page h1,
  .sm-page .sm-hero h1 {
    font-size: clamp(2rem, 6.5vw, 3.1rem) !important;
    line-height: 1.05 !important;
    max-width: 18ch !important;
  }

  .smoke-page .hero p,
  .sm-page .sm-hero p,
  .smoke-page .eyebrow,
  .sm-page .sm-kicker {
    max-width: min(42rem, 100%) !important;
    width: 100% !important;
  }

  .smoke-page .stats-grid,
  .smoke-page .section-title,
  .smoke-page .split,
  .smoke-page .status-menu,
  .smoke-page .project-grid,
  .smoke-page .synopsis-grid,
  .smoke-page .gallery-grid,
  .smoke-page .media-grid,
  .smoke-page .contact-band,
  .smoke-page .service-grid,
  .sm-page .sm-title,
  .sm-page .sm-feature,
  .sm-page .sm-grid,
  .sm-page .sm-grid.two,
  .sm-page .sm-poster-grid,
  .sm-page .sm-strip {
    grid-template-columns: 1fr !important;
  }

  .smoke-page .gallery-grid {
    grid-auto-rows: minmax(200px, 28vw) !important;
  }

  .smoke-page .gallery-grid .gallery-feature {
    grid-row: span 1 !important;
  }

  .sm-page .sm-poster-grid {
    gap: 22px !important;
  }

  .sm-page .sm-feature img {
    min-height: 220px !important;
    height: 220px !important;
  }

  .sm-page .sm-cta-band .sm-wrap,
  .sm-page .sm-footer .sm-wrap {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .smoke-page .button,
  .smoke-page .actions a,
  .sm-page .sm-btn,
  .sm-page a.sm-btn {
    min-height: 44px;
  }
}

/* Tablet landscape / medium: 2-up cards where it helps */
@media (min-width: 701px) and (max-width: 1024px) {
  .smoke-page .project-grid,
  .smoke-page .synopsis-grid,
  .smoke-page .service-grid,
  .smoke-page .media-grid,
  .sm-page .sm-grid,
  .sm-page .sm-grid.two,
  .sm-page .sm-poster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* ========== Phones ========== */
@media (max-width: 700px) {
  .smoke-page .wrap,
  .sm-page .sm-wrap,
  .sm-wrap {
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
  }

  .smoke-page .section,
  .sm-page .sm-section {
    padding: 48px 0 !important;
  }

  .smoke-page .section-title h2,
  .smoke-page .copy-block h2,
  .smoke-page .contact-panel h2,
  .sm-page .sm-title h2,
  .sm-page h2 {
    font-size: clamp(1.55rem, 6vw, 2rem) !important;
  }

  .smoke-page .copy-block,
  .smoke-page .contact-panel,
  .sm-page .sm-card,
  .sm-page .sm-panel,
  .sm-page .sm-feature-body,
  .sm-page .sm-synopsis {
    padding: 18px !important;
  }

  .smoke-page .project-card {
    grid-template-rows: 160px 1fr !important;
    min-height: auto !important;
  }

  .smoke-page .project-card img {
    height: 160px !important;
  }

  .smoke-page .poster-grid {
    columns: 1 !important;
  }

  .smoke-page .media-card {
    grid-template-columns: 1fr !important;
  }

  .smoke-page .media-card img {
    height: 200px !important;
  }

  .sm-page .sm-card img,
  .sm-page .sm-feature img {
    height: 200px !important;
    min-height: 200px !important;
  }

  .sm-page .sm-poster-title {
    font-size: clamp(1.35rem, 7vw, 1.85rem) !important;
  }

  .sm-page .sm-poster-credits {
    grid-template-columns: 1fr !important;
  }

  .sm-page .sm-hero h1,
  .sm-page .sm-hero p,
  .sm-page .sm-kicker,
  .smoke-page .hero .eyebrow,
  .smoke-page .hero p {
    max-width: 100% !important;
  }

  /* Contact / CF7 */
  .sm-page .wpcf7 input,
  .sm-page .wpcf7 textarea,
  .sm-page .wpcf7 select,
  .smoke-page .wpcf7 input,
  .smoke-page .wpcf7 textarea,
  .smoke-page .wpcf7 select {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 16px !important; /* prevent iOS zoom */
  }

  .sm-page table,
  .smoke-page table {
    display: block;
    width: 100%;
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  /* Kill the old 360px content cage */
  .sm-page .sm-wrap,
  .sm-wrap {
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
  }

  .smoke-page .brand,
  .sm-page .sm-brand {
    width: min(52vw, 150px) !important;
  }

  .smoke-page .hero,
  .sm-page .sm-hero {
    padding-top: 108px !important;
  }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .snm-menu-toggle__bars span {
    transition: none;
  }
}
