/* ==========================================================================
   Koyomi template: Japanese household-finance site
   Visual idea: a daily tear-off calendar (日めくり暦). Leaves of washi paper,
   big printed date numerals, with Sundays in vermilion and Saturdays in blue
   exactly as a Japanese calendar prints them. The numerals are the one loud
   element; everything around them stays quiet.
   ========================================================================== */

:root {
  --ky-washi: #e9e5da;
  --ky-sheet: #fbf9f3;
  --ky-edge: #d3cdbc;
  --ky-tint: #f1eee4;
  --ky-sumi: #23272f;
  --ky-mute: #565b64;
  --ky-ai: #27406b;
  --ky-ai-deep: #1c2f52;
  --ky-ai-soft: #c9d2e2;
  --ky-ruri: #24539a;
  --ky-shu: #bb3218;
  --ky-rule: #d8d2c2;

  --ky-mincho: 'Kaisei Tokumin', 'Hiragino Mincho ProN', 'Yu Mincho', 'YuMincho', serif;
  --ky-gothic: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;

  --ky-wrap: 1120px;
  --ky-gutter: clamp(16px, 4vw, 32px);
  --ky-pad: clamp(18px, 4vw, 44px);
}

/* ---------- base ---------- */
.ky-body {
  margin: 0;
  background: var(--ky-washi);
  color: var(--ky-sumi);
  font-family: var(--ky-gothic);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: 0.03em;
  line-break: strict;
  word-break: normal;
  overflow-wrap: break-word;
  font-synthesis: none;
  font-kerning: normal;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
.ky-body *, .ky-body *::before, .ky-body *::after { box-sizing: border-box; }
.ky-body img { max-width: 100%; height: auto; display: block; }
.ky-body em, .ky-body i:not([class*="fa-"]), .ky-body cite, .ky-body address { font-style: normal; }
:where(.ky-body) :where(h1, h2, h3, h4) {
  margin: 0;
  font-family: var(--ky-mincho);
  font-weight: 700;
  font-feature-settings: "palt";
  letter-spacing: 0.04em;
  word-break: auto-phrase;
  text-wrap: pretty;
}
:where(.ky-body) p { margin: 0; }

.ky-wrap {
  width: 100%;
  max-width: var(--ky-wrap);
  margin-inline: auto;
  padding-inline: var(--ky-gutter);
}
.ky-main { display: block; min-height: 60vh; padding-bottom: 88px; overflow-x: clip; }
.ky-body > [id^="taboola-"] {
  max-width: var(--ky-wrap);
  margin-inline: auto;
  padding-inline: var(--ky-gutter);
}

.ky-vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ky-body :focus-visible {
  outline: 3px solid var(--ky-ai);
  outline-offset: 3px;
}
.ky-head :focus-visible,
.ky-foot :focus-visible {
  outline-color: var(--ky-sheet);
}

.ky-skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--ky-sheet);
  color: var(--ky-ai);
  font-weight: 700;
}
.ky-skip:focus { top: 12px; }

/* ---------- header: the calendar's indigo backing board ---------- */
.ky-head {
  position: relative;
  z-index: 3;
  background: var(--ky-ai);
  color: var(--ky-sheet);
}
.ky-head a { color: inherit; text-decoration: none; }
.ky-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  padding-block: 22px 14px;
}
.ky-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 20px;
  min-width: 0;
}
.ky-wordmark {
  font-family: var(--ky-mincho);
  font-weight: 800;
  font-size: 34px;
  line-height: 1.3;
  letter-spacing: 0.1em;
  font-feature-settings: "palt";
  white-space: nowrap;
}
.ky-tagline {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ky-ai-soft);
}
.ky-head-side {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: none;
  font-size: 13.5px;
}
.ky-today {
  font-weight: 500;
  white-space: nowrap;
}
.ky-head-links { display: flex; gap: 18px; }
.ky-head-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--ky-ai-soft);
}
.ky-head-links a:hover { color: var(--ky-sheet); text-decoration: underline; text-underline-offset: 4px; }

