/* ============================================================
   VASCRM Help Center — Public Styles
   Premium dark-mode design
   ============================================================ */

@import './variables.css';

/* --- Public-Specific Variables --- */
:root {
  --leading: 1.6;
  --space-3xl: 4rem;
  --container-max: 1200px;
  --content-max: 800px;
  --sidebar-right-width: 280px;
  --header-height: 64px;
  --bg-header: rgba(17, 17, 17, 0.85);
}

[data-theme="light"] {
  --bg-header: rgba(255, 255, 255, 0.85);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: var(--leading);
  color: var(--text-primary);
  background-color: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition-fast);
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

::selection {
  background: var(--accent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dark);
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* --- Header (sticky) --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  height: var(--header-height);
}

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  flex-shrink: 0;
}
.header-brand:hover {
  text-decoration: none;
}

.header-logo {
  height: 28px;
  width: auto;
}
[data-theme="light"] .header-logo {
  filter: none;
}

.header-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.header-brand:hover .header-title {
  color: var(--text-primary);
}

.header-search {
  flex: 1;
  max-width: 440px;
}
.header-search--hidden {
  display: none;
}

/* --- Search Input --- */
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.search-input-wrap input {
  width: 100%;
  padding: 10px 16px 10px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: var(--transition);
}
.search-input-wrap input::placeholder {
  color: var(--text-muted);
}
.search-input-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input-wrap--lg input {
  padding: 14px 20px 14px 52px;
  font-size: 1.05rem;
  border-radius: 100px;
}
.search-input-wrap--lg .search-icon {
  left: 18px;
}

/* --- Live Search Dropdown --- */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 200;
  overflow: hidden;
  max-height: 380px;
  overflow-y: auto;
}

.search-dropdown-item {
  display: block;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition-fast);
  border-bottom: 1px solid var(--border-subtle);
}
.search-dropdown-item:last-child {
  border-bottom: none;
}
.search-dropdown-item:hover,
.search-dropdown-item:focus {
  background: var(--bg-hover);
  text-decoration: none;
  color: var(--text-primary);
}

.search-dropdown-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.search-dropdown-snippet {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-dropdown-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, var(--accent-glow-subtle) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: var(--space-sm);
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.hero-search {
  max-width: 560px;
  margin: 0 auto;
}

/* --- Sections --- */
.section {
  padding: var(--space-2xl) 0;
}

.section--alt {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: var(--space-lg);
}

.section-subtitle + .card-grid {
  margin-top: var(--space-md);
}

/* --- Card Grid --- */
.card-grid {
  display: grid;
  gap: var(--space-lg);
}

.card-grid--3 {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.card-grid--4 {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.card-grid--2 {
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}

/* --- Cards (base) --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
}
a.card:hover,
.card:hover {
  text-decoration: none;
  color: inherit;
}

/* --- Category Card --- */
.category-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
a.category-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--accent-glow);
}

.category-card--featured {
  border-color: var(--accent);
  position: relative;
  box-shadow: 0 0 0 1px rgba(255, 107, 0, 0.3), 0 4px 16px rgba(255, 107, 0, 0.1);
  border-left: 3px solid var(--accent);
}

.category-card--featured::before {
  content: "\2605  Featured";
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(255, 107, 0, 0.12);
  padding: 3px 10px;
  border-radius: 4px;
}

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow-subtle);
  border-radius: var(--radius);
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.card-icon--sm {
  width: 36px;
  height: 36px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.card-meta {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--bg-hover);
  color: var(--text-muted);
}

.badge--sm {
  font-size: 0.7rem;
  padding: 2px 8px;
}

.badge--video {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}
.badge--video svg {
  width: 12px;
  height: 12px;
}

/* --- Folder Card --- */
.folder-card {
  padding: 0;
  overflow: hidden;
}

.folder-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}
.folder-card-header:hover {
  background: var(--bg-hover);
  text-decoration: none;
  color: inherit;
}
.folder-card-header .card-title {
  flex: 1;
}

.folder-quick-links {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-sm) var(--space-lg) var(--space-lg);
}
.folder-quick-links li + li {
  margin-top: 2px;
}
.folder-quick-links a {
  display: block;
  padding: 6px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition-fast);
}
.folder-quick-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* --- Article List (home popular) --- */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.article-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}
.article-list-item:hover {
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
}

.article-list-content {
  flex: 1;
  min-width: 0;
}

.article-list-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.article-list-snippet {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.article-list-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition-fast);
}
.article-list-item:hover .article-list-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* --- Article Card List (folder page) --- */
.article-card-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.article-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
}
a.article-card:hover {
  border-color: var(--border-emphasis);
  background: var(--bg-hover);
}
a.article-card:hover .article-list-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

.article-card-body {
  flex: 1;
  min-width: 0;
}

.article-card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 4px;
}

.article-card-snippet {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-footer {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
}

.article-card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* --- Folder Layout (sidebar + content) --- */
.folder-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: var(--space-xl);
  margin-top: var(--space-lg);
}

.folder-sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-lg));
  align-self: start;
  max-height: calc(100vh - var(--header-height) - var(--space-xl));
  overflow-y: auto;
}

.sidebar-heading {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.sidebar-list li + li {
  margin-top: 1px;
}

.sidebar-link {
  display: block;
  padding: 8px 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-radius: var(--radius);
  border-left: 2px solid transparent;
  transition: var(--transition-fast);
}
.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  text-decoration: none;
}
.sidebar-link--active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-glow-subtle);
  font-weight: 500;
}

/* --- Article Layout (content + right sidebar) --- */
.article-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-right-width);
  gap: var(--space-xl);
  margin-top: var(--space-lg);
}

.article-main {
  max-width: var(--content-max);
  min-width: 0;
}

.article-header {
  margin-bottom: var(--space-xl);
}

.article-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.article-date {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

.article-sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-lg));
  align-self: start;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.sidebar-card .sidebar-heading {
  margin-bottom: var(--space-md);
}

.sidebar-card .sidebar-list li + li {
  margin-top: 0;
}

.sidebar-card .sidebar-link {
  padding: 8px 0;
  border-left: none;
  border-radius: 0;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar-card .sidebar-link:last-child {
  border-bottom: none;
}
.sidebar-card .sidebar-link:hover {
  color: var(--accent);
  background: transparent;
}

/* --- Theme Toggle --- */
.theme-toggle {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
[data-theme="dark"] .theme-icon--light { display: none; }
[data-theme="light"] .theme-icon--dark { display: none; }

/* --- Video Cards --- */
.video-guides-section {
  margin-bottom: var(--space-xl);
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}
.video-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--accent-glow);
}

.video-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}
.video-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.video-card:hover .video-card-thumb img {
  transform: scale(1.05);
}
.video-card-thumb--loom {
  background: linear-gradient(135deg, #4f46e5 0%, #f97316 100%);
}
.video-card-thumb--generic {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  transition: background 0.2s ease;
}
.video-card:hover .video-card-play {
  background: rgba(0, 0, 0, 0.2);
}
.video-card-play svg {
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
  transition: transform 0.2s ease;
}
.video-card:hover .video-card-play svg {
  transform: scale(1.15);
  color: var(--accent);
}

.video-card-info {
  padding: var(--space-md);
}

.video-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

/* --- Video Embed --- */
.article-videos {
  margin-bottom: var(--space-xl);
}

.video-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  margin-bottom: var(--space-md);
}
.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* --- Prose (Article Body) --- */
.prose {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.prose h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.prose h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.01em;
}

.prose h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.prose h4, .prose h5, .prose h6 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.prose p {
  margin-bottom: var(--space-md);
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prose a:hover {
  color: var(--accent-hover);
}

.prose strong {
  color: var(--text-primary);
  font-weight: 600;
}

.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin-bottom: var(--space-md);
}
.prose ul {
  list-style: disc;
}
.prose ol {
  list-style: decimal;
}
.prose li {
  margin-bottom: 4px;
}
.prose li::marker {
  color: var(--text-muted);
}

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: var(--space-sm) var(--space-lg);
  margin: var(--space-md) 0;
  font-style: italic;
  color: var(--text-secondary);
  background: var(--accent-glow-subtle);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-surface);
  color: var(--accent-hover);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.prose pre {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  overflow-x: auto;
  margin: var(--space-md) 0;
}
.prose pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.prose img {
  border-radius: var(--radius-md);
  margin: var(--space-md) 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
  font-size: 0.9rem;
}
.prose th, .prose td {
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  text-align: left;
}
.prose th {
  background: var(--bg-hover);
  color: var(--text-primary);
  font-weight: 600;
}
.prose tr:nth-child(even) td {
  background: var(--bg-hover);
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-xl) 0;
}

