.md-typeset .home-logo {
  display: block;
  width: 360px;
  max-width: 100%;
  height: auto;
  margin: 0 auto 1.5rem;
  padding: 0.75rem;
  border-radius: 0.4rem;
  background-color: #fff;
}

/* Centra las imágenes sueltas; las que flotan con align quedan a un costado. */
.md-typeset p:has(> img:not([align])),
.md-typeset p:has(> a > img:not([align])) {
  text-align: center;
}

/* Mantiene los videos y las galerías dentro del ancho disponible. */
.md-typeset iframe[src*="youtube.com/embed/"] {
  display: block;
  width: 100%;
  max-width: 35rem;
  height: auto;
  margin: 1em auto;
  aspect-ratio: 16 / 9;
  border: 0;
}

/* Los YouTube Shorts son verticales. */
.md-typeset iframe.video-vertical {
  max-width: 20rem;
  aspect-ratio: 9 / 16;
}

.md-typeset .device-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.md-typeset .device-gallery > a {
  flex: 0 1 15rem;
  max-width: 100%;
}

.md-typeset .installation-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}

.md-typeset .device-gallery img,
.md-typeset .installation-gallery img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: auto;
}
