/*
 * F-003 base.css — minimal reset + typography baseline.
 *
 * Scope:
 *  - root font-size clamp (320px = 15px baseline, wide >= 18px).
 *  - body typography defaults via --tk-* tokens.
 *  - accessible focus state, link contrast, and 44x44 tap-target minimum
 *    (WCAG 2.2 AA 2.5.5).
 *
 * Non-goals:
 *  - Visual layout of the header/footer/cards (handled in F-004 onward).
 *  - Component-level styling (handled per-feature).
 */

html {
    /*
     * Mobile-first base: 15px at 320px viewport grows fluidly up to 18px at wide screens.
     * This addresses the F-001 evaluator note about 12.82px body text on small screens.
     */
    font-size: clamp(15px, 3.75vw, 18px);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--tk-font-sans);
    font-size: var(--tk-fs-base);
    line-height: var(--tk-lh-relaxed);
    letter-spacing: var(--tk-ls-normal);
    color: var(--tk-color-ink);
    background-color: var(--tk-color-bg);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--tk-font-heading);
    font-weight: var(--tk-fw-bold);
    line-height: var(--tk-lh-snug);
    letter-spacing: var(--tk-ls-tight);
    color: var(--tk-color-ink);
}

p {
    margin-block: 0 var(--tk-space-4);
}

a {
    color: var(--tk-color-link);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--tk-dur-fast) var(--tk-ease);
}

a:hover,
a:focus-visible {
    color: var(--tk-color-primary-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--tk-color-primary);
    outline-offset: 2px;
}

/*
 * Tap-target minimum 44x44 (WCAG 2.2 AA 2.5.5).
 * Applied only to interactive elements rendered by core block editor and
 * Arkhe's header navigation / search. Additional components may opt in later.
 */
button,
.wp-block-button__link,
.c-gnavBtn,
.c-searchBtn {
    min-width: 44px;
    min-height: 44px;
}

/*
 * Utility: visually-hidden content for accessibility labels.
 * Do NOT abuse this for SEO keyword stuffing — NG-12 / NG-13 forbid it.
 * This class is for screen-reader-only labels (e.g. "検索", "閉じる") and is
 * whitelisted by the AC-13 hidden-text scan.
 */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* ---------------------------------------------------------------------
 * F-004 AC-14 — prefers-reduced-motion guard (F-003 carryover).
 * When the user requests reduced motion, kill all transitions, animations,
 * and smooth-scroll across the site. !important is deliberate: it must
 * override component-level transitions without per-component opt-in.
 * ------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.001ms !important;
        transition-delay: 0ms !important;
        animation-duration: 0.001ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}

/* ---------------------------------------------------------------------
 * F-004 AC-15 — `palt` proportional-alternate metrics for JP body text
 * (F-003 carryover). `palt` tightens the gaps around half-width and
 * punctuation glyphs so Japanese prose sits naturally. We opt out on
 * any element that shows numeric or monospace UI where tight glyph
 * metrics degrade readability (code, kbd, form controls, copyright line).
 * ------------------------------------------------------------------- */
body {
    font-feature-settings: 'palt' 1;
}

pre,
code,
kbd,
samp,
input,
textarea,
select,
.c-copyright,
.c-verifiedBadge__date {
    font-feature-settings: normal;
}

/* F-011 v2: CF7 a11y tap targets (per Design Evaluator authorization) */
/* F-011 v2 / F-003.1 — CF7 form controls a11y (tap-target + iOS zoom + CTA weight).
   Authorized by Design Evaluator 2026-04-22; see output/designs/tokens.json revisions[0]. */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="url"],
.wpcf7-form input[type="number"],
.wpcf7-form input[type="search"],
.wpcf7-form select,
.wpcf7-form textarea {
  min-height: 44px;
  padding: var(--tk-space-3) var(--tk-space-3);
  border: 1px solid var(--tk-color-border);
  border-radius: var(--tk-radius-md);
  background-color: var(--tk-color-bg);
  color: var(--tk-color-ink);
  font: inherit;
  line-height: var(--tk-lh-normal);
  box-sizing: border-box;
  transition: border-color var(--tk-dur-fast) var(--tk-ease), box-shadow var(--tk-dur-fast) var(--tk-ease);
}
.wpcf7-form textarea {
  min-height: calc(var(--tk-space-12) * 4); /* 192px */
  line-height: var(--tk-lh-relaxed);
}
.wpcf7-form input[type="text"]:focus-visible,
.wpcf7-form input[type="email"]:focus-visible,
.wpcf7-form input[type="tel"]:focus-visible,
.wpcf7-form input[type="url"]:focus-visible,
.wpcf7-form input[type="number"]:focus-visible,
.wpcf7-form input[type="search"]:focus-visible,
.wpcf7-form select:focus-visible,
.wpcf7-form textarea:focus-visible {
  outline: 2px solid var(--tk-color-link);
  outline-offset: 2px;
  border-color: var(--tk-color-link);
}
.wpcf7-form input[type="checkbox"],
.wpcf7-form input[type="radio"] {
  width: 20px;
  height: 20px;
  margin-inline-end: var(--tk-space-2);
  accent-color: var(--tk-color-primary);
  vertical-align: middle;
}
.wpcf7-form .wpcf7-acceptance label,
.wpcf7-form .wpcf7-list-item label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-block: var(--tk-space-2);
  cursor: pointer;
}
.wpcf7-form input[type="submit"],
.wpcf7-submit {
  min-height: 44px;
  padding: var(--tk-space-3) var(--tk-space-6);
  background-color: var(--tk-color-primary);
  color: var(--tk-color-bg);
  border: 0;
  border-radius: var(--tk-radius-md);
  font-weight: var(--tk-fw-bold);
  cursor: pointer;
  transition: background-color var(--tk-dur-fast) var(--tk-ease);
}
.wpcf7-form input[type="submit"]:hover,
.wpcf7-form input[type="submit"]:focus-visible,
.wpcf7-submit:hover,
.wpcf7-submit:focus-visible {
  background-color: var(--tk-color-primary-hover);
}
.wpcf7-form input[type="submit"]:focus-visible,
.wpcf7-submit:focus-visible {
  outline: 2px solid var(--tk-color-ink);
  outline-offset: 2px;
}
@media (max-width: 767px) {
  .wpcf7-form input[type="text"],
  .wpcf7-form input[type="email"],
  .wpcf7-form input[type="tel"],
  .wpcf7-form input[type="url"],
  .wpcf7-form input[type="number"],
  .wpcf7-form input[type="search"],
  .wpcf7-form select,
  .wpcf7-form textarea {
    font-size: 16px; /* iOS Safari auto-zoom guard */
  }
}
@media (prefers-reduced-motion: reduce) {
  .wpcf7-form input,
  .wpcf7-form select,
  .wpcf7-form textarea,
  .wpcf7-submit {
    transition: none;
  }
}

