/* Agenda de Gandia: réplica aislada del prototipo HTML aprobado. */
body.borgia26-agenda-page .wp-site-blocks {
  padding: 0;
}

html[data-theme="light"] body.borgia26-agenda-page {
  background: #ffffff;
}

.borgia-agenda {
  --agenda-ink: #000000;
  --agenda-hair: #000000;
  --agenda-red: #c8102e;
  --agenda-lightbox: rgba(255, 255, 255, .92);
  --agenda-outline: rgba(0, 0, 0, .1);
  --agenda-pad-x: 48px;
  --agenda-text: clamp(17px, 1rem + .45vw, 22px);
  --agenda-heading: clamp(44px, 2.5rem + 1.5vw, 55px);
  --agenda-section-heading: clamp(34px, 2rem + 1vw, 46px);
  width: 100%;
  color: var(--agenda-ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.5;
}

html[data-theme="dark"] .borgia-agenda {
  --agenda-ink: #ffffff;
  --agenda-hair: #ffffff;
  --agenda-lightbox: rgba(20, 20, 20, .98);
  --agenda-outline: rgba(255, 255, 255, .1);
}

/* Cielo estrellado en modo oscuro, como el de la portada (markup por
   wp_footer en agenda.php; estilos base de .borgia-star en style.css). */
html[data-theme="dark"] body.borgia26-agenda-page .borgia-stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

html[data-theme="dark"] body.borgia26-agenda-page .wp-site-blocks {
  position: relative;
  z-index: 1;
}

.borgia-agenda a,
.borgia-agenda a:hover,
.borgia-agenda button,
.borgia-agenda button:hover {
  color: var(--agenda-ink);
}

.borgia-agenda a:focus-visible,
.borgia-agenda button:focus-visible {
  outline: 2px solid var(--agenda-red);
  outline-offset: 3px;
}

.agenda-masthead,
.agenda-main {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--agenda-pad-x);
}

.agenda-masthead {
  display: block;
  padding-top: 40px;
  padding-bottom: 16px;
}

.agenda-back,
.agenda-lightbox-close {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.agenda-back:hover,
.agenda-lightbox-close:hover {
  border-bottom-color: var(--agenda-red);
}

.agenda-main {
  padding-bottom: 96px;
}

.agenda-hero {
  padding: 64px 0 56px;
  text-align: center;
}

.agenda-language {
  display: flex;
  gap: 0 22px;
  margin-bottom: 14px;
}

.agenda-hero .agenda-language {
  justify-content: center;
}

.agenda-language__link,
.agenda-language__current {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
}

.agenda-language__link:hover,
.agenda-language__link:focus-visible {
  color: var(--agenda-red);
  border-bottom-color: var(--agenda-red);
}

.agenda-language__current {
  border-bottom-color: var(--agenda-red);
}

.agenda-hero h1,
.agenda-event-head h1 {
  margin: 0;
  font-size: var(--agenda-heading);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.agenda-hero h1 {
  margin-inline: auto;
}

.agenda-hero p {
  max-width: 58ch;
  margin: 20px auto 0;
  font-size: var(--agenda-text);
  line-height: 1.4;
  text-wrap: pretty;
}

.agenda-blog-link a {
  border-bottom: 1px solid var(--agenda-ink);
}

.agenda-blog-link a:hover {
  border-bottom-color: var(--agenda-red);
}

.agenda-rows {
  margin: 40px 0 0;
  padding: 0;
  border-bottom: 1px solid var(--agenda-hair);
  list-style: none;
}

.agenda-event-row {
  display: flex;
  align-items: baseline;
  gap: 24px;
  min-height: 58px;
  padding: 14px 0;
  border-top: 1px solid var(--agenda-hair);
  font-size: var(--agenda-text);
  line-height: 1.35;
}

.agenda-event-row p {
  margin: 0;
}

.agenda-date {
  width: 22%;
  flex: none;
  font-variant-numeric: tabular-nums;
}

.agenda-title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-details {
  order: 3;
  width: 24%;
  flex: none;
  text-align: right;
}

.agenda-no-results {
  padding: 24px 0;
  font-size: var(--agenda-text);
  text-wrap: pretty;
}

.agenda-event-detail {
  padding-top: 64px;
}

.agenda-event-head {
  padding-bottom: 40px;
  border-bottom: 1px solid var(--agenda-hair);
}

.agenda-event-meta {
  margin: 18px 0 0;
  font-size: var(--agenda-text);
  font-weight: 400;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.agenda-event-content {
  max-width: 70ch;
  margin-top: 40px;
  font-size: var(--agenda-text);
  line-height: 1.55;
}

.agenda-event-content p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

.agenda-event-content a {
  border-bottom: 1px solid var(--agenda-ink);
}

.agenda-event-content a:hover {
  border-bottom-color: var(--agenda-red);
}

.agenda-gallery-wrap {
  margin-top: 64px;
}

.agenda-gallery {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.agenda-gallery a {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
}

.agenda-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  outline: 1px solid var(--agenda-outline);
  outline-offset: -1px;
}

.agenda-lightbox-open {
  overflow: hidden;
}

/* El overlay se monta en <body>, fuera de .borgia-agenda: no puede usar
   variables --agenda-*, solo valores propios o tokens de :root. */
.agenda-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: rgba(255, 255, 255, .92);
}

html[data-theme="dark"] .agenda-lightbox {
  background: rgba(0, 0, 0, .88);
}

.agenda-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  outline: 1px solid rgba(0, 0, 0, .1);
  outline-offset: -1px;
}

html[data-theme="dark"] .agenda-lightbox img {
  outline-color: rgba(255, 255, 255, .1);
}

.agenda-lightbox-close:hover,
.agenda-lightbox-close:focus-visible {
  border-bottom-color: var(--accent);
}

.agenda-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  min-width: 44px;
  min-height: 44px;
  border-bottom-color: var(--agenda-ink);
}

