/*
 * Custom theme - Based on Design & Life prototype
 * Overrides for Paper theme
 */

:root {
  /* Page */
  --page-bg: #F8F9FA;
  --card-bg: #FFFFFF;
  --card-hover: #F1F3F5;
  --surface-subtle: #F1F3F5;

  /* Text */
  --text-primary: #212529;
  --text-secondary: #6C757D;
  --text-muted: #9CA3AF;
  --text-light: #ADB5BD;

  /* Borders */
  --border-default: #DEE2E6;
  --border-input: #D1D5DB;
  --border-subtle: #E5E7EB;

  /* Accent */
  --accent: #6366F1;
  --accent-hover: #4F46E5;
  --accent-dark: #4338CA;
  --accent-light: #EEF2FF;

  /* Source Badge Base Colors */
  --badge-github: #22C55E;
  --badge-github-text: #16A34A;
  --badge-rss: #F97316;
  --badge-rss-text: #EA580C;
  --badge-youtube: #EF4444;
  --badge-youtube-text: #DC2626;
  --badge-x: #000000;
  --badge-x-text: #1F2937;
  --badge-x-border: #374151;
  --badge-website: #3B82F6;
  --badge-website-text: #2563EB;

  /* Card Theme (light mode) */
  --card-bg-unread: #FFFFFF;
  --card-bg-read: #FAFAFA;
  --card-border: #DEE2E6;
  --card-hover: #F1F3F5;
  --text-headline: #212529;
  --text-headline-read: #6C757D;
  --text-summary: #6C757D;

  /* Density: comfortable (default) */
  --card-padding: 20px;
  --card-gap: 12px;
  --badge-height: 24px;

  /* Status */
  --status-success: #10B981;
  --status-success-text: #16A34A;
  --status-warning: #F59E0B;
  --status-error: #DC2626;
  --status-error-text: #DC2626;
  --status-error-light: #FCA5A5;
  --status-error-bg: #FEF2F2;
}

[data-theme="dark"] {
  --page-bg: #1A1B1E;
  --card-bg: #25262B;
  --card-hover: #2C2E33;
  --surface-subtle: #2C2E33;

  --text-primary: #E9ECEF;
  --text-secondary: #ADB5BD;
  --text-muted: #868E96;
  --text-light: #495057;

  --border-default: #373A40;
  --border-input: #495057;
  --border-subtle: #2C2E33;

  --accent: #818CF8;
  --accent-hover: #A5B4FC;
  --accent-light: rgba(129, 140, 248, 0.1);

  /* Card Theme (dark mode) */
  --card-bg-unread: #1A1B1E;
  --card-bg-read: #222326;
  --card-hover: #25262A;
  --card-border: #2C2D31;
  --text-headline: #E9ECEF;
  --text-headline-read: #ADB5BD;
  --text-summary: #ADB5BD;

  --badge-x: #E9ECEF;
  --badge-github-text: #4ADE80;
  --badge-rss-text: #FB923C;
  --badge-youtube-text: #F87171;
  --badge-x-text: #D1D5DB;
  --badge-x-border: #9CA3AF;
  --badge-website-text: #60A5FA;
}

/* Density: compact */
[data-density="compact"] {
  --card-padding: 12px;
  --card-gap: 4px;
  --badge-height: 20px;
}

/* Density: spacious */
[data-density="spacious"] {
  --card-padding: 28px;
  --card-gap: 20px;
  --badge-height: 28px;
}

/* Base styles */
html,
body {
  background-color: var(--page-bg);
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  color: var(--text-primary);
  min-height: 100vh;
}

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

/* Heading Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Instrument Sans', sans-serif;
}

h1 {
  font-weight: 700;
}

h2, h3, h4, h5, h6 {
  font-weight: 600;
}

/* Container */
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (min-width: 768px) {
  .container {
    padding: 0;
  }
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0;
}