/* F-012 iter3 LP CTA scope (Design Evaluator authorized: DB-1 radius, DB-2 hover/focus).
   Scoped to body Gutenberg CTAs only — header .c-lineCta and .wpcf7-submit untouched.
   iter3 specificity note: Arkhe parent uses .wp-block-button.wp-block-button .wp-block-button__link:hover
   (specificity 0,4,0) for its opacity:.75 hover. To beat that on hover *and* to ensure our
   base-state rules are robust against future parent-theme changes, we mirror the doubled-class
   pattern and prepend our .l-article / .entry-content scope — giving us (0,5,0) > (0,4,0). */
.l-article .wp-block-button.wp-block-button .wp-block-button__link,
.entry-content .wp-block-button.wp-block-button .wp-block-button__link {
  border-radius: var(--tk-radius-md);          /* DB-1: tokens.json default_button */
  font-weight: var(--tk-fw-bold);              /* trust-critical CTA weight */
  transition: background-color var(--tk-dur-fast) var(--tk-ease);
}
.l-article .wp-block-button.wp-block-button .wp-block-button__link:hover,
.entry-content .wp-block-button.wp-block-button .wp-block-button__link:hover {
  opacity: 1;                                  /* kill Arkhe opacity:0.75 fade */
  background-color: var(--tk-color-accent-hover);  /* DB-2: cta_primary_line.hover_bg */
  color: var(--tk-color-ink);
}
.l-article .wp-block-button.wp-block-button .wp-block-button__link:focus-visible,
.entry-content .wp-block-button.wp-block-button .wp-block-button__link:focus-visible {
  outline: 2px solid var(--tk-color-link);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .l-article .wp-block-button.wp-block-button .wp-block-button__link,
  .entry-content .wp-block-button.wp-block-button .wp-block-button__link { transition: none; }
}
/* end F-012 iter3 LP CTA scope */
/* F-012 iter2 marker retained for evaluator grep compatibility: F-012 iter2 LP CTA scope */

/* F-019: 404 / search / archive */
.c-f019-shell {
  padding-top: var(--tk-space-8);
  padding-bottom: var(--tk-space-12);
}

.c-f019-layout {
  display: grid;
  gap: var(--tk-space-8);
}

.c-f019-main {
  min-width: 0;
}

.c-f019-hero {
  margin-bottom: var(--tk-space-8);
}

.c-f019-eyebrow {
  margin: 0 0 var(--tk-space-2);
  font-size: var(--tk-fs-sm);
  font-weight: var(--tk-fw-bold);
  letter-spacing: var(--tk-ls-wide);
  text-transform: uppercase;
  color: var(--tk-color-primary);
}

.c-f019-title {
  margin: 0 0 var(--tk-space-4);
  font-size: var(--tk-fs-2xl);
  line-height: 1.4;
}

.c-f019-lead {
  margin: 0;
  color: var(--tk-color-ink-muted);
}

.c-f019-panel {
  margin-bottom: var(--tk-space-6);
  padding: var(--tk-space-6);
  background: var(--tk-color-bg-subtle);
  border: 1px solid var(--tk-color-border);
  border-radius: var(--tk-radius-lg);
}

.c-f019-section-title {
  margin: 0 0 var(--tk-space-4);
  font-size: var(--tk-fs-lg);
  line-height: 1.4;
}

.c-f019-search-form form,
.c-f019-search-form .searchform {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tk-space-3);
}

.c-f019-search-form input[type="search"],
.c-f019-search-form input[type="text"] {
  flex: 1 1 240px;
  min-height: 44px;
  padding: var(--tk-space-3) var(--tk-space-4);
  border: 1px solid var(--tk-color-border);
  border-radius: var(--tk-radius-md);
  background: var(--tk-color-bg);
  color: var(--tk-color-ink);
}

.c-f019-search-form button,
.c-f019-search-form input[type="submit"] {
  min-height: 44px;
  padding: var(--tk-space-3) var(--tk-space-5);
  border: 0;
  border-radius: var(--tk-radius-md);
  background: var(--tk-color-primary);
  color: var(--tk-color-bg);
  font-weight: var(--tk-fw-bold);
}

.c-f019-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--tk-space-3);
  padding: 0;
  margin: 0;
  list-style: none;
}

.c-f019-link-grid a,
.c-f019-line-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--tk-space-3) var(--tk-space-4);
  border-radius: var(--tk-radius-md);
  text-decoration: none;
  font-weight: var(--tk-fw-bold);
}

.c-f019-link-grid a {
  width: 100%;
  background: var(--tk-color-bg);
  border: 1px solid var(--tk-color-border);
  color: var(--tk-color-link);
}

.c-f019-line-panel {
  border-color: var(--tk-color-accent);
}

.c-f019-line-button {
  background: var(--tk-color-accent);
  color: var(--tk-color-ink);
}

.c-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--tk-space-6);
}

.c-article__card {
  margin: 0;
}

.c-article__card-link {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.c-article__card-body {
  height: 100%;
  padding: var(--tk-space-6);
  background: var(--tk-color-bg);
  border: 1px solid var(--tk-color-border);
  border-radius: var(--tk-radius-lg);
  box-shadow: var(--tk-shadow-xs);
}

.c-article__card-title {
  margin: 0 0 var(--tk-space-3);
  font-size: var(--tk-fs-lg);
  line-height: 1.4;
}

.c-article__card-verify,
.c-article__card-date {
  margin: 0 0 var(--tk-space-2);
  font-size: var(--tk-fs-sm);
  color: var(--tk-color-ink-muted);
}

.c-article__card-excerpt {
  margin: 0;
  color: var(--tk-color-ink);
}

.archive-empty,
.c-f019-empty {
  color: var(--tk-color-ink-muted);
}

.skip-link + .skip-link {
  display: none;
}

@media (min-width: 1000px) {
  .c-f019-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }
}

/* F-011c: CF7 input width fix — prevents 375/390px mobile clip (size=40 intrinsic ~414px) */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="url"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   Qiita-style TOP page layout — F-020 (revised: popup-only subscribe)
   Scope: .l-qiitaFeed wrapper and descendants only.
   Rollback: delete this block from base.css and run scripts/restore_top_page.py
   ========================================================================== */

.l-qiitaFeed {
  display: grid;
  gap: var(--tk-space-6);
  grid-template-columns: 1fr;
  grid-template-areas:
    "main"
    "left"
    "right";
  max-width: 1328px;
  margin: 0 auto;
}

.l-qiitaFeed__main  { grid-area: main; }
.l-qiitaFeed__left  { grid-area: left; }
.l-qiitaFeed__right { grid-area: right; }

@media (min-width: 1024px) {
  .l-qiitaFeed {
    grid-template-columns: 248px minmax(0, 1fr) 300px;
    grid-template-areas: "left main right";
    gap: var(--tk-space-8);
    align-items: start;
  }
}

.l-qiitaFeed__left,
.l-qiitaFeed__right {
  display: grid;
  gap: var(--tk-space-4);
}

/* Sidebars scroll naturally — no sticky to avoid cutoff under the sticky header/nav. */

.l-qiitaFeed__main {
  display: grid;
  gap: var(--tk-space-4);
  min-width: 0;
}

