*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-primary: #1a2744;
  --color-primary-light: #2c4470;
  --color-accent: #c5a254;
  --color-accent-warm: #b85c38;
  --color-bg: #f7f6f3;
  --color-surface: #ffffff;
  --color-border: #e2e0db;
  --color-text: #1e1e1e;
  --color-text-secondary: #5a5a5a;
  --color-high: #2e7d32;
  --color-medium: #f9a825;
  --color-low: #757575;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.1);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --max-width: 1200px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════
   HEADER — Odisha Ace branded
   ═══════════════════════════════════════════════════ */

.site-header {
  background: var(--color-primary);
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(26, 39, 68, 0.25);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  padding-bottom: 10px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
}

.site-logo:hover {
  text-decoration: none;
  opacity: 0.92;
}

.logo-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: contain;
  background: white;
  padding: 2px;
}

.logo-text {
  letter-spacing: 0.02em;
}

.logo-accent {
  color: var(--color-accent);
}

.site-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-link {
  color: rgba(255, 255, 255, 0.85);
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  margin: 5px 0;
  border-radius: 2px;
  transition: 0.3s;
}

/* ═══════════════════════════════════════════════════
   HOMEPAGE
   ═══════════════════════════════════════════════════ */

/* Ad Banner */
.ad-bar {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 12px 20px;
  background: #edecea;
}

.ad-slot {
  flex: 1;
  max-width: 460px;
  min-height: 70px;
  background: #d8d6d1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-placeholder {
  font-size: 0.78rem;
  color: #8a877f;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Marquee Banner */
.marquee-bar {
  background: var(--color-primary);
  overflow: hidden;
  padding: 8px 0;
  white-space: nowrap;
}

.marquee-track {
  display: inline-flex;
  animation: marqueeScroll 40s linear infinite;
}

.marquee-text {
  font-size: 0.82rem;
  color: var(--color-accent);
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0 2em;
}

@keyframes marqueeScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Home Hero */
.home-hero {
  padding: 52px 0 40px;
  background: var(--color-bg);
}

.home-split {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 260px;
}

.home-left {
  flex: 1.3;
  display: flex;
  align-items: center;
  padding-right: 40px;
}

.home-divider {
  width: 1px;
  background: var(--color-border);
  flex-shrink: 0;
}

.home-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding-left: 40px;
}

/* Search Card */
.home-search-card {
  width: 100%;
  position: relative;
}

.home-search-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.home-search-desc {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
}

.home-search-wrap {
  display: flex;
  align-items: center;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 28px;
  padding: 12px 20px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.home-search-wrap:focus-within {
  border-color: var(--color-primary-light);
  box-shadow: 0 4px 20px rgba(26, 39, 68, 0.1);
}

.home-search-icon {
  width: 20px;
  height: 20px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
  margin-right: 12px;
}

.home-search-wrap:focus-within .home-search-icon {
  color: var(--color-primary-light);
}

.home-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  font-family: var(--font);
  color: var(--color-text);
}

.home-search-input::placeholder {
  color: #b5b3ae;
}

/* Search Results Dropdown */
.home-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  z-index: 50;
}

.hsr-item {
  display: block;
  padding: 12px 18px;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid #f2f1ee;
  transition: background 0.15s;
}

.hsr-item:hover {
  background: #f7f6f3;
  text-decoration: none;
}

.hsr-item strong {
  display: block;
  font-size: 0.92rem;
  color: var(--color-primary);
  margin-bottom: 2px;
}

.hsr-item span {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.hsr-empty {
  padding: 20px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--color-text-secondary);
}

.hsr-section {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  background: #e8e6e1;
  color: var(--color-text-secondary);
  padding: 1px 8px;
  border-radius: 8px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

.hsr-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
  margin-top: 2px;
}

/* Navigation Buttons */
.home-nav-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  color: var(--color-text);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: var(--shadow);
}

.home-nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary-light);
  text-decoration: none;
}

.home-nav-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.home-nav-label {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
}

.home-nav-sub {
  display: none;
}

/* Explore Topics */
.home-explore {
  padding: 32px 0 64px;
}

.card-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

/* Footer */
.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 1rem;
}

.footer-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  object-fit: contain;
  padding: 1px;
}

