/*
 * Signal Watch - Main Stylesheet
 * A professional news-site design
 */

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

:root {
  --color-primary: #1a1a2e;
  --color-secondary: #16213e;
  --color-accent: #e94560;
  --color-accent-dark: #c73e54;
  --color-text: #333;
  --color-text-light: #666;
  --color-text-muted: #999;
  --color-bg: #fafafa;
  --color-white: #fff;
  --color-border: #e0e0e0;
  --color-border-light: #f0f0f0;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-typewriter: "Special Elite", "Courier New", Courier, monospace;
  --max-width: 1200px;
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
}

html {
  font-size: 16px;
  line-height: 1.6;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-accent-dark);
}

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

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

/* Header */
.site-header {
  background: var(--color-primary) url("/assets/signal_watch-d4fe8625.png") center / cover no-repeat;
  position: relative;
  color: var(--color-white);
  padding: var(--spacing-lg) 0;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 46, 0.82);
  pointer-events: none;
}

.site-header > * {
  position: relative;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--spacing-xl);
}

.masthead {
  flex: 1;
}

.main-nav {
  display: flex;
  gap: var(--spacing-lg);
  align-items: center;
}

.nav-separator {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 var(--spacing-sm);
}


.site-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.site-title a {
  color: var(--color-white);
}

.site-title a:hover {
  color: var(--color-accent);
}

.site-tagline-inline {
  font-size: 0.9rem;
  font-weight: 400;
  font-family: var(--font-sans);
  margin-left: var(--spacing-sm);
  display: inline-block;
  vertical-align: baseline;
  text-transform: lowercase;
}

.site-tagline-inline a {
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s ease;
}

.site-tagline-inline a:hover {
  color: var(--color-white);
  text-decoration: underline;
}

.site-tagline {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: var(--spacing-xs);
}

.main-nav {
  display: flex;
  gap: var(--spacing-lg);
}

.nav-link {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-size: 0.95rem;
  padding: var(--spacing-sm) 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--color-white);
  border-bottom-color: var(--color-accent);
}

.nav-social {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
}

.nav-social-link {
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

.nav-social-link .ph {
  font-size: 20px;
}

.nav-social-link:hover {
  color: var(--color-white);
  transform: translateY(-2px);
}

/* Main Content */
.site-main {
  flex: 1;
  padding: var(--spacing-2xl) 0;
}

/* Landing Page */
.latest-news-section {
  margin-bottom: var(--spacing-2xl);
  overflow: visible;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--spacing-lg);
}

.latest-news-section .section-title {
  margin-bottom: var(--spacing-lg);
}

.landing > .section-title {
  margin-top: var(--spacing-2xl);
}

.content-card-theory-link {
  display: block;
  text-align: right;
  font-size: 0.75rem;
  color: var(--color-accent);
  padding: 0 var(--spacing-md) var(--spacing-sm);
}

.content-card-theory-link:hover {
  color: var(--color-accent-dark);
}

.content-card-theory-tag {
  display: inline-block;
  margin-top: var(--spacing-sm);
  font-size: 0.7rem;
  color: var(--color-accent);
  background: rgba(233, 69, 96, 0.08);
  padding: 2px 8px;
  border-radius: 3px;
  text-decoration: none;
}

.content-card-theory-tag:hover {
  background: rgba(233, 69, 96, 0.15);
}

.content-card-theory-badge {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-white);
  background: var(--color-accent);
  padding: 2px 6px;
  border-radius: 2px;
}

.content-card-theory-tag {
  color: var(--color-accent);
  font-weight: 500;
}

.content-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.featured-badge {
  position: absolute;
  top: 0;
  right: 0;
  font-family: var(--font-typewriter);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 0 0 0 4px;
  color: var(--color-white);
  z-index: 10;
  box-shadow: -2px 2px 4px rgba(0,0,0,0.1);
}

.featured-badge--new { background: #2ecc71; }
.featured-badge--popular { background: var(--color-accent); }
.featured-badge--trending { background: #e67e22; }
.featured-badge--classic { background: var(--color-primary); }

/* Theory Cards */
.theory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--spacing-xl);
  align-items: stretch;
}

