/*
  ============================================================================
  Pizza Directory Template - Global Stylesheet
  ----------------------------------------------------------------------------
  Purpose:
    - Provide clean, reusable, and generation-friendly styles for the pizza
      directory landing page and individual restaurant detail pages.
    - Keep class names semantic and stable so they can be targeted by a future
      generator without brittle selectors.

  Notes for future automation:
    - Header and Footer are wrapped with data attributes and clear comments so
      they can be swapped programmatically.
    - Most layout blocks use simple class hooks (e.g., .cards-grid, .layout)
      to facilitate templating.
  ============================================================================
*/

/* ==================== CSS Variables (Light Theme) ==================== */
:root {
  --color-bg: #f6f7fb;
  --color-surface: #ffffff;
  --color-surface-2: #fafafa;
  --color-border: #e5e7eb;
  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-accent: #e65100; /* warm orange accent */

  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-1: 0 1px 2px rgba(15,23,42,0.04), 0 4px 10px rgba(15,23,42,0.06);
  --shadow-2: 0 8px 30px rgba(15,23,42,0.10);

  --container-max: 1100px;
  --spacing-1: 6px;
  --spacing-2: 10px;
  --spacing-3: 14px;
  --spacing-4: 20px;
  --spacing-5: 28px;
}

/* ==================== Base / Reset ==================== */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.5;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--spacing-4);
}

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

/* ==================== Header (Swappable) ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: linear-gradient(180deg, #ffffff, #fbfbfd);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: saturate(120%) blur(6px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.site-nav ul {
  display: flex;
  gap: var(--spacing-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--color-text-muted);
}

.site-nav a:hover {
  color: var(--color-text);
}

/* ==================== Mobile Navigation ==================== */
.hamburger-menu {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10001;
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background-color: var(--color-text);
  transition: all 0.3s ease;
  transform-origin: center;
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  box-shadow: var(--shadow-2);
  z-index: 10000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.mobile-nav.active {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-3);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
}

.mobile-nav-content {
  padding: var(--spacing-4);
}

.mobile-nav-section {
  margin-bottom: var(--spacing-5);
}

.mobile-nav-section h3 {
  margin: 0 0 var(--spacing-3) 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav-list li {
  margin-bottom: var(--spacing-2);
}

.mobile-nav-list a {
  display: block;
  padding: var(--spacing-2) 0;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.mobile-nav-list a:hover {
  border-bottom-color: var(--color-accent);
}

/* Mobile nav backdrop overlay */
.mobile-nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Always show hamburger menu, hide desktop nav */
.site-nav {
  display: none;
}

/* ==================== Footer (Swappable) ==================== */
.site-footer {
  margin-top: var(--spacing-5);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

/* ==================== Landing: Cards Grid ==================== */
.site-main {
  padding: var(--spacing-5) 0;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-4);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: #d9dce1;
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Square media well; image should NOT stretch. */
.card-media {
  position: relative;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  /* Rectangular sizing for better text space */
  aspect-ratio: 4 / 3;
}

.card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* zoom to fill, maintain aspect ratio */
  object-position: center;
}

.card-body {
  padding: var(--spacing-4);
  display: grid;
  gap: var(--spacing-2);
}

.card-title {
  margin: 0;
  font-size: 1.05rem;
}

.card-summary {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid var(--color-border);
  color: #374151;
  font-size: 12px;
}

/* ==================== Detail Page Layout ==================== */
.page-header {
  padding: var(--spacing-5) 0 var(--spacing-4);
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(180deg, #ffffff, #fafbff);
}

.page-header .title {
  margin: 0;
  font-size: 1.6rem;
}

.subtitle { color: var(--color-text-muted); margin: 4px 0 0 0; }

.badge-row {
  margin-top: var(--spacing-2);
  display: flex;
  gap: var(--spacing-2);
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px solid #fde3d0;
  color: #7c2d12;
  font-size: 12px;
  font-weight: 600;
}

.layout {
  display: grid;
  grid-template-columns: 2fr 1fr; /* Left content, Right sidebar */
  gap: var(--spacing-5);
  align-items: start;
}

/* Responsive stacking */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.content-column,
.sidebar-column {
  display: grid;
  gap: var(--spacing-5);
}

.section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.section-header {
  padding: var(--spacing-4) var(--spacing-4) 0;
}

.section-body {
  padding: var(--spacing-4);
}

/* ======= Hero Card (square image + meta) ======= */
.hero-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--spacing-5);
  align-items: start;
  padding: var(--spacing-5);
}

.hero-square {
  width: 320px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-1);
}

