/* Blog layout: sticky masthead, feed + sidebar on wide screens, single reading column for posts */
:root {
  --bg: #ffffff;
  --surface: #e9f5ef;
  --ink: #0f1f18;
  --graphite: #56665e;
  --rule: #d5e0da;
  --slate: #197a56;
  --accent: #197a56;
  --logo: #03522d;
  --hero: #03522d;
  --footer: #03522d;
  --tint: 0%; /* 다크 모드에서 카테고리 색을 밝히는 비율 */
  --sans: 'IBM Plex Sans KR', system-ui, sans-serif;
  --serif: 'IBM Plex Sans KR', system-ui, sans-serif;
  --measure: 40rem;
  --wide: calc(70vw + 18rem + 3rem + 2.5rem); /* 글 목록 70vw + 사이드바 + 간격 + 좌우 여백 */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0b1f17;
    --surface: #123024;
    --ink: #eef6f1;
    --graphite: #a9bdb2;
    --rule: #254436;
    --slate: #4fd093;
    --accent: #29ba74;
    --logo: #4fd093;
    --hero: #0f4a30;
    --footer: #07150f;
    --tint: 50%;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0b1f17;
  --surface: #123024;
  --ink: #eef6f1;
  --graphite: #a9bdb2;
  --rule: #254436;
  --slate: #4fd093;
  --accent: #29ba74;
  --logo: #4fd093;
  --hero: #0f4a30;
  --footer: #07150f;
  --tint: 50%;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.7 var(--sans);
  word-break: keep-all;
  overflow-wrap: break-word;
}
::selection { background: #197a56; color: #fff; }
a { color: var(--slate); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--slate); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--sans); font-weight: 600; line-height: 1.35; letter-spacing: -0.02em; text-wrap: balance; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--accent); color: #fff; padding: 0.4rem 0.8rem; z-index: 20; }

.wrap { max-width: var(--wide); margin: 0 auto; padding-inline: max(1.25rem, env(safe-area-inset-left, 0px)); }

/* ── masthead ───────────────────────────── */
.masthead {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; min-height: 3.5rem; flex-wrap: wrap; }
.brand { text-decoration: none; color: var(--logo); display: flex; align-items: center; }
.brand:hover { color: var(--accent); }
.brand-name { font-family: var(--sans); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.02em; }
.masthead nav { display: flex; align-items: center; gap: 1.5rem; font-size: 0.95rem; }
.back-link { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 0.9rem; font-weight: 500; color: var(--slate); text-decoration: none; padding: 0.3rem 0.5rem 0.3rem 0; margin-bottom: 0.75rem; }
.back-link:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.post-nav { clear: both; }
.share-btn { display: inline-flex; align-items: center; gap: 0.35rem; font: inherit; font-size: 0.85rem; font-weight: 500; color: var(--slate); background: transparent; border: 1px solid var(--slate); border-radius: 3px; padding: 0.25rem 0.6rem; cursor: pointer; white-space: nowrap; }
.share-btn:hover, .share-btn.done { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 560px) {
  .masthead nav { gap: 0.9rem; }
  .share-btn { padding: 0.35rem 0.45rem; }
  .share-btn span { display: none; }
  .share-btn.done span { display: inline; }
}
.masthead nav a { color: var(--ink); text-decoration: none; padding: 0.25rem 0; }
.masthead nav a:hover { color: var(--accent); }
.masthead nav a[aria-current='page'] { font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }

/* ── blog grid ──────────────────────────── */
.blog { display: grid; gap: 3rem; padding-block: 2.5rem 0; }
@media (min-width: 960px) { .blog { grid-template-columns: minmax(0, 1fr) 18rem; gap: 3rem; } }
.blog > * { min-width: 0; }