/* ============================================================
   View Transitions (cross-document). El opt-in vive en este CSS,
   que solo se encola en las páginas de Agenda: ambas páginas de una
   navegación deben declararlo, así que las transiciones ocurren
   únicamente Agenda ↔ Agenda y nunca hacia el resto del blog.
   ============================================================ */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: agenda-page-out .14s ease-in both;
  mix-blend-mode: normal;
}

::view-transition-new(root) {
  animation: agenda-page-in .2s .04s cubic-bezier(.2, 0, 0, 1) both;
  mix-blend-mode: normal;
}

@keyframes agenda-page-out {
  to {
    opacity: 0;
  }
}

@keyframes agenda-page-in {
  from {
    opacity: 0;
  }
}

/* El título del evento viaja del listado a la ficha y de vuelta.
   El nombre lo pone agenda-v2.js en la fila del listado; en la ficha
   es fijo. */
.agenda-event-detail .agenda-event-head h1 {
  view-transition-name: agenda-event-title;
}

::view-transition-group(agenda-event-title) {
  animation-duration: .3s;
  animation-timing-function: cubic-bezier(.2, 0, 0, 1);
}

/* ============================================================
   Reveal al entrar en viewport. La clase .agenda-reveal solo la
   añade agenda-v2.js a elementos bajo el pliegue: sin JS no se
   oculta nada.
   ============================================================ */
.agenda-reveal {
  opacity: 0;
  transform: translateY(12px);
  transition-property: opacity, transform;
  transition-duration: .34s;
  transition-timing-function: cubic-bezier(.2, 0, 0, 1);
}

.agenda-reveal--in {
  opacity: 1;
  transform: translateY(0);
}

.agenda-reveal--skip {
  opacity: 1;
  transform: translateY(0);
  transition-duration: 0s;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }

  .agenda-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 900px) {
  .borgia-agenda {
    --agenda-pad-x: 24px;
  }

  .agenda-date {
    width: 28%;
  }

  .agenda-details {
    width: 28%;
  }

  .agenda-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  /* Header de la Agenda en una sola línea: título a la izquierda, acciones a la derecha. */
  body.borgia26-agenda-page .masthead {
    flex-wrap: nowrap;
  }

  body.borgia26-agenda-page .masthead .wp-block-site-title {
    width: auto;
  }

  body.borgia26-agenda-page .mast-actions {
    width: auto;
    justify-content: flex-end;
  }

  .agenda-hero {
    padding: 40px 0;
  }

  .agenda-rows {
    margin-top: 28px;
  }

  .agenda-event-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 16px;
    min-height: 0;
    line-height: 1.4;
  }

  .agenda-date,
  .agenda-details {
    width: auto;
  }

  .agenda-details {
    order: 0;
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
  }

  .agenda-title {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .agenda-event-detail {
    padding-top: 40px;
  }

  .agenda-event-head {
    padding-bottom: 32px;
  }

  .agenda-event-content {
    margin-top: 32px;
  }

  .agenda-gallery-wrap {
    margin-top: 64px;
  }

  .agenda-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agenda-lightbox {
    padding: 56px 16px 16px;
  }
}
