/* ============================================================
   Teatro Corfú 7 — Histórico (archive grid of past events)
   ============================================================ */

/* ---------- Page wrapper ---------- */
/* Higher specificity than .elementor-page .site-main (which zeroes out
   the bottom padding for full-width Elementor pages) so the grid never
   ends up flush against the footer. */
.elementor-page .site-main.historico-main,
.historico-main {
  padding-top: calc(var(--header-offset) + clamp(48px, 6vh, 72px));
  padding-bottom: calc(clamp(80px, 10vh, 120px) + var(--bottom-bar-h, 0px)) !important;
  max-width: none;
}

/* ---------- Page header ---------- */
.historico-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto clamp(48px, 6vh, 72px);
  padding: 0 clamp(20px, 5vw, 40px);
}

.historico-header__eyebrow {
  font-family: var(--tiny);
  font-size: clamp(.6rem, .3vw + .52rem, .72rem);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 clamp(10px, 1.5vh, 16px);
}

.historico-header__title {
  font-family: var(--corfu7-display);
  font-size: clamp(2.6rem, 5vw + 1rem, 5.2rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--white);
  margin: 0 0 clamp(14px, 2vh, 20px);
}

.historico-header__count {
  font-family: var(--tiny);
  font-size: clamp(.68rem, .35vw + .58rem, .82rem);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}

/* ---------- Grid ---------- */
.historico-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(12px, 1.5vw, 20px);
  padding: 0 clamp(20px, 5vw, 56px);
  max-width: 1400px;
  margin: 0 auto clamp(60px, 8vh, 100px);
}

/* ---------- Card ---------- */
.historico-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  overflow: hidden;
}

.historico-card__poster {
  position: relative;
  background: rgba(255,255,255,.04);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  transition:
    border-color .35s var(--ease),
    box-shadow .35s var(--ease),
    transform .35s var(--ease);
}

.historico-card:hover .historico-card__poster {
  border-color: rgba(18,163,140,.4);
  box-shadow:
    0 0 0 1px rgba(18,163,140,.18),
    0 20px 56px -18px rgba(1,158,199,.45);
  transform: translateY(-4px) scale(1.015);
}

.historico-card__poster img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .5s var(--ease);
}

.historico-card:hover .historico-card__poster img {
  transform: scale(1.06);
}

/* Fallback when no image */
.historico-card__no-img {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: linear-gradient(
    135deg,
    rgba(18,163,140,.08) 0%,
    rgba(1,158,199,.06) 50%,
    rgba(199,204,0,.05) 100%
  );
}

/* Overlay */
.historico-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(14px, 2vw, 20px);
  background: linear-gradient(
    to top,
    rgba(6,7,10,.92) 0%,
    rgba(6,7,10,.65) 35%,
    rgba(6,7,10,.0) 62%
  );
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}

.historico-card:hover .historico-card__overlay {
  opacity: 1;
  transform: translateY(0);
}

.historico-card__cat {
  font-family: var(--tiny);
  font-size: clamp(.52rem, .26vw + .46rem, .62rem);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: clamp(5px, .8vh, 8px);
  display: block;
}

.historico-card__name {
  font-family: var(--corfu7-display);
  font-size: clamp(.95rem, 1.2vw + .5rem, 1.25rem);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.15;
  color: var(--white);
  margin: 0 0 clamp(4px, .6vh, 7px);
  text-wrap: balance;
}

.historico-card__date {
  font-family: var(--tiny);
  font-size: clamp(.6rem, .28vw + .52rem, .7rem);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  margin: 0;
}

/* ---------- Empty state ---------- */
.historico-empty {
  text-align: center;
  color: var(--ink-faint);
  font-family: var(--tiny);
  font-size: .9rem;
  letter-spacing: .06em;
  padding: clamp(48px, 8vh, 80px) 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .historico-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .historico-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .historico-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(10px, 2vw, 14px);
    padding: 0 clamp(14px, 4vw, 24px);
  }

  /* On touch devices always show the overlay */
  .historico-card__overlay {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 400px) {
  .historico-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0 12px;
  }
}
