/* Contacto (contacto.html). D-26 layout (no image, see CLAUDE.md), §10a form.
   Reuses tokens, .frame-grid, .cols, components.css (copy button).
   Breakpoints: <720 / 720–1023 / ≥1024. */

.contacto {
  --seccion: var(--space-7);
  padding-block: var(--space-6) var(--seccion);
}

@media (min-width: 1024px) {
  .contacto {
    --seccion: var(--space-8);
  }
}

/* ---------- D-26 layout (no image, see CLAUDE.md) ---------- */

.contacto__cols {
  row-gap: var(--space-7);
}

.contacto__principal > h1 {
  margin-bottom: var(--space-4);
}

.contacto__principal > .lead {
  margin-bottom: var(--space-6);
}

/* ≥1024: form in cols 1–7, correo/horario in cols 9–12, top-aligned */
@media (min-width: 1024px) {
  .contacto__principal {
    grid-column: 1 / span 7;
  }

  .contacto__aside {
    grid-column: 9 / span 4;
    align-self: start;
  }
}

/* ---------- Correo and horario ---------- */

.contacto__aside h2 {
  margin-bottom: var(--space-3);
  font-size: var(--fs-h3); /* heading at H3 size, like the correo below */
  line-height: var(--lh-h3);
}

/* H3 style. Sizes measured so the correo fits one line with ≥8% spare:
   24px, except 18px in the 288–373px aside at 1024–1279. */
.contacto__correo {
  max-width: none;
  font-size: 1.5rem; /* 24 */
  font-stretch: var(--wdth-text);
  font-weight: 600;
  line-height: var(--lh-h3);
  overflow-wrap: anywhere; /* long real addresses must wrap, not overflow */
  hyphens: manual;
}

@media (min-width: 1024px) {
  .contacto__correo {
    font-size: 1.125rem; /* 18 */
  }
}

@media (min-width: 1280px) {
  .contacto__correo {
    font-size: 1.5rem; /* 24 */
  }
}

.contacto__copiar {
  margin-top: var(--space-3);
}

.contacto__horario {
  margin-top: var(--space-4);
}

/* ---------- Form (§10a) ---------- */

.formulario {
  position: relative;
  max-width: 66ch;
}

/* Honeypot: off-screen, not display:none */
.trampa {
  position: absolute;
  top: 0;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.campo {
  display: grid;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.campo label {
  color: var(--gris);
  font-size: var(--fs-ui);
  font-weight: 600;
  line-height: var(--lh-ui);
}

.campo__opcional {
  font-weight: 400;
}

.campo input,
.campo select,
.campo textarea {
  width: 100%;
  min-height: var(--control-h);
  padding: 10px 12px;
  border: 2px solid var(--gris);
  border-radius: var(--radius);
  background: var(--blanco);
  color: var(--gris);
  font-size: var(--fs-body); /* 18px: also prevents iOS zoom on focus */
  line-height: 1.4;
}

.campo textarea {
  resize: vertical;
}

/* Invalid: thicker border in --alerta plus written text, never color alone.
   Padding drops 1px so the 3px border doesn't shift the layout. */
.campo [aria-invalid="true"] {
  padding: 9px 11px;
  border-width: 3px;
  border-color: var(--alerta);
}

.campo__error {
  color: var(--alerta);
  font-size: var(--fs-ui);
  font-weight: 600;
  line-height: var(--lh-ui);
}

.campo__error:empty {
  display: none;
}

.formulario__privacidad {
  margin-bottom: var(--space-4);
}

/* Status (success) and alert (failure) messages, above the button */
.formulario__estado,
.formulario__alerta {
  margin-bottom: var(--space-4);
  padding-left: var(--space-3);
  font-weight: 600;
}

.formulario__estado {
  border-left: 4px solid var(--azul);
  color: var(--gris);
}

.formulario__alerta {
  border-left: 4px solid var(--alerta);
  color: var(--alerta);
}

.formulario__alerta a {
  color: var(--alerta);
}

.formulario__estado:empty,
.formulario__alerta:empty {
  display: none;
}

.formulario__enviar[disabled] {
  cursor: progress;
}

/* §9 "Confirmación": success message fades in over 150ms */
@media (prefers-reduced-motion: no-preference) {
  .formulario__estado.is-nuevo {
    animation: estado-aparece 150ms ease;
  }
}

@keyframes estado-aparece {
  from {
    opacity: 0;
  }
}
