/*
Theme Name: 한국어 백과
Theme URI: http://localhost:8080
Author: Korean Teacher
Description: 한국어 학습자를 위한 백과사전 테마. 게시글은 Markdown으로 작성. 모바일·라이트·미니멀.
Version: 0.26.23
Text Domain: korean-class
Requires at least: 6.0
Requires PHP: 8.0
*/

/* ── Tokens (light UI + coral) ── */
:root {
  --yt-canvas: #f0f0f0;
  --yt-bg: #ffffff;
  --yt-surface: #f2f2f2;
  --yt-elevated: #ebebeb;
  --yt-hover: #e5e5e5;
  --yt-border: #e0e0e0;
  --yt-text: #0f0f0f;
  --yt-muted: #606060;
  --yt-dim: #909090;
  --accent: #ff6f61;
  --accent-hover: #e85a4f;
  --accent-soft: rgba(255, 111, 97, 0.12);
  --accent-10: rgba(255, 111, 97, 0.1);
  --accent-text: #d9483b;
  /* Form chips (형태) — distinct hues; 받침 O/X keep accent / muted */
  --chip-hada-bg: rgba(46, 125, 90, 0.12);
  --chip-hada-text: #2a7a58;
  --chip-ao-yes-bg: rgba(55, 110, 160, 0.12);
  --chip-ao-yes-text: #2c628c;
  --chip-ao-no-bg: rgba(55, 110, 160, 0.07);
  --chip-ao-no-text: #5a7d99;
  --chip-irreg-bg: rgba(176, 120, 48, 0.14);
  --chip-irreg-text: #8f6420;
  --header-h: 56px;
  --chip-h: 48px;
  --sidebar-w: 240px;
  --sidebar-w-mini: 72px;
  --radius: 5px;
  --max: 960px;
  --font: "Noto Sans KR", "Noto Sans SC", "Apple SD Gothic Neo", "PingFang SC", sans-serif;
  --font-thumb: "KingSejongInstitute", "Noto Sans KR", "Noto Sans SC", "Apple SD Gothic Neo", "PingFang SC", sans-serif;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --tap: 44px;
}

@font-face {
  font-family: "KingSejongInstitute";
  src: url("assets/fonts/KingSejongInstitute-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--yt-canvas);
  color: var(--yt-text);
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
ul { list-style: none; }

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

/* ── Shell ── */
.site {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.site-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.site-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 0 3rem;
  background: var(--yt-bg);
}

body.has-sidebar-drawer {
  overflow: hidden;
}

/* ── Header (top bar) ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 130;
  height: var(--header-h);
  background: var(--yt-bg);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  border-bottom-color: var(--yt-border);
}

.header-inner {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--yt-bg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.brand__mark {
  min-width: 28px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.brand__name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-btn {
  width: var(--tap);
  height: var(--tap);
  border: 0;
  background: transparent;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--yt-text);
  cursor: pointer;
  transition: background 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.header-btn:hover,
.header-btn:focus-visible {
  background: var(--yt-hover);
  outline: none;
}

.header-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Language switcher */
.lang-switch {
  position: relative;
  flex-shrink: 0;
}

.lang-switch__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--yt-border);
  border-radius: var(--radius);
  background: var(--yt-bg);
  color: var(--yt-text);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.lang-switch__btn:hover,
.lang-switch__btn:focus-visible,
.lang-switch.is-open .lang-switch__btn {
  background: var(--yt-hover);
  outline: none;
}

.lang-switch__code {
  text-transform: uppercase;
  line-height: 1;
}

.lang-switch__chev {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
  transition: transform 0.15s var(--ease);
}

.lang-switch.is-open .lang-switch__chev {
  transform: rotate(180deg);
}

.lang-switch__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100%;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--yt-bg);
  border: 1px solid var(--yt-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  z-index: 140;
}

.lang-switch__menu[hidden] {
  display: none;
}

.lang-switch__option {
  display: block;
  padding: 8px 12px;
  border-radius: calc(var(--radius) - 1px);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--yt-text);
  white-space: nowrap;
}

.lang-switch__option:hover,
.lang-switch__option:focus-visible {
  background: var(--yt-hover);
  outline: none;
}

.lang-switch__option.is-current {
  color: var(--accent);
}

.lang-switch__option.is-disabled {
  color: var(--yt-dim);
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-underline-offset: 0;
}

.lang-switch__option.is-disabled:hover,
.lang-switch__option.is-disabled:focus-visible {
  background: transparent;
}

/* Search overlay */
.search-panel {
  display: none;
  position: absolute;
  inset: 0;
  background: var(--yt-bg);
  padding: 0 12px;
  align-items: center;
  gap: 8px;
}

.search-panel.is-open { display: flex; }

.search-panel form {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--yt-surface);
  border-radius: var(--radius);
  height: 40px;
  padding: 0 14px;
}

.search-panel input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  color: var(--yt-text);
  min-width: 0;
}

.search-panel input::placeholder { color: var(--yt-dim); }

/* ── Sidebar ── */
.sidebar {
  background: var(--yt-bg);
  flex-shrink: 0;
}

.sidebar__nav {
  padding: 8px;
}

.sidebar__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--yt-text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.sidebar__link:hover,
.sidebar__link:focus-visible {
  background: var(--yt-hover);
  outline: none;
}

.sidebar__link.is-active {
  background: var(--yt-surface);
  font-weight: 600;
}

.sidebar__link--parent {
  cursor: default;
}

.sidebar__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__sublist {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 6px;
  padding-left: 12px;
}

.sidebar__link--child {
  min-height: 36px;
  font-weight: 400;
  color: var(--yt-muted);
}

