/* ==========================================================================
   AI News Platform - Main Stylesheet
   Optimized for performance, SEO, and WCAG AAA accessibility
   ========================================================================== */

/* ==========================================================================
   CSS Variables (Design Tokens) - Dark Mode with AAA Contrast
   ========================================================================== */
:root {
  /* Dark Mode Backgrounds - Pure black for maximum contrast */
  --header-bg: #000000;
  --footer-bg: #000000;
  --body-bg: #000000;
  --card-bg: #1a1a1a;
  
  /* Text Colors - AAA Contrast Ratios */
  --text-dark: #ffffff;  /* White text on black: 21:1 contrast (exceeds AAA) */
  --text-light: #ffffff;  /* White text: 21:1 contrast */
  --text-muted: #b3b3b3;  /* Light gray on black: 7.1:1 contrast (AAA compliant for normal text) */
  
  /* Accent Colors - Light colors for visibility on dark */
  --accent: #ffffff;  /* White accent for links/buttons */
  --accent-hover: #e0e0e0;  /* Slightly darker white for hover */
  
  /* Search Form */
  --search-bg: #1a1a1a;
  --search-input-bg: #1a1a1a;
  --search-input-text: #ffffff;
  --search-btn-bg: #ffffff;
  --search-btn-text: #000000;
  --search-btn-hover: #e0e0e0;
  
  /* Borders - Light borders on dark background */
  --border-color: rgba(255, 255, 255, 0.15);  /* Light border: 6.8:1 contrast */
  --border-dark: rgba(255, 255, 255, 0.25);  /* Darker light border: 8.5:1 contrast */
  
  /* Shadows - Light shadows for depth on dark background */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 6px 24px rgba(0, 0, 0, 0.7);
  
  /* Transitions */
  --transition-fast: 0.1s;
  --transition-base: 0.2s;
}

/* ==========================================================================
   Inline Critical CSS Blocks
   ========================================================================== */

/* inline:all start */
*, *::before, *::after {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
  background: #000000;
  color: #ffffff;
  font-family: 'Georgia', serif;
  line-height: 1.6;
  font-size: 16px;
}
body {
  min-height: 100vh;
}
a {
  color: #ffffff;
  text-decoration: none;
}
.site-header {
  background: var(--header-bg);
  color: var(--text-light);
  padding: 0;
}
.header-container,
.content-wrapper,
.article-wrapper,
.main-wrapper {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 40px;
  box-sizing: border-box;
}
.site-logo {
  font-size: 52px;
  font-weight: 900;
  margin: 0;
  letter-spacing: -0.02em;
  font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
}
.site-logo a {
  color: var(--text-light);
  text-decoration: none;
  transition: opacity var(--transition-base);
}
.site-logo a:hover {
  opacity: 0.9;
}
.site-logo a:focus-visible {
  outline-color: var(--text-light);
}
.search-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  background: var(--search-bg);
  padding: 0;
  border-radius: 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
  width: 100%;
}
.search-input {
  background: var(--search-input-bg);
  border: none;
  padding: 10px 15px;
  color: var(--search-input-text);
  font-size: 16px;
  width: 100%;
  font-family: 'Helvetica', Arial, sans-serif;
  min-width: 0;
}
.search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
.search-input:focus-visible {
  outline: 3px solid var(--text-light);
  outline-offset: 2px;
  background: var(--search-input-bg);
}
.search-btn {
  background: var(--search-btn-bg);
  border: none;
  padding: 10px 20px;
  color: var(--search-btn-text);
  font-size: 19px;
  font-weight: 900;
  font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
  cursor: pointer;
  transition: background var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-btn:hover {
  background: var(--search-btn-hover);
}
.search-btn:focus-visible {
  outline: 3px solid var(--search-btn-text);
  outline-offset: 2px;
}
.header-nav {
  width: 100%;
  padding: 15px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.header-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  justify-content: flex-start;
  gap: 40px;
  flex-wrap: wrap;
}
.header-nav li {
  margin: 0;
  padding: 0;
}
.header-nav a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 17px;
  font-weight: 900;
  font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
  transition: opacity var(--transition-base);
  display: block;
}
.header-nav a:hover {
  opacity: 0.8;
}
.header-nav a:focus-visible {
  outline-color: var(--text-light);
}
.main-wrapper {
  background: var(--body-bg);
  padding: 40px 0;
}
.main-wrapper ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-wrapper li {
  margin: 0 0 24px;
}
.language-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-family: 'Helvetica', Arial, sans-serif;
  color: var(--text-light);
}
.language-option {
  display: inline-flex;
  align-items: center;
  color: var(--text-light);
  text-decoration: none;
}
.language-option.language-current {
  font-weight: 700;
}
.article-title {
  font-size: 20px;
  font-weight: bold;
  margin: 0 0 15px 0;
  line-height: 1.3;
}
.article-title a {
  color: var(--text-dark);
  text-decoration: none;
  transition: color var(--transition-base);
}
.article-title a:hover {
  color: var(--accent);
}
.article-meta {
  display: flex;
  gap: 15px;
  font-size: 10px;
  font-family: 'Helvetica', Arial, sans-serif;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0;
}
.article-meta time {
  color: var(--text-light);
}
.article-meta span {
  color: var(--text-muted);
}
/* inline:all end */