.feed-head, .side-title, .year { position: relative; border-top: 1px solid var(--rule); padding-top: 0.8rem; }
.feed-head::before, .side-title::before, .year::before { content: ''; position: absolute; left: 0; top: -1px; width: 2.5rem; height: 5px; background: color-mix(in srgb, var(--c, var(--accent)), #fff var(--tint)); }
.feed-head { margin: 0 0 0.5rem; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.feed-head h1 { font-size: 1.6rem; margin: 0; }
.feed-head p { margin: 0; color: var(--graphite); font-size: 0.9rem; }

/* featured (newest) */
.featured { display: block; text-decoration: none; color: var(--ink); padding: 2rem; margin: 0.75rem 0 0.25rem; background: var(--hero); color: #fff; }
.featured .thumb { width: min(100%, 48rem); aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface); margin-bottom: 1.25rem; max-width: 100%; }
.featured .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0.35rem 0 0.6rem; }
.featured p.sub { margin: 0; font-size: 1rem; line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.featured:hover h2 { color: #fff; text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 2px; }
.featured .kicker, .featured .kicker .cat, .featured p.sub { color: #d3eadf; }
.featured .lang-tag { color: #d3eadf; border-color: #d3eadf; }

/* card list */
.cards { list-style: none; margin: 0; padding: 0; }
.card { position: relative; border-bottom: 1px solid var(--rule); }
.card::before, .featured::before { content: ''; position: absolute; left: 0; top: -1px; width: 2.5rem; height: 4px; background: color-mix(in srgb, var(--c, var(--accent)), #fff var(--tint)); }
.card:first-child::before { display: none; }
.featured { position: relative; }
.featured::before { top: 0; display: none; }
.card a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.25rem; padding: 1.4rem 0; text-decoration: none; color: var(--ink); align-items: start; }
.card h3 { font-size: 1.2rem; margin: 0.25rem 0 0.4rem; }
.card a:hover h3 { color: color-mix(in srgb, var(--c, var(--accent)), #fff var(--tint)); }
.card .sub { margin: 0; font-size: 0.93rem; color: var(--graphite); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .thumb { width: 9rem; aspect-ratio: 3 / 2; overflow: hidden; background: var(--surface); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.contain img { object-fit: contain; }
.thumb.books { display: flex; justify-content: center; align-items: center; gap: 8%; padding: 0.4rem 0; background: #f3eedc; }
.thumb.books img { width: auto; height: 100%; max-width: 42%; object-fit: contain; box-shadow: 0 3px 8px rgba(0,0,0,.28); }
.featured .thumb.books { padding: 1rem 0; }
@media (max-width: 560px) { .card .thumb { width: 6rem; } }

.kicker { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; font-size: 0.8rem; color: var(--graphite); align-items: center; }
.kicker .cat { color: var(--ink); font-weight: 400; }
.kicker .cat::before { content: ''; display: inline-block; width: 0.6em; height: 0.6em; margin-right: 0.4em; background: color-mix(in srgb, var(--c, var(--accent)), #fff var(--tint)); }
.lang-tag { font-size: 0.7rem; border: 1px solid var(--rule); border-radius: 3px; padding: 0 0.3rem; color: var(--graphite); }

/* pagination */
.pager { display: flex; justify-content: center; align-items: center; gap: 0.35rem; margin: 2.5rem 0 0; font-size: 0.95rem; flex-wrap: wrap; }
.pager a, .pager span { min-width: 2.25rem; text-align: center; padding: 0.35rem 0.6rem; text-decoration: none; color: var(--graphite); font-variant-numeric: tabular-nums; }
.pager a:hover { background: var(--surface); color: var(--ink); }
.pager [aria-current='page'] { color: #fff; background: #197a56; font-weight: 600; }

/* ── sidebar ────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 2.25rem; }
@media (min-width: 960px) { .sidebar { position: sticky; top: 5.5rem; align-self: start; } }
.side-title { font-size: 1rem; color: var(--ink); margin: 0 0 0.6rem; }
.profile { background: var(--surface); padding: 1.25rem; }
.profile .role { margin: 0 0 0.6rem; font-size: 0.85rem; color: var(--accent); font-weight: 600; }
.profile p { margin: 0 0 1rem; font-size: 0.9rem; line-height: 1.65; }
.profile p:last-child { margin-bottom: 0; }

/* category index — keeps the book-index leaders */
.index { list-style: none; margin: 0; padding: 0; font-size: 0.93rem; }
.index a { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.3rem 0; color: var(--ink); text-decoration: none; }
.index .leader { flex: 1; min-width: 1rem; }
.index li { border-bottom: 1px solid var(--rule); }
.index .count { font-size: 0.85rem; color: var(--graphite); font-variant-numeric: tabular-nums; }
.index .term { position: relative; padding-left: 1.05em; }
.index .term::before { content: ''; position: absolute; left: 0; top: 0.42em; width: 0.65em; height: 0.65em; background: color-mix(in srgb, var(--c, var(--accent)), #fff var(--tint)); }
.index a:hover .term, .index a[aria-current='page'] .term { color: color-mix(in srgb, var(--c, var(--accent)), #fff var(--tint)); }
.index a[aria-current='page'] .term { font-weight: 600; }
.side-list { list-style: none; margin: 0; padding: 0; font-size: 0.93rem; display: grid; gap: 0.5rem; }
.side-list a { color: var(--ink); text-decoration: none; }
.side-list a:hover { color: var(--accent); }
.side-list span { color: var(--graphite); font-size: 0.82rem; margin-left: 0.35rem; }

/* ── page heads ─────────────────────────── */
.page-head { padding: 3rem 0 1.5rem; max-width: var(--measure); }
.page-head h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); margin: 0 0 0.5rem; }
.page-head p { margin: 0; color: var(--graphite); }
.meta { font-size: 0.85rem; color: var(--graphite); }
.section-title { font-size: 1.2rem; margin: 0 0 1rem; }

/* compact list (archive, series) */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding: 0.9rem 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.15rem 1.25rem; }
.post-list time { font-size: 0.85rem; color: var(--graphite); padding-top: 0.15rem; font-variant-numeric: tabular-nums; }
.post-list a { color: var(--ink); text-decoration: none; font-weight: 500; }
.post-list a:hover { color: var(--accent); }
.post-list .sub { grid-column: 2; margin: 0; font-size: 0.9rem; color: var(--graphite); }
@media (max-width: 560px) { .post-list li { grid-template-columns: 1fr; } .post-list .sub { grid-column: 1; } }
.year { font-size: 1.15rem; color: var(--ink); margin: 2.5rem 0 0.25rem; }

/* ── article ────────────────────────────── */
.article { max-width: 52.5rem; margin: 0 auto; padding-top: 1.25rem; } /* 본문 840px: 한 줄 40~47자 */
.article-head { border-top: 1px solid var(--rule); position: relative; padding-top: 1rem; }
.article-head::before { content: ''; position: absolute; left: 0; top: -1px; width: 2.5rem; height: 5px; background: color-mix(in srgb, var(--c, var(--accent)), #fff var(--tint)); }
.article-head h1 { font-size: clamp(1.7rem, 4.5vw, 2.35rem); margin: 0.6rem 0 0.9rem; }
.article-cover { margin: 0 0 2rem; border-radius: 6px; overflow: hidden; border: 1px solid var(--rule); }
.article-cover img { display: block; width: 100%; }
.prose { font-family: var(--serif); font-size: clamp(17px, 1.25vw, 19px); line-height: 1.85; margin-top: 2rem; }
.prose p, .prose li { max-width: 60em; }

.prose h2 { font-size: 1.35em; margin: 2.75rem 0 0.75rem; }
.prose h3, .prose h4 { font-size: 1.15em; margin: 2.25rem 0 0.5rem; }
.prose p { margin: 0 0 1.2rem; }
.prose img { display: block; margin: 2rem auto; border-radius: 4px; }
.prose blockquote { margin: 1.75rem 0; padding: 0.25rem 0 0.25rem 1.25rem; border-left: 3px solid var(--accent); color: var(--graphite); }
.prose ul { padding-left: 1.25rem; }
.prose li { margin: 0.3rem 0; }
.prose table { border-collapse: collapse; font-family: var(--sans); font-size: 0.9rem; display: block; overflow-x: auto; }
.prose td, .prose th { border: 1px solid var(--rule); padding: 0.4rem 0.6rem; }

/* ── 부제 · 긴 글(essay) 부품 ────────────── */
.article-subtitle { font-size: clamp(1.05rem, 2vw, 1.35rem); line-height: 1.55; color: var(--graphite); margin: -0.35rem 0 0.9rem; font-weight: 500; }
.essay { counter-reset: sec fig; }
.essay h2:not(.plain) { counter-increment: sec; display: grid; grid-template-columns: auto 1fr; gap: 0 0.7em; align-items: baseline; font-size: 1.45em; line-height: 1.4; margin: 3.75rem 0 1.1rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.essay h2:not(.plain)::before { content: counter(sec, decimal-leading-zero); color: var(--accent); font-size: 0.72em; font-weight: 600; }
.essay h2.plain { font-size: 1.2em; margin: 3.75rem 0 1rem; padding-top: 1.25rem; border-top: 2px solid var(--ink); }
.essay strong { font-weight: 600; background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 24%, transparent) 0); }
.essay-quote, .prose .essay-quote { margin: 0 0 2rem; padding: 0.2rem 0 0.2rem 1.1rem; border-left: 4px solid var(--accent); color: var(--ink); font-size: clamp(1.3rem, 2.6vw, 1.75rem); font-weight: 600; line-height: 1.45; }
.essay-toc { margin: 2.25rem 0; padding: 1.1rem 1.35rem; background: var(--surface); border-radius: 6px; font-size: 0.86em; }
.prose .essay-toc p { margin: 0 0 0.5rem; font-weight: 600; }
.essay-toc ol { margin: 0; padding-left: 1.5rem; columns: 2; column-gap: 2.5rem; }
.essay-toc li { margin: 0.2rem 0; break-inside: avoid; }
.essay-toc a { color: var(--ink); text-decoration: none; }
.essay-toc a:hover { color: var(--accent); text-decoration: underline; }
.essay-fig { margin: 2.25rem 0; font-size: 0.86em; line-height: 1.6; }
.essay-fig figcaption { margin-bottom: 0.7rem; color: var(--graphite); }
.essay-fig figcaption b { color: var(--accent); }
.prose .fig-note { margin: 0.65rem 0 0; font-size: 0.88em; color: var(--graphite); }
.fig-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.fig-split > div { padding: 1.1rem 1.25rem; border-radius: 6px; border: 1px solid var(--rule); }
.fig-split h3, .prose .fig-split h3 { margin: 0 0 0.5rem; font-size: 1.02em; }
.fig-split ul { margin: 0; padding-left: 1.1rem; }
.fig-closed { background: var(--hero); color: #fff; border-color: var(--hero) !important; }
.fig-open { border-style: dashed !important; }
.fig-row { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: 1rem; padding: 0.75rem 0.25rem; border-bottom: 1px solid var(--rule); }
.fig-case .fig-row { grid-template-columns: 3rem 1fr 1fr; }
.fig-head { padding-top: 0.25rem; border-bottom: 2px solid var(--ink); font-weight: 600; font-size: 0.92em; }
.fig-row small { display: block; color: var(--graphite); font-size: 0.88em; }
.prose .fig-goal { max-width: none; margin: 0.75rem 0 0; padding: 0.6rem; text-align: center; background: var(--hero); color: #fff; border-radius: 4px; font-weight: 600; }
.fig-steps { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 0.75rem; }
.fig-steps > div { display: flex; flex-direction: column; padding: 1rem 1.15rem; border: 1px solid var(--rule); border-radius: 6px; }
.fig-steps span { color: var(--accent); font-size: 0.88em; font-weight: 600; }
.fig-steps b { margin: 0.2rem 0; font-size: 1.1em; font-weight: 600; }
.fig-steps small { color: var(--graphite); font-size: 0.88em; }
.fig-steps .is-key { background: var(--surface); border-color: var(--accent); }
.fig-matrix { display: grid; grid-template-columns: 5.5rem 1fr 1fr; gap: 0.5rem; }
.m-col { font-weight: 600; font-size: 0.92em; align-self: end; }
.m-rowh { font-weight: 600; font-size: 0.92em; align-self: center; }
.m-cell { padding: 0.9rem 1rem; border: 1px solid var(--rule); border-radius: 6px; }
.m-cell b { display: block; font-weight: 600; }
.m-cell small { color: var(--graphite); font-size: 0.9em; }
.m-cell.is-local { background: var(--surface); }
.m-cell.is-joint { background: var(--hero); border-color: var(--hero); color: #fff; }
.m-cell.is-joint small { color: #d3eadf; }
.prose ol.essay-cards { list-style: none; counter-reset: card; margin: 1.75rem 0; padding: 0; display: grid; gap: 0.6rem; font-size: 0.92em; }
.essay-cards li, .prose .essay-cards li { counter-increment: card; display: grid; grid-template-columns: 2.25rem 7.5rem 1fr; gap: 0.1rem 0.75rem; max-width: none; margin: 0; padding: 0.95rem 1.1rem; border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: 4px; line-height: 1.6; }
.essay-cards li::before { content: counter(card); grid-row: span 2; color: var(--accent); font-size: 1.5em; font-weight: 600; line-height: 1.1; }
.essay-cards b { grid-row: span 2; font-weight: 600; font-size: 1.08em; }
.essay-cards .q { font-weight: 600; }
.essay-cards li > span:last-child { color: var(--graphite); }
.essay-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin: 1.75rem 0; }
.essay-stats > div { padding: 1.1rem 1.2rem; background: var(--surface); border-radius: 6px; }
.essay-stats b { display: block; color: var(--accent); font-size: 2.1em; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.essay-stats span { display: block; margin-top: 0.3rem; font-size: 0.8em; line-height: 1.55; color: var(--graphite); }
.essay-books { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; font-size: 0.82em; line-height: 1.6; }
.bk-cover { display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; aspect-ratio: 2 / 3; padding: 1rem; background: var(--hero); color: #fff; border-radius: 3px; box-shadow: 0 1px 4px rgb(0 0 0 / 0.2); }
.bk-cover img, .prose .bk-cover img { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; object-fit: cover; border-radius: 0; }
.essay-books article:nth-child(2) .bk-cover { background: var(--accent); }
.essay-books article:nth-child(3) .bk-cover { background: var(--ink); color: var(--bg); }
.essay-books article:nth-child(4) .bk-cover { background: var(--graphite); color: var(--bg); }
.bk-cover b { font-size: 1.3em; font-weight: 600; line-height: 1.25; }
.bk-cover span { font-size: 0.88em; opacity: 0.88; }
.prose .essay-books p { margin: 0.65rem 0 0.25rem; }
.essay-books small { color: var(--graphite); }
.essay-refs { font-size: 0.8em; line-height: 1.7; color: var(--graphite); }
.essay-refs li { max-width: none; }
@media (max-width: 640px) {
  .essay-toc ol { columns: 1; }
  .fig-split, .fig-steps, .essay-stats { grid-template-columns: 1fr; }
  .fig-row { grid-template-columns: 4.5rem 1fr 1.2fr; gap: 0.6rem; }
  .fig-case .fig-row { grid-template-columns: 1.5rem 1fr 1fr; }
  .fig-matrix { grid-template-columns: 1fr 1fr; }
  .m-corner { display: none; }
  .m-rowh { grid-column: 1 / -1; margin-top: 0.4rem; }
  .m-col { font-size: 0.82em; }
  .essay-cards li, .prose .essay-cards li { grid-template-columns: 1.75rem 1fr; }
  .essay-cards b, .essay-cards li > span { grid-row: auto; grid-column: 2; }
  .essay-cards li::before { grid-row: span 3; }
  .essay-books { grid-template-columns: 1fr 1fr; }
}

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); font-size: 0.95rem; }
.post-nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.post-nav a:hover { color: var(--accent); }
.post-nav span { display: block; font-size: 0.8rem; color: var(--graphite); font-weight: 400; }
.post-nav .next { text-align: right; }
.origin { font-size: 0.85rem; color: var(--graphite); margin-top: 2rem; }

/* ── about / book ───────────────────────── */
.book { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr); gap: 2rem; align-items: start; }
.book img { width: 100%; border-radius: 2px; box-shadow: 0 2px 10px rgb(0 0 0 / 0.15); }
.book h3 { margin: 0 0 0.2rem; font-size: 1.5rem; }
.book .subtitle { margin: 0 0 1rem; color: var(--graphite); }
.book .lead { font-family: var(--serif); font-size: 1.15rem; margin: 0 0 1rem; padding-left: 1rem; border-left: 3px solid var(--accent); }
.book .about p { font-family: var(--serif); margin: 0 0 0.9rem; line-height: 1.85; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 0.75rem 1.25rem; margin: 1.5rem 0; padding: 1rem 0; border-block: 1px solid var(--rule); font-size: 0.85rem; }
.facts dt { color: var(--graphite); }
.facts dd { margin: 0; }
.button { display: inline-block; font-size: 0.95rem; font-weight: 500; padding: 0.6rem 1.1rem; border: 1px solid var(--ink); color: var(--ink); text-decoration: none; border-radius: 4px; }
.button:hover { background: #197a56; color: #fff; border-color: #197a56; }
@media (max-width: 600px) { .book { grid-template-columns: 1fr; } .book img { max-width: 11rem; } }

/* ── footer ─────────────────────────────── */
.colophon { margin-top: 5rem; background: var(--footer); font-size: 0.85rem; color: #cfe3d9; }
.colophon .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding-block: 1.5rem 3rem; }
.colophon p { margin: 0; }
.colophon a { color: #fff; }

/* 해시태그 */
.hashtags { display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; margin: 0.75rem 0 0; padding: 0; list-style: none; }
.hashtags a { color: var(--slate); font-size: 0.9rem; font-weight: 500; text-decoration: none; }
.hashtags a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.sidebar .hashtags { margin: 0; gap: 0.3rem 0.7rem; }
.sidebar .hashtags a { font-size: 0.88rem; }
.sidebar .hashtags .more { color: var(--graphite); font-weight: 400; }
.tagmap { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.tagmap-group { padding: 1.1rem 1.25rem; background: var(--surface); border-top: 3px solid var(--accent); }
.tagmap-group h3 { margin: 0 0 0.6rem; font-size: 0.95rem; color: var(--graphite); }
.tagmap ul { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.85rem; margin: 0; padding: 0; list-style: none; }
.tagmap a { color: var(--ink); font-weight: 600; text-decoration: none; line-height: 1.5; }
.tagmap a:hover { color: var(--slate); }
.tagmap .n { margin-left: 0.15rem; font-size: 0.7rem; font-weight: 400; color: var(--graphite); vertical-align: super; }

/* 검색 */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.search-btn { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 7.5rem; padding: 0.25rem 0.65rem; font-size: 0.85rem; font-weight: 500; color: var(--graphite) !important; text-decoration: none; border: 1px solid var(--rule); border-radius: 3px; box-shadow: none !important; }
.search-btn:hover { color: var(--slate) !important; border-color: var(--slate); }
@media (max-width: 560px) { .search-btn { min-width: 0; padding: 0.35rem 0.45rem; } .search-btn span { display: none; } }
.side-search { display: flex; border: 1px solid var(--rule); background: var(--bg); }
.side-search input { flex: 1; min-width: 0; padding: 0.6rem 0.75rem; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 0.95rem; }
.side-search input:focus { outline: none; }
.side-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.side-search button { display: flex; align-items: center; padding: 0 0.75rem; border: 0; background: var(--accent); color: #fff; cursor: pointer; }
.search-page { max-width: 52rem; margin: 0 auto; }
.search-page kbd { padding: 0 0.35em; border: 1px solid var(--rule); border-bottom-width: 2px; font-family: inherit; font-size: 0.85em; }
.search-form { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.4rem 0.4rem 0.9rem; border: 2px solid var(--accent); background: var(--bg); color: var(--slate); }
.search-form input { flex: 1; min-width: 0; padding: 0.55rem 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.15rem; }
.search-form input:focus { outline: none; }
.search-cats { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0 0.75rem; }
.search-cats button { padding: 0.2rem 0.7rem; border: 1px solid var(--rule); background: var(--bg); color: var(--graphite); font: inherit; font-size: 0.88rem; cursor: pointer; }
.search-cats button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.search-results .r { display: block; padding: 1rem 0; border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; }
.search-results .r:hover strong { color: var(--slate); text-decoration: underline; text-underline-offset: 0.2em; }
.search-results .k { display: block; font-size: 0.8rem; font-weight: 600; color: var(--slate); }
.search-results strong { display: block; margin: 0.15rem 0 0.3rem; font-size: 1.1rem; line-height: 1.45; }
.search-results .x { display: block; color: var(--graphite); font-size: 0.93rem; line-height: 1.65; }
.search-results mark { background: color-mix(in srgb, #ffd84d 55%, transparent); color: inherit; padding: 0 0.1em; }
#search-more { margin-top: 1.25rem; }

/* 메인 상단 고정 글 */
.pin-label { display: inline-flex; align-items: center; gap: 0.3rem; margin-bottom: 0.6rem; padding: 0.1rem 0.6rem; background: #fff; color: var(--hero, #03522d); font-size: 0.8rem; font-weight: 700; }
.pin-label::before { content: '📌'; font-size: 0.85em; }
.feed-head.after-pin { margin-top: 2.5rem; }

/* 좋아요 */
.side-likes li span { color: var(--accent); white-space: nowrap; }
.side-likes a { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.side-likes li { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }

/* 글 아래 키워드 */
.post-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin: 3rem 0 0; padding: 1.1rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.post-tags-label { font-size: 0.8rem; font-weight: 700; color: var(--graphite); letter-spacing: 0.04em; }
.post-tags ul { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.post-tags a { display: inline-block; padding: 0.3rem 0.8rem; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--accent) 7%, transparent); color: var(--accent); font-size: 0.92rem; font-weight: 500; text-decoration: none; }
.post-tags a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 메인 상단 추천 글 슬라이드 */
.spot { margin: 0.75rem 0 0; }
.spot-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.spot-head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--hero); letter-spacing: 0.02em; }
.spot-nav { display: flex; align-items: center; gap: 0.6rem; }
.spot-count { font-size: 0.88rem; color: var(--graphite); font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: center; }
.spot-count b { color: var(--ink); }
.spot-btn { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border: 1px solid var(--rule); border-radius: 50%; background: var(--bg); color: var(--hero); cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.spot-btn:hover { background: var(--hero); border-color: var(--hero); color: #fff; }
.spot-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.spot-track::-webkit-scrollbar { display: none; }
.spot-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.spot-slide { flex: 0 0 100%; scroll-snap-align: start; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 2rem; align-items: center; padding: 2rem; background: var(--hero); color: #fff; text-decoration: none; position: relative; box-sizing: border-box; }
.spot-thumb.spot-ph { display: flex; flex-direction: column; justify-content: flex-end; gap: 0.4rem; padding: 1.5rem; background: linear-gradient(135deg, color-mix(in srgb, var(--c, var(--accent)), #fff 22%), color-mix(in srgb, var(--c, var(--accent)), #000 18%)); }
.spot-ph span { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 700; line-height: 1.2; color: #fff; }
.spot-ph b { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.75); }
.spot-slide::before { content: ''; position: absolute; left: 2rem; top: 0; width: 2.5rem; height: 5px; background: color-mix(in srgb, var(--c, var(--accent)), #fff 35%); }
.spot-thumb { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface); }
.spot-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spot-thumb.contain img { object-fit: contain; }
.spot-thumb.spot-books { display: flex; justify-content: center; align-items: center; gap: 8%; padding: 1.1rem 0; background: #f3eedc; }
.spot-thumb.spot-books img { width: auto; height: 100%; max-width: 40%; object-fit: contain; box-shadow: 0 6px 18px rgba(0,0,0,.28); }
.spot-text h3 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); line-height: 1.4; margin: 0.4rem 0 0.7rem; color: #fff; }
.spot-text p.sub { margin: 0; font-size: 0.98rem; line-height: 1.75; color: #d3eadf; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.spot-text .kicker, .spot-text .kicker .cat { color: #d3eadf; }
.spot-text .lang-tag { color: #d3eadf; border-color: #d3eadf; }
.spot-more { display: inline-block; margin-top: 1.1rem; font-size: 0.9rem; font-weight: 600; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.5); padding-bottom: 0.1rem; }
.spot-slide:hover h3 { text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 2px; }
.spot-dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: 0.85rem; }
.spot-dots button { width: 0.6rem; height: 0.6rem; padding: 0; border: 0; border-radius: 999px; background: var(--rule); cursor: pointer; transition: width 0.2s, background 0.2s; }
.spot-dots button[aria-selected="true"] { width: 1.6rem; background: var(--accent); }
@media (max-width: 760px) {
  .spot-slide { grid-template-columns: 1fr; gap: 1.1rem; padding: 1.25rem; }
  .spot-slide::before { left: 1.25rem; }
  .spot-thumb { aspect-ratio: 16 / 9; }
}
@media (prefers-reduced-motion: reduce) { .spot-track { scroll-behavior: auto; } }

/* 사이드바 카테고리 대분류 */
.index li.grp { border-bottom: 0; margin-top: 0.35rem; }
.index li.grp:first-of-type { margin-top: 0; }
.index .grp-head { padding: 0.55rem 0 0.3rem; border-bottom: 1px solid var(--rule); font-weight: 700; font-size: 0.86rem; color: var(--hero); letter-spacing: 0.02em; }
.index .grp-head:hover .grp-name, .index .grp-head[aria-current='page'] .grp-name { text-decoration: underline; text-underline-offset: 0.2em; }
.index li.grp ul { list-style: none; margin: 0; padding: 0 0 0 0.75rem; }

.crumb { margin: 0 0 0.4rem; font-size: 0.85rem; color: var(--graphite); }
.crumb a { color: var(--accent); text-decoration: none; font-weight: 600; }
.crumb a:hover { text-decoration: underline; }
.grp-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.25rem; padding: 0; }
.grp-chips a { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.8rem; border: 1px solid var(--rule); border-left: 4px solid color-mix(in srgb, var(--c, var(--accent)), #fff var(--tint)); color: var(--ink); text-decoration: none; font-size: 0.9rem; }
.grp-chips a:hover { border-color: var(--c, var(--accent)); }
.grp-chips span { font-size: 0.8rem; color: var(--graphite); }

/* 와인 찾기 */
.wine-line { margin: 0.35rem 0 0; font-size: 0.82rem; color: var(--graphite); }
.wf { margin: 0 0 1.75rem; padding: 1.25rem 1.25rem 1rem; border: 1px solid var(--rule); border-top: 4px solid var(--c, var(--accent)); background: var(--bg); }
.wf-head { display: flex; align-items: baseline; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 0.85rem; }
.wf-head h2 { margin: 0; font-size: 1.1rem; color: var(--hero); }
.wf-count { margin: 0; font-size: 0.85rem; color: var(--graphite); }
.wf-count b { color: var(--ink); font-size: 1.05rem; }
.wf-reset { margin-left: auto; border: 0; background: none; color: var(--accent); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 0.2em; }
.wf-search { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.8rem; border: 1px solid var(--rule); margin-bottom: 0.9rem; color: var(--graphite); background: var(--surface, transparent); }
.wf-search:focus-within { border-color: var(--accent); }
.wf-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 0.95rem; }
.wf-row { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.6rem; padding: 0.55rem 0; border-top: 1px solid var(--rule); align-items: start; }
.wf-label { font-size: 0.82rem; font-weight: 700; color: var(--hero); padding-top: 0.35rem; }
.wf-br { display: none; }
.wf-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.wf-chips button { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.28rem 0.7rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--bg); color: var(--ink); font: inherit; font-size: 0.86rem; cursor: pointer; transition: background 0.12s, border-color 0.12s, color 0.12s; }
.wf-chips button small { font-size: 0.75rem; color: var(--graphite); font-variant-numeric: tabular-nums; }
.wf-chips button:hover { border-color: var(--accent); }
.wf-chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.wf-chips button[aria-pressed="true"] small { color: rgba(255,255,255,0.8); }
.wf-chips button.zero { opacity: 0.38; }
.wf-chips button.off { display: none; }
.wf-chips:not(.open) button[data-extra] { display: none; }
.wf-chips .wf-more { border-style: dashed; color: var(--accent); }
.wf-filters > summary { list-style: none; cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--accent); padding: 0.2rem 0 0.6rem; }
.wf-filters > summary::-webkit-details-marker { display: none; }
.wf-filters > summary::before { content: '▸ '; }
.wf-filters[open] > summary::before { content: '▾ '; }
.wf-empty { margin: 0.75rem 0 0; font-size: 0.9rem; color: var(--graphite); }
.cards li.card[hidden] { display: none; }
@media (max-width: 600px) {
  .wf { padding: 1rem 0.9rem 0.8rem; }
  .wf-row { grid-template-columns: 1fr; gap: 0.4rem; }
  .wf-label { padding-top: 0; }
}