.theory-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.theory-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.theory-card--skeleton {
  background: var(--color-border-light);
  border-style: dashed;
  display: flex;
  flex-direction: column;
  min-height: 330px;
}

.theory-card--skeleton .theory-card-body {
  flex: 1;
}

.theory-card--skeleton:hover {
  transform: none;
  box-shadow: none;
}

.skeleton-silhouette {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 180px;
  flex: 1;
  color: var(--color-text-muted);
}

.skeleton-silhouette-icon {
  margin-bottom: var(--spacing-md);
  opacity: 0.4;
}

.skeleton-silhouette-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text-light);
  margin-bottom: var(--spacing-xs);
}

.skeleton-silhouette-text {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.theory-card-body {
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.theory-card-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  margin-bottom: var(--spacing-sm);
}

.theory-card-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--spacing-sm);
}

.theory-card-title a {
  color: var(--color-text);
}

.theory-card-title a:hover {
  color: var(--color-accent);
}

.theory-card-summary {
  color: var(--color-text-light);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: var(--spacing-md);
}

.theory-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--color-border-light);
  margin-top: auto;
}

.theory-card-meta-main {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.theory-podcast-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #1DB954; /* Spotify Green */
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
}

.theory-podcast-link:hover {
  color: #1ed760;
  transform: translateY(-1px);
}

.spotify-icon {
  width: 16px;
  height: 16px;
}

.listen-text {
  display: inline;
}

@media (max-width: 480px) {
  .listen-text {
    display: none;
  }
}

.featured-badge--featured { background: #D4AF37; } /* Gold */

.theory-card--featured {
  border: 1px solid rgba(212, 175, 55, 0.5);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
  background: linear-gradient(135deg, #fffdf2 0%, #ffffff 100%);
}

.theory-card--featured:hover {
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.35);
  border-color: rgba(212, 175, 55, 0.7);
}

.theory-card--podcast {
  background: linear-gradient(135deg, #fffbf0 0%, #fffef8 50%, #fffbf0 100%);
  border-color: rgba(212, 175, 55, 0.3);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.1);
}

.theory-card--podcast:hover {
  background: linear-gradient(135deg, #fff8e0 0%, #fffef0 50%, #fff8e0 100%);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.2);
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge--historical { background: #e8e8e8; color: #555; }
.status-badge--new { background: #e3f2fd; color: #1565c0; }
.status-badge--emerging { background: #fff3e0; color: #e65100; }
.status-badge--evolving { background: #fce4ec; color: #c62828; }
.status-badge--debunked { background: #e8f5e9; color: #2e7d32; }
.status-badge--persistent { background: #f3e5f5; color: #7b1fa2; }
.status-badge--recent { background: #e0f2f1; color: #00796b; }

/* Tags */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.tag-link {
  display: inline-block;
  padding: 3px 10px;
  background: var(--color-border-light);
  color: var(--color-text-light);
  border-radius: 3px;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.tag-link:hover {
  background: var(--color-accent);
  color: var(--color-white);
}

/* Theory Show Page Layout */
.theory-detail {
  min-width: 0;
  margin-bottom: 0;
}

.theory-header {
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
}

.theory-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.theory-header-row .tag-list {
  margin-top: 0;
  justify-content: flex-end;
  flex: 1;
}

.tag-more {
  display: inline-block;
  padding: 3px 6px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: help;
}

.theory-category {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
}

.theory-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
  color: var(--color-primary);
  max-width: 900px;
}

.theory-summary {
  font-size: 1.2rem;
  color: var(--color-text-light);
  line-height: 1.6;
  margin-bottom: var(--spacing-lg);
  max-width: 900px;
}

.theory-meta {
  display: flex;
  gap: var(--spacing-lg);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  max-width: 900px;
}

.theory-body {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--color-text);
}

.theory-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--spacing-2xl);
  align-items: start;
}

.theory-main {
  min-width: 0;
}

.theory-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

@media (max-width: 900px) {
  .theory-with-sidebar {
    grid-template-columns: 1fr;
  }

  .theory-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .theory-sidebar > * {
    flex: 1 1 250px;
  }
}

.theory-body p {
  margin-bottom: var(--spacing-lg);
}

.theory-body h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin: var(--spacing-xl) 0 var(--spacing-md);
  color: var(--color-primary);
}

.theory-body h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin: var(--spacing-lg) 0 var(--spacing-sm);
  color: var(--color-primary);
}

/* JSON theory view - Prominent Figures */
.theory-json-content .theory-section:first-child h2 {
  margin-top: 0;
}

.prominent-figures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

.prominent-figure-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: var(--spacing-lg);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.prominent-figure-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  border-color: var(--color-accent);
}

.figure-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--spacing-xs);
}

.figure-role {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-bottom: var(--spacing-sm);
}

.figure-platform {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.figure-platform svg {
  opacity: 0.6;
}

.theory-body ul,
.theory-body ol {
  margin-bottom: var(--spacing-lg);
  padding-left: var(--spacing-xl);
}

.theory-body li {
  margin-bottom: var(--spacing-sm);
}

/* Categories & Tags Index */
.category-grid,
.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

.category-card,
.tag-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: var(--spacing-lg);
  transition: box-shadow 0.2s ease;
}

.category-card:hover,
.tag-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.category-card h3,
.tag-card h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin-bottom: var(--spacing-sm);
}

.category-card h3 a,
.tag-card h3 a {
  color: var(--color-text);
}

.category-card h3 a:hover,
.tag-card h3 a:hover {
  color: var(--color-accent);
}

.category-card p,
.tag-card p {
  color: var(--color-text-light);
  font-size: 0.9rem;
}

.theory-count {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: var(--spacing-sm);
}

/* Page Headers */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-2xl);
  gap: var(--spacing-lg);
}

