/**
 * Project single page — spacing, media grid, prev/next nav (all breakpoints).
 * Loaded last. Scoped to body.midz-project-page only.
 */

body.midz-project-page .midz-project-content {
  --midz-project-rail: min(1320px, calc(100% - clamp(28px, 6vw, 96px)));
}

body.midz-project-page .custom-container {
  width: var(--midz-project-rail) !important;
  max-width: var(--midz-project-rail) !important;
  margin-inline: auto !important;
  padding-inline: 0 !important;
  box-sizing: border-box !important;
}

body.midz-project-page .midz-project-secondary-track,
body.midz-project-page .midz-project-guidelines-shell.custom-container {
  width: var(--midz-project-rail) !important;
  max-width: var(--midz-project-rail) !important;
  margin-inline: auto !important;
  padding-inline: 0 !important;
  box-sizing: border-box !important;
}

body.midz-project-page .midz-project-text-block > .custom-container,
body.midz-project-page .midz-project-gallery-stack > .custom-container,
body.midz-project-page .midz-project-gallery-stack-list.custom-container,
body.midz-project-page .midz-project-research > .custom-container,
body.midz-project-page .midz-project-main-media > .custom-container,
body.midz-project-page .midz-project-more-carousel > .custom-container,
body.midz-project-page .midz-project-guidelines > .custom-container,
body.midz-project-page .midz-project-secondary-head.custom-container {
  width: var(--midz-project-rail) !important;
  max-width: var(--midz-project-rail) !important;
  margin-inline: auto !important;
  padding-inline: 0 !important;
}