.ky-tabs { background: var(--ky-ai-deep); }
.ky-tabs-list {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0 calc(var(--ky-gutter) * -1);
  padding: 0 calc(var(--ky-gutter) - 12px);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ky-tabs-list::-webkit-scrollbar { display: none; }
.ky-tabs-list li { flex: none; }
.ky-tabs-list a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 12px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ky-ai-soft);
  white-space: nowrap;
}
.ky-tabs-list a:hover { color: var(--ky-sheet); }
.ky-tabs-list a[aria-current="page"] { color: var(--ky-sheet); font-weight: 700; }
.ky-tabs-list a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  background: var(--ky-sheet);
}
.ky-tabs-list a:focus-visible { outline-offset: -3px; }

/* ---------- paper: stub, perforation, torn edge ---------- */
/* The stub still bound to the pad, above a line of perforation holes. */
.ky-stub {
  height: 20px;
  background-color: var(--ky-sheet);
  background-image: radial-gradient(circle, var(--ky-washi) 2.3px, transparent 2.8px);
  background-size: 11px 6px;
  background-position: 0 100%;
  background-repeat: repeat-x;
}

/* A leaf already torn off: half-holes bitten out of its top edge. */
.ky-leaf {
  position: relative;
  background-color: var(--ky-sheet);
  background-image: radial-gradient(circle at 50% 0, var(--ky-washi) 2.6px, transparent 3.1px);
  background-size: 11px 6px;
  background-position: 0 0;
  background-repeat: repeat-x;
  box-shadow: 0 1px 0 var(--ky-edge);
}

/* ---------- the date block ---------- */
.ky-day {
  display: grid;
  grid-template-areas: "ym" "num" "wd";
  justify-items: start;
  align-content: start;
  color: var(--ky-sumi);
}
.ky-day-ym {
  grid-area: ym;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ky-mute);
  font-feature-settings: "palt";
}
.ky-day-num {
  grid-area: num;
  font-family: var(--ky-mincho);
  font-weight: 800;
  font-size: clamp(60px, 7vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  font-variant-numeric: lining-nums;
}
.ky-day-wd {
  grid-area: wd;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.12em;
}
.ky-day--sun .ky-day-num, .ky-day--sun .ky-day-wd { color: var(--ky-shu); }
.ky-day--sat .ky-day-num, .ky-day--sat .ky-day-wd { color: var(--ky-ruri); }

/* ---------- home: lead sheet ---------- */
.ky-hero-wrap { position: relative; }
.ky-hero {
  position: relative;
  background: var(--ky-sheet);
  /* the rest of the pad, showing below today's sheet */
  box-shadow:
    0 1px 0 var(--ky-edge),
    0 5px 0 -1px var(--ky-tint),
    0 6px 0 -1px var(--ky-edge),
    0 10px 0 -2px var(--ky-tint),
    0 11px 0 -2px var(--ky-edge);
}
.ky-hero-grid {
  display: grid;
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr) minmax(0, 0.92fr);
  gap: clamp(24px, 3.4vw, 44px);
  padding: 26px var(--ky-pad) clamp(30px, 4vw, 48px);
}
.ky-hero-grid--noimg { grid-template-columns: minmax(250px, 310px) minmax(0, 1fr); }

.ky-day--hero {
  grid-template-areas: "ym ym" "num wd";
  grid-template-columns: auto 1fr;
  column-gap: 14px;
}
.ky-day--hero .ky-day-ym {
  font-size: 15px;
  letter-spacing: 0.08em;
}
.ky-day--hero .ky-day-num {
  font-size: clamp(128px, 17.5vw, 216px);
  line-height: 1;
}
.ky-day--hero .ky-day-wd {
  writing-mode: vertical-rl;
  font-family: var(--ky-mincho);
  font-size: 19px;
  letter-spacing: 0.2em;
  align-self: center;
}

.ky-hero-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding-top: 2px; }
.ky-hero-title {
  margin: 10px 0 14px;
  font-size: clamp(25px, 2.5vw, 31px);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  overflow: hidden;
}
.ky-hero-title a { color: inherit; text-decoration: none; }
.ky-hero-title a:hover { color: var(--ky-ai); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.ky-hero-dek {
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--ky-mute);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  overflow: hidden;
}
.ky-hero-text .ky-meta { margin-top: auto; padding-top: 14px; }
.ky-hero-media { display: block; min-width: 0; align-self: stretch; }
.ky-hero-media img {
  width: 100%;
  height: 100%;
  min-height: 240px;
  aspect-ratio: 5 / 4;
  object-fit: cover;
}