.page-header-left {
  flex: 1;
}

.page-header-right {
  flex-shrink: 0;
}

.page-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--spacing-sm);
}

.page-description {
  color: var(--color-text-light);
  font-size: 1.1rem;
}

/* Search Bar */
.search-bar {
  margin-bottom: var(--spacing-xl);
}

.search-form {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

.search-input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-white);
  color: var(--color-text);
  transition: border-color 0.15s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

.search-input--compact {
  width: 200px;
  padding: 8px 12px;
  font-size: 0.85rem;
}

.search-submit {
  font-family: var(--font-typewriter);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  padding: 10px 20px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-white);
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-submit:hover {
  background: var(--color-border-light);
}

.search-clear {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.search-clear:hover {
  color: var(--color-accent);
}

.filter-empty {
  color: var(--color-text-muted);
  font-style: italic;
  text-align: center;
  padding: var(--spacing-2xl) 0;
}

.empty-state {
  text-align: center;
  padding: var(--spacing-2xl) 0;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.empty-state p {
  color: var(--color-text-light);
  font-size: 1.1rem;
  margin-bottom: var(--spacing-lg);
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: var(--color-accent-dark);
  color: var(--color-white);
}

/* Sidebar Filters */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--spacing-2xl);
}

.sidebar {
  position: sticky;
  top: var(--spacing-lg);
  align-self: start;
}

.filter-section {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.filter-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-md);
}

.filter-list {
  list-style: none;
}

.filter-list li {
  margin-bottom: var(--spacing-sm);
}

.filter-list a {
  color: var(--color-text-light);
  font-size: 0.9rem;
  display: block;
  padding: var(--spacing-xs) 0;
}

.filter-list a:hover,
.filter-list a.active {
  color: var(--color-accent);
}

/* Footer */
.site-footer {
  background: var(--color-primary) url("/assets/signal_watch-d4fe8625.png") center / cover no-repeat;
  position: relative;
  color: rgba(255, 255, 255, 0.7);
  padding: var(--spacing-2xl) 0;
  margin-top: auto;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 46, 0.88);
  pointer-events: none;
}

.site-footer > * {
  position: relative;
}

.footer-content {
  text-align: center;
}

.footer-top {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-white);
}

.footer-nav {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
}

