:root {
  color-scheme: light dark;
  --bg: #f6f5f2;
  --surface: #F9F9DF;
  --text: #1d1d1b;
  --muted: #66655e;
  --border: #e2e0da;
  --accent: #b3400d;
  --open-fg: #ffffff;
  --open-bg: #15803d;
  --soon-fg: #3b2300;
  --soon-bg: #f59e0b;
  --closed-fg: #55544e;
  --closed-bg: #eceae5;
  --radius: 0.625rem;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151513;
    --surface: #1e1e1b;
    --text: #ecebe6;
    --muted: #a5a49b;
    --border: #34332f;
    --accent: #f08a54;
    --open-fg: #f0fdf4;
    --open-bg: #16803c;
    --soon-fg: #fffbeb;
    --soon-bg: #b45309;
    --closed-fg: #b9b8b0;
    --closed-bg: #2a2a26;
    --shadow: none;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  background: #1a1410;
  color: var(--text);
  font: 1rem/1.55 var(--font);
  -webkit-text-size-adjust: 100%;
}

/* Photo background, darkened. A fixed pseudo-element is more reliable on mobile than background-attachment. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("pizza.jpg") center / cover no-repeat;
  filter: brightness(0.6);
}

.container {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Header and footer */

.site-header {
  padding: 2.5rem 0 1.5rem;
}

h1 {
  margin: 0 0 0.5rem;
  color: #fff;
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.5);
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.lead {
  margin: 0;
  max-width: 36rem;
  color: #f3efe9;
  text-shadow: 0 1px 6px rgb(0 0 0 / 0.6);
}

.site-footer {
  padding-top: 1rem;
  padding-bottom: 2.5rem;
  color: #e6e1d9;
  font-size: 0.875rem;
  text-shadow: 0 1px 4px rgb(0 0 0 / 0.6);
}

/* Categories */

.category {
  margin-top: 2rem;
}

.category-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin: 0 0 0.875rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgb(255 255 255 / 0.55);
  color: #fff;
  text-shadow: 0 1px 6px rgb(0 0 0 / 0.6);
}

.category h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Place card */

.place {
  margin-bottom: 0.875rem;
  padding: 1rem 1.125rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.place-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.place h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.clock {
  flex: none;
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
}

.badge-open { color: var(--open-fg); background: var(--open-bg); }
.badge-closing { color: var(--soon-fg); background: var(--soon-bg); }
.badge-closed { color: var(--closed-fg); background: var(--closed-bg); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.875rem 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  max-width: 100%;
  padding: 0.25rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
}

a.btn:hover {
  border-color: var(--accent);
}

.btn-static {
  color: var(--text);
}

.category-head .label {
  color: #e6e1d9;
}

.label {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 400;
}

.today {
  margin: 0.875rem 0 0.25rem;
  font-weight: 500;
}

.today .label {
  margin-right: 0.25rem;
}

/* Expandable sections */

details {
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.today + details {
  margin-top: 0.5rem;
}

summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  cursor: pointer;
  list-style: none;
  font-weight: 500;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "";
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

details[open] > summary::before {
  transform: rotate(45deg);
}

.count {
  color: var(--muted);
  font-weight: 400;
}

/* Opening hours table */

.hours {
  width: 100%;
  margin-bottom: 0.5rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.hours th,
.hours td {
  padding: 0.4rem 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.hours tr:last-child th,
.hours tr:last-child td {
  border-bottom: 0;
}

.hours th {
  width: 8rem;
  font-weight: 400;
  color: var(--muted);
}

.hours .is-today th,
.hours .is-today td {
  color: var(--text);
  font-weight: 600;
}

/* Menu scans: scaled to the width, never cropped */

.menu {
  display: grid;
  gap: 1rem;
  padding: 0.5rem 0 0.5rem;
}

.menu figure {
  margin: 0;
}

.menu a {
  display: block;
}

.menu img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
}

.menu figcaption {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.menu-updated {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

/* Empty state */

.empty {
  margin-top: 1rem;
  padding: 2rem 1.25rem;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty h2 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}

.empty p {
  margin: 0;
  color: var(--muted);
}

/* Larger screens */

@media (min-width: 40rem) {
  .container { padding: 0 1.5rem; }
  .site-header { padding: 3.5rem 0 2rem; }
  h1 { font-size: 2rem; }
  .place { padding: 1.25rem 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
