/* ==========================================================================
   Bangkok Restaurant Directory — Main Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Custom Properties
   -------------------------------------------------------------------------- */
:root {
  --primary: #C41E3A;
  --primary-dark: #9B1830;
  --accent: #E8A838;
  --accent-light: #F5D590;
  --secondary: #2C3E50;
  --secondary-light: #34495E;
  --bg: #FAFAFA;
  --card-bg: #FFFFFF;
  --text: #333333;
  --text-light: #666666;
  --border: #E5E7EB;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: 0.25s ease;
  --max-width: 1200px;
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--secondary);
}

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */
.site-main {
  padding: 0;
}

/* Shared section spacing — used on every <section class="section"> */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.section-title {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   4. Site Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
  text-decoration: none;
}

.site-logo:hover {
  color: var(--primary-dark);
}

.logo-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.logo-text {
  white-space: nowrap;
}

/* Primary navigation — the <nav> and its <ul> */
.site-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-item {
  position: relative;
}

/* Nav links (both <a> and <button>) */
.nav-link {
  position: relative;
  font-family: 'Inter', sans-serif;
  font-size: 0.935rem;
  font-weight: 500;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform var(--transition);
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.caret {
  font-size: 0.6rem;
  transition: transform var(--transition);
}

.caret::before {
  content: '▼';
}

/* Dropdown menus */
.has-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 110;
  list-style: none;
}

.has-dropdown:hover .dropdown-menu,
.has-dropdown.is-open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--text);
}

.dropdown-menu a:hover {
  background: var(--bg);
  color: var(--primary);
}

.dropdown-menu a::after {
  display: none;
}

/* Hamburger toggle (hidden on desktop) */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 36px;
  height: 36px;
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--secondary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* --------------------------------------------------------------------------
   5. Hero Section
   -------------------------------------------------------------------------- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  text-align: center;
  padding: 4rem 1.5rem;
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.75rem;
  color: #fff;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.hero-prompt {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 1rem;
}

/* --------------------------------------------------------------------------
   6. Category Grid
   -------------------------------------------------------------------------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.category-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: transform var(--transition), box-shadow var(--transition);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  color: var(--text);
}

.category-icon {
  font-size: 2.25rem;
  display: block;
  margin-bottom: 0.5rem;
}

.category-name {
  font-weight: 600;
  font-size: 1rem;
  display: block;
}

.category-count {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.25rem;
  display: block;
}

/* --------------------------------------------------------------------------
   7. Restaurant Card
   -------------------------------------------------------------------------- */
.restaurant-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.restaurant-card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.card-header h2 {
  font-size: 1.5rem;
  color: var(--secondary);
  flex: 1;
  min-width: 0;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
}

.cuisine-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-light);
}

.price-range {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9rem;
}

.rating {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
}

.card-body {
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
}

.card-body .description {
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.card-details p {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}

.card-details a {
  color: var(--primary);
}

.card-details a:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   8. Editor's Pick / Spotlight
   -------------------------------------------------------------------------- */
.spotlight-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--accent);
  overflow: hidden;
}

.spotlight-header {
  padding: 1.5rem 1.5rem 0;
}

.spotlight-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.spotlight-header h3 {
  font-size: 1.5rem;
  color: var(--secondary);
}

.spotlight-body {
  padding: 1rem 1.5rem 1.5rem;
}

.spotlight-description {
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 1rem;
}

.spotlight-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.spotlight-details {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-bottom: 1rem;
}

.spotlight-details p {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}

.spotlight-details a {
  color: var(--primary);
}

.spotlight-details a:hover {
  text-decoration: underline;
}

.spotlight-link {
  display: inline-block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary);
  padding: 0.5rem 0;
}

.spotlight-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   9. Neighborhood Grid
   -------------------------------------------------------------------------- */
.neighborhood-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.neighborhood-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: transform var(--transition), box-shadow var(--transition);
}

.neighborhood-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  color: var(--text);
}

.neighborhood-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

/* --------------------------------------------------------------------------
   10. Collections Row
   -------------------------------------------------------------------------- */
.collections-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.collection-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: transform var(--transition), box-shadow var(--transition);
}

.collection-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  color: var(--text);
}

.collection-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.collection-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

/* --------------------------------------------------------------------------
   11. SEO Section
   -------------------------------------------------------------------------- */
.seo-content {
  max-width: 800px;
}

.seo-content h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.seo-content p {
  color: var(--text-light);
  line-height: 1.75;
}

