/* Página "Alle Ausstellungen" — grid + tarjetas */
:root{
  --red:#dc2626;         /* pasado */
  --red-ink:#b91c1c;
  --green:#16a34a;       /* activo */
  --green-ink:#166534;
  --blue:#2563eb;        /* próximo */
  --blue-ink:#1e40af;
  --ink:#111;
  --muted:#6b7280;
  --border:#e5e7eb;
  --card-bg:#fff;
  --shadow:0 8px 24px rgba(0,0,0,.06);
}

.exhibitions-page{
  padding: clamp(2rem, 4vw, 3rem) 0;
  background:#fafafa;
  color:var(--ink);
}
.exhibitions-page .container{
  width:min(1100px,92%);
  margin:0 auto;
}

.page-head h1{
  margin:0 0 .25rem;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing:.02em;
}
.page-head .muted{
  color:var(--muted);
  margin:0 0 1.25rem;
}

/* Mensajes */
.alert.error{
  background:#fee2e2;
  color:#991b1b;
  padding:1rem;
  border-radius:12px;
  margin-bottom:1rem;
}
.empty{
  text-align:center;
  padding:2rem 1rem;
  border:2px dashed var(--border);
  border-radius:14px;
  background:#fff;
}

/* ---------- GRID ---------- */
.exhibitions-list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); /* grid fluido */
}

/* ---------- TARJETA ---------- */
.ex-card{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:.55rem;
  background:var(--card-bg);
  border:1px solid var(--border);
  border-left-width:6px;                /* color por estado abajo */
  border-radius:16px;
  box-shadow:var(--shadow);
  padding:1rem 1.1rem 1.15rem;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  min-height: 170px;                    /* sensación de consistencia */
}
.ex-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(0,0,0,.10);
  border-color: rgba(0,0,0,.08);
}

/* Colores por estado (borde y badge) */
.ex-card.is-past     { border-left-color: var(--red); }
.ex-card.is-active   { border-left-color: var(--green); }
.ex-card.is-upcoming { border-left-color: var(--blue); }

/* Cabecera de tarjeta */
.ex-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.8rem;
}
.ex-title{
  margin:0;
  font-size:1.05rem;
  letter-spacing:.02em;
}

/* Badge (esquina derecha) */
.badge{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  padding:.35rem .65rem;
  border-radius:999px;
  border:1px solid transparent;
  font-size:.78rem;
  font-weight:700;
  text-transform:uppercase;
  line-height:1;
  white-space:nowrap;
}
.badge.past{
  background: rgba(220,38,38,.12);
  color: var(--red-ink);
  border-color: rgba(220,38,38,.35);
}
.badge.active{
  background: rgba(22,163,74,.12);
  color: var(--green-ink);
  border-color: rgba(22,163,74,.35);
}
.badge.upcoming{
  background: rgba(37,99,235,.12);
  color: var(--blue-ink);
  border-color: rgba(37,99,235,.35);
}

/* Contenido de tarjeta */
.ex-dates{ margin:.15rem 0 0; color:#374151; font-weight:500; }
.ex-where{ margin:.1rem 0 0;  font-weight:600; }
.ex-desc{
  margin:.35rem 0 0;
  color:#374151;
  display:-webkit-box;
  -webkit-line-clamp:3;     /* recorte elegante */
  -webkit-box-orient:vertical;
  overflow:hidden;
}

/* CTA inferior */
.page-cta{
  display:flex;
  justify-content:center;
  margin-top:1.25rem;
}
.page-cta .btn{
  display:inline-block;
  text-decoration:none;
  background:#111;
  color:#fff;
  padding:.85rem 1.15rem;
  border-radius:12px;
  font-weight:700;
}
.page-cta .btn:hover{ opacity:.92; }

/* Responsivo fino */
@media (min-width: 1200px){
  .ex-title{ font-size:1.1rem; }
}
@media (prefers-reduced-motion: reduce){
  .ex-card{ transition: none; }
}
/* Fondo blanco solo para esta página */
body {
  background: #fff !important;
  color: #111; /* asegura contraste en textos */
}
.ex-flyer {
  margin-top: 0.5rem;
}

.flyer-img {
  max-width: 250px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.flyer-link {
  display: inline-block;
  margin-top: .3rem;
  color: #0073e6;
  font-weight: 500;
}
.ex-flyer { margin: .5rem 0; }
.flyer-img { max-width: 220px; height: auto; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.flyer-link { display:inline-block; margin-top:.25rem; font-weight:500; }
/* ===== Centrado del bloque y encabezado ===== */
.exhibitions-page .container{
  width: min(1000px, 92%);   /* un poco más estrecho que 1100 para concentrar contenido */
  margin: 0 auto;
}
.page-head{ text-align:center; }
.page-head h1{ margin-bottom:.35rem; }
.page-head .muted{ margin:0 auto 1.25rem; max-width: 70ch; }

/* ===== Grid más centrado y con columnas razonables ===== */
.exhibitions-list{
  display:grid;
  gap: 1rem 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(380px, 560px));
  justify-content: center;     /* centra las columnas dentro del contenedor */
  align-items: start;
}

/* ===== Cards más compactas y centradas ===== */
.ex-card{
  width: min(100%, 560px);     /* no se estiran de lado a lado */
  margin-inline: auto;         /* centradas cuando hay 1 columna */
  padding: 1rem 1.1rem;
  min-height: auto;            /* quita altura mínima que agregaba mucho aire */
  border-left-width: 5px;
}

/* Ajustes finos */
.ex-head{ align-items:flex-start; }
.ex-title{ font-size:1.06rem; }
.ex-dates{ margin-top:.1rem; }
.ex-desc{ -webkit-line-clamp: 4; } /* un poco más de texto sin que sea largo */

/* ===== Modo 2 columnas cuando hay flyer (solo desktop) ===== */
@media (min-width: 880px){
  .ex-card:has(.flyer-img),
  .ex-card:has(.flyer-link){
    display: grid;
    grid-template-columns: 180px 1fr;
    column-gap: 1.1rem;
  }
  /* Ubicar contenido textual en la 2ª columna */
  .ex-head, .ex-dates, .ex-where, .ex-desc, .ex-updated { grid-column: 2; }
  .ex-flyer { grid-column: 1; grid-row: 1 / span 5; margin:0; }
  .flyer-img{ width:100%; max-width:100%; height:auto; border-radius:8px; }
}

/* ===== Flyer (limpieza de duplicados) ===== */
.ex-flyer{ margin:.5rem 0; }
.flyer-img{
  max-width: 250px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.flyer-link{
  display:inline-block;
  margin-top:.25rem;
  color:#0073e6;
  font-weight:500;
}
