/*
Theme Name: XuzPost Modern News Theme
Theme URI: https://example.com/xuzpost-theme
Author: Your Name
Author URI: https://example.com
Description: A modern, fast, and responsive WordPress news/blog theme with clean design, featured posts, category sections, dark mode support, and SEO optimization.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: xuzpost-theme
Tags: blog, news, magazine, responsive, dark-mode, seo-friendly, custom-header, custom-menu, featured-images, threaded-comments
*/

/* ===========================
   CSS VARIABLES
   =========================== */
:root {
  --primary-color: #2563eb;
  --secondary-color: #1e40af;
  --text-color: #1f2937;
  --text-secondary: #6b7280;
  --bg-color: #ffffff;
  --bg-secondary: #f9fafb;
  --border-color: #e5e7eb;
  --hover-color: #3b82f6;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.1);
  --card-hover-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

[data-theme="dark"] {
  --primary-color: #3b82f6;
  --secondary-color: #60a5fa;
  --text-color: #f9fafb;
  --text-secondary: #9ca3af;
  --bg-color: #111827;
  --bg-secondary: #1f2937;
  --border-color: #374151;
  --hover-color: #60a5fa;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.3);
  --card-hover-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* ===========================
   RESET & BASE STYLES
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

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

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

/* ===========================
   CONTAINER & LAYOUT
   =========================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-main {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 30px;
  margin-top: 30px;
}

@media (max-width: 968px) {
  .site-main {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   HEADER
   =========================== */
.site-header {
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--card-shadow);
}

.header-top {
  background: var(--bg-secondary);
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.header-main {
  padding: 20px 0;
}

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

.site-branding {
  display: flex;
  align-items: center;
}

.site-logo {
  max-height: 50px;
  width: auto;
}

.site-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}

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

.site-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 5px 0 0;
}

/* ===========================
   NAVIGATION
   =========================== */
.main-navigation {
  display: flex;
  align-items: center;
  gap: 30px;
}

.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 25px;
  margin: 0;
}

.main-navigation li {
  position: relative;
}

.main-navigation a {
  color: var(--text-color);
  font-weight: 500;
  font-size: 15px;
  padding: 8px 0;
  display: block;
}

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

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 16px;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  
  .main-navigation ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color);
    flex-direction: column;
    padding: 20px;
    box-shadow: var(--card-shadow);
  }
  
  .main-navigation.toggled ul {
    display: flex;
  }
}

/* ===========================
   BREAKING NEWS TICKER
   =========================== */
.breaking-news {
  background: var(--primary-color);
  color: white;
  padding: 12px 0;
  overflow: hidden;
}

.breaking-news-content {
  display: flex;
  align-items: center;
  gap: 20px;
}

.breaking-label {
  font-weight: 700;
  background: rgba(255,255,255,0.2);
  padding: 5px 15px;
  border-radius: 4px;
  white-space: nowrap;
}

.breaking-news-items {
  display: flex;
  gap: 30px;
  animation: scroll 30s linear infinite;
}

.breaking-news-items a {
  color: white;
  white-space: nowrap;
}

@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===========================
   POST CARDS
   =========================== */
.post-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--card-shadow);
}

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

.post-thumbnail {
  position: relative;
  overflow: hidden;
  padding-top: 60%;
}

.post-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-thumbnail img {
  transform: scale(1.05);
}

.post-content {
  padding: 20px;
}

.post-categories {
  margin-bottom: 10px;
}

.post-categories a {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 5px;
}

.post-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin: 10px 0;
}

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

.post-excerpt {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin: 10px 0;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 15px;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.read-more {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 8px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  margin-top: 15px;
}

.read-more:hover {
  background: var(--secondary-color);
  color: white;
}

/* ===========================
   GRID LAYOUTS
   =========================== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   FEATURED POSTS
   =========================== */
.featured-posts {
  margin-bottom: 40px;
}

.featured-post-large {
  position: relative;
  height: 500px;
  border-radius: 12px;
  overflow: hidden;
}

.featured-post-large .post-thumbnail {
  padding-top: 0;
  height: 100%;
}

.featured-post-large .post-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  color: white;
  padding: 40px;
}