/* Yesterday's sheet tears away once on load. Hidden by default, so with no
   animation (or reduced motion) the page simply shows today's sheet. */
.ky-tear {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--ky-sheet);
  box-shadow: 0 1px 0 var(--ky-edge);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform-origin: 100% 0;
  animation: ky-tear 0.7s cubic-bezier(0.55, 0.05, 0.7, 0.3) 0.1s backwards;
}
.ky-tear-face { display: grid; grid-template-areas: "ym" "num"; justify-items: start; padding: 26px var(--ky-pad); color: var(--ky-sumi); }
.ky-tear-face .ky-day-ym { font-size: 15px; letter-spacing: 0.08em; }
.ky-tear-face .ky-day-num { font-size: clamp(128px, 17.5vw, 216px); line-height: 1; }
.ky-tear-face.ky-day--sun .ky-day-num { color: var(--ky-shu); }
.ky-tear-face.ky-day--sat .ky-day-num { color: var(--ky-ruri); }
@keyframes ky-tear {
  0% { opacity: 1; visibility: visible; transform: none; }
  70% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: visible; transform: translate(-3%, 70px) rotate(-7deg); }
}
@media (prefers-reduced-motion: reduce) {
  .ky-tear { animation: none; }
}

/* ---------- labels and meta ---------- */
.ky-cat {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ky-ai);
  text-decoration: none;
}
.ky-cat:hover { text-decoration: underline; text-underline-offset: 3px; }
.ky-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ky-mute);
}

/* ---------- sections ---------- */
.ky-sec { margin-top: clamp(52px, 7vw, 84px); }
.ky-sec-title {
  margin-bottom: 18px;
  font-size: 24px;
  line-height: 1.5;
  color: var(--ky-ai);
}

/* ---------- leaves of entries (home feed, category) ---------- */
.ky-leaves { display: grid; gap: 14px; }
.ky-leaves > .ky-leaf {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 0 clamp(16px, 3vw, 36px);
  padding: 24px var(--ky-pad) 12px;
}
.ky-leaves > .ky-leaf > .ky-day {
  position: sticky;
  top: 16px;
  align-self: start;
  padding-bottom: 12px;
}
.ky-entries { min-width: 0; }

