/* Jornada 26-11-2026 (prompts/2026-11-26/CONTRATO.md): portada en cuatro bloques y tarjeta de evento.
   La tarjeta (.event-card, de util.js) se ve igual en la portada, el catálogo, Comunidad y Mi formación;
   es la única definición de la tarjeta. Mobile first: se diseña a 390 px y se amplía.
   Tamaños de letra: el titular, 1.5rem (subtítulos y día de la tarjeta), 1.0625rem (lectura) y 0.875rem (datos). */

/* ---------- Tarjeta de evento ---------- */
.event-card { position: relative; display: flex; flex-direction: column; padding: 0; border-radius: 12px; background: var(--blanco); border: 1px solid var(--linea); overflow: hidden; transition: border-color var(--dur), box-shadow 0.2s var(--ease); }
.event-card:hover { border-color: var(--linea-fuerte); box-shadow: var(--shadow-hover); transform: none; }
.event-card > a { position: absolute; inset: 0; z-index: 1; border-radius: 12px; }
.event-card > a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.event-card .ec-media { position: relative; aspect-ratio: 16 / 9; border-radius: 0; background: var(--noche-050); overflow: hidden; }
.event-card .ec-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.event-card .ec-fav { position: absolute; z-index: 2; right: 8px; top: 8px; width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.94); color: var(--noche); cursor: pointer; box-shadow: var(--shadow-sm); }
.event-card .ec-fav:hover { color: var(--coral-profundo, #C94A2E); }
.event-card .ec-fav:active { transform: scale(0.94); }
.event-card .ec-fav.on { color: var(--coral-profundo, #C94A2E); }
.event-card .ec-fav.on .icon { fill: currentColor; }
/* La portada tipográfica no necesita tanto alto: en celular va más baja para que mande el título. */
.event-card .ec-media:has(img[src^='/assets/covers/']) { aspect-ratio: 21 / 9; }

.event-card .ec-body { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 16px; }
.ec-head { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: start; }
.ec-date { display: grid; justify-items: center; align-content: center; gap: 0; min-height: 64px; padding: 6px 0; border: 1px solid var(--linea-fuerte); border-radius: 12px; color: var(--noche); font-variant-numeric: tabular-nums; line-height: 1.1; }
.ec-date span { font-size: 0.875rem; color: var(--gris); }
.ec-date b { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.ec-title { display: grid; gap: 4px; min-width: 0; }
.event-card .ec-title h3 { margin: 0; font-size: 1.0625rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ec-place { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 0; font-size: 0.875rem; color: var(--gris); }
.ec-place span + span { padding-left: 8px; border-left: 1px solid var(--linea-fuerte); }

.ec-price { margin: 0; padding-top: 12px; border-top: 1px solid var(--line-soft); font-family: var(--font-display); font-size: 1.0625rem; font-weight: 600; color: var(--noche); font-variant-numeric: tabular-nums; }
.ec-price small { font-family: var(--font-sans); font-size: 0.875rem; font-weight: 500; color: var(--gris); }
.ec-host { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0; font-size: 0.875rem; color: var(--gris); }
.ec-host-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: auto 0 0; padding: 0; list-style: none; }
.ec-badges li { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 10px; border-radius: 6px; background: var(--noche-050); color: var(--noche); font-size: 0.875rem; font-weight: 500; }

/* ---------- Portada ---------- */
.home { padding-bottom: 8px; }
.home h2 { font-size: 1.5rem; line-height: 1.2; }

.hm-hero { padding-block: 32px 40px; }
.hm-hero h1 { max-width: 20ch; font-size: clamp(2rem, 1.35rem + 2.6vw, 3.25rem); line-height: 1.08; letter-spacing: -0.03em; }
.hm-lede { max-width: 46ch; margin: 12px 0 0; font-size: 1.0625rem; line-height: 1.5; color: var(--gris); }

.hm-search { display: grid; gap: 12px; margin-top: 28px; }
.hm-field { display: grid; gap: 6px; min-width: 0; }
.hm-field > span { font-size: 0.875rem; font-weight: 600; color: var(--noche); }
.hm-field .select { min-height: 48px; font-size: 1.0625rem; }
.hm-submit { width: 100%; min-height: 52px; margin-top: 4px; font-size: 1.0625rem; }
.hm-submit .icon { width: 20px; height: 20px; }

.hm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hm-chips .chip { min-height: 48px; padding: 0 14px; font-size: 0.875rem; }

.hm-next { padding-block: 40px 48px; border-top: 1px solid var(--linea); }
.hm-next h2 { margin-bottom: 20px; }
.hm-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.hm-all { display: inline-flex; min-height: 48px; margin-top: 16px; font-size: 1.0625rem; }
.hm-note { margin: 0; padding: 20px 0; font-size: 1.0625rem; color: var(--gris); border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); }
.hm-note a { color: var(--link); font-weight: 600; }

.hm-skel { min-height: 280px; border-radius: 12px; background: var(--noche-050); }

.hm-alert { padding-block: 48px; background: var(--noche); color: var(--crema); }
.hm-alert:has(> .container:empty) { display: none; }

.hm-org { display: grid; gap: 16px; padding-block: 40px; }
.hm-org p { margin: 0; font-family: var(--font-display); font-size: 1.0625rem; font-weight: 500; color: var(--noche); }
.hm-org-btn { width: 100%; min-height: 48px; border-color: var(--noche); color: var(--noche); }
.hm-org-btn:hover { background: var(--noche-050); border-color: var(--noche); }

@media (min-width: 640px) {
  .event-card .ec-media, .event-card .ec-media:has(img[src^='/assets/covers/']) { aspect-ratio: 16 / 10; }
  /* En rejilla, el título reserva dos líneas para que precio y organizador queden alineados en la fila. */
  .event-card .ec-title h3 { min-height: calc(2 * 1.3em); }
  .hm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .hm-search { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hm-submit { grid-column: 1 / -1; }
  .hm-org { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .hm-org-btn { width: auto; padding-inline: 24px; }
}

@media (min-width: 1000px) {
  .hm-hero { padding-block: 72px 56px; }
  .hm-lede { margin-top: 16px; }
  .hm-search { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; max-width: 1040px; margin-top: 36px; }
  .hm-submit { grid-column: auto; width: auto; min-height: 48px; margin-top: 0; padding-inline: 28px; }
  .hm-next { padding-block: 56px 64px; }
  .hm-next h2 { margin-bottom: 24px; }
  .hm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
  .hm-alert { padding-block: 64px; }
  .hm-org { padding-block: 56px; }
}