.featured-post-large .post-title {
  font-size: 32px;
  color: white;
}

.featured-post-large .post-categories a {
  background: var(--primary-color);
}

/* ===========================
   SIDEBAR
   =========================== */
.sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.widget {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: var(--card-shadow);
}

.widget-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-color);
}

.widget ul {
  list-style: none;
}

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

.widget li:last-child {
  border-bottom: none;
}

/* Trending Posts Widget */
.trending-post {
  display: flex;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-color);
}

.trending-post:last-child {
  border-bottom: none;
}

.trending-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 30px;
}

.trending-thumbnail {
  width: 80px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

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

.trending-content h4 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 5px;
}

.trending-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===========================
   SINGLE POST
   =========================== */
.single-post-header {
  margin-bottom: 30px;
}

.single-post-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 20px;
}

.single-post-featured-image {
  margin-bottom: 30px;
  border-radius: 12px;
  overflow: hidden;
}

.entry-content {
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-color);
}

.entry-content p {
  margin-bottom: 20px;
}

.entry-content h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 30px 0 15px;
}

.entry-content h3 {
  font-size: 24px;
  font-weight: 700;
  margin: 25px 0 12px;
}

.entry-content ul, .entry-content ol {
  margin: 20px 0;
  padding-left: 30px;
}

.entry-content li {
  margin-bottom: 10px;
}

/* Author Box */
.author-box {
  display: flex;
  gap: 20px;
  padding: 30px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin: 40px 0;
}

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

.author-info h4 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.author-bio {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Social Share */
.social-share {
  display: flex;
  gap: 10px;
  margin: 30px 0;
}

.share-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: white;
  background: var(--primary-color);
  transition: all 0.2s ease;
}

.share-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-hover-shadow);
  color: white;
}

.share-button.facebook { background: #1877f2; }
.share-button.twitter { background: #1da1f2; }
.share-button.linkedin { background: #0a66c2; }

/* Related Posts */
.related-posts {
  margin-top: 50px;
}

.related-posts h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 25px;
}

/* ===========================
   COMMENTS
   =========================== */
.comments-area {
  margin-top: 50px;
}

.comments-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 30px;
}

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

.comment {
  padding: 25px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 20px;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.comment-author img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
}

.comment-metadata {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===========================
   FOOTER
   =========================== */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: 60px;
}

.footer-widgets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  padding: 50px 0;
}

@media (max-width: 968px) {
  .footer-widgets {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 568px) {
  .footer-widgets {
    grid-template-columns: 1fr;
  }
}

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

.footer-widget h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

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

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

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

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

.site-info {
  text-align: center;
  padding: 25px 0;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 14px;
}

/* Social Icons */
.social-links {
  display: flex;
  gap: 10px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.social-links a:hover {
  transform: translateY(-3px);
  background: var(--secondary-color);
}

/* ===========================
   DARK MODE TOGGLE
   =========================== */
.dark-mode-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s ease;
}

.dark-mode-toggle:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* ===========================
   BREADCRUMBS
   =========================== */
.breadcrumbs {
  padding: 15px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.breadcrumbs a {
  color: var(--text-secondary);
}

.breadcrumbs a:hover {
  color: var(--primary-color);
}

.breadcrumbs span {
  margin: 0 8px;
}

/* ===========================
   SEARCH FORM
   =========================== */
.search-form {
  display: flex;
  gap: 5px;
}

.search-form input[type="search"] {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 14px;
}

.search-form button {
  padding: 10px 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}

.search-form button:hover {
  background: var(--secondary-color);
}

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

.pagination a,
.pagination span {
  padding: 10px 15px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
}

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

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

/* ===========================
   UTILITY CLASSES
   =========================== */
.section-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 3px solid var(--primary-color);
}

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

.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }