:root {
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #191513;
  background: #fbfaf7;
  --ink: #191513;
  --muted: #655d56;
  --line: #ded7ce;
  --paper: #fffdf9;
  --soft: #f4f0ea;
  --accent: #a63e32;
  --accent-dark: #722922;
  --red: var(--accent);
  --red-dark: var(--accent-dark);
  --green: #286f5c;
  --green-soft: #e5f2ed;
  --gold: #b9841f;
  --sky: #1f628e;
  --photo-panel: rgba(255, 255, 255, 0.97);
  --shadow: 0 18px 44px rgba(28, 24, 20, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(180deg, #fffdf9 0%, #f8f5ef 100%);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px max(18px, calc((100vw - 1220px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.brand,
.data-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-size: 18px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--red);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(173, 61, 47, 0.2);
}

svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-actions {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto;
  gap: 10px;
  align-items: center;
  width: min(560px, 100%);
}

.search-field {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.data-link,
.filters button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--paper);
  font-size: 14px;
}

main {
  width: min(1220px, calc(100% - 36px));
  margin: 0 auto;
  padding: 26px 0 54px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 250px);
  gap: 18px;
  align-items: end;
  padding: 12px 0 26px;
}

.intro h1 {
  max-width: 780px;
  font-size: clamp(34px, 6vw, 70px);
  line-height: 1;
  letter-spacing: 0;
  font-weight: 800;
}

.intro p,
.section-head span,
.location,
.highlight.muted {
  color: var(--muted);
}

.intro p {
  margin-top: 14px;
  font-size: 16px;
}

.intro-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.intro-card span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.intro-card strong {
  font-size: 28px;
  line-height: 1.05;
  font-weight: 800;
}

.featured {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.section-head h2,
.filter-head h2 {
  font-size: 18px;
  line-height: 1.2;
}

.section-head.compact {
  padding: 4px 0 12px;
}

.featured-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}

.featured-card,
.restaurant-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  overflow: hidden;
  box-shadow: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.featured-card {
  min-height: 250px;
  display: grid;
  grid-template-rows: 150px auto auto auto;
  gap: 7px;
  padding-bottom: 12px;
  scroll-snap-align: start;
}

.featured-card:hover,
.restaurant-card:hover {
  border-color: #d8cabf;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.featured-card span,
.featured-card strong,
.featured-card small {
  padding: 0 12px;
}

.featured-card span,
.featured-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.featured-card strong {
  font-size: 20px;
  line-height: 1.16;
  font-weight: 800;
}

.directory-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.filters {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.filters select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.filters button {
  min-height: 34px;
  color: var(--red-dark);
  font-weight: 800;
}

.filters .location-button {
  gap: 8px;
  color: var(--green);
}

.filters .location-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.location-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.manual-location {
  display: grid;
  gap: 9px;
}

.manual-location[hidden] {
  display: none;
}

.manual-location input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.manual-location input:disabled,
.manual-location button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.results-wrap {
  min-width: 0;
}

.results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.restaurant-card {
  min-width: 0;
  display: grid;
  grid-template-rows: 190px minmax(250px, 1fr);
  isolation: isolate;
}

.card-body {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 100%;
  padding: 14px;
  border-top: 1px solid rgba(32, 25, 21, 0.08);
  background: var(--photo-panel);
  color: var(--ink);
}

.chips,
.detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip,
.detail-chips span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--soft);
  color: #574941;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}

.chip.price {
  background: #fff0ca;
  color: #704c08;
}

.chip.spice {
  background: #ffe8df;
  color: var(--red-dark);
}

.chip.status {
  background: var(--green-soft);
  color: var(--green);
}

.chip.distance {
  background: #eaf3ff;
  color: var(--sky);
}

.restaurant-card h3 {
  font-size: 22px;
  line-height: 1.16;
  font-weight: 800;
}

.location {
  font-size: 14px;
  line-height: 1.4;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.detail-action {
  min-width: 0;
  max-width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.detail-action:hover,
.detail-action:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(32, 25, 21, 0.09);
}

.detail-action:focus-visible {
  outline: 3px solid rgba(173, 61, 47, 0.25);
  outline-offset: 2px;
}

.detail-action svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.detail-action span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-action.map {
  border-color: #e6c7c2;
  background: #fff7f5;
  color: var(--red-dark);
}

.detail-action.reserve {
  border-color: #bfd9cf;
  background: #f3faf7;
  color: var(--green);
}

.detail-action.order {
  border-color: #bfd5e1;
  background: #f3f9fd;
  color: var(--sky);
}

.specialty-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.specialty-row span {
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.specialty-row strong {
  min-width: 0;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
}

.highlight {
  color: #463b34;
  font-size: 14px;
  line-height: 1.45;
}

.featured-image,
.card-image,
.detail-hero,
.image-fallback {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: var(--soft);
}

.featured-image,
.card-image {
  border-bottom: 1px solid rgba(32, 25, 21, 0.08);
}

.image-fallback {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(173, 61, 47, 0.14), rgba(40, 111, 92, 0.14)),
    #fffaf7;
}

.image-fallback span {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--paper);
  color: var(--red-dark);
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(67, 41, 25, 0.12);
}

.empty {
  grid-column: 1 / -1;
  min-height: 150px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  padding: 28px;
}

dialog {
  width: min(1160px, calc(100vw - 48px));
  max-height: min(780px, calc(100dvh - 48px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(25, 21, 18, 0.24);
}

dialog::backdrop {
  background: rgba(25, 21, 18, 0.36);
}

.icon-button {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(25, 21, 18, 0.12);
}

#detail-content {
  max-height: inherit;
}

.detail-shell {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  min-height: 0;
  height: min(760px, calc(100dvh - 48px));
}

.detail-gallery {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: #171412;
}

.detail-carousel,
.detail-carousel-stage {
  min-width: 0;
  min-height: 0;
}

.detail-carousel {
  position: sticky;
  top: 16px;
  height: 100%;
}

.detail-carousel-stage {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #171412;
  touch-action: pan-y;
  user-select: none;
}

.detail-carousel-stage:focus-visible {
  outline: 3px solid rgba(173, 61, 47, 0.34);
  outline-offset: 3px;
}

.detail-hero {
  border-radius: 8px;
  overflow: hidden;
  background: #171412;
}

.detail-carousel .detail-hero {
  object-fit: contain;
}

.detail-hero[hidden],
.carousel-fallback[hidden] {
  display: none;
}

.photo-nav {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(32, 25, 21, 0.1);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.88);
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(32, 25, 21, 0.16);
  transform: translateY(-50%);
}

.photo-nav:hover,
.photo-nav:focus-visible {
  background: var(--paper);
}

.photo-nav.previous {
  left: 12px;
}

.photo-nav.next {
  right: 12px;
}

.photo-counter,
.photo-dots {
  position: absolute;
  z-index: 1;
  left: 50%;
  transform: translateX(-50%);
}

.photo-counter {
  top: 12px;
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  background: rgba(32, 25, 21, 0.68);
  color: #ffffff;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}

.photo-dots {
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  background: rgba(32, 25, 21, 0.42);
  padding: 6px 8px;
}

.photo-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
}

.photo-dot[data-active="true"] {
  width: 18px;
  background: #ffffff;
}

.detail-copy {
  display: grid;
  align-content: start;
  gap: 18px;
  max-height: 100%;
  padding: 38px 42px 42px;
  overflow: auto;
}

.detail-copy > .chips:first-child {
  padding-right: 58px;
}

.detail-copy h2 {
  max-width: calc(100% - 58px);
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.02;
  font-weight: 750;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.fact-grid div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.fact-grid strong {
  font-size: 18px;
  line-height: 1.25;
}

.fact-grid span,
.detail-section h3 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.detail-section {
  display: grid;
  gap: 10px;
}

.detail-chips span {
  min-height: 30px;
  padding: 5px 11px;
  font-size: 13px;
}

.quote-list,
.source-list {
  display: grid;
  gap: 8px;
}

.quote-list a,
.source-list a {
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
}

.quote-list a {
  display: grid;
  gap: 5px;
}

.quote-list span {
  font-size: 15px;
  line-height: 1.6;
}

.quote-list small,
.source-list a {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 1080px) {
  .results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .site-header {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 16px;
  }

  .header-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  main {
    width: min(100% - 28px, 620px);
    padding-top: 18px;
  }

  .intro,
  .directory-layout {
    grid-template-columns: 1fr;
  }

  .intro h1 {
    font-size: clamp(36px, 12vw, 54px);
  }

  .filters {
    position: sticky;
    top: 0;
    z-index: 5;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
  }

  .filter-head {
    grid-column: 1 / -1;
    order: 0;
  }

  .filters label {
    order: 2;
  }

  .filters .location-button {
    order: 1;
    grid-column: 1 / -1;
    min-height: 48px;
    border-color: var(--green);
    background: var(--green);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(40, 111, 92, 0.18);
  }

  .filters .location-button:disabled {
    opacity: 0.82;
  }

  .location-status,
  .manual-location {
    order: 1;
    grid-column: 1 / -1;
  }

  .location-status {
    min-height: 0;
  }

  .results {
    grid-template-columns: 1fr;
  }

  .restaurant-card {
    grid-template-rows: 210px auto;
  }

  .detail-shell {
    grid-template-columns: 1fr;
    min-height: 0;
    height: auto;
    max-height: calc(100dvh - 28px);
    overflow: auto;
  }

  .detail-gallery {
    grid-template-rows: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .detail-carousel {
    position: static;
    height: auto;
  }

  .detail-carousel-stage {
    height: auto;
    aspect-ratio: 16 / 10;
  }

  .detail-copy {
    max-height: none;
    padding: 24px;
    overflow: visible;
  }

  .detail-copy h2 {
    font-size: clamp(32px, 9vw, 44px);
  }

  .detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-action {
    justify-content: center;
    padding-inline: 10px;
  }
}

@media (max-width: 520px) {
  .brand {
    white-space: nowrap;
  }

  .brand span:last-child {
    font-size: 17px;
  }

  .header-actions {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .search-field {
    width: 100%;
  }

  .data-link {
    display: none;
  }

  main {
    width: calc(100% - 24px);
  }

  .intro {
    padding-top: 8px;
  }

  .intro-card {
    grid-template-columns: 1fr 1fr;
    align-items: end;
  }

  .intro-card strong {
    text-align: right;
    font-size: 22px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .featured-strip {
    grid-auto-columns: 82%;
  }

  .filters {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
    margin-inline: 0;
    padding: 10px;
    overflow: visible;
    scrollbar-width: auto;
    scroll-snap-type: none;
  }

  .filter-head {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    scroll-snap-align: none;
  }

  .filter-head h2 {
    font-size: 16px;
  }

  .filters label {
    min-width: 0;
    gap: 4px;
    font-size: 10px;
    scroll-snap-align: none;
  }

  .filters select,
  .manual-location input {
    min-height: 38px;
    padding: 0 8px;
    font-size: 14px;
  }

  .filters button {
    min-height: 38px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .filters .location-button {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    font-size: 15px;
    scroll-snap-align: none;
  }

  .filters .location-button svg {
    width: 20px;
    height: 20px;
  }

  .location-status {
    grid-column: 1 / -1;
    min-height: 0;
    display: flex;
    align-items: center;
    scroll-snap-align: none;
  }

  .manual-location {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    scroll-snap-align: none;
  }

  .manual-location label {
    min-width: 0;
  }

  .restaurant-card h3 {
    font-size: 21px;
  }

  dialog {
    width: min(100% - 24px, 620px);
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    margin: auto;
    border-radius: 8px;
  }

  .detail-gallery {
    padding: 10px;
  }

  .detail-carousel-stage {
    aspect-ratio: 4 / 3;
  }

  .photo-nav {
    width: 38px;
    height: 38px;
  }

  .photo-nav.previous {
    left: 8px;
  }

  .photo-nav.next {
    right: 8px;
  }

  .fact-grid {
    grid-template-columns: 1fr;
  }
}
