/* ============================================================
   kobayan-architecture.com — Library Design System v2.1
   Matches existing shortcode BEM class names
   ============================================================ */

/* === CSS Variables ========================================== */
:root {
  --kb-paper:    #faf8f4;
  --kb-cream:    #f5f0e8;
  --kb-linen:    #ede8de;
  --kb-sand:     #ddd5c5;
  --kb-wood-lt:  #c8a96e;
  --kb-wood:     #a07848;
  --kb-shelf:    #8b6340;
  --kb-shelf-dk: #6b4a28;
  --kb-ink:      #3a3228;
  --kb-ink-lt:   #6b5d50;
  --kb-muted:    #9c8f82;

  --kb-serif: 'Noto Serif JP', 'Yu Mincho', 'YuMincho', Georgia, serif;
  --kb-sans:  'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;

  /* シリーズカラー */
  --kb-jisshi:      #c4784a;
  --kb-jisshi-dk:   #9a5830;
  --kb-seinou:      #4a78b4;
  --kb-seinou-dk:   #2e5890;
  --kb-lifestyle:   #6a9e72;
  --kb-lifestyle-dk:#4a7a52;
  --kb-megane:      #8a70b0;
  --kb-megane-dk:   #6a5090;
  --kb-shiso:       #6a6258;
  --kb-shiso-dk:    #4a4238;
  --kb-nihon:       #b8943c;
  --kb-nihon-dk:    #9a7420;
  --kb-coming:      #c0bab0;
}

/* === Animations ============================================= */
@keyframes kb-fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes kb-bookRise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   LIBRARY SECTION (.kb-library)
   ============================================================ */
.kb-library {
  padding: 72px 0 88px;
  background: linear-gradient(180deg, var(--kb-paper) 0%, var(--kb-cream) 40%, var(--kb-linen) 100%);
}

/* === Section Header ======================================== */
.kb-section__inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 24px 40px;
}
.kb-section__label {
  font-family: var(--kb-sans); font-size: 10px; letter-spacing: .25em;
  text-transform: uppercase; color: var(--kb-muted);
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 10px;
}
.kb-section__label::after {
  content: ''; flex: 0 0 40px; height: 1px; background: var(--kb-sand);
}
.kb-section__title {
  font-family: var(--kb-serif);
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 400; letter-spacing: .06em;
  color: var(--kb-ink); margin-bottom: 8px;
}
.kb-section__desc {
  font-size: 13px; color: var(--kb-muted);
  font-family: var(--kb-serif); line-height: 2;
}

/* ============================================================
   SHELF FRAME (.kb-shelf)
   ============================================================ */