.hero-square img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-4);
  padding-top: var(--spacing-2);
}

.hero-meta .title {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.hero-meta .subtitle {
  margin: 0;
  font-size: 1.1rem;
  color: var(--color-text-muted);
  font-weight: 500;
  line-height: 1.3;
}

.hero-meta .address-line {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.hero-meta .address-line a {
  color: #1d4ed8;
  text-decoration: underline;
  text-decoration-color: rgba(29,78,216,0.3);
  font-weight: 500;
  transition: color 0.2s ease;
}

.hero-meta .address-line a:hover {
  color: #1e40af;
  text-decoration-color: rgba(30,64,175,0.5);
}

.hero-meta .badge-row {
  margin: 0;
  display: flex;
  gap: var(--spacing-3);
  flex-wrap: wrap;
  margin-top: var(--spacing-1);
}

.hero-meta .badge {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
  border: 1px solid #fde3d0;
  color: #7c2d12;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-meta .badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .hero-card { 
    grid-template-columns: 1fr; 
    gap: var(--spacing-4);
    padding: var(--spacing-4);
  }
  
  .hero-square { 
    width: 100%; 
    max-width: 350px;
    margin: 0 auto;
  }
  
  .hero-meta {
    text-align: center;
    gap: var(--spacing-3);
    padding-top: 0;
  }
  
  .hero-meta .title {
    font-size: 1.8rem;
    letter-spacing: -0.01em;
  }
  
  .hero-meta .subtitle {
    font-size: 1rem;
  }
  
  .hero-meta .address-line {
    font-size: 0.95rem;
  }
  
  .hero-meta .badge {
    font-size: 13px;
    padding: 8px 14px;
  }
  
  .hero-meta .badge-row {
    justify-content: center;
    gap: var(--spacing-2);
  }
}

@media (max-width: 480px) {
  .hero-card {
    padding: var(--spacing-3);
  }
  
  .hero-meta .title {
    font-size: 1.6rem;
  }
  
  .hero-meta .subtitle {
    font-size: 0.95rem;
  }
  
  .hero-meta .address-line {
    font-size: 0.9rem;
  }
  
  .hero-meta .badge {
    font-size: 12px;
    padding: 6px 12px;
  }
}

.hero-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
}

.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* keep aspect */
  object-position: center;
}

/* ==================== Structured Info (Right Sidebar) ==================== */
.info-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--spacing-2);
}

.kv {
  
  grid-template-columns: 120px 1fr;
  gap: var(--spacing-2);
}

.kv .k {
  color: var(--color-text-muted);
}

.kv .v a {
  color: #1d4ed8;
  text-decoration: underline;
  text-decoration-color: rgba(29,78,216,0.25);
}

/* Stacked variant: label on top, value below */
.info-stacked .kv { grid-template-columns: 1fr; }
.info-stacked .kv .k { display: block; margin: 0 0 4px 0; color: var(--color-text); font-weight: 700; }
.info-stacked .kv .v { display: block; }

/* Hours list: keep day at start, push time to the opposite edge */
ul[data-field="hours-list"] { padding-left: 20px; }
ul[data-field="hours-list"] li { display: flex; align-items: baseline; gap: 8px; }
ul[data-field="hours-list"] li strong { margin-left: auto; font-weight: 800; }

/* Removed duplicate pill styles - consolidated below */

/* ==================== CTAs & Buttons ==================== */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-1);
}

.btn:hover {
  border-color: #d9dce1;
}