.ky-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 208px;
  grid-template-rows: auto auto auto 1fr;
  grid-template-areas:
    "cat   media"
    "title media"
    "dek   media"
    "meta  media";
  column-gap: 28px;
  padding-bottom: 20px;
}
.ky-entry + .ky-entry {
  padding-top: 20px;
  border-top: 1px dotted var(--ky-edge);
}
.ky-entry--nocat {
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    "title media"
    "dek   media"
    "meta  media";
}
.ky-entry--noimg {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "cat" "title" "dek" "meta";
}
.ky-entry--nocat.ky-entry--noimg { grid-template-areas: "title" "dek" "meta"; }
.ky-entry > .ky-cat { grid-area: cat; justify-self: start; }
.ky-entry-title {
  grid-area: title;
  margin: 2px 0 8px;
  font-size: 20px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.ky-entry-title a { color: inherit; text-decoration: none; }
.ky-entry-title a:hover { color: var(--ky-ai); text-decoration: underline; text-underline-offset: 4px; }
.ky-entry-dek {
  grid-area: dek;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ky-mute);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.ky-entry > .ky-meta { grid-area: meta; align-self: end; padding-top: 6px; }
.ky-entry-media { grid-area: media; display: block; align-self: start; }
.ky-entry-media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

/* ---------- home: rows by category ---------- */
.ky-shelves { border-bottom: 1px solid var(--ky-edge); }
.ky-shelf {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 8px 36px;
  padding-block: 22px;
  border-top: 1px solid var(--ky-edge);
}
.ky-shelf-name { font-size: 19px; line-height: 1.6; color: var(--ky-sumi); }
.ky-shelf-name a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
.ky-shelf-name a:hover { color: var(--ky-ai); text-decoration: underline; text-underline-offset: 4px; }
.ky-shelf-name i { width: 1.5em; color: var(--ky-ai); font-size: 0.82em; }
.ky-shelf-hint { font-size: 13.5px; line-height: 1.75; color: var(--ky-mute); }
.ky-shelf-list { list-style: none; margin: 0; padding: 0; min-width: 0; }
.ky-shelf-list li {
  display: grid;
  grid-template-columns: 5.6em minmax(0, 1fr);
  gap: 0 8px;
  padding-block: 6px;
}
.ky-shelf-date { font-size: 13px; line-height: 1.9; color: var(--ky-mute); padding-top: 1px; }
.ky-shelf-list a {
  color: var(--ky-sumi);
  font-size: 15.5px;
  line-height: 1.75;
  text-decoration: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.ky-shelf-list a:hover { color: var(--ky-ai); text-decoration: underline; text-underline-offset: 3px; }
.ky-shelf--plain .ky-shelf-name i { width: 1.5em; }

/* ---------- category page ---------- */
.ky-cat-head {
  display: flex;
  align-items: flex-start;
  gap: clamp(14px, 2.4vw, 24px);
  padding-block: clamp(34px, 5vw, 56px) clamp(22px, 3vw, 32px);
}
.ky-cat-icon { font-size: clamp(26px, 3vw, 34px); color: var(--ky-ai); padding-top: 0.5em; flex: none; }
.ky-cat-title { font-size: clamp(32px, 4vw, 44px); line-height: 1.4; color: var(--ky-ai); }
.ky-cat-hint { margin-top: 4px; font-size: 15px; line-height: 1.8; color: var(--ky-sumi); }
.ky-cat-count { font-size: 13px; color: var(--ky-mute); }

.ky-empty { padding: 36px var(--ky-pad); }
.ky-empty p { margin-bottom: 20px; }

.ky-btn, .ky-body a.ky-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 22px;
  background: var(--ky-ai);
  color: var(--ky-sheet);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.ky-btn:hover, .ky-body a.ky-btn:hover { background: var(--ky-ai-deep); color: var(--ky-sheet); }

/* ---------- article ---------- */
.ky-post-sheet {
  background: var(--ky-sheet);
  box-shadow: 0 1px 0 var(--ky-edge);
}
.ky-post-grid {
  display: grid;
  grid-template-columns: 176px minmax(0, 700px);
  justify-content: center;
  gap: 0 clamp(24px, 4vw, 56px);
  padding: 26px var(--ky-pad) clamp(40px, 5vw, 64px);
}
.ky-post-date { min-width: 0; }
.ky-day--post {
  position: sticky;
  top: 20px;
}
.ky-day--post .ky-day-ym { font-size: 14px; letter-spacing: 0.06em; }
.ky-day--post .ky-day-num { font-size: 112px; line-height: 1.02; }
.ky-day--post .ky-day-wd { font-size: 14px; }

.ky-post-col { min-width: 0; }
.ky-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
  font-size: 13.5px;
  color: var(--ky-mute);
}
.ky-crumbs a { display: inline-flex; align-items: center; min-height: 32px; color: var(--ky-ai); font-weight: 500; text-decoration: none; }
.ky-crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ky-crumbs i { font-size: 11px; }
.ky-post-title {
  margin: 6px 0 14px;
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.5;
  color: var(--ky-sumi);
  overflow-wrap: anywhere;
}
.ky-post-meta { margin-bottom: 8px; }
.ky-post-figure { margin: 24px 0 32px; }
.ky-post-figure img { width: 100%; max-height: 460px; object-fit: cover; }

.ky-post-body { font-size: 17px; line-height: 1.95; }
.ky-post-body .content-paragraph,
.ky-post-body .intro-paragraph,
.ky-post-body p {
  margin: 0 0 1.5em;
  line-height: 1.95;
  color: var(--ky-sumi);
}
.ky-post-body .intro-paragraph,
.ky-post-body .intro-paragraph:first-child,
.ky-post-body > p:first-child {
  font-family: var(--ky-mincho);
  font-size: 18.5px;
  font-weight: 500;
  line-height: 2;
  color: var(--ky-sumi);
}
.ky-post-body .content-paragraph:first-of-type { font-size: inherit; color: var(--ky-sumi); }

.ky-post-body h2,
.ky-post-body .content-heading,
.ky-post-body .point-heading,
.ky-post-body .conclusion-heading {
  color: var(--ky-sumi);
  border: 0;
  padding: 0;
}
.ky-post-body h2,
.ky-post-body h2.content-heading {
  position: relative;
  margin: 2.5em 0 0.9em;
  padding-top: 0.8em;
  border-top: 1px solid var(--ky-rule);
  font-size: 25px;
  line-height: 1.55;
}
.ky-post-body h2::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 2.2em;
  height: 3px;
  background: var(--ky-shu);
}
.ky-post-body h3,
.ky-post-body h3.content-heading,
.ky-post-body .point-heading,
.ky-post-body .conclusion-heading {
  margin: 2em 0 0.7em;
  font-size: 20.5px;
  line-height: 1.6;
  color: var(--ky-ai);
}
.ky-post-body h4,
.ky-post-body h4.content-heading {
  margin: 1.8em 0 0.6em;
  font-size: 18px;
  line-height: 1.6;
}
.ky-post-body h2::after,
.ky-post-body h3::after,
.ky-post-body .point-heading::after,
.ky-post-body .conclusion-heading::after { content: none; }

