/*
Theme Name: Modern Responsive Theme
Theme URI: https://example.com
Author: Your Name
Author URI: https://example.com
Description: A modern, responsive WordPress theme with dark mode, custom widgets, and LLM-friendly markup
Version: 3.8
License: GPL v2 or later
Text Domain: modern-theme
*/

:root {
  --primary-color: #f5f5f5;
  --secondary-color: #e0e0e0;
  --text-color: #333;
  --heading-color: #1a1a1a;
  --border-color: #ddd;
  --link-color: #0066cc;
  --link-hover: #0052a3;
  --sidebar-bg: #fafafa;
  --card-shadow: 0 2px 4px rgba(0,0,0,0.1);
  --max-width: 1200px;
}

[data-theme="dark"] {
  --primary-color: #1a1a1a;
  --secondary-color: #2d2d2d;
  --text-color: #e0e0e0;
  --heading-color: #f5f5f5;
  --border-color: #404040;
  --link-color: #66b3ff;
  --link-hover: #4d9fff;
  --sidebar-bg: #222;
  --card-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Dark mode specific link styling for single posts */
[data-theme="dark"] .post-body a {
  color: #ffffff !important;
  text-decoration: underline;
  text-decoration-color: #ffffff;
}

[data-theme="dark"] .post-body a:hover {
  color: #e0e0e0 !important;
  text-decoration-color: #e0e0e0;
}

/* Breadcrumbs */
.breadcrumbs {
  background-color: var(--secondary-color);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
  font-size: 0.85rem;
}

.breadcrumb-list {
  display: flex !important;
  align-items: center !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  min-height: 20px;
}

.breadcrumb-list li {
  display: inline-block !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

.breadcrumb-list li:not(:last-child)::after {
  content: " > ";
  color: var(--text-color);
  opacity: 0.6;
  padding: 0 4px;
}

.breadcrumb-list a {
  color: var(--link-color) !important;
  text-decoration: none !important;
  transition: color 0.3s ease;
  white-space: nowrap !important;
  display: inline !important;
}

.breadcrumb-list a:hover {
  color: var(--link-hover) !important;
  text-decoration: underline !important;
}

.breadcrumb-list span {
  color: var(--text-color) !important;
  opacity: 0.8;
  white-space: nowrap !important;
  display: inline !important;
}

/* Sticky Widget */
.sticky-widget-container {
  position: fixed;
  top: 120px;
  right: calc((100vw - var(--max-width)) / 2 - 20px);
  width: 280px;
  z-index: 1000;
  margin-bottom: 20px;
}

/* Fallback for smaller screens */
@media (max-width: 1240px) {
  .sticky-widget-container {
    right: 20px;
  }
}

.sticky-widget-active {
  background-color: var(--secondary-color);
  border: 2px solid var(--link-color);
  border-radius: 8px;
  padding: 15px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}

.sticky-widget-active:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

[data-theme="dark"] .sticky-widget-active {
  border-color: var(--link-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.sticky-widget-active h3,
.sticky-widget-active h4 {
  color: var(--link-color);
  margin-bottom: 10px;
}

.sticky-widget-active::before {
  content: "📌 Sticky Widget";
  display: block;
  font-size: 0.7rem;
  color: var(--link-color);
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

html {
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--primary-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

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

/* Header Styles */
header.site-header {
  background-color: var(--secondary-color);
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 0 !important;
  left: 0;
  right: 0;
  width: 100% !important;
  z-index: 1000 !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Force fixed positioning */
header.site-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 9999 !important;
}

/* Add space for fixed header */
main#main-content {
  padding-top: 100px;
}

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

.site-branding h1 {
  font-size: 1.8rem;
  color: var(--heading-color);
}

.site-branding a {
  text-decoration: none;
  color: inherit;
}

/* Navigation */
nav.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 30px;
}

nav.main-navigation a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

nav.main-navigation a:hover {
  color: var(--link-hover);
}

/* Social Icons */
.social-icons {
  display: flex;
  gap: 15px;
  align-items: center;
}

.social-icons a {
  color: var(--text-color);
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.social-icons a:hover {
  transform: translateY(-2px);
}

/* Homepage Hero Section */
.hero-section {
  padding: 60px 0;
  background-color: var(--primary-color);
}

.hero-content {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: center;
}

.hero-image img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--card-shadow);
}

.hero-text h2 {
  font-size: 2.5rem;
  color: var(--heading-color);
  margin-bottom: 10px;
}

.hero-text p {
  font-size: 1.2rem;
  color: var(--text-color);
  opacity: 0.9;
}

/* Cited In Section */
.cited-section {
  padding: 40px 0;
  background-color: var(--secondary-color);
}

.cited-section h3 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--heading-color);
}

.cited-logos {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  align-items: center;
}

.cited-logos img {
  width: 100%;
  max-width: 150px;
  height: auto;
  filter: grayscale(100%);
  opacity: 0.7;
  transition: all 0.3s ease;
}

.cited-logos img:hover {
  filter: grayscale(0%);
  opacity: 1;
}

/* Category Sections */
.featured-category {
  background-color: var(--sidebar-bg);
  border: 2px solid var(--link-color);
  border-radius: 12px;
  margin: 20px 0;
  padding: 20px 0;
}

.category-title {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
}

.featured-badge {
  background: linear-gradient(45deg, var(--link-color), var(--link-hover));
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-divider {
  margin: 60px 0;
  text-align: center;
}

.category-divider .container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.divider-line {
  flex: 1;
  border: none;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--border-color), transparent);
}