.footer-social-link {
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

.footer-social-link:hover {
  color: var(--color-white);
  transform: translateY(-2px);
}

.footer-nav-separator {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 var(--spacing-xs);
}

.footer-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-link:hover {
  color: var(--color-white);
  text-decoration: underline;
}

.footer-disclaimer {
  font-size: 0.85rem;
  max-width: 800px;
  margin: 0 auto var(--spacing-md);
  line-height: 1.5;
}

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  max-width: 800px;
  margin: 0 auto;
}

/* Static Pages */
.static-content {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--spacing-2xl) 0;
  line-height: 1.7;
}

.static-content h1 {
  margin-bottom: var(--spacing-xl);
}

.static-content h2 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin: var(--spacing-xl) 0 var(--spacing-md);
  color: var(--color-primary);
}

.static-content p {
  margin-bottom: var(--spacing-md);
}

.static-content ul {
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-xl);
}

.static-content li {
  margin-bottom: var(--spacing-xs);
}

/* ===== THEORY TABS ===== */
.theory-tabs-container {
  margin-top: var(--spacing-sm);
}

.tab-bar {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid var(--color-border);
  background: var(--color-bg);
  border-radius: 4px 4px 0 0;
  padding-right: 4px;
}

.tab {
  font-family: var(--font-typewriter);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  padding: 10px 20px 8px;
  border: none;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  position: relative;
  bottom: -2px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tab-active {
  background: var(--color-white);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-bottom-color: var(--color-white);
}

.tab-inactive {
  background: var(--color-border-light);
  color: var(--color-text-light);
  border: 1px solid transparent;
  border-bottom: none;
}

.tab-inactive:hover {
  background: var(--color-white);
  color: var(--color-accent);
}

/* Tab Panel */
.tab-panel {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 4px 4px;
  padding: var(--spacing-xl);
  min-height: 400px;
}

.panel-hidden {
  display: none;
}

.panel-active {
  display: block;
}

.panel-empty {
  font-family: var(--font-typewriter);
  color: var(--color-text-muted);
  font-size: 1rem;
  text-align: center;
  padding: var(--spacing-2xl) 0;
}

/* Refetch Button (Admin) */
.tab-panel {
  position: relative;
}

.panel-actions {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  z-index: 10;
}

.btn-refetch {
  background: none;
  color: var(--color-text-muted);
  border: none;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.3;
  border-radius: 4px;
}

.btn-refetch svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.btn-refetch:hover {
  opacity: 1;
  color: var(--color-accent);
  background: none;
  box-shadow: none;
}

.btn-refetch:hover svg {
  transform: rotate(45deg);
}

/* ===== THEORY GRID LAYOUT ===== */
.theory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-xl);
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-2xl);
  align-items: stretch;
}