/* inline:root start */
/* Add homepage-specific critical styles here */
/* inline:root end */

/* inline:article start */
/* Add article page critical styles here */
/* inline:article end */

/* inline:search start */
/* Add search page critical styles here */
/* inline:search end */

/* inline:topic start */
/* Add topic page critical styles here */
/* inline:topic end */

/* inline:author start */
/* Add author page critical styles here */
/* inline:author end */

/* inline:daily start */
/* Add daily index page critical styles here */
/* inline:daily end */

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--body-bg);
  color: var(--text-dark);
  font-family: 'Georgia', serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ==========================================================================
   Accessibility Utilities
   ========================================================================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* WCAG AAA: High contrast focus indicators */
:focus-visible {
  outline: 3px solid var(--text-light);
  outline-offset: 2px;
}

/* Ensure links maintain AAA contrast on dark background */
a {
  color: var(--accent);
}

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

/* ==========================================================================
   Header Styles
   ========================================================================== */

/* Search Form */

/* Navigation */
/* ==========================================================================
   Main Content Wrapper
   ========================================================================== */
.main-wrapper {
  background: var(--body-bg);
  padding: 40px 0;
}

.content-wrapper {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 344px;
  gap: 20px;
  margin-bottom: 50px;
}

.hero-main {
  background: var(--card-bg);
  min-height: 500px;
}

.hero-featured {
  position: relative;
  height: 100%;
}

