/**
 * Ftrain public site styles
 * Fast, minimal CSS for a literary archive
 * Mobile-first design
 */

:root {
  /* IBM Plex font family */
  --font-serif: 'IBM Plex Serif', Georgia, serif;
  --font-sans: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --text: #222;
  --text-muted: #555;
  --bg: #fff;
  --bg-alt: #f5f5f5;
  --border: #ddd;
  --link: #0055aa;
  --link-hover: #003366;
  --focus: #0055aa;
  --accent: #990000;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #ddd;
    --text-muted: #aaa;
    --bg: #1a1a1a;
    --bg-alt: #242424;
    --border: #3a3a3a;
    --link: #6ab0ff;
    --link-hover: #8cc4ff;
    --accent: #ff6666;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 20px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font: 1rem/1.7 var(--font-serif);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Skip link */
.skip {
  position: absolute;
  left: -9999px;
  background: var(--text);
  color: var(--bg);
  padding: 0.75rem 1rem;
  z-index: 999;
  font-size: 1rem;
}
.skip:focus { left: 0; top: 0; }

/* ==========================================================================
   Layout
   ========================================================================== */

/* One container for all text content */
.page-container {
  max-width: 50em;
  margin: 0 auto;
  padding: 0 2rem;
}

main {
  padding: 1.5rem 0;
}

main.home {
  /* no additional styling needed */
}

footer {
  margin-top: 2.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   Masthead & Navigation
   ========================================================================== */

.masthead {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
}

/* Site navigation - fixed top-right */
.site-nav {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font: 0.9rem var(--font-sans);
  z-index: 100;
}

/* Site header - inside page container */
.site-header {
  padding: 2rem 0 1.5rem;
}

.site-brand,
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.site-icon,
.logo-icon {
  display: block;
  width: 7rem;
  height: 7rem;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
}

.site-title,
.logo-text {
  font: 400 normal 2.25rem/1 var(--font-serif);
  color: var(--text);
  text-transform: none;
  margin: 0;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 0.25rem;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
}

/* Navigation dropdown */
.site-nav details { position: relative; }
.site-nav summary {
  cursor: pointer;
  list-style: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-nav summary::-webkit-details-marker { display: none; }
.site-nav summary:hover { color: var(--text); }

/* Hamburger icon */
.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 16px;
}
.hamburger-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.site-nav .dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 280px;
  max-width: 90vw;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 100;
  border-radius: 4px;
}

/* These styles only apply to flat link dropdowns, not hierarchy-nav */
.site-nav .dropdown > a {
  display: block;
  padding: 0.6rem 0.875rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 44px;
}
.site-nav .dropdown > a:last-child { border-bottom: none; }
.site-nav .dropdown > a:hover,
.site-nav .dropdown > a:focus { background: var(--bg-alt); }

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

/* Simple inline breadcrumb nav */
.breadcrumb {
  font: 0.85rem var(--font-sans);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--link);
  text-decoration: underline;
}

/* Legacy breadcrumbs with ol/li structure */
.breadcrumbs {
  padding: 0.625rem 1rem;
  background: var(--bg-alt);
  font: 0.85rem var(--font-sans);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  list-style: none;
  max-width: 64rem;
  margin: 0 auto;
  white-space: nowrap;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.breadcrumbs li:not(:last-child)::after {
  content: '/';
  margin-left: 0.25rem;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0;
}
.breadcrumbs a:hover { color: var(--link); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--text); }

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: normal;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.25rem; font-weight: normal; }
h2 { font-size: 1.75rem; margin-top: 2rem; }
h3 { font-size: 1.375rem; margin-top: 1.5rem; font-weight: 600; }

p { margin: 0 0 1rem; }

a { color: var(--link); }
a:hover { color: var(--link-hover); }

blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--border);
  color: var(--text-muted);
  font-style: italic;
}