/* Tab switcher above feed */
.c-feedTabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--tk-color-border);
  background: var(--tk-color-bg);
  border-radius: var(--tk-radius-md) var(--tk-radius-md) 0 0;
  padding: 0 var(--tk-space-3);
}

.c-feedTabs__item {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: var(--tk-space-3) var(--tk-space-4);
  color: var(--tk-color-ink-muted);
  text-decoration: none;
  font-size: var(--tk-fs-sm);
  font-weight: var(--tk-fw-bold);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.c-feedTabs__item:hover,
.c-feedTabs__item:focus-visible {
  color: var(--tk-color-ink);
}

.c-feedTabs__item.is-active {
  color: var(--tk-color-ink);
  border-bottom-color: var(--tk-color-primary);
}

/* Article feed card — mirrors Qiita: white 8px radius, 16px 24px padding, no shadow */
.c-feedCard {
  position: relative;
  background: var(--tk-color-bg);
  border-radius: var(--tk-radius-md);
  padding: var(--tk-space-4) var(--tk-space-6);
  display: flex;
  flex-direction: column;
  gap: var(--tk-space-2);
  border: 0;
  list-style: none;
  transition: background-color 120ms ease;
}

.c-feedCard:hover {
  background: rgba(11, 95, 174, .03);
}

/* Invisible click overlay — entire card clickable to article */
.c-feedCard__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  text-indent: -9999px;
  overflow: hidden;
  background: transparent;
  pointer-events: auto;
}

/* Foreground content sits above visually but is transparent to clicks,
   so plain-text clicks fall through to the overlay link. */
.c-feedCard > *:not(.c-feedCard__overlay) {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

/* Re-enable clicks on actual interactive descendants. */
.c-feedCard a,
.c-feedCard button {
  pointer-events: auto;
  position: relative;
  z-index: 3;
}

.c-feedCard__overlay:focus-visible {
  outline: 2px solid var(--tk-color-link);
  outline-offset: -2px;
}

.c-feedCard__flag {
  display: inline-flex;
  align-items: center;
  gap: var(--tk-space-1);
  font-size: var(--tk-fs-xs);
  color: var(--tk-color-ink-muted);
}

.c-feedCard__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tk-space-2);
  font-size: var(--tk-fs-xs);
  color: var(--tk-color-ink-muted);
}

.c-feedCard__author {
  font-weight: var(--tk-fw-bold);
  color: var(--tk-color-ink);
}

.c-feedCard__title {
  margin: var(--tk-space-1) 0;
  font-size: var(--tk-fs-lg);
  font-weight: var(--tk-fw-bold);
  line-height: var(--tk-lh-snug);
  color: var(--tk-color-ink);
}

.c-feedCard__title a {
  color: var(--tk-color-ink);
  text-decoration: none;
}

.c-feedCard__title a:hover,
.c-feedCard__title a:focus-visible {
  color: var(--tk-color-link);
  text-decoration: underline;
}

.c-feedCard__excerpt {
  margin: 0;
  font-size: var(--tk-fs-sm);
  line-height: var(--tk-lh-relaxed);
  color: var(--tk-color-ink-muted);
}

/* Tag list — Qiita chip style (flat gray) */
.c-tagList {
  list-style: none;
  margin: var(--tk-space-2) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--tk-space-1);
}

.c-tagList li { margin: 0; }

.c-tagList a {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 6px;
  background: #edeeee;
  color: rgba(31, 41, 51, .7);
  border-radius: 4px;
  font-size: var(--tk-fs-sm);
  text-decoration: none;
  line-height: 1;
}

.c-tagList a:hover,
.c-tagList a:focus-visible {
  background: var(--tk-color-border);
  color: var(--tk-color-ink);
}

.c-feedCard__stats {
  display: flex;
  align-items: center;
  gap: var(--tk-space-3);
  margin-top: var(--tk-space-2);
  padding-top: var(--tk-space-2);
  font-size: var(--tk-fs-xs);
  color: var(--tk-color-ink-muted);
}

/* Sidebar cards (left and right) */
.c-sideCard {
  background: var(--tk-color-bg);
  border-radius: var(--tk-radius-md);
  padding: var(--tk-space-4);
}

.c-sideCard__title {
  margin: 0 0 var(--tk-space-3);
  font-size: var(--tk-fs-sm);
  font-weight: var(--tk-fw-bold);
  color: var(--tk-color-ink);
  padding-bottom: var(--tk-space-2);
  border-bottom: 1px solid var(--tk-color-border);
}

.c-rankList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--tk-space-2);
  counter-reset: rank;
}

.c-rankList li {
  counter-increment: rank;
  position: relative;
  padding: var(--tk-space-2) var(--tk-space-2) var(--tk-space-2) 44px;
  border-radius: var(--tk-radius-sm);
  min-height: 36px;
  display: flex;
  align-items: center;
}

/* Base rank badge (4位以降) */
.c-rankList li::before {
  content: counter(rank);
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: var(--tk-color-bg-subtle);
  color: var(--tk-color-ink-muted);
  font-size: var(--tk-fs-sm);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--tk-font-sans);
  letter-spacing: -0.02em;
  box-shadow: inset 0 0 0 1px var(--tk-color-border);
}