.sidebar__link--child.is-active {
  color: var(--yt-text);
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 959.98px) {
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    z-index: 120;
    width: min(280px, 86vw);
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.22s var(--ease);
    box-shadow: none;
  }

  .site.is-sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.12);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 110;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s var(--ease);
  }

  .sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (min-width: 960px) {
  .sidebar {
    position: sticky;
    top: var(--header-h);
    height: calc(100dvh - var(--header-h));
    width: var(--sidebar-w);
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.2s var(--ease);
  }

  .site.is-sidebar-collapsed .sidebar {
    width: var(--sidebar-w-mini);
  }

  .site.is-sidebar-collapsed .sidebar__nav {
    padding: 8px 4px;
  }

  .site.is-sidebar-collapsed .sidebar__link {
    justify-content: center;
    min-height: 40px;
    padding: 8px 4px;
    text-align: center;
  }

  .site.is-sidebar-collapsed .sidebar__label {
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.2;
    max-width: 100%;
  }

  .site.is-sidebar-collapsed .sidebar__sublist {
    display: none;
  }

  .sidebar-backdrop {
    display: none !important;
  }
}

/* ── Feed (home list) ── */
.archive-intro {
  padding: 8px 12px 16px;
}

.archive-intro__title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.archive-intro__desc {
  margin: 8px 0 0;
  color: var(--muted, #626266);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.news-level-filter {
  margin-top: 12px;
}

.news-level-filter__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-level-filter__link {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius);
  background: var(--yt-surface);
  color: var(--yt-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  line-height: 1;
}

.news-level-filter__link:hover {
  color: var(--yt-text);
  background: var(--yt-elevated);
}

.news-level-filter__link.is-active {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.archive-intro--home {
  margin-bottom: 8px;
}

/* ── Language home shelves (YouTube-style rails) ── */
.home-shelves {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 0 0 32px;
}

.shelf__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  margin-bottom: 10px;
}

.shelf__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

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

.shelf__title a:hover { color: var(--accent-text); }

.shelf__more {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--yt-muted);
  text-decoration: none;
  white-space: nowrap;
}

.shelf__more:hover { color: var(--yt-text); }

.shelf__rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 12px;
  padding: 2px 12px 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.shelf__rail::-webkit-scrollbar { display: none; }

