/* INIC coffee 風: 明朝体の本文 × ゴシックの見出し、モノクロ基調のミニマルデザイン */

:root {
  --bg: #fff;
  --surface: #fff;
  --ink: #333;
  --ink-strong: #231815; /* 濃い珈琲色 */
  --ink-soft: #888;
  --line: #e6e6e6;
  --band: #333;      /* h2 黒帯 */
  --band-soft: #f0f0f0; /* h3 薄グレー帯 */
  --accent: #333;
  --accent2: #8a7563;
  --font-serif: "Yu Mincho", "游明朝", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --font-gothic: "Hiragino Kaku Gothic ProN", "Yu Gothic", "游ゴシック", "Noto Sans JP", Meiryo, sans-serif;
}

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

body {
  font-family: var(--font-serif);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.9;
}

/* ---- header ---- */
header {
  background: #fff;
  color: var(--ink-strong);
  padding: 40px 24px 32px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.logo {
  font-family: var(--font-gothic);
  font-size: 26px;
  letter-spacing: 0.5em;
  text-indent: 0.5em; /* letter-spacing の右余白を相殺して中央に */
  font-weight: 400;
}
.logo span { font-weight: 700; }
.logo a { color: inherit; text-decoration: none; }
.tagline {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 10px;
  letter-spacing: 0.2em;
}
.site-nav {
  font-family: var(--font-gothic);
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 32px;
  font-size: 13px;
  letter-spacing: 0.15em;
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }

.layout {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding: 0 20px;
}
main { flex: 1; min-width: 0; max-width: 1040px; margin: 0 auto; padding: 40px 0 100px; }

/* ---- ad slots ---- */
.ad-rail {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 20px;
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.ad-slot {
  font-family: var(--font-gothic);
  border: 1px dashed #ccc;
  background: #fafafa;
  color: #aaa;
  font-size: 11px;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.8;
}
.ad-rect { width: 300px; height: 250px; }
.ad-sky { width: 300px; height: 600px; }
.ad-banner { max-width: 728px; height: 90px; margin: 48px auto 0; }
@media (max-width: 1180px) {
  .ad-rail { display: none; }
}

/* 記事・一覧ページ: 読みやすい本文幅 + 広告レール。レール非表示時も中央寄せ維持 */
.layout { justify-content: center; }
.layout > .page { flex: 1; margin: 0; max-width: 760px; }

/* ---- search ---- */
.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}
.search-box input {
  font-family: var(--font-gothic);
  flex: 1;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 11px 14px;
  font-size: 13.5px;
  color: var(--ink);
  background: #fff;
  outline: none;
}
.search-box input::placeholder { color: #bbb; }
.search-box input:focus { border-color: var(--ink-strong); box-shadow: 0 0 0 1px var(--ink-strong); }
.result-count {
  font-family: var(--font-gothic);
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  letter-spacing: 0.05em;
}
.empty {
  grid-column: 1 / -1;
  background: #fff;
  padding: 40px 20px;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-soft);
}

/* ---- section headings (INIC風: 黒帯) ---- */
.recipes-section h2, .guide-section h2 {
  font-family: var(--font-gothic);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.15em;
  background: var(--band);
  color: #fff;
  padding: 8px 16px;
}
.section-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 12px 0 20px;
}