.btn.primary {
  background: var(--color-accent);
  border-color: #db5a1a;
  color: #ffffff;
  font-weight: 700;
}

/* ==================== Media Galleries ==================== */
/* Base media-grid is overridden by inline styles in detail pages */

/* ==================== Reviews & Stories ==================== */
.locals-stories {
  display: grid;
  gap: var(--spacing-4);
}

.story-item {
  padding: var(--spacing-3);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.story-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-2);
}

.reviewer-name {
  font-weight: 600;
  color: var(--color-text);
}

.story-rating {
  color: #f59e0b;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
}

.story-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.reviews-grid {
  display: grid;
  gap: var(--spacing-3);
}

.review-card {
  padding: var(--spacing-3);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3);
}

.review-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
}

.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--spacing-2);
}

.reviewer-name {
  font-weight: 600;
  color: var(--color-text);
  font-size: 14px;
}

.review-rating {
  color: #f59e0b;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.review-date {
  color: var(--color-text-muted);
  font-size: 12px;
  margin-left: auto;
}

.review-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  font-style: italic;
}

.review-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: var(--spacing-2);
  max-width: 400px;
}

.review-image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.review-image:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-2);
}

.review-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Modal Gallery Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  position: relative;
  width: 800px;
  height: 600px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-2);
}

.modal-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: var(--color-text);
  transition: background 0.2s ease;
}

.modal-nav:hover {
  background: rgba(255, 255, 255, 1);
}

.modal-nav.prev {
  left: 20px;
}

.modal-nav.next {
  right: 20px;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 18px;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

.modal-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
}

/* Mobile responsive for review cards */
@media (max-width: 640px) {
  .review-images {
    grid-template-columns: repeat(2, 1fr);
    max-width: 100%;
  }
  
  .modal-content {
    width: 95vw;
    height: 70vh;
  }
  
  .modal-nav {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .modal-nav.prev {
    left: 10px;
  }
  
  .modal-nav.next {
    right: 10px;
  }
  
  .modal-close {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
  
  /* Move Location & Contact section after About section on mobile */
  .layout {
    display: flex;
    flex-direction: column;
  }
  
  .content-column {
    order: 1;
  }
  
  .sidebar-column {
    order: 2;
  }
  
  /* Hide Location & Contact from sidebar on mobile */
  .sidebar-column #business-info-section {
    display: none;
  }
  
  /* Show mobile-only Location & Contact section */
  .mobile-only {
    display: block;
  }
}

/* Hide mobile-only sections on desktop */
@media (min-width: 641px) {
  .mobile-only {
    display: none;
  }
}

/* ==================== FAQ Styling ==================== */
.faq-list {
  display: grid;
  gap: var(--spacing-4);
}

.faq-item {
  padding: var(--spacing-3);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.faq-question {
  margin: 0 0 var(--spacing-2) 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.faq-answer {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* ==================== CTA Styling ==================== */
.cta-list {
  display: grid;
  gap: var(--spacing-3);
}

.cta-item {
  padding: var(--spacing-3);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.cta-item h4 {
  margin: 0 0 var(--spacing-1) 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-accent);
}

.cta-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text-muted);
}

/* ==================== Enhanced Pills ==================== */
.pill {
  background: #f3f4f6;
  border: 1px solid var(--color-border);
  color: #374151;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-2);
}

/* ==================== Lists & Typography ==================== */
h1, h2, h3 {
  line-height: 1.25;
}

h4 {
  line-height: 1.3;
}

p { margin: 0 0 var(--spacing-3) 0; }

ul, ol { padding-left: 18px; }

/* Optional helpers if a field is missing in generation */
.is-optional { display: contents; }
.is-hidden { display: none; }

/* ==================== Fun Facts ==================== */
#fun-fact-section {
  border-left: 6px solid var(--color-text-muted);
  margin-left: var(--spacing-2);
  padding-left: var(--spacing-4);
}

.fun-fact-category {
  margin-top: var(--spacing-3);
  padding-top: var(--spacing-2);
  border-top: 1px solid var(--color-border);
}

.fun-fact-category small {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==================== County Pages ==================== */
.page-header {
  text-align: center;
  margin-bottom: var(--spacing-5);
  padding: var(--spacing-5) 0;
}

.page-header h1 {
  margin: 0 0 var(--spacing-2) 0;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text);
}

.page-subtitle {
  margin: 0 0 var(--spacing-4) 0;
  color: var(--color-text-muted);
  font-size: 1.125rem;
}

.county-stats {
  display: flex;
  justify-content: center;
  gap: var(--spacing-3);
}

.stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-2) var(--spacing-3);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.county-commentary-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-4);
  margin: var(--spacing-5) 0;
  text-align: center;
}