pre, code {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

pre {
  background: var(--bg-alt);
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
  border-radius: 4px;
  -webkit-overflow-scrolling: touch;
}

cite { font-style: italic; }

/* ==========================================================================
   Article
   ========================================================================== */

article {
  margin: 0;
  padding: 0;
}

.article-header {
  margin: 0 0 2.5rem;
  padding: 0 0 1.5rem;
}

.article-header h1 {
  font-size: 2.25rem;
  line-height: 1.15;
  margin-bottom: 1rem;
  max-width: none;
}

.article-meta {
  font: 0.9rem/1.4 var(--font-serif);
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: baseline;
}

.article-meta .author,
.article-meta .byline,
.article-meta .date {
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 0.8rem;
}

.article-meta .author::after,
.article-meta .byline:not(:last-child)::after {
  content: '·';
  margin: 0 0.4rem;
}

.article-content {
  margin-bottom: 2rem;
}

/* Prev/Next navigation */
.prev-next {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font: 0.9rem var(--font-sans);
}

.prev-next a {
  color: var(--text-muted);
  text-decoration: none;
  max-width: 45%;
}

.prev-next a:hover {
  color: var(--link);
}

.prev-next .next {
  text-align: right;
  margin-left: auto;
}

/* Content blocks */
.content-block { margin-bottom: 1rem; }
.content-block p:last-child { margin-bottom: 0; }

.description {
  font-style: italic;
  color: var(--text-muted);
  margin: 1.7rem 0;
}

/* Nested sections (for nested f:arb) */
.nested-section {
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}
.nested-section h2:first-child,
.nested-section h3:first-child {
  margin-top: 0;
}

/* Refs */
a.ref { text-decoration: none; border-bottom: 1px solid var(--link); }
a.ref:hover { border-bottom-color: var(--link-hover); }
.broken-ref { color: var(--text-muted); }
a.external::after { content: ' ↗'; font-size: 0.75em; }

/* Section items (sub-sections with descriptions) */
.section-item {
  margin: 0.75rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
}

.section-item .section-link {
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
}

.section-item .section-link:hover {
  color: var(--link);
}

.section-item .section-desc {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

/* Footnotes */
.footnote {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.875rem 1rem;
  background: var(--bg-alt);
  margin: 1rem 0;
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
}

/* Horizontal rule - fleur de lis divider */
hr, hr.cut {
  border: none;
  height: auto;
  margin: 2.5rem 0;
  text-align: center;
  overflow: visible;
}

hr::before, hr.cut::before {
  content: '+';
  display: block;
  color: var(--text-muted);
  font-size: 1.5rem;
}

/* ==========================================================================
   Tables
   ========================================================================== */

table {
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
  width: 100%;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

th, td {
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
th { background: var(--bg-alt); font-weight: 600; }

/* ==========================================================================
   Images
   ========================================================================== */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

p > a > img,
p > img {
  margin: 1rem 0;
}

/* Clickable image links */
a > img {
  border: none;
}

/* ==========================================================================
   Children list
   ========================================================================== */

.children-list {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.children-list h2 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  margin-top: 0;
}

.children-list ul {
  list-style: none;
}

.children-list li {
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
}
.children-list li:last-child { border-bottom: none; }

.children-list li a {
  font-weight: 500;
  text-decoration: none;
  font-size: 1rem;
}
.children-list li a:hover { text-decoration: underline; }

.children-list li time {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.children-list li p {
  margin: 0.375rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   Related content
   ========================================================================== */

.related {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--bg-alt);
  font-size: 0.9rem;
  border-radius: 4px;
}

.related-group {
  margin-bottom: 1rem;
}
.related-group:last-child { margin-bottom: 0; }

.related h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.related ul { list-style: none; }
.related li { margin-bottom: 0.375rem; }
.related a { padding: 0.25rem 0; display: inline-block; }

/* ==========================================================================
   Prev/Next navigation
   ========================================================================== */

.prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.prev-next a {
  display: block;
  text-decoration: none;
  padding: 0.5rem 0;
}

.prev-next .prev { text-align: left; }
.prev-next .next { text-align: right; }

.prev-next .label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.prev-next .title {
  color: var(--link);
  word-wrap: break-word;
}
.prev-next a:hover .title { text-decoration: underline; }

/* ==========================================================================
   Home page
   ========================================================================== */

.home-columns {
  display: block;
}

.recent-section {
  margin-bottom: 2.5rem;
}

.browse-section {
  padding-left: 1rem;
}

.recent-section h1,
.browse-section h2 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Recent posts - uses same article styles as single pages */
.recent-posts {
  list-style: none;
}

.recent-posts li {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}
.recent-posts li:first-child { padding-top: 0; }
.recent-posts li:last-child { border-bottom: none; }

/* Make h2 titles in home posts match h1 article titles */
.recent-posts .article-header h2 {
  font-size: 2.25rem;
  margin: 0 0 0.5rem;
  line-height: 1.15;
}

.recent-posts .article-header h2 a {
  color: var(--text);
  text-decoration: none;
}
.recent-posts .article-header h2 a:hover {
  color: var(--link);
}

/* ==========================================================================
   Hierarchy navigation
   ========================================================================== */

.hierarchy-nav ul {
  list-style: none;
}

.hierarchy-nav > ul > li {
  border-bottom: 1px solid var(--border);
}

.hierarchy-nav li {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  padding: 0.5rem 0;
}

.hierarchy-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.375rem 0.5rem;
  flex: 1;
  min-width: 0;
  border-radius: 4px;
}
.hierarchy-nav a:hover {
  color: var(--link);
  background: var(--bg-alt);
}

/* Toggle button - always visible for expandable items */
.hierarchy-nav .toggle {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.25rem;
  transition: background 0.15s, border-color 0.15s;
}
.hierarchy-nav .toggle:hover {
  background: var(--border);
  border-color: var(--text-muted);
}
.hierarchy-nav .toggle[aria-expanded="true"] {
  background: var(--link);
  border-color: var(--link);
  color: var(--bg);
}
.hierarchy-nav .toggle .arrow {
  display: block;
  line-height: 1;
}

/* Placeholder for items without children */
.hierarchy-nav .no-toggle {
  width: 2rem;
  flex-shrink: 0;
  margin-right: 0.25rem;
}

/* Nested levels */
.hierarchy-nav ul ul {
  width: 100%;
  padding-left: 0.75rem;
  margin-top: 0.25rem;
  border-left: 2px solid var(--border);
  margin-left: 0.875rem;
}

.hierarchy-nav ul ul li {
  padding: 0.35rem 0;
  border-bottom: none;
}

.hierarchy-nav ul ul a {
  font-size: 0.9rem;
}

/* Dropdown hierarchy nav */
.dropdown-hierarchy {
  padding: 0.5rem;
}

.dropdown-hierarchy ul {
  list-style: none;
}

.dropdown-hierarchy > ul > li {
  border-bottom: 1px solid var(--border);
}
.dropdown-hierarchy > ul > li:last-child {
  border-bottom: none;
}

.dropdown-hierarchy li {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  padding: 0.375rem 0;
}

.dropdown-hierarchy a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.375rem 0.5rem;
  flex: 1;
  min-width: 0;
  border-radius: 4px;
  border-bottom: none;
  white-space: normal;
  min-height: auto;
}
.dropdown-hierarchy a:hover {
  color: var(--link);
  background: var(--bg-alt);
}
.dropdown-hierarchy a.current {
  background: var(--link);
  color: var(--bg);
}
.dropdown-hierarchy a.ancestor {
  background: var(--bg-alt);
  font-weight: 500;
}

.dropdown-hierarchy .toggle {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 0.7rem;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.25rem;
}
.dropdown-hierarchy .toggle:hover {
  background: var(--border);
  border-color: var(--text-muted);
}
.dropdown-hierarchy .toggle[aria-expanded="true"] {
  background: var(--link);
  border-color: var(--link);
  color: var(--bg);
}

.dropdown-hierarchy .no-toggle {
  width: 1.75rem;
  flex-shrink: 0;
  margin-right: 0.25rem;
}

.dropdown-hierarchy ul ul {
  width: 100%;
  padding-left: 0.5rem;
  margin-top: 0.25rem;
  border-left: 2px solid var(--border);
  margin-left: 0.75rem;
}

.dropdown-hierarchy ul ul li {
  padding: 0.25rem 0;
  border-bottom: none;
}

.dropdown-hierarchy ul ul a {
  font-size: 0.85rem;
}

/* ==========================================================================
   Focus states
   ========================================================================== */

:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ==========================================================================
   Tablet and up (min-width: 600px)
   ========================================================================== */

@media (min-width: 600px) {
  html { font-size: 18px; }

  .masthead { padding: 1rem 1.5rem; }
  main { padding: 2rem 0; }
  footer { padding: 1.5rem 0; }

  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.875rem; }
  h3 { font-size: 1.375rem; }

  .children-list li time {
    display: inline-block;
    margin-top: 0;
    margin-left: 0.5rem;
  }
}

/* ==========================================================================
   Desktop (min-width: 900px)
   ========================================================================== */

@media (min-width: 900px) {
  .home-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }

  .recent-section {
    margin-bottom: 0;
  }

  .browse-section {
    padding-left: 0;
  }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  header, footer, .site-nav, .breadcrumbs,
  .prev-next, .related, .hierarchy-nav { display: none; }

  main { max-width: none; padding: 0; }

  body { font-size: 12pt; line-height: 1.5; }

  a { color: inherit; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; }

  img { max-width: 4in; }
}

/* ==========================================================================
   TOC Browser
   ========================================================================== */

.toc-browser {
  --toc-bg: var(--bg);
  --toc-text: var(--text);
  --toc-text-muted: var(--text-muted);
  --toc-border: var(--border);
  --toc-link: var(--link);
  --toc-link-hover: var(--link-hover);
  --toc-highlight-bg: #fff3cd;
  --toc-highlight-border: #ffc107;
  --toc-hover-bg: var(--bg-alt);
  --toc-toggle-bg: var(--bg-alt);
  --toc-toggle-hover: var(--border);
  --toc-toggle-active: var(--link);
  --toc-indent: 1.25rem;

  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--toc-text);
  background: var(--toc-bg);
  border: 1px solid var(--toc-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}

@media (prefers-color-scheme: dark) {
  .toc-browser {
    --toc-highlight-bg: #3d3000;
  }
}

.toc-controls {
  padding: 12px;
  border-bottom: 1px solid var(--toc-border);
  background: var(--toc-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.toc-search { margin-bottom: 8px; }

.toc-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--toc-border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--toc-bg);
  color: var(--toc-text);
  outline: none;
}

.toc-search-input:focus {
  border-color: var(--toc-link);
  box-shadow: 0 0 0 2px rgba(0, 85, 170, 0.1);
}

.toc-search-input::placeholder { color: var(--toc-text-muted); }

.toc-filters { display: flex; gap: 8px; }

.toc-sort, .toc-subject {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--toc-border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--toc-bg);
  color: var(--toc-text);
  cursor: pointer;
}