/* All section labels start on the same left rail */
body.midz-project-page .midz-project-section-head,
body.midz-project-page .midz-project-secondary-head {
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.midz-project-page .midz-project-content .section-subtitle,
body.midz-project-page .midz-project-section-head .section-subtitle,
body.midz-project-page .midz-project-secondary-head .section-subtitle {
  width: auto !important;
  max-width: none !important;
  flex: none !important;
  padding: 0 !important;
  margin: 0 !important;
  justify-content: flex-start !important;
}

body.midz-project-page .midz-project-research,
body.midz-project-page .midz-project-main-media,
body.midz-project-page .midz-project-secondary,
body.midz-project-page .midz-project-text-block {
  padding-block: 0 !important;
  padding-bottom: clamp(24px, 3.5vw, 40px) !important;
}

body.midz-project-page .midz-project-text-block-inner,
body.midz-project-page .midz-project-about-text {
  max-width: 100% !important;
  width: 100% !important;
  overflow: visible !important;
  text-overflow: unset !important;
  white-space: normal !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
}

body.midz-project-page .midz-project-research {
  padding-bottom: clamp(20px, 3vw, 28px) !important;
}

body.midz-project-page .midz-project-main-media {
  padding-top: 0 !important;
  padding-bottom: clamp(16px, 2.5vw, 28px) !important;
}

body.midz-project-page .midz-project-secondary-head {
  padding-top: var(--midz-project-section-title-top) !important;
  padding-bottom: var(--midz-project-section-title-bottom) !important;
}

body.midz-project-page .midz-project-main-media + .midz-project-secondary .midz-project-secondary-head {
  padding-top: var(--midz-project-section-title-top) !important;
}

body.midz-project-page .midz-project-more-carousel .midz-project-section-head,
body.midz-project-page .midz-project-guidelines .midz-project-section-head,
body.midz-project-page .midz-project-secondary-head,
body.midz-project-page .midz-project-section-head,
body.midz-project-page .midz-project-main-media .midz-project-section-head,
body.midz-project-page .midz-project-gallery-stack > .custom-container > .midz-project-section-head {
  padding-top: var(--midz-project-section-title-top) !important;
  margin-bottom: var(--midz-project-section-title-bottom) !important;
}

body.midz-project-page .midz-project-research > .custom-container > .midz-project-section-head {
  padding-top: var(--midz-project-section-title-top, 30px) !important;
}

body.midz-project-page .midz-project-scroll-hint {
  margin-top: 18px !important;
}

/* Hero is flex — margin-inline:auto centers the block; align to same left rail as sections */
body.midz-project-page .midz-project-hero {
  justify-content: flex-start !important;
  align-items: flex-end !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin-top: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

body.midz-project-page .midz-project-hero-content.custom-container {
  width: min(1320px, 100%) !important;
  max-width: min(1320px, 100%) !important;
  margin-left: 0 !important;
  margin-right: auto !important;
  padding-inline: 0 !important;
  padding-bottom: 36px !important;
}

body.midz-project-page .midz-project-hero-media,
body.midz-project-page .midz-project-hero-media img {
  min-height: 100% !important;
  height: 100% !important;
}

body.midz-project-page .midz-project-more-carousel .midz-project-section-head,
body.midz-project-page .midz-project-guidelines .midz-project-section-head {
  padding-top: var(--midz-project-section-title-top) !important;
  margin-bottom: var(--midz-project-section-title-bottom) !important;
}

body.midz-project-page .midz-project-secondary-head,
body.midz-project-page .midz-project-section-head {
  margin-bottom: var(--midz-project-section-title-bottom) !important;
}

body.midz-project-page .midz-project-main-media .midz-project-media-frame,
body.midz-project-page .midz-project-main-media .midz-project-media-frame img,
body.midz-project-page .midz-project-main-media .midz-project-media-frame video {
  width: 100% !important;
  max-width: 100% !important;
  border-radius: clamp(14px, 1.6vw, 22px) !important;
}

body.midz-project-page .midz-project-main-media .midz-project-media-frame video {
  object-fit: contain !important;
  width: 100% !important;
  height: auto !important;
  max-height: min(78vh, 920px) !important;
  background: #080808 !important;
}

body.midz-project-page .midz-project-main-media .midz-project-media-frame.is-fit-contain img,
body.midz-project-page .midz-project-main-media .midz-project-media-frame.is-fit-contain video {
  object-fit: contain !important;
  background: #080808 !important;
  max-height: min(78vh, 920px) !important;
}

/* ── More Media: 4 desktop / 2 tablet+mobile, any count, portrait or landscape ── */
body.midz-project-page .midz-project-secondary-track {
  width: min(1320px, calc(100% - clamp(28px, 6vw, 96px))) !important;
  max-width: min(1320px, calc(100% - clamp(28px, 6vw, 96px))) !important;
  margin-inline: auto !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: clamp(14px, 1.8vw, 24px) !important;
  align-items: start !important;
}

body.midz-project-page .midz-project-secondary-track .midz-project-media-frame {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: #080808 !important;
  border-radius: clamp(12px, 1.4vw, 20px) !important;
  overflow: hidden !important;
}

body.midz-project-page .midz-project-secondary-track .midz-project-media-frame.is-portrait {
  aspect-ratio: 3 / 4 !important;
}

body.midz-project-page .midz-project-secondary-track .midz-project-media-frame.is-landscape {
  aspect-ratio: 4 / 3 !important;
}

body.midz-project-page .midz-project-secondary-track .midz-project-media-frame.is-square {
  aspect-ratio: 1 / 1 !important;
}

body.midz-project-page .midz-project-secondary-track .midz-project-media-frame.is-full {
  aspect-ratio: 16 / 9 !important;
}

body.midz-project-page .midz-project-secondary-track .midz-project-media-frame.is-story {
  aspect-ratio: 9 / 16 !important;
}

body.midz-project-page .midz-project-secondary-track .midz-project-media-frame.is-feed-portrait {
  aspect-ratio: 4 / 5 !important;
}

body.midz-project-page .midz-project-secondary-track .midz-project-media-frame:not(.is-portrait):not(.is-landscape):not(.is-square):not(.is-full):not(.is-story):not(.is-feed-portrait) {
  aspect-ratio: 1 / 1 !important;
}

body.midz-project-page .midz-project-secondary-track .midz-project-media-frame img,
body.midz-project-page .midz-project-secondary-track .midz-project-media-frame video {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

body.midz-project-page .midz-project-secondary-track .midz-project-media-frame.is-fit-contain img,
body.midz-project-page .midz-project-secondary-track .midz-project-media-frame.is-fit-contain video {
  object-fit: contain !important;
  padding: 6px !important;
  box-sizing: border-box !important;
}

/* ── Prev / Next navigation ── */
body.midz-project-page .midz-project-nav {
  padding: clamp(36px, 5vw, 56px) 0 clamp(48px, 6vw, 72px) !important;
  background: #050505 !important;
}

body.midz-project-page .midz-project-nav-inner {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
  gap: clamp(14px, 2vw, 24px) !important;
  align-items: center !important;
}

body.midz-project-page .midz-project-nav-link {
  display: flex !important;
  align-items: center !important;
  gap: clamp(10px, 1.4vw, 14px) !important;
  min-width: 0 !important;
  position: relative !important;
  overflow: hidden !important;
  padding: clamp(10px, 1.2vw, 14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: clamp(12px, 1.4vw, 16px) !important;
  background: rgba(255, 255, 255, 0.025) !important;
  text-decoration: none !important;
  color: #fff !important;
  transition: border-color 0.25s ease, background 0.25s ease !important;
}

body.midz-project-page .midz-project-nav-bg {
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  background-size: cover !important;
  background-position: center !important;
  opacity: 0.3 !important;
  pointer-events: none !important;
}

body.midz-project-page .midz-project-nav-link > :not(.midz-project-nav-bg) {
  position: relative !important;
  z-index: 1 !important;
}

body.midz-project-page .midz-project-nav-link:hover {
  border-color: rgba(255, 255, 255, 0.22) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  opacity: 1 !important;
}

body.midz-project-page .midz-project-nav-link--next {
  justify-content: flex-end !important;
  text-align: right !important;
}

body.midz-project-page .midz-project-nav-link--next .midz-project-nav-copy {
  align-items: flex-end !important;
}

body.midz-project-page .midz-project-nav-copy {
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

body.midz-project-page .midz-project-nav-title {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  font-size: clamp(14px, 1.6vw, 16px) !important;
  line-height: 1.35 !important;
  word-break: break-word !important;
}

body.midz-project-page .midz-project-nav-label {
  font-size: 10px !important;
  letter-spacing: 0.12em !important;
  white-space: nowrap !important;
}

body.midz-project-page .midz-project-nav-thumb {
  flex: 0 0 clamp(52px, 8vw, 72px) !important;
  width: clamp(52px, 8vw, 72px) !important;
  height: clamp(52px, 8vw, 72px) !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: #111 !important;
}

body.midz-project-page .midz-project-nav-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

body.midz-project-page .midz-project-nav-all {
  flex-shrink: 0 !important;
  width: clamp(46px, 7vw, 52px) !important;
  height: clamp(46px, 7vw, 52px) !important;
}

body.midz-project-page .midz-project-nav-spacer {
  display: none !important;
}

/* Tablet + mobile — prev left, center gap, next right (same row) */
@media (max-width: 991px) {
  body.midz-project-page .midz-project-secondary-track {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  body.midz-project-page .midz-project-nav-inner {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
    grid-template-areas: "prev center next" !important;
    gap: clamp(10px, 3vw, 20px) !important;
    align-items: center !important;
  }

  body.midz-project-page .midz-project-nav-all {
    grid-area: center !important;
    justify-self: center !important;
    align-self: center !important;
    width: 40px !important;
    height: 40px !important;
    flex-shrink: 0 !important;
  }

  body.midz-project-page .midz-project-nav-all img {
    width: 14px !important;
  }

  body.midz-project-page .midz-project-nav-link--prev {
    grid-area: prev !important;
    justify-content: flex-start !important;
    text-align: left !important;
  }

  body.midz-project-page .midz-project-nav-link--next {
    grid-area: next !important;
    justify-content: flex-end !important;
    text-align: right !important;
  }

  body.midz-project-page .midz-project-nav-link--next .midz-project-nav-copy {
    align-items: flex-end !important;
  }

  body.midz-project-page .midz-project-nav-link {
    flex-direction: row !important;
    align-items: center !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    min-height: 0 !important;
  }

  body.midz-project-page .midz-project-nav-link--next {
    flex-direction: row !important;
    align-items: center !important;
  }

  body.midz-project-page .midz-project-nav-thumb {
    width: 42px !important;
    height: 42px !important;
    flex: 0 0 42px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 8px !important;
  }

  body.midz-project-page .midz-project-nav-title {
    font-size: 11px !important;
    line-height: 1.25 !important;
    -webkit-line-clamp: 2 !important;
  }

  body.midz-project-page .midz-project-nav-label {
    font-size: 8px !important;
    letter-spacing: 0.1em !important;
  }

  body.midz-project-page .midz-project-nav-copy {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
}

/* More Media horizontal carousel — peek next slide, hidden scrollbar */
body.midz-project-page .midz-project-more-carousel-viewport {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  scroll-snap-type: x mandatory !important;
  scroll-behavior: smooth !important;
  cursor: grab !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  padding: 0 !important;
  container-type: inline-size !important;
  container-name: midz-carousel !important;
}

body.midz-project-page .midz-project-more-carousel-viewport::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body.midz-project-page .midz-project-more-carousel-viewport.is-dragging {
  cursor: grabbing !important;
  scroll-snap-type: none !important;
}

body.midz-project-page .midz-project-more-carousel-track .midz-project-media-frame {
  scroll-snap-align: start !important;
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: min(78vw, 360px) !important;
}

body.midz-project-page .midz-project-more-carousel-track .midz-project-media-frame.is-story {
  width: min(64vw, 300px) !important;
  max-width: 300px !important;
  aspect-ratio: 9 / 16 !important;
}

body.midz-project-page .midz-project-more-carousel-track .midz-project-media-frame.is-feed-portrait {
  width: min(70vw, 340px) !important;
  max-width: 340px !important;
  aspect-ratio: 4 / 5 !important;
}

body.midz-project-page .midz-project-more-carousel-track .midz-project-media-frame.is-portrait {
  aspect-ratio: 3 / 4 !important;
}

body.midz-project-page .midz-project-more-carousel-track .midz-project-media-frame.is-landscape {
  aspect-ratio: 4 / 3 !important;
}

body.midz-project-page .midz-project-more-carousel-track .midz-project-media-frame.is-square {
  aspect-ratio: 1 / 1 !important;
}

body.midz-project-page .midz-project-more-carousel-track .midz-project-media-frame.is-full {
  aspect-ratio: 16 / 9 !important;
}

body.midz-project-page .midz-project-more-carousel-track .midz-project-media-frame img,
body.midz-project-page .midz-project-more-carousel-track .midz-project-media-frame video {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

body.midz-project-page .midz-project-more-carousel-track .midz-project-media-frame.is-fit-contain img,
body.midz-project-page .midz-project-more-carousel-track .midz-project-media-frame.is-fit-contain video {
  object-fit: contain !important;
  background: #080808 !important;
}

@container midz-carousel (min-width: 768px) {
  body.midz-project-page .midz-project-more-carousel-track .midz-project-media-frame {
    width: calc(100cqw * 0.74 - 12px) !important;
    max-width: 440px !important;
  }

  body.midz-project-page .midz-project-more-carousel-track .midz-project-media-frame.is-story {
    width: min(calc(100cqw * 0.34 - 10px), 300px) !important;
    max-width: 300px !important;
  }

  body.midz-project-page .midz-project-more-carousel-track .midz-project-media-frame.is-feed-portrait {
    width: min(calc(100cqw * 0.4 - 10px), 340px) !important;
    max-width: 340px !important;
  }
}

@container midz-carousel (min-width: 1100px) {
  body.midz-project-page .midz-project-more-carousel-track .midz-project-media-frame {
    width: calc(100cqw * 0.72 - 14px) !important;
    max-width: 420px !important;
  }

  body.midz-project-page .midz-project-more-carousel-track .midz-project-media-frame.is-story {
    width: min(calc(100cqw * 0.26 - 8px), 300px) !important;
    max-width: 300px !important;
  }

  body.midz-project-page .midz-project-more-carousel-track .midz-project-media-frame.is-feed-portrait {
    width: min(calc(100cqw * 0.31 - 8px), 340px) !important;
    max-width: 340px !important;
  }
}

@media (max-width: 575px) {
  body.midz-project-page .midz-project-hero-content {
    padding-top: 0 !important;
    padding-bottom: 32px !important;
  }

  body.midz-project-page .midz-project-secondary-track {
    gap: 8px !important;
  }

  body.midz-project-page .midz-project-secondary-track .midz-project-media-frame.is-portrait {
    aspect-ratio: 3 / 4 !important;
  }

  body.midz-project-page .midz-project-nav-inner {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
    grid-template-areas: "prev center next" !important;
    gap: clamp(8px, 2.5vw, 14px) !important;
  }

  body.midz-project-page .midz-project-nav-link {
    padding: 7px 8px !important;
    gap: 6px !important;
  }

  body.midz-project-page .midz-project-nav-all {
    width: 36px !important;
    height: 36px !important;
  }

  body.midz-project-page .midz-project-nav-thumb {
    width: 36px !important;
    height: 36px !important;
    flex: 0 0 36px !important;
  }

  body.midz-project-page .midz-project-nav-title {
    font-size: 10px !important;
    -webkit-line-clamp: 2 !important;
  }

  body.midz-project-page .midz-project-nav-label {
    font-size: 7px !important;
  }

  body.midz-project-page .midz-project-gallery-stack > .custom-container,
  body.midz-project-page .midz-project-gallery-stack-list.custom-container {
    width: calc(100% - clamp(24px, 5vw, 32px)) !important;
    max-width: calc(100% - clamp(24px, 5vw, 32px)) !important;
  }
}

/* Large desktop */
@media (min-width: 1400px) {
  body.midz-project-page .midz-project-secondary-track {
    gap: 20px !important;
  }
}

body.midz-project-page .midz-project-hero-title {
  margin-left: 0 !important;
  padding-left: 0 !important;
  max-width: 100% !important;
}

body.midz-project-page .midz-project-hero-title.reveal-type .word,
body.midz-project-page .midz-project-hero-title.reveal-type .char {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* ── Unified section spacing (loads last) ── */
body.midz-project-page .midz-project-gallery-stack {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

body.midz-project-page .midz-project-gallery-stack-list {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

body.midz-project-page .midz-project-guidelines {
  padding-top: 0 !important;
  padding-bottom: clamp(48px, 8vw, 72px) !important;
}

body.midz-project-page .midz-project-more-carousel {
  margin-top: var(--midz-project-carousel-gap-top, clamp(32px, 5vw, 52px)) !important;
  padding-top: 0 !important;
  padding-bottom: var(--midz-project-carousel-gap-bottom, clamp(56px, 7vw, 76px)) !important;
  position: relative;
  z-index: 3;
}

body.midz-project-page .midz-project-gallery-stack > .custom-container > .midz-project-section-head,
body.midz-project-page .midz-project-more-carousel > .custom-container > .midz-project-section-head,
body.midz-project-page .midz-project-guidelines > .custom-container > .midz-project-section-head,
body.midz-project-page .midz-project-research > .custom-container > .midz-project-section-head,
body.midz-project-page .midz-project-section-head,
body.midz-project-page .midz-project-secondary-head {
  padding-top: var(--midz-project-section-title-top, 30px) !important;
  margin-bottom: var(--midz-project-section-title-bottom, 14px) !important;
}

body.midz-project-page .midz-project-more-carousel-shell {
  margin-top: 0 !important;
  padding-top: 2px !important;
}

body.midz-project-page .midz-project-guidelines {
  justify-content: flex-start !important;
}

body.midz-project-page .header-menu-wrap .custom-container {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: clamp(18px, 3vw, 40px) !important;
  padding-right: clamp(18px, 3vw, 40px) !important;
  box-sizing: border-box !important;
}

body.midz-project-page .header-menu-wrap .custom-row {
  width: 100% !important;
  align-items: center !important;
  justify-content: space-between !important;
}

body.midz-project-page .header-menu-wrap .logo {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

body.midz-project-page .header-menu-wrap .header-right-info {
  margin-left: auto !important;
  padding-right: 0 !important;
}

body.midz-project-page .header-menu-wrap .midz-header-slot-download,
body.midz-project-page .header-menu-wrap .header-right-info a[aria-label="View company portfolio"] {
  margin-right: 0 !important;
}

@media (max-width: 991px) {
  body.midz-project-page .midz-project-guidelines.is-mobile-native-guidelines {
    min-height: auto !important;
    height: auto !important;
    padding-bottom: var(--midz-project-section-pad-bottom, 40px) !important;
  }

  body.midz-project-page .midz-project-guidelines.is-mobile-native-guidelines .midz-project-guidelines-pin,
  body.midz-project-page .midz-project-guidelines.is-mobile-native-guidelines .midz-project-guidelines-shell {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    isolation: auto !important;
  }

  body.midz-project-page .midz-project-guidelines.is-mobile-native-guidelines .midz-project-guidelines-viewport {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    padding: 0 18px 6px !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-behavior: auto !important;
    scroll-padding-inline: 18px !important;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
    touch-action: pan-x pan-y !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  body.midz-project-page .midz-project-guidelines.is-mobile-native-guidelines .midz-project-guidelines-viewport::-webkit-scrollbar {
    display: none;
  }

  body.midz-project-page .midz-project-guidelines.is-mobile-native-guidelines .midz-project-guidelines-track {
    transform: none !important;
    width: max-content !important;
    gap: 14px !important;
    will-change: auto !important;
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
    padding-right: 18px !important;
  }

  body.midz-project-page .midz-project-guidelines.is-mobile-native-guidelines .midz-project-guidelines-track .midz-project-media-frame {
    flex: 0 0 min(82vw, 340px) !important;
    width: min(82vw, 340px) !important;
    max-width: min(82vw, 340px) !important;
    height: min(70dvh, 540px) !important;
    min-height: 0 !important;
    padding: 0 !important;
    scroll-snap-align: start;
    contain: layout paint;
  }

  body.midz-project-page .midz-project-guidelines.is-mobile-native-guidelines .midz-project-guidelines-track .midz-project-media-frame.is-portrait {
    height: min(78dvh, 620px) !important;
  }

  body.midz-project-page .midz-project-guidelines.is-mobile-native-guidelines .midz-project-guidelines-track .midz-project-media-frame img,
  body.midz-project-page .midz-project-guidelines.is-mobile-native-guidelines .midz-project-guidelines-track .midz-project-media-frame video {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 22px !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32) !important;
    pointer-events: auto !important;
  }

  body.midz-project-page .header-menu-wrap .custom-container {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  body.midz-project-page .midz-project-guidelines.is-mobile-native-guidelines .midz-project-guidelines-track .midz-project-media-frame:first-child {
    margin-left: 0 !important;
  }

  body.midz-project-page .midz-project-guidelines.is-mobile-native-guidelines .midz-project-guidelines-track .midz-project-media-frame:last-child {
    margin-right: 0 !important;
  }

  body.midz-project-page .midz-project-guidelines {
    padding-bottom: var(--midz-project-section-pad-bottom, 40px) !important;
  }

  body.midz-project-page .midz-project-guidelines.is-pinned-scroll {
    touch-action: pan-y pinch-zoom !important;
    overflow: visible !important;
    padding-bottom: 0 !important;
    z-index: 2 !important;
  }

  body.midz-project-page .midz-project-guidelines.is-guidelines-sticky {
    min-height: var(--midz-guidelines-span, auto) !important;
    height: auto !important;
  }

  body.midz-project-page .midz-project-guidelines-pin.is-pinned-scroll {
    touch-action: pan-y pinch-zoom !important;
    overflow: hidden !important;
    background: transparent !important;
    z-index: 2 !important;
    isolation: isolate !important;
    height: 100vh !important;
    height: 100dvh !important;
  }

  body.midz-project-page .midz-project-guidelines-pin.is-guidelines-sticky {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
  }

  body.midz-project-page .midz-project-guidelines-pin.is-pinned-scroll .midz-project-guidelines-shell {
    height: 100% !important;
  }

  body.midz-project-page .midz-project-guidelines-pin.is-guidelines-active {
    background: #050505 !important;
    z-index: 5 !important;
  }

  body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-viewport {
    overflow: hidden !important;
    touch-action: pan-y pinch-zoom !important;
    height: 100% !important;
    padding: 0 18px !important;
    display: flex !important;
    align-items: center !important;
  }

  body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
  }

  body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
  }

  body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track {
    gap: 14px !important;
    padding-right: 18px !important;
    will-change: transform !important;
  }

  body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame img,
  body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame video {
    width: auto !important;
    height: 72vh !important;
    height: 72dvh !important;
    max-width: none !important;
    max-height: 680px !important;
    object-fit: contain !important;
    border-radius: 22px !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32) !important;
    pointer-events: none !important;
  }

  body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame:first-child {
    margin-left: 0 !important;
  }

  body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame:last-child {
    margin-right: 0 !important;
  }
}

/* Keep document scroll chain intact — do not lock overflow-x on html/body (breaks touch + sticky). */
html:has(body.midz-project-page),
body.midz-project-page {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  scroll-behavior: auto !important;
  overscroll-behavior-y: auto !important;
  touch-action: pan-y pinch-zoom !important;
}

body.midz-project-page .midz-project-guidelines,
body.midz-project-page .midz-project-guidelines.is-pinned-scroll,
body.midz-project-page .midz-project-content {
  overscroll-behavior: auto !important;
}

/* More Media grid — must stay clickable for lightbox */
body.midz-project-page .midz-project-secondary-track .midz-project-media-frame,
body.midz-project-page .midz-project-secondary-track .midz-project-media-frame img {
  pointer-events: auto !important;
  cursor: zoom-in !important;
  touch-action: manipulation !important;
}

body.midz-project-page .midz-project-lightbox {
  z-index: 9800 !important;
}

@media (min-width: 992px) {
  body.midz-lightbox-open #magic-cursor {
    z-index: 10001 !important;
  }
}

/* Phone-only Acadio portrait treatment. Keep tablet and desktop unchanged. */
@media (max-width: 575px) {
  body.midz-project-page .midz-project-guidelines-track .midz-project-responsive-media {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    height: 72vh;
    height: 72svh;
    max-height: 680px;
  }

  body.midz-project-page .midz-project-guidelines-pin.is-pinned-scroll {
    height: 100vh !important;
    height: 100svh !important;
    background: #050505 !important;
    z-index: 5 !important;
  }

  body.midz-project-page .midz-project-guidelines-track {
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
  }

  body.midz-project-page .midz-project-guidelines-pin.is-guidelines-active {
    background: #050505 !important;
  }

  body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame,
  body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame {
    flex: 0 0 min(84vw, 352px) !important;
    width: min(84vw, 352px) !important;
    max-width: min(84vw, 352px) !important;
    height: 100% !important;
    padding: 0 5px !important;
    contain: layout paint;
  }

  body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame img,
  body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame video,
  body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame img,
  body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame video {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 680px !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 18px !important;
  }

  body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame:first-child {
    padding-left: 0 !important;
  }

  body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame:last-child {
    padding-right: 0 !important;
  }
}

/* Header over hero — transparent, no black strip */
body.midz-project-page.single-project .header-menu-wrap {
  position: fixed !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  background: transparent !important;
}

body.midz-project-page .header-menu-wrap .menu a {
  color: #fff !important;
}

body.midz-project-page .midz-project-hero {
  margin-top: 0 !important;
}

@media (min-width: 992px) {
  body.midz-project-page .header-menu-wrap .custom-container {
    padding-left: clamp(24px, 4vw, 72px) !important;
    padding-right: clamp(24px, 4vw, 72px) !important;
  }
}

/* Final project-page fixes: mobile media containment, hero edge bleed, and smoother guidelines */
body.midz-project-page .midz-project-hero {
  overflow: hidden !important;
}

body.midz-project-page .midz-project-hero-media {
  inset: 0 -2px !important;
  width: auto !important;
  transform: translateZ(0) !important;
}

body.midz-project-page .midz-project-hero-media img,
body.midz-project-page .midz-project-hero-media picture {
  width: 100% !important;
  height: 100% !important;
}

body.midz-project-page .midz-project-hero-overlay {
  inset: 0 -2px !important;
}

body.midz-project-page .midz-project-guidelines,
body.midz-project-page .midz-project-guidelines.is-pinned-scroll {
  background: #050505 !important;
}

body.midz-project-page .midz-project-guidelines-pin.is-pinned-scroll {
  height: 100vh !important;
  height: 100svh !important;
  overflow: hidden !important;
}

body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-shell {
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
}

body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-viewport {
  overflow: hidden !important;
}

body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track {
  will-change: transform !important;
}

@media (min-width: 992px) {
  body.midz-project-page .midz-project-hero-media {
    inset: 0 -12px !important;
  }

  body.midz-project-page .midz-project-hero-overlay {
    inset: 0 -12px !important;
  }
}

@media (max-width: 575px) {
  body.midz-project-page .midz-project-gallery-stack-list .midz-project-media-frame,
  body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame,
  body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame {
    background: #080808 !important;
  }

  body.midz-project-page .midz-project-gallery-stack-list .midz-project-responsive-media,
  body.midz-project-page .midz-project-guidelines-track .midz-project-responsive-media,
  body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-responsive-media {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
  }

  body.midz-project-page .midz-project-gallery-stack-list .midz-project-media-frame img,
  body.midz-project-page .midz-project-gallery-stack-list .midz-project-media-frame video,
  body.midz-project-page .midz-project-gallery-stack-list .midz-project-media-frame picture img,
  body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame img,
  body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame video,
  body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame picture img,
  body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame img,
  body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame video,
  body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame picture img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: #080808 !important;
  }
}

/* Hard override: Acadio-like guideline panels + hero alpha fill */
body.midz-project-page .midz-project-hero,
body.midz-project-page .midz-project-hero-media {
  background: rgb(var(--midz-project-accent-rgb)) !important;
}

body.midz-project-page .midz-project-hero-media img,
body.midz-project-page .midz-project-hero-media picture,
body.midz-project-page .midz-project-hero-media picture img {
  background: transparent !important;
}

body.midz-project-page .midz-project-guidelines,
body.midz-project-page .midz-project-guidelines.is-pinned-scroll {
  position: relative !important;
  overflow: visible !important;
  background: #050505 !important;
}

body.midz-project-page .midz-project-guidelines-pin,
body.midz-project-page .midz-project-guidelines-pin.is-pinned-scroll {
  width: 100% !important;
  overflow: hidden !important;
  background: #050505 !important;
}

body.midz-project-page .midz-project-guidelines-shell,
body.midz-project-page .midz-project-guidelines-pin.is-pinned-scroll .midz-project-guidelines-shell {
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  min-width: 0 !important;
}

body.midz-project-page .midz-project-guidelines-viewport,
body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-viewport {
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 clamp(18px, 3vw, 32px) !important;
  box-sizing: border-box !important;
}

body.midz-project-page .midz-project-guidelines-track,
body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: clamp(10px, 1.4vw, 18px) !important;
  width: max-content !important;
  will-change: transform !important;
}

body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame,
body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  height: min(78vh, 720px) !important;
  min-height: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 22px !important;
  background: #080808 !important;
  overflow: hidden !important;
}

body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame.is-portrait,
body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame.is-portrait {
  height: min(82vh, 760px) !important;
}

body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame.is-full,
body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame.is-full {
  height: min(72vh, 660px) !important;
}

body.midz-project-page .midz-project-guidelines-track .midz-project-responsive-media,
body.midz-project-page .midz-project-guidelines-track picture,
body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-responsive-media,
body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track picture {
  display: block !important;
  width: auto !important;
  height: 100% !important;
  flex: 0 0 auto !important;
}

body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame img,
body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame video,
body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame picture img,
body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame img,
body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame video,
body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame picture img {
  width: auto !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
  display: block !important;
  background: #080808 !important;
}

body.midz-project-page .midz-project-guidelines.is-pinned-scroll {
  min-height: var(--midz-guidelines-span, auto) !important;
  height: auto !important;
}

@media (max-width: 575px) {
  body.midz-project-page .midz-project-guidelines-viewport,
  body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-viewport {
    padding: 0 18px !important;
  }

  body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame,
  body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame {
    height: min(72svh, 620px) !important;
    border-radius: 18px !important;
  }

  body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame.is-portrait,
  body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame.is-portrait {
    height: min(78svh, 680px) !important;
  }

  body.midz-project-page .midz-project-guidelines-track .midz-project-media-frame.is-full,
  body.midz-project-page .midz-project-guidelines.is-pinned-scroll .midz-project-guidelines-track .midz-project-media-frame.is-full {
    height: min(66svh, 560px) !important;
  }
}
