:root {
  --bg: #f7f3ea;
  --surface: #fffdf8;
  --ink: #22201c;
  --muted: #6b665e;
  --line: #ded5c7;
  --tomato: #c84f3d;
  --leaf: #2f765f;
  --navy: #243b53;
  --butter: #f2c94c;
  --shadow: 0 18px 44px rgba(36, 59, 83, .13);
  --menu-width: min(320px, 86vw);
}

* { box-sizing: border-box; }
html, body { max-width: 100vw; min-height: 100%; overflow-x: hidden; }
@supports (overflow: clip) {
  html, body { overflow-x: clip; }
}
body {
  margin: 0;
  background: linear-gradient(180deg, #fff8e8 0, var(--bg) 420px);
  color: var(--ink);
  font-family: "Noto Sans JP", Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.main-header {
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  z-index: 1000;
  background: rgba(255, 253, 248, .9);
  border-bottom: 1px solid var(--line);
  height: 68px;
  position: fixed;
  inset: 0 0 auto;
}
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1080px, 100% - 28px);
  height: 100%;
  margin: 0 auto;
}
.logo {
  max-width: 100%;
  color: var(--tomato);
  font-weight: 900;
  line-height: 1.25;
}
.desktop-nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  color: var(--muted);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: .9rem;
  font-weight: 900;
}
#menu-btn {
  position: fixed;
  top: 15px;
  right: 16px;
  z-index: 2000;
  display: grid;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--tomato);
  cursor: pointer;
  place-items: center;
  padding: 8px;
  box-shadow: 0 8px 20px rgba(36, 59, 83, .12);
}
#menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 3px auto;
  border-radius: 999px;
  background: currentColor;
}
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 2050;
  background: rgba(34, 32, 28, .42);
}
#side-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2100;
  width: var(--menu-width);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 42px rgba(36, 59, 83, .18);
  transform: translate3d(100%, 0, 0);
  visibility: hidden;
  pointer-events: none;
  transition: transform .24s ease, visibility .24s ease;
  will-change: transform;
  contain: paint;
}
#side-menu.open {
  transform: translate3d(0, 0, 0);
  visibility: visible;
  pointer-events: auto;
}
.app-shell {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  padding-top: 68px;
}
.menu-content { display: flex; flex-direction: column; height: 100%; padding: 24px; }
.close-menu {
  align-self: flex-end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff3ef;
  color: var(--tomato);
  cursor: pointer;
  padding: 8px 14px;
  font-weight: 900;
}
.menu-nav { display: grid; gap: 10px; margin-top: 28px; }
.menu-link {
  border-radius: 8px;
  padding: 14px 12px;
  color: var(--navy);
  font-size: 1rem;
  font-weight: 900;
}
.menu-link:hover { background: #eef6f1; color: var(--leaf); }

main { width: min(1080px, 100% - 28px); max-width: calc(100% - 28px); margin: 0 auto; }
.hero {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 330px;
  width: 100%;
  margin: 22px 0 0;
  padding: 46px clamp(22px, 5vw, 64px) 54px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(21, 48, 45, .9) 0%, rgba(30, 63, 74, .74) 50%, rgba(30, 63, 74, .28) 100%),
    url("/GourmetFilter/static/images/hero.png") center 42%/cover;
}
.hero-copy { position: relative; z-index: 1; max-width: 720px; }
.eyebrow { margin: 0 0 10px; color: var(--leaf); font-size: .78rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { margin: 0; color: #fff; text-shadow: 0 4px 18px rgba(0, 0, 0, .28); font-size: clamp(1.55rem, 4vw, 3.35rem); line-height: 1.14; font-weight: 900; }
.subtitle { margin: 18px 0 0; color: #fff; text-shadow: 0 3px 14px rgba(0, 0, 0, .26); font-size: clamp(.9rem, 1.65vw, 1.05rem); font-weight: 900; line-height: 1.5; max-width: 460px; }
.hero-lead { max-width: 680px; margin: 16px 0 0; color: rgba(255,255,255,.92); font-size: clamp(.98rem, 1.8vw, 1.12rem); font-weight: 800; line-height: 1.85; text-shadow: 0 2px 12px rgba(0, 0, 0, .22); }

.search-panel, .status-card, .article-card, .shop-card, .page-shell, .article-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.search-panel { padding: clamp(20px, 4vw, 32px); }
label { display: grid; gap: 8px; color: var(--navy); font-weight: 900; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
input, select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 14px;
  color: var(--ink);
  font-weight: 700;
}
input:focus, select:focus { outline: 3px solid rgba(47, 118, 95, .22); border-color: var(--leaf); }
.search-mode-fieldset, .ng-fieldset { margin: 0 0 16px; padding: 0; border: 0; }
.search-mode-fieldset legend, .ng-fieldset legend, .custom-ng-label span { display: block; margin-bottom: 8px; color: var(--navy); font-weight: 900; }
.search-mode-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.search-mode-option { position: relative; cursor: pointer; }
.search-mode-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  opacity: 0;
  pointer-events: none;
}
.search-mode-option span {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid rgba(47, 118, 95, .35);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 900;
  text-align: center;
}
.search-mode-option input:checked + span { background: #eef6f1; color: var(--leaf); border-color: var(--leaf); box-shadow: inset 0 0 0 1px var(--leaf); }
.mode-panel[hidden], .location-panel[hidden], .map-coordinate-label[hidden] { display: none; }
.location-panel {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.location-button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--leaf);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}
.location-button:disabled { opacity: .58; cursor: wait; }
.location-status, .coordinate-help {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 800;
  line-height: 1.7;
}
.map-coordinate-label { margin-bottom: 10px; }
.coordinate-help {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8e8;
  padding: 12px 14px;
}
.coordinate-help code {
  color: var(--navy);
  font-weight: 900;
  word-break: break-all;
}
.ng-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ng-option { position: relative; cursor: pointer; }
.ng-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  opacity: 0;
  pointer-events: none;
}
.ng-option span {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid rgba(200, 79, 61, .35);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 900;
}
.ng-option input:checked + span { background: #fff3ef; color: var(--tomato); border-color: var(--tomato); box-shadow: inset 0 0 0 1px var(--tomato); }
.custom-ng-label { margin-bottom: 16px; }
.favorite-guide {
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef6f1;
  color: var(--leaf);
  padding: 12px 14px;
  font-size: .86rem;
  font-weight: 800;
  line-height: 1.7;
}
.favorite-guide a { color: var(--tomato); text-decoration: underline; text-underline-offset: 3px; }
.submit-button {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: var(--tomato);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 14px 26px rgba(200, 79, 61, .28);
}
.submit-button:disabled { opacity: .58; cursor: wait; }
.credit { margin: 14px 0 0; color: var(--muted); font-size: .82rem; font-weight: 700; text-align: center; }
.credit a { color: var(--tomato); text-decoration: underline; text-underline-offset: 3px; }

.status-section { margin-top: 18px; }
.status-card { padding: 16px 18px; color: var(--muted); font-weight: 800; line-height: 1.7; box-shadow: none; }
.results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.shop-card { overflow: hidden; display: flex; flex-direction: column; min-height: 100%; position: relative; font-family: "Noto Sans JP", Arial, sans-serif; }
.favorite-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(242, 201, 76, .75);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: #b8860b;
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(36, 59, 83, .18);
}
.favorite-btn.active { background: #fff7dd; color: #d69b21; border-color: #d69b21; }
.shop-image-link { display: block; }
.shop-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #ece3d3; }
.shop-body { display: grid; gap: 10px; padding: 16px; }
.shop-card h2 { margin: 0; color: var(--navy); font-size: 1.1rem; line-height: 1.45; }
.shop-meta { color: var(--muted); font-size: .86rem; font-weight: 800; line-height: 1.65; }
.shop-catch { margin: 0; color: #4d4740; font-size: .9rem; font-weight: 700; line-height: 1.75; }
.budget-memo { margin: -2px 0 0; color: var(--muted); font-size: .82rem; font-weight: 700; line-height: 1.7; }
.budget-memo p { margin: 0; color: inherit; font-weight: inherit; }
.budget-memo span { display: block; margin-top: 2px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { border-radius: 8px; background: #eef6f1; color: var(--leaf); padding: 4px 8px; font-size: .78rem; font-weight: 900; }
.shop-link { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; border-radius: 8px; background: var(--navy); color: #fff; font-weight: 900; }
.full-width { grid-column: 1 / -1; }
.status-card h2 { margin: 0 0 8px; color: var(--navy); font-size: 1.2rem; }
.status-card p { margin: 0; }
.results-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 20px 0 0;
  color: var(--muted);
  font-weight: 900;
}
.pager-btn {
  min-width: 88px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  font-weight: 900;
}
.pager-btn:disabled { opacity: .45; cursor: not-allowed; }

.articles-preview { margin: 46px 0 70px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-title h2 { margin: 0; font-size: 1.45rem; }
.section-title a, .back-link a { color: var(--tomato); font-weight: 900; text-decoration: underline; }
.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.article-card { padding: 0; box-shadow: none; transition: transform .2s, border-color .2s; overflow: hidden; }
.article-card:hover { border-color: var(--tomato); transform: translateY(-2px); }
.article-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #ece3d3; }
.article-card h2, .article-card h3 { margin: 16px 18px 8px; color: var(--navy); font-size: 1.06rem; line-height: 1.5; }
.article-card p { margin: 0 18px 18px; color: var(--muted); font-size: .9rem; font-weight: 700; line-height: 1.75; }

.site-footer { display: flex; justify-content: center; gap: 18px; padding: 28px; color: var(--muted); font-size: .82rem; font-weight: 800; }
.page-shell { width: min(880px, 100% - 28px); margin: 36px auto 70px; padding: clamp(22px, 4vw, 34px); }
.page-shell h1 { margin: 0; color: var(--navy); font-size: clamp(1.8rem, 5vw, 2.5rem); }
.page-lead { color: var(--muted); font-weight: 800; line-height: 1.8; }
.article-body { box-shadow: none; padding: clamp(20px, 4vw, 34px); }
.article-top-image { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; margin: 0 0 28px; background: #ece3d3; }
.article-body h1 { margin-top: 0; color: var(--navy); line-height: 1.35; }
.article-body h2 { margin-top: 34px; color: var(--leaf); line-height: 1.45; }
.article-body p, .article-body li { color: #45413b; line-height: 2; }
.article-body a { color: var(--tomato); font-weight: 900; text-decoration: underline; }

@media (max-width: 860px) {
  .desktop-nav { display: none; }
  .field-grid, .article-grid { grid-template-columns: 1fr; }
  .hero {
    min-height: 230px;
    padding-top: 34px;
    padding-bottom: 34px;
    background-position: center center;
  }
  .search-mode-options, .ng-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .location-panel { grid-template-columns: 1fr; }
}

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

@media (max-width: 560px) {
  .main-header { height: 64px; }
  .app-shell { padding-top: 64px; }
  #menu-btn { top: 11px; right: 14px; }
  .header-container { width: min(100% - 28px, 1080px); justify-content: flex-start; }
  main { width: min(100% - 22px, 1080px); }
  .hero h1 { font-size: clamp(1.35rem, 6vw, 1.75rem); max-width: 100%; }
  .subtitle { max-width: 360px; }
  .hero-lead { font-size: .9rem; }
}