.toc-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
}

.toc-tree, .toc-children, .toc-years, .toc-year-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-node { position: relative; }

.toc-node-row {
  display: flex;
  align-items: center;
  padding: 4px 0;
  border-radius: 4px;
}

.toc-node-row:hover { background: var(--toc-hover-bg); }

.toc-node.highlighted > .toc-node-row {
  background: var(--toc-highlight-bg);
  border-left: 3px solid var(--toc-highlight-border);
  margin-left: -3px;
  padding-left: 3px;
}

.toc-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  margin-right: 4px;
  border: none;
  border-radius: 4px;
  background: var(--toc-toggle-bg);
  color: var(--toc-text);
  font-size: 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.toc-toggle:hover { background: var(--toc-toggle-hover); }
.toc-toggle[aria-expanded="true"] { background: var(--toc-toggle-active); color: white; }

.toc-arrow { display: block; line-height: 1; }

.toc-no-toggle {
  width: 24px;
  height: 24px;
  margin-right: 4px;
  flex-shrink: 0;
}

.toc-link {
  color: var(--toc-text);
  text-decoration: none;
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toc-link:hover { color: var(--toc-link); text-decoration: underline; }
.toc-node.highlighted .toc-link { font-weight: 600; }

.toc-children {
  margin-left: var(--toc-indent);
  padding-left: 8px;
  border-left: 1px solid var(--toc-border);
}

.toc-year-group { margin-bottom: 4px; }

.toc-year-header {
  display: flex;
  align-items: center;
  padding: 8px 4px;
  border-radius: 4px;
  cursor: pointer;
}

.toc-year-header:hover { background: var(--toc-hover-bg); }

.toc-year-label {
  font-weight: 600;
  font-size: 15px;
  margin-right: 8px;
}

.toc-year-count {
  color: var(--toc-text-muted);
  font-size: 12px;
}

.toc-year-items {
  margin-left: var(--toc-indent);
  padding-left: 8px;
  border-left: 1px solid var(--toc-border);
}

.toc-date-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 4px;
}

.toc-date-item:hover { background: var(--toc-hover-bg); }

.toc-date-item.highlighted {
  background: var(--toc-highlight-bg);
  border-left: 3px solid var(--toc-highlight-border);
  margin-left: -3px;
}

.toc-date-item .toc-link {
  flex: 1;
  min-width: 0;
  padding: 0;
}

.toc-date {
  color: var(--toc-text-muted);
  font-size: 12px;
  margin-left: 8px;
  flex-shrink: 0;
}

.toc-empty, .toc-loading {
  padding: 24px;
  text-align: center;
  color: var(--toc-text-muted);
}