.theory-grid-col {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

.info-bubble {
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.info-bubble-label {
  font-family: var(--font-typewriter);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-sm);
}

.info-bubble-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.info-bubble-card .content-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.info-bubble-card .content-card-link {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.info-bubble-card .content-card--video .content-card-body,
.info-bubble-card .content-card--book .content-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.info-bubble-card .content-card--video .content-card-thumb {
  margin-bottom: 0;
  border-radius: 0;
}

.info-bubble-card .content-card--book .content-card-cover {
  margin-right: 0;
  margin-bottom: 0;
  border-radius: 0;
}

.info-bubble-card .content-card--book {
  flex-direction: row;
}

.info-bubble-card .content-card--book .content-card-link {
  flex-direction: row;
}

.info-bubble-more {
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 500;
  margin-top: var(--spacing-sm);
  text-decoration: none;
  align-self: flex-end;
}

.info-bubble-more:hover {
  text-decoration: underline;
}

/* Skeleton Placeholders */
.content-card--skeleton {
  background: var(--color-white);
  border-left: 4px solid var(--color-border-light);
  pointer-events: none;
}

/* Video cards - no border */
.content-card--video {
  border-left: none;
}

.skeleton-content {
  padding: var(--spacing-md);
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.skeleton-line {
  background: var(--color-border-light);
  height: 12px;
  border-radius: 2px;
  animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-line--short { width: 40%; }
.skeleton-line--medium { width: 70%; }
.skeleton-line--long { width: 100%; }
.skeleton-line--title { height: 16px; margin-bottom: 4px; }

.skeleton-thumb, .skeleton-cover {
  background: var(--color-border-light);
  border-radius: 2px;
  animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-thumb { aspect-ratio: 16/9; width: 100%; }
.skeleton-cover { width: 70px; height: 105px; flex-shrink: 0; }

.content-card--skeleton.content-card--book .skeleton-content {
  flex-direction: row;
  align-items: center;
}

@keyframes pulse {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
  align-items: start;
}

.content-card--news {
  border-left: none !important;
  max-height: 250px;
}

/* Carousel */
.carousel-container {
  position: relative;
  overflow: visible;
}

.carousel-viewport {
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.carousel-slide {
  flex: 0 0 calc(100% / 3);
  padding-right: var(--spacing-md);
}

.carousel-slide .content-card {
  height: 100%;
}

/* Carousel Navigation */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-light);
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.carousel-nav:hover {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
}

.carousel-nav--prev {
  left: -12px;
}

.carousel-nav--next {
  right: -12px;
}

/* Carousel Dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: var(--spacing-md);
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--color-border);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.carousel-dot:hover {
  background: var(--color-text-muted);
}

.carousel-dot--active {
  background: var(--color-accent);
  width: 24px;
  border-radius: 4px;
}

/* News Ticker - full width, below header */
.ticker-container {
  background: var(--color-primary);
  position: relative;
  overflow: hidden;
  padding: 12px 0;
  border-bottom: 4px solid var(--color-accent);
}

.ticker-viewport {
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.ticker-track {
  display: flex;
  gap: 40px;
  white-space: nowrap;
  will-change: transform;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.ticker-item:hover {
  color: var(--color-white);
}

.ticker-item-source {
  font-family: var(--font-typewriter);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  background: rgba(255, 255, 255, 0.1);
  padding-left: 8px;
  padding-right: 6px;
  padding-top: 6px;
  padding-bottom: 2px;
  border-radius: 2px;
}

.ticker-item-title {
  font-family: var(--font-sans);
  font-weight: 400;
}

.ticker-separator {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.6rem;
  padding-left: 8px;
  padding-right: 8px;
  flex-shrink: 0;
}

/* Force overflow visible everywhere */
.content-card,
.content-card-link,
.news-item-insight {
  overflow: visible !important;
}

.content-card {
  background: var(--color-white);
  border-left: 4px solid var(--color-text-light);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.content-card > .content-card-link {
  flex: 0 1 auto;
}

/* Force overflow visible everywhere */
.content-card,
.content-card-link,
.news-item-insight {
  overflow: visible !important;
}

.content-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.news-item-insight {
  display: block;
  background: #e8f5e9;
  border: 1px solid #81c784;
  border-radius: 18px 18px 18px 4px;
  padding: var(--spacing-sm) var(--spacing-md);
  font-family: var(--font-typewriter);
  font-size: 0.8rem;
  color: #1b5e20;
  line-height: 1.3;
  margin: var(--spacing-xs) var(--spacing-md) var(--spacing-sm);
  max-width: 90%;
  white-space: normal !important;
  overflow: visible !important;
}

.news-item-insight--placeholder {
  background: #fff3e0;
  border-color: #ffb74d;
  color: #e65100;
  font-style: italic;
  font-size: 0.8rem;
  padding: var(--spacing-sm) var(--spacing-md);
}

/* Video cards - no border */
.content-card--video {
  border-left: none;
}

.content-card-link {
  display: flex;
  flex-direction: column;
  padding: var(--spacing-md);
  color: inherit;
  text-decoration: none;
  flex: 0 1 auto;
  white-space: normal;
}

.content-card-source {
  font-family: var(--font-typewriter);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  margin-bottom: 4px;
}

.content-card-title {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text);
}

.content-card:hover .content-card-title {
  color: var(--color-accent);
}

.content-card-date,
.content-card-meta {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 6px;
}



/* Video cards */
.content-card--video .content-card-link {
  padding: 0;
}

.content-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--color-primary);
  overflow: hidden;
}

.content-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-card--video .content-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--spacing-md);
}

/* Book cards */
.content-card--book .content-card-link {
  flex-direction: row;
  gap: var(--spacing-md);
}

.content-card-cover {
  flex-shrink: 0;
  width: 70px;
  height: 105px;
  background: var(--color-primary);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.content-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-card-cover-placeholder {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-white);
}

.content-card--book .content-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  justify-content: center;
}

/* Follow button */
.follow-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  vertical-align: baseline;
  color: var(--color-text-light);
  transition: all 0.2s ease;
  margin-right: var(--spacing-xs);
  margin-top: 4px;
  line-height: 1;
  font-family: inherit;
  outline: none;
}

.follow-button:hover {
  color: var(--color-accent);
}

.follow-button--active {
  color: var(--color-accent);
}

.follow-button--active:hover {
  opacity: 0.7;
}

/* Theory header actions */
.theory-header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.theory-header-actions--secondary {
  margin-top: var(--spacing-sm);
}

/* Social Share */
.social-share {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.social-share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--color-text-light);
  transition: all 0.2s ease;
  text-decoration: none;
}