/* セクション見出し + スライダー操作 */
.section-head { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.section-head h2 { flex: 1; min-width: 200px; display: flex; align-items: center; }
.slider-ctrl { display: flex; align-items: stretch; gap: 6px; flex-shrink: 0; }
.mini-btn {
  font-family: var(--font-gothic);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 0 12px;
  cursor: pointer;
  white-space: nowrap;
}
.mini-btn:hover { color: var(--ink); border-color: var(--ink); }
.arrow-btn {
  font-family: var(--font-gothic);
  width: 36px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.arrow-btn:hover { background: var(--band-soft); }

/* 価格帯の凡例 */
.price-legend {
  font-family: var(--font-gothic);
  font-size: 12px;
  color: var(--ink-soft);
  margin: 12px 2px 0;
  letter-spacing: 0.03em;
}
.price-legend b { color: var(--ink); font-weight: 700; margin: 0 3px; }
.price-legend span { display: block; margin-top: 3px; font-size: 11px; color: #b0a595; }

/* ---- filters ---- */
#filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 28px;
}
.chip {
  font-family: var(--font-gothic);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 2px;
  padding: 5px 14px;
  font-size: 12px;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--band); border-color: var(--band); color: #fff; }

/* ---- grid / cards ---- */
#grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  /* DBが増えても縦に伸びないよう、数段だけ表示してこの中で個別スクロール */
  max-height: 60vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* スクロール可能なことが分かるよう控えめなスクロールバー */
#grid::-webkit-scrollbar { width: 8px; }
#grid::-webkit-scrollbar-thumb { background: #d8cdbd; border-radius: 4px; }
#grid::-webkit-scrollbar-track { background: transparent; }
.card {
  background: var(--surface);
  padding: 20px 18px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card:hover, .card:focus-visible {
  background: #f9f9f9;
  outline: none;
}
.card-head { display: flex; gap: 10px; align-items: flex-start; }
.flag-badge {
  font-family: var(--font-gothic);
  flex-shrink: 0;
  width: 34px; height: 34px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-indent: 0.08em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.flag-badge-lg { width: 52px; height: 52px; font-size: 17px; }
.card-country {
  font-family: var(--font-gothic);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}
.card-name { font-family: var(--font-gothic); font-size: 15px; font-weight: 700; line-height: 1.5; }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-family: var(--font-gothic);
  font-size: 10.5px;
  background: var(--band-soft);
  color: #666;
  border-radius: 2px;
  padding: 2px 8px;
  letter-spacing: 0.05em;
}
.card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-gothic);
  font-size: 11.5px;
  color: var(--ink-soft);
}
.price { margin-left: auto; font-weight: 700; color: var(--ink); font-size: 13.5px; }
.price small { font-weight: 400; color: var(--ink-soft); }
.role {
  font-family: var(--font-gothic);
  font-size: 10px;
  border-radius: 2px;
  padding: 2px 7px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: 1px solid;
  background: none;
}
.role-base { color: #5b6b78; border-color: #b9c3cb; }
.role-character { color: #8a5b4e; border-color: #cdb4ac; }
.role-accent { color: #6e5b7e; border-color: #c3b6cd; }

/* ---- detail panel ---- */
#overlay {
  position: fixed; inset: 0;
  background: rgba(35, 24, 21, 0.5);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}
#overlay.open { opacity: 1; pointer-events: auto; }

#detail {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(680px, 94vw);
  background: #fff;
  z-index: 11;
  transform: translateX(102%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  padding: 32px 32px 60px;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}
#detail.open { transform: translateX(0); }

.close-btn {
  position: sticky;
  top: 0;
  float: right;
  font-size: 20px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 0;
  width: 36px; height: 36px;
  cursor: pointer;
  color: var(--ink-soft);
  z-index: 2;
}
.close-btn:hover { color: var(--ink); border-color: var(--ink); }

.detail-head { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; }
.detail-head h2 {
  font-family: var(--font-gothic);
  font-size: 20px;
  font-weight: 700;
  margin: 2px 0 8px;
  letter-spacing: 0.05em;
}

.detail-cols {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 560px) { .detail-cols { grid-template-columns: 1fr; } }

.desc { font-size: 14px; margin-bottom: 16px; }
.spec {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-gothic);
  font-size: 12.5px;
  margin-bottom: 20px;
}
.spec th, .spec td { border-bottom: 1px solid var(--line); padding: 8px 4px; text-align: left; }
.spec th { color: var(--ink-soft); font-weight: 500; width: 40%; letter-spacing: 0.05em; }

.price-note { font-size: 10.5px; color: var(--ink-soft); }

.shop-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.shop-links-label {
  font-family: var(--font-gothic);
  width: 100%;
  font-size: 11.5px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}
.shop-btn {
  font-family: var(--font-gothic);
  display: inline-block;
  background: var(--ink-strong);
  color: #fff;
  text-decoration: none;
  border-radius: 2px;
  padding: 10px 22px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.shop-btn:hover { background: #4a3b35; }

.text-link {
  font-family: var(--font-gothic);
  color: var(--ink-strong);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.text-link:hover { color: #4a3b35; }

.detail-radar {
  border: 1px solid var(--line);
  padding: 16px;
}
.radar { width: 100%; height: auto; display: block; }
.radar-label { font-family: var(--font-gothic); font-size: 10px; fill: var(--ink-soft); }

.bar-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.bar-label { font-family: var(--font-gothic); font-size: 10.5px; color: var(--ink-soft); width: 58px; flex-shrink: 0; }
.bar-track { flex: 1; height: 4px; background: var(--band-soft); }
.bar-fill { height: 100%; background: var(--ink); }

/* ---- recommendations ---- */
.rec-section { margin-top: 36px; }
.rec-section h3 {
  font-family: var(--font-gothic);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: var(--band-soft);
  color: var(--ink);
  padding: 7px 14px;
}
.rec-sub { font-size: 12.5px; color: var(--ink-soft); margin: 10px 0 12px; }
.rec-list { display: flex; flex-direction: column; gap: 14px; }

.goal-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.goal-chip.active { background: var(--ink-strong); border-color: var(--ink-strong); }

.rec-card {
  display: flex;
  gap: 14px;
  border: 1px solid var(--line);
  padding: 18px;
}
.rec-rank {
  font-family: var(--font-gothic);
  flex-shrink: 0;
  width: 30px; height: 30px;
  background: var(--band);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rec-body { flex: 1; min-width: 0; }
.rec-head { display: flex; gap: 10px; align-items: flex-start; }
.rec-name { font-family: var(--font-gothic); font-size: 14.5px; font-weight: 700; }
.rec-score {
  font-family: var(--font-gothic);
  margin-left: auto;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-strong);
  white-space: nowrap;
}
.rec-score small { font-size: 10.5px; color: var(--ink-soft); font-weight: 400; }
.rec-ratio { font-family: var(--font-gothic); font-size: 12.5px; margin: 8px 0 4px; }
.rec-ratio strong { font-size: 15px; }
.rec-reason { font-size: 13px; color: #555; }
.rec-radar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.rec-radar .radar { width: 140px; flex-shrink: 0; }
.rec-radar-caption { font-family: var(--font-gothic); font-size: 11px; color: var(--ink-soft); letter-spacing: 0.05em; }

.link-btn {
  font-family: var(--font-gothic);
  background: none;
  border: none;
  color: var(--ink);
  font-size: 12.5px;
  cursor: pointer;
  padding: 6px 0 0;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-bottom: 1px solid transparent;
}
.link-btn:hover { border-bottom-color: var(--ink); }

/* ---- recipes ---- */
.recipes-section, .guide-section { margin-top: 64px; }

/* レシピは横スライダー: 数枚だけ見せて残りは左右スクロール */
.recipe-slider {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 8px;
  align-items: stretch;
}
.recipe-slider::-webkit-scrollbar { height: 8px; }
.recipe-slider::-webkit-scrollbar-thumb { background: #d8cdbd; border-radius: 4px; }
.recipe-slider::-webkit-scrollbar-track { background: transparent; }
.recipe-card {
  flex: 0 0 auto;
  width: 250px;
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid var(--line);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@media (max-width: 560px) { .recipe-card { width: 82vw; } }
.recipe-head { display: flex; align-items: center; gap: 10px; }
.recipe-head h3 { font-family: var(--font-gothic); font-size: 15px; font-weight: 700; letter-spacing: 0.05em; }
.goal-tag { background: none; border: 1px solid var(--line); color: var(--ink-soft); }
.recipe-beans { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.recipe-bean { padding: 0; font-size: 13px; }
.recipe-x { color: var(--ink-soft); font-size: 11px; margin: 0 3px; }
.recipe-ratio { font-family: var(--font-gothic); font-size: 12.5px; }
.recipe-ratio strong { font-size: 14.5px; }
.recipe-comment { font-size: 12.5px; color: #555; }
.recipe-radar { margin-top: auto; }
.recipe-radar .radar { width: 150px; margin: 0 auto; }

/* ---- static pages (privacy / about) ---- */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}
.page h2 {
  font-family: var(--font-gothic);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.15em;
  background: var(--band);
  color: #fff;
  padding: 8px 16px;
  margin-bottom: 24px;
}
.page h3 {
  font-family: var(--font-gothic);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: var(--band-soft);
  padding: 6px 14px;
  margin: 28px 0 12px;
}
.page p { font-size: 13.5px; margin-bottom: 10px; }
.page a { color: var(--ink); }
.page-date {
  margin-top: 32px;
  font-family: var(--font-gothic);
  font-size: 12px;
  color: var(--ink-soft);
  text-align: right;
}

/* ---- articles ---- */
.article-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 24px;
}
.article-item {
  background: #fff;
  padding: 22px 24px;
  display: block;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s;
}
.article-item:hover { background: #f9f9f9; }
.article-item h3 {
  font-family: var(--font-gothic);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: none;
  padding: 0;
  margin: 0 0 6px;
}
.article-item p { font-size: 13px; color: #666; margin: 0; }
.article-item .article-date {
  font-family: var(--font-gothic);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 6px;
}

.article-meta {
  font-family: var(--font-gothic);
  font-size: 11.5px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}
.page table.info {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-gothic);
  font-size: 12.5px;
  margin: 12px 0 16px;
}
.page table.info th, .page table.info td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}
.page table.info th { background: var(--band-soft); font-weight: 700; white-space: nowrap; }
.related-box {
  border: 1px solid var(--line);
  padding: 16px 18px;
  margin-top: 28px;
}
.related-box h4 {
  font-family: var(--font-gothic);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.related-box ul { list-style: none; }
.related-box li { margin: 4px 0; font-size: 13px; }
.related-box a { color: var(--ink-strong); }

/* ---- footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 28px 20px 36px;
  text-align: center;
}
.site-footer nav {
  font-family: var(--font-gothic);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 12px;
  letter-spacing: 0.05em;
}
.site-footer nav a { color: var(--ink-soft); text-decoration: none; }
.site-footer nav a:hover { color: var(--ink); }
.site-footer p {
  font-family: var(--font-gothic);
  margin-top: 14px;
  font-size: 11px;
  color: #bbb;
  letter-spacing: 0.1em;
}

/* ---- guide ---- */
#guide {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.tip-card {
  display: flex;
  gap: 14px;
  border: 1px solid var(--line);
  padding: 16px 18px;
}
.tip-num {
  font-family: var(--font-gothic);
  flex-shrink: 0;
  width: 24px; height: 24px;
  background: var(--band);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}
.tip-card h4 { font-family: var(--font-gothic); font-size: 13px; margin-bottom: 4px; letter-spacing: 0.05em; }
.tip-card p { font-size: 12.5px; color: #555; }
