:root {
  --cream: #FBF8F3;
  --forest: #2C5530;
  --gold: #D4AF37;
  --dark: #2B2620;
  --white: #FFFFFF;
  --gray: #6B6B6B;
  --light-gray: #E8E4DF;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --card-shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--light-gray);
  padding: 0.75rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
}

.logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--forest);
}

.main-nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  text-decoration: none;
  color: var(--dark);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--forest);
  border-bottom-color: var(--gold);
}

.app-container {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--light-gray);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.controls {
  margin-bottom: 1.5rem;
}

.search-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 250px;
  padding: 0.75rem 1rem;
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--white);
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--forest);
}

.filter-select {
  padding: 0.75rem 1rem;
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--white);
  cursor: pointer;
  min-width: 140px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--forest);
}

.reset-btn {
  padding: 0.75rem 1rem;
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  background: transparent;
  color: var(--gray);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}

.reset-btn:hover {
  border-color: var(--forest);
  color: var(--forest);
}

.results-count {
  font-size: 0.9rem;
  color: var(--gray);
  margin-bottom: 1rem;
}

.cheese-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.cheese-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

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

.cheese-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.cheese-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cheese-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: rgba(255,255,255,0.8);
  font-family: 'Playfair Display', serif;
}

.cheese-card-body {
  padding: 1rem 1.25rem;
}

.cheese-card-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.cheese-card-meta {
  font-size: 0.85rem;
  color: var(--gray);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cheese-card-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gray);
}

.intensity-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: auto;
}

.intensity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--light-gray);
}

.intensity-dot.filled {
  background: var(--gold);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pagination button {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--light-gray);
  border-radius: 6px;
  background: var(--white);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.pagination button:hover {
  border-color: var(--forest);
  color: var(--forest);
}

.pagination button.active {
  background: var(--forest);
  color: var(--white);
  border-color: var(--forest);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination .ellipsis {
  padding: 0.5rem 0.5rem;
  color: var(--gray);
}

.detail-page {
  max-width: 900px;
  margin: 0 auto;
}

.detail-back {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--forest);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
}

.detail-back:hover {
  text-decoration: underline;
}

.detail-header {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.detail-image-wrap {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.detail-image {
  width: 100%;
  height: 300px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-credit {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--gray);
}

.detail-credit a {
  color: var(--forest);
}

.detail-credit-flag {
  color: #9c5a00;
}

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

.detail-image .placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: rgba(255,255,255,0.7);
  font-family: 'Playfair Display', serif;
}

.detail-info {
  flex: 1;
  min-width: 250px;
}

.detail-name {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.detail-origin {
  font-size: 1.1rem;
  color: var(--gray);
  margin-bottom: 0.75rem;
}

.detail-firstmade {
  font-size: 0.95rem;
  color: var(--gray);
  margin-bottom: 1rem;
}

.origin-src {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--forest);
  text-decoration: none;
  margin-left: 0.35rem;
}

.origin-src:hover {
  text-decoration: underline;
}

.detail-protected {
  display: inline-block;
  background: var(--gold);
  color: var(--white);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.detail-desc {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--dark);
  margin-bottom: 1rem;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag {
  background: var(--light-gray);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--gray);
}

.detail-taxonomy {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--card-shadow);
}

.detail-taxonomy h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--forest);
}

.taxonomy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.taxonomy-item {
  display: flex;
  flex-direction: column;
}

.taxonomy-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray);
  margin-bottom: 0.2rem;
}

.taxonomy-value {
  font-weight: 500;
  font-size: 0.95rem;
}

.shops-section {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
}

.shops-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--forest);
}

.shop-list {
  list-style: none;
}

.shop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--light-gray);
}

.shop-item:last-child {
  border-bottom: none;
}

.shop-name {
  font-weight: 500;
}

.shop-badge {
  background: var(--gold);
  color: var(--white);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 0.5rem;
  font-weight: 600;
}

.shop-link {
  color: var(--forest);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.shop-link:hover {
  text-decoration: underline;
}

.shops-empty {
  color: var(--gray);
  font-style: italic;
  padding: 0.5rem 0;
}

.related-section {
  margin-top: 2rem;
}

.related-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--forest);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.related-card {
  background: var(--white);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: var(--card-shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s;
  display: block;
}

.related-card:hover {
  transform: translateY(-2px);
}

.related-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.related-card-meta {
  font-size: 0.8rem;
  color: var(--gray);
}

.map-page {
  display: flex;
  gap: 1.5rem;
  height: calc(100vh - 200px);
  min-height: 500px;
}

.map-container {
  flex: 1;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  min-height: 400px;
}

#map {
  width: 100%;
  height: 100%;
}

.map-sidebar {
  width: 320px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 1.5rem;
  overflow-y: auto;
  flex-shrink: 0;
}