.county-commentary-section p {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text);
  font-style: italic;
}

/* ==================== About Page Styles ==================== */
.about-hero {
  background: linear-gradient(135deg, var(--color-accent), #ff6b35);
  color: white;
  text-align: center;
  padding: var(--spacing-5) var(--spacing-4);
  margin-bottom: var(--spacing-5);
}

.about-hero h1 {
  margin: 0 0 var(--spacing-3) 0;
  font-size: 2.5rem;
  font-weight: 700;
}

.about-hero p {
  margin: 0;
  font-size: 1.25rem;
  opacity: 0.9;
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--spacing-4);
}

.about-section {
  margin-bottom: var(--spacing-5);
}

.about-section h2 {
  color: var(--color-accent);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 var(--spacing-4) 0;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: var(--spacing-2);
}

.about-section p {
  font-size: 1.125rem;
  line-height: 1.7;
  margin: 0 0 var(--spacing-4) 0;
  color: var(--color-text);
}

.about-section ul {
  margin: var(--spacing-4) 0;
  padding-left: var(--spacing-4);
}

.about-section li {
  font-size: 1.125rem;
  line-height: 1.7;
  margin-bottom: var(--spacing-3);
  color: var(--color-text);
}

.about-section strong {
  color: var(--color-accent);
  font-weight: 600;
}

.about-section a {
  color: var(--color-accent);
  text-decoration: underline;
}

.about-section a:hover {
  text-decoration: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-4);
  margin: var(--spacing-5) 0;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-4);
  text-align: center;
  box-shadow: var(--shadow-1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: var(--spacing-2);
}

.stat-label {
  font-size: 1rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* End of global stylesheet */

/* Enhanced Card Styles - Star Ratings, Address, Food Previews */

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.star-rating {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 16px;
  line-height: 1;
}

.star {
  color: #fbbf24;
}

.star-full {
  color: #f59e0b;
}

.star-half {
  color: #fbbf24;
  opacity: 0.7;
}

.star-empty {
  color: #d1d5db;
}

.rating-text {
  margin-left: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.card-address {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}

.card-summary {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.food-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.food-chip {
  display: inline-block;
  padding: 4px 10px;
  background: #f3f4f6;
  border-radius: 12px;
  font-size: 12px;
  color: #374151;
  white-space: nowrap;
  transition: background 160ms ease;
}

.card-link:hover .food-chip {
  background: #e5e7eb;
}

/* Ensure card body takes full height for proper spacing */
.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--spacing-3);
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* Hero Card Meta Styling - Consistent with index page cards */
.hero-card-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: var(--spacing-3);
}

.hero-star-rating {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 18px;
  line-height: 1;
}

.hero-star-rating .star {
  color: #fbbf24;
}

.hero-star-rating .star-full {
  color: #f59e0b;
}

.hero-star-rating .star-half {
  color: #fbbf24;
  opacity: 0.7;
}

.hero-star-rating .star-empty {
  color: #d1d5db;
}

.hero-star-rating .rating-text {
  margin-left: 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.hero-card-address {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

.hero-card-address a {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s ease;
}

.hero-card-address a:hover {
  color: #1e40af;
  text-decoration: underline;
}

.hero-card-meta .badge-row {
  display: flex;
  gap: var(--spacing-2);
  flex-wrap: wrap;
  margin: 0;
}

.hero-card-meta .badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 12px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s ease;
}

.hero-card-meta .badge:hover {
  background: #e5e7eb;
}

@media (max-width: 768px) {
  .hero-card-meta {
    gap: 10px;
  }
  
  .hero-star-rating {
    font-size: 16px;
  }
  
  .hero-star-rating .rating-text {
    font-size: 14px;
  }
  
  .hero-card-address {
    font-size: 13px;
  }
  
  .hero-card-meta .badge {
    font-size: 12px;
    padding: 5px 10px;
  }
}

/* Hours List Styling */
.hours-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hours-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
}

.hours-list li:last-child {
  border-bottom: none;
}

.hours-list .day {
  font-weight: 500;
  color: var(--color-text);
  float: left;
}

.hours-list .time {
  font-weight: 400;
  color: var(--color-text-muted);
  float: right;
  text-align: right;
}

/* Text Blurb Section on Index Page */
.text-blurb {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: var(--spacing-5);
  margin: var(--spacing-5) 0;
  text-align: left;
}

.text-blurb .section-header {
  border-bottom: none;
  padding-bottom: 0;
}

.text-blurb .section-header h2 {
  font-size: 1.75rem;
  margin-bottom: var(--spacing-2);
}

.text-blurb .section-body p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 720px;
  margin: 0;
  line-height: 1.6;
}

