/* JC Core – components (works with any theme; uses Japan Clinic tokens when present) */
.jc-toc, .jc-silo-wrap, .jc-related, .jc-landing-box, .jc-faq {
	--_brand: var(--jc-brand, #d71920);
	--_ink: var(--jc-ink, #18181c);
	--_muted: var(--jc-muted, #6c6c78);
	--_line: var(--jc-line, #ececf0);
	--_surface: var(--jc-surface, #f6f6f8);
	--_radius: var(--jc-radius, 16px);
}

/* ---- TOC ---- */
.jc-toc { margin: 0 0 24px; }
.jc-toc__box { border: 1px solid var(--_line); border-radius: var(--_radius); background: #fff; overflow: hidden; }
.jc-toc__summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; cursor: pointer; font-weight: 800; color: var(--_ink); user-select: none; }
.jc-toc__summary::-webkit-details-marker { display: none; }
.jc-toc__summary::after { content: ""; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .25s; margin-inline-start: auto; opacity: .6; }
.jc-toc__box[open] .jc-toc__summary::after { transform: rotate(-135deg); }
.jc-toc__count { font-size: 12px; font-weight: 600; color: var(--_muted); background: var(--_surface); padding: 2px 10px; border-radius: 999px; }
.jc-toc__progress { height: 3px; background: var(--_surface); }
.jc-toc__progress span { display: block; height: 100%; width: 0; background: var(--_brand); transition: width .15s linear; }
.jc-toc__list { list-style: none; margin: 0; padding: 8px 8px 12px; counter-reset: jctoc; max-height: min(60vh, 520px); overflow-y: auto; overscroll-behavior: contain; }
.jc-toc__list > li { counter-increment: jctoc; }
.jc-toc__list a { display: flex; gap: 10px; padding: 7px 10px; border-radius: 10px; color: var(--jc-text, #2b2b31); font-size: 14px; line-height: 1.65; text-decoration: none; transition: background .15s, color .15s; }
.jc-toc__list > li > a::before { content: counter(jctoc, persian); min-width: 22px; height: 22px; border-radius: 7px; background: var(--_surface); color: var(--_muted); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; flex-shrink: 0; margin-top: 1px; }
.jc-toc__list a:hover { background: var(--_surface); color: var(--_ink); }
.jc-toc__list a.is-active { background: #fdecec; color: var(--_brand); font-weight: 700; }
.jc-toc__list a.is-active::before { background: var(--_brand); color: #fff; }
.jc-toc__list ol { list-style: none; margin: 0 0 4px; padding-inline-start: 32px; }
.jc-toc__list ol a { font-size: 13.5px; padding-block: 5px; color: var(--_muted); }
.jc-toc--inline { max-width: 820px; }

/* ---- Silo ---- */
.jc-silo-wrap { display: grid; gap: 28px; margin-top: 44px; }
.jc-silo { padding: 22px; border: 1px solid var(--_line); border-radius: var(--_radius); background: var(--_surface); }
.jc-silo__title { font-size: 20px !important; margin: 0 0 16px !important; padding: 0 !important; border: 0 !important; color: var(--_ink); }
.jc-silo__list { list-style: none; margin: 0; padding: 0; }
.jc-silo__list--grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.jc-silo__list--grid a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 60px; background: #fff; border: 1px solid var(--_line); border-radius: 12px; color: var(--_ink); font-weight: 700; font-size: 14.5px; line-height: 1.5; text-decoration: none; transition: border-color .2s, box-shadow .2s, transform .2s; }
.jc-silo__list--grid a:hover { border-color: var(--_brand); color: var(--_brand); box-shadow: 0 6px 18px rgba(20,20,23,.08); transform: translateY(-1px); }
.jc-silo__thumb { width: 52px; height: 40px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.jc-silo__list--chips { display: flex; flex-wrap: wrap; gap: 8px; }
.jc-silo__list--chips a { display: inline-block; padding: 7px 14px; background: #fff; border: 1px solid var(--_line); border-radius: 999px; color: var(--_ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.jc-silo__list--chips a:hover { border-color: var(--_brand); color: var(--_brand); }
.jc-silo__list--list { display: grid; gap: 6px; }
.jc-silo__list--list a { display: block; padding: 10px 14px; background: #fff; border-radius: 10px; color: var(--_ink); font-weight: 600; text-decoration: none; }
.jc-silo__list--list a:hover { color: var(--_brand); }
.jc-silo__parent { display: inline-block; margin-top: 14px; font-weight: 700; color: var(--_brand); text-decoration: none; }

/* ---- Landing box in posts ---- */
.jc-landing-box { margin-top: 36px; padding: 20px 22px; border-radius: var(--_radius); border: 1.5px solid var(--_brand); background: #fff8f8; }
.jc-landing-box__label { margin: 0; font-size: 13px; color: var(--_muted); }
.jc-landing-box__link { display: inline-block; margin: 4px 0; font-size: 19px; font-weight: 800; color: var(--_brand); text-decoration: none; }
.jc-landing-box__sub { margin: 0; font-size: 14.5px; }

/* ---- Related ---- */
.jc-related { background: var(--_surface); padding-block: 48px; margin-top: 24px; }
.jc-related__inner { max-width: var(--jc-container, 1240px); margin-inline: auto; padding-inline: var(--jc-gutter, 16px); }
.jc-related__title { font-size: 24px; margin: 0 0 20px; }
.jc-related__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.jc-related__list a { display: block; background: #fff; border-radius: var(--_radius); overflow: hidden; border: 1px solid var(--_line); color: var(--_ink); text-decoration: none; height: 100%; transition: box-shadow .2s, transform .2s; }
.jc-related__list a:hover { box-shadow: 0 12px 32px rgba(20,20,23,.1); transform: translateY(-2px); }
.jc-related__list img, .jc-related__ph { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--_line); }
.jc-related__name { display: block; padding: 14px 16px; font-weight: 700; line-height: 1.6; }

/* ---- FAQ ---- */
.jc-faq { display: grid; gap: 10px; margin-block: 24px; }
.jc-faq__item { border: 1px solid var(--_line); border-radius: 14px; background: #fff; }
.jc-faq__item[open] { border-color: var(--_brand); box-shadow: 0 6px 18px rgba(215,25,32,.08); }
.jc-faq__q { list-style: none; cursor: pointer; padding: 16px 18px; font-weight: 800; color: var(--_ink); display: flex; justify-content: space-between; gap: 12px; }
.jc-faq__q::-webkit-details-marker { display: none; }
.jc-faq__q::after { content: "+"; font-size: 22px; line-height: 1; color: var(--_brand); transition: transform .2s; }
.jc-faq__item[open] .jc-faq__q::after { transform: rotate(45deg); }
.jc-faq__a { padding: 0 18px 16px; }
.jc-faq__a > :last-child { margin-bottom: 0; }

.jc-autolink { font-weight: inherit; }

/* ---- Gallery (runs of figures in content) ---- */
.jc-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-block: 24px; }
@media (min-width: 768px) { .jc-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
.jc-gallery figure { margin: 0 !important; border-radius: 14px; overflow: hidden; background: #f6f6f8; aspect-ratio: 4 / 3; }
.jc-gallery figure img { width: 100%; height: 100%; object-fit: cover; border-radius: 0 !important; display: block; transition: transform .4s ease; }
.jc-gallery figure:hover img { transform: scale(1.04); }
.jc-gallery figcaption { display: none; }
.jc-gallery > p { display: none; }
