/* Metamedia Player — self-contained styles.
   No framework dependencies. Everything is namespaced under .mm- so the
   player can be embedded anywhere without leaking styles. */

.mm-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Helvetica Neue",
    Arial,
    sans-serif;
  -webkit-tap-highlight-color: transparent;
  container-type: size;
}

/* ---------- Layers ---------- */

.mm-layers {
  position: absolute;
  inset: 0;
}

.mm-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

img.mm-layer,
video.mm-layer {
  object-fit: cover; /* default */
}

.mm-fit-cover {
  object-fit: cover;
}
.mm-fit-contain {
  object-fit: contain;
}
.mm-fit-fill {
  object-fit: fill;
}
.mm-fit-none {
  object-fit: none;
}

.mm-hidden {
  visibility: hidden;
}

/* ---------- Text layers ---------- */

.mm-text {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8%;
  /* padding must not grow the box past the canvas, or "center" sits 8%
     off-center and right-aligned text lands outside the viewport */
  box-sizing: border-box;
  pointer-events: none;
}

.mm-text-content {
  color: #fff;
  font-size: clamp(1.25rem, 4.5vw, 3rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.35;
  text-align: center;
  white-space: pre-wrap;
  max-width: 100%;
}

.mm-text.mm-align-left {
  justify-content: flex-start;
}
.mm-text.mm-align-right {
  justify-content: flex-end;
}
.mm-text.mm-align-left .mm-text-content {
  text-align: left;
}
.mm-text.mm-align-right .mm-text-content {
  text-align: right;
}

.mm-text.mm-valign-top {
  align-items: flex-start;
}
.mm-text.mm-valign-bottom {
  align-items: flex-end;
}

.mm-text.mm-serif .mm-text-content {
  font-family: Georgia, "Times New Roman", serif;
}

/* ---------- Controls menu ---------- */

.mm-menu {
  position: absolute;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease-out;
}

@media (hover: hover) {
  .mm-container:hover .mm-menu {
    opacity: 1;
    pointer-events: auto;
  }
}

.mm-menu.mm-visible {
  opacity: 1;
  pointer-events: auto;
}

.mm-pos-bottom {
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  flex-direction: row;
  max-width: calc(100% - 28px);
}
.mm-pos-top {
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  flex-direction: row;
  max-width: calc(100% - 28px);
}
.mm-pos-left {
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  max-height: calc(100% - 28px);
}
.mm-pos-right {
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  max-height: calc(100% - 28px);
}

/* Tighten gap and padding on narrow/short pieces so the menu stays a single
   clean row or column without scrolling or wrapping. Targets the row positions
   (width-constrained) and column positions (height-constrained) separately.
   At 375px (phone) with 11 buttons: gap 8px fits comfortably. */
@container (max-width: 400px) {
  .mm-pos-bottom,
  .mm-pos-top {
    gap: 8px;
    padding: 8px 10px;
  }
}

@container (max-height: 400px) {
  .mm-pos-left,
  .mm-pos-right {
    gap: 8px;
    padding: 10px 8px;
  }
}

.mm-theme-light {
  color: #fff;
}
.mm-theme-dark {
  color: #000;
}

/* ---------- Buttons ---------- */

.mm-btn {
  appearance: none;
  background: none;
  border: 0;
  margin: 0;
  padding: 4px;
  cursor: pointer;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  opacity: 0.85;
  transition: opacity 150ms ease-out;
}

.mm-btn:hover {
  opacity: 1;
}

.mm-toggle-box {
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  transition: background-color 150ms ease-out;
}

.mm-toggle.mm-on .mm-toggle-box {
  background-color: currentColor;
}

/* ---------- Rotate-device hint ---------- */

.mm-rotate-hint {
  position: absolute;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease-out;
}

.mm-rotate-hint.mm-visible {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.mm-rotate-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-align: center;
}
