/* ==========================================================================
   Journal — UJCMS demo theme stylesheet (hand-written, no build step)
   Sections: 1 tokens · 2 base · 3 layout · 4 header · 5 hero carousel · 6 cards
   7 rows · 8 sidebar · 9 page head / chips · 10 article · 11 forms & comments
   12 guestbook · 13 pagination · 14 footer · 15 toast / to-top / lightbox
   16 motion & print
   The accent colour token is overridden from the theme setting brand.accent
   by an inline <style> in snippets/meta.html.
   ========================================================================== */

/* 1. tokens ---------------------------------------------------------------- */
:root {
  --accent: #1f4e8c;
  --paper: #ffffff;
  --surface: #f6f5f2;
  --surface-2: #ebe9e4;
  --ink: #15171a;
  --ink-2: #3d4046;
  --muted: #6b7280;
  --line: #e6e4df;
  --line-strong: #15171a;
  --footer-bg: #141517;
  --footer-ink: #d1d5db;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", "Songti SC", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius: 6px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 10px 28px -14px rgba(0, 0, 0, .2);
  --container: 1200px;
  --gutter: 20px;
  --masthead-h: 64px;
  --nav-h: 48px;
  --head-h: 43px;
  --t: 160ms ease;
}

/* 2. base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
body.is-grey { filter: grayscale(.95); }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--t); }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; text-wrap: pretty; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { display: inline-flex; width: 1em; height: 1em; flex: none; vertical-align: -.15em; }
.icon svg { width: 100%; height: 100%; display: block; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--ink); color: #fff; border-radius: var(--radius); }
.skip-link:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

/* 3. layout ---------------------------------------------------------------- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 820px; }
.page-grid { display: grid; gap: 40px; align-items: start; margin-top: 40px; }
.page-grid > .section { margin-block: 0; }
.site-main { min-height: 60vh; }
.section { margin-block: 40px; }
/* --head-h: the height of a section heading row (title line + padding + rule); the sidebar widget
   titles take the same height so both columns' rules sit on one line. */
.section__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; min-height: var(--head-h);
  padding-bottom: 10px; margin-bottom: 24px; border-bottom: 2px solid var(--line-strong);
}
.section__title { font-size: 1.625rem; }
.section__more { display: inline-flex; align-items: center; gap: 6px; font-size: .875rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.section__more:hover { color: var(--accent); }
.section__more .icon { transition: transform var(--t); }
.section__more:hover .icon { transform: translateX(3px); }
.kicker {
  display: inline-block; font-family: var(--font-body); font-size: .75rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
}
.kicker--light { color: #fff; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); padding: 3px 9px; border-radius: 3px; backdrop-filter: blur(4px); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .8125rem; color: var(--muted); }
.meta__item { display: inline-flex; align-items: center; gap: 5px; }
.meta__item .icon { opacity: .8; }
.meta a:hover { color: var(--accent); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius-lg); }
.load-more { display: flex; justify-content: center; margin-top: 24px; }
.results-count { margin-bottom: 16px; color: var(--muted); font-size: .9375rem; }
@media (min-width: 1024px) {
  .page-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; }
}

/* 4. header ----------------------------------------------------------------
   Two rows: the masthead (date · centred title · tools) scrolls away, the nav bar stays pinned.
   The pinning is a negative sticky offset equal to the masthead height (desktop only); on narrow
   screens the masthead is the only row and the nav bar becomes the slide-down menu. */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--paper); }