/* --------------------------------------------------------------------------
   12. Breadcrumbs (category pages)
   -------------------------------------------------------------------------- */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.breadcrumb li + li::before {
  content: '›';
  color: var(--border);
  font-size: 1rem;
}

.breadcrumb a {
  color: var(--text-light);
}

.breadcrumb a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.breadcrumb [aria-current="page"] span {
  font-weight: 600;
  color: var(--text);
}

/* --------------------------------------------------------------------------
   13. Category Page Layout
   -------------------------------------------------------------------------- */
.category-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.category-header {
  margin-bottom: 2rem;
}

.category-header h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.category-intro {
  max-width: 720px;
  font-size: 1.05rem;
  color: var(--text-light);
  line-height: 1.75;
  margin-bottom: 0.5rem;
}

.restaurant-count {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   14. Related Categories
   -------------------------------------------------------------------------- */
.related-categories {
  margin: 2.5rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-categories h2 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.related-link {
  display: inline-block;
  font-size: 0.825rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.related-link:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* --------------------------------------------------------------------------
   15. About Page
   -------------------------------------------------------------------------- */
.about-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.about-header {
  margin-bottom: 2rem;
}

.about-header h1 {
  font-size: 2rem;
}

.about-content {
  max-width: 800px;
}

.about-content h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.about-content p {
  margin-bottom: 1.25rem;
  line-height: 1.75;
}

.about-content a {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   16. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--secondary);
  color: rgba(255, 255, 255, 0.8);
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.footer-col a {
  display: block;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.65);
  padding: 0.2rem 0;
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-col li {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.25rem;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}

/* --------------------------------------------------------------------------
   17. Utility Classes
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   18. Responsive — Tablet (max-width: 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .category-grid,
  .neighborhood-grid,
  .collections-row {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .hero h1 {
    font-size: 2.25rem;
  }
}

/* --------------------------------------------------------------------------
   19. Responsive — Mobile (max-width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Header & navigation */
  .mobile-menu-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: 64px;
    right: -300px;
    width: 300px;
    height: calc(100vh - 64px);
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    transition: right var(--transition);
    z-index: 120;
  }

  .site-nav.is-open {
    right: 0;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0;
  }

  .nav-link {
    padding: 0.75rem 1.5rem;
    width: 100%;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
  }

  .nav-link::after {
    display: none;
  }

  /* Dropdown becomes accordion on mobile */
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    display: none;
    background: var(--bg);
  }

  .has-dropdown.is-open .dropdown-menu {
    display: block;
  }

  .dropdown-menu a {
    padding-left: 2.5rem;
  }

  /* Grids */
  .category-grid,
  .neighborhood-grid,
  .collections-row {
    grid-template-columns: 1fr;
  }

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

  /* Hero */
  .hero {
    padding: 2.5rem 1.25rem;
  }

  .hero h1 {
    font-size: 1.85rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  /* Cards */
  .card-header {
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
  }

  .card-header h2 {
    font-size: 1.25rem;
  }

  .card-body {
    padding: 0.875rem 1.25rem 1.25rem;
  }

  /* Sections */
  .section {
    padding: 1.5rem 1.25rem;
  }

  .section-title {
    font-size: 1.35rem;
  }

  .category-page,
  .about-page {
    padding: 1.25rem 1.25rem 2rem;
  }

  /* Footer */
  .footer-bottom {
    text-align: center;
  }

  /* Logo */
  .logo-text {
    font-size: 0.95rem;
  }
}

/* --------------------------------------------------------------------------
   20. Responsive — Small Mobile (max-width: 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .hero-subtitle {
    font-size: 0.9rem;
  }

  .hero {
    padding: 2rem 1rem;
  }

  .section {
    padding: 1.25rem 1rem;
  }

  .category-page,
  .about-page {
    padding: 1rem 1rem 2rem;
  }

  .card-header h2 {
    font-size: 1.1rem;
  }

  .rank-badge {
    min-width: 2rem;
    height: 2rem;
    font-size: 0.825rem;
  }

  .category-card,
  .neighborhood-card,
  .collection-card {
    padding: 1.15rem;
  }
}

/* --------------------------------------------------------------------------
   21. Print Styles
   -------------------------------------------------------------------------- */
@media print {
  .site-header,
  .site-footer,
  .mobile-menu-toggle,
  .hero,
  .related-categories,
  .breadcrumb {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }

  .restaurant-card,
  .category-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .site-main {
    padding: 0;
  }
}
