/*
 * Morph Pill Card.
 *
 * The root reserves only the pill's footprint; the surface is positioned over
 * it and grows past it. Every size is a custom property written from the
 * measured layouts, and flipping `.is-open` swaps which set each box reads —
 * so one class change drives the surface, the image and the title together,
 * all on the same spring.
 *
 * Port sin React de la plantilla Morph Pill Card de Scrolltide (sep-2026)
 * para el sitio Marca. El CSS es el original; lo agregado está al final.
 */

.mp {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  width: var(--mp-pw);
  height: var(--mp-ph);
  font-size: var(--mp-font);
  color: var(--mp-text);
  /* Set explicitly: a card is read top-left down, and must not inherit a
     centred alignment from whatever it is placed in. */
  text-align: left;
}

.mp.is-open {
  z-index: 20;
}

.mp__surface {
  --t: var(--mp-speed) var(--mp-spring);

  position: absolute;
  width: var(--mp-pw);
  height: var(--mp-ph);
  overflow: hidden;
  border-radius: calc(var(--mp-ph) / 2);
  background: var(--mp-surface);
  box-shadow: var(--mp-shadow);
  outline: none;
  cursor: default;
  transition:
    width var(--t),
    height var(--t),
    border-radius var(--t);
}

.mp--center .mp__surface {
  left: 50%;
  top: 50%;
  translate: -50% -50%;
}
.mp--start .mp__surface {
  left: 0;
  top: 0;
}

.mp.is-open .mp__surface {
  width: var(--mp-cw);
  height: var(--mp-ch);
  border-radius: var(--mp-card-r);
}

.mp__surface:focus-visible {
  box-shadow: var(--mp-shadow), 0 0 0 2px var(--mp-focus);
}

/* --- shared elements: image and title move between the two layouts ------- */

.mp__img {
  position: absolute;
  left: 8px;
  top: 8px;
  width: var(--mp-avatar);
  height: var(--mp-avatar);
  object-fit: cover;
  border-radius: calc(var(--mp-avatar) / 2);
  transition:
    width var(--t),
    height var(--t),
    border-radius var(--t);
}
.mp.is-open .mp__img {
  width: var(--mp-img-w);
  height: calc(var(--mp-ch) - 16px);
  border-radius: var(--mp-img-r);
}

.mp__title {
  position: absolute;
  left: var(--mp-title-x0);
  top: var(--mp-title-y0);
  line-height: var(--mp-line);
  white-space: nowrap;
  transition:
    left var(--t),
    top var(--t);
}
.mp.is-open .mp__title {
  left: var(--mp-title-x1);
  top: var(--mp-title-y1);
}

/* --- card-only content ----------------------------------------------------
   Fades in once the surface is mostly open; out at once on the way back so
   it is never squeezed by a shrinking surface. */

.mp__body {
  position: absolute;
  left: var(--mp-body-x);
  top: 14px;
  bottom: 12px;
  width: var(--mp-body-w);
  display: flex;
  flex-direction: column;
  opacity: 0;
  translate: 0 4px;
  pointer-events: none;
  transition:
    opacity 0.12s ease,
    translate 0.12s ease;
}
.mp.is-open .mp__body {
  opacity: 1;
  translate: 0 0;
  pointer-events: auto;
  transition:
    opacity 0.3s ease calc(var(--mp-speed) * 0.35),
    translate 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--mp-speed) * 0.35);
}

.mp__title-space {
  height: var(--mp-line);
  flex: none;
}

.mp__sub {
  margin-top: 7px;
  font-size: 0.75em;
  line-height: 1.5;
  color: var(--mp-muted);
}
.mp__sub p,
.mp__desc {
  margin: 0;
}

.mp__rows {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.6875em;
  line-height: 1.55;
}
.mp__rows li {
  display: flex;
  align-items: center;
  gap: 0.4em;
}

.mp__icon {
  display: inline-flex;
  flex: none;
  width: 1.15em;
  height: 1.15em;
}
.mp__icon svg {
  width: 100%;
  height: 100%;
}

.mp__foot {
  margin-top: auto;
  padding-top: 12px;
}

.mp__desc {
  font-size: 0.6875em;
  line-height: 1.3;
  color: var(--mp-muted);
}

.mp__button {
  display: inline-block;
  margin-top: 10px;
  padding: 0.45em 0.95em;
  border: 0;
  border-radius: 999px;
  background: var(--mp-button);
  color: var(--mp-button-text);
  font: inherit;
  font-size: 0.75em;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.2s ease;
}
.mp__button:hover {
  filter: brightness(0.94);
}
.mp__button:focus-visible {
  outline: 2px solid var(--mp-focus);
  outline-offset: 2px;
}

/* --- measuring copies ------------------------------------------------------ */

.mp__measure {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  pointer-events: none;
}
/* inline-block, not inline: ResizeObserver reports nothing for inline boxes,
   so a webfont arriving late would never trigger a re-measure. */
.mp__title-measure {
  display: inline-block;
  white-space: nowrap;
  line-height: var(--mp-line);
}
.mp__body-measure {
  width: var(--mp-body-w);
  display: flex;
  flex-direction: column;
}

@media (prefers-reduced-motion: reduce) {
  .mp__surface,
  .mp__img,
  .mp__title {
    transition-duration: 0.01s;
  }
}

/* --- agregado para Marca --------------------------------------------------
   El nombre en negrita navy y el botón con el rojo del sitio. Solo color y
   peso: ningún largo ni ninguna transición cambia. */
.mp--marca .mp__title,
.mp--marca .mp__title-measure {
  font-weight: 700;
}
.mp--marca .mp__button {
  font-weight: 700;
}