.social-share-link:hover {
  transform: scale(1.1);
  color: var(--color-text);
}

.social-share-link--facebook:hover {
  color: #1877f2;
}

.social-share-link--twitter:hover {
  color: #000;
}

.social-share-link--reddit:hover {
  color: #ff4500;
}

/* Auth and Flash */
.auth-button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: inline-block;
  outline: none;
  text-align: inherit;
  padding-left: 0;
  padding-right: 0;
}

.nav-separator {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 var(--spacing-sm);
  flex-shrink: 0;
}

.auth-form-container {
  max-width: 440px;
  margin: var(--spacing-2xl) auto;
  padding: var(--spacing-2xl);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.auth-form-container h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--spacing-sm);
}

.auth-form-container .auth-form-subtitle {
  color: var(--color-text-light);
  font-size: 0.95rem;
  margin-bottom: var(--spacing-xl);
}

.auth-form-container .field {
  margin-bottom: var(--spacing-lg);
}

.auth-form-container label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light);
  margin-bottom: var(--spacing-xs);
}

.auth-form-container input[type="email"],
.auth-form-container input[type="password"],
.auth-form-container input[type="text"],
.auth-form-container input[type="url"],
.auth-form-container textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 1rem;
}

.auth-form-container input[type="email"]:focus,
.auth-form-container input[type="password"]:focus,
.auth-form-container input[type="text"]:focus,
.auth-form-container input[type="url"]:focus,
.auth-form-container textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.checkbox-field {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: var(--spacing-sm);
}

.checkbox-field input {
  width: auto !important;
  margin: 0;
}

.checkbox-field label {
  margin-bottom: 0;
  text-transform: none;
  font-weight: normal;
  letter-spacing: normal;
}

.field-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-xs);
}

.auth-form-container input[type="submit"] {
  width: 100%;
  padding: 14px;
  background: var(--color-accent);
  color: var(--color-white);
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-form-container input[type="submit"]:hover {
  background: var(--color-accent-dark);
}

.omniauth-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xl);
}

.omniauth-buttons .button_to {
  margin: 0;
}

.omniauth-buttons button {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  transition: all 0.2s ease;
}

.btn-google {
  background-color: #fff;
  color: #333;
  border: 1px solid #dadce0 !important;
}

