/* THE IVORY GROVE — Dining & Lounge page. Breakpoints: 1199px and 600px */

.menu {
  min-width: 0;
}

/* Category chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 34px;
}
.chip {
  padding: 11px 18px;
  border: 1px solid rgba(var(--cream-rgb), 0.2);
  border-radius: 999px;
  background: transparent;
  color: var(--color-stone);
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition:
    background-color 0.6s var(--ease-luxury),
    color 0.6s var(--ease-luxury),
    border-color 0.6s var(--ease-luxury);
}
.chip:hover {
  color: var(--color-cream);
  border-color: rgba(var(--cream-rgb), 0.45);
}
.chip.on {
  background: var(--color-oxblood);
  border-color: var(--color-oxblood);
  color: var(--color-cream);
}
.chip:focus-visible {
  outline: 2px solid var(--color-cream);
  outline-offset: 2px;
}

/* Category heading */
.dhead {
  margin-bottom: 26px;
}
.dhead h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.4vw, 46px);
  font-weight: 400;
  line-height: 1.05;
}
.dhead p {
  margin-top: 8px;
  font-size: 20px;
  font-style: italic;
  color: var(--color-stone-light);
}

/* Dish cards */
.dgrid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 22px;
}

.dcard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(var(--cream-rgb), 0.1);
  background: rgba(var(--cream-rgb), 0.04);
  animation: dish-in 1s var(--ease-luxury) calc(var(--i, 0) * 90ms) both;
  transition:
    border-color 0.7s var(--ease-luxury),
    transform 0.8s var(--ease-luxury);
}
@media (hover: hover) {
  .dcard:hover {
    border-color: rgba(var(--cream-rgb), 0.28);
    transform: translateY(-4px);
  }
}

.dcard__img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #4a3428, #1f1511);
}
.dcard__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.8s var(--ease-luxury);
}
@media (hover: hover) {
  .dcard:hover .dcard__img img {
    transform: scale(1.06);
  }
}
.dcard__img::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 55%,
    rgba(var(--espresso-deep-rgb), 0.5)
  );
}

/* Placeholder when a photo is not added yet */
.dcard__img.no-img img {
  display: none;
}
.dcard__img.no-img::before {
  content: attr(data-l);
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 64px;
  font-style: italic;
  color: rgba(var(--cream-rgb), 0.28);
}

.dcard__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 20px 20px 18px;
}
.dcard__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.dcard__name {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.1;
}
.dcard__price {
  flex: none;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 500;
  color: var(--color-cream);
}
.dcard__desc {
  font-size: 18px;
  line-height: 1.4;
  color: var(--color-stone-light);
}
.dcard__ctl {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 10px;
}

.dnote {
  margin-top: 28px;
  font-family: var(--font-body);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--color-stone-dim);
}
.dnote[hidden] {
  display: none;
}

/* Tablet (1199px and below) */
@media (max-width: 1199px) {
  .dgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile (600px and below) */
@media (max-width: 600px) {
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 calc(-1 * var(--pad-x)) 26px;
    padding: 2px var(--pad-x) 8px;
    scrollbar-width: none;
  }
  .chips::-webkit-scrollbar {
    display: none;
  }
  .dgrid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .dcard {
    border-radius: 20px;
  }
  .dcard__img {
    aspect-ratio: 16 / 10;
  }
  .dcard__body {
    padding: 16px 16px 14px;
  }
  .dcard__name {
    font-size: 23px;
  }
  .dcard__price {
    font-size: 21px;
  }
  .dcard__desc {
    font-size: 17px;
  }
  .dhead p {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dcard {
    animation: none;
  }
}

.dsec + .dsec {
  margin-top: 56px;
}
.dsec .dhead {
  margin-bottom: 22px;
}

/* ===== Page loader ===== */
.pageload {
  display: none;
}
.js .pageload {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 24px;
  background: radial-gradient(
    65% 65% at 50% 48%,
    var(--color-espresso) 0%,
    var(--color-espresso-deep) 85%
  );
  transition:
    transform 1.2s cubic-bezier(0.76, 0, 0.24, 1),
    visibility 0s linear 1.2s;
}
.js .pageload.done {
  transform: translateY(-100%);
  visibility: hidden;
}
.pageload__logo {
  width: min(240px, 62vw);
  height: auto;
  animation: pl-in 1.3s var(--ease-luxury) 0.15s both;
}
.pageload__line {
  width: min(170px, 46vw);
  height: 1px;
  transform-origin: left;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-oxblood),
    var(--color-stone),
    transparent
  );
  animation: pl-line 1.6s cubic-bezier(0.76, 0, 0.24, 1) 0.3s both;
}
@keyframes pl-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes pl-line {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* Hold the card animations until the loader lifts */
.js:not(.dl-ready) [data-anim].is-in {
  opacity: 0;
  transform: translate3d(0, 44px, 0);
  filter: blur(6px);
}

/* ===== Card animation: rise + zoom, photo opens like a curtain ===== */
.dcard {
  animation: none;
}
.js .dcard[data-anim] .dcard__img {
  clip-path: inset(0 0 22% 0);
  transition: clip-path 1.8s cubic-bezier(0.65, 0, 0.35, 1)
    calc(var(--d, 0s) + 0.2s);
}
.js .dcard[data-anim].is-in .dcard__img {
  clip-path: inset(0 0 0 0);
}
@media (hover: hover) {
  .js .dcard.is-in:hover {
    transform: translateY(-4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .pageload {
    display: none;
  }
  .js:not(.dl-ready) [data-anim].is-in {
    opacity: 1;
    transform: none;
    filter: none;
  }
  .js .dcard[data-anim] .dcard__img {
    clip-path: none;
  }
}
