/* Modern Reset and Design Tokens */
:root {
  --radius: 0.875rem;
  --background: oklch(98.5% 0.012 60); /* Very light warm beige */
  --foreground: oklch(24% 0.04 20); /* Elegant dark charcoal/brown */
  
  --card: oklch(100% 0 0); /* Pure white */
  --card-foreground: oklch(24% 0.04 20);
  
  --primary: oklch(55% 0.16 10); /* Rose-magenta */
  --primary-foreground: oklch(99% 0.01 60);
  
  --secondary: oklch(93% 0.04 30); /* Light soft peach */
  --secondary-foreground: oklch(30% 0.06 20);
  
  --muted: oklch(96% 0.015 50);
  --muted-foreground: oklch(50% 0.03 30);
  
  --accent: oklch(78% 0.11 55); /* Amber/gold */
  --accent-foreground: oklch(20% 0.03 20);
  
  --border: oklch(90% 0.02 40); /* Soft border */
  --input: oklch(92% 0.02 40);
  --ring: oklch(55% 0.16 10);
  
  --gradient-hero: linear-gradient(135deg, oklch(93% 0.05 25) 0%, oklch(97% 0.025 60) 50%, oklch(90% 0.06 50) 100%);
  --gradient-rose: linear-gradient(135deg, oklch(55% 0.16 10), oklch(70% 0.13 40));
  
  --shadow-soft: 0 10px 40px -15px oklch(55% 0.16 10 / 0.25);
  --shadow-card: 0 4px 20px -8px oklch(55% 0.16 10 / 0.15);
  
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Cormorant Garamond", "Playfair Display", Georgia, serif;
}

/* Base resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-color: var(--border);
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  background-image: 
    radial-gradient(at top, oklch(55% 0.16 10 / 0.08) 0%, transparent 60%),
    radial-gradient(at 100% 100%, oklch(78% 0.11 55 / 0.08) 0%, transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

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

/* Layout container */
.max-w-6xl {
  max-width: 72rem; /* 1152px */
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Header section */
header {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

header .hero-bg {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
  z-index: 0;
  opacity: 0.85;
}

header .hero-content {
  position: relative;
  z-index: 1;
  padding-top: 4rem;
  padding-bottom: 5rem;
  text-align: center;
}

.badge-community {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--primary);
  margin-bottom: 1.5rem;
  border: 1px solid oklch(55% 0.16 10 / 0.1);
  font-weight: 500;
}

header h1 {
  font-size: 3rem;
  font-weight: 300;
  color: var(--foreground);
  margin-bottom: 1rem;
  line-height: 1.1;
}

@media (min-width: 768px) {
  header h1 {
    font-size: 4.5rem;
  }
}

header h1 em {
  color: var(--primary);
  font-style: normal;
  font-weight: 400;
}

header p.tagline {
  font-size: 1rem;
  color: var(--muted-foreground);
  max-w: 42rem;
  margin: 0 auto 2.5rem auto;
}

@media (min-width: 768px) {
  header p.tagline {
    font-size: 1.125rem;
  }
}

/* Search bar & filter bar */
.search-container {
  max-width: 48rem;
  margin: 0 auto;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 1.25rem;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

@media (min-width: 768px) {
  .search-container {
    flex-direction: row;
    gap: 0.5rem;
  }
}

.search-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.search-input-wrapper svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary);
  flex-shrink: 0;
}

.search-input-wrapper input {
  flex: 1;
  padding: 0.75rem 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--foreground);
  font-size: 1rem;
}

.search-input-wrapper input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.85;
}

.search-container select {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background-color: oklch(93% 0.04 30 / 0.6);
  border: 1px solid var(--border);
  color: var(--secondary-foreground);
  outline: none;
  cursor: pointer;
  font-size: 0.875rem;
  transition: border-color 0.2s;
  min-width: 12rem;
}

.search-container select:focus {
  border-color: var(--primary);
}

.btn-primary {
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  color: var(--primary-foreground);
  font-weight: 500;
  background: var(--gradient-rose);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  font-size: 0.875rem;
  white-space: nowrap;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:active {
  transform: scale(0.98);
}

.results-counter {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.results-counter strong {
  color: var(--foreground);
}

/* Main Grid */
main {
  padding-top: 3rem;
  padding-bottom: 4rem;
}

.cards-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* Card item */
article.business-card {
  background-color: var(--card);
  border-radius: 1.25rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

article.business-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -10px oklch(55% 0.16 10 / 0.2);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--gradient-rose);
  color: var(--primary-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  flex-shrink: 0;
}

.card-title-wrapper {
  min-width: 0; /* Ensures text truncation works inside flex if needed */
}

.card-title-wrapper h3 {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--foreground);
}

.card-subtitle {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

/* Card details (dl) */
.card-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  margin-bottom: auto; /* Push review/footer to bottom */
}

.detail-row {
  display: flex;
  gap: 0.5rem;
  color: rgba(var(--foreground), 0.8);
}

.detail-icon {
  flex-shrink: 0;
}

.detail-value {
  min-w: 0;
  word-break: break-word;
}

.detail-value a {
  color: var(--primary);
  transition: text-decoration 0.2s;
}

.detail-value a:hover {
  text-decoration: underline;
}

/* Review section inside card */
.card-review {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.review-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.review-stars {
  color: var(--accent);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
}

.review-author {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.review-text {
  font-size: 0.875rem;
  font-style: italic;
  color: oklch(24% 0.04 20 / 0.85);
  line-height: 1.525;
}

/* Card footer */
.card-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.card-footer .source-label {
  font-style: italic;
}

/* Load more container */
.pagination-container {
  text-align: center;
  margin-top: 3rem;
}

.btn-outline {
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  background: transparent;
  color: var(--primary);
  border: 1px solid oklch(55% 0.16 10 / 0.3);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  font-size: 0.875rem;
}

.btn-outline:hover {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* Empty search result state */
.empty-results {
  text-align: center;
  padding: 5rem 1rem;
  color: var(--muted-foreground);
  font-size: 1rem;
}

/* Footer styling */
footer.site-footer {
  border-top: 1px solid var(--border);
  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-top: 4rem;
}

footer.site-footer .footer-content {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  footer.site-footer .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

footer.site-footer h2 {
  font-size: 1.25rem;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

footer.site-footer p.footer-desc {
  max-width: 38rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
}

footer.site-footer .footer-copyright {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-align: left;
}

@media (min-width: 768px) {
  footer.site-footer .footer-copyright {
    text-align: right;
  }
}

/* Modal Dialog Styling */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(24, 24, 27, 0.4); /* Tailwind zinc-900 / 0.4 */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background-color: var(--card);
  border-radius: 1.25rem;
  padding: 2rem;
  max-width: 32rem; /* max-w-lg */
  width: 100%;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.32, 1);
}

.modal-overlay.open .modal-container {
  transform: scale(1);
}

.modal-container h2 {
  font-size: 1.875rem; /* text-3xl */
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.modal-container p.modal-desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--input);
  background-color: var(--background);
  color: var(--foreground);
  outline: none;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.modal-form input:focus {
  border-color: var(--primary);
}

.modal-form input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.8;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn-secondary {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  color: var(--foreground);
  background-color: transparent;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background-color 0.2s;
}

.btn-secondary:hover {
  background-color: var(--muted);
}

.modal-actions .btn-primary {
  flex: 1;
}

/* Form validation styling helper */
.modal-form input:invalid:focus {
  border-color: #ef4444; /* red-500 */
}