.btn-google:hover {
  background-color: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-google::before {
  content: "";
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%234285F4' d='M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z'/%3E%3Cpath fill='%2334A853' d='M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z'/%3E%3Cpath fill='%23FBBC05' d='M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z'/%3E%3Cpath fill='%23EA4335' d='M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.btn-twitter {
  background-color: #000000;
  color: #fff;
}

.btn-twitter:hover {
  background-color: #333;
}

.btn-twitter::before {
  content: "";
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

.auth-form-divider {
  text-align: center;
  margin: var(--spacing-lg) 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.auth-form-footer {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--color-border-light);
  text-align: center;
  font-size: 0.9rem;
}

.auth-form-footer a {
  display: block;
  margin-bottom: var(--spacing-xs);
  color: var(--color-text-light);
}

.auth-form-footer a:hover {
  color: var(--color-accent);
}

.error_explanation {
  background: #fff5f5;
  border: 1px solid #feb2b2;
  color: #c53030;
  padding: var(--spacing-md);
  border-radius: 4px;
  margin-bottom: var(--spacing-lg);
  font-size: 0.9rem;
}

.error_explanation h2 {
  font-size: 1rem;
  text-align: left;
  margin-bottom: var(--spacing-xs);
  color: inherit;
}

.error_explanation ul {
  padding-left: var(--spacing-lg);
}

.flash {
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  border-radius: 4px;
  font-size: 0.95rem;
}

.flash-notice {
  background-color: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.flash-alert {
  background-color: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}
/* Responsive */
@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--spacing-md);
  }

  .masthead {
    flex: 0 0 auto;
  }

  .main-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-sm) var(--spacing-md);
  }

  .site-title {
    font-size: 2rem;
  }

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

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

  .theory-title {
    font-size: 1.8rem;
  }

  .tab-bar {
    flex-wrap: wrap;
  }

  .tab {
    font-size: 0.75rem;
    padding: 8px 14px 6px;
  }

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

  .carousel-slide {
    flex: 0 0 100%;
  }

  .tab-panel {
    padding: var(--spacing-md);
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .carousel-slide {
    flex: 0 0 50%;
  }
}

/* Account Page */
.account-page {
  max-width: 600px;
  margin: 0 auto;
}

.account-header h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--color-primary);
  margin-bottom: var(--spacing-xl);
}

.account-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

.account-section {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: var(--spacing-lg);
}

.account-section h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--color-primary);
  margin-bottom: var(--spacing-md);
}

.profile-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.profile-field:last-child {
  border-bottom: none;
}

.profile-field .label {
  font-weight: 600;
  color: var(--color-text-light);
}

.profile-field .value {
  color: var(--color-text);
}

.help-text {
  font-size: 0.95rem;
  color: var(--color-text-light);
  line-height: 1.6;
  margin-bottom: var(--spacing-md);
}

.help-text:last-child {
  margin-bottom: 0;
}

.help-text a {
  color: var(--color-accent);
}

.btn-logout {
  width: 100%;
  padding: 12px;
  background: var(--color-white);
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: var(--color-accent);
  color: var(--color-white);
}

/* User Avatar */
.user-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  text-decoration: none;
}

.user-nickname {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.user-info:hover .user-nickname {
  color: var(--color-white);
}

.user-avatar {
  display: inline-block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-accent);
  flex-shrink: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Form Styles */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--color-text-light);
  margin-bottom: var(--spacing-xs);
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-white);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.1);
}

.form-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: var(--spacing-xs);
}

/* Account Form */
.account-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.form-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.form-row label {
  flex: 0 0 100px;
  font-weight: 600;
  color: var(--color-text-light);
  text-align: right;
  margin: 0;
}

.form-row .form-control {
  flex: 1;
  max-width: 300px;
}

.form-row--checkbox {
  align-items: flex-start !important;
  gap: var(--spacing-sm) !important;
}

.form-row--checkbox label {
  flex: 1 !important;
  text-align: left !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: var(--spacing-sm) !important;
  font-weight: normal !important;
  color: var(--color-text) !important;
  cursor: pointer;
  line-height: 1.5;
}

.form-row--checkbox label input[type="checkbox"] {
  margin-top: 4px;
  flex-shrink: 0;
}

.form-row--checkbox label strong {
  white-space: nowrap;
}

.form-row--checkbox label .help-text {
  display: block;
  margin-bottom: 0;
  font-size: 0.875rem;
}

/* API Key input group */
.input-group {
  display: flex;
  gap: var(--spacing-sm);
  flex: 1;
}

.input-group .form-control {
  font-family: var(--font-typewriter);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.input-group .form-control.form-control-disabled {
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--color-text-light);
  margin-bottom: var(--spacing-xs);
}

.text-success {
  color: #2e7d32;
}

.form-control-disabled {
  background-color: var(--color-border-light);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

/* HOME PAGE - TIGHT GRID */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: var(--spacing-md);
  padding: var(--spacing-md) 0;
}

.home-section {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: var(--spacing-md);
}

.home-section--digest {
  grid-column: span 2;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--color-accent);
}

.section-label {
  font-family: var(--font-typewriter);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
}