.ky-post-body ul,
.ky-post-body ol,
.ky-post-body .content-list,
.ky-post-body .content-numbered-list {
  margin: 0 0 1.7em;
  padding-left: 1.5em;
}
.ky-post-body ul,
.ky-post-body .content-list { list-style-type: "・"; }
.ky-post-body ol,
.ky-post-body .content-numbered-list { list-style-type: decimal; }
.ky-post-body li { margin-bottom: 0.5em; line-height: 1.85; padding-left: 0.1em; }
.ky-post-body li::before { content: none; }
.ky-post-body li::marker { color: var(--ky-ai); font-weight: 700; }

.ky-post-body a {
  color: var(--ky-ai);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}
.ky-post-body a:hover { color: var(--ky-shu); text-decoration-thickness: 2px; }
.ky-post-body strong { font-weight: 700; }
.ky-post-body em {
  font-style: normal;
  text-emphasis: filled sesame;
  -webkit-text-emphasis: filled sesame;
  text-emphasis-position: over right;
  -webkit-text-emphasis-position: over right;
}

.ky-post-body blockquote,
.ky-post-body .content-quote {
  margin: 1.9em 0;
  padding: 1em 1.3em;
  background: var(--ky-tint);
  border: 0;
  border-left: 3px solid var(--ky-ai);
  border-radius: 0;
  font-size: 16px;
  font-style: normal;
  line-height: 1.9;
  color: var(--ky-sumi);
}
.ky-post-body blockquote::before,
.ky-post-body blockquote::after { content: none; }
.ky-post-body blockquote p:last-child { margin-bottom: 0; }

.ky-post-body hr { border: 0; border-top: 1px dotted var(--ky-edge); margin: 2.4em 0; }
.ky-post-body code {
  padding: 0.1em 0.35em;
  background: var(--ky-tint);
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}
.ky-post-body pre {
  margin: 0 0 1.7em;
  padding: 1em;
  overflow-x: auto;
  background: var(--ky-tint);
}
.ky-post-body pre code { padding: 0; background: none; overflow-wrap: normal; }
.ky-post-body img { margin: 1.8em 0; }
.ky-post-body .tech-term { font-weight: 500; }

/* tables (selectors include .content-table to outrank common/post.css) */
.ky-post-body .content-table-wrapper {
  margin: 1.9em 0;
  border: 1px solid var(--ky-rule);
  border-radius: 0;
  box-shadow: none;
}
.ky-post-body .content-table { background: var(--ky-sheet); font-size: 15px; line-height: 1.7; }
.ky-post-body .content-table thead th {
  background: var(--ky-ai);
  color: var(--ky-sheet);
  font-weight: 700;
  padding: 0.7em 0.9em;
}
.ky-post-body .content-table tbody td {
  padding: 0.7em 0.9em;
  border-top: 1px solid var(--ky-rule);
  color: var(--ky-sumi);
}
.ky-post-body .content-table tbody td:first-child { color: var(--ky-sumi); font-weight: 700; }
.ky-post-body .content-table tbody tr:nth-child(even) { background: var(--ky-tint); }
.ky-post-body .content-table tbody tr:hover { background: var(--ky-washi); }

