/*
Theme Name: AutoDrive
Theme URI: https://autodrive.com
Author: AutoDrive Team
Author URI: https://autodrive.com
Description: A modern automotive magazine theme featuring car reviews, buying guides, and automotive news. Clean, responsive design optimized for readability and engagement.
Version: 1.0.0
Requires at least: 5.9
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: autodrive
Tags: blog, news, magazine, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, responsive-layout

AutoDrive WordPress Theme, Copyright 2024 AutoDrive
AutoDrive is distributed under the terms of the GNU GPL
*/

/* ============================================
   CSS VARIABLES / DESIGN TOKENS
   ============================================ */
:root {
  --color-primary: #1e3a5f;
  --color-primary-foreground: #ffffff;
  --color-accent: #dc2626;
  --color-accent-foreground: #ffffff;
  --color-background: #f8fafc;
  --color-foreground: #0f172a;
  --color-muted: #64748b;
  --color-muted-foreground: #64748b;
  --color-card: #ffffff;
  --color-card-foreground: #0f172a;
  --color-border: #e2e8f0;
  --color-footer-bg: #0f172a;
  --color-footer-text: #cbd5e1;
  
  --font-heading: 'Oswald', sans-serif;
  --font-body: 'Source Sans Pro', sans-serif;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  
  --radius: 0.5rem;
  --transition: all 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-foreground);
  background-color: var(--color-background);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-foreground);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

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

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

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

ul, ol {
  list-style: none;
}

/* ============================================
   LAYOUT
   ============================================ */
.page-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

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

/* ============================================
   HEADER
   ============================================ */
.site-header {
  background-color: var(--color-primary);
  color: var(--color-primary-foreground);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

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

@media (min-width: 768px) {
  .header-inner {
    height: 80px;
  }
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  background-color: var(--color-accent);
  padding: 0.5rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg {
  width: 24px;
  height: 24px;
  fill: var(--color-accent-foreground);
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary-foreground);
}

/* Navigation */
.main-nav {
  display: none;
}

@media (min-width: 768px) {
  .main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
  }
}

.nav-link {
  font-weight: 500;
  color: var(--color-primary-foreground);
  opacity: 0.9;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  opacity: 1;
  color: var(--color-primary-foreground);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-accent);
  transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--color-primary-foreground);
  cursor: pointer;
  padding: 0.5rem;
}

@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
}

/* Mobile Navigation */
.mobile-nav {
  display: none;
  background-color: var(--color-primary);
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.mobile-nav.active {
  display: block;
}

@media (min-width: 768px) {
  .mobile-nav {
    display: none !important;
  }
}

.mobile-nav a {
  display: block;
  padding: 0.75rem 0;
  color: var(--color-primary-foreground);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-nav a:last-child {
  border-bottom: none;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
  background: linear-gradient(135deg, var(--color-primary) 0%, #2d4a6f 100%);
  color: var(--color-primary-foreground);
  padding: 4rem 0;
  text-align: center;
}

@media (min-width: 768px) {
  .hero-section {
    padding: 6rem 0;
  }
}

.hero-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--color-primary-foreground);
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3.5rem;
  }
}