.hero-image-link {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.hero-image-placeholder {
  position: relative;
  width: 100%;
  height: 500px;
  background: #2a2a2a;  /* Dark gray for image placeholders */
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  padding: 25px;
  color: var(--text-light);
}

.hero-title {
  font-size: 24px;
  font-weight: bold;
  margin: 0 0 10px 0;
  color: var(--text-light);
  line-height: 1.3;
}

.hero-meta {
  display: flex;
  gap: 15px;
  font-size: 10px;
  font-family: 'Helvetica', Arial, sans-serif;
  font-weight: 500;
  color: var(--text-light);
}

.hero-sidebar {
  background: var(--card-bg);
  padding: 15px;
}

.sidebar-featured {
  margin-bottom: 15px;
}

.sidebar-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.sidebar-image {
  width: 100%;
  height: 200px;
  background: #2a2a2a;  /* Dark gray for image placeholders */
  overflow: hidden;
  margin-bottom: 15px;
  position: relative;
}

.sidebar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sidebar-title {
  font-size: 20px;
  font-weight: bold;
  margin: 0 0 15px 0;
  line-height: 1.3;
}

.sidebar-title a {
  color: var(--text-dark);
  text-decoration: none;
  transition: color var(--transition-base);
}

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

.sidebar-meta {
  display: flex;
  gap: 15px;
  font-size: 10px;
  font-family: 'Helvetica', Arial, sans-serif;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.sidebar-excerpt {
  font-size: 16px;
  color: var(--accent);
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   Image Placeholder System
   ========================================================================== */
.image-placeholder {
  display: none;
  width: 100%;
  height: 100%;
  background: #2a2a2a;  /* Dark gray for image placeholders */
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);  /* Light text for visibility */
  font-size: 14px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.img-error {
  display: none !important;
}

.img-error + .image-placeholder {
  display: flex !important;
  z-index: 2;
}

.article-image-img:not(.img-error),
.trending-image img:not(.img-error),
.hero-img:not(.img-error),
.sidebar-img:not(.img-error) {
  display: block;
}

/* Redundant - base .image-placeholder already has these properties */

/* ==========================================================================
   Latest News Section
   ========================================================================== */
.latest-news {
  margin-top: 60px;
}

.section-header {
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-color);
}

.section-title {
  font-size: 33px;
  font-weight: normal;
  margin: 0;
  color: var(--text-dark);
}

.articles-grid {
  display: grid;
  grid-template-columns: 1fr 410px;
  gap: 40px;
}

/* ==========================================================================
   Trending Sidebar
   ========================================================================== */
.trending-sidebar {
  background: var(--card-bg);
  padding: 25px;
}

.trending-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.trending-title {
  font-size: 20px;
  font-weight: normal;
  margin: 0;
  color: var(--text-dark);
}

.view-all-btn {
  background: var(--accent);
  border: none;
  border-radius: 3px;
  padding: 5px 15px;
  color: #000000;  /* Black text on white button for contrast */
  font-size: 11px;
  font-family: 'Georgia', serif;
  cursor: pointer;
  transition: background var(--transition-base);
}

.view-all-btn:hover {
  background: var(--accent-hover);
  color: #000000;
}

.view-all-btn:focus-visible {
  outline-color: var(--text-light);
}

.trending-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.trending-item {
  display: flex;
  gap: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--border-color);
}

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

.trending-image {
  width: 140px;
  height: 100px;
  flex-shrink: 0;
  background: #2a2a2a;  /* Dark gray for image placeholders */
  overflow: hidden;
  position: relative;
}

.trending-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trending-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.trending-item-title {
  font-size: 15px;
  font-weight: normal;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.trending-item-title a {
  color: var(--text-dark);
  text-decoration: none;
  transition: color var(--transition-base);
}

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

.trending-item-excerpt {
  font-size: 10px;
  color: var(--accent);
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.trending-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  font-family: 'Helvetica', Arial, sans-serif;
  font-weight: 500;
  color: var(--text-muted);
}

/* ==========================================================================
   Articles Grid
   ========================================================================== */
.articles-main {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
}

.article-card {
  background: var(--card-bg);
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.article-card-large {
  grid-column: span 2;
  position: relative;
  padding: 0;
  min-height: 365px;
}

.article-card-large .article-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #2a2a2a;  /* Dark gray for image placeholders */
  overflow: hidden;
}

.article-card-large .article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card-large .article-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  padding: 25px;
  color: var(--text-light);
}

.article-card-large .article-title {
  color: var(--text-light);
  font-size: 20px;
}

.article-card-large .article-meta {
  color: var(--text-light);
}

.article-image {
  width: 100%;
  height: 254px;
  background: #2a2a2a;  /* Dark gray for image placeholders */
  overflow: hidden;
  margin-bottom: 10px;
  position: relative;
}

.article-card-large .article-image {
  height: 100%;
  margin-bottom: 0;
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-horizontal {
  display: flex;
  gap: 25px;
  padding: 25px 0;
  border-bottom: 1px solid var(--border-color);
}

.article-horizontal:last-child {
  border-bottom: none;
}

.article-horizontal .article-image {
  width: 106px;
  height: 110px;
  flex-shrink: 0;
  margin: 0;
}

.article-horizontal .article-content {
  flex: 1;
}

.article-horizontal .article-title {
  font-size: 15px;
  margin-bottom: 10px;
}

.article-horizontal .article-excerpt {
  font-size: 10px;
  margin: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--footer-bg);
  color: var(--text-light);
  padding: 40px 0;
  margin-top: 60px;
}

.footer-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px;
}

.footer-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
}

.footer-links-left {
  display: flex;
  gap: 40px;
}

.footer-links-left a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 17px;
  font-weight: 300;
  font-family: 'Helvetica', Arial, sans-serif;
  transition: opacity var(--transition-base);
}

.footer-links-left a:hover {
  opacity: 0.8;
}

.footer-links-left a:focus-visible {
  outline-color: var(--text-light);
}

.footer-nav-categories {
  display: flex;
  gap: 40px;
}

.footer-category-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.footer-category-group a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 17px;
  font-weight: 900;
  font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
  transition: opacity var(--transition-base);
}