/* Ribbon tail (bottom notch) for top 3 */
.c-rankList li:nth-child(-n+3)::after {
  content: "";
  position: absolute;
  left: 6px;
  bottom: -2px;
  width: 30px;
  height: 8px;
  transform: translateY(0);
  background:
    linear-gradient(to bottom right, transparent 50%, rgba(0,0,0,0.15) 50%) top left / 50% 100% no-repeat,
    linear-gradient(to bottom left, transparent 50%, rgba(0,0,0,0.15) 50%) top right / 50% 100% no-repeat;
  filter: blur(0.5px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

/* 🥇 1st — Gold */
.c-rankList li:nth-child(1)::before {
  color: #7a5a00;
  background: linear-gradient(135deg, #ffe992 0%, #f4c430 48%, #b58c1a 100%);
  box-shadow:
    0 2px 4px rgba(180, 140, 20, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  font-size: 1rem;
  font-weight: 900;
}
.c-rankList li:nth-child(1)::before {
  content: "1";
}

/* 🥈 2nd — Silver */
.c-rankList li:nth-child(2)::before {
  color: #3f4a55;
  background: linear-gradient(135deg, #f4f6f8 0%, #c6cdd5 50%, #8a939b 100%);
  box-shadow:
    0 2px 4px rgba(138, 147, 155, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  font-size: 1rem;
  font-weight: 900;
}

/* 🥉 3rd — Bronze */
.c-rankList li:nth-child(3)::before {
  color: #5e2a08;
  background: linear-gradient(135deg, #ecc2a0 0%, #cd7f32 50%, #8b4a1a 100%);
  box-shadow:
    0 2px 4px rgba(139, 74, 26, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  font-size: 1rem;
  font-weight: 900;
}

/* Small crown dot on top of #1 */
.c-rankList li:nth-child(1)::before {
  background-image:
    radial-gradient(ellipse at 30% 25%, rgba(255, 255, 255, 0.6) 0%, transparent 35%),
    linear-gradient(135deg, #ffe992 0%, #f4c430 48%, #b58c1a 100%);
}

.c-rankList a {
  display: block;
  color: var(--tk-color-ink);
  text-decoration: none;
  font-size: var(--tk-fs-sm);
  line-height: var(--tk-lh-snug);
}

.c-rankList a:hover,
.c-rankList a:focus-visible {
  color: var(--tk-color-link);
  text-decoration: underline;
}

.c-rankList .c-rankList__count {
  display: block;
  font-size: var(--tk-fs-xs);
  color: var(--tk-color-ink-muted);
  margin-top: 2px;
}

/* Simple link list for sidebar */
.c-sideLinks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--tk-space-1);
}

.c-sideLinks a {
  display: block;
  padding: var(--tk-space-2);
  border-radius: var(--tk-radius-sm);
  color: var(--tk-color-ink);
  text-decoration: none;
  font-size: var(--tk-fs-sm);
  line-height: var(--tk-lh-snug);
}

.c-sideLinks a:hover,
.c-sideLinks a:focus-visible {
  background: var(--tk-color-bg-subtle);
  color: var(--tk-color-link);
}

/* Body background tint to match Qiita's subtle gray on home feed. Applied to
   body and wrapper to eliminate white gap between nav and feed on desktop. */
body.home,
body.page-id-10 {
  background: var(--tk-color-bg-subtle);
}
body.home .l-content,
body.page-id-10 .l-content,
body.home .l-contentWrap,
body.page-id-10 .l-contentWrap,
body.home .l-main,
body.page-id-10 .l-main {
  background: var(--tk-color-bg-subtle);
}

/* ==========================================================================
   Horizontal scrollable secondary nav (Qiita-style, below header)
   ========================================================================== */

.c-tabNav {
  position: sticky;
  top: 52px;  /* Mobile: just below Arkhe header */
  z-index: 90;
  background: var(--tk-color-bg);
  border-bottom: 1px solid var(--tk-color-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  width: 100%;
  margin-bottom: var(--tk-space-2); /* was var(--tk-space-4) — tighten gap to hero */
  transition: transform 260ms ease;
}

/* Hide on scroll down (toggled by JS). Show again on scroll up. */
.c-tabNav.is-nav-hidden {
  transform: translateY(-100%);
}

@media (min-width: 768px) {
  .c-tabNav { top: 56px; }
}
@media (min-width: 1000px) {
  .c-tabNav {
    top: 64px;  /* Desktop Arkhe header is typically 64px */
    margin-bottom: var(--tk-space-4); /* was var(--tk-space-6) */
  }
  /* Hide tabNav items already shown in the header gnav (c-gnavWrap).
     PHP tags these links is-gnav-item by comparing with header_menu URLs. */
  .c-tabNav__item.is-gnav-item {
    display: none;
  }
  /* If every item is hidden (all overlap with gnav), collapse the nav bar. */
  .c-tabNav:not(:has(.c-tabNav__item:not(.is-gnav-item))) {
    display: none;
  }
}

/* Right-edge fade + scroll arrow hint (mobile scrollable hint) */
.c-tabNav::after {
  content: "›";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 1px; /* above the border */
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px 0 48px;
  width: 56px;
  pointer-events: none;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, var(--tk-color-bg) 60%);
  color: var(--tk-color-ink-muted);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  transition: opacity 180ms ease;
  opacity: 1;
  z-index: 2;
}

.c-tabNav[data-scrolled-right="true"]::after { opacity: 0; }

.c-tabNav__scroll {
  display: flex;
  gap: var(--tk-space-1);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 var(--tk-space-3);
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

.c-tabNav__scroll::-webkit-scrollbar {
  display: none;
}

.c-tabNav__item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: var(--tk-space-3) var(--tk-space-3);
  color: var(--tk-color-ink-muted);
  text-decoration: none;
  font-size: var(--tk-fs-sm);
  font-weight: var(--tk-fw-bold);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  min-height: 44px;
  scroll-snap-align: start;
  transition: color 120ms ease, border-color 120ms ease;
}

.c-tabNav__item:hover,
.c-tabNav__item:focus-visible {
  color: var(--tk-color-ink);
}

.c-tabNav__item.is-active {
  color: var(--tk-color-ink);
  border-bottom-color: var(--tk-color-primary);
}

@media (min-width: 1024px) {
  .c-tabNav__scroll {
    padding: 0 var(--tk-space-6);
    max-width: 1328px;
    margin: 0 auto;
  }
}

/* Hide truly empty <p> elements left by wpautop in the Qiita feed layout.
 * JS in wp_footer also handles whitespace-only paragraphs as a fallback. */
.l-qiitaFeed__main > p:empty,
.l-qiitaFeed > p:empty {
  display: none !important;
  margin: 0 !important;
}

/* Feed card flag as a link */
.c-feedCard__flag a {
  color: inherit;
  text-decoration: none;
}
.c-feedCard__flag a:hover,
.c-feedCard__flag a:focus-visible {
  color: var(--tk-color-link);
  text-decoration: underline;
}

/* ==========================================================================
   Auth forms (register / login)
   ========================================================================== */
.c-authForm {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--tk-space-6);
  background: var(--tk-color-bg);
  border: 1px solid var(--tk-color-border);
  border-radius: var(--tk-radius-lg);
}
.c-authForm__title { margin: 0 0 var(--tk-space-5); font-size: var(--tk-fs-xl); }
.c-authForm__form p { margin: 0 0 var(--tk-space-4); }
.c-authForm__form label { display: block; font-weight: 700; font-size: var(--tk-fs-sm); margin-bottom: 4px; }
.c-authForm__form label small { font-weight: 400; color: var(--tk-color-ink-muted); font-size: var(--tk-fs-xs); }
.c-authForm__form input[type="text"],
.c-authForm__form input[type="email"],
.c-authForm__form input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--tk-color-border);
  border-radius: var(--tk-radius-md);
  font-size: 16px;
  background: #fff;
}
.c-authForm__form input:focus-visible {
  outline: 2px solid var(--tk-color-link);
  outline-offset: 2px;
  border-color: var(--tk-color-link);
}
.c-authForm__submit {
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  background: var(--tk-color-primary);
  color: #fff;
  border: 0;
  border-radius: var(--tk-radius-md);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}
.c-authForm__submit:hover:not([disabled]),
.c-authForm__submit:focus-visible:not([disabled]) {
  background: var(--tk-color-primary-hover);
}
.c-authForm__submit[disabled] { opacity: .6; cursor: not-allowed; }
.c-authForm__google {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid var(--tk-color-border);
  border-radius: var(--tk-radius-md);
  color: var(--tk-color-ink);
  text-decoration: none;
  font-weight: 700;
}
.c-authForm__google::before {
  content: "";
  display: inline-block;
  width: 18px; height: 18px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'><path fill='%23FFC107' d='M43.6 20.5H42V20H24v8h11.3c-1.6 4.5-5.9 7.8-11.3 7.8A12 12 0 1 1 24 12c3 0 5.8 1.1 7.9 3l5.7-5.7A20 20 0 1 0 44 24a20 20 0 0 0-.4-3.5z'/><path fill='%23FF3D00' d='M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.1 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z'/><path fill='%234CAF50' d='M24 44a20 20 0 0 0 13.5-5.2l-6.2-5.2A12 12 0 0 1 12.7 28.5L6.1 33.5A20 20 0 0 0 24 44z'/><path fill='%231976D2' d='M43.6 20.5H42V20H24v8h11.3c-.8 2.2-2.2 4-4 5.3l6.2 5.2c-.4.4 6.5-4.8 6.5-14.5a20 20 0 0 0-.4-3.5z'/></svg>") center/contain no-repeat;
}
.c-authForm__note { font-size: var(--tk-fs-sm); min-height: 1.4em; color: var(--tk-color-ink-muted); }
.c-authForm hr { border: 0; border-top: 1px solid var(--tk-color-border); margin: var(--tk-space-4) 0; }

/* ==========================================================================
   Post feedback widget (solved-rate + comments merged)
   Hide F-005's own comment field when wrapped inside [tonari_post_feedback]
   (the integrated comment form below replaces it to avoid duplicate UIs).
   ========================================================================== */
.c-postFeedback .c-solvedRate__commentDetails,
.c-postFeedback .c-solvedRate__comment {
  display: none !important;
}

.c-postFeedback {
  margin: var(--tk-space-8) 0 var(--tk-space-6);
  padding: var(--tk-space-6) var(--tk-space-5);
  background: var(--tk-color-bg);
  border: 1px solid var(--tk-color-border);
  border-radius: var(--tk-radius-lg);
}
.c-postFeedback__title { margin: 0 0 var(--tk-space-4); font-size: var(--tk-fs-lg); }
.c-postFeedback__commentsHeader {
  margin-top: var(--tk-space-6);
  padding-top: var(--tk-space-4);
  border-top: 1px solid var(--tk-color-border);
}
.c-postFeedback__commentsTitle {
  margin: 0 0 4px;
  font-size: var(--tk-fs-base);
  font-weight: var(--tk-fw-bold);
}
.c-postFeedback__commentCount {
  font-weight: 400;
  color: var(--tk-color-ink-muted);
  font-size: var(--tk-fs-sm);
}
.c-postFeedback__commentsHint {
  margin: 0 0 var(--tk-space-3);
  color: var(--tk-color-ink-muted);
  font-size: var(--tk-fs-sm);
}

/* needLogin notice — sits BELOW the hint paragraph, ABOVE the comment form */
.c-postFeedback__needLogin {
  margin: 0 0 var(--tk-space-4);
  padding: var(--tk-space-2) var(--tk-space-3);
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: var(--tk-radius-sm);
  color: #C81E1E;
  font-size: var(--tk-fs-sm);
  line-height: var(--tk-lh-relaxed);
}
.c-postFeedback__needLogin strong { color: #C81E1E; display: block; margin-bottom: 4px; }
.c-postFeedback__needLogin a { color: var(--tk-color-primary); font-weight: var(--tk-fw-bold); text-decoration: underline; }

.c-commentList { list-style: none; margin: 0 0 var(--tk-space-4); padding: 0; }
.c-commentList__item {
  padding: var(--tk-space-3) 0;
  border-top: 1px solid var(--tk-color-border);
}
.c-commentList__head {
  display: flex;
  align-items: center;
  gap: var(--tk-space-2);
  margin-bottom: 6px;
}
.c-commentList__avatar { border-radius: 50%; width: 40px; height: 40px; }
.c-commentList__meta { display: flex; flex-direction: column; gap: 2px; }
.c-commentList__author { font-weight: var(--tk-fw-bold); font-size: var(--tk-fs-sm); }
.c-commentList__date { color: var(--tk-color-ink-muted); font-size: var(--tk-fs-xs); }
.c-commentList__body { font-size: var(--tk-fs-sm); line-height: var(--tk-lh-relaxed); }
.c-commentList__body p { margin: 0 0 0.5em; }

.c-commentForm {
  display: grid;
  gap: var(--tk-space-2);
  padding: var(--tk-space-3);
  background: var(--tk-color-bg-subtle);
  border-radius: var(--tk-radius-md);
  margin-top: var(--tk-space-2);
}
/* .c-commentForm__needLogin — deprecated (relocated to .c-postFeedback__needLogin). Kept for safety. */
.c-commentForm__needLogin { display: none !important; }
.c-commentForm__label {
  font-size: var(--tk-fs-sm);
  font-weight: var(--tk-fw-bold);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.c-commentForm__counter {
  font-weight: 400;
  font-size: var(--tk-fs-xs);
  color: var(--tk-color-ink-muted);
  font-variant-numeric: tabular-nums;
}
.c-commentForm__counter .c-commentForm__counterNow { font-weight: 700; color: var(--tk-color-ink); }

/* Image upload field */
.c-commentForm__imageField {
  margin-top: var(--tk-space-2);
}
.c-commentForm__imageLabel {
  display: block;
  font-size: var(--tk-fs-sm);
  font-weight: var(--tk-fw-bold);
  margin-bottom: 4px;
}
.c-commentForm__imageLabel small {
  display: block;
  font-weight: 400;
  font-size: var(--tk-fs-xs);
  color: var(--tk-color-ink-muted);
  margin-top: 2px;
}
.c-commentForm__imageInput {
  display: block;
  font-size: var(--tk-fs-sm);
  margin-top: 4px;
}
.c-commentForm__imagePreview {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tk-space-2);
  margin-top: var(--tk-space-2);
}
.c-commentForm__previewImg {
  max-width: 120px;
  max-height: 120px;
  border-radius: var(--tk-radius-sm);
  border: 1px solid var(--tk-color-border);
  object-fit: cover;
}
.c-commentForm__previewErr {
  margin: 0;
  font-size: var(--tk-fs-xs);
  color: #C81E1E;
  flex-basis: 100%;
}

/* Comment image attachments display */
.c-commentList__images {
  list-style: none;
  padding: 0;
  margin: var(--tk-space-2) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--tk-space-2);
}
.c-commentList__image {
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--tk-radius-sm);
  border: 1px solid var(--tk-color-border);
  object-fit: cover;
  display: block;
}

/* Report button on each comment */
.c-commentList__report {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--tk-color-border);
  border-radius: var(--tk-radius-sm);
  color: var(--tk-color-ink-muted);
  font-size: var(--tk-fs-xs);
  cursor: pointer;
}
.c-commentList__report:hover,
.c-commentList__report:focus-visible {
  background: #fff5f5;
  color: #C81E1E;
  border-color: #fecaca;
}
.c-commentList__head { align-items: center; }
.c-commentForm__required {
  color: #C81E1E;
  font-weight: 400;
  font-size: var(--tk-fs-xs);
}
.c-commentForm__textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 100px;
  padding: 10px 12px;
  border: 1px solid var(--tk-color-border);
  border-radius: var(--tk-radius-md);
  font-size: 16px;
  background: #fff;
  font-family: inherit;
  resize: vertical;
}
.c-commentForm__textarea.is-readonly {
  cursor: pointer;
  background: #fafbfd;
}
.c-commentForm__textarea:focus-visible {
  outline: 2px solid var(--tk-color-link);
  outline-offset: 2px;
  border-color: var(--tk-color-link);
}
.c-commentForm__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--tk-space-2);
  flex-wrap: wrap;
}
.c-commentForm__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  background: var(--tk-color-primary);
  color: #fff;
  border: 0;
  border-radius: var(--tk-radius-md);
  font-weight: var(--tk-fw-bold);
  font-size: var(--tk-fs-base);
  cursor: pointer;
  text-decoration: none;
}
.c-commentForm__submit:hover,
.c-commentForm__submit:focus-visible {
  background: var(--tk-color-primary-hover);
  color: #fff;
}
.c-commentForm__submit.-login {
  background: var(--tk-color-primary);
  color: #fff;
}
.c-commentForm__user {
  font-size: var(--tk-fs-xs);
  color: var(--tk-color-ink-muted);
}