/* --- Breadcrumb --- */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  padding-top: var(--space-lg);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.breadcrumb a {
  color: var(--accent);
}
.breadcrumb a:hover {
  text-decoration: underline;
}
.breadcrumb-sep {
  color: var(--text-muted);
  margin: 0 2px;
}
.breadcrumb-current {
  color: var(--text-secondary);
}

/* --- Page Header --- */
.page-header {
  margin-bottom: var(--space-xl);
}

.page-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-desc {
  color: var(--text-secondary);
  margin-top: var(--space-xs);
  font-size: 1rem;
}

/* --- Search Page --- */
.search-page-form {
  max-width: 600px;
  margin-bottom: var(--space-xl);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.search-result-card {
  padding: var(--space-lg);
}
a.search-result-card:hover {
  border-color: var(--border-emphasis);
  background: var(--bg-hover);
}

.search-result-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.search-result-snippet {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 6px;
}
.search-result-snippet mark {
  background: rgba(255, 107, 0, 0.25);
  color: var(--accent-hover);
  border-radius: 2px;
  padding: 1px 3px;
}

.search-result-path {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--text-muted);
}

.empty-state-icon {
  margin-bottom: var(--space-md);
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

/* --- Video Modal --- */
.video-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  animation: fadeIn 0.2s ease;
}

.video-modal-content {
  position: relative;
  width: 100%;
  max-width: 900px;
}

.video-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 32px;
  height: 32px;
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}
.video-modal-close:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.video-modal-embed {
  position: relative;
  padding-bottom: 56.25%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}
.video-modal-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* --- Footer --- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-xl) 0;
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  text-align: center;
}

.site-footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.site-footer a {
  color: var(--text-secondary);
}
.site-footer a:hover {
  color: var(--accent);
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Responsive: Tablet (1024px) --- */
@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .article-sidebar {
    position: static;
    margin-top: var(--space-xl);
  }
  .folder-layout {
    grid-template-columns: 1fr;
  }
  .folder-sidebar {
    position: static;
    max-height: none;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--space-lg);
    margin-bottom: var(--space-lg);
  }
  .sidebar-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
  }
  .sidebar-list li + li {
    margin-top: 0;
  }
  .sidebar-link {
    padding: 6px 12px;
    border-left: none;
    border-radius: 100px;
    font-size: 0.85rem;
    border: 1px solid var(--border-subtle);
  }
  .sidebar-link--active {
    border-color: var(--accent);
  }
}

/* --- Responsive: Mobile (768px) --- */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  .header-inner {
    padding: 0 var(--space-md);
  }
  .header-title {
    display: none;
  }
  .header-search {
    max-width: none;
  }

  .card-grid--3,
  .card-grid--4,
  .card-grid--2 {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: var(--space-2xl) var(--space-md);
  }
  .hero-title {
    font-size: 1.8rem;
  }
  .hero-subtitle {
    font-size: 0.95rem;
  }

  .container {
    padding: 0 var(--space-md);
  }

  .section {
    padding: var(--space-xl) 0;
  }

  .article-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .article-card-footer {
    width: 100%;
    justify-content: space-between;
    margin-top: var(--space-sm);
  }
}

/* --- Responsive: Small Mobile (480px) --- */
@media (max-width: 480px) {
  body {
    font-size: 14px;
  }
  .hero {
    padding: var(--space-xl) var(--space-sm);
  }
  .hero-title {
    font-size: 1.5rem;
  }
  .search-input-wrap--lg input {
    padding: 12px 16px 12px 44px;
    font-size: 0.95rem;
  }
  .card {
    padding: var(--space-md);
  }
}
