/* MuPiBox visual refinements · 2.8.1
 * Shared responsive polish after the image-led redesign.
 */

/* Consistent card geometry for cards that start with an illustration. */
body.mupibox-site .mupi-card {
  --mupi-card-pad: clamp(1.35rem,3vw,2rem);
}
body.mupibox-site .mupi-card > .mupi-card-art {
  margin: calc(-1 * var(--mupi-card-pad)) calc(-1 * var(--mupi-card-pad)) 1.05rem;
}
body.mupibox-site .mupi-classic-hub-card > .mupi-card-art {
  margin: -1.35rem -1.35rem 1rem;
}
body.mupibox-site .mupi-support-hero-card > div > .mupi-card-art {
  min-height: 94px;
  margin: 0 0 1rem;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 15px;
}

/* Keep text blocks readable instead of stretching across wide cards. */
body.mupibox-site .mupi-card > p,
body.mupibox-site .mupi-choice-card > p,
body.mupibox-site .mupi-topic-card > p,
body.mupibox-site .mupi-product-card p {
  max-width: 68ch;
}
body.mupibox-site .mupi-section-heading {
  max-width: 840px;
}
body.mupibox-site .mupi-section-heading--split {
  max-width: none;
}

/* Visual heroes: stable geometry, safe cropping and less dead space. */
body.mupibox-site .mupi-visual-hero__art,
body.mupibox-site .mupi-page-hero__panel {
  isolation: isolate;
}
body.mupibox-site .mupi-visual-hero__art > img.mupi-visual-photo {
  position: absolute;
  inset: 0;
}
body.mupibox-site .mupi-visual-hero__caption,
body.mupibox-site .mupi-page-hero__caption {
  z-index: 5;
}
body.mupibox-site .mupi-visual-photo-card img,
body.mupibox-site .mupi-photo-card__media img,
body.mupibox-site .mupi-info-community-collage img,
body.mupibox-site .mupi-project-hero-collage img,
body.mupibox-site .mupi-home-hero__photo {
  object-position: center;
}

/* Make all expandable technical detail rows comfortable touch targets. */
body.mupibox-site .mupi-detail-fold summary,
body.mupibox-site .mupi-hw-details summary,
body.mupibox-site .mupi-mupihat-details summary,
body.mupibox-site .mupi-install-fallback > summary,
body.mupibox-site details.mupi-faq-item > summary {
  min-height: 52px;
}
body.mupibox-site details > summary {
  -webkit-tap-highlight-color: transparent;
}

/* Reference tables keep their context while horizontally scrolling. */
body.mupibox-site .mupi-reference-table-wrap,
body.mupibox-site .mupi-comparison-wrap {
  scrollbar-width: thin;
  scrollbar-color: rgba(126,211,255,.45) rgba(255,255,255,.04);
}
body.mupibox-site .mupi-reference-table th:first-child,
body.mupibox-site .mupi-reference-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
}
body.mupibox-site .mupi-reference-table th:first-child {
  z-index: 2;
}
body.mupibox-site .mupi-reference-table td:first-child {
  background: #111722;
}

/* Showroom: predictable crop and less jumping between cards. */
body.mupibox-site .mupibox-showroom-entry__main {
  aspect-ratio: 4 / 3;
}
body.mupibox-site .mupibox-showroom-entry__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body.mupibox-site .mupibox-showroom-entry__body p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

/* NG preview blocks should not look empty on wide displays. */
body.mupibox-site .mupi-ng-preview__mock {
  min-height: 235px;
}
body.mupibox-site .mupi-ng-preview__mockcontent {
  min-height: 150px;
}

/* Hardware illustrations and product images stay proportional. */
body.mupibox-site .mupi-hw-visual,
body.mupibox-site .mupi-hw-art {
  width: 100%;
}
body.mupibox-site .mupi-hw-catalog-card,
body.mupibox-site .mupi-hw-start-card {
  overflow: hidden;
}
body.mupibox-site .mupi-hw-details > div {
  color: var(--mupi-text-muted);
}

/* Blog cards: consistent image height but natural body height. */
body.mupibox-site .mupi-blog-card__body {
  min-height: 235px;
}

/* 404 should look like the rest of the visual system. */
body.mupibox-site .mupibox-page--404 .mupi-404-visual {
  margin-top: 1.25rem;
}
body.mupibox-site .mupibox-page--404 .mupi-card {
  overflow: hidden;
}