.shelf-card {
  flex: 0 0 auto;
  width: min(68vw, 220px);
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.shelf-card__thumb {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: var(--accent);
  display: grid;
  place-items: center;
  padding: 12px 14px;
  overflow: hidden;
}

.shelf-card--practice .shelf-card__thumb,
.shelf-card--materials .shelf-card__thumb,
.shelf-card--page .shelf-card__thumb {
  background: var(--yt-surface);
  border: 1px solid var(--yt-border);
}

.shelf-card--practice .shelf-card__topic,
.shelf-card--materials .shelf-card__topic,
.shelf-card--page .shelf-card__topic {
  color: var(--yt-text);
}

.shelf-card__thumb-stack {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 100%;
  text-align: center;
}

.shelf-card__kicker {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.25em);
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--font-thumb);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.shelf-card__topic {
  position: relative;
  color: #fff;
  font-family: var(--font-thumb);
  font-size: clamp(0.95rem, 2.8vw, 1.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* News shelf / entry-nav: level + title, bottom-left (same as news list) */
.shelf-card--news .shelf-card__thumb {
  position: relative;
  display: block;
  place-items: unset;
  padding: 0;
  background: var(--news-thumb-bg, var(--accent));
}

.shelf-card--news .shelf-card__thumb-stack {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.2em;
  max-width: 100%;
  padding: 10px 100px 10px 12px;
  text-align: left;
  box-sizing: border-box;
}

.shelf-card--news .shelf-card__kicker {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-align: left;
}

.shelf-card--news .shelf-card__topic {
  position: static;
  font-size: clamp(0.8rem, 2.4vw, 1rem);
  line-height: 1.25;
  text-align: left;
  display: block;
  overflow: hidden;
  text-overflow: clip;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.shelf-card__meta { min-width: 0; }

.shelf-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.shelf-card:active .shelf-card__thumb { filter: brightness(0.96); }

.feed {
  display: flex;
  flex-direction: column;
}

.feed-item {
  display: block;
  padding: 12px 12px 16px;
  transition: background 0.15s var(--ease);
}

.feed-item:active { background: var(--yt-elevated); }

.feed-item--practice .feed-item__thumb,
.feed-item--materials .feed-item__thumb {
  display: none;
}

/* News list: same thumb size as grammar; level + title bottom-left */
.feed-item--news .feed-item__thumb--news {
  position: relative;
  display: block;
  place-items: unset;
  padding: 0;
  background: var(--news-thumb-bg, var(--accent));
}

.feed-item--news .feed-item__thumb-stack {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.25em;
  max-width: 100%;
  padding: 16px 100px 16px 20px;
  text-align: left;
  box-sizing: border-box;
}

.feed-item--news .feed-item__thumb-kicker {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: clamp(0.7rem, 2.2vw, 0.875rem);
  letter-spacing: 0.12em;
  text-align: left;
  white-space: nowrap;
}

.feed-item--news .feed-item__thumb-title {
  position: static;
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  line-height: 1.25;
  text-align: left;
  display: block;
  overflow: hidden;
  text-overflow: clip;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.feed-item--news .news-tags--feed {
  margin-top: 6px;
}

.feed-item--materials {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feed-item--materials .feed-item__body {
  flex: 1;
  min-width: 0;
}

.feed-item__format {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--yt-muted);
}

.feed-item__format svg {
  width: 20px;
  height: 20px;
  display: block;
}

.entry--practice .entry__thumb,
.entry--materials .entry__thumb,
.entry--news .entry__thumb,
.entry--baekgwa .entry__thumb {
  display: none;
}

/* Baekgwa (Namuwiki-oriented) */
.feed-item--baekgwa .feed-item__thumb--baekgwa {
  position: relative;
  display: block;
  place-items: unset;
  padding: 0;
  background: linear-gradient(145deg, #3d5a80 0%, #2c3e50 100%);
}

.feed-item--baekgwa .feed-item__thumb-stack {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.25em;
  max-width: 100%;
  padding: 16px 20px;
  text-align: left;
  box-sizing: border-box;
}

.feed-item--baekgwa .feed-item__thumb-kicker {
  position: static;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.feed-item--baekgwa .feed-item__thumb-title {
  position: static;
  font-size: clamp(1.15rem, 3.5vw, 1.5rem);
  line-height: 1.3;
  text-align: left;
  color: #fff;
  word-break: keep-all;
}

.shelf-card--baekgwa .shelf-card__thumb {
  background: linear-gradient(145deg, #3d5a80 0%, #2c3e50 100%);
}

.entry--baekgwa .entry__content {
  font-size: 0.9375rem;
  line-height: 1.7;
}

.entry--baekgwa .entry__content h2 {
  margin-top: 1.75em;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--yt-border);
  font-size: 1.2rem;
}

.entry--baekgwa .entry__content h3 {
  margin-top: 1.35em;
  font-size: 1.05rem;
}

.entry--baekgwa .entry__content a.wiki-link {
  color: #0645ad;
  text-decoration: none;
  border-bottom: 1px solid rgba(6, 69, 173, 0.25);
}

.entry--baekgwa .entry__content a.wiki-link:hover {
  border-bottom-color: #0645ad;
}

.entry--baekgwa .entry__content a.wiki-link--missing {
  color: #ba0000;
  border-bottom-color: rgba(186, 0, 0, 0.35);
}

.entry--baekgwa .entry__content a.wiki-link--missing:hover {
  border-bottom-color: #ba0000;
}

.entry--baekgwa .entry__content .footnote-ref {
  font-size: 0.875em;
  line-height: 1;
  margin-left: 0.05em;
  color: #0645ad;
  text-decoration: none;
  border-bottom: none;
  white-space: nowrap;
}

.entry--baekgwa .entry__content .footnote-ref:hover {
  text-decoration: underline;
}

.entry--baekgwa .entry__content .footnotes {
  margin-top: 2.5em;
  padding-top: 0.5em;
  border-top: 1px solid var(--yt-border);
  font-size: 0.875rem;
  color: var(--yt-muted, #5f6368);
}

.entry--baekgwa .entry__content .footnotes__title {
  margin-top: 0;
  font-size: 1rem;
  border-bottom: none;
  padding-bottom: 0;
}

.entry--baekgwa .entry__content .footnotes__list {
  margin: 0.75em 0 0;
  padding-left: 1.35em;
}

.entry--baekgwa .entry__content .footnotes__item {
  margin: 0.4em 0;
  line-height: 1.55;
}

.entry--baekgwa .entry__content .footnotes__back {
  margin-left: 0.25em;
  color: #0645ad;
  text-decoration: none;
}

.entry--baekgwa .entry__content .footnotes__back:hover {
  text-decoration: underline;
}

.wiki-toc {
  margin: 0 0 1.5em;
  padding: 0.85em 1em 1em;
  max-width: 22rem;
  border: 1px solid var(--yt-border);
  border-radius: var(--radius);
  background: var(--yt-surface);
  font-size: 0.875rem;
}

.wiki-toc__title {
  margin-bottom: 0.5em;
  font-weight: 700;
  text-align: center;
}

.wiki-toc__list {
  margin: 0;
  padding-left: 1.25em;
}

.wiki-toc__list .wiki-toc__list {
  margin-top: 0.25em;
}

.wiki-toc__item {
  margin: 0.2em 0;
}

.wiki-toc a {
  color: var(--yt-text);
  text-decoration: none;
}

.wiki-toc a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* News public tags (list + single) */
.news-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-tags--feed {
  margin-top: 8px;
}

.news-tags__item {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius);
  background: var(--yt-surface);
  color: var(--yt-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}

.news-tags__item--level {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.entry__meta .news-tags {
  margin-right: 4px;
}

.entry__news-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 2em;
  padding-top: 1em;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--yt-dim);
  line-height: 1.5;
  position: relative;
}

.entry__news-note::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 10%;
  border-top: 1px solid var(--yt-border);
}

.entry__news-note-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 0.15em;
  color: var(--yt-dim);
}

.feed-item__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--accent);
  margin-bottom: 10px;
  display: grid;
  place-items: center;
  padding: 16px 20px;
  text-decoration: none;
}

.feed-item__thumb-stack {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 100%;
  text-align: center;
}

.feed-item__thumb-kicker {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.35em);
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--font-thumb);
  font-size: clamp(0.7rem, 2.2vw, 0.875rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.feed-item__thumb-title {
  position: relative;
  color: #fff;
  font-family: var(--font-thumb);
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
  text-align: center;
  max-width: 100%;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.feed-item__body {
  display: block;
  min-width: 0;
}

.feed-item__meta { min-width: 0; }

.feed-item__title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-item__sub {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--yt-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.feed-item__sub span:not(:last-child)::after {
  content: "·";
  margin-left: 6px;
  color: var(--yt-dim);
}

/* ── Empty / states ── */
.state {
  padding: 4rem 1.5rem;
  text-align: center;
}

.state h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.state p {
  color: var(--yt-muted);
  font-size: 0.875rem;
  max-width: 28ch;
  margin: 0 auto;
}

/* ── Pagination ── */
.pagination {
  padding: 1.5rem 12px 0;
}

.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.pagination a,
.pagination span {
  min-width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--yt-surface);
}

.pagination .current {
  background: var(--yt-text);
  color: var(--yt-bg);
}

.pagination a:hover { background: var(--yt-hover); }

/* ── Single post ── */
.entry {
  padding: 16px 16px 0;
}

.entry__badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

.entry__title {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.entry__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: 0.75rem;
  color: var(--yt-muted);
  margin-bottom: 20px;
}

.entry__meta > span:not(:last-of-type)::after {
  content: "·";
  margin-left: 6px;
  color: var(--yt-dim);
}

.entry__header {
  position: relative;
}

.entry__actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  margin-top: -6px;
  margin-bottom: -6px;
}

.entry__meta .entry__actions::after,
.entry__meta .print-btn::after {
  content: none;
}

.entry__meta a.print-btn {
  text-decoration: none;
  color: inherit;
}

.print-btn.is-busy {
  opacity: 0.45;
  pointer-events: none;
}

.print-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  flex-shrink: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--yt-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.print-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.print-btn:hover,
.print-btn:focus-visible {
  color: var(--yt-text);
  background: var(--yt-hover);
  outline: none;
}

.print-btn:active {
  background: var(--yt-elevated);
}

.copy-url-btn {
  position: relative;
}

.copy-url-btn .copy-url-btn__icon--check,
.copy-url-btn.is-copied .copy-url-btn__icon--link {
  display: none;
}

.copy-url-btn__check-path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
}

.copy-url-btn.is-copied .copy-url-btn__icon--check {
  display: block;
  color: var(--ok, #2e7d4f);
}

.copy-url-btn.is-copied .copy-url-btn__check-path {
  animation: copy-check-draw 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.copy-url-btn.is-copied {
  color: var(--ok, #2e7d4f);
}

@keyframes copy-check-draw {
  to { stroke-dashoffset: 0; }
}

.print-qrcode {
  display: none;
}

.print-qrcode__mark {
  display: block;
  margin-top: 4px;
  color: #000;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.entry__thumb {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--accent);
  margin-bottom: 20px;
  display: grid;
  place-items: center;
  padding: 24px 28px;
}

.entry__thumb-stack {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 100%;
  text-align: center;
}

.entry__thumb-kicker {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.4em);
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--font-thumb);
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.entry__thumb-title {
  position: relative;
  color: #fff;
  font-family: var(--font-thumb);
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
  text-align: center;
  max-width: 100%;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.entry__content {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--yt-text);
}

.entry__content > * + * { margin-top: 1em; }

.entry__content h2,
.entry__content h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 1.5em;
}

.entry__content h2 { font-size: 1.25rem; }
.entry__content h3 { font-size: 1.0625rem; }

.entry__content a { color: var(--accent-hover); }
.entry__content a:hover { text-decoration: underline; }

/* Side-by-side comparison (은/는 | 이/가) — soft, parallel panels */
.entry__content .compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 0.75em;
}

.entry__content .compare.compare--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.entry__content .compare__col {
  min-width: 0;
  padding: 14px 14px 16px;
  background: var(--accent-10);
  border-radius: var(--radius);
}

.entry__content .compare__title {
  margin: 0 0 0.65em;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-text);
  word-break: keep-all;
}