/* ==========================================================================
   Markdown block (tonari_md shortcode output) + content-level fallback
   ========================================================================== */
.c-markdown { }
.c-markdown h2, .c-markdown h3, .c-markdown h4 { margin-top: var(--tk-space-6); }
.c-markdown code { background: var(--tk-color-bg-subtle); padding: 2px 6px; border-radius: 3px; font-size: 0.9em; }
.c-markdown pre { background: #1f2933; color: #f5f7fa; padding: 12px; border-radius: 6px; overflow-x: auto; }
.c-markdown pre code { background: transparent; padding: 0; color: inherit; }
.c-markdown blockquote { border-left: 3px solid var(--tk-color-border); margin: 1em 0; padding: 8px 16px; background: var(--tk-color-bg-subtle); }
/* ---- Tables (site-wide) ---- */

/* Scrollable wrapper — mobile horizontal scroll */
.wp-block-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-block: var(--tk-space-5, 1.25rem);
}

/* Base reset */
.wp-block-table table,
.c-markdown table,
.entry-content table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--tk-fs-sm, 0.875rem);
  line-height: 1.6;
  margin: 0;
}

/* Cells */
.wp-block-table th,
.wp-block-table td,
.c-markdown th,
.c-markdown td,
.entry-content th,
.entry-content td {
  padding: 10px 16px;
  border: 1px solid #c4cdd8;
  text-align: left;
  vertical-align: top;
  min-width: 100px;
}