.footer-category-group a:hover {
  opacity: 0.8;
}

.footer-category-group a:focus-visible {
  outline-color: var(--text-light);
}

.footer-copyright {
  text-align: center;
  font-size: 17px;
  font-weight: 300;
  font-family: 'Helvetica', Arial, sans-serif;
  color: var(--text-light);
  margin-top: 20px;
}

/* ==========================================================================
   Article Page Styles
   ========================================================================== */
.article-page {
  background: var(--card-bg);
  margin: 0;
  padding: 0;
}

.article-wrapper {
  max-width: 930px;
  margin: 0 auto;
  background: var(--card-bg);
  position: relative;
}

.article-hero {
  position: relative;
  width: 100%;
  height: 398px;
  overflow: hidden;
  background: #2a2a2a;  /* Dark gray for image placeholders */
  margin-bottom: 24px;
}

.article-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-close-btn {
  position: absolute;
  top: 25px;
  right: 25px;
  width: 49px;
  height: 49px;
  background: var(--card-bg);
  border: none;
  border-radius: 29.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-base);
  z-index: 10;
}

.article-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);  /* Light hover on dark background */
}

.article-close-btn:focus-visible {
  outline-color: var(--text-dark);
}

.close-icon {
  position: relative;
  width: 24px;
  height: 24px;
}

.close-icon::before,
.close-icon::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 24px;
  background: var(--text-light);  /* White X on dark button */
  top: 50%;
  left: 50%;
}

.close-icon::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.close-icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.article-content {
  padding: 0 175px;
  max-width: 930px;
  margin: 0 auto;
}

.article-header {
  margin-bottom: 25px;
}

.article-title-main {
  font-family: 'Georgia', serif;
  font-size: 26px;
  font-weight: bold;
  line-height: 1.3;
  color: var(--text-dark);
  margin: 0 0 15px 0;
}

.article-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}

.article-author-info {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 1;
}

.author-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
}

.author-avatar svg {
  width: 100%;
  height: 100%;
}

.article-meta-text {
  display: flex;
  gap: 20px;
  align-items: center;
  font-family: 'Helvetica', Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dark);
}

.article-author {
  font-weight: 500;
}

.article-time,
.article-read-time {
  color: var(--text-dark);
}

.article-social {
  display: flex;
  gap: 10px;
  align-items: center;
}

.social-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  border-radius: 4px;
  transition: opacity var(--transition-base);
}

.social-btn:hover {
  opacity: 0.7;
}

.social-btn:focus-visible {
  outline-color: var(--text-dark);
}

.social-btn svg {
  width: 100%;
  height: 100%;
  display: block;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px auto 30px;
  padding: 0 175px;
  max-width: 930px;
}

.topic-tag {
  display: inline-block;
  padding: 6px 16px;
  background: var(--accent);
  color: #000000;  /* Black text on white tag */
  text-decoration: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Helvetica', Arial, sans-serif;
  transition: background var(--transition-base), transform var(--transition-fast);
  white-space: nowrap;
}

.topic-tag:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  color: #000000;  /* Black text on light hover */
}

.topic-tag:active {
  transform: translateY(0);
}

.topic-tag:focus-visible {
  outline-color: var(--text-light);
}

.article-body {
  font-family: 'Georgia', serif;
  font-size: 20px;
  line-height: 1.6;
  color: var(--text-dark);
  max-width: 580px;
  margin: 0 auto;
}

.article-body p {
  margin: 0 0 1.5em 0;
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body figure {
  margin: 2em 0;
  width: 100%;
}

.article-body figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
}

.article-body figcaption {
  font-family: 'Georgia', serif;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.4;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border-dark);
  margin: 2em 0;
  width: 75%;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   Author Page Styles
   ========================================================================== */
.author-page {
  background: var(--body-bg);
}

.author-wrapper {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px;
  background: var(--body-bg);
}

.author-content {
  background: var(--card-bg);
  padding: 0;
  max-width: 100%;
}

.author-header {
  display: flex;
  gap: 40px;
  padding: 40px;
  border-bottom: 2px solid var(--border-color);
  align-items: flex-start;
}

.author-photo-container {
  flex-shrink: 0;
}

.author-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
  box-shadow: var(--shadow-md);
}