.entry__content .compare__list {
  margin: 0;
  padding-left: 1.15em;
  list-style: decimal;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--yt-text);
  word-break: keep-all;
}

.entry__content .compare__list > li + li {
  margin-top: 0.4em;
}

@media (max-width: 720px) {
  .entry__content .compare.compare--3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .entry__content .compare {
    grid-template-columns: 1fr;
  }
}

.entry__content ul,
.entry__content ol {
  padding-left: 1.25em;
  list-style: revert;
}

/* 예문 — each sentence as its own block (no list markers) */
.entry__content ol.examples {
  list-style: none;
  padding: 0;
  margin-top: 1.25em;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entry__content ol.examples > li {
  display: block;
  padding: 14px 16px;
  background: var(--yt-surface);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  font-size: 1.0625rem;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.entry__content ol.examples > li.examples__pair {
  display: flex;
  flex-direction: column;
  gap: 0.45em;
}

.entry__content ol.examples > li::marker {
  content: none;
}

.entry__content ol.examples strong {
  color: var(--accent-text);
  font-weight: 700;
}

.entry__content ol.examples .examples__gloss {
  display: block;
  margin-top: 0.35em;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--yt-muted);
  word-break: keep-all;
}

.entry__content ol.examples .examples__gloss strong {
  color: inherit;
  font-weight: 600;
}

/* Dialogue pair (가 / 나) — always two stacked rows */
.entry__content ol.examples .examples__turn {
  display: block;
  word-break: keep-all;
}

.entry__content ol.examples .examples__turn strong {
  color: var(--accent-text);
  font-weight: 700;
}

/* Footnote marker in examples / body */
.entry__content .fn-ref {
  display: inline;
  margin-left: 0.1em;
  font-size: 0.7em;
  font-weight: 700;
  line-height: 1;
  vertical-align: super;
  color: var(--accent-text);
  text-decoration: none;
}

.entry__content .fn-ref:hover {
  text-decoration: underline;
}

/* Footnote block (separate section, no heading) */
.entry__content .fn-note {
  margin-top: 1.75em;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--accent-10);
  color: var(--yt-text);
  font-size: 0.9375rem;
  line-height: 1.65;
  word-break: keep-all;
}

.entry__content .fn-note p {
  margin: 0;
}

.entry__content .fn-note__mark {
  font-weight: 700;
  color: var(--accent-text);
  margin-right: 0.25em;
}

.entry__content blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 14px;
  color: var(--yt-muted);
}

.entry__content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
  background: var(--yt-surface);
  padding: 0.1em 0.35em;
  border-radius: var(--radius);
}

.entry__content pre {
  background: var(--yt-surface);
  padding: 14px;
  border-radius: var(--radius);
  overflow-x: auto;
}

.entry__content img {
  border-radius: var(--radius);
  margin: 1.25em 0;
}

.entry__content .table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5em 0;
}

.entry__content .table-scroll > table {
  margin: 0;
}

/* Chips stacked in the leftmost form-condition cell */
.entry__content table .form-cell__sep {
  color: var(--yt-dim);
  font-weight: 500;
  margin: 0 0.15em;
}

