/*
 * Final mobile refinement layer.
 * Kept separate from the legacy responsive rules so one predictable file owns
 * the compact phone layout without changing the desktop design.
 */

.sez-mobile-menu__logo {
  display: inline-flex;
  width: 118px;
  height: 49px;
  align-items: center;
  color: var(--sez-ink);
}

.sez-mobile-menu__logo .sez-electric-logo {
  width: 100%;
  height: 100%;
}

/* Project lightbox controls follow the same square, high-contrast system. */
.fancybox-button,
.fancybox-navigation .fancybox-button {
  width: 44px;
  height: 44px;
  padding: 11px;
  border: 1px solid rgb(255 255 255 / 66%);
  border-radius: 0;
  background: rgb(32 37 43 / 92%);
  color: #fff;
  box-shadow: none;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.fancybox-button:hover,
.fancybox-navigation .fancybox-button:hover {
  border-color: var(--sez-accent);
  background: var(--sez-accent);
  color: #fff;
}

.fancybox-button svg {
  width: 18px;
  height: 18px;
}

.fancybox-toolbar :is(
  .fancybox-button--zoom,
  .fancybox-button--play,
  .fancybox-button--pause,
  .fancybox-button--fullscreen,
  .fancybox-button--thumbs,
  .fancybox-button--share,
  .fancybox-button--download
) {
  display: none;
}

@media (max-width: 767px) {
  :root {
    --sez-mobile-card-title: 14px;
    --sez-mobile-card-copy: 11px;
  }

  html,
  body {
    width: 100%;
    max-width: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  /*
   * 16px is intentional: iOS zooms the visual viewport when a smaller form
   * control receives focus.
   */
  :where(input, textarea, select) {
    font-size: 16px;
  }

  /* The first screen always occupies the real visual viewport. */
  .sez-home .sez-hero,
  .sez-home .sez-hero__slides,
  .sez-home .sez-hero__slide,
  .sez-home .sez-hero__media {
    width: 100dvw;
    min-width: 100dvw;
    height: 100dvh;
    min-height: 100svh;
  }

  .sez-home .sez-hero {
    max-width: none;
    overflow: hidden;
  }

  .sez-home .sez-hero__media {
    position: absolute;
    inset: 0;
    max-width: none;
  }

  .sez-home .sez-hero__media :is(img, video) {
    width: 100%;
    min-width: 100%;
    height: 100%;
    min-height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
  }

  /* Burger menu: the brand remains visible beside the close control. */
  .sez-mobile-menu__head {
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0 8px;
  }

  .sez-mobile-menu__logo {
    width: 108px;
    height: 45px;
    flex: 0 0 108px;
  }

  /* Leadership copy is deliberately quieter than the surrounding headings. */
  .sez-brand-director__quote,
  .sez-brand-director__quote blockquote,
  .sez-brand-director blockquote {
    min-height: 0;
  }

  .sez-brand-director__quote {
    padding: 18px;
  }

  .sez-brand-director__quote blockquote,
  .sez-brand-director blockquote {
    margin: 0 0 15px;
    font-size: 14px;
    line-height: 1.46;
  }

  .sez-brand-director__quote :is(cite, strong, small) {
    font-size: 10px;
    line-height: 1.4;
  }

  /* Mobile documents are the actual A4 previews, not oversized text cards. */
  .sez-about-documents {
    overflow: visible;
  }

  .sez-about-documents__label {
    display: none;
  }

  .sez-about-documents__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .sez-about-documents__grid .sez-about-document {
    min-width: 0;
    min-height: 0;
    aspect-ratio: 210 / 297;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
  }

  .sez-about-documents__grid .sez-about-document > :is(i, strong) {
    display: none;
  }

  .sez-about-documents__grid .sez-about-document .sez-about-document__preview {
    position: static;
    display: block;
    width: 100%;
    height: 100%;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: none;
  }

  .sez-about-document__preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }

  /*
   * Homepage services become an optional horizontal rail. The form card is
   * omitted here because the same complete form is available immediately
   * below the content and cannot remain usable inside a 300px swipe card.
   */
  .sez-home .sez-service-mosaic.sez-service-stack {
    display: grid;
    width: calc(100% + var(--sez-gutter));
    max-width: none;
    grid-auto-columns: min(76vw, 286px);
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-template-rows: 1fr;
    gap: 10px;
    margin: 0 calc(var(--sez-gutter) * -1) 0 0;
    padding: 0 var(--sez-gutter) 2px 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .sez-home .sez-service-mosaic.sez-service-stack::-webkit-scrollbar {
    display: none;
  }

  .sez-home .sez-service-stack .sez-service-tile {
    position: relative;
    top: auto;
    display: flex;
    width: auto;
    min-width: 0;
    min-height: 252px;
    height: 252px;
    margin: 0;
    padding: 12px;
    overflow: hidden;
    flex-direction: column;
    justify-content: flex-end;
    border: 1px solid var(--sez-line);
    background: var(--sez-white);
    color: var(--sez-ink);
    box-shadow: none;
    scroll-snap-align: start;
  }

  .sez-home .sez-service-stack .sez-service-tile--form {
    display: none;
  }

  .sez-home .sez-service-tile__media,
  .sez-home .sez-service-tile--enclosure .sez-service-tile__media,
  .sez-home .sez-service-tile__media--brand {
    position: absolute;
    z-index: 0;
    inset: 27px 8px 60px;
    display: grid;
    width: auto;
    height: auto;
    place-items: center;
    overflow: hidden;
    background: transparent;
    opacity: 1;
    transform: none;
  }

  .sez-home .sez-service-tile__media :is(img, video),
  .sez-home .sez-service-tile__asset,
  .sez-home .sez-service-tile__media--brand img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
  }

  .sez-home .sez-service-tile__shade {
    display: none;
  }

  .sez-home .sez-service-tile__index {
    z-index: 2;
    top: 13px;
    left: 13px;
    color: var(--sez-muted);
    font-size: 9px;
  }

  .sez-home .sez-service-tile > strong,
  .sez-home .sez-service-stack .sez-service-tile > strong {
    position: relative;
    z-index: 2;
    max-width: 100%;
    margin: 0;
    color: var(--sez-ink);
    font-size: 13px;
    line-height: 1.25;
  }

  .sez-home .sez-service-tile .sez-card-detail {
    display: none;
  }

  /* Services archive: one compact, predictable card in every row. */
  .sez-service-archive {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-flow: row;
    grid-auto-rows: auto;
  }

  .sez-service-archive__card,
  .sez-service-archive__card.is-wide,
  .sez-service-archive__card.is-full,
  .sez-service-archive__card--enclosure {
    min-height: 280px;
    grid-column: 1;
    padding: 14px;
    padding-right: 14px;
    background: var(--sez-white);
    color: var(--sez-ink);
  }

  .sez-service-archive__media,
  .sez-service-archive__card--enclosure .sez-service-archive__media {
    z-index: -1;
    inset: 34px 9px 68px;
    display: grid;
    place-items: center;
    background: transparent;
    opacity: 1;
  }

  .sez-service-archive__media :is(img, video),
  .sez-service-archive__card--enclosure .sez-service-archive__media :is(img, video) {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }

  .sez-service-archive__shade {
    display: none;
  }

  .sez-service-archive__index,
  .sez-service-archive__card--media-full .sez-service-archive__index,
  .sez-service-archive__card--mounting .sez-service-archive__index {
    top: 13px;
    left: 13px;
    color: var(--sez-muted);
    font-size: 9px;
  }

  .sez-service-archive__card strong {
    position: relative;
    z-index: 2;
    max-width: 100%;
    color: var(--sez-ink);
    font-size: var(--sez-mobile-card-title);
    line-height: 1.25;
  }

  .sez-service-archive__card .sez-card-detail {
    display: none;
  }

  /* Product naming follows the shared compact mobile type scale. */
  .sez-product-tile strong,
  .sez-category-card__title,
  .sez-product-card__body h2,
  .sez-catalog-card__title,
  .sez-shop-card__title,
  .sez-commerce-card__title {
    font-size: var(--sez-mobile-card-title);
    line-height: 1.24;
  }

  .sez-product-tile__media :is(img, video),
  .sez-category-card__media :is(img, video),
  .sez-catalog-card__media :is(img, video) {
    object-fit: contain;
    object-position: center;
  }

  .single-sez_product .sez-page-hero h1,
  .single-sez_product .sez-product-hero h1,
  .single-sez_product .sez-nku-hero h1 {
    font-size: clamp(22px, 7vw, 27px);
    line-height: 1.12;
  }

  /* Project cards retain a 3:4 cover but lose excess copy height. */
  .sez-feed-card--project {
    --project-body-height: 132px;
    grid-template-rows: auto var(--project-body-height);
  }

  .sez-feed-card--project .sez-feed-card__media {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .sez-feed-card--project .sez-feed-card__media :is(img, video) {
    object-fit: cover;
    object-position: center;
  }

  .sez-feed-card--project .sez-feed-card__body {
    height: var(--project-body-height);
    padding: 12px;
  }

  .sez-feed-card--project .sez-feed-card__body h3 {
    font-size: 13px;
    line-height: 1.22;
  }

  .sez-feed-card--project .sez-feed-card__body :is(p, span, small) {
    font-size: 9px;
    line-height: 1.38;
  }

  .sez-project-showcase {
    height: 296px;
    grid-template-columns: minmax(0, 42%) minmax(0, 58%);
  }

  .sez-project-showcase__content {
    padding: 9px;
  }

  .sez-project-showcase__title {
    min-height: 2.35em;
    font-size: 12px;
    line-height: 1.18;
  }

  .sez-project-showcase__gallery {
    --project-showcase-gallery-height: 86px;
    margin: 7px 0 0;
  }

  .sez-project-showcase__gallery-track {
    align-items: stretch;
    gap: 5px;
  }

  .sez-project-showcase__gallery-item {
    height: 100%;
  }

  .sez-project-showcase__gallery-item :is(img, video) {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .sez-project-showcase__footer {
    min-height: 72px;
    padding-top: 7px;
  }

  .sez-project-showcase__client {
    min-height: 26px;
    gap: 6px;
    font-size: 9px;
  }

  .sez-project-showcase__logo {
    width: 66px;
    height: 24px;
    flex-basis: 66px;
  }

  .sez-project-showcase__footer p {
    margin-top: 5px;
    font-size: 8px;
    line-height: 1.35;
    -webkit-line-clamp: 2;
  }

  .sez-project-showcase__year {
    top: 9px;
    right: 9px;
    font-size: 8px;
  }

  /* Hide native controls on decorative autoplay media only. */
  :where(.sez-home, .sez-service-archive, .sez-project-showcase) video[autoplay]::-webkit-media-controls,
  :where(.sez-home, .sez-service-archive, .sez-project-showcase) video[data-sez-autoplay]::-webkit-media-controls {
    display: none;
  }

  :where(.sez-home, .sez-service-archive, .sez-project-showcase) video[autoplay],
  :where(.sez-home, .sez-service-archive, .sez-project-showcase) video[data-sez-autoplay] {
    pointer-events: none;
  }

  /* Footer accordions start directly after the intro and stay evenly spaced. */
  .sez-footer {
    padding-top: 28px;
  }

  .sez-footer__top {
    margin-bottom: 10px;
  }

  .sez-footer__grid > :first-child {
    border-top: 0;
  }

  .sez-footer__grid > .sez-footer__products-nav {
    margin: 0;
    padding-top: 0;
    border-top: 1px solid rgb(255 255 255 / 22%);
  }

  .sez-footer__accordion-toggle {
    min-height: 44px;
  }

  /* Square compact controls in both project viewers. */
  .fancybox-button,
  .fancybox-navigation .fancybox-button {
    width: 38px;
    height: 38px;
    padding: 9px;
  }
}

@media (max-width: 380px) {
  .sez-home .sez-service-mosaic.sez-service-stack {
    grid-auto-columns: 78vw;
  }

  .sez-home .sez-service-stack .sez-service-tile {
    min-height: 236px;
    height: 236px;
  }

  .sez-project-showcase {
    height: 274px;
  }

  .sez-project-showcase__gallery {
    --project-showcase-gallery-height: 74px;
  }
}

@media (orientation: landscape) and (max-height: 560px) and (pointer: coarse) {
  .sez-home .sez-hero,
  .sez-home .sez-hero__slides,
  .sez-home .sez-hero__slide,
  .sez-home .sez-hero__media {
    height: 100dvh;
    min-height: 100dvh;
  }
}
