.events-hero {
  aspect-ratio: 390 / 700;
}

@media (min-width: 1024px) {
  .events-hero {
    aspect-ratio: 1728 / 1117;
  }
}

.event-spaces {
  background: var(--color-cream);
  padding: var(--space-xl) var(--space-section-x);
  display: flex;
  flex-direction: column;
}

.event-spaces__header {
  text-align: center;
  max-width: 45rem;
  margin: 0 auto;
  /* Was the section's own `gap` (--space-lg) — less than the section's
     own top padding (--space-xl) above this block, so the header sat
     with more room above it than below. Matching this to that top
     padding keeps the header centered in even space on both sides. */
  margin-bottom: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.event-spaces__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--fs-section-title);
  color: var(--color-olive);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.event-spaces__subtitle {
  font-size: var(--fs-body);
  color: var(--color-olive);
  line-height: 1.5;
}

/* Grid, not stacked flex columns — a real grid keeps each row's cards
   aligned to that row's own track, so a taller title in one card (from
   text wrapping to 2 lines) can't push just its own column's next card
   down out of line with its row-mates, the way independent per-column
   flex stacks did. */
.event-spaces__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.event-card {
  display: block;
  position: relative;
}

.event-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.event-card__media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.event-card:hover .event-card__media-img {
  transform: scale(1.04);
}

/* Two images stacked in the same box — the hover one sits on top, hidden
   until hover, so hovering crossfades from the base photo to the second
   one instead of just fading the single image to transparent. */
.event-card__media-img--hover {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.event-card:hover .event-card__media-img--hover {
  opacity: 1;
}

.event-card:hover .event-card__title {
  opacity: 0.7;
}

.event-card__tag {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  background: rgba(225, 228, 230, 0.2);
  backdrop-filter: blur(4px);
  color: var(--color-cream);
  font-size: var(--fs-label);
  text-transform: uppercase;
  padding: 0.5em 0.9em;
  border-radius: 0.25rem;
}

.event-card__explore {
  position: absolute;
  bottom: var(--space-sm);
  left: var(--space-sm);
  /* Outline, not solid-filled — was background: cream/color: olive
     (a filled pill), matching the site's default .btn treatment
     (transparent, cream border/text) instead now that it's sitting
     directly on the photo rather than a cream backdrop. */
  background: transparent;
  border: 1px solid var(--color-cream);
  color: var(--color-cream);
  font-family: var(--font-body);
  font-size: var(--fs-label);
  text-transform: uppercase;
  padding: 0.5em 0.9em;
  border-radius: 0.25rem;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.event-card:hover .event-card__explore {
  opacity: 1;
  transform: translateY(0);
}

.event-card__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.75rem, 1.4rem + 1.5vw, 3rem);
  color: var(--color-olive);
  text-transform: uppercase;
  margin-top: var(--space-sm);
  /* Figma sets this much tighter than the inherited body default (1.4) —
     measured line-to-line spacing on 2-line titles matches the font-size
     almost exactly (~1:1), not 1.4x it. */
  line-height: 1;
  transition: opacity 0.18s ease;
}

@media (min-width: 1024px) {
  .event-spaces__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Event card modal — opened by clicking a card in .event-spaces__grid
   (see event-modal.js). Figma (node 526:2868) shows it as a large panel
   inset from the top-left of the viewport, dark backdrop showing through
   the gap; that inset is desktop-only here, full-screen on mobile. */
.event-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
}

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

.event-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(66, 68, 47, 0.94);
}

.event-modal__close {
  /* On mobile the panel is full-screen cream, so this sits ON the cream —
     plain dark icon, no circle. Only at the desktop breakpoint does it sit
     over the dark backdrop margin (see below), where it needs the
     inverted/cream treatment instead. */
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  z-index: 2;
  width: 3.625rem;
  height: 3.625rem;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-modal__close img {
  width: 1.5rem;
  height: 1.5rem;
}

.event-modal__panel {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  background: var(--color-cream);
  padding: var(--space-xl) var(--space-section-x);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.event-modal__subtitle {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 3rem;
  color: var(--color-olive);
  text-transform: uppercase;
}

.event-modal__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--fs-section-title);
  line-height: 1;
  color: var(--color-olive);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-top: var(--space-xs);
}

.event-modal__description {
  font-family: var(--font-body);
  font-size: 1.75rem;
  line-height: 1.36;
  color: var(--color-olive);
  display: flex;
  flex-direction: column;
  gap: 1em;
  margin-top: var(--space-md);
}

.event-modal__cta {
  margin-top: var(--space-lg);
}

.event-modal__gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.event-modal__gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-md);
}

@media (min-width: 1024px) {
  .event-modal__close {
    top: 4.875rem;
    left: 5rem;
    border: 1px solid var(--color-cream);
  }

  .event-modal__close img {
    /* close.svg is authored dark (olive) for use on cream backgrounds;
       at this breakpoint the button sits on the dark backdrop margin
       instead, so invert it to cream. */
    filter: invert(1);
  }

  .event-modal__panel {
    top: 4.875rem;
    left: 12.25rem;
    padding: 5rem 3.8125rem 5rem 8.4375rem;
    flex-direction: row;
    align-items: flex-start;
    gap: 9.75rem;
  }

  .event-modal__content {
    flex: 0 0 41.125rem;
    max-width: 41.125rem;
    /* .event-modal__panel is the scroll container (overflow-y: auto) for
       both columns — sticking the text column to its own top keeps it in
       view while the taller gallery column scrolls past beside it. */
    position: sticky;
    top: 0;
    align-self: flex-start;
  }

  .event-modal__gallery {
    flex: 0 0 32.625rem;
    max-width: 32.625rem;
  }
}

/* Events "Asador at Lennan's Yard" banner carries two paragraphs, too much
   for the fixed aspect-ratio banner on narrow screens — let it grow with
   the copy instead, keeping the base ratio as a minimum. */
.dining-room--long-copy {
  aspect-ratio: auto;
  min-height: calc(100vw * 600 / 390);
  display: flex;
}

.dining-room--long-copy .dining-room__overlay {
  position: relative;
  inset: auto;
  flex: 1;
  padding-top: 40vw;
  background: linear-gradient(to bottom, transparent 25%, rgba(0, 0, 0, 0.85) 75%);
}

.dining-room--long-copy .dining-room__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

@media (min-width: 1024px) {
  .dining-room--long-copy {
    min-height: calc(100vw * 1080 / 1728);
  }

  .dining-room--long-copy .dining-room__overlay {
    padding-top: var(--space-xl);
    background: linear-gradient(to bottom, transparent 20%, rgba(0, 0, 0, 0.85) 70%);
  }
}