.home-section--digest .section-label {
  color: var(--color-accent);
}

.section-date {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-typewriter);
}

/* Daily Digest */
.digest-headline {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-white);
  margin: 0 0 var(--spacing-xs);
  line-height: 1.3;
}

.digest-hook {
  font-size: 0.85rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 var(--spacing-sm);
  line-height: 1.4;
}

.digest-summary {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 var(--spacing-sm);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.digest-domains {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.domain-tag {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 2px;
}

/* Trending Narratives */
.narratives-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.narrative-item {
  display: flex;
  gap: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border-light);
}

.narrative-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.narrative-rank {
  font-family: var(--font-typewriter);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-accent);
  flex-shrink: 0;
  width: 20px;
}

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

.narrative-title {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 2px;
  line-height: 1.3;
}

.narrative-summary {
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin: 0 0 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.narrative-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
}

.sentiment {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 2px;
}

.sentiment--positive { background: rgba(46, 204, 113, 0.2); color: #27ae60; }
.sentiment--negative { background: rgba(231, 76, 60, 0.2); color: #c0392b; }
.sentiment--neutral { background: rgba(52, 152, 219, 0.2); color: #2980b9; }

.kw-tag {
  font-size: 0.6rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: 1px 5px;
  border-radius: 2px;
}

/* Viral Content */
.viral-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.viral-item {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: var(--spacing-sm);
  background: var(--color-bg);
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.viral-item:hover {
  border-color: var(--color-accent);
}

.viral-meta {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
  align-items: center;
}

.platform {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 2px;
  background: var(--color-text-muted);
  color: var(--color-white);
}

.platform--youtube { background: #ff0000; }
.platform--rumble { background: #85c442; }
.platform--tiktok { background: #000; }
.platform--instagram { background: #e1306c; }
.platform--twitter { background: #1da1f2; }
.platform--facebook { background: #1877f2; }
.platform--bluesky { background: #1185fe; }

.fact-check {
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 1px 4px;
  border-radius: 2px;
}

.fact-check--verified { background: rgba(46, 204, 113, 0.2); color: #27ae60; }
.fact-check--disputed { background: rgba(241, 196, 15, 0.2); color: #d4ac0d; }
.fact-check--false { background: rgba(231, 76, 60, 0.2); color: #c0392b; }
.fact-check--unverified { background: rgba(149, 165, 166, 0.2); color: #7f8c8d; }

.viral-claim {
  font-size: 0.75rem;
  color: var(--color-text);
  margin: 0 0 4px;
  line-height: 1.4;
}

.viral-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.viral-creator {
  font-size: 0.65rem;
  color: var(--color-text-muted);
}

.engagement {
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 1px 4px;
  border-radius: 2px;
}

.engagement--low { background: rgba(149, 165, 166, 0.2); color: #7f8c8d; }
.engagement--medium { background: rgba(52, 152, 219, 0.2); color: #2980b9; }
.engagement--high { background: rgba(241, 196, 15, 0.2); color: #d4ac0d; }
.engagement--viral { background: rgba(231, 76, 60, 0.2); color: #c0392b; }

/* Fresh Signals / News */
.news-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.news-item {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: var(--spacing-sm);
  background: var(--color-bg);
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.news-item:hover {
  border-color: var(--color-accent);
}

.news-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}

.news-source {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
}

.news-time {
  font-size: 0.6rem;
  color: var(--color-text-muted);
}

.news-title {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 3px;
  line-height: 1.3;
}

.news-insight {
  font-size: 0.7rem;
  color: var(--color-text-light);
  margin: 0 0 4px;
  line-height: 1.4;
}

.news-theory-tag {
  display: inline-block;
  font-size: 0.55rem;
  color: var(--color-text-muted);
  background: var(--color-border-light);
  padding: 1px 5px;
  border-radius: 2px;
}

/* Responsive */
@media (max-width: 1024px) {
  .home-grid {
    grid-template-columns: 1fr 1fr;
  }
  .home-section--digest {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
  .home-section--digest {
    grid-column: span 1;
  }
}
@media (max-width: 767px) {
  .ticker-container {
    display: none;
  }
}