/* note and sharing */
.ky-note {
  margin: 2.6em 0 0;
  padding: 18px 22px;
  background: var(--ky-tint);
  border-top: 2px solid var(--ky-ai);
}
.ky-body .ky-note-title,
.ky-page-body .ky-note-title {
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ky-ai);
}
.ky-page-body .ky-note-title::before { content: none; }
.ky-note p { margin: 0; font-size: 14.5px; line-height: 1.9; color: var(--ky-sumi); }

.ky-share { margin-top: 30px; }
.ky-share-label { display: block; margin-bottom: 8px; font-size: 13.5px; font-weight: 700; color: var(--ky-mute); }
.ky-share-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ky-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--ky-ai);
  border-radius: 0;
  color: var(--ky-ai);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
}
.ky-share-btn:hover { background: var(--ky-ai); color: var(--ky-sheet); }

/* related */
.ky-related-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ky-related-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 20px 20px 22px;
  color: var(--ky-sumi);
  text-decoration: none;
}
.ky-day--small .ky-day-num { font-size: 56px; }
.ky-related-title {
  font-family: var(--ky-mincho);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "palt";
  word-break: auto-phrase;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.ky-related-item:hover .ky-related-title { color: var(--ky-ai); text-decoration: underline; text-underline-offset: 4px; }
.ky-related-img { display: block; margin-top: auto; padding-top: 6px; }
.ky-related-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* ---------- static pages ---------- */
.ky-page { padding-top: 0; }
.ky-page-sheet { background: var(--ky-sheet); box-shadow: 0 1px 0 var(--ky-edge); }
.ky-page-in {
  max-width: 760px;
  margin-inline: auto;
  padding: clamp(24px, 4vw, 44px) var(--ky-pad) clamp(40px, 5vw, 64px);
}
.ky-page-title { font-size: clamp(28px, 3.6vw, 38px); line-height: 1.5; color: var(--ky-ai); }
.ky-dek { margin-top: 10px; font-size: 16px; color: var(--ky-mute); }
.ky-page-body { margin-top: 28px; }
.ky-page-body p { margin-bottom: 1.3em; line-height: 1.95; }
.ky-page-body h2 {
  position: relative;
  margin: 2.2em 0 0.7em;
  padding-top: 0.7em;
  border-top: 1px solid var(--ky-rule);
  font-size: 21px;
  line-height: 1.6;
}
.ky-page-body h2::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 2.2em;
  height: 3px;
  background: var(--ky-shu);
}
.ky-page-body ul { margin: 0 0 1.4em; padding-left: 1.5em; list-style-type: "・"; }
.ky-page-body li { margin-bottom: 0.55em; line-height: 1.85; }
.ky-page-body li::marker { color: var(--ky-ai); font-weight: 700; }
.ky-page-body a:not(.ky-btn) {
  color: var(--ky-ai);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}
.ky-page-body a:not(.ky-btn):hover { color: var(--ky-shu); }
.ky-page-body .ky-note { margin: 2em 0; }
.ky-page-body .ky-note p { margin: 0; line-height: 1.9; }

.ky-page-body .ky-page-cats { list-style: none; margin: 0 0 1.4em; padding: 0; }
.ky-page-cats li { margin: 0; border-bottom: 1px dotted var(--ky-edge); }
.ky-page-body .ky-page-cats a {
  display: grid;
  grid-template-columns: 1.8em minmax(0, 1fr);
  align-items: baseline;
  padding-block: 10px;
  color: var(--ky-sumi);
  text-decoration: none;
}
.ky-page-body .ky-page-cats a:hover strong { color: var(--ky-ai); text-decoration: underline; text-underline-offset: 3px; }
.ky-page-cats i { color: var(--ky-ai); font-size: 15px; }
.ky-page-cat-hint { display: block; font-size: 13.5px; line-height: 1.7; color: var(--ky-mute); }

.ky-dl { margin: 0 0 1.4em; }
.ky-dl > div {
  display: grid;
  grid-template-columns: 6.5em minmax(0, 1fr);
  gap: 0 12px;
  padding-block: 9px;
  border-top: 1px dotted var(--ky-edge);
}
.ky-dl > div:last-child { border-bottom: 1px dotted var(--ky-edge); }
.ky-dl dt { font-size: 14px; font-weight: 700; color: var(--ky-mute); line-height: 1.9; }
.ky-dl dd { margin: 0; line-height: 1.8; overflow-wrap: anywhere; }
.ky-page-body .ky-contact-mail { margin-block: 4px 8px; }