.entry__content table .form-cell__plain {
  font-weight: 600;
  color: var(--yt-muted);
  white-space: nowrap;
}

.entry__content table th:first-child,
.entry__content table td:first-child {
  white-space: nowrap;
}

.entry__content table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.45;
}

/* Number cards (고유어/한자어 수사) — digit↔hangul gap +50%, hangul stays centered */
.entry__content .korean-numbers-root .number-digit {
  transform: translateY(-2.325em); /* was -1.55em */
}

/* Hangul jamo cards — keep gap + wrapping on narrow screens */
.entry__content .hangul-component-root .grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
}

@media (max-width: 600px) {
  .entry__content .hangul-component-root .grid-container {
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 12px;
  }
}

/* Hangul combination table — isolate from encyclopedia table chrome */
.entry__content .hangul-component-root .syllable-table {
  width: 100% !important;
  min-width: 100% !important;
  table-layout: fixed;
  border-collapse: separate !important;
  border-spacing: 6px;
  font-size: inherit;
  line-height: normal;
}

.entry__content .hangul-component-root .syllable-table th,
.entry__content .hangul-component-root .syllable-table td {
  border: 1px solid #000 !important;
  border-radius: 5px;
  background-color: #fff;
  color: #000 !important;
  white-space: nowrap;
  text-align: center !important;
  vertical-align: top;
  width: auto;
  max-width: 0; /* equal cols under table-layout:fixed */
  position: relative;
  height: 0 !important;
  padding: 0 !important;
  font-size: 0 !important; /* label carries real type size */
  line-height: 0 !important;
  font-weight: 500;
  overflow: hidden;
  box-sizing: border-box;
}

/* Square cells via width-relative padding (works in print too) */
.entry__content .hangul-component-root .syllable-table th::before,
.entry__content .hangul-component-root .syllable-table td::before {
  content: "";
  display: block;
  padding-top: 100%;
}

.entry__content .hangul-component-root .syllable-table .cell-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1;
  color: inherit;
  pointer-events: none;
}

.entry__content .hangul-component-root .syllable-table th {
  background-color: #f2f2f2 !important;
  font-weight: 700 !important;
}

.entry__content .hangul-component-root .syllable-table th .cell-label {
  font-size: 1.25rem;
  font-weight: 700;
}

.entry__content .hangul-component-root .syllable-table th:empty {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: default;
}

.entry__content .hangul-component-root .syllable-table th:first-child,
.entry__content .hangul-component-root .syllable-table td:first-child {
  text-align: center !important;
  width: auto;
}

.entry__content .hangul-component-root .syllable-wrapper {
  margin: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 720px) {
  .entry__content .hangul-component-root .syllable-table {
    border-spacing: 3px;
  }

  .entry__content .hangul-component-root .syllable-table th,
  .entry__content .hangul-component-root .syllable-table td {
    border-radius: 4px;
  }

  .entry__content .hangul-component-root .syllable-table .cell-label {
    font-size: 0.8125rem;
  }

  .entry__content .hangul-component-root .syllable-table th .cell-label {
    font-size: 0.875rem;
  }
}

@media (max-width: 420px) {
  .entry__content .hangul-component-root .syllable-table {
    border-spacing: 2px;
  }

  .entry__content .hangul-component-root .syllable-table th,
  .entry__content .hangul-component-root .syllable-table td {
    border-radius: 3px;
  }

  .entry__content .hangul-component-root .syllable-table .cell-label {
    font-size: 0.6875rem;
  }

  .entry__content .hangul-component-root .syllable-table th .cell-label {
    font-size: 0.75rem;
  }
}

.entry__content th,
.entry__content td {
  padding: 14px 10px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid var(--yt-border);
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--yt-text);
  background: transparent;
  white-space: nowrap;
}

.entry__content th:first-child,
.entry__content td:first-child {
  text-align: left;
  padding-left: 2px;
  width: 1%;
}

.entry__content tr:last-child th,
.entry__content tr:last-child td {
  border-bottom: 0;
}

.entry__content table strong {
  color: var(--accent-text);
  font-weight: 700;
}

/* 받침 O/X — single chip, equal mark width */
.batchim {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 1.625rem;
  padding: 0 6px 0 8px;
  border-radius: var(--radius);
  white-space: nowrap;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  vertical-align: middle;
}

.batchim--yes {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.batchim--no {
  background: var(--yt-elevated);
  color: var(--yt-muted);
}

/* ㄹ·ㅂ·ㅅ·ㄷ·ㅎ·르 불규칙 — one shared amber */
.batchim--irreg {
  background: var(--chip-irreg-bg);
  color: var(--chip-irreg-text);
}

.batchim__mark {
  display: inline-grid;
  place-items: center;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: var(--radius);
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.7);
  color: inherit;
}

/* ㅏ/ㅗ · 하다 — same chip language as 받침 */
.vowel {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 1.625rem;
  padding: 0 6px 0 8px;
  border-radius: var(--radius);
  white-space: nowrap;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  vertical-align: middle;
}

.vowel--yes {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.vowel--no {
  background: var(--yt-elevated);
  color: var(--yt-muted);
}

.vowel--hada {
  background: var(--chip-hada-bg);
  color: var(--chip-hada-text);
}

.vowel--ao.vowel--yes {
  background: var(--chip-ao-yes-bg);
  color: var(--chip-ao-yes-text);
}

.vowel--ao.vowel--no {
  background: var(--chip-ao-no-bg);
  color: var(--chip-ao-no-text);
}

.vowel__mark {
  display: inline-grid;
  place-items: center;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: var(--radius);
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.7);
  color: inherit;
}

.form-subhead__plain {
  font-weight: 600;
  color: var(--yt-muted);
}

.entry__content blockquote p {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--yt-text);
  line-height: 1.7;
}

.entry-nav {
  margin-top: 32px;
  margin-left: -16px;
  margin-right: -16px;
}