.kb-shelf {
  max-width: 1100px; margin: 0 auto;
  background: linear-gradient(180deg, #b8894e 0%, #9a6f38 100%);
  border-radius: 6px 6px 8px 8px;
  padding: 0 28px 0;
  box-shadow: 0 8px 40px rgba(80,50,20,.22),
              inset 0 1px 0 rgba(255,220,160,.3);
  position: relative;
}
.kb-shelf__rail {
  height: 14px;
  background: linear-gradient(180deg, #c89a56 0%, #a07838 100%);
  border-radius: 6px 6px 0 0;
  margin: 0 -28px 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.kb-shelf__floor {
  margin: 20px -28px 0;
  height: 22px;
  background: linear-gradient(180deg, #7a5228 0%, #5a3a18 100%);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

/* ============================================================
   BOOKS (.kb-shelf__books / .kb-book)
   ============================================================ */
.kb-shelf__books {
  display: flex; gap: 12px; align-items: flex-end;
  justify-content: center; flex-wrap: wrap;
  padding-bottom: 4px;
}

.kb-book {
  position: relative; cursor: pointer;
  width: 68px; flex-shrink: 0;
  transition: transform .22s ease, filter .22s ease;
  outline: none;
  opacity: 0;
  animation: kb-bookRise .5s ease both;
}
.kb-book:hover,
.kb-book:focus { transform: translateY(-10px); filter: brightness(1.08); }
.kb-book:hover .kb-book__card,
.kb-book:focus .kb-book__card {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Book spine */
.kb-book__body {
  height: 160px;
  border-radius: 3px 6px 6px 3px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  padding: 14px 8px;
  writing-mode: vertical-rl; text-orientation: mixed;
  box-shadow: -3px 4px 14px rgba(0,0,0,.28),
              inset -2px 0 6px rgba(0,0,0,.12),
              inset 2px 0 4px rgba(255,255,255,.12);
  position: relative; overflow: hidden;
}
.kb-book__body::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg,
    rgba(0,0,0,.12) 0%, transparent 30%,
    rgba(255,255,255,.06) 70%, rgba(0,0,0,.08) 100%);
  pointer-events: none;
}

/* Empty/coming body variant */
.kb-book__body--empty {
  background: linear-gradient(180deg, #d0cac0 0%, #a8a098 100%) !important;
  cursor: default;
}

.kb-book__number {
  font-family: var(--kb-sans); font-size: 9px;
  letter-spacing: .1em; opacity: .7; color: rgba(255,255,255,.85);
}
.kb-book__title {
  font-family: var(--kb-serif); font-size: 11px;
  font-weight: 400; letter-spacing: .12em;
  color: rgba(255,255,255,.95);
  text-shadow: 0 1px 3px rgba(0,0,0,.3);
  writing-mode: vertical-rl;
  white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-height: 100px;
}
.kb-book__icon {
  font-size: 14px; opacity: .85;
  writing-mode: horizontal-tb;
}

/* Coming soon label */
.kb-book__coming {
  font-family: var(--kb-sans); font-size: 9px;
  letter-spacing: .08em; color: rgba(255,255,255,.6);
  writing-mode: vertical-rl; text-align: center;
}

/* Plus button in placeholder */
.kb-book__plus {
  font-size: 20px; color: rgba(255,255,255,.4);
  writing-mode: horizontal-tb;
}

/* Series-specific spine colors */
.kb-book--jisshi   .kb-book__body { background: linear-gradient(180deg, #d4886a 0%, var(--kb-jisshi-dk) 100%); }
.kb-book--seinou   .kb-book__body { background: linear-gradient(180deg, #5a88c4 0%, var(--kb-seinou-dk) 100%); }
.kb-book--lifestyle .kb-book__body { background: linear-gradient(180deg, #7aae82 0%, var(--kb-lifestyle-dk) 100%); }
.kb-book--megane   .kb-book__body { background: linear-gradient(180deg, #9a80c0 0%, var(--kb-megane-dk) 100%); }
.kb-book--shiso    .kb-book__body { background: linear-gradient(180deg, #7a7268 0%, var(--kb-shiso-dk) 100%); }
.kb-book--nihon    .kb-book__body { background: linear-gradient(180deg, #c8a44c 0%, var(--kb-nihon-dk) 100%); }
.kb-book--placeholder .kb-book__body { background: linear-gradient(180deg, #d0cac0 0%, #a8a098 100%); cursor: default; }
.kb-book--placeholder:hover { transform: none; filter: none; }

/* Divider between groups */
.kb-book--divider {
  width: 2px; height: 120px; margin: 0 4px;
  background: linear-gradient(180deg, rgba(255,255,255,.25) 0%, rgba(255,255,255,.05) 100%);
  align-self: flex-end; border-radius: 1px; flex-shrink: 0;
  cursor: default; opacity: 1; animation: none;
}
.kb-book--divider:hover { transform: none; filter: none; }

/* ============================================================
   HOVER CARD (.kb-book__card)
   ============================================================ */
.kb-book__card {
  position: absolute; bottom: calc(100% + 12px); left: 50%;
  transform: translateX(-50%) translateY(8px) scale(.96);
  width: 200px;
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.08);
  pointer-events: none; opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 20; text-align: left;
  writing-mode: horizontal-tb;
}
.kb-book__card::after {
  content: '';
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border: 6px solid transparent;
  border-top-color: #fff;
}
.kb-book__card-title {
  font-family: var(--kb-serif); font-size: 13px; font-weight: 500;
  color: var(--kb-ink); margin-bottom: 6px; line-height: 1.5;
  border: none !important; padding: 0 !important;
}
.kb-book__card-sub {
  font-family: var(--kb-sans); font-size: 11px;
  color: var(--kb-ink-lt); line-height: 1.6; margin-bottom: 10px;
}
.kb-book__card-count {
  font-family: var(--kb-sans); font-size: 10px;
  color: var(--kb-muted); margin-bottom: 10px;
  letter-spacing: .05em;
}
.kb-book__card-cta {
  display: block; text-align: center;
  padding: 7px 12px;
  font-family: var(--kb-sans); font-size: 11px;
  letter-spacing: .1em; color: #fff;
  border-radius: 3px; text-decoration: none;
  transition: opacity .2s;
}
.kb-book__card-cta:hover { opacity: .85; text-decoration: none; color: #fff; }

/* CTA colors per series */
.kb-book--jisshi    .kb-book__card-cta { background: var(--kb-jisshi); }
.kb-book--seinou    .kb-book__card-cta { background: var(--kb-seinou); }
.kb-book--lifestyle .kb-book__card-cta { background: var(--kb-lifestyle); }
.kb-book--megane    .kb-book__card-cta { background: var(--kb-megane); }
.kb-book--shiso     .kb-book__card-cta { background: var(--kb-shiso); }
.kb-book--nihon     .kb-book__card-cta { background: var(--kb-nihon); }

/* ============================================================
   SCROLL HINT (.kb-shelf__hint)
   ============================================================ */
.kb-shelf__hint {
  text-align: center;
  font-family: var(--kb-sans); font-size: 11px;
  color: var(--kb-muted); letter-spacing: .12em;
  padding: 12px 0 0;
  opacity: 0; transition: opacity .5s;
}
.kb-shelf__hint.visible { opacity: 1; }

/* ============================================================
   SERIES CARD GRID (.kb-series-grid)
   ============================================================ */
.kb-series-grid {
  max-width: 1100px; margin: 56px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.kb-series-card {
  background: #fff;
  border: 1px solid var(--kb-sand);
  border-radius: 10px;
  overflow: hidden;
  display: flex; flex-direction: column;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 2px 12px rgba(60,40,20,.06);
}
.kb-series-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(60,40,20,.12);
  text-decoration: none;
}
.kb-series-card__spine {
  height: 6px; width: 100%;
}
.kb-series-card--jisshi   .kb-series-card__spine { background: var(--kb-jisshi); }
.kb-series-card--seinou   .kb-series-card__spine { background: var(--kb-seinou); }
.kb-series-card--lifestyle .kb-series-card__spine { background: var(--kb-lifestyle); }
.kb-series-card--megane   .kb-series-card__spine { background: var(--kb-megane); }
.kb-series-card--shiso    .kb-series-card__spine { background: var(--kb-shiso); }
.kb-series-card--nihon    .kb-series-card__spine { background: var(--kb-nihon); }

.kb-series-card__body {
  padding: 20px 20px 16px; flex: 1;
}
.kb-series-card__icon {
  font-size: 24px; margin-bottom: 10px; display: block;
}
.kb-series-card__name {
  font-family: var(--kb-serif); font-size: 15px;
  font-weight: 400; color: var(--kb-ink);
  margin-bottom: 6px; line-height: 1.5;
}
.kb-series-card__tagline {
  font-family: var(--kb-sans); font-size: 11px;
  color: var(--kb-ink-lt); line-height: 1.7;
}
.kb-series-card__count {
  font-family: var(--kb-sans); font-size: 10px;
  color: var(--kb-muted); letter-spacing: .05em;
  margin-top: 8px;
}
.kb-series-card__footer {
  padding: 12px 20px;
  border-top: 1px solid var(--kb-linen);
  display: flex; align-items: center; justify-content: space-between;
}
.kb-series-card__start {
  font-family: var(--kb-sans); font-size: 11px;
  letter-spacing: .1em; color: var(--kb-wood);
}
.kb-series-card__arrow {
  font-size: 14px; color: var(--kb-sand);
  transition: transform .2s, color .2s;
}
.kb-series-card:hover .kb-series-card__arrow {
  transform: translateX(3px);
  color: var(--kb-wood);
}

/* ============================================================
   BOOK ENTRANCE ANIMATION
   ============================================================ */
.kb-shelf__books:not(.kb-animate) .kb-book {
  animation-play-state: paused;
}
.kb-shelf__books.kb-animate .kb-book {
  animation-play-state: running;
}
.kb-book:nth-child(1)  { animation-delay: .05s; }
.kb-book:nth-child(2)  { animation-delay: .10s; }
.kb-book:nth-child(3)  { animation-delay: .15s; }
.kb-book:nth-child(4)  { animation-delay: .20s; }
.kb-book:nth-child(5)  { animation-delay: .25s; }
.kb-book:nth-child(6)  { animation-delay: .30s; }
.kb-book:nth-child(7)  { animation-delay: .35s; }
.kb-book:nth-child(8)  { animation-delay: .40s; }
.kb-book:nth-child(9)  { animation-delay: .45s; }
.kb-book:nth-child(10) { animation-delay: .50s; }

/* ============================================================
   HERO (optional, for future hero shortcode)
   ============================================================ */
.kb-hero {
  min-height: 60vh; display: flex; align-items: center;
  background: linear-gradient(160deg, var(--kb-paper) 0%, var(--kb-cream) 60%, var(--kb-linen) 100%);
  position: relative; overflow: hidden;
  padding: 72px 24px 56px;
}
.kb-hero::before {
  content: ''; position: absolute; top: -80px; right: -80px;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,169,110,.12) 0%, transparent 70%);
  pointer-events: none;
}
.kb-hero-content {
  max-width: 580px; position: relative; z-index: 2;
  animation: kb-fadeInUp .8s ease both;
}
.kb-hero-eyebrow {
  font-family: var(--kb-sans); font-size: 10px; letter-spacing: .3em;
  text-transform: uppercase; color: var(--kb-muted); margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px;
}
.kb-hero-eyebrow::before {
  content: ''; width: 24px; height: 1px; background: var(--kb-wood-lt);
}
.kb-hero-title {
  font-family: var(--kb-serif); font-size: clamp(26px, 5vw, 44px);
  font-weight: 300; line-height: 1.7; letter-spacing: .06em;
  color: var(--kb-ink); margin-bottom: 24px;
}
.kb-hero-title em {
  font-style: normal; color: var(--kb-shelf);
  border-bottom: 1px solid currentColor; padding-bottom: 2px;
}
.kb-hero-sub {
  font-size: 13px; color: var(--kb-ink-lt);
  line-height: 2.2; font-family: var(--kb-serif); margin-bottom: 36px;
}
.kb-hero-cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--kb-ink); color: var(--kb-cream);
  padding: 13px 30px; font-family: var(--kb-sans);
  font-size: 12px; letter-spacing: .12em;
  text-decoration: none; border-radius: 2px;
  transition: background .25s, transform .2s;
}
.kb-hero-cta:hover {
  background: var(--kb-shelf); transform: translateY(-2px);
  color: #fff; text-decoration: none;
}

/* ============================================================
   SERIES MAP (シリーズ固定ページ用)
   ============================================================ */
.kb-roadmap {
  position: relative; padding: 32px 0;
}
.kb-roadmap::before {
  content: ''; position: absolute; left: 32px; top: 0; bottom: 0;
  width: 2px; background: var(--kb-sand);
}
.kb-roadmap-item {
  position: relative; padding: 0 0 32px 76px;
}
.kb-roadmap-dot {
  position: absolute; left: 23px; top: 4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--kb-wood-lt);
  border: 3px solid var(--kb-paper);
  box-shadow: 0 0 0 2px var(--kb-wood-lt);
}
.kb-roadmap-number {
  font-family: var(--kb-sans); font-size: 10px;
  letter-spacing: .1em; color: var(--kb-muted); margin-bottom: 4px;
}
.kb-roadmap-title {
  font-family: var(--kb-serif); font-size: 16px;
  color: var(--kb-ink); margin-bottom: 6px;
}
.kb-roadmap-desc {
  font-family: var(--kb-sans); font-size: 12px;
  color: var(--kb-ink-lt); line-height: 1.8;
}
.kb-roadmap-link {
  display: inline-block; margin-top: 8px;
  font-family: var(--kb-sans); font-size: 11px;
  color: var(--kb-wood); text-decoration: none;
  border-bottom: 1px solid var(--kb-sand); padding-bottom: 1px;
  transition: border-color .2s, color .2s;
}
.kb-roadmap-link:hover { color: var(--kb-shelf); border-color: var(--kb-wood); }

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 768px) {
  .kb-library { padding: 52px 0 64px; }
  .kb-section__inner { padding: 0 16px 28px; }

  .kb-shelf { margin: 0 16px; padding: 0 16px 0; }
  .kb-shelf__rail { margin: 0 -16px 20px; }
  .kb-shelf__floor { margin: 16px -16px 0; }

  .kb-shelf__books {
    flex-wrap: nowrap; overflow-x: auto;
    justify-content: flex-start;
    gap: 10px; padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .kb-shelf__books::-webkit-scrollbar { height: 3px; }
  .kb-shelf__books::-webkit-scrollbar-track { background: rgba(0,0,0,.1); }
  .kb-shelf__books::-webkit-scrollbar-thumb { background: rgba(255,255,255,.4); border-radius: 2px; }

  .kb-book { scroll-snap-align: start; flex-shrink: 0; width: 62px; }
  .kb-book__body { height: 140px; padding: 12px 6px; }
  .kb-book__title { font-size: 10px; }

  /* Card: fixed bottom sheet on mobile */
  .kb-book__card {
    position: fixed; bottom: 20px; left: 16px; right: 16px;
    top: auto; transform: none; width: auto;
    display: none;
  }
  .kb-book__card.active { display: block; opacity: 1; }
  .kb-book__card::after { display: none; }

  .kb-series-grid {
    grid-template-columns: 1fr; gap: 16px;
    margin-top: 40px; padding: 0 16px;
  }
  .kb-hero { padding: 52px 20px 44px; min-height: auto; }
  .kb-hero-title { font-size: clamp(22px, 7vw, 32px); }
}

@media (max-width: 480px) {
  .kb-series-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   COCOON COMPATIBILITY
   ============================================================ */
.kb-library a,
.kb-series-card { text-decoration: none; }
.kb-shelf__books { list-style: none; }


/* ============================================================
   全記事下 ミニシリーズナビ .kb-mini-library
   ============================================================ */
.kb-mini-library {
  margin: 3rem 0 1rem;
  padding: 1.5rem 1.25rem;
  background: #faf8f5;
  border-top: 3px solid #d4a574;
  border-radius: 0 0 8px 8px;
  font-family: var(--kb-font-ja, 'Noto Serif JP', Georgia, serif);
}

.kb-mini__label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #5c4a32;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.kb-mini__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.kb-mini__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.4rem 0.85rem;
  border: 1.5px solid currentColor;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  background: #fff;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}

.kb-mini__chip:hover {
  background: #fdf6ee;
  transform: translateY(-1px);
  text-decoration: none;
}

.kb-mini__all {
  display: inline-block;
  font-size: 0.8rem;
  color: #8a7560;
  text-decoration: none;
  border-bottom: 1px dashed #c4a882;
  padding-bottom: 1px;
}

.kb-mini__all:hover {
  color: #5c4a32;
}

@media (max-width: 768px) {
  .kb-mini-library {
    padding: 1.25rem 1rem;
  }
  .kb-mini__chips {
    gap: 0.4rem;
  }
  .kb-mini__chip {
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
  }
}


/* ============================================================
   「次に読む」カード .kb-next-read
   ============================================================ */
.kb-next-read {
  margin: 2.5rem 0 0;
  font-family: var(--kb-font-ja, 'Noto Serif JP', Georgia, serif);
}
.kb-next-read__label {
  font-size: 0.78rem;
  color: #9a7850;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.kb-next-read__card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #faf8f5;
  border: 2px solid var(--series-color, #d4a574);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.kb-next-read__card:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  text-decoration: none;
}
.kb-next-read__spine {
  width: 6px;
  min-height: 52px;
  border-radius: 3px;
  flex-shrink: 0;
  align-self: stretch;
}
.kb-next-read__body {
  flex: 1;
  min-width: 0;
}
.kb-next-read__series {
  font-size: 0.75rem;
  color: #9a7850;
  margin-bottom: 0.3rem;
  font-family: sans-serif;
}
.kb-next-read__title {
  font-size: 1rem;
  font-weight: 700;
  color: #3d2b1a;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.kb-next-read__arrow {
  font-size: 1.4rem;
  color: var(--series-color, #d4a574);
  flex-shrink: 0;
  transition: transform 0.15s;
}
.kb-next-read__card:hover .kb-next-read__arrow {
  transform: translateX(4px);
}

@media (max-width: 768px) {
  .kb-next-read__title { font-size: 0.92rem; }
  .kb-next-read__card  { padding: 0.85rem 1rem; gap: 0.75rem; }
}


/* ============================================================
   動的シリーズ目次 .kb-toc
   ============================================================ */
.kb-toc {
  margin: 2rem 0 2.5rem;
  font-family: var(--kb-font-ja, 'Noto Serif JP', Georgia, serif);
}
.kb-toc__header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.kb-toc__icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  color: #fff;
}
.kb-toc__series-name {
  font-size: .95rem;
  font-weight: 700;
  color: #3d2b1a;
  line-height: 1.3;
}
.kb-toc__count {
  font-size: .75rem;
  color: #9a7850;
  margin-top: .15rem;
}
.kb-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #ede5da;
  border-radius: 10px;
  overflow: hidden;
}
.kb-toc__item + .kb-toc__item {
  border-top: 1px solid #f0e8de;
}
.kb-toc__link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  text-decoration: none;
  background: #fdfaf6;
  transition: background .15s;
}
.kb-toc__link:hover {
  background: #fff8f0;
  text-decoration: none;
}
.kb-toc__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: sans-serif;
}
.kb-toc__title {
  flex: 1;
  font-size: .88rem;
  color: #3d2b1a;
  line-height: 1.45;
}
.kb-toc__arrow {
  font-size: .9rem;
  color: #c4a882;
  flex-shrink: 0;
  transition: transform .15s;
}
.kb-toc__link:hover .kb-toc__arrow {
  transform: translateX(3px);
}
.kb-toc__more {
  display: block;
  text-align: center;
  padding: .75rem;
  font-size: .82rem;
  color: #9a7850;
  background: #faf5ee;
  border: 1px solid #ede5da;
  border-top: none;
  border-radius: 0 0 10px 10px;
  text-decoration: none;
}
.kb-toc__more:hover { background: #f5ede0; }

@media (max-width: 768px) {
  .kb-toc__title  { font-size: .82rem; }
  .kb-toc__link   { padding: .65rem .85rem; }
}

/* ============================================================
   HOMEヒーローエリア .kb-hero
   ============================================================ */
.kb-hero {
  position: relative;
  margin: 0 0 3rem;
  padding: 4rem 2rem 3.5rem;
  background: #fdf8f0;
  border-radius: 16px;
  text-align: center;
  overflow: hidden;
}
.kb-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 31px,
      rgba(180,150,100,.07) 31px,
      rgba(180,150,100,.07) 32px
    );
  pointer-events: none;
}
.kb-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #d4713a 0%, #d4a574 40%, #9a7850 100%);
  border-radius: 0 0 16px 16px;
}
.kb-hero__deco {
  font-size: 2rem;
  margin-bottom: 1.25rem;
  opacity: .75;
  letter-spacing: .25em;
}
.kb-hero__heading {
  font-size: clamp(1.3rem, 4vw, 2rem);
  font-weight: 700;
  color: #2d1f0e;
  line-height: 1.5;
  margin-bottom: .75rem;
  font-family: 'Noto Serif JP', Georgia, serif;
}
.kb-hero__sub {
  font-size: .95rem;
  color: #7a5c3a;
  line-height: 1.8;
  margin-bottom: 2rem;
}
.kb-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.75rem;
  background: #3d2b1a;
  color: #fdf8f0;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: .04em;
  transition: background .2s, transform .15s;
}
.kb-hero__cta:hover {
  background: #5c4a32;
  transform: translateY(-2px);
  text-decoration: none;
  color: #fdf8f0;
}
.kb-hero__cta-arrow {
  transition: transform .15s;
}
.kb-hero__cta:hover .kb-hero__cta-arrow {
  transform: translateX(3px);
}

@media (max-width: 768px) {
  .kb-hero { padding: 2.5rem 1.25rem 2.5rem; border-radius: 12px; }
  .kb-hero__deco { font-size: 1.6rem; }
}


/* ============================================================
   サイドバー シリーズナビ .kb-sidebar-widget / .kb-sw
   ============================================================ */
.kb-sidebar-widget {
  margin-bottom: 1.5rem !important;
}
.kb-sw {
  border: 1px solid #ede5da;
  border-radius: 10px;
  overflow: hidden;
  font-family: 'Noto Serif JP', Georgia, serif;
  background: #fdfaf6;
}
.kb-sw__header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  background: #3d2b1a;
  color: #fdf8f0;
}
.kb-sw__header-icon {
  font-size: 1rem;
}
.kb-sw__header-title {
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .05em;
}
.kb-sw__list {
  display: flex;
  flex-direction: column;
}
.kb-sw__item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .9rem;
  text-decoration: none;
  border-bottom: 1px solid #f0e8de;
  transition: background .15s;
}
.kb-sw__item:last-child {
  border-bottom: none;
}
.kb-sw__item:hover {
  background: #fff8f0;
  text-decoration: none;
}
.kb-sw__spine {
  width: 4px;
  height: 2rem;
  border-radius: 2px;
  flex-shrink: 0;
}
.kb-sw__icon {
  font-size: .95rem;
  flex-shrink: 0;
}
.kb-sw__name {
  flex: 1;
  font-size: .78rem;
  color: #3d2b1a;
  line-height: 1.4;
}
.kb-sw__arrow {
  font-size: 1rem;
  color: #c4a882;
  flex-shrink: 0;
}
.kb-sw__footer {
  display: block;
  text-align: center;
  padding: .6rem;
  font-size: .75rem;
  color: #9a7850;
  background: #f5ede0;
  text-decoration: none;
  border-top: 1px solid #ede5da;
}
.kb-sw__footer:hover {
  background: #ede5da;
  color: #5c4a32;
}


/* ============================================================
   モバイル用シリーズナビ（記事内）
   PC = 非表示（サイドバーに表示）
   スマホ = 表示（サイドバー非表示のため）
   ============================================================ */
.kb-mobile-series {
  display: none;
  margin: 2rem 0 0;
}
@media (max-width: 834px) {
  .kb-mobile-series {
    display: block;
  }
  /* サイドバー内の同じウィジェットはスマホで非表示 */
  .sidebar .kb-sidebar-widget {
    display: none;
  }
}