/* ── Homepage responsive ── */
@media (max-width: 768px) {
  .ad-bar {
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }

  .ad-slot {
    max-width: 100%;
    width: 100%;
    min-height: 60px;
  }

  .home-split {
    flex-direction: column;
    gap: 28px;
  }

  .home-left {
    padding-right: 0;
  }

  .home-divider {
    width: 100%;
    height: 1px;
  }

  .home-right {
    padding-left: 0;
    flex-direction: row;
    gap: 12px;
  }

  .home-nav-btn {
    flex: 1;
    flex-direction: column;
    text-align: center;
    padding: 16px;
  }

  .home-search-title {
    font-size: 1.3rem;
  }
}

/* Category Grid */
.category-grid {
  padding: 56px 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--color-primary);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.category-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
  color: var(--color-text);
  text-decoration: none;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  border-color: var(--color-primary-light);
}

.card-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 12px;
}

.category-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-primary);
}

.category-card p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

.card-arrow {
  font-weight: 600;
  color: var(--color-primary-light);
  font-size: 0.875rem;
}

/* Section Cards (homepage) */
.section-grid {
  padding: 56px 0;
}

.section-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
  color: var(--color-text);
  text-decoration: none;
}

.section-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  border-color: var(--color-primary-light);
}

.section-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-primary);
}

.section-card p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

/* Notes List */
.notes-section {
  padding: 40px 0 64px;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.note-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

.note-card:hover {
  box-shadow: var(--shadow-lg);
}

.note-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.note-card h3 a {
  color: var(--color-primary);
  text-decoration: none;
}

.note-card h3 a:hover {
  color: var(--color-primary-light);
}

.note-card p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.note-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
}

.note-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  padding: 2px 10px;
  background: #e8eaf6;
  color: var(--color-primary);
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}

.reading-time {
  font-style: italic;
}

.read-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary-light);
}

/* Note Article (single note) */
.note-article {
  padding-bottom: 64px;
}

.note-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
  padding: 40px 20px 32px;
}

.note-header .back-link {
  color: rgba(255, 255, 255, 0.75);
}

.note-header .back-link:hover {
  color: white;
}

.note-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.3;
}

.note-header .note-meta {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
}

.note-header .tag {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

.container-narrow {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 20px;
}

.note-content {
  padding: 48px 0;
}

.note-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 2em 0 0.6em;
  padding-bottom: 8px;
  border-bottom: 2px solid #ddd9d2;
}

.note-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.6em 0 0.5em;
  color: var(--color-primary-light);
}

.note-content p {
  margin-bottom: 1.1em;
  line-height: 1.75;
  font-size: 1rem;
}

.note-content ul,
.note-content ol {
  margin-bottom: 1.1em;
  padding-left: 1.5em;
}

.note-content li {
  margin-bottom: 0.4em;
  line-height: 1.7;
}

.note-content a {
  color: var(--color-primary-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.note-content strong {
  color: var(--color-primary);
}

.note-content blockquote {
  border-left: 4px solid var(--color-primary-light);
  padding: 12px 20px;
  margin: 1.5em 0;
  background: #f5f7ff;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #444;
}

.note-content blockquote p:last-child {
  margin-bottom: 0;
}

.note-content code {
  background: #f0f0f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  color: #c62828;
}

.note-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 20px 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5em 0;
  line-height: 1.5;
  font-size: 0.875rem;
}

.note-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.note-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
}

.note-content th {
  background: #f5f5f5;
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid var(--color-border);
}

.note-content td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
}

.note-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2em 0;
}

.note-content img {
  max-width: 100%;
  border-radius: var(--radius);
}

/* KaTeX overrides */
.katex-display {
  margin: 1.5em 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
}

.katex {
  font-size: 1.1em !important;
}

/* Page Header */
.page-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
  padding: 40px 20px 32px;
}

.back-link {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-block;
  margin-bottom: 12px;
}

.back-link:hover {
  color: white;
}

.page-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.page-description {
  font-size: 1rem;
  opacity: 0.85;
  max-width: 640px;
}

.result-count {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 12px;
}

/* Filter Bar */
.table-section {
  padding: 32px 0 64px;
}

.filter-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  background: var(--color-surface);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  flex: 1;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}

.filter-group input,
.filter-group select {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: var(--font);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 2px rgba(57, 73, 171, 0.2);
}

.filter-reset {
  min-width: auto;
  flex: 1;
  justify-content: flex-end;
}

.btn-reset {
  padding: 8px 20px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-reset:hover {
  background: #f5f5f5;
  border-color: #bdbdbd;
}

/* Table */
.table-wrapper {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
  overflow-y: visible;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 800px;
}

.data-table th {
  background: #f5f5f5;
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.data-table th:hover {
  background: #eeeeee;
}

.data-table th .sort-icon {
  font-size: 0.6rem;
  margin-left: 4px;
  opacity: 0.4;
  vertical-align: middle;
}

.data-table th.sorted-asc .sort-icon,
.data-table th.sorted-desc .sort-icon {
  opacity: 1;
  color: var(--color-primary-light);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.15s;
}

.data-table tbody tr:hover {
  background: #f8f9ff;
}

.data-table tbody tr.hidden {
  display: none;
}

.cell-name {
  font-weight: 600;
  white-space: nowrap;
}

.cell-url {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-url a {
  font-size: 0.85rem;
}

.external-icon {
  font-size: 0.7rem;
  opacity: 0.5;
}

.cell-desc {
  max-width: 320px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-type {
  background: #e8eaf6;
  color: var(--color-primary);
}

.badge-high {
  background: #e8f5e9;
  color: var(--color-high);
}

.badge-medium {
  background: #fff8e1;
  color: #c17900;
}

.badge-low {
  background: #f5f5f5;
  color: var(--color-low);
}

/* No Results */
.no-results {
  text-align: center;
  padding: 48px 20px;
  color: var(--color-text-secondary);
}

.no-results p {
  font-size: 1rem;
}

/* Notes empty state */
.no-notes {
  text-align: center;
  padding: 48px 20px;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

/* Footer */
.site-footer {
  background: var(--color-primary);
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  padding: 32px 20px;
  margin-top: auto;
  font-size: 0.85rem;
}

.footer-small {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-top: 6px;
}

/* Responsive */
@media (max-width: 768px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-primary);
    flex-direction: column;
    padding: 12px 20px 20px;
    box-shadow: var(--shadow-lg);
  }

  .site-nav.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .hero {
    padding: 48px 20px 40px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-group {
    min-width: 100%;
  }

  .page-header {
    padding: 32px 20px 24px;
  }

  .page-header h1 {
    font-size: 1.4rem;
  }

  .data-table {
    font-size: 0.8rem;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
  }
}

/* ═══════════════════════════════════════════════════
   SEARCH / FILTER BAR
   ═══════════════════════════════════════════════════ */

.sf-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 12px 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
  flex-wrap: wrap;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.sf-bar:focus-within {
  border-color: var(--color-primary-light);
  box-shadow: 0 4px 18px rgba(57, 73, 171, 0.1);
}

/* Search input wrapper */
.sf-search-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 200px;
  position: relative;
}

.sf-search-icon {
  width: 18px;
  height: 18px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
  margin-right: 10px;
  transition: color 0.2s ease;
}

.sf-bar:focus-within .sf-search-icon {
  color: var(--color-primary-light);
}

.sf-search {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.92rem;
  font-family: var(--font);
  color: var(--color-text);
  padding: 4px 0;
  min-width: 0;
}

.sf-search::placeholder {
  color: #b0b0b0;
  font-weight: 400;
}

.sf-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: #e8eaf6;
  color: var(--color-primary);
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.15s ease;
  line-height: 1;
}

.sf-clear:hover {
  background: var(--color-primary-light);
  color: white;
  transform: scale(1.1);
}

/* Tag dropdown */
.sf-tag-wrap {
  flex-shrink: 0;
}

.sf-select {
  padding: 7px 32px 7px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 0.82rem;
  font-family: var(--font);
  font-weight: 500;
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' stroke='%23616161' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.sf-select:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 2px rgba(57, 73, 171, 0.15);
}

.sf-select:hover {
  border-color: #bdbdbd;
}

/* Status count */
.sf-status {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 20px;
}

.sf-status-active #sf-count {
  display: inline-block;
  background: #e8eaf6;
  color: var(--color-primary);
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.72rem;
  animation: sfPulse 0.3s ease;
}

@keyframes sfPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

/* No results message */
.sf-no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-secondary);
}

.sf-no-results p {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.sf-no-hint {
  font-size: 0.85rem !important;
  font-weight: 400 !important;
  opacity: 0.7;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .sf-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }

  .sf-search-wrap {
    min-width: 100%;
  }

  .sf-tag-wrap {
    width: 100%;
  }

  .sf-select {
    width: 100%;
  }

  .sf-status {
    text-align: center;
  }
}

/* ═══════════════════════════════════════════════════
   TIMELINE — Premium chronological event display
   ═══════════════════════════════════════════════════ */

