/* Shared components. Used by Inicio, Servicios and Contacto.
   Pages link this file before their own CSS and must not redefine these rules. */

/* ==========================================================================
   CIERRE DE CONTACTO (D-24). Self-contained block, reused on Servicios.
   Markup: <section class="cierre bleed-left bleed-inner on-dark"> … </section>
   as a direct child of a .frame-grid.
   ========================================================================== */

.cierre {
  margin-block: var(--seccion);
  padding-block: var(--space-6);
  background: var(--gris);
  color: var(--blanco);
}

.cierre h2 {
  color: var(--blanco);
}

.cierre a:not(.btn) {
  color: var(--blanco);
}

.cierre__correo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  max-width: none;
}

.cierre__correo a {
  overflow-wrap: anywhere;
}

.cierre__horario {
  margin-top: var(--space-2);
}

.cierre__accion {
  margin-top: var(--space-5);
}

/* ≥720: bleeds left (D-19); text keeps a gap before the band's right end */
@media (min-width: 720px) {
  .cierre.bleed-left {
    padding-right: var(--space-5);
  }
}

/* ≥1024: band ends at the end of column 10.
   100% = bleed track + frame; col 10 ends at 10/12 of the frame − gap/6. */
@media (min-width: 1024px) {
  .cierre.bleed-left {
    width: calc(var(--bleed-w) + (100% - var(--bleed-w)) * 10 / 12 - var(--gap) / 6);
  }
}

/* ==========================================================================
   COPIAR CORREO (js/copiar-correo.js). Button label crossfade, §9 "Confirmación".
   ========================================================================== */

.copiar {
  display: inline-grid;
  place-items: center;
}

.copiar__texto {
  grid-area: 1 / 1; /* both labels share one cell: the button never resizes */
  transition: opacity 150ms ease;
}

.copiar__texto--ok {
  opacity: 0;
}

.copiar.is-copiado .copiar__texto {
  opacity: 0;
}

.copiar.is-copiado .copiar__texto--ok {
  opacity: 1;
}

.copiar-aviso {
  flex-basis: 100%;
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

@media (prefers-reduced-motion: reduce) {
  .copiar__texto {
    transition: none;
  }
}

/* ---------- Image slots: ratio boxes for real images (.slot--foto) ---------- */

.slot {
  display: grid;
  place-items: center;
  width: 100%;
  height: auto;
  aspect-ratio: var(--slot-ratio, 16 / 9);
  padding: var(--space-3);
  background: var(--bruma);
  color: var(--gris);
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: var(--lh-small);
  text-align: center;
  object-fit: cover;
  object-position: 50% 50%;
}

.slot--16x9 {
  --slot-ratio: 16 / 9;
}

/* Hero slots: one 4:5 file, CSS crops to 3:2 below 720px (D-20c) */
.slot--mesa {
  --slot-ratio: 3 / 2;
  position: relative;
}

@media (min-width: 720px) {
  .slot--mesa {
    --slot-ratio: 4 / 5;
  }

  /* Central 24–76% band: the part a 3:2 crop keeps (D-20c) */
  .slot--mesa::before {
    content: "";
    position: absolute;
    inset: 24% 0;
    background: #cfdbe3;
  }
}

/* Secondary button for light surfaces (Copiar correo here) */
.btn--secundario {
  border-color: var(--azul);
  background: transparent;
  color: var(--azul);
}

.btn--secundario:hover {
  background: var(--azul);
  color: var(--blanco);
}

/* Real images inside slots (opt-in with .slot--foto). The box keeps its
   ratio from .slot / .slot--<ratio>; the image fills it and is cropped by
   object-fit, so one file serves every ratio (e.g. 4:5 → 3:2 below 720px).
   The tint, padding and hero middle band are removed for these slots only. */
.slot.slot--foto {
  position: relative;
  padding: 0;
  background: none;
}

.slot.slot--foto::before {
  content: none;
}

.slot > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