/* Ad placeholder styles */
.blurb-container {
  display: flex;
  gap: var(--spacing-5);
  align-items: center;
}

.blurb-content {
  flex: 2; /* Takes up 2/3 of the space */
}

.ad-placeholder {
  flex: 1; /* Takes up 1/3 of the space */
  background: #f0f0f0;
  border: 1px dashed #ccc;
  padding: var(--spacing-5);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  border-radius: var(--radius-md);
  align-self: stretch; /* Make placeholder fill the card height */
}

.ad-placeholder p {
  color: #888;
  font-style: italic;
}

@media (max-width: 768px) {
  .blurb-container {
    flex-direction: column;
    align-items: stretch;
  }
  .ad-placeholder {
    width: 100%;
    margin-top: var(--spacing-4);
  }
  .text-blurb {
    padding: var(--spacing-4);
  }
  .text-blurb .section-header h2 {
    font-size: 1.5rem;
  }
  .text-blurb .section-body p {
    font-size: 1rem;
  }
}

/* Town Links Section */
.town-links-section {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
    padding: var(--spacing-5);
    margin: var(--spacing-5) 0;
}
.town-links-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-3);
    list-style: none;
    padding: 0;
    margin: 0;
}
.town-links-grid li a {
    display: block;
    padding: var(--spacing-2);
    background-color: #f3f4f6;
    border-radius: var(--radius-md);
    text-align: center;
    text-decoration: none;
    color: var(--color-text);
    transition: background-color 0.2s ease;
}
.town-links-grid li a:hover {
    background-color: #e5e7eb;
}

@media (max-width: 1024px) {
    .town-links-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .town-links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .town-links-grid {
        grid-template-columns: 1fr;
    }
}

/* Enhanced Town Page Cards */
.town-restaurants-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-5);
}
.enhanced-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--spacing-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-1);
    position: relative; /* Needed for button positioning */
}
.enhanced-card-image {
    height: 100%;
}
.enhanced-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.enhanced-card-content {
    padding: var(--spacing-4);
    display: flex;
    flex-direction: column;
}
.enhanced-card-header {
    margin-bottom: var(--spacing-3);
}
.enhanced-card-title {
    margin: 0 0 var(--spacing-1) 0;
}
.enhanced-card-address {
    font-size: 14px;
    color: #6b7280;
    margin: var(--spacing-2) 0 0 0;
}
.enhanced-card-summary {
    margin: 0 0 var(--spacing-3) 0;
    font-size: 14px;
    line-height: 1.6;
}
.enhanced-card-review {
    background: #f9fafb;
    padding: var(--spacing-3);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-3);
    border-left: 3px solid var(--color-primary);
}
.enhanced-card-review .review-text {
    font-style: italic;
    margin: 0 0 var(--spacing-2) 0;
}
.enhanced-card-review .reviewer-name {
    font-weight: bold;
    text-align: right;
}
.enhanced-card-menu-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-2);
    margin-bottom: var(--spacing-3);
}
.menu-image-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--radius-md);
}
.menu-image-item .menu-image-caption {
    font-size: 12px;
    text-align: center;
    margin-top: var(--spacing-1);
}
.enhanced-card-link {
    margin-top: auto;
    align-self: flex-start;
    padding: var(--spacing-2) var(--spacing-3);
    background-color: var(--color-accent);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: background-color 0.2s ease;
    opacity: 1; /* Make button visible by default */
    pointer-events: auto !important;
}

