/* BUA v2 — Agenda (/calendario)
   Migración página por página: el CSS global no se toca. */

.v2-cal {
  padding-bottom: 40px;
}

/* ===== CABECERA ===== */

/* ===== TIMELINE ===== */
.v2-cal-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.v2-cal-card {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: start;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--v2-border);
  border-radius: 20px;
  background: var(--v2-surface);
  box-shadow: var(--v2-shadow);
  transition: transform .18s var(--v2-ease), box-shadow .18s var(--v2-ease);
}

.v2-cal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--v2-shadow-lg);
}

.v2-cal-date {
  display: grid;
  place-items: center;
  width: 62px;
  padding: 10px 0;
  border-radius: 16px;
  background: var(--v2-primary);
  color: var(--v2-on-primary);
  line-height: 1;
}

.v2-cal-date b {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.03em;
}

.v2-cal-date span {
  margin-top: 4px;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .12em;
  opacity: .85;
}

.v2-cal-media {
  width: 120px;
  height: 92px;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
}

.v2-cal-body {
  min-width: 0;
}

.v2-cal-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.v2-cal-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cat-color, var(--v2-gold)) 16%, transparent);
  color: var(--cat-color, var(--v2-gold));
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.v2-cal-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--v2-muted);
  font-size: .74rem;
  font-weight: 600;
}

.v2-cal-title {
  margin: 8px 0 0;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--v2-ink);
}

.v2-cal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 6px;
}

.v2-cal-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--v2-muted);
  font-size: .78rem;
}

.v2-cal-desc {
  margin-top: 10px;
  max-width: 62ch;
  color: var(--v2-muted);
  font-size: .82rem;
  line-height: 1.5;
}

.v2-cal-card .v2-link {
  margin-top: 10px;
}

/* ===== PARRILLA ===== */
.v2-cal-gridwrap {
  border: 1px solid var(--v2-border);
  border-radius: 20px;
  background: var(--v2-surface);
  box-shadow: var(--v2-shadow);
  overflow: hidden;
}

.v2-cal-gridnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--v2-border);
}

.v2-cal-gridnav strong {
  font-size: 1rem;
  font-weight: 800;
  color: var(--v2-ink);
}

.v2-cal-arrow {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--v2-border);
  border-radius: 50%;
  color: var(--v2-ink);
  background: var(--v2-surface);
  text-decoration: none;
}

.v2-cal-arrow:hover {
  background: var(--v2-surface-2);
}

.v2-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--v2-border);
}

.v2-cal-gridhd {
  padding: 9px 10px;
  background: var(--v2-surface-2);
  color: var(--v2-muted);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
}

.v2-cal-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 92px;
  padding: 8px;
  background: var(--v2-surface);
}

.v2-cal-cell--fuera {
  background: var(--v2-surface-2);
}

.v2-cal-cell--hoy {
  background: color-mix(in srgb, var(--v2-gold) 10%, var(--v2-surface));
}

.v2-cal-num {
  color: var(--v2-muted);
  font-size: .74rem;
  font-weight: 700;
}

.v2-cal-cell--hoy .v2-cal-num {
  color: var(--v2-ink);
}

.v2-cal-ev {
  display: block;
  padding: 4px 6px;
  border-left: 3px solid var(--cat-color, var(--v2-gold));
  border-radius: 6px;
  background: color-mix(in srgb, var(--cat-color, var(--v2-gold)) 12%, transparent);
  color: var(--v2-ink);
  font-size: .68rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  overflow: hidden;
}

.v2-cal-more {
  color: var(--v2-muted);
  font-size: .66rem;
  font-weight: 700;
}

/* ===== PÓSTERS ===== */
.v2-cal-posters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.v2-cal-poster {
  border: 1px solid var(--v2-border);
  border-radius: 20px;
  background: var(--v2-surface);
  overflow: hidden;
  box-shadow: var(--v2-shadow);
  transition: transform .18s var(--v2-ease), box-shadow .18s var(--v2-ease);
}

.v2-cal-poster:hover {
  transform: translateY(-3px);
  box-shadow: var(--v2-shadow-lg);
}

.v2-cal-poster-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--v2-surface-2);
}