.entry-nav__rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 16px;
  padding: 2px 16px 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.entry-nav__rail .shelf-card {
  width: min(58vw, 180px);
}

.entry-nav__rail .shelf-card__title {
  -webkit-line-clamp: 2;
}

/* ── Page ── */
.page-wrap {
  padding: 20px 16px 0;
}

.page-wrap:has(.chis-app) {
  padding-top: 12px;
}

.page-wrap:has(.chis-app) .entry__content > * + * {
  margin-top: 0;
}

.page-wrap h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

/* ── About (kw.ne.kr–inspired rows) ── */
.page-wrap--about {
  padding-bottom: 48px;
}

.about {
  max-width: 40rem;
}

.about__hero {
  margin: 0 0 1.5rem;
  padding: 1.75rem 0 0;
}

.about__mark {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 0 1.1rem;
  object-fit: contain;
}

.about__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.about__title {
  margin: 0;
  font-family: var(--font-thumb);
  font-size: clamp(1.65rem, 4.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--yt-text);
}

.about__intro {
  margin: 0 0 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--yt-border);
}

.about__intro p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--yt-text);
  word-break: keep-all;
}

.about__intro p + p {
  margin-top: 0.85rem;
}

.about__section + .about__section {
  margin-top: 2rem;
}

.about__heading {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--yt-text);
}

.about__rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.about__row {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1rem 1.25rem;
  align-items: start;
}

.about__year {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.45;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}

.about__year--label {
  font-weight: 600;
  color: var(--yt-dim);
}

.about__detail {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.about__place {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.4;
  color: var(--yt-text);
  word-break: keep-all;
}

.about__role {
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--yt-muted);
}

.about__link {
  color: var(--accent-hover);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  word-break: break-all;
}

.about__link:hover,
.about__link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.about__sns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
}

@media (min-width: 640px) {
  .about__hero {
    padding-top: 2rem;
  }

  .about__mark {
    width: 5.25rem;
    height: 5.25rem;
  }

  .about__row {
    grid-template-columns: 4.5rem 1fr;
    gap: 1rem 1.75rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .about__hero,
  .about__intro,
  .about__section {
    animation: rise 0.4s var(--ease) both;
  }

  .about__intro { animation-delay: 0.04s; }
  .about__section:nth-of-type(1) { animation-delay: 0.08s; }
  .about__section:nth-of-type(2) { animation-delay: 0.12s; }
  .about__section:nth-of-type(3) { animation-delay: 0.16s; }
}

/* ── Apps (OKSAN download) ── */
.page-wrap--apps {
  max-width: none;
  padding: 0 0 56px;
}

.apps {
  margin: 0;
}

.apps__stage {
  /* Match App Store shot canvas (#F2F1F6 → #E3E6ED), not site charcoal. */
  --apps-shot-bg: #f2f1f6;
  position: relative;
  overflow: hidden;
  margin: 0 0 2rem;
  padding: 2rem 1rem 0;
  background: linear-gradient(180deg, var(--apps-shot-bg) 0%, #e8e9ef 72%, #e3e6ed 100%);
  color: var(--yt-text);
}

.apps__stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 56px;
  background: linear-gradient(180deg, transparent, var(--yt-canvas));
  pointer-events: none;
}

.apps__stage-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1.75rem;
  max-width: 960px;
  margin: 0 auto;
  align-items: end;
}

.apps__intro {
  text-align: center;
  padding-bottom: 0.25rem;
}

.apps__brand {
  margin: 0 0 0.45rem;
  font-family: var(--font-thumb);
  font-size: clamp(2rem, 7vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--accent-text);
}

.apps__title {
  margin: 0 0 0.65rem;
  font-family: var(--font);
  font-size: clamp(1.2rem, 3.6vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--yt-text);
  word-break: keep-all;
}

.apps__lead {
  margin: 0 auto 1.35rem;
  max-width: 28rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--yt-muted);
  word-break: keep-all;
}

.apps__cta {
  display: grid;
  gap: 0.65rem;
  max-width: 22rem;
  margin: 0 auto;
}

.apps__store-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid rgba(15, 15, 15, 0.08);
  box-shadow: 0 1px 2px rgba(15, 15, 15, 0.04);
  color: var(--yt-text);
  text-decoration: none;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.apps__store-btn:hover,
.apps__store-btn:focus-visible {
  background: #fff;
  border-color: rgba(15, 15, 15, 0.16);
  box-shadow: 0 4px 14px rgba(15, 15, 15, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.apps__store-btn-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
}

.apps__store-btn-icon svg {
  display: block;
}

.apps__store-btn-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  text-align: left;
}

.apps__store-btn-kicker {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--yt-dim);
}

.apps__store-btn-label {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.apps__hero-shot {
  margin: 0;
  display: flex;
  justify-content: center;
  padding: 0 0.5rem;
}

.apps__hero-img {
  display: block;
  width: min(100%, 280px);
  height: auto;
  /* Soften phone only; shot canvas already matches stage. */
  filter: drop-shadow(0 18px 28px rgba(20, 24, 40, 0.12));
}

.apps__gallery {
  max-width: 960px;
  margin: 0 auto 2rem;
  padding: 0 0 0.25rem;
}

.apps__gallery-head {
  padding: 0 1rem 0.75rem;
}

.apps__gallery-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--yt-dim);
}

.apps__rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 1rem 12px;
  scrollbar-width: thin;
}

.apps__shot {
  flex: 0 0 auto;
  width: min(52vw, 200px);
  margin: 0;
  scroll-snap-align: start;
  border-radius: 10px;
  overflow: hidden;
  background: #f2f1f6;
}

.apps__shot img {
  display: block;
  width: 100%;
  height: auto;
}

.apps__download {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.apps__download-title {
  margin: 0 0 0.85rem;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--yt-text);
}