/* Tablet: keep useful two-column layouts instead of collapsing too early. */
@media (min-width: 641px) and (max-width: 921px) {
  body.mupibox-site .mupi-grid--3,
  body.mupibox-site .mupi-grid--4 {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  body.mupibox-site .mupi-choice-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  body.mupibox-site .mupi-feature-ribbon {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  body.mupibox-site .mupi-page-hero__grid,
  body.mupibox-site .mupi-visual-hero__grid {
    gap: 1.6rem;
  }

  body.mupibox-site .mupi-page-hero__panel,
  body.mupibox-site .mupi-visual-hero__art {
    min-height: 340px;
  }

  body.mupibox-site .mupi-home-hero__visual--collage {
    min-height: 420px;
  }

  body.mupibox-site .mupi-classic-hub-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
  body.mupibox-site .mupi-classic-hub-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  body.mupibox-site .mupi-reference-gallery {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  body.mupibox-site .mupi-blog-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

/* Mobile: content first, visual second, without oversized art blocks. */
@media (max-width: 640px) {
  body.mupibox-site .mupi-card {
    --mupi-card-pad: 1.15rem;
  }

  body.mupibox-site .mupi-info-hero,
  body.mupibox-site .mupi-secondary-hero,
  body.mupibox-site .mupi-showroom-hero,
  body.mupibox-site .mupi-donate-hero,
  body.mupibox-site .mupi-blog-hero {
    padding-block: 2.35rem 2.75rem;
  }

  body.mupibox-site .mupi-visual-hero__grid,
  body.mupibox-site .mupi-page-hero__grid {
    gap: 1.35rem;
  }

  body.mupibox-site .mupi-visual-hero__art {
    min-height: 255px;
    border-radius: 20px;
  }

  body.mupibox-site .mupi-visual-hero__caption,
  body.mupibox-site .mupi-page-hero__caption {
    left: .7rem;
    right: .7rem;
    bottom: .7rem;
    padding: .65rem .75rem;
  }

  body.mupibox-site .mupi-visual-hero__caption span,
  body.mupibox-site .mupi-page-hero__caption span {
    font-size: .72rem;
    line-height: 1.35;
  }

  body.mupibox-site .mupi-info-hero h1,
  body.mupibox-site .mupi-blog-hero h1,
  body.mupibox-site .mupi-donate-hero h1 {
    max-width: none;
    font-size: clamp(2.45rem,12.5vw,3.45rem);
    line-height: .98;
  }

  body.mupibox-site .mupi-info-hero p,
  body.mupibox-site .mupi-blog-hero p,
  body.mupibox-site .mupi-donate-hero p {
    font-size: 1rem;
    line-height: 1.55;
  }

  body.mupibox-site .mupi-home-hero__visual--collage {
    min-height: 335px;
  }
  body.mupibox-site .mupi-home-hero__collage {
    inset: .55rem .55rem 4.9rem;
  }
  body.mupibox-site .mupi-home-hero__photo--one {
    width: 65% !important;
    height: 57%;
  }
  body.mupibox-site .mupi-home-hero__photo--two {
    width: 45% !important;
    height: 45%;
  }
  body.mupibox-site .mupi-home-hero__photo--three {
    width: 58% !important;
    height: 42%;
  }

  body.mupibox-site .mupi-ng-device-panel,
  body.mupibox-site .mupi-install-hero__panel,
  body.mupibox-site .mupi-mupihat-hero__visual,
  body.mupibox-site .mupi-classic-hero-visual {
    min-height: 350px !important;
  }

  body.mupibox-site .mupi-ng-device {
    width: 100%;
    border-width: 6px;
    border-radius: 20px;
  }

  body.mupibox-site .mupi-install-device {
    min-height: 195px;
  }
  body.mupibox-site .mupi-install-device__screen {
    width: 100%;
    padding: 1.35rem;
    border-width: 6px;
    border-radius: 19px;
  }
  body.mupibox-site .mupi-install-flow {
    gap: .12rem;
  }
  body.mupibox-site .mupi-install-flow b {
    width: 29px;
    height: 29px;
    font-size: .76rem;
  }

  body.mupibox-site .mupi-hw-hero-stage {
    min-height: 305px;
  }
  body.mupibox-site .mupi-hw-box {
    width: 94%;
    border-radius: 20px;
    transform: none;
  }
  body.mupibox-site .mupi-hw-float {
    padding: .5rem .6rem;
  }
  body.mupibox-site .mupi-hw-float strong {
    font-size: .72rem;
  }
  body.mupibox-site .mupi-hw-float span {
    font-size: .61rem;
  }
  body.mupibox-site .mupi-hw-float--pi {
    left: .2rem;
    top: 2%;
  }
  body.mupibox-site .mupi-hw-float--rfid {
    right: .2rem;
    top: 7%;
  }
  body.mupibox-site .mupi-hw-float--power {
    left: .5rem;
    bottom: 1%;
  }

  body.mupibox-site .mupi-info-art-stack,
  body.mupibox-site .mupi-info-art-chat,
  body.mupibox-site .mupi-project-hero-collage,
  body.mupibox-site .mupi-info-community-collage {
    height: 205px;
  }

  body.mupibox-site .mupi-info-art-versus {
    width: 96%;
    gap: .45rem;
  }
  body.mupibox-site .mupi-info-art-versus__classic,
  body.mupibox-site .mupi-info-art-versus__ng {
    min-height: 145px;
    padding: .45rem;
    font-size: .88rem;
  }

  body.mupibox-site .mupi-card-art {
    min-height: 94px;
  }
  body.mupibox-site .mupi-card-art__tile {
    min-width: 46px;
    min-height: 46px;
    border-radius: 12px;
    font-size: .8rem;
  }

  body.mupibox-site .mupi-photo-card__media {
    height: 150px;
  }

  body.mupibox-site .mupi-classic-hub-card {
    padding: 1.15rem;
  }
  body.mupibox-site .mupi-classic-hub-card > .mupi-card-art {
    margin: -1.15rem -1.15rem .9rem;
  }

  body.mupibox-site .mupi-doc-visual {
    display: flex;
    overflow-x: auto;
    gap: .5rem;
    padding-bottom: .25rem;
    scroll-snap-type: x proximity;
  }
  body.mupibox-site .mupi-doc-visual span {
    flex: 0 0 145px;
    min-height: 58px;
    scroll-snap-align: start;
  }

  body.mupibox-site .mupi-reference-table {
    min-width: 620px;
  }
  body.mupibox-site .mupi-reference-table th,
  body.mupibox-site .mupi-reference-table td {
    padding: .72rem .78rem;
    font-size: .84rem;
  }

  body.mupibox-site .mupi-reference-gallery figure {
    padding: .55rem;
  }

  body.mupibox-site .mupibox-showroom-entry__main {
    aspect-ratio: 1 / .82;
  }
  body.mupibox-site .mupibox-showroom-entry__body p {
    -webkit-line-clamp: 3;
  }

  body.mupibox-site .mupi-blog-card__media {
    height: 185px;
  }
  body.mupibox-site .mupi-blog-card__body {
    min-height: 0;
  }

  body.mupibox-site .mupi-community-map {
    min-height: 430px;
    border-radius: 18px;
  }

  body.mupibox-site .mupi-map-filters {
    padding: .7rem;
    border-radius: 15px;
  }
}

/* Very small phones: prevent decorative elements from stealing space. */
@media (max-width: 390px) {
  body.mupibox-site .mupi-visual-hero__art {
    min-height: 230px;
  }

  body.mupibox-site .mupi-home-hero__visual--collage {
    min-height: 305px;
  }

  body.mupibox-site .mupi-ng-device__mascot,
  body.mupibox-site .mupi-home-hero__mascot {
    display: none;
  }

  body.mupibox-site .mupi-hw-float span {
    display: none;
  }

  body.mupibox-site .mupi-info-art-stack span {
    font-size: .8rem;
  }
}

/* Motion should never be required to understand the page. */
@media (prefers-reduced-motion: reduce) {
  body.mupibox-site *,
  body.mupibox-site *::before,
  body.mupibox-site *::after {
    scroll-behavior: auto !important;
  }

  body.mupibox-site .mupibox-showroom-entry__main img,
  body.mupibox-site .mupi-blog-card__media img {
    transition: none !important;
  }
}


/* 2.8.2 real-photo pass */
body.mupibox-site .mupi-hw-art--photo {
  display:grid;
  min-height:180px;
  place-items:center;
  background:
    radial-gradient(circle at 50% 35%,rgba(255,208,120,.09),transparent 55%),
    #0f1622;
}
body.mupibox-site .mupi-hw-art--photo img {
  display:block;
  width:100%;
  height:100%;
  min-height:180px;
  object-fit:contain;
  padding:.7rem;
}

body.mupibox-site .mupi-classic-ui-gallery {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:.8rem;
  margin:1.5rem 0 2.5rem;
}
body.mupibox-site .mupi-classic-ui-gallery figure {
  margin:0;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  background:#111722;
  box-shadow:0 14px 32px rgba(0,0,0,.18);
}
body.mupibox-site .mupi-classic-ui-gallery img {
  display:block;
  width:100%;
  aspect-ratio:5/3;
  object-fit:cover;
  background:#080d14;
}
body.mupibox-site .mupi-classic-ui-gallery figcaption {
  padding:.7rem .8rem .8rem;
  color:#aeb7c5;
  font-size:.78rem;
  line-height:1.4;
}

body.mupibox-site .mupi-classic-docs-photo-strip {
  padding:1rem 0 0;
  background:#090e17;
}
body.mupibox-site .mupi-classic-docs-photo-strip__grid {
  display:grid;
  grid-template-columns:1fr 1.35fr 1fr;
  gap:.7rem;
}
body.mupibox-site .mupi-classic-docs-photo-strip figure {
  min-height:190px;
  margin:0;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  background:#111722;
}
body.mupibox-site .mupi-classic-docs-photo-strip img {
  width:100%;
  height:100%;
  object-fit:cover;
}
body.mupibox-site .mupi-classic-docs-photo-strip figure:first-child img,
body.mupibox-site .mupi-classic-docs-photo-strip figure:last-child img {
  object-fit:contain;
  padding:.55rem;
}

body.mupibox-site .mupi-shopping-photo {
  display:grid;
  height:150px;
  margin:-1.25rem -1.25rem 1rem;
  place-items:center;
  overflow:hidden;
  border-bottom:1px solid rgba(255,255,255,.08);
  background:#0f1622;
}
body.mupibox-site .mupi-shopping-photo img {
  width:100%;
  height:100%;
  object-fit:cover;
}
body.mupibox-site .mupi-shopping-photo--contain img {
  object-fit:contain;
  padding:.55rem;
}
body.mupibox-site .mupi-photo-card__media--contain img {
  object-fit:contain;
  padding:.55rem;
  background:#0f1622;
}

body.mupibox-site .mupi-choice-card--photo {
  overflow:hidden;
}
body.mupibox-site .mupi-choice-card__photo {
  height:150px;
  margin:0 calc(-1 * clamp(1.3rem,2.6vw,1.8rem)) 1rem;
  overflow:hidden;
  border-bottom:1px solid rgba(255,255,255,.08);
  background:#0f1622;
}
body.mupibox-site .mupi-choice-card__photo img {
  width:100%;
  height:100%;
  object-fit:contain;
  padding:.5rem;
}
body.mupibox-site .mupi-choice-card__photo--ui img {
  object-fit:cover;
  padding:0;
}

body.mupibox-site .mupi-download-card__visual--photo {
  height:145px;
  overflow:hidden;
  padding:0;
}
body.mupibox-site .mupi-download-card__visual--photo img {
  width:100%;
  height:100%;
  object-fit:cover;
}
body.mupibox-site .mupi-download-card__visual--ng i {
  color:#778396;
  font-style:normal;
  font-size:1.3rem;
}

@media (max-width: 921px) {
  body.mupibox-site .mupi-classic-ui-gallery {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  body.mupibox-site .mupi-classic-ui-gallery figure:last-child {
    grid-column:1 / -1;
  }
}

@media (max-width: 640px) {
  body.mupibox-site .mupi-hw-art--photo,
  body.mupibox-site .mupi-hw-art--photo img {
    min-height:145px;
  }

  body.mupibox-site .mupi-classic-ui-gallery {
    grid-template-columns:1fr;
    gap:.65rem;
    margin:1rem 0 1.8rem;
  }
  body.mupibox-site .mupi-classic-ui-gallery figure:last-child {
    grid-column:auto;
  }

  body.mupibox-site .mupi-classic-docs-photo-strip__grid {
    grid-template-columns:1fr 1fr;
  }
  body.mupibox-site .mupi-classic-docs-photo-strip figure {
    min-height:140px;
  }
  body.mupibox-site .mupi-classic-docs-photo-strip figure:nth-child(2) {
    grid-column:1 / -1;
    grid-row:1;
  }

  body.mupibox-site .mupi-shopping-photo,
  body.mupibox-site .mupi-choice-card__photo,
  body.mupibox-site .mupi-download-card__visual--photo {
    height:125px;
  }
}


/* 2.8.3 legacy content gets the same visual entrance */
body.mupibox-site.mupibox-legacy-page:not(.page-id-3):not(.page-id-351):not(.page-id-366) .entry-header {
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1.1fr) minmax(260px,.55fr);
  gap:clamp(1.4rem,4vw,3rem);
  align-items:center;
  width:min(100%,1080px);
  min-height:270px;
  padding:clamp(1.25rem,3vw,2rem);
  overflow:hidden;
  border:1px solid rgba(255,255,255,.11);
  border-radius:24px;
  background:
    radial-gradient(circle at 84% 22%,rgba(255,126,182,.10),transparent 22rem),
    radial-gradient(circle at 68% 78%,rgba(83,191,243,.08),transparent 20rem),
    #111824;
  box-shadow:0 20px 52px rgba(0,0,0,.22);
}
body.mupibox-site.mupibox-legacy-page:not(.page-id-3):not(.page-id-351):not(.page-id-366) .entry-header::after {
  content:"";
  display:block;
  width:100%;
  min-height:210px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:20px;
  background:
    url('../brand/mupi-axolotl-box.svg') center / min(76%,240px) auto no-repeat,
    radial-gradient(circle at 50% 45%,rgba(255,126,182,.18),transparent 48%),
    #0d131e;
}
body.mupibox-site.mupibox-legacy-page:not(.page-id-3):not(.page-id-351):not(.page-id-366) .entry-title {
  max-width:14ch;
}

body.mupibox-site.mupibox-legacy-page .entry-content img {
  box-shadow:0 16px 36px rgba(0,0,0,.24);
}
body.mupibox-site.mupibox-legacy-page .entry-content .wp-block-image,
body.mupibox-site.mupibox-legacy-page .entry-content figure {
  overflow:hidden;
  border-radius:18px;
}
body.mupibox-site.mupibox-legacy-page .entry-content .wp-block-gallery {
  gap:.75rem;
}
body.mupibox-site.mupibox-legacy-page .entry-content .wp-block-gallery img {
  width:100%;
  height:100%;
  object-fit:cover;
}
body.mupibox-site.mupibox-legacy-page .entry-content .wp-block-button__link {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  padding:.72rem 1rem;
  border:1px solid rgba(255,255,255,.12);
  border-radius:999px;
  background:linear-gradient(135deg,#ffc159,#ff6fae);
  color:#24101b !important;
  font-weight:850;
  text-decoration:none;
}
body.mupibox-site.mupibox-legacy-page .entry-content > h2 {
  position:relative;
  padding-top:1.25rem;
}
body.mupibox-site.mupibox-legacy-page .entry-content > h2::before {
  content:"";
  position:absolute;
  left:0;
  top:0;
  width:52px;
  height:3px;
  border-radius:99px;
  background:linear-gradient(90deg,#53bff3,#ff7eb6);
}

@media (max-width: 780px) {
  body.mupibox-site.mupibox-legacy-page:not(.page-id-3):not(.page-id-351):not(.page-id-366) .entry-header {
    grid-template-columns:1fr;
    min-height:0;
  }
  body.mupibox-site.mupibox-legacy-page:not(.page-id-3):not(.page-id-351):not(.page-id-366) .entry-header::after {
    min-height:180px;
  }
  body.mupibox-site.mupibox-legacy-page:not(.page-id-3):not(.page-id-351):not(.page-id-366) .entry-title {
    max-width:none;
  }
}

@media (max-width: 640px) {
  body.mupibox-site.mupibox-legacy-page:not(.page-id-3):not(.page-id-351):not(.page-id-366) .entry-header {
    padding:1rem;
    border-radius:19px;
  }
  body.mupibox-site.mupibox-legacy-page:not(.page-id-3):not(.page-id-351):not(.page-id-366) .entry-header::after {
    min-height:145px;
    border-radius:15px;
    background-size:min(70%,185px) auto;
  }
}
