:root {
  color-scheme: light;
  --green: #1f6b4e;
  --green-dark: #15503a;
  --green-soft: #e5f1ea;
  --bg: #f6f7f7;
  --surface: #ffffff;
  --text: #1c2620;
  --muted: #5e6c64;
  --border: #dbe3dd;
  --shadow: 0 12px 24px rgba(20, 48, 32, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

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

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

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 6vw;
}

.logo {
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--green);
  font-size: 1rem;
}

.btn {
  border-radius: 999px;
  padding: 10px 20px;
  min-height: 44px;
  border: 1px solid transparent;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:focus-visible,
.chip:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--green);
  color: var(--surface);
  box-shadow: 0 10px 18px rgba(31, 107, 78, 0.22);
}

.btn-primary:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.btn-ghost {
  border-color: rgba(31, 107, 78, 0.3);
  background: var(--surface);
  color: var(--green-dark);
}

.btn-outline {
  border-color: rgba(31, 107, 78, 0.5);
  background: var(--surface);
  color: var(--green-dark);
}

.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-static {
  cursor: default;
  opacity: 0.6;
}

.btn-sm {
  padding: 8px 14px;
  min-height: 44px;
  font-size: 0.9rem;
}

.btn-xs {
  padding: 6px 12px;
  min-height: 32px;
  font-size: 0.75rem;
}

.link {
  color: var(--green);
  font-weight: 600;
}

main {
  flex: 1;
}

.list-page {
  padding: 12px 6vw 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Hero title redesign (index.html) */
.hero {
  background: var(--surface);
  padding: 64px 0 48px;
  text-align: center;
}

.hero-inner {
  text-align: center;
  display: grid;
  gap: 16px;
  justify-items: center;
  margin: 0 auto;
  max-width: 880px;
}

.hero-badge {
  font-weight: 800;
  font-size: clamp(1.75rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}

.hero-title {
  margin: 0;
  font-weight: 900;
  font-size: clamp(2.5rem, 4.4vw, 2.75rem);
  letter-spacing: -0.02em;
}

.hero-sub {
  margin: 0;
  font-weight: 600;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  color: var(--muted);
}

.list-search {
  display: grid;
  gap: 12px;
  text-align: center;
}

.hero-search {
  display: grid;
  gap: 12px;
  align-items: center;
  justify-items: stretch;
  max-width: 640px;
  margin: 0 auto;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(28, 38, 32, 0.18);
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(15, 24, 18, 0.08);
  flex-wrap: wrap;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-bar:focus-within {
  border-color: rgba(31, 107, 78, 0.7);
  box-shadow: 0 12px 26px rgba(31, 107, 78, 0.18);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  min-height: 44px;
  font-size: 1rem;
  background: transparent;
  min-width: 180px;
}

.filter-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.filter-row select {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(28, 38, 32, 0.18);
  padding: 8px 16px;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(15, 24, 18, 0.06);
}

.result-count {
  margin: 0;
  font-weight: 600;
  color: var(--muted);
}

.list-meta {
  color: var(--muted);
}

.list-state {
  color: var(--muted);
  font-size: 0.95rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: none;
}

.restaurant-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

.restaurant-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.media-frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--media-aspect, 16 / 9);
  overflow: hidden;
  background: #f1f3f1;
  border-bottom: 1px solid var(--border);
}

.media-frame.media-card {
  height: 180px;
  aspect-ratio: auto;
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.media-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  background: #f1f3f1;
}

.media-loaded .media-placeholder {
  opacity: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(31, 107, 78, 0.9);
  color: var(--surface);
  font-weight: 700;
  width: fit-content;
}

.badge.is-muted {
  background: rgba(31, 107, 78, 0.18);
  color: var(--green-dark);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.card-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.card-info {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.card-info p {
  margin: 0;
}

.menu-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.card-actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-actions.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.cta-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.skeleton {
  background: linear-gradient(90deg, #eef2ee 25%, #f7f9f7 37%, #eef2ee 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
  min-height: 16px;
}

.skeleton-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
  display: grid;
  gap: 12px;
}

@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.about {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.about-card {
  background: var(--green-soft);
  padding: 18px;
  border-radius: var(--radius-sm);
}

.detail-page {
  padding: 20px 6vw 160px;
  display: grid;
  gap: 20px;
}

.detail-hero {
  display: grid;
  gap: 20px;
  background: var(--surface);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.detail-title {
  display: grid;
  gap: 12px;
}

.detail-title h1 {
  margin: 0;
}

.detail-summary {
  display: grid;
  gap: 12px;
}

.summary-card {
  background: var(--surface);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: grid;
  gap: 6px;
}

.summary-card span {
  color: var(--muted);
  font-size: 0.85rem;
}

.detail-info {
  display: grid;
  gap: 16px;
}

.info-card {
  background: var(--surface);
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: grid;
  gap: 12px;
}

.info-card h3 {
  margin: 0;
}

.info-list {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

.gallery {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.gallery img {
  border-radius: var(--radius-sm);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
}

.detail-cert,
.detail-share {
  background: var(--surface);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.share-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.share-hint {
  color: var(--muted);
  font-size: 0.85rem;
}

.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--border);
  padding: 12px 6vw calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 24px rgba(20, 48, 32, 0.08);
  z-index: 12;
}

.sticky-cta .cta-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cta-actions {
  display: grid;
  gap: 10px;
}

.site-footer {
  padding: 24px 6vw 32px;
  color: var(--muted);
  font-size: 0.9rem;
}

.list-loader {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 24px;
}

.list-end {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
  min-height: 24px;
}

.scroll-sentinel {
  width: 100%;
  height: 1px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

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

@media (min-width: 768px) {
  .restaurant-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-hero {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    align-items: center;
  }

  .detail-summary {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .detail-info {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .sticky-cta .cta-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .cta-actions {
    grid-auto-flow: column;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .hero {
    padding: 56px 0 40px;
  }

  .hero-badge {
    font-size: 1.3rem;
  }

  .hero-title {
    font-size: 1.65rem;
  }

  .hero-sub {
    font-size: 0.8rem;
  }
}

@media (min-width: 960px) {
  .restaurant-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .restaurant-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .restaurant-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