.timeline-section {
  padding: 40px 0 80px;
}

.timeline-section .result-count {
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
}

.timeline {
  position: relative;
  padding: 12px 0 32px;
}

/* ── Vertical ruler line ── */
.tl-ruler {
  position: absolute;
  left: 112px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #c5cae9 0%, var(--color-primary-light) 15%, var(--color-primary-light) 85%, #c5cae9 100%);
  border-radius: 2px;
  z-index: 0;
}

/* Subtle glow aura around the ruler */
.tl-ruler::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 0;
  bottom: 0;
  width: 12px;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(57, 73, 171, 0.08) 15%,
    rgba(57, 73, 171, 0.08) 85%,
    transparent 100%
  );
  border-radius: 6px;
}

/* ── Each timeline item ── */
.tl-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  margin-bottom: 24px;
  min-height: 44px;
  padding-left: 160px;
  /* JS will animate these */
  will-change: opacity, transform;
}

/* ── Year label (left of ruler) ── */
.tl-date {
  position: absolute;
  left: 0;
  top: 10px;
  width: 96px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--color-primary);
  white-space: nowrap;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

/* ── Dot on the ruler ── */
.tl-dot {
  position: absolute;
  left: 105px;
  top: 11px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 3.5px solid var(--color-primary-light);
  box-shadow: 0 0 0 3px var(--color-bg);
  z-index: 2;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

/* Active dot pulse ring */
.tl-item.tl-active .tl-dot {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-bg),
              0 0 0 6px rgba(57, 73, 171, 0.15);
}

/* ── Connector line (dot → card) ── */
.tl-connector {
  position: absolute;
  left: 123px;
  top: 19px;
  width: 32px;
  height: 2px;
  background: var(--color-primary-light);
  opacity: 0.35;
  z-index: 1;
  border-radius: 1px;
  transition: opacity 0.3s ease;
}

.tl-item.tl-active .tl-connector {
  opacity: 0.7;
}

/* ── Content card ── */
.tl-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-primary-light);
  border-radius: 8px;
  padding: 16px 20px 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  position: relative;
  flex: 1;
  transition: box-shadow 0.3s ease,
              border-color 0.3s ease,
              transform 0.2s ease;
}

.tl-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  border-left-color: var(--color-primary);
  transform: translateX(2px);
}

/* ── Card typography ── */
.tl-title {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 1rem;
  line-height: 1.35;
}

.tl-title a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.tl-title a:hover {
  color: var(--color-primary-light);
  text-decoration: none;
}

.tl-desc {
  font-size: 0.84rem;
  color: var(--color-text-secondary);
  margin-bottom: 10px;
  line-height: 1.5;
}

.tl-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tl-tag {
  display: inline-block;
  padding: 3px 10px;
  background: #e8eaf6;
  color: var(--color-primary);
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.2s ease;
}

.tl-card:hover .tl-tag {
  background: #c5cae9;
}

/* ── Responsive: Tablet ── */
@media (max-width: 900px) {
  .tl-ruler {
    left: 88px;
  }
  .tl-item {
    padding-left: 130px;
  }
  .tl-date {
    width: 74px;
  }
  .tl-dot {
    left: 81px;
    width: 16px;
    height: 16px;
  }
  .tl-connector {
    left: 97px;
    top: 18px;
    width: 28px;
  }
}

/* ── Responsive: Mobile ── */
@media (max-width: 600px) {
  .tl-ruler {
    left: 58px;
  }

  .tl-item {
    padding-left: 96px;
    margin-bottom: 18px;
  }

  .tl-dot {
    left: 51px;
    top: 10px;
    width: 14px;
    height: 14px;
    border-width: 3px;
  }

  .tl-connector {
    left: 65px;
    top: 16px;
    width: 24px;
  }

  .tl-date {
    left: 0;
    width: 48px;
    font-size: 0.68rem;
    top: 9px;
  }

  .tl-card {
    padding: 12px 14px 10px;
    border-left-width: 2px;
  }

  .tl-title {
    font-size: 0.9rem;
  }

  .tl-desc {
    font-size: 0.78rem;
  }

  .tl-tag {
    font-size: 0.62rem;
    padding: 2px 8px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 14px;
  }

  .site-logo {
    font-size: 1.25rem;
  }

  .hero h1 {
    font-size: 1.3rem;
  }

  .category-card,
  .section-card {
    padding: 20px 16px;
  }
}