:root {
  --fg: #2a1d22; --muted: #74636a; --line: #eadfe3; --bg: #f8f4f5; --card: #fff; --accent: #7a1f3d;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--fg); background: var(--bg); line-height: 1.7; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: .4em 0; line-height: 1.35; }
h2 { font-size: 1.15rem; margin: 0 0 .6em; }
h3 { font-size: 1rem; margin: 1em 0 .4em; }
small { font-weight: normal; }
.muted { color: var(--muted); font-size: .88rem; }
.lead { font-size: 1.02rem; }

.site-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3em 1em; padding: .8em 1.2em; background: var(--card); border-bottom: 1px solid var(--line); }
.logo { white-space: nowrap; font-weight: 800; font-size: 1.4rem; text-decoration: none; color: var(--fg); }
.tagline { color: var(--muted); font-size: .85rem; }
.gnav { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .2em 1em; font-size: .92rem; white-space: nowrap; }
.gnav a { text-decoration: none; color: var(--fg); padding: .2em 0; }
.gnav a[aria-current] { color: var(--accent); border-bottom: 2px solid var(--accent); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 1em; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
@media (max-width: 1023px) { .wrap { grid-template-columns: minmax(0, 1fr); } .side { display: none; } }
.sticky { position: sticky; top: 16px; }

.panel, .intro { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1em 1.2em; margin: 0 0 1em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 1em; }
.cards > .ad { grid-column: 1 / -1; }
.panel .cards { margin-bottom: 0; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .9em 1em; color: inherit; text-decoration: none; }
.card:hover { border-color: var(--accent); }
.card h3, .card h2 { margin: 0 0 .3em; font-size: 1.05rem; color: var(--accent); }
.card p { margin: .2em 0; }
.axes .card h3, .axes .card h2 { font-size: 1.25rem; }

.crumb { font-size: .85rem; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: .4em; margin: .3em 0; }
.tag { display: inline-block; padding: .05em .6em; border-radius: 999px; font-size: .75rem; border: 1px solid var(--line); background: var(--bg); color: var(--fg); text-decoration: none; }
.tag-est { background: #eef0fa; border-color: #c8cdee; }
.tag-review { background: #fff4d6; border-color: #e9c96b; }
.tag-aroma { border-color: var(--c); border-left-width: 6px; background: #fff; }

dl.kv { margin: 0; }
dl.kv > div { display: grid; grid-template-columns: 9em 1fr; gap: .8em; padding: .4em 0; border-bottom: 1px solid var(--line); }
dl.kv > div:last-child { border-bottom: 0; }
dl.kv dt { color: var(--muted); font-size: .88rem; }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { dl.kv > div { grid-template-columns: 1fr; gap: 0; } }

.taste { max-width: 360px; }
.taste-row { display: grid; grid-template-columns: 3.5em 1fr 1.5em; align-items: center; gap: .6em; margin: .25em 0; }
.taste .bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.taste .bar i { height: 10px; border-radius: 3px; background: var(--line); }
.taste .bar i.on { background: var(--accent); }
.taste .v { font-variant-numeric: tabular-nums; text-align: right; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5em, 1fr)); gap: .6em 1em; margin: 0 0 1em; }
.stats div { border-left: 3px solid var(--accent); padding-left: .6em; }
.stats dt { color: var(--muted); font-size: .78rem; }
.stats dd { margin: 0; font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
ol.steps { padding-left: 1.4em; }
ol.steps li { margin: .5em 0; }
ol.steps .at { display: inline-block; min-width: 3.4em; margin-right: .5em; padding: 0 .4em; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); font-size: .8rem; text-align: center; font-variant-numeric: tabular-nums; }

.map { height: 380px; border-radius: 8px; border: 1px solid var(--line); background: #e9eef0; z-index: 0; margin-bottom: .3em; }
@media (max-width: 600px) { .map { height: 280px; } }
.map-note { margin: 0 0 1em; }
.origin-tree ul { margin: .2em 0 .4em; }

.aroma-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 1em; }
.aroma-cat { background: var(--card); border: 1px solid var(--line); border-top: 6px solid var(--c); border-radius: 10px; padding: .8em 1em; }
.aroma-cat h3 { margin: 0 0 .2em; }

.quote { margin: .5em 0; padding: .6em 1em; border-left: 4px solid var(--line); background: var(--bg); }
.quote blockquote { margin: 0; }
.quote figcaption { font-size: .8rem; color: var(--muted); }
.notice { margin: 1em 0; }
.meta h3 { font-size: .92rem; }
.sources, .todo { padding-left: 1.2em; margin: 0; font-size: .9rem; }

table.fc { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.fc th, table.fc td { border-bottom: 1px solid var(--line); padding: .45em .5em; text-align: left; vertical-align: top; }

.ad { margin: 0 auto 1em; text-align: center; max-width: 100%; }
.ad-label { font-size: .65rem; color: var(--muted); letter-spacing: .1em; }
.ad-placeholder { display: flex; align-items: center; justify-content: center; min-height: inherit; height: 90px; border: 1px dashed #cfc5bb; color: #a39588; font-size: .75rem; background: repeating-linear-gradient(45deg, #fbfaf8, #fbfaf8 8px, #f3efea 8px, #f3efea 16px); }
.ad-content1 .ad-placeholder, .ad-content2 .ad-placeholder { height: 250px; max-width: 336px; margin: 0 auto; }
.ad-side .ad-placeholder { height: 600px; }
.site-header + .ad { padding-top: 1em; }

.prose h2 { margin-top: 1.2em; }
.prose h2:first-child { margin-top: 0; }
.site-footer { border-top: 1px solid var(--line); background: var(--card); padding: 1.2em; font-size: .8rem; color: var(--muted); }
.site-footer .credit { max-width: 900px; }

.summary { border-left: 4px solid var(--accent); }
.summary p { margin: 0; font-weight: 600; }
.article-list li { margin: .5em 0; }
ul.plain { margin: 0; padding-left: 1.1em; }
ol.steps .why { display: inline-block; margin-left: .4em; font-size: .8rem; white-space: nowrap; }
ol.lesson-steps li::marker { color: var(--accent); font-weight: 700; }
.scroll { overflow-x: auto; }
table.fc caption { text-align: left; font-weight: 700; margin-bottom: .4em; }
table.fc tbody th { font-weight: 600; }
dl.glossary > div { padding: .5em 0; border-bottom: 1px solid var(--line); }
dl.glossary > div:last-child { border-bottom: 0; }
dl.glossary dt { font-weight: 700; }
dl.glossary dd { margin: .1em 0 0; }
dl.aroma-subs { margin: .4em 0 0; }
dl.aroma-subs > div { margin: .3em 0; }
dl.aroma-subs dt { font-size: .78rem; color: var(--muted); }
dl.aroma-subs dd { margin: .1em 0 0; }

.st { font-size: .7rem; vertical-align: middle; white-space: nowrap; }
.st-verified { background: #e6f2ed; border-color: #9fcdb7; }
.st-tasted { background: #e7eefb; border-color: #a9bfe8; }
.st-estimate { background: #eef0fa; border-color: #c8cdee; }
.st-recommendation { background: #f6efe6; border-color: #dcc3a3; }
.st-unverified { background: #fff4d6; border-color: #e9c96b; }
.status-legend { margin-top: 1em; }
h2 .st, h3 .st { margin-left: .3em; }

ul.refs { list-style: none; padding: 0; margin: 0; }
ul.refs > li { padding: .8em 0; border-bottom: 1px solid var(--line); }
ul.refs > li:last-child { border-bottom: 0; }
ul.refs p { margin: .2em 0; }
.ref-title { font-weight: 700; }
.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
details > summary { cursor: pointer; font-weight: 600; margin: .75rem 0 .25rem; }
.fc tbody th { white-space: nowrap; }

/* 市販商品の絞り込み */
.pfilter h2 { margin-top: 0; }
.pfilter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9em, 1fr)); gap: .6em 1em; }
.pfilter label { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); gap: .2em; }
.pfilter input, .pfilter select { font: inherit; font-size: 1rem; color: var(--fg); padding: .4em .5em; border: 1px solid var(--line); border-radius: 6px; background: #fff; min-width: 0; }
.pfilter .pfilter-q { grid-column: 1 / -1; }
.pfilter-foot { display: flex; align-items: center; gap: 1em; margin: .8em 0 .2em; }
.pfilter-foot output { font-weight: 700; }
.pfilter button { font: inherit; font-size: .85rem; padding: .3em .9em; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--fg); cursor: pointer; }
.brand-toc p { margin: .3em 0; }
.brand-toc a.is-out { color: var(--muted); opacity: .5; text-decoration: none; }
details.pbrand { border-top: 1px solid var(--line); padding-top: .2em; }
details.pbrand > summary { display: flex; align-items: baseline; gap: .6em; list-style: none; }
details.pbrand > summary::-webkit-details-marker { display: none; }
details.pbrand > summary::before { content: '▸'; color: var(--accent); transition: transform .15s; }
details.pbrand[open] > summary::before { transform: rotate(90deg); }
details.pbrand > summary h3 { display: inline; margin: 0; }
.pbrand h4 { margin: .6em 0 .2em; font-size: .9rem; color: var(--muted); }
[hidden] { display: none !important; }

/* ワイン、気になる。固有 */
.logo-en { font-weight: 500; font-size: .8rem; color: var(--muted); letter-spacing: .04em; }
.site-footer .drinking { font-size: .9rem; border: 1px solid var(--line); border-radius: 8px; padding: .6em .8em; background: var(--card); }

/* 記事の説明図（架空のラベルなど） */
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2em; }
.fig { margin: 0; }
.fig img { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto .4em; }
.fig figcaption strong { display: block; }
.fig figcaption .muted { display: block; }
ol.fig-notes { margin: .4em 0 0; padding-left: 0; list-style: none; counter-reset: fig; font-size: .88rem; }
ol.fig-notes li { counter-increment: fig; position: relative; padding: .15em 0 .15em 2em; }
ol.fig-notes li::before { content: counter(fig); position: absolute; left: 0; top: .25em; width: 1.5em; height: 1.5em; border-radius: 50%; background: var(--accent); color: #fff; font-size: .78rem; font-weight: 700; line-height: 1.5em; text-align: center; }
.fig-wide { grid-column: 1 / -1; }
.fig-wide img { max-width: 720px; }
.fig-wide ol.fig-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 1.5em; }

/* キーボード操作：本文へのスキップリンクと、フォーカスの枠 */
.skip { position: absolute; left: -9999px; top: 0; z-index: 10; padding: .5em 1em; background: var(--accent); color: #fff; }
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* サイト内検索 */
.search { display: flex; gap: .3em; margin-left: auto; }
.search input { width: 13em; max-width: 100%; padding: .35em .6em; border: 1px solid #b9a9af; border-radius: 6px; font: inherit; font-size: .9rem; background: #fff; color: var(--fg); }
.search button { padding: .35em .9em; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: #fff; font: inherit; font-size: .9rem; cursor: pointer; }
.search-page { margin: 0 0 .6em; }
.search-page input { flex: 1; width: auto; font-size: 1rem; }
@media (max-width: 600px) { .site-header .search { flex-basis: 100%; margin-left: 0; } .site-header .search input { flex: 1; width: auto; } }
ul.results { list-style: none; padding: 0; margin: 0; }
ul.results li { padding: .6em 0; border-top: 1px solid var(--line); }
ul.results li:first-child { border-top: 0; }

/* 索引（ラベルの言葉を詰めて並べる） */
ul.index { list-style: none; padding: 0; margin: 0; columns: 2 16em; column-gap: 2em; }
ul.index li { break-inside: avoid; padding: .15em 0; }
dl.kv dd > p { margin: 0 0 .6em; }
dl.kv dd > p:last-child { margin-bottom: 0; }
.status-legend { line-height: 2; }
table.scale tr.here > * { background: #f6e9ee; }
table.scale tr.here th { border-left: 4px solid var(--accent); }