/* thead — blue column headers */
.wp-block-table thead th,
.c-markdown thead th,
.entry-content thead th {
  background: #0B5FAE;
  color: #fff;
  font-weight: 600;
  border-color: #094e92;
  white-space: nowrap;
}

/* tbody th — row labels (light blue) */
.wp-block-table tbody th,
.c-markdown tbody th,
.entry-content tbody th {
  background: #e9f1fb;
  color: #0a3d7a;
  font-weight: 600;
  white-space: nowrap;
}

/* Mobile */
@media (max-width: 767px) {
  .wp-block-table th,
  .wp-block-table td,
  .c-markdown th,
  .c-markdown td,
  .entry-content th,
  .entry-content td {
    padding: 8px 10px;
    font-size: 0.8125rem;
    min-width: 80px;
  }
}

/* **bold** → 赤太字 (Markdown強調マーカー) */
.c-markdown strong,
.c-strong-mark,
.entry-content strong.c-strong-mark {
    color: var(--tk-color-danger, #C81E1E);
    font-weight: var(--tk-fw-bold, 700);
}

/* ---------- Qiita 風コードブロック ---------- */
.c-codeblock {
    margin: var(--tk-space-4) 0;
    border-radius: var(--tk-radius-md);
    overflow: hidden;
    box-shadow: var(--tk-shadow-sm);
    background: #1e1e1e;
    border: 1px solid #2a2a2d;
}
.c-codeblock__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #161618;
    border-bottom: 1px solid #2a2a2d;
}
.c-codeblock__label {
    color: #c7c7c7;
    font-size: var(--tk-fs-xs, 0.75rem);
    font-weight: 600;
    font-family: var(--tk-font-mono);
    letter-spacing: 0.04em;
    text-transform: lowercase;
}
.c-codeblock__copy {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #4a4a4d;
    background: #2d2d30;
    color: #eaeaea;
    padding: 3px 12px;
    border-radius: var(--tk-radius-sm);
    font-size: var(--tk-fs-xs, 0.75rem);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--tk-dur-fast, 120ms), color var(--tk-dur-fast, 120ms);
}
.c-codeblock__copy:hover { background: #3a3a3d; }
.c-codeblock__copy:focus-visible { outline: 2px solid var(--tk-color-accent, #06C755); outline-offset: 1px; }
.c-codeblock__copy.is-copied {
    background: var(--tk-color-accent, #06C755);
    border-color: transparent;
    color: #fff;
}
.c-codeblock pre,
.c-codeblock pre[class*="language-"] {
    margin: 0 !important;
    padding: var(--tk-space-4) !important;
    background: #1e1e1e !important;
    color: #eaeaea !important;
    overflow-x: auto !important;
    font-family: var(--tk-font-mono) !important;
    font-size: var(--tk-fs-sm, 0.875rem) !important;
    line-height: 1.65 !important;
    border-radius: 0 !important;
    text-shadow: none !important;
    white-space: pre !important;
}
.c-codeblock pre code,
.c-codeblock pre code[class*="language-"] {
    background: transparent !important;
    color: inherit !important;
    padding: 0 !important;
    font-family: inherit !important;
    font-size: inherit !important;
    white-space: pre !important;
    text-shadow: none !important;
    display: block;
}

/* ---------- 水平線を視覚的に非表示 (semantics は残す) ---------- */
.c-markdown hr,
.entry-content hr.wp-block-separator,
article hr.wp-block-separator,
.l-article hr.wp-block-separator {
    border: 0;
    background: transparent;
    height: 1px;
    margin: var(--tk-space-6) 0;
    opacity: 0;
}

/* ==========================================================================
   Table of contents (目次) — auto-generated from h2/h3 in the_content
   ========================================================================== */
.c-toc {
    margin: var(--tk-space-6) 0 var(--tk-space-8);
    padding: 0;
    background: var(--tk-color-bg);
    border: 1px solid var(--tk-color-border);
    border-radius: var(--tk-radius-md);
    overflow: hidden;
    box-shadow: var(--tk-shadow-xs);
}
.c-toc__head {
    display: flex;
    align-items: center;
    gap: var(--tk-space-2);
    padding: var(--tk-space-3) var(--tk-space-4);
    cursor: pointer;
    list-style: none;
    user-select: none;
    background: var(--tk-color-bg-subtle);
    border-bottom: 1px solid var(--tk-color-border);
    font-weight: 700;
    color: var(--tk-color-ink);
    font-size: var(--tk-fs-md);
}
.c-toc__head::-webkit-details-marker,
.c-toc__head::marker { display: none; content: none; }
.c-toc__title {
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: var(--tk-space-2);
}
.c-toc__title::before {
    content: "";
    display: inline-block;
    width: 18px; height: 18px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B5FAE' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><line x1='8' y1='6' x2='21' y2='6'/><line x1='8' y1='12' x2='21' y2='12'/><line x1='8' y1='18' x2='21' y2='18'/><line x1='3' y1='6' x2='3.01' y2='6'/><line x1='3' y1='12' x2='3.01' y2='12'/><line x1='3' y1='18' x2='3.01' y2='18'/></svg>");
    background-repeat: no-repeat;
    background-size: contain;
    flex-shrink: 0;
}
.c-toc__chevron {
    width: 9px; height: 9px;
    border-right: 2px solid var(--tk-color-ink-muted);
    border-bottom: 2px solid var(--tk-color-ink-muted);
    transform: rotate(45deg);
    transition: transform var(--tk-dur-normal, 200ms) var(--tk-ease);
    margin-bottom: 4px;
}
.c-toc[open] > .c-toc__head .c-toc__chevron {
    transform: rotate(-135deg);
    margin-top: 4px;
    margin-bottom: 0;
}
.c-toc__list {
    list-style: none;
    margin: 0;
    padding: var(--tk-space-3) var(--tk-space-4);
    counter-reset: toc-h2;
}
.c-toc__item {
    margin: 0;
    padding: 4px 0;
    font-size: var(--tk-fs-sm);
    line-height: 1.6;
}
.c-toc__item.is-h2 {
    padding-left: 0;
    counter-increment: toc-h2;
    font-weight: 600;
}
.c-toc__item.is-h2 > a::before {
    content: counter(toc-h2) ". ";
    color: var(--tk-color-primary);
    font-weight: 700;
    margin-right: 4px;
}
.c-toc__item.is-h3 {
    padding-left: var(--tk-space-6);
    font-weight: 400;
}
.c-toc__item.is-h3 > a::before {
    content: "– ";
    color: var(--tk-color-ink-muted);
    margin-right: 2px;
}
.c-toc__item a {
    color: var(--tk-color-ink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color var(--tk-dur-fast, 120ms), border-color var(--tk-dur-fast, 120ms);
}
.c-toc__item a:hover,
.c-toc__item a:focus-visible {
    color: var(--tk-color-primary);
    border-bottom-color: var(--tk-color-primary);
    outline: none;
}

/* スクロールオフセット: sticky ヘッダ + nav で見出しが隠れないように */
.entry-content h2[id], .entry-content h3[id],
article h2[id], article h3[id],
.c-markdown h2[id], .c-markdown h3[id],
.l-article h2[id], .l-article h3[id] {
    scroll-margin-top: 140px;
}
@media (max-width: 999px) {
    .entry-content h2[id], .entry-content h3[id],
    article h2[id], article h3[id],
    .c-markdown h2[id], .c-markdown h3[id],
    .l-article h2[id], .l-article h3[id] {
        scroll-margin-top: 110px;
    }
}

/* ==========================================================================
   Hero slideshow — F-021
   Managed via plugins/mu/032-hero-slideshow.php, shortcode [tonari_hero_slides].
   Responsive: desktop 1192x250 (Qiita Conference banner matches), mobile 343x160.
   ========================================================================== */

.c-heroSlider {
  position: relative;
  border-radius: var(--tk-radius-md);
  margin-bottom: var(--tk-space-4);
  background: var(--tk-color-bg);
  overflow: hidden;
}

.c-heroSlider__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 150ms;
}
.c-heroSlider__close:hover,
.c-heroSlider__close:focus-visible {
  background: rgba(0, 0, 0, .8);
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.c-heroSlider__track {
  display: flex;
  transition: transform 480ms cubic-bezier(.2, .8, .2, 1);
  touch-action: pan-y;
  will-change: transform;
}

.c-heroSlide {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  background: var(--tk-color-bg);
}

.c-heroSlide__media {
  position: relative;
  display: block;
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  text-decoration: none;
  overflow: hidden;
}

@media (max-width: 640px) {
  .c-heroSlide__media { height: 160px; }
}

.c-heroSlide__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--tk-space-1);
  padding: var(--tk-space-5) var(--tk-space-6);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .58) 100%);
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}

.c-heroSlide__title {
  margin: 0;
  font-size: clamp(1.05rem, 0.95rem + 0.6vw, 1.5rem);
  font-weight: var(--tk-fw-bold);
  line-height: 1.35;
  color: #fff;
}

.c-heroSlide__subtitle {
  margin: 0;
  font-size: clamp(0.8rem, 0.7rem + 0.3vw, 0.95rem);
  line-height: 1.5;
  opacity: .95;
}

.c-heroSlide__footer {
  padding: var(--tk-space-3) var(--tk-space-5);
  border-top: 1px solid var(--tk-color-border);
  background: var(--tk-color-bg);
}

.c-heroSlide__cta {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 16px;
  background: var(--tk-color-primary);
  color: #fff;
  border-radius: 4px;
  font-weight: 700;
  font-size: var(--tk-fs-sm);
  text-decoration: none;
  transition: background-color 150ms;
}

.c-heroSlide__cta:hover,
.c-heroSlide__cta:focus-visible {
  background: var(--tk-color-primary-hover);
  color: #fff;
}

.c-heroSlider__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
  transition: background-color 150ms;
}
.c-heroSlider__btn:hover,
.c-heroSlider__btn:focus-visible {
  background: rgba(0, 0, 0, .72);
  outline: none;
}
.c-heroSlider__btn.-prev { left: 10px; }
.c-heroSlider__btn.-next { right: 10px; }