.divider-text {
  background-color: var(--primary-color);
  padding: 10px 20px;
  border: 2px solid var(--border-color);
  border-radius: 25px;
  font-weight: 600;
  color: var(--heading-color);
  white-space: nowrap;
}

.other-category {
  margin: 20px 0;
}

/* Post Grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  padding: 40px 0;
}

.post-card {
  background-color: var(--sidebar-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease;
}

.post-card:hover {
  transform: translateY(-5px);
}

.post-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-card-content {
  padding: 20px;
}

.post-card h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

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

.post-meta {
  color: var(--text-color);
  opacity: 0.7;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.post-dates {
  margin-bottom: 10px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  background-color: var(--secondary-color);
  padding: 10px;
  border-radius: 4px;
  border-left: 3px solid var(--link-color);
}

.post-dates time {
  display: block;
  margin-bottom: 5px;
}

.post-dates time:last-child {
  margin-bottom: 0;
}

.post-dates strong {
  color: var(--heading-color);
  opacity: 1;
}

.post-meta-info {
  font-size: 0.9rem;
}

/* Single Post Layout */
.single-post-container {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  gap: 30px;
  padding: 40px 0;
}

.single-post-container-single-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
  padding: 40px 0;
}

/* Left Sidebar */
.left-sidebar {
  position: relative;
}

/* Author Box */
.author-box {
  background-color: var(--sidebar-bg);
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 12px;
  box-shadow: var(--card-shadow);
  border-left: 3px solid var(--link-color);
  position: -webkit-sticky;
  position: sticky !important;
  top: 20px !important;
  z-index: 100 !important;
}

.author-avatar {
  text-align: center;
  margin-bottom: 8px;
}

.author-avatar img {
  border-radius: 50%;
  border: 1px solid var(--link-color);
  transition: transform 0.3s ease;
  width: 40px;
  height: 40px;
}

.author-avatar img:hover {
  transform: scale(1.05);
}

.author-name {
  margin: 0 0 4px 0;
  text-align: center;
  font-size: 0.7rem;
}

