/* Restaurant directory landing page (Views/Public/Restaurants.cshtml).
   Deliberately namespaced under .rd-* instead of reusing .main-container,
   which Views/Public/Menus.cshtml already owns with a different fixed-height
   layout — the two pages must not fight over the same class names.

   v2: bolder "block" consumer-discovery treatment (vs. the first pass's plain
   list rows) — profile-style cards built around what owners actually upload
   (a small logo mark, not a wide hero photo), not a photo-banner pattern that
   would fight the real asset shape. */

.rd-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--primary-color) 94%, black) 0%,
    var(--primary-color) 60%,
    color-mix(in srgb, var(--primary-color) 85%, #ff8a3d 15%) 100%
  );
  color: var(--color-on-primary);
  padding: 2.75rem 1rem 5rem;
  text-align: center;
}

/* Two soft blurred blobs for a "vibrant/block" backdrop — pure CSS, no imagery
   to source or keep in sync with a claim about the restaurant. */
.rd-hero::before,
.rd-hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.35;
  pointer-events: none;
}
.rd-hero::before {
  width: 16rem;
  height: 16rem;
  background: #ffffff;
  top: -8rem;
  inset-inline-end: -5rem;
}
.rd-hero::after {
  width: 12rem;
  height: 12rem;
  background: #2b0a0a;
  bottom: -7rem;
  inset-inline-start: -4rem;
  opacity: 0.25;
}

.rd-hero__inner {
  position: relative;
}

.rd-hero__eyebrow {
  display: inline-block;
  font-family: "Lalezar", "Yekan Bakh", sans-serif;
  font-size: 1.35rem;
  font-weight: 400;
  margin: 0 0 0.35rem;
  color: #ffe8b8;
}

.rd-hero__title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 0.6rem;
}

.rd-hero__subtitle {
  font-size: 0.95rem;
  opacity: 0.92;
  margin: 0 auto;
  max-width: 32rem;
  line-height: 1.7;
}

.rd-hero__count {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-pill);
  background-color: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 0.85rem;
  font-weight: 600;
}

.rd-search {
  position: relative;
  max-width: 30rem;
  margin: 1.75rem auto 0;
}

.rd-search__icon {
  position: absolute;
  inset-inline-start: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.15rem;
  height: 1.15rem;
  color: var(--color-muted);
  pointer-events: none;
}

.rd-search__input {
  width: 100%;
  min-height: 3.1rem;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  padding: 0 3.1rem 0 1.25rem;
  font-family: inherit;
  font-size: 1rem;
  background-color: var(--color-surface);
  color: var(--color-foreground);
  box-shadow: var(--shadow-lg);
  transition: border-color var(--transition-fast);
}

.rd-search__input:focus-visible {
  outline: none;
  border-color: var(--color-on-primary);
}

.rd-search__input::placeholder {
  color: var(--color-muted);
}

.rd-search__clear {
  position: absolute;
  inset-inline-end: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.15rem;
  height: 2.15rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.rd-search__clear.is-visible {
  display: flex;
}

.rd-search__clear:hover {
  background-color: var(--color-background);
}

.rd-body {
  max-width: 72rem;
  margin: -3rem auto 0;
  padding: 0 1rem 3rem;
  position: relative;
}

.rd-summary {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 0.9rem 1.25rem;
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

.rd-summary strong {
  color: var(--color-foreground);
}

.rd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 1rem;
}

.rd-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  padding: 1.5rem 1.1rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-sm);
  color: var(--color-foreground);
  min-height: 44px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    border-color var(--transition-fast);
  opacity: 0;
  animation: rd-card-in 420ms ease forwards;
}

/* Stagger the first couple of screens' worth of cards; anything further down
   just appears with the base delay instead of an ever-growing wait. */
.rd-grid .rd-card:nth-child(1) { animation-delay: 20ms; }
.rd-grid .rd-card:nth-child(2) { animation-delay: 60ms; }
.rd-grid .rd-card:nth-child(3) { animation-delay: 100ms; }
.rd-grid .rd-card:nth-child(4) { animation-delay: 140ms; }
.rd-grid .rd-card:nth-child(5) { animation-delay: 180ms; }
.rd-grid .rd-card:nth-child(6) { animation-delay: 220ms; }
.rd-grid .rd-card:nth-child(n+7) { animation-delay: 240ms; }

@keyframes rd-card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .rd-card {
    opacity: 1;
    animation: none;
  }
}

.rd-card:hover,
.rd-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.rd-card__logo-ring {
  flex: 0 0 auto;
  width: 4.75rem;
  height: 4.75rem;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, var(--primary-color) 60%, #ff8a3d));
  display: flex;
  align-items: center;
  justify-content: center;
}

.rd-card__logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  /* contain, not cover: these are uploaded logo marks (and the shared "no
     photo" placeholder, which is 4:3) — cropping to fill a circle can cut off
     real content instead of just cropping empty margin like a photo would. */
  object-fit: contain;
  padding: 0.35rem;
  background-color: var(--color-surface);
  border: 2px solid var(--color-surface);
}

.rd-card__name {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
}

.rd-card__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--color-muted);
  max-width: 100%;
}

.rd-card__meta svg {
  flex: 0 0 auto;
  width: 0.85rem;
  height: 0.85rem;
}

.rd-card__meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rd-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-pill);
  background-color: var(--primary-color-soft);
  color: var(--primary-color);
  font-size: 0.8rem;
  font-weight: 700;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.rd-card:hover .rd-card__cta,
.rd-card:focus-visible .rd-card__cta {
  background-color: var(--primary-color);
  color: var(--color-on-primary);
}

.rd-card__cta svg {
  width: 0.9rem;
  height: 0.9rem;
}

.rd-empty {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--color-muted);
}

.rd-empty__icon-wrap {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background-color: var(--primary-color-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rd-empty svg {
  width: 2rem;
  height: 2rem;
  color: var(--primary-color);
}

.rd-empty p {
  margin: 0;
  font-size: 0.95rem;
}

@media (min-width: 640px) {
  .rd-hero {
    padding: 3.75rem 1rem 5.75rem;
  }

  .rd-hero__eyebrow {
    font-size: 1.7rem;
  }

  .rd-hero__title {
    font-size: 2rem;
  }

  .rd-hero__subtitle {
    font-size: 1.05rem;
  }

  .rd-grid {
    grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
    gap: 1.25rem;
  }
}