@media (max-width: 640px), (min-width: 960px) {
  .c-heroSlider__btn { display: none; }
}

.c-heroSlider__dots {
  position: absolute;
  right: var(--tk-space-5);
  bottom: 14px;
  display: flex;
  gap: 6px;
  z-index: 2;
  padding: 4px 6px;
  background: rgba(255, 255, 255, .85);
  border-radius: 20px;
}

/* When hero slide has footer (CTA below image), dots live in the footer area */
.c-heroSlide:has(.c-heroSlide__footer) ~ .c-heroSlider__dots,
.c-heroSlider:has(.c-heroSlide__footer) .c-heroSlider__dots {
  /* Move into the footer — position relative to the entire slider */
  position: absolute;
  top: auto;
  bottom: 8px;
  right: var(--tk-space-4);
  background: transparent;
  padding: 0;
}

.c-heroSlider__dot {
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  border: 1px solid var(--tk-color-border);
  background: var(--tk-color-bg);
  color: var(--tk-color-ink-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 150ms, color 150ms, border-color 150ms;
}
.c-heroSlider__dot:hover,
.c-heroSlider__dot:focus-visible {
  background: var(--tk-color-bg-subtle);
  color: var(--tk-color-ink);
  border-color: var(--tk-color-link);
}
.c-heroSlider__dot[aria-selected="true"] {
  background: var(--tk-color-primary);
  color: #fff;
  border-color: var(--tk-color-primary);
}

/* ==========================================================================
   Avatar — 32×32 square, Qiita-style (no radius)
   ========================================================================== */

.c-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--tk-color-bg-subtle);
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  vertical-align: middle;
}