.apps__download-grid {
  display: grid;
  gap: 0.75rem;
}

.apps__dl {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--yt-surface);
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--yt-text);
  text-align: left;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease);
}

.apps__dl:hover,
.apps__dl:focus-visible {
  background: var(--yt-hover);
  outline: none;
  transform: translateY(-1px);
}

.apps__dl-badge {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.apps__dl-badge svg {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.apps__dl-body {
  flex: 1;
  min-width: 0;
}

.apps__dl-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--yt-text);
  word-break: keep-all;
}

.apps__dl-hint {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--yt-muted);
  word-break: keep-all;
}

@media (min-width: 720px) {
  .apps__stage {
    padding: 2.75rem 1.5rem 0;
  }

  .apps__stage-inner {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    align-items: center;
    gap: 2rem;
    padding-bottom: 0.5rem;
  }

  .apps__intro {
    text-align: left;
    padding: 0 0 2.5rem;
  }

  .apps__lead {
    margin-left: 0;
    margin-right: 0;
  }

  .apps__cta {
    margin-left: 0;
    max-width: 20rem;
  }

  .apps__hero-shot {
    justify-content: flex-end;
    align-self: end;
  }

  .apps__hero-img {
    width: min(100%, 320px);
  }

  .apps__gallery-head,
  .apps__rail {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .apps__shot {
    width: 220px;
  }

  .apps__download {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .apps__download-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 960px) {
  .page-wrap--apps {
    /* Cancel default page horizontal padding so the stage can edge-to-edge. */
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .apps__intro {
    animation: rise 0.45s var(--ease) both;
  }

  .apps__hero-shot {
    animation: apps-float-in 0.55s var(--ease) both;
    animation-delay: 0.08s;
  }

  .apps__gallery {
    animation: rise 0.4s var(--ease) both;
    animation-delay: 0.12s;
  }

  .apps__download {
    animation: rise 0.4s var(--ease) both;
    animation-delay: 0.18s;
  }

  .apps__hero-img {
    animation: apps-bob 5.5s var(--ease) infinite;
    animation-delay: 0.7s;
  }

  @keyframes apps-float-in {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  @keyframes apps-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .apps__hero-img {
    animation: none !important;
  }
}

/* ── Footer ── */
.site-footer {
  padding: 24px 16px 32px;
  text-align: center;
}

.site-footer p {
  font-size: 0.75rem;
  color: var(--yt-dim);
}

.site-footer a { color: var(--yt-muted); }
.site-footer a:hover { color: var(--yt-text); }

/* ── Desktop refinements ── */
@media (min-width: 640px) {
  .header-inner { padding-left: 24px; padding-right: 24px; }

  .feed-item {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 14px;
    padding: 12px 24px;
    align-items: start;
  }

  .feed-item--materials {
    display: flex;
    align-items: center;
    padding: 12px 24px;
  }

  .feed-item__thumb {
    margin-bottom: 0;
    border-radius: var(--radius);
  }

  .feed-item__title { font-size: 1.0625rem; }

  .entry,
  .page-wrap { padding-left: 24px; padding-right: 24px; }

  .page-wrap.page-wrap--apps {
    padding-left: 0;
    padding-right: 0;
  }

  .entry__title { font-size: 1.75rem; }

  .home-shelves { gap: 36px; }
  .shelf__head { padding: 0 24px; }
  .shelf__rail { padding-left: 24px; padding-right: 24px; scroll-padding-inline: 24px; gap: 14px; }
  .shelf-card { width: 240px; }
}

@media (min-width: 960px) {
  .feed-item:hover { background: var(--yt-elevated); }
  .feed-item {
    grid-template-columns: 360px 1fr;
  }
  .feed-item--practice {
    grid-template-columns: 1fr;
  }

  .feed-item--materials {
    display: flex;
  }
}

/* ── Motion ── */
@media (prefers-reduced-motion: no-preference) {
  .feed-item {
    animation: rise 0.35s var(--ease) both;
  }

  .feed-item:nth-child(1) { animation-delay: 0.02s; }
  .feed-item:nth-child(2) { animation-delay: 0.06s; }
  .feed-item:nth-child(3) { animation-delay: 0.1s; }
  .feed-item:nth-child(4) { animation-delay: 0.14s; }
  .feed-item:nth-child(5) { animation-delay: 0.18s; }

  @keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .brand__mark {
    transition: transform 0.2s var(--ease);
  }

  .brand:active .brand__mark {
    transform: scale(0.92);
  }
}

/* ── Language gate (`/`) ── */
body.is-lang-gate {
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255, 111, 97, 0.16), transparent 60%),
    radial-gradient(800px 500px at 100% 100%, rgba(15, 15, 15, 0.04), transparent 55%),
    linear-gradient(180deg, #f7f5f3 0%, #f0f0f0 45%, #ebe8e4 100%);
  min-height: 100dvh;
}

body.is-lang-gate .site,
body.is-lang-gate .site-header,
body.is-lang-gate .site-shell,
body.is-lang-gate .site-footer {
  display: none;
}

.lang-gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

.lang-gate__inner {
  width: min(100%, 22rem);
  text-align: center;
}

.lang-gate__mark {
  display: block;
  width: 14rem;
  height: 14rem;
  margin: 0 auto 1.75rem;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.lang-gate__mark-img {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  object-fit: contain;
}

.lang-gate__brand {
  margin: 0 0 2.25rem;
  font-family: var(--font-thumb);
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--yt-text);
}

.lang-gate__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lang-gate__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--yt-bg);
  color: var(--yt-text);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 8px 24px rgba(15, 15, 15, 0.06);
  transition:
    transform 0.2s var(--ease),
    background 0.2s var(--ease),
    color 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.lang-gate__btn:hover,
.lang-gate__btn:focus-visible {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 10px 28px rgba(255, 111, 97, 0.28);
  outline: none;
  transform: translateY(-1px);
}

.lang-gate__btn:active {
  transform: translateY(0) scale(0.98);
}

@media (prefers-reduced-motion: no-preference) {
  .lang-gate__brand {
    animation: lang-gate-in 0.55s var(--ease) both;
  }

  .lang-gate__btn:nth-child(1) {
    animation: lang-gate-in 0.55s var(--ease) 0.08s both;
  }

  .lang-gate__btn:nth-child(2) {
    animation: lang-gate-in 0.55s var(--ease) 0.16s both;
  }

  .lang-gate__btn:nth-child(3) {
    animation: lang-gate-in 0.55s var(--ease) 0.24s both;
  }

  .lang-gate__btn:nth-child(4) {
    animation: lang-gate-in 0.55s var(--ease) 0.32s both;
  }

  @keyframes lang-gate-in {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ── PDF export clone (html2pdf onclone) ── */
html.is-pdf-export .entry__actions,
html.is-pdf-export .entry-nav,
html.is-pdf-export .entry__thumb {
  display: none !important;
}

html.is-pdf-export .print-qrcode {
  display: block !important;
  position: absolute;
  top: 0;
  right: 0;
  text-align: center;
}

html.is-pdf-export .entry__header {
  position: relative;
  padding-right: 80px;
  margin-bottom: 8px;
}

html.is-pdf-export .entry__content .korean-numbers-root .numbers-grid {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 12px;
}

html.is-pdf-export .entry__content .korean-numbers-root .number-card {
  break-inside: avoid;
  box-shadow: none !important;
  aspect-ratio: 5 / 4;
  width: 100%;
  height: auto;
  min-height: 0;
  box-sizing: border-box;
}

html.is-pdf-export .entry__content .korean-numbers-root .number-digit {
  transform: translateY(-2.1em);
}

/* ── Print (자료 · 강좌 posts) ── */
@media print {
  @page {
    margin: 10mm;
  }

  .site-header,
  .sidebar,
  .sidebar-backdrop,
  .site-footer,
  .entry-nav,
  .entry__thumb,
  .print-btn,
  .entry__actions,
  .lang-switch {
    display: none !important;
  }

  body,
  .site,
  .site-shell,
  .site-column,
  .site-main {
    background: #fff !important;
    color: #000 !important;
  }

  .site-shell {
    display: block;
  }

  .site-main {
    padding: 0;
    max-width: none;
  }

  .entry,
  .entry--materials {
    padding: 0;
  }

  .entry__header {
    padding-right: 80px;
    margin-bottom: 8px;
  }

  .entry__title {
    font-size: 1.5rem !important;
    margin-bottom: 0.2rem !important;
  }

  .entry__meta {
    margin-bottom: 0;
  }

  .print-qrcode {
    display: block !important;
    position: absolute;
    top: 0;
    right: 0;
    text-align: center;
  }

  .print-qrcode img {
    display: block;
    width: 52px;
    height: 52px;
    margin: 0 auto;
  }

  .print-qrcode__mark {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .entry__content .korean-numbers-root .number-card {
    break-inside: avoid;
    box-shadow: none !important;
    aspect-ratio: 5 / 4;
    width: 100%;
    height: auto;
    min-height: 0;
    box-sizing: border-box;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .entry__content .korean-numbers-root .number-digit {
    transform: translateY(-2.1em); /* was -1.4em */
  }

  .entry__content .hangul-component-root .hangul-card {
    break-inside: avoid;
    box-shadow: none !important;
    aspect-ratio: 5 / 4;
    width: 100%;
    height: auto !important;
    min-height: 0;
    box-sizing: border-box;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Hangul combination tables — keep screen card-cell design */
  .entry__content .hangul-component-root {
    margin: 0 0 1rem !important;
    break-before: auto;
    page-break-before: auto;
    break-inside: auto;
  }

  /* Keep each chart on its own page; first chart must not spill */
  .entry__content .hangul-component-root:first-of-type {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .entry__content .hangul-component-root + .hangul-component-root {
    break-before: page !important;
    page-break-before: always !important;
  }

  .entry__content .hangul-component-root .section-title {
    margin: 0 0 0.4rem !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #000 !important;
  }

  .entry__content .hangul-component-root .syllable-wrapper {
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .entry__content .hangul-component-root .syllable-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 3px !important;
  }

  /*
   * 자음+기본모음: 15 square rows overflow a full-width print page.
   * Slightly narrower table → smaller squares → fits page 1 with header.
   */
  .entry__content .hangul-component-root:first-of-type .syllable-table {
    width: 88% !important;
    max-width: 88% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .entry__content .hangul-component-root .syllable-table thead {
    display: table-header-group;
  }

  .entry__content .hangul-component-root .syllable-table th,
  .entry__content .hangul-component-root .syllable-table td {
    border: 1px solid #000 !important;
    border-radius: 5px !important;
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
    position: relative !important;
    height: 0 !important;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    font-weight: 500 !important;
    max-width: 0 !important;
    width: auto !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-align: center !important;
    vertical-align: top !important;
    cursor: default !important;
    box-sizing: border-box !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .entry__content .hangul-component-root .syllable-table th::before,
  .entry__content .hangul-component-root .syllable-table td::before {
    content: "" !important;
    display: block !important;
    padding-top: 100% !important;
  }

  .entry__content .hangul-component-root .syllable-table .cell-label {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    color: #000 !important;
  }

  .entry__content .hangul-component-root .syllable-table th {
    background: #f2f2f2 !important;
    font-weight: 700 !important;
  }

  .entry__content .hangul-component-root .syllable-table th .cell-label {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
  }

  .entry__content .hangul-component-root .syllable-table th:empty {
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .entry__content .hangul-component-root .syllable-table th:first-child,
  .entry__content .hangul-component-root .syllable-table td:first-child {
    text-align: center !important;
  }

  .entry__content .hangul-component-root .syllable-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