/* ---------- shared error page (views/error.ejs) ---------- */
.site-error {
  width: auto;
  max-width: 720px;
  margin: clamp(32px, 6vw, 64px) var(--ky-gutter);
  padding: 44px var(--ky-pad) 40px;
  background-color: var(--ky-sheet);
  background-image: radial-gradient(circle at 50% 0, var(--ky-washi) 2.6px, transparent 3.1px);
  background-size: 11px 6px;
  background-repeat: repeat-x;
  box-shadow: 0 1px 0 var(--ky-edge);
}
@media (min-width: 790px) {
  .site-error { margin-inline: auto; }
}
.site-error h1 { font-size: clamp(25px, 3.2vw, 32px); line-height: 1.5; color: var(--ky-ai); }
.site-error p { margin: 14px 0 26px; color: var(--ky-sumi); }
.ky-body a.site-error-btn {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 8px 24px;
  background: var(--ky-ai);
  color: var(--ky-sheet);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
}
.ky-body a.site-error-btn:hover { background: var(--ky-ai-deep); }

/* ---------- footer ---------- */
.ky-foot {
  background: var(--ky-ai-deep);
  color: var(--ky-ai-soft);
  font-size: 14px;
  line-height: 1.85;
  padding-block: 48px 28px;
}
.ky-foot a { color: var(--ky-ai-soft); text-decoration: none; }
.ky-foot a:hover { color: var(--ky-sheet); text-decoration: underline; text-underline-offset: 3px; }
.ky-foot-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 24px 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(201, 210, 226, 0.3);
}
.ky-foot-name {
  display: inline-block;
  font-family: var(--ky-mincho);
  font-weight: 800;
  font-size: 25px;
  line-height: 1.5;
  letter-spacing: 0.1em;
  font-feature-settings: "palt";
  margin-bottom: 4px;
}
.ky-foot .ky-foot-name { color: var(--ky-sheet); }
.ky-foot-social { display: flex; gap: 6px; list-style: none; margin: 10px 0 0 -12px; padding: 0; }
.ky-foot-social a {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 18px;
}
.ky-foot-cats { display: flex; flex-wrap: wrap; gap: 0 20px; align-content: start; }
.ky-foot-cats a, .ky-foot-house a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.ky-foot-note {
  margin-top: 20px;
  font-size: 13px;
  line-height: 1.9;
  max-width: 54em;
}
.ky-foot-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 28px;
  margin-top: 14px;
}
.ky-foot-house { display: flex; flex-wrap: wrap; gap: 0 20px; }
.ky-foot-legal { font-size: 12.5px; }

/* ---------- narrower screens ---------- */
@media (max-width: 1040px) {
  .ky-hero-grid { grid-template-columns: minmax(230px, 280px) minmax(0, 1fr); }
  .ky-hero-media { grid-column: 1 / -1; }
  .ky-hero-media img { aspect-ratio: 16 / 7; min-height: 0; height: auto; }
  .ky-hero-text .ky-meta { margin-top: 0; }
  .ky-shelf { grid-template-columns: 220px minmax(0, 1fr); }
  .ky-post-grid { grid-template-columns: 136px minmax(0, 1fr); }
  .ky-day--post .ky-day-num { font-size: 88px; }
}