.author-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.author-name {
  font-size: 42px;
  font-weight: bold;
  margin: 0;
  color: var(--text-dark);
  font-family: 'Georgia', serif;
  line-height: 1.2;
}

.author-meta {
  font-size: 16px;
  color: var(--text-muted);
  font-family: 'Helvetica', Arial, sans-serif;
  line-height: 1.6;
}

.author-social {
  display: flex;
  gap: 15px;
  align-items: center;
}

.author-social a {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: opacity var(--transition-base);
}

.author-social a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.author-social a:focus-visible {
  outline-color: var(--accent);
}

.author-bio {
  padding: 40px;
  border-bottom: 2px solid var(--border-color);
}

.author-bio h2 {
  font-size: 28px;
  font-weight: bold;
  margin: 0 0 20px 0;
  color: var(--text-dark);
  font-family: 'Georgia', serif;
}

.author-bio p {
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-dark);
  font-family: 'Georgia', serif;
  margin: 0;
}

.author-articles {
  padding: 40px;
}

.author-articles h2 {
  font-size: 28px;
  font-weight: bold;
  margin: 0 0 30px 0;
  color: var(--text-dark);
  font-family: 'Georgia', serif;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-color);
}

.articles-list {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.articles-list .loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 16px;
  font-family: 'Helvetica', Arial, sans-serif;
}

.article-preview {
  padding: 25px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.article-preview:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.article-preview h3 {
  font-size: 22px;
  font-weight: bold;
  margin: 0 0 15px 0;
  line-height: 1.4;
  font-family: 'Georgia', serif;
}

.article-preview h3 a {
  color: var(--text-dark);
  text-decoration: none;
  transition: color var(--transition-base);
}

.article-preview h3 a:hover {
  color: var(--accent);
}

.article-preview h3 a:focus-visible {
  outline-color: var(--accent);
}

.article-preview .article-meta {
  display: flex;
  gap: 15px;
  align-items: center;
  font-size: 12px;
  font-family: 'Helvetica', Arial, sans-serif;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.article-preview .article-meta time {
  color: var(--text-muted);
}

.article-preview .article-topic {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent);
  color: #000000;  /* Black text on white tag */
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.article-preview .article-excerpt {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-dark);
  font-family: 'Georgia', serif;
  margin: 0;
}

/* ==========================================================================
   Search Results Page
   ========================================================================== */
.search-results-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0;
}

.search-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}

.search-header h1 {
  font-size: 33px;
  font-weight: normal;
  margin: 0 0 20px 0;
  color: var(--text-dark);
}

.search-results-info {
  color: var(--text-muted);
  font-size: 14px;
  font-family: 'Helvetica', Arial, sans-serif;
  margin-bottom: 20px;
}

.search-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-result-item {
  padding: 25px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-bg);
  transition: box-shadow var(--transition-base);
}

.search-result-item:hover {
  box-shadow: var(--shadow-md);
}

.search-result-item a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.search-result-title {
  font-size: 22px;
  font-weight: bold;
  margin: 0 0 10px 0;
  line-height: 1.4;
  font-family: 'Georgia', serif;
  color: var(--text-dark);
}

.search-result-title a {
  color: var(--text-dark);
  transition: color var(--transition-base);
}

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