.hero-subtitle {
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   ARTICLE CARDS
   ============================================ */
.articles-section {
  padding: 4rem 0;
}

.section-title {
  font-size: 1.75rem;
  margin-bottom: 2rem;
  position: relative;
  padding-bottom: 0.75rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background-color: var(--color-accent);
  border-radius: 2px;
}

.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .articles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Featured Article */
.featured-article {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 4rem;
  background-color: var(--color-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 1024px) {
  .featured-article {
    grid-template-columns: 1.5fr 1fr;
  }
}

.featured-article-image {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.featured-article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.featured-article:hover .featured-article-image img {
  transform: scale(1.05);
}

.featured-article-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-badge {
  display: inline-block;
  background-color: var(--color-accent);
  color: var(--color-accent-foreground);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 1rem;
  width: fit-content;
}

.featured-article-title {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .featured-article-title {
    font-size: 2rem;
  }
}

.featured-article-excerpt {
  color: var(--color-muted);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.read-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--color-primary);
  color: var(--color-primary-foreground);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: var(--transition);
  width: fit-content;
}

.read-more-btn:hover {
  background-color: var(--color-accent);
  color: var(--color-accent-foreground);
}

/* Article Card */
.article-card {
  background-color: var(--color-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.article-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.article-card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.article-card:hover .article-card-image img {
  transform: scale(1.05);
}

.article-card-content {
  padding: 1.5rem;
}

.article-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.article-card-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

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

.article-card-excerpt {
  color: var(--color-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.article-meta svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   SINGLE ARTICLE
   ============================================ */
.single-article {
  padding: 3rem 0;
}

.article-header {
  max-width: 800px;
  margin: 0 auto 2rem;
  text-align: center;
}

.article-header .article-category {
  margin-bottom: 1rem;
}

.article-title {
  font-size: 2rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .article-title {
    font-size: 2.5rem;
  }
}

.article-featured-image {
  max-width: 1000px;
  margin: 0 auto 2rem;
  border-radius: var(--radius);
  overflow: hidden;
}

.article-featured-image img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
}

.article-content p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.article-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.article-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-content ul {
  list-style: disc;
}

.article-content ol {
  list-style: decimal;
}

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

.article-content blockquote {
  border-left: 4px solid var(--color-accent);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--color-muted);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background-color: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 3rem 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

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

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-brand .site-logo {
  margin-bottom: 1rem;
}

.footer-brand .logo-text {
  color: #fff;
}

.footer-brand p {
  font-size: 0.875rem;
  opacity: 0.8;
  line-height: 1.7;
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  font-size: 0.875rem;
  opacity: 0.8;
  transition: var(--transition);
}

.footer-links a:hover {
  opacity: 1;
  color: var(--color-accent);
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  opacity: 0.8;
}

.footer-contact-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-bottom {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.875rem;
  opacity: 0.6;
}

/* ============================================
   PAGE TEMPLATES
   ============================================ */
.page-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, #2d4a6f 100%);
  color: var(--color-primary-foreground);
  padding: 4rem 0;
  text-align: center;
}

.page-title {
  font-size: 2.5rem;
  color: var(--color-primary-foreground);
}

.page-content {
  padding: 4rem 0;
}

.page-content .page-container {
  max-width: 800px;
}

.page-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.page-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

/* Contact Form */
.contact-form {
  max-width: 600px;
  margin: 2rem auto 0;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
}

.submit-btn {
  background-color: var(--color-primary);
  color: var(--color-primary-foreground);
  padding: 0.875rem 2rem;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

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

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: var(--radius);
  font-weight: 500;
  transition: var(--transition);
}

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

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

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

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  padding: 2rem 0;
}

.widget {
  background-color: var(--color-card);
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-accent);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }

.hidden { display: none; }

@media (min-width: 768px) {
  .md-show { display: block; }
  .md-hide { display: none; }
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   WORDPRESS SPECIFIC
   ============================================ */
.alignleft {
  float: left;
  margin-right: 1.5rem;
  margin-bottom: 1rem;
}

.alignright {
  float: right;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  font-size: 0.875rem;
  color: var(--color-muted);
  text-align: center;
  margin-top: 0.5rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.gallery-item {
  margin: 0;
}

.gallery-item img {
  border-radius: var(--radius);
}

/* Comments */
.comments-area {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.comments-title {
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

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

.comment {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.comment-author {
  font-weight: 600;
}

.comment-meta {
  font-size: 0.875rem;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}

.comment-content p {
  margin-bottom: 0.5rem;
}

.comment-reply-link {
  font-size: 0.875rem;
  color: var(--color-accent);
}
