/* Comida gallery (screen18): marquee wall + the pull-up drawer (reused by regalos/bulb). */

/* Endless-scroll wall (comida gallery): fixed number of tracks, each an
   overflow:hidden window onto a track__inner that's twice as long as it
   needs to be (see initMarqueeGallery in script.js) and animated by
   transform, so it loops forever with no visible seam. Square tiles
   (aspect-ratio + a size pinned to the track's own cross-axis, via flex
   stretch) keep the math simple and the wall visually even, unlike the
   aspect-preserving carousel below. */
.marquee-gallery {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  gap: 1rem;
}

.marquee-track {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
  /* overflow:hidden clips each photo's box-shadow flat wherever a tile
     straddles the track's edge - fading the track itself out near its edges
     (instead of hard-clipping) blends that away instead of chopping it. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
}

.marquee-track__inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: marquee-scroll-y var(--marquee-duration, 30s) linear infinite;
}

.marquee-track__inner--reverse {
  animation-direction: reverse;
}

/* The tile (not the photo) carries the aspect-ratio/border/white background
   and clips its content - so hiding the photo inside it (opacity, while its
   own tile is open in the lightbox) reveals a plain white square rather than
   leaving a hole, and fading it back on close never fades the border too. */
.marquee-tile {
  width: 100%;
  aspect-ratio: 1;
  flex-shrink: 0;
  border: 4px solid #ffffff;
  border-radius: 4px;
  background: #ffffff;
  overflow: hidden;
}

.marquee-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.6s ease;
}

.marquee-photo--hidden {
  opacity: 0;
  cursor: default;
  pointer-events: none;
}

@keyframes marquee-scroll-y {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(calc(var(--marquee-shift, 0px) * -1));
  }
}

@keyframes marquee-scroll-x {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(var(--marquee-shift, 0px) * -1));
  }
}

@media (max-width: 600px) {
  .marquee-gallery {
    flex-direction: column;
  }

  .marquee-track {
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
  }

  .marquee-track__inner {
    flex-direction: row;
    height: 100%;
    animation-name: marquee-scroll-x;
  }

  .marquee-tile {
    width: auto;
    height: 100%;
  }
}

/* Pull-up drawer teaser (comida gallery only): hidden entirely until the
   first photo is opened, then sits collapsed as just a handle peeking above
   the bottom edge. The handle stays glued to the panel's top edge at all
   times (see .comida-drawer__handle's negative top) - toggling
   .comida-drawer--open just slides the whole assembly between "handle only"
   and "handle + panel", so the handle visibly travels with the panel. */
.comida-drawer {
  position: fixed;
  left: 0;
  right: 0;
  /* Flush with the true bottom edge - when open, the panel's bottom (and its
     shadow) sit exactly at the screen edge, so the shadow gets clipped by
     body's overflow:hidden instead of floating visibly in a gap below the
     panel. The handle still needs to rest above the edge while collapsed,
     so that lift now lives in the collapsed transform below instead. */
  bottom: 0;
  height: 50vh;
  display: none;
  transform: translateY(calc(100% - 2rem));
  transition: transform 0.5s ease;
  z-index: 5;
}

.comida-drawer.comida-drawer--shown {
  display: block;
}

.comida-drawer.comida-drawer--open {
  transform: translateY(0);
}

.comida-drawer__handle {
  position: absolute;
  /* More negative than the handle's own height (3.5rem) on purpose, so a
     visible gap opens up between the handle and the panel's top edge once
     expanded, instead of them touching. */
  top: -4.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  /* "White shadow" glow, on purpose, rather than the usual dark drop-shadow -
     it's meant to stand out against whatever busy photo is behind it. Once
     open, a busy photo isn't what's behind it anymore (the panel is), so it
     switches to a soft gray instead - see .comida-drawer--open below. */
  box-shadow: 0 0 16px 4px rgba(255, 255, 255, 0.85);
  transition: box-shadow 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.comida-drawer--open .comida-drawer__handle {
  box-shadow: 0 0 16px 4px rgba(60, 60, 60, 0.5);
}

.comida-drawer__arrow {
  display: inline-block;
  font-size: 1.6rem;
  line-height: 1;
  color: #000000;
  transition: transform 0.5s ease;
}

.comida-drawer--open .comida-drawer__arrow {
  transform: rotate(180deg);
}

.comida-drawer__panel {
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem;
  text-align: center;
  border-top-left-radius: 1.5rem;
  border-top-right-radius: 1.5rem;
  box-shadow: 0 0 16px 4px rgba(255, 255, 255, 0.85);
  transition: box-shadow 0.5s ease;
}

.comida-drawer--open .comida-drawer__panel {
  box-shadow: 0 0 16px 4px rgba(60, 60, 60, 0.5);
}

.comida-drawer__message {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.8rem;
  color: #000000;
  max-width: 30rem;
  line-height: 1.4;
}

.comida-drawer .next-btn {
  color: #000000;
  border-color: #000000;
}

/* The regalos drawer steps through three messages in place (see
   regalosDrawerNext in script.js) - same 1.2s crossfade as the rest of the
   site. background/color re-listed so the hover fade isn't dropped. */
#regalosDrawer .comida-drawer__message,
#regalosDrawer .next-btn {
  transition: opacity 1.2s ease, background 0.3s ease, color 0.3s ease;
}

/* This button stays in place across all three messages, so a hover fill
   never cleared - the pointer (or a phone's sticky tap-hover) was still on
   it when the next message faded in, leaving it black. Only fills while
   actually pressed instead: white with black text normally, black with
   white text on press. Must come after the #screen28 .next-btn:hover rule
   (same specificity) to win. */
#regalosDrawer .next-btn:hover {
  background: transparent;
  color: #000000;
}

#regalosDrawer .next-btn:active {
  background: #000000;
  color: #ffffff;
}

.comida-drawer .next-btn:hover {
  background: #000000;
  color: #ffffff;
}