.enhanced-card-link:hover {
    background-color: #1e40af; /* A darker shade of the primary color */
}

@media (max-width: 768px) {
    .enhanced-card {
        grid-template-columns: 1fr;
    }
    .enhanced-card-image {
        aspect-ratio: 1 / 1; /* Square aspect ratio for mobile */
    }
    .enhanced-card-menu-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

.text-blurb.last-blurb .ad-placeholder {
    align-self: flex-start; /* Prevent stretching */
    position: -webkit-sticky; /* For Safari */
    position: sticky;
    top: 84px; /* 64px header + 20px spacing */
}

/* Make button visible on enhanced cards */
.enhanced-card .enhanced-card-link {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* ==================== Nearby Locations Section ==================== */

#nearby-locations-section {
  margin-top: 30px;
}

.nearby-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 1200px) {
  .nearby-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .nearby-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .nearby-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Nearby Card Styling */
.nearby-card {
  display: block;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.nearby-card:hover {
  border-color: #c00;
  box-shadow: 0 6px 12px rgba(0,0,0,0.12);
  transform: translateY(-3px);
}

.nearby-card-image {
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f5f5 0%, #e5e7eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.nearby-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.nearby-card-image img[src*="undefined"],
.nearby-card-image img[src=""] {
  display: none;
}

.nearby-card:hover .nearby-card-image img {
  transform: scale(1.08);
}

.nearby-card-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 100px;
}

.nearby-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nearby-card-rating {
  font-size: 13px;
  color: #1f2937;
  font-weight: 400;
  line-height: 1.4;
  margin: 4px 0;
}

.nearby-card-rating .star-rating {
  display: inline-block;
  color: #f59e0b;
}

.nearby-card-rating .rating-text {
  color: #1f2937;
  font-weight: 500;
}

.nearby-card-address {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nearby-card-town {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.nearby-card-distance {
  margin: 0;
  font-size: 13px;
  color: #c00;
  font-weight: 600;
  margin-top: 4px;
}

/* ==================== Map Section Styling ==================== */

#nearby-map-section {
  margin-top: 40px;
}

#nearby-map {
  background: #f5f5f5;
  position: relative;
}

/* Minimal Map Popup Styling */
.leaflet-popup-content-wrapper {
  border-radius: 6px;
  padding: 10px;
}

.leaflet-popup-content {
  margin: 0;
  line-height: 1.3;
  font-size: 12px;
  min-width: 140px;
}

.map-popup-minimal {
  display: flex;
  flex-direction: column;
}

.minimal-popup .leaflet-popup-tip {
  display: block;
}

/* Ensure map controls are visible */
.leaflet-control-zoom {
  border: 2px solid rgba(0,0,0,0.2);
  border-radius: 4px;
}

.leaflet-control-zoom a {
  background-color: #fff;
  color: #333;
}

.leaflet-control-zoom a:hover {
  background-color: #f4f4f4;
}

/* Mobile responsiveness for map */
@media (max-width: 768px) {
  #nearby-map {
    height: 350px !important;
  }
  
  .nearby-card-image {
    height: 140px;
  }
}

@media (max-width: 480px) {
  #nearby-map {
    height: 300px !important;
  }
  
  .nearby-card-image {
    height: 120px;
  }
  
  .leaflet-popup-content {
    min-width: 120px;
  }
}