.search-result-meta {
  font-size: 12px;
  font-family: 'Helvetica', Arial, sans-serif;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.search-result-description {
  color: var(--text-dark);
  line-height: 1.6;
  font-size: 16px;
  font-family: 'Georgia', serif;
  margin: 0;
}

.search-result-topic {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent);
  color: #000000;  /* Black text on white tag */
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Helvetica', Arial, sans-serif;
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.no-results-icon {
  font-size: 4em;
  margin-bottom: 20px;
}

.no-results h2 {
  font-size: 24px;
  margin: 0 0 10px 0;
  color: var(--text-dark);
}

.no-results p {
  font-size: 16px;
  margin: 0;
  color: var(--text-muted);
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 16px;
  font-family: 'Helvetica', Arial, sans-serif;
}

.spinner {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.highlight {
  background: rgba(255, 255, 0, 0.3);  /* Yellow highlight for dark mode */
  color: #000000;  /* Black text on yellow highlight */
  padding: 2px 4px;
  border-radius: 2px;
}

/* ==========================================================================
   Legacy Styles (for day pages and admin)
   ========================================================================== */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px;
  background: var(--body-bg);
}

nav {
  margin-bottom: 20px;
}

nav a {
  margin-right: 12px;
  color: var(--accent);
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

h1 {
  font-size: 28px;
  margin: 0 0 16px;
  color: var(--text-dark);
}

h2 {
  font-size: 20px;
  margin: 12px 0;
  color: var(--text-dark);
}

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

a:hover {
  text-decoration: underline;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.list li:last-child {
  border-bottom: 0;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-item a {
  flex: 1;
}

.delete-btn {
  background: var(--accent);
  color: #000000;  /* Black text on white button */
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  transition: opacity var(--transition-base), background var(--transition-base), transform var(--transition-fast);
  flex-shrink: 0;
  padding: 0;
  margin: 0;
}

.delete-btn:hover {
  opacity: 1;
  background: var(--accent-hover);
}

.delete-btn:active {
  transform: scale(0.95);
}

.delete-btn:focus-visible {
  outline-color: var(--accent);
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #000000;  /* Black text on white badge */
  font-size: 12px;
}

/* ==========================================================================
   Pagination Styles
   ========================================================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 40px 0;
  padding: 20px 0;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  font-family: 'Helvetica', Arial, sans-serif;
  font-size: 16px;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background var(--transition-base), color var(--transition-base);
}

.pagination a {
  color: var(--accent);
  border: 1px solid var(--border-color);
}

.pagination a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-hover);
}

.pagination a:focus-visible {
  outline: 3px solid var(--text-light);
  outline-offset: 2px;
}

.pagination .pagination-current {
  background: var(--accent);
  color: #000000;  /* Black text on white background */
  font-weight: 600;
  border: 1px solid var(--accent);
}

.pagination .pagination-disabled {
  color: var(--text-disabled);
  cursor: not-allowed;
}

.pagination .pagination-ellipsis {
  color: var(--text-muted);
  padding: 8px 4px;
}

.pagination .pagination-pages {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 1200px) {
  .content-wrapper {
    padding: 0 20px;
  }
  
  .header-container {
    padding: 20px;
  }
  
  .articles-grid {
    grid-template-columns: 1fr;
  }
  
  .trending-sidebar {
    order: -1;
  }
  
  .hero-section {
    grid-template-columns: 1fr;
  }
  
  .articles-main {
    grid-template-columns: 1fr;
  }
  
  .article-card-large {
    grid-column: span 1;
  }
  
  .article-content {
    padding: 0 40px;
  }
  
  .article-body {
    max-width: 100%;
  }
  
  .author-wrapper {
    padding: 30px 20px;
  }
  
  .author-header {
    padding: 30px 20px;
  }
  
  .author-bio {
    padding: 30px 20px;
  }
  
  .author-articles {
    padding: 30px 20px;
  }
}

@media (max-width: 768px) {
  .search-bar {
    width: 100%;
  }
  
  .search-input {
    width: 100%;
    flex: 1;
  }
  
  .header-nav {
    flex-wrap: wrap;
    gap: 20px;
  }
  
  .footer-nav {
    flex-direction: column;
    gap: 30px;
  }
  
  .footer-links-left {
    flex-wrap: wrap;
    gap: 20px;
  }
  
  .article-content {
    padding: 0 20px;
  }
  
  .article-tags {
    padding: 0 20px;
  }
  
  .article-hero {
    height: 250px;
  }
  
  .article-title-main {
    font-size: 22px;
  }
  
  .article-body {
    font-size: 18px;
  }
  
  .article-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .author-wrapper {
    padding: 20px;
  }
  
  .author-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 30px;
    padding: 30px 20px;
  }
  
  .author-photo {
    width: 150px;
    height: 150px;
  }
  
  .author-name {
    font-size: 32px;
  }
  
  .author-info {
    align-items: center;
  }
  
  .author-bio {
    padding: 30px 20px;
  }
  
  .author-bio h2 {
    font-size: 24px;
  }
  
  .author-bio p {
    font-size: 16px;
  }
  
  .author-articles {
    padding: 30px 20px;
  }
  
  .author-articles h2 {
    font-size: 24px;
  }
  
  .article-preview {
    padding: 20px;
  }
  
  .article-preview h3 {
    font-size: 20px;
  }
  
  .article-preview .article-excerpt {
    font-size: 15px;
  }
}