@media (max-width: 760px) {
  .ky-body { font-size: 16.5px; }

  .ky-head-row {
    align-items: flex-start;
    padding-block: 14px 10px;
    gap: 12px;
  }
  .ky-brand { display: block; }
  .ky-wordmark { font-size: 27px; }
  .ky-tagline { font-size: 12.5px; }
  .ky-head-side { padding-top: 8px; }
  .ky-head-links { display: none; }
  .ky-today { font-size: 12.5px; text-align: right; line-height: 1.5; }
  .ky-tabs-list a { font-size: 14px; }

  .ky-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 18px; }
  .ky-day--hero .ky-day-num { font-size: 120px; }
  .ky-tear-face { padding-top: 18px; }
  .ky-tear-face .ky-day-num { font-size: 120px; }
  .ky-day--hero .ky-day-wd { font-size: 17px; }
  .ky-hero-title { font-size: 23px; line-height: 1.55; margin-top: 4px; -webkit-line-clamp: 4; line-clamp: 4; }
  .ky-hero-dek { font-size: 15px; -webkit-line-clamp: 4; line-clamp: 4; }
  .ky-hero-text .ky-meta { padding-top: 8px; }
  .ky-hero-media { order: 2; }
  .ky-hero-media img { aspect-ratio: 16 / 9; }

  /* A leaf's date runs across its top instead of down the side. */
  .ky-leaves > .ky-leaf {
    grid-template-columns: minmax(0, 1fr);
    padding: 18px 18px 6px;
  }
  .ky-leaves > .ky-leaf > .ky-day {
    position: static;
    grid-template-areas: "num ym" "num wd";
    grid-template-columns: auto 1fr;
    column-gap: 10px;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px dotted var(--ky-edge);
  }
  .ky-leaves > .ky-leaf > .ky-day .ky-day-num { font-size: 54px; line-height: 1; }
  .ky-leaves > .ky-leaf > .ky-day .ky-day-ym { align-self: end; }
  .ky-leaves > .ky-leaf > .ky-day .ky-day-wd { align-self: start; }

  .ky-entry {
    grid-template-columns: minmax(0, 1fr) 100px;
    grid-template-rows: none;
    grid-template-areas:
      "cat   cat"
      "title media"
      "dek   dek"
      "meta  meta";
    column-gap: 14px;
    padding-bottom: 14px;
  }
  .ky-entry + .ky-entry { padding-top: 14px; }
  .ky-entry > .ky-cat { min-height: 36px; padding-right: 12px; }
  .ky-entry--nocat {
    grid-template-areas:
      "title media"
      "dek   dek"
      "meta  meta";
  }
  .ky-entry--noimg { grid-template-columns: minmax(0, 1fr); grid-template-areas: "cat" "title" "dek" "meta"; }
  .ky-entry--nocat.ky-entry--noimg { grid-template-areas: "title" "dek" "meta"; }
  .ky-entry-title { font-size: 17.5px; line-height: 1.6; margin-bottom: 6px; -webkit-line-clamp: 4; line-clamp: 4; }
  .ky-entry-media img { aspect-ratio: 1 / 1; }
  .ky-entry-dek { -webkit-line-clamp: 3; line-clamp: 3; }
  .ky-entry > .ky-meta { padding-top: 2px; }

  .ky-shelf { grid-template-columns: minmax(0, 1fr); gap: 6px; padding-block: 18px; }

  .ky-post-grid { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
  .ky-day--post {
    position: static;
    grid-template-areas: "num ym" "num wd";
    grid-template-columns: auto 1fr;
    column-gap: 10px;
    align-items: center;
  }
  .ky-day--post .ky-day-num { font-size: 72px; line-height: 1; }
  .ky-day--post .ky-day-ym { align-self: end; }
  .ky-day--post .ky-day-wd { align-self: start; }
  .ky-crumbs { margin-top: 6px; }
  .ky-post-figure { margin-inline: calc(var(--ky-pad) * -1); margin-block: 18px 24px; }
  .ky-post-body { font-size: 16.5px; }
  .ky-post-body .intro-paragraph,
  .ky-post-body .intro-paragraph:first-child,
  .ky-post-body > p:first-child { font-size: 17.5px; }
  .ky-post-body h2,
  .ky-post-body h2.content-heading { font-size: 22px; }
  .ky-post-body h3,
  .ky-post-body h3.content-heading { font-size: 19px; }
  .ky-note { padding: 16px; }

  .ky-related-list { grid-template-columns: minmax(0, 1fr); }
  .ky-related-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 6px 14px;
    padding: 18px 18px 16px;
  }
  .ky-related-img { display: none; }
  .ky-day--small .ky-day-num { font-size: 44px; line-height: 1.05; }
  .ky-day--small .ky-day-ym { font-size: 11.5px; white-space: nowrap; }
  .ky-day--small .ky-day-wd { font-size: 11.5px; }

  .ky-dl > div { grid-template-columns: minmax(0, 1fr); padding-block: 8px; }

  .ky-foot-top { grid-template-columns: minmax(0, 1fr); }
  .ky-foot-bottom { display: block; }
}