.map-sidebar h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--forest);
}

.map-locate-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--forest);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 1rem;
  transition: background 0.2s;
}

.map-locate-btn:hover {
  background: #1e3d20;
}

.map-locate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.closest-list {
  list-style: none;
}

.closest-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--light-gray);
  text-decoration: none;
  color: inherit;
}

.closest-item:last-child {
  border-bottom: none;
}

.closest-item-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.closest-item-dist {
  font-size: 0.8rem;
  color: var(--gray);
}

.map-legend {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--light-gray);
}

.map-legend h4 {
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 0.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.count-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--white);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--forest);
  cursor: pointer;
}

.map-breadcrumb {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  min-height: 1.2rem;
}

.breadcrumb-back {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--forest);
  text-decoration: none;
}

.breadcrumb-back:hover {
  text-decoration: underline;
}

.breadcrumb-country {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--forest);
}

.region-list {
  margin-bottom: 1rem;
}

.region-list h4 {
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 0.5rem;
}

.region-items {
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
}

.region-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  margin-bottom: 2px;
  border-radius: 6px;
  font-size: 0.88rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.region-item:hover {
  background: var(--light-gray);
}

.region-item.active {
  background: var(--forest);
  color: var(--white);
}

.region-name {
  font-weight: 500;
}

.region-count {
  font-size: 0.78rem;
  color: var(--gray);
}

.region-item.active .region-count {
  color: rgba(255, 255, 255, 0.75);
}

.region-empty {
  font-size: 0.85rem;
  color: var(--gray);
}

.site-footer {
  background: var(--white);
  border-top: 1px solid var(--light-gray);
  padding: 1.5rem 2rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray);
}

.footer-data {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  opacity: 0.7;
}

.credits-page {
  max-width: 800px;
}

.privacy-page h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--forest);
  margin: 1.75rem 0 0.5rem;
}

.privacy-glance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.glance-card {
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--card-shadow);
}

.glance-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 0.4rem;
}

.glance-card p {
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.5;
}

@media (max-width: 640px) {
  .privacy-glance {
    grid-template-columns: 1fr;
  }
}

.credits-intro,
.credits-note {
  color: var(--gray);
  line-height: 1.6;
}

.credits-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  border-top: 1px solid var(--light-gray);
}

.credits-item {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--light-gray);
  font-size: 0.9rem;
  line-height: 1.5;
}

.credits-cheese {
  min-width: 150px;
  font-weight: 600;
  color: var(--forest);
  flex-shrink: 0;
}

.credits-meta {
  color: var(--dark);
}

@media (max-width: 768px) {
  .app-container {
    padding: 1rem;
  }

  .cheese-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
  }

  .cheese-card-img {
    height: 140px;
  }

  .detail-header {
    flex-direction: column;
  }

  .detail-image-wrap {
    width: 100%;
  }

  .detail-image {
    width: 100%;
    height: 250px;
  }

  .map-page {
    flex-direction: column;
    height: auto;
  }

  .map-container {
    min-height: 300px;
    height: 400px;
  }

  .map-sidebar {
    width: 100%;
  }

  .search-row {
    flex-direction: column;
  }

  .filter-select {
    width: 100%;
  }
}

.learn-page {
  max-width: 800px;
}

.learn-page h1 {
  margin-bottom: 0.75rem;
}

.learn-intro {
  color: var(--gray);
  line-height: 1.6;
}

.learn-section {
  margin-top: 2rem;
}

.learn-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--forest);
  margin-bottom: 0.4rem;
}

.learn-section .learn-intro {
  margin-bottom: 1rem;
}

.learn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.learn-card {
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--card-shadow);
}

.learn-card-name {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 0.4rem;
}

.learn-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray);
  white-space: nowrap;
}

.learn-card-desc {
  font-size: 0.88rem;
  color: var(--dark);
  line-height: 1.55;
}

@media (max-width: 640px) {
  .learn-grid {
    grid-template-columns: 1fr;
  }
}

.create-page {
  max-width: 800px;
}

.create-steps {
  margin: 1.5rem 0;
}

.create-step {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--light-gray);
}

.create-step:last-child {
  border-bottom: none;
}

.step-number {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--light-gray);
  color: var(--forest);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.create-step h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--forest);
  margin: 0.15rem 0 0.35rem;
}

.create-step p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--dark);
}

.makers-section {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2rem;
  box-shadow: var(--card-shadow);
}

.makers-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--forest);
  margin-bottom: 0.75rem;
}

.makers-intro {
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.maker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.maker-card {
  border: 1px solid var(--light-gray);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.maker-name {
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 0.4rem;
}

.maker-blurb {
  font-size: 0.88rem;
  color: var(--dark);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.maker-card .shop-link {
  margin-top: auto;
}