.masthead { border-bottom: 1px solid var(--line); }
.masthead__inner { display: flex; align-items: center; gap: 12px; min-height: var(--masthead-h); }
.masthead__date { display: none; font-size: .8125rem; color: var(--muted); letter-spacing: .02em; white-space: nowrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__logo { height: 36px; width: auto; }
.brand__mark { width: 30px; height: 30px; border-radius: 6px; }
.brand__name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.header-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-bar {
  display: none; border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  transition: box-shadow var(--t);
}
.nav-bar__inner { display: flex; align-items: center; gap: 12px; min-height: var(--nav-h); }
/* Mini brand / search icon: laid out in the outer grid columns at all times (so the centred nav never
   collides with them) but only visible once the masthead has scrolled away. */
.nav-bar__brand, .nav-bar__search {
  display: none; align-items: center; gap: 8px;
  opacity: 0; visibility: hidden; transition: opacity var(--t), visibility var(--t);
}
.nav-bar__brand { justify-self: start; max-width: 240px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; letter-spacing: -.01em; }
.nav-bar__brand img { width: 24px; height: 24px; flex: none; border-radius: 5px; }
.nav-bar__search { justify-self: end; width: 36px; height: 36px; justify-content: center; border-radius: 50%; color: var(--muted); font-size: 1.125rem; }
.nav-bar__search:hover { color: var(--ink); background: var(--surface); }
.nav { flex: 1 1 0; min-width: 0; }
.nav__list { display: flex; align-items: center; }
.nav__item { position: relative; }
.nav__link {
  display: inline-flex; align-items: center; gap: 4px; height: var(--nav-h); padding: 0 12px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; color: var(--ink-2);
  transition: color var(--t), border-color var(--t);
}
.nav__link:hover { color: var(--ink); }
.nav__link.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.nav__caret { font-size: .95em; opacity: .6; }
.nav__dropdown {
  position: absolute; top: 100%; left: 0; z-index: 60; min-width: 200px; padding: 8px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 0 0 var(--radius-lg) var(--radius-lg); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity var(--t), transform var(--t), visibility var(--t);
}
.nav__dropdown a { display: block; padding: 8px 12px; border-radius: var(--radius); font-size: .9375rem; }
.nav__dropdown a:hover { background: var(--surface); color: var(--accent); }
.nav__item.has-children:hover > .nav__dropdown,
.nav__item.has-children:focus-within > .nav__dropdown,
.nav__item.is-open > .nav__dropdown { opacity: 1; visibility: visible; transform: none; }
.nav__item--mobile-only { display: none; }
.search-form {
  display: flex; align-items: center; padding: 0 4px 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  transition: border-color var(--t), background var(--t);
}
.search-form:focus-within { border-color: var(--ink); background: #fff; }
.search-form__input { width: 150px; padding: 7px 0; border: 0; background: none; font-size: .9375rem; outline: none; }
.search-form__input::-webkit-search-decoration, .search-form__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-form__btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; color: var(--muted); }
.search-form__btn:hover { color: var(--accent); background: var(--surface-2); }
.search-form--lg { max-width: 640px; padding: 4px 4px 4px 18px; background: #fff; box-shadow: var(--shadow); }
.search-form--lg .search-form__input { flex: 1; width: auto; font-size: 1.125rem; padding: 10px 0; }
.lang-menu { position: relative; }
.lang-menu__btn {
  display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 10px; border-radius: 999px;
  font-size: .875rem; font-weight: 600; color: var(--muted); cursor: pointer; list-style: none; user-select: none;
  transition: color var(--t), background var(--t);
}
.lang-menu__btn::-webkit-details-marker { display: none; }
.lang-menu__btn:hover, .lang-menu[open] > .lang-menu__btn { color: var(--ink); background: var(--surface); }
.lang-menu__caret { font-size: .85em; opacity: .7; transition: transform var(--t); }
.lang-menu[open] .lang-menu__caret { transform: rotate(180deg); }
.lang-menu__list {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; min-width: 180px; padding: 6px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.lang-menu__list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: var(--radius); font-size: .9375rem; white-space: nowrap; }
.lang-menu__list a:hover { background: var(--surface); color: var(--accent); }
.lang-menu__list a[aria-current] { color: var(--accent); font-weight: 600; }
.nav-toggle { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: var(--radius); font-size: 1.5rem; }
.nav-toggle__close { display: none; }
.site-header.nav-open .nav-toggle__open { display: none; }
.site-header.nav-open .nav-toggle__close { display: inline-flex; }
@media (min-width: 1024px) {
  :root { --masthead-h: 96px; }
  .site-header { top: calc(-1 * var(--masthead-h) - 1px); }
  .masthead__inner { display: grid; grid-template-columns: 1fr auto 1fr; }
  .masthead__date { display: block; }
  .brand { justify-self: center; gap: 12px; }
  .brand__logo { height: 44px; }
  .brand__mark { width: 40px; height: 40px; border-radius: 8px; }
  .brand__name { font-size: 2.375rem; }
  .header-tools { justify-self: end; margin-left: 0; }
  .nav-bar { display: block; }
  .nav-bar__inner { display: grid; grid-template-columns: 1fr auto 1fr; }
  .nav { flex: none; min-width: 0; }
  .nav__list { flex-wrap: wrap; justify-content: center; }
  .nav-bar__brand, .nav-bar__search { display: inline-flex; }
  .site-header.is-scrolled .nav-bar__brand, .site-header.is-scrolled .nav-bar__search { opacity: 1; visibility: visible; }
  .site-header.is-scrolled .nav-bar { box-shadow: 0 8px 24px -16px rgba(0, 0, 0, .25); }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .nav__link { padding: 0 9px; font-size: .75rem; }
  .brand__name { font-size: 2rem; }
  .search-form__input { width: 120px; }
}
@media (max-width: 1023px) {
  .nav-toggle { display: inline-flex; }
  .site-header.nav-open .nav-bar { display: block; max-height: calc(100vh - var(--masthead-h)); overflow-y: auto; }
  .nav-bar__inner { display: block; padding: 8px 0 16px; }
  .nav__list { flex-direction: column; align-items: stretch; }
  .nav__link {
    display: flex; justify-content: space-between; height: auto; padding: 12px 8px; margin: 0;
    border-bottom: 1px solid var(--line); font-size: 1rem; font-weight: 600; letter-spacing: 0; text-transform: none;
  }
  .nav__link.is-active { border-bottom-color: var(--line); background: color-mix(in srgb, var(--accent) 7%, white); }
  .nav__dropdown { position: static; display: none; padding: 0 0 0 16px; border: 0; border-radius: 0; box-shadow: none; background: var(--surface); opacity: 1; visibility: visible; transform: none; }
  .nav__item.is-open > .nav__dropdown { display: block; }
  .nav__dropdown a { padding: 10px 8px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .nav__item--mobile-only { display: block; }
  .nav__item--mobile-only .nav__link { justify-content: flex-start; gap: 10px; }
  .search-form__input { width: 120px; }
}
@media (max-width: 639px) {
  .search-form { display: none; }
  .lang-menu__label { display: none; }
  .brand__name { font-size: 1.25rem; }
}

/* 5. hero band: carousel (2/3) + trending panel (1/3) ------------------------ */
.hero-band { display: grid; gap: 24px; margin-top: 24px; }
.hero-panel { display: flex; flex-direction: column; padding: 18px 22px 20px; background: var(--surface); border-radius: var(--radius-lg); }
.hero-panel .widget__title { margin-bottom: 4px; border-bottom-color: var(--line); }
.hero-panel .trending { flex: 1; justify-content: space-between; }
.hero-panel .trending__item { border-top-color: var(--line); }
.carousel { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--ink); }
.carousel__track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; -ms-overflow-style: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; }
.carousel__link { position: relative; display: block; aspect-ratio: 16 / 9; color: #fff; }
.carousel__link:hover { color: #fff; }
.carousel__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 700ms ease; }
.carousel__slide:hover .carousel__img { transform: scale(1.03); }
.carousel__caption {
  position: absolute; inset: auto 0 0; padding: clamp(20px, 4vw, 48px);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .55) 45%, rgba(0, 0, 0, .82) 100%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
.carousel__title { margin-top: 10px; max-width: 22ch; font-size: clamp(1.5rem, 3vw, 2.375rem); text-wrap: balance; }
.carousel__subtitle { margin-top: 10px; max-width: 60ch; font-size: clamp(.9375rem, 1.4vw, 1.125rem); opacity: .9; }
.carousel__btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 50%; background: rgba(255, 255, 255, .85); color: var(--ink); font-size: 1.5rem;
  opacity: 0; transition: opacity var(--t), background var(--t);
}
.carousel:hover .carousel__btn, .carousel__btn:focus-visible { opacity: 1; }
.carousel__btn:hover { background: #fff; color: var(--accent); }
.carousel__btn--prev { left: 16px; }
.carousel__btn--next { right: 16px; }
.carousel__dots { position: absolute; right: 20px; bottom: 20px; z-index: 2; display: flex; gap: 8px; }
.carousel__dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .45); transition: background var(--t), transform var(--t); }
.carousel__dot.is-active { background: #fff; transform: scale(1.2); }
@media (min-width: 1024px) {
  .hero-band { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 32px; align-items: stretch; }
  .carousel__link { aspect-ratio: 16 / 10; }
}
@media (max-width: 639px) {
  .hero-band { margin-top: 16px; gap: 20px; }
  .hero-panel { padding: 16px 18px; }
  .carousel__link { aspect-ratio: 4 / 3; }
  .carousel__btn { display: none; }
  .carousel__caption { padding: 16px; }
  .carousel__dots { right: 12px; bottom: 12px; }
}

/* 6. cards ----------------------------------------------------------------- */
.card-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
.card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card__media { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface-2); }
.card__img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms ease; }
.card:hover .card__img { transform: scale(1.04); }
.card__badge {
  position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, .65); color: #fff; font-size: .75rem; font-weight: 600;
}
.card__body { display: flex; flex-direction: column; gap: 6px; }
.card__title { font-size: 1.125rem; line-height: 1.3; }
.card__title a { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-decoration: underline transparent; text-underline-offset: 3px; transition: text-decoration-color var(--t), color var(--t); }
.card__title a:hover, .row__title a:hover { color: var(--ink); text-decoration-color: var(--accent); }
.row__title a { text-decoration: underline transparent; text-underline-offset: 3px; transition: text-decoration-color var(--t), color var(--t); }
.card__excerpt { color: var(--ink-2); font-size: .9375rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card--feature .card__media { aspect-ratio: 16 / 10; }
.card--feature .card__title { font-size: clamp(1.375rem, 2.2vw, 1.75rem); }
/* Compact card: thumbnail on the left, one hairline between rows — used for a module's stories 2–5. */
.card-stack { display: flex; flex-direction: column; min-width: 0; }
.card--compact { flex-direction: row; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.card-stack > .card--compact:first-child { padding-top: 0; }
.card-stack > .card--compact:last-child { border-bottom: 0; padding-bottom: 0; }
.card--compact .card__media { flex: none; width: 112px; aspect-ratio: 4 / 3; border-radius: var(--radius); }
.card--compact .card__body { gap: 4px; }
.card--compact .card__title { font-size: 1.0625rem; }
.card--compact .card__title a { -webkit-line-clamp: 2; }
.card--compact .meta { font-size: .75rem; }
@media (min-width: 640px) {
  .card-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .card-grid--module { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
}
@media (min-width: 1024px) {
  .card-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .card-grid--module { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 40px; }
}

/* 7. rows ------------------------------------------------------------------ */
.rows { display: flex; flex-direction: column; }
.row { display: flex; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.rows > .row:first-child { padding-top: 4px; }
.row__media { flex: none; width: 200px; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface-2); }
.row__img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms ease; }
.row:hover .row__img { transform: scale(1.04); }
.row__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.row__title { font-size: 1.25rem; line-height: 1.3; }
.row__excerpt { color: var(--ink-2); font-size: .9375rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row__title em, .row__title b, .row__excerpt--hit em, .row__excerpt--hit b, .row__excerpt--hit .highlight {
  font-style: normal; font-weight: inherit; padding: 0 2px; border-radius: 2px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, white);
}
@media (max-width: 639px) {
  .row { gap: 14px; padding: 16px 0; }
  .row__media { width: 108px; aspect-ratio: 1; }
  .row__title { font-size: 1.0625rem; }
  .row__excerpt { display: none; }
}

/* 8. sidebar --------------------------------------------------------------- */
.sidebar { display: flex; flex-direction: column; gap: 36px; }
.widget__title {
  display: flex; align-items: center; gap: 8px; padding-bottom: 10px; margin-bottom: 14px;
  border-bottom: 2px solid var(--line-strong);
  font-family: var(--font-body); font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.widget__title .icon { color: var(--accent); font-size: 1rem; }
.sidebar .widget__title { min-height: var(--head-h); align-items: flex-end; }
.sidebar .widget__title .icon { margin-bottom: 2px; }
/* Trending: upright tabular numerals sharing the first text line's line-height, hairlines between rows;
   the top three ranks take the accent, the rest stay muted (contrast-safe). */
.trending { display: flex; flex-direction: column; }
.trending__item { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); }
.trending__item:first-child { padding-top: 0; border-top: 0; }
.trending__rank {
  flex: none; width: 1.5rem; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700;
  line-height: 1.3125rem; font-variant-numeric: tabular-nums lining-nums; color: var(--muted);
}
.trending__item:nth-child(-n+3) .trending__rank { color: var(--accent); }
.trending__link { font-weight: 600; font-size: .9375rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: .8125rem; font-weight: 600; color: var(--ink-2);
  transition: all var(--t);
}
.tag:hover { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, white); }
.tag__count { font-size: .75rem; font-weight: 500; color: var(--muted); }
.tag-cloud--lg { gap: 10px; }
.tag--1 { font-size: .8125rem; }
.tag--2 { font-size: .9375rem; }
.tag--3 { font-size: 1.0625rem; padding: 6px 14px; }
.tag--4 { font-size: 1.25rem; padding: 8px 16px; }
.widget--subscribe { padding: 20px; background: var(--surface); border-radius: var(--radius-lg); }
.widget--subscribe .widget__title { border-bottom-color: var(--line); }
.widget--subscribe p { margin-bottom: 14px; font-size: .9375rem; color: var(--ink-2); }
@media (min-width: 1024px) {
  .sidebar { position: sticky; top: calc(var(--nav-h) + 24px); }
}

/* 9. page head / breadcrumb / chips ----------------------------------------- */
.page-head { padding: 28px 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.page-head--slim { padding: 14px 0; }
.page-head--search { padding-bottom: 36px; }
.page-head__title { margin-top: 6px; font-size: clamp(1.75rem, 4vw, 2.5rem); }
.page-head__desc { margin-top: 8px; max-width: 70ch; color: var(--ink-2); }
.page-head__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head .search-form--lg { margin-top: 20px; }
.page-head .meta { margin-top: 12px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .8125rem; color: var(--muted); }
.breadcrumb li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb li + li::before { content: "›"; opacity: .45; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chips-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.chips-stack .chips { margin-top: 0; }
.chip {
  display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; font-size: .875rem; font-weight: 600; color: var(--ink-2);
  transition: all var(--t);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* 10. article -------------------------------------------------------------- */
.article { min-width: 0; }
.article__head { padding: 0 0 20px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.article__title { margin-top: 10px; font-size: clamp(1.875rem, 4.2vw, 2.75rem); text-wrap: balance; }
.article__subtitle { margin-top: 12px; font-size: 1.125rem; line-height: 1.5; color: var(--ink-2); }
.article__meta { margin-top: 16px; font-size: .875rem; }
.article__cover { margin: 0 0 24px; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface-2); }
.article__cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article__media { margin-bottom: 24px; overflow: hidden; border-radius: var(--radius-lg); background: #000; }
.article__media video { width: 100%; display: block; }
.article__media audio { width: 100%; display: block; background: var(--surface); }
.gallery { display: grid; gap: 16px; margin-bottom: 24px; }
.gallery__item { margin: 0; }
.gallery__item img { width: 100%; border-radius: var(--radius-lg); cursor: zoom-in; }
.gallery__item figcaption { margin-top: 8px; font-size: .875rem; color: var(--muted); }
.gallery__index { font-weight: 700; color: var(--ink); }
.prose { font-size: 1.0625rem; line-height: 1.8; color: var(--ink-2); overflow-wrap: anywhere; }
.prose > * + * { margin-top: 1.1em; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin-top: 1.6em; line-height: 1.3; color: var(--ink); }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.25rem; }
.prose h4 { font-size: 1.125rem; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.prose img { max-width: 100%; height: auto; margin-inline: auto; border-radius: var(--radius-lg); cursor: zoom-in; }
.prose figure { margin: 1.5em 0; }
.prose figcaption { margin-top: 8px; font-size: .875rem; text-align: center; color: var(--muted); }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); font-family: var(--font-display); font-size: 1.2em; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .4em; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.prose th, .prose td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--surface); font-weight: 600; }
.prose pre { padding: 16px; overflow: auto; border-radius: var(--radius); background: var(--ink); color: #e5e7eb; font-size: .875rem; }
.prose code { padding: 2px 5px; border-radius: 4px; background: var(--surface); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.prose pre code { padding: 0; background: none; }
.prose hr { margin: 2em 0; border: 0; border-top: 1px solid var(--line); }
.prose iframe, .prose video { max-width: 100%; }
.article__body > p:first-of-type::first-letter {
  float: left; margin: .08em .12em 0 0; font-family: var(--font-display); font-size: 3.6em; font-weight: 700; line-height: .78; color: var(--ink);
}
.single { padding-top: 8px; }
.article__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 32px; color: var(--muted); }
.article__actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 28px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share__label { margin-right: 4px; font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.share__wrap { position: relative; }
.share__btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-size: .8125rem; font-weight: 600; white-space: nowrap; transition: all var(--t);
}
.share__btn .icon { font-size: 1rem; }
.share__btn:hover, .share__btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, white); }
.share__qr {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 40; width: 196px; padding: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); text-align: center;
}
.share__qr-code svg { display: block; width: 100%; height: auto; }
.share__qr-hint { margin-top: 10px; font-size: .75rem; line-height: 1.4; color: var(--muted); }
.votes { display: flex; gap: 8px; }
.vote-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); font-weight: 600; font-size: .9375rem; transition: all var(--t);
}
.vote-btn:hover { border-color: var(--accent); color: var(--accent); }
.vote-btn.is-done { background: var(--accent); border-color: var(--accent); color: #fff; }
.vote-btn .icon { font-size: 1.125rem; }
.attachments { margin-top: 28px; padding: 20px; background: var(--surface); border-radius: var(--radius-lg); }
.attachments__title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-family: var(--font-body); font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.attachments__list { display: flex; flex-direction: column; gap: 6px; }
.attachment { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.attachment .icon { color: var(--accent); }
.pager { display: grid; gap: 16px; margin-top: 32px; }
.pager__item { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); transition: border-color var(--t); }
.pager__item:hover { border-color: var(--accent); }
.pager__item--next { text-align: right; align-items: flex-end; }
.pager__label { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pager__title { font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem; line-height: 1.35; }
.related { margin-top: 36px; }
.related__title { padding-bottom: 10px; margin-bottom: 12px; border-bottom: 2px solid var(--line-strong); font-size: 1.375rem; }
.related__list { display: flex; flex-direction: column; }
.related__list li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.related__date { flex: none; font-size: .8125rem; font-weight: 500; color: var(--muted); }
@media (min-width: 640px) {
  .pager { grid-template-columns: 1fr 1fr; }
}

/* 11. forms & comments ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px;
  border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: .9375rem; line-height: 1.2;
  white-space: nowrap; transition: all var(--t);
}
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 85%, black); color: #fff; }
.btn--outline { border-color: var(--ink); color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: #fff; }
.btn--ghost { color: var(--muted); }
.btn--ghost:hover { color: var(--ink); background: var(--surface); }
.btn--sm { padding: 7px 14px; font-size: .875rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.input, .textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; font-size: .9375rem; transition: border-color var(--t), box-shadow var(--t);
}
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.textarea { resize: vertical; min-height: 88px; }
.input--captcha { width: 140px; }
.captcha-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.captcha-img { display: inline-flex; height: 40px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.captcha-img img { display: block; height: 100%; width: auto; min-width: 96px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field__label { font-size: .875rem; font-weight: 600; }
.req { color: var(--accent); }
.field-grid { display: grid; gap: 16px; }
.radio-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-chip { position: relative; display: inline-flex; }
.radio-chip input { position: absolute; inset: 0; margin: 0; opacity: 0; }
.radio-chip span { display: inline-flex; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: .875rem; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: all var(--t); }
.radio-chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.radio-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.comments { margin-top: 40px; }
.comments__title { padding-bottom: 10px; margin-bottom: 16px; border-bottom: 2px solid var(--line-strong); font-size: 1.375rem; }
.comments__total { font-family: var(--font-body); font-size: .9375rem; font-weight: 500; color: var(--muted); }
.comments__note { padding: 14px 16px; border-radius: var(--radius); background: var(--surface); color: var(--muted); font-size: .9375rem; }
.comment-form { display: flex; flex-direction: column; gap: 12px; padding: 16px; margin-bottom: 24px; background: var(--surface); border-radius: var(--radius-lg); }
.comment-list { display: flex; flex-direction: column; }
.comment { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment__avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; overflow: hidden;
  border-radius: 50%; background: var(--accent); color: #fff; font-family: var(--font-display); font-size: 1.125rem; font-weight: 700;
}
.comment__avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment__body { flex: 1; min-width: 0; }
.comment__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; font-size: .875rem; }
.comment__author { font-weight: 700; }
.comment__date { color: var(--muted); }
.comment__text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9375rem; color: var(--ink-2); }
.comment__images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.comment__images img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius); }
@media (min-width: 640px) {
  .field-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 12. guestbook ------------------------------------------------------------- */
.board { display: flex; flex-direction: column; margin-top: 8px; }
.board-item { padding: 20px 0; border-bottom: 1px solid var(--line); }
.board-item__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.board-item__title { font-size: 1.25rem; line-height: 1.3; }
.board-item__text { margin-top: 8px; font-size: .9375rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.board-item .meta { margin-top: 10px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .03em; }
.badge--ok { background: #dcfce7; color: #166534; }
.badge--type { background: color-mix(in srgb, var(--accent) 10%, white); color: var(--accent); }
.page-head .board-item__head { margin: 12px 0 4px; }
.board-form { display: flex; flex-direction: column; gap: 20px; margin-top: 32px; padding: 24px; background: var(--surface); border-radius: var(--radius-lg); }
.board-detail { margin-top: 32px; }
.reply { margin-top: 32px; padding: 20px 24px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; background: var(--surface); }
.reply__title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 1.125rem; }
.reply__title .icon { color: var(--accent); }
.reply .prose { margin-top: 12px; font-size: 1rem; }
.board-detail__back { margin: 32px 0 48px; }

/* 13. pagination ----------------------------------------------------------- */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 32px; }
.pagination__link {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 38px; height: 38px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line); font-size: .875rem; font-weight: 600; transition: all var(--t);
}
.pagination__link:hover { border-color: var(--accent); color: var(--accent); }
.pagination__link.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination__link.is-disabled { opacity: .4; pointer-events: none; }
.pagination__gap { padding: 0 4px; color: var(--muted); }
@media (max-width: 639px) {
  .pagination__link--nav span:not(.icon) { display: none; }
}

/* 14. footer ---------------------------------------------------------------- */
.site-footer { margin-top: 64px; background: var(--footer-bg); color: var(--footer-ink); font-size: .9375rem; }
.site-footer a:hover { color: #fff; }
.site-footer__grid { display: flex; flex-wrap: wrap; gap: 32px 40px; padding: 48px 0 32px; }
.footer-col { flex: 1 1 150px; min-width: 0; }
.footer-col--brand { flex: 2 1 260px; }
.footer-brand { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: #fff; }
.footer-brand__tagline { margin-top: 10px; max-width: 40ch; color: #9ca3af; }
.footer-brand__links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; font-size: .875rem; }
.footer-brand__links a { display: inline-flex; align-items: center; gap: 6px; }
.footer-col__title { margin-bottom: 14px; font-family: var(--font-body); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: #9ca3af; }
.footer-logos { display: flex; flex-wrap: wrap; gap: 10px; }
.footer-logos img { height: 28px; width: auto; padding: 3px; border-radius: 4px; background: #fff; }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 20px 0 28px;
  border-top: 1px solid rgba(255, 255, 255, .1); font-size: .8125rem; color: #9ca3af;
}
.site-footer__bottom a { color: #d1d5db; }

/* 15. toast / to-top / lightbox --------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 90; max-width: min(90vw, 420px); padding: 12px 18px;
  border-radius: 999px; background: var(--ink); color: #fff; font-size: .9375rem; font-weight: 500; box-shadow: var(--shadow);
  opacity: 0; transform: translate(-50%, 16px); transition: opacity var(--t), transform var(--t);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast--success { background: #166534; }
.toast--alert { background: var(--accent); }
.to-top {
  position: fixed; right: 20px; bottom: 24px; z-index: 80; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); font-size: 1.25rem;
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: all var(--t);
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--accent); border-color: var(--accent); }
.lightbox { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 0; border: 0; background: transparent; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(0, 0, 0, .88); }
.lightbox__img { width: auto; height: auto; max-width: 92vw; max-height: 88vh; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lightbox__close {
  position: fixed; top: 16px; right: 16px; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; font-size: 1.5rem;
}
.lightbox__close:hover { background: rgba(255, 255, 255, .3); }

/* 16. motion & print ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .sidebar, .share, .votes, .comments, .pager, .to-top, .load-more, .carousel__btn, .carousel__dots { display: none !important; }
  .page-grid { display: block; }
  body { color: #000; }
}