.author-name a {
  color: var(--heading-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.author-name a:hover {
  color: var(--link-color);
}

.author-description {
  font-size: 0.6rem;
  line-height: 1.2;
  color: var(--text-color);
  opacity: 0.8;
  text-align: center;
  margin-bottom: 6px;
}

.author-meta {
  text-align: center;
  font-size: 0.55rem;
  color: var(--text-color);
  opacity: 0.7;
  border-top: 1px solid var(--border-color);
  padding-top: 6px;
}

.author-meta a {
  color: var(--link-color);
  text-decoration: none;
}

.author-meta a:hover {
  text-decoration: underline;
}

/* Table of Contents */
.table-of-contents {
  background-color: var(--sidebar-bg);
  padding: 8px;
  border-radius: 6px;
}

.table-of-contents h3 {
  margin-bottom: 6px;
  font-size: 0.65rem;
  color: var(--heading-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.toc-list li {
  margin-bottom: 3px;
}

.toc-list a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.6rem;
  transition: color 0.3s ease;
  line-height: 1.2;
  display: block;
}

.toc-list a:hover {
  color: var(--link-hover);
}

/* Main Content */
.post-content {
  background-color: var(--sidebar-bg);
  padding: 30px;
  border-radius: 8px;
}

article.post h1 {
  font-size: 2.2rem;
  margin-bottom: 20px;
  color: var(--heading-color);
}

article.post h2 {
  font-size: 1.8rem;
  margin: 30px 0 15px;
  color: var(--heading-color);
}

article.post h3 {
  font-size: 1.4rem;
  margin: 25px 0 12px;
  color: var(--heading-color);
}

article.post p {
  margin-bottom: 15px;
  line-height: 1.7;
}

article.post img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 20px 0;
}

article.post ul, article.post ol {
  margin: 15px 0 15px 30px;
}

article.post li {
  margin-bottom: 8px;
}

article.post blockquote {
  border-left: 4px solid var(--link-color);
  padding-left: 20px;
  margin: 20px 0;
  font-style: italic;
  color: var(--text-color);
  opacity: 0.9;
}

/* Sidebar */
.post-sidebar {
  position: sticky;
  top: 20px;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
}

.sidebar-widget {
  background-color: var(--sidebar-bg);
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 15px;
  flex-shrink: 0;
}

.sidebar-widget h3 {
  margin-bottom: 6px;
  font-size: 0.65rem;
  color: var(--heading-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.widget-post-list {
  list-style: none;
}

.widget-post-list li {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.widget-post-list li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.widget-post-list a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.6rem;
  line-height: 1.2;
  display: block;
}

.widget-post-list a:hover {
  color: var(--link-hover);
}

.widget-post-meta {
  font-size: 0.5rem;
  color: var(--text-color);
  opacity: 0.6;
  margin-top: 2px;
  line-height: 1.1;
}

/* Trending Posts Widget */
.trending-posts-list .trending-indicator {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 2px;
  font-size: 0.5rem;
  color: #ff6b35;
  font-weight: 500;
}

.trending-posts-list .trending-indicator svg {
  color: #ff6b35;
}

.trending-posts-list li {
  position: relative;
  padding-left: 15px;
}

.trending-posts-list li::before {
  content: "🔥";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 10px;
}

.trending-posts-list a {
  font-weight: 600;
  color: var(--heading-color);
}

.trending-posts-list a:hover {
  color: #ff6b35;
}

/* Blog Page */
.blog-container {
  padding: 40px 0;
}

.blog-posts {
  display: grid;
  gap: 30px;
}

.blog-post {
  background-color: var(--sidebar-bg);
  padding: 30px;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}

.blog-post h2 {
  margin-bottom: 15px;
  font-size: 1.8rem;
}

.blog-post h2 a {
  color: var(--heading-color);
  text-decoration: none;
}

.blog-post-excerpt {
  margin: 15px 0;
  line-height: 1.6;
}

.read-more {
  display: inline-block;
  margin-top: 10px;
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
}

.read-more:hover {
  color: var(--link-hover);
}

/* Footer */
footer.site-footer {
  background-color: var(--secondary-color);
  padding: 40px 0 20px;
  border-top: 1px solid var(--border-color);
  margin-top: 60px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 30px;
}

.footer-widget h3 {
  margin-bottom: 15px;
  color: var(--heading-color);
}

.footer-widget ul {
  list-style: none;
}

.footer-widget li {
  margin-bottom: 10px;
}

.footer-widget a {
  color: var(--text-color);
  text-decoration: none;
}

.footer-widget a:hover {
  color: var(--link-hover);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  color: var(--text-color);
  opacity: 0.7;
}

/* Dark Mode Toggle */
.theme-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--secondary-color);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease;
  z-index: 1000;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .cited-logos {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .single-post-container {
    grid-template-columns: 1fr 280px;
  }
  
  .single-post-container-single-sidebar {
    grid-template-columns: 1fr 280px;
  }
  
  .left-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  header.site-header {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding-left: calc(50vw - 50%);
    padding-right: calc(50vw - 50%);
  }
  
  .header-content {
    position: relative;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
  }
  
  .mobile-menu-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
  }
  
  nav.main-navigation ul {
    flex-direction: column;
    gap: 15px;
    text-align: left;
  }
  
  .breadcrumbs {
    padding: 8px 0;
    font-size: 0.75rem;
  }
  
  .breadcrumb-list li:not(:last-child)::after {
    margin: 0 6px;
  }
  
  .sticky-widget-container {
    position: static;
    margin-bottom: 15px;
  }
  
  .sticky-widget-active {
    padding: 12px;
  }
  
  .sticky-widget-active::before {
    font-size: 0.6rem;
    margin-bottom: 6px;
  }
  
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-image {
    margin: 0 auto;
  }
  
  .cited-logos {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .post-grid {
    grid-template-columns: 1fr;
  }
  
  .single-post-container {
    grid-template-columns: 1fr;
  }
  
  .single-post-container-single-sidebar {
    grid-template-columns: 1fr;
  }
  
  .post-sidebar {
    position: static;
    margin-top: 40px;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-text h2 {
    font-size: 1.8rem;
  }
  
  .hero-text p {
    font-size: 1rem;
  }
  
  article.post h1 {
    font-size: 1.8rem;
  }
  
  .post-content {
    padding: 20px;
  }
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 40px 0;
}

.pagination a, .pagination span {
  padding: 8px 12px;
  background-color: var(--sidebar-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

.pagination a:hover {
  background-color: var(--link-color);
  color: white;
}

.pagination .current {
  background-color: var(--link-color);
  color: white;
}

/* Accessibility */
.screen-reader-text {
  position: absolute;
  left: -9999px;
}

/* Print Styles */
@media print {
  .theme-toggle,
  .social-icons,
  .table-of-contents,
  .post-sidebar,
  footer {
    display: none;
  }
  
  body {
    color: black;
    background: white;
  }
  
  article.post {
    max-width: 100%;
  }
}