.c-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   Filter bar — sits above the feed (Qiita "tune ≡ すべて" pattern)
   ========================================================================== */

.c-feedFilter {
  display: flex;
  align-items: center;
  gap: var(--tk-space-2);
  padding: var(--tk-space-3) var(--tk-space-2);
  background: transparent;
  border-bottom: 1px solid var(--tk-color-border);
  margin-bottom: var(--tk-space-2);
}

.c-feedFilter__btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--tk-color-bg);
  border: 1px solid var(--tk-color-border);
  border-radius: 4px;
  font-size: var(--tk-fs-sm);
  font-weight: var(--tk-fw-bold);
  color: var(--tk-color-ink);
  cursor: pointer;
  min-height: 36px;
}

.c-feedFilter__btn::before {
  content: "≡";
  display: inline-block;
  font-weight: 400;
  font-size: 16px;
  line-height: 1;
}

.c-feedFilter__btn:hover,
.c-feedFilter__btn:focus-visible {
  background: var(--tk-color-bg-subtle);
  border-color: var(--tk-color-link);
}

.c-feedFilter__note {
  flex: 1 1 0;
  font-size: var(--tk-fs-xs);
  color: var(--tk-color-ink-muted);
  min-width: 0;
}

.c-feedFilter__rss {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--tk-color-ink-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}
.c-feedFilter__rss:hover { color: var(--tk-color-link); background: var(--tk-color-bg-subtle); }

.c-feedFilter__menu {
  position: absolute;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--tk-color-border);
  border-radius: var(--tk-radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
  padding: 6px;
  min-width: 220px;
  z-index: 10;
  display: none;
}

.c-feedFilter[data-open="true"] .c-feedFilter__menu { display: block; }

.c-feedFilter__menuItem {
  display: block;
  padding: 8px 12px;
  border-radius: var(--tk-radius-sm);
  text-decoration: none;
  color: var(--tk-color-ink);
  font-size: var(--tk-fs-sm);
}
.c-feedFilter__menuItem:hover,
.c-feedFilter__menuItem:focus-visible {
  background: var(--tk-color-bg-subtle);
  color: var(--tk-color-link);
}
.c-feedFilter__menuItem.is-active {
  background: var(--tk-color-primary);
  color: #fff;
}

.c-feedCard__header {
  display: flex;
  align-items: center;
  gap: var(--tk-space-2);
}

.c-feedCard__headerBody {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 0;
}

.c-feedCard__author {
  font-weight: var(--tk-fw-bold);
  color: var(--tk-color-ink);
  font-size: var(--tk-fs-sm);
}

.c-feedCard__time {
  font-size: var(--tk-fs-xs);
  color: var(--tk-color-ink-muted);
}

/* Card footer with tag list (left) + stats/actions (right) */
.c-feedCard__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--tk-space-3);
  margin-top: var(--tk-space-2);
  flex-wrap: wrap;
}

.c-feedCard__footer .c-tagList {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.c-feedCard__actions {
  display: inline-flex;
  align-items: center;
  gap: var(--tk-space-3);
  flex: 0 0 auto;
}

.c-actionBtn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--tk-color-ink-muted);
  font-size: var(--tk-fs-sm);
  cursor: pointer;
  text-decoration: none;
  min-height: 36px;
  min-width: 36px;
  justify-content: center;
}

.c-actionBtn:hover,
.c-actionBtn:focus-visible {
  background: var(--tk-color-bg-subtle);
  color: var(--tk-color-ink);
  outline: none;
}

.c-actionBtn[data-action="like"].is-liked {
  color: #C81E1E;
}

.c-actionBtn[data-action="bookmark"].is-bookmarked {
  color: var(--tk-color-primary);
}

.c-actionBtn__icon {
  font-size: 16px;
  line-height: 1;
}

.c-actionBtn__count {
  font-variant-numeric: tabular-nums;
  font-weight: var(--tk-fw-bold);
}

/* Inline post-action bar — also used at top of single post page */
.c-postActions {
  display: flex;
  align-items: center;
  gap: var(--tk-space-3);
  padding: var(--tk-space-3) 0;
  margin: var(--tk-space-3) 0;
  border-top: 1px solid var(--tk-color-border);
  border-bottom: 1px solid var(--tk-color-border);
}

.c-postActions__like,
.c-postActions__bookmark,
.c-postActions__share {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--tk-color-bg);
  border: 1px solid var(--tk-color-border);
  border-radius: var(--tk-radius-pill);
  color: var(--tk-color-ink);
  font-size: var(--tk-fs-sm);
  font-weight: var(--tk-fw-bold);
  cursor: pointer;
  min-height: 40px;
  text-decoration: none;
}

.c-postActions__like:hover,
.c-postActions__bookmark:hover,
.c-postActions__share:hover {
  background: var(--tk-color-bg-subtle);
  border-color: var(--tk-color-link);
  color: var(--tk-color-link);
}

.c-postActions__like.is-liked {
  background: #fff1f1;
  border-color: #C81E1E;
  color: #C81E1E;
}

.c-postActions__bookmark.is-bookmarked {
  background: #f0f6ff;
  border-color: var(--tk-color-primary);
  color: var(--tk-color-primary);
}

/* ==========================================================================
   Responsive refinements
   - ≥1024: 3-column grid (248 / 1fr / 300) like Qiita
   - 720-1023: 2-column (1fr / 280 right sidebar, left above main)
   - <720: single column stack
   ========================================================================== */

@media (min-width: 720px) and (max-width: 1023.98px) {
  .l-qiitaFeed {
    grid-template-columns: minmax(0, 1fr) 280px;
    grid-template-areas:
      "main main"
      "left right";
    gap: var(--tk-space-6);
  }
  .l-qiitaFeed__left {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--tk-space-3);
  }
  .c-rankList { gap: 2px; }
}

@media (max-width: 719.98px) {
  .l-qiitaFeed { gap: var(--tk-space-4); }
  .c-feedCard { padding: var(--tk-space-4); }
  .c-feedTabs { padding: 0 var(--tk-space-2); }
  .c-feedTabs__item { padding: var(--tk-space-3); font-size: var(--tk-fs-sm); }
}

/* ---- c-feedMore ---- */
.c-feedMore {
  text-align: center;
  margin-top: var(--tk-space-6);
  margin-bottom: var(--tk-space-4);
}
.c-feedMore__btn {
  display: inline-block;
  padding: var(--tk-space-3) var(--tk-space-6);
  border: 2px solid var(--tk-color-link);
  border-radius: var(--tk-radius-md, 8px);
  color: var(--tk-color-link);
  font-weight: 600;
  font-size: var(--tk-fs-base);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.c-feedMore__btn:hover,
.c-feedMore__btn:focus-visible {
  background: var(--tk-color-link);
  color: #fff;
}