.nav-logo {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.nav-link:hover {
  color: var(--text-primary);
}

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

/* Blog Header */
.blog-header {
  padding-top: 8rem;
  padding-bottom: 6rem;
}

.blog-header h1 {
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.1;
  margin: 0;
}

@media (min-width: 768px) {
  .blog-header h1 {
    font-size: 4.5rem;
  }
}

.blog-header h1 span {
  font-weight: 500;
}

.blog-header p {
  margin-top: 2rem;
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 28rem;
  font-weight: 300;
  line-height: 1.6;
}

/* Main content */
main {
  flex-grow: 1;
}

/* Briefing Card — Redesigned */
.briefing-card {
  display: block;
  background: var(--card-bg-unread);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: var(--card-padding);
  margin-bottom: var(--card-gap);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.briefing-card:hover {
  background: var(--card-hover);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.briefing-card time {
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 400;
  white-space: nowrap;
}

.briefing-card h2 {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-headline);
  line-height: 1.4;
  margin: 0 0 0.5rem 0;
}

.briefing-card p {
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  color: var(--text-summary);
  line-height: 1.6;
  font-weight: 400;
  margin: 0;
}

/* Read state — muted card */
.briefing-card.is-read {
  background: var(--card-bg-read);
}

.briefing-card.is-read h2 {
  color: var(--text-headline-read);
}

/* View Archive Button */
.view-archive {
  padding: 6rem 0;
  display: flex;
  justify-content: center;
}

.view-archive button {
  font-size: 0.875rem;
  font-weight: 500;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-input);
  padding-bottom: 0.25rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.view-archive button:hover {
  border-color: var(--text-primary);
}

/* Footer */
footer {
  padding: 4rem 0;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footer-separator {
  margin: 0 0.25rem;
  user-select: none;
}

footer a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--text-primary);
}

footer a:focus-visible {
  color: var(--text-primary);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Single Post */
.post-back {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 3rem;
  transition: color 0.3s ease;
}

.post-back:hover {
  color: var(--text-primary);
}

.post-back svg {
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
  transition: transform 0.3s ease;
}

.post-back:hover svg {
  transform: translateX(-4px);
}

.post-back-bottom {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

/* Reduce gap between content and footer on briefing detail pages */
main:has(.layout-briefing-single),
main:has(.layout-news),
main:has(.layout-opinion),
main:has(.layout-tutorial),
main:has(.layout-video-explainer),
main:has(.layout-github-release) {
  flex-grow: 0;
}

.post-header {
  margin-bottom: 4rem;
}

.post-header time {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
  margin-bottom: 1rem;
}

.post-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  margin: 0 0 1.5rem 0;
}

@media (min-width: 768px) {
  .post-header h1 {
    font-size: 3rem;
  }
}

.post-header .description {
  font-size: 1.25rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.6;
  border-left: 2px solid var(--border-default);
  padding-left: 1.5rem;
  margin: 0;
}

/* Post Content */
.post-content {
  font-size: 1.125rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.8;
}

.post-content p {
  margin: 0 0 1.5rem 0;
}

.post-content strong {
  font-weight: 500;
  color: var(--text-primary);
}

.post-content h2,
.post-content h3 {
  font-weight: 500;
  color: var(--text-primary);
  margin: 2.5rem 0 1rem 0;
}

.post-content h2 {
  font-size: 1.5rem;
}

.post-content h3 {
  font-size: 1.25rem;
}

.post-content ul,
.post-content ol {
  margin: 0 0 1.5rem 0;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

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

.post-content a:hover {
  opacity: 0.7;
}

.post-content blockquote {
  border-left: 2px solid var(--border-default);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
}

.post-content pre {
  background: var(--surface-subtle);
  padding: 1.5rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-content code {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.875em;
}

.post-content p code {
  background: var(--surface-subtle);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

/* Post Footer */
.post-footer {
  margin-top: 4rem;
  padding-top: 4rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.post-footer a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-footer a:hover {
  color: var(--text-primary);
}

.post-footer .thanks {
  font-size: 0.875rem;
  color: var(--border-input);
  font-style: italic;
}

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

.animate-fade-in {
  animation: fadeIn 0.7s ease-out;
}

/* Post list container */
.post-list {
  margin-top: 0;
}

/* Date Section Headers */
.date-section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.date-section-header:first-child {
  margin-top: 0;
}

.date-section-header span {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.date-section-header hr {
  flex: 1;
  border: none;
  border-top: 1px solid var(--border-default);
  margin: 0;
}

/* Source Badges — Linear-style: pastel bg + colored border + dark text */
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  padding: 0 0.5rem;
  height: var(--badge-height);
  border-radius: 4px;
  border: 1px solid transparent;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

.source-badge svg {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

.source-github_releases {
  background: rgba(34, 197, 94, 0.1);
  border-color: #22C55E;
  color: var(--badge-github-text);
}

.source-rss {
  background: rgba(249, 115, 22, 0.1);
  border-color: #F97316;
  color: var(--badge-rss-text);
}

.source-youtube_channel {
  background: rgba(239, 68, 68, 0.1);
  border-color: #EF4444;
  color: var(--badge-youtube-text);
}

.source-x_account {
  background: rgba(0, 0, 0, 0.08);
  border-color: var(--badge-x-border);
  color: var(--badge-x-text);
}

.source-website {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3B82F6;
  color: var(--badge-website-text);
}

.source-podcast {
  background: rgba(168, 85, 247, 0.1);
  border-color: #A855F7;
  color: var(--badge-podcast-text, #7E22CE);
}

/* Dark mode badge background overrides */
[data-theme="dark"] .source-github_releases {
  background: rgba(34, 197, 94, 0.15);
}
[data-theme="dark"] .source-rss {
  background: rgba(249, 115, 22, 0.15);
}
[data-theme="dark"] .source-youtube_channel {
  background: rgba(239, 68, 68, 0.15);
}
[data-theme="dark"] .source-x_account {
  background: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .source-website {
  background: rgba(59, 130, 246, 0.15);
}
[data-theme="dark"] .source-podcast {
  background: rgba(168, 85, 247, 0.15);
}

/* Briefing single page */
.briefing-source-link {
  margin: 1.5rem 0;
}

.view-original,
.post-content .view-original {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 0.375rem;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: opacity 0.2s ease;
}

.view-original:hover {
  opacity: 0.85;
}

.view-original svg {
  flex-shrink: 0;
}

/* Feed Header */
.feed-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 2rem 0 1.5rem;
}

.feed-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.feed-title {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.feed-tagline {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 400;
}

.feed-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
  padding: 0;
}

.icon-btn:hover {
  color: var(--text-primary);
  background: var(--surface-subtle);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* Day Navigation Pills */
.day-nav {
  margin-bottom: 1.5rem;
}

.day-nav-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}

.day-nav-pills::-webkit-scrollbar {
  display: none;
}

.day-pill {
  display: inline-flex;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.day-pill:hover {
  background: var(--border-default);
  color: var(--text-primary);
}

.day-pill.active {
  background: var(--accent);
  color: white;
  font-weight: 600;
}

.day-count {
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* Older Dropdown */
.older-dropdown {
  display: inline;
  position: relative;
}

.older-dropdown > summary {
  list-style: none;
}

.older-dropdown > summary::-webkit-details-marker {
  display: none;
}

.older-dropdown-content {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 240px;
  background: var(--card-bg, #FFFFFF);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 10;
  padding: 0.5rem 0;
}

[data-theme="dark"] .older-dropdown-content {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.archive-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background-color 0.1s ease;
}

.archive-link:hover {
  background: var(--surface-subtle);
}

.archive-count {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Filtered empty state */
.filtered-empty {
  padding: 4rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 1.125rem;
}

/* Pagination — Prev/Next + Page Indicator */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0 1.5rem;
  font-family: 'Inter', sans-serif;
}

.pagination-prev,
.pagination-next {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  padding: 0.5rem 0;
  transition: color 0.15s ease;
}

.pagination-prev:hover,
.pagination-next:hover {
  color: var(--accent-hover);
}

.pagination-spacer {
  width: 80px;
}

.pagination-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
}

.pagination-position {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.pagination-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Mobile Responsive (768px breakpoint) */
@media (max-width: 768px) {
  .feed-header {
    flex-direction: column;
    gap: 1rem;
  }

  .feed-header-right {
    align-self: flex-start;
  }

  .day-nav-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .pagination {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }

  .pagination-spacer {
    display: none;
  }

  .pagination-prev,
  .pagination-next {
    order: -1;
  }

  .pagination-info {
    order: 1;
  }
}

/* Accessibility — Focus Indicators (WCAG 2.1 AA) */
.briefing-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pagination-prev:focus-visible,
.pagination-next:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

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

.archive-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: var(--surface-subtle);
}

/* Empty State */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  padding: 3rem 1rem;
}

/* 404 Page */
.error-content {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4rem 0 6rem;
  animation: fadeIn 0.7s ease-out;
}

.error-content h1 {
  font-size: 6rem;
  font-weight: 300;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
  line-height: 1;
}

.error-content h2 {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin: 0 0 1.5rem 0;
}

.error-content p {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 28rem;
  font-weight: 300;
  line-height: 1.6;
  margin: 0 0 2rem 0;
}

.error-content a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-input);
  padding-bottom: 0.25rem;
  transition: border-color 0.3s ease;
}

.error-content a:hover {
  border-color: var(--text-primary);
}

/* Briefing Detail Article */
.briefing-article {
  max-width: 700px;
  margin: 0 auto;
}

.briefing-article .briefing-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.briefing-article .briefing-meta time {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0;
}

/* Font Toggle — hidden by default, JS reveals after attaching listeners */
.font-toggle {
  display: none;
  gap: 0.25rem;
  padding: 0.125rem;
  background: var(--surface-subtle);
  border-radius: 0.375rem;
}

.font-toggle.is-ready {
  display: inline-flex;
}

.font-toggle-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  line-height: 1;
}

.font-toggle-btn:hover {
  color: var(--text-secondary);
}

.font-toggle-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

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

/* Serif font class */
.post-content.font-serif {
  font-family: 'Lora', 'Charter', Georgia, serif;
}

/* Dark mode: font toggle */
[data-theme="dark"] .font-toggle {
  background: var(--surface-subtle);
}

[data-theme="dark"] .font-toggle-btn {
  color: var(--text-muted);
}

[data-theme="dark"] .font-toggle-btn:hover {
  color: var(--text-secondary);
}

[data-theme="dark"] .font-toggle-btn.active {
  background: var(--accent);
  color: white;
}

/* Dark mode: source badges */
[data-theme="dark"] .source-github_releases {
  background: rgba(74, 222, 128, 0.1);
  color: var(--badge-github-text);
}

[data-theme="dark"] .source-rss {
  background: rgba(251, 146, 60, 0.1);
  color: var(--badge-rss-text);
}

[data-theme="dark"] .source-youtube_channel {
  background: rgba(248, 113, 113, 0.1);
  color: var(--badge-youtube-text);
}

[data-theme="dark"] .source-x_account {
  background: rgba(209, 213, 219, 0.1);
  color: var(--badge-x-text);
}

[data-theme="dark"] .source-website {
  background: rgba(96, 165, 250, 0.1);
  color: var(--badge-website-text);
}

/* ================================================================
   Email Verification Banner
   ================================================================ */

.verification-banner {
  background: #FFFBEB;
  border: 1px solid #F59E0B;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.verification-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
}

.verification-banner-message {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #92400E;
  line-height: 1.4;
}

.verification-banner-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: #D97706;
}

.verification-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.verification-resend-btn {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #92400E;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
  min-width: 44px;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.verification-resend-btn:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.25);
}

.verification-resend-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.verification-resend-feedback {
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.verification-resend-feedback.is-success {
  color: var(--status-success-text);
}

.verification-resend-feedback.is-error {
  color: var(--status-error-text);
}

.verification-dismiss-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  background: none;
  color: #92400E;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.15s ease;
  flex-shrink: 0;
}

.verification-dismiss-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

.verification-dismiss-btn:hover {
  background: rgba(245, 158, 11, 0.15);
}

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

/* Responsive: stack actions below message on narrow screens */
@media (max-width: 600px) {
  .verification-banner-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .verification-banner-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* Dark mode */
[data-theme="dark"] .verification-banner {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.3);
}

[data-theme="dark"] .verification-banner-message {
  color: #FCD34D;
}

[data-theme="dark"] .verification-banner-icon {
  color: #FBBF24;
}

[data-theme="dark"] .verification-resend-btn {
  color: #FCD34D;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.25);
}

[data-theme="dark"] .verification-resend-btn:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .verification-dismiss-btn {
  color: #FCD34D;
}

[data-theme="dark"] .verification-dismiss-btn:hover {
  background: rgba(245, 158, 11, 0.12);
}

[data-theme="dark"] .verification-resend-feedback.is-success {
  color: #4ADE80;
}

[data-theme="dark"] .verification-resend-feedback.is-error {
  color: #F87171;
}

/* ================================================================
   Verify Email Page
   ================================================================ */

.verify-email-page {
  text-align: center;
  padding: 2rem 0;
}

.verify-email-state {
  display: none;
}

.verify-email-state.is-active {
  display: block;
}

.verify-email-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1.25rem;
}

.verify-email-icon.icon-success {
  color: var(--status-success);
}

.verify-email-icon.icon-error {
  color: var(--status-error);
}

.verify-email-icon.icon-loading {
  color: var(--accent);
}

.verify-email-title {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
}

.verify-email-message {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.verify-email-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: white;
  background: var(--accent-hover);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  transition: opacity 0.15s ease;
  text-decoration: none;
}

.verify-email-action:hover {
  opacity: 0.9;
}

.verify-email-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.verify-email-action.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-input);
}

.verify-email-action.btn-secondary:hover {
  background: var(--surface-subtle);
  opacity: 1;
}

.verify-email-countdown {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.verify-email-resend-feedback {
  font-size: 0.8125rem;
  font-weight: 500;
  margin-top: 0.75rem;
}

.verify-email-resend-feedback.is-success {
  color: var(--status-success-text);
}

.verify-email-resend-feedback.is-error {
  color: var(--status-error-text);
}

/* Dark mode */
[data-theme="dark"] .verify-email-action {
  background: var(--accent);
}

[data-theme="dark"] .verify-email-action.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--border-default);
}

[data-theme="dark"] .verify-email-action.btn-secondary:hover {
  background: var(--surface-subtle);
}

[data-theme="dark"] .verify-email-resend-feedback.is-success {
  color: #4ADE80;
}

[data-theme="dark"] .verify-email-resend-feedback.is-error {
  color: #F87171;
}

/* ================================================================
   Settings Verification Required Block
   ================================================================ */

.verification-required {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  min-height: 40vh;
}

.verification-required-icon {
  width: 3rem;
  height: 3rem;
  color: #D97706;
  margin-bottom: 1.25rem;
}

.verification-required h2 {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
}

.verification-required p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0;
  max-width: 24rem;
  line-height: 1.5;
}

/* Dark mode */
[data-theme="dark"] .verification-required-icon {
  color: #FBBF24;
}