.v2-cal-poster-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v2-cal-poster-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--cat-color, var(--v2-gold));
  background: color-mix(in srgb, var(--cat-color, var(--v2-gold)) 12%, var(--v2-surface-2));
}

.v2-cal-poster-media .v2-cal-tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
}

.v2-cal-poster-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 18px;
}

.v2-cal-poster-title {
  font-size: .95rem;
  font-weight: 800;
  color: var(--v2-ink);
  line-height: 1.25;
}

.v2-cal-poster-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--v2-muted);
  font-size: .74rem;
}

/* ===== ESTADO VACÍO ===== */
.v2-cal-empty {
  margin-top: 8px;
}

/* ===== MODAL ===== */
.v2-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 10, 16, .6);
  backdrop-filter: blur(4px);
}

.v2-modal-overlay[hidden] {
  display: none;
}

.v2-modal {
  position: relative;
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px;
  border-radius: 20px;
  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-lg);
}

.v2-modal h2 {
  margin: 0 0 18px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--v2-ink);
}

.v2-modal-x {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--v2-surface-2);
  color: var(--v2-ink);
  font-size: 1.1rem;
  cursor: pointer;
}

.v2-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.v2-field label {
  color: var(--v2-ink);
  font-size: .76rem;
  font-weight: 700;
}

.v2-field .fi {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--v2-border);
  border-radius: 10px;
  background: var(--v2-surface-2);
  color: var(--v2-ink);
  font: inherit;
  font-size: .88rem;
}

.v2-field .fi:focus {
  outline: 2px solid var(--v2-gold);
  outline-offset: 1px;
}

.v2-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.v2-hint {
  color: var(--v2-muted);
  font-size: .72rem;
}

.v2-field--send {
  margin-top: 6px;
}

.v2-form-msg {
  min-height: 1.2em;
  margin-top: 10px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--v2-muted);
}

/* ===== RESPONSIVO ===== */
@media (max-width: 860px) {
  .v2-cal-card {
    grid-template-columns: auto 1fr;
    gap: 14px;
  }
  .v2-cal-media {
    grid-column: 1 / -1;
    width: 100%;
    height: 160px;
  }
  .v2-cal-controls {
    align-items: flex-start;
    flex-direction: column;
  }
  .v2-segmented {
    width: 100%;
    justify-content: space-between;
  }
  .v2-segmented a {
    flex: 1;
    text-align: center;
  }
}

@media (max-width: 540px) {
  .v2-pagehead {
    align-items: flex-start;
    flex-direction: column;
  }
  .v2-cal .v2-empty {
    flex-direction: column;
    align-items: flex-start;
  }
  .v2-cal-card {
    grid-template-columns: 1fr;
  }
  .v2-cal-date {
    display: flex;
    gap: 8px;
    align-items: baseline;
    justify-self: start;
    width: auto;
    padding: 6px 12px;
    border-radius: 999px;
  }
  .v2-cal-date b {
    font-size: 1rem;
  }
  .v2-cal-date span {
    margin-top: 0;
  }
  .v2-cal-cell {
    min-height: 68px;
    padding: 5px;
  }
  .v2-cal-ev {
    font-size: .6rem;
  }
  .v2-row {
    grid-template-columns: 1fr;
  }
  .v2-modal {
    padding: 20px 16px;
  }
}

/* =========================================================
   Componentes que la agenda necesita y que viven en home.css.
   Se replican aquí acotados a .v2-cal porque home.css solo se
   carga en la home y esa página no se toca.
   ========================================================= */
.v2-cal .v2-empty {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 24px;
  border: 1px dashed var(--v2-border);
  border-radius: 18px;
  background: var(--v2-surface-2);
}
.v2-cal .v2-empty-icon {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--v2-surface);
  color: var(--v2-muted);
}
.v2-cal .v2-empty strong {
  display: block;
  font-size: .86rem;
  color: var(--v2-ink);
}
.v2-cal .v2-empty p {
  margin-top: 2px;
  font-size: .76rem;
  color: var(--v2-muted);
}
.v2-cal .v2-empty .v2-link { margin-top: 6px; }

/* ===== EXPLORA ===== */
.v2-explora {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 148px;
  gap: 10px;
}
.v2-cal .v2-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: var(--navy);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}
.v2-cal .v2-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ===== AGENDA ===== */
.v2-agenda {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
