/* ====== CSS VARIABLES ====== */
:root {
  --primary: #2563eb;
  --secondary: #10b981;
  --accent: #f59e0b;
  --dark: #1f2937;
  --light: #f9fafb;
  --white: #ffffff;
  --border: #e5e7eb;
  --text: #374151;
  --text-light: #6b7280;
  --max-width: 960px;
  --gap: 30px;
  --radius: 8px;
}

/* ====== RESET ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: #e5e7eb;
}

/* ====== MAIN CONTAINER ====== */
.main-container {
  max-width: var(--max-width);
  margin: 20px auto;
  background: var(--white);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #d1d5db;
  border-radius: 12px;  /* Add this line */
  overflow: hidden;      /* Add this to keep content from spilling out of rounded corners */
}

/* ====== TYPOGRAPHY ====== */
h1, h2, h3, h4, h5, h6 {
  color: var(--dark);
  line-height: 1.3;
  margin-top: 0;
  margin-bottom: 0.75em;
}

h1 { font-size: 2.25em; }
h2 { font-size: 1.875em; }
h3 { font-size: 1.5em; }
h4 { font-size: 1.25em; }

p {
  margin-bottom: 1.25em;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

strong {
  font-weight: 600;
  color: var(--dark);
}

/* ====== HEADER ====== */
.site-header {
  height: 170px;
  background: linear-gradient(135deg, #e0f2ff, #cce7ff);
  background-size: 100% auto;
  background-position: center top;
  background-repeat: no-repeat;
  position: relative;
  border-bottom: 2px solid #99ccff;
  display: flex;
  align-items: center;
}

.header-content {
  padding-left: 30px;
  background: rgba(255, 255, 255, 0.3);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.site-header h1 {
  font-size: 1.8em;
  font-weight: 700;
  margin: 0;
}

.site-header h1 a {
  color: var(--dark);
  text-decoration: none;
}

.site-header h1 a:hover {
  color: var(--dark);
  opacity: 1;
  text-decoration: none;
}

.tagline {
  font-size: 0.9em;
  color: var(--text);
  margin: 5px 0 0 0;
}

/* ====== CONTENT WRAPPER ====== */
.content-wrapper {
  display: flex;
  gap: 30px;
  padding: 30px;
}

.main-content {
  flex: 1;
  min-width: 0;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
}

/* ====== INTRO SECTION ====== */
.intro-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
}

.intro-section p {
  font-size: 1.1em;
  color: var(--text);
  line-height: 1.6;
  margin: 0;
}

/* ====== FEATURED SECTION ====== */
.featured-section {
  margin: 40px 0;
}

.featured-section h2 {
  text-align: center;
  font-size: 2em;
  margin-bottom: 30px;
  color: var(--dark);
}

/* ====== ARTICLES GRID ====== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.article-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
  border: 1px solid var(--border);
  padding: 20px;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.card-image {
  width: calc(100% + 40px);
  height: 200px;
  margin: -20px -20px 20px -20px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card h2 {
  margin: 0 0 15px;
  font-size: 1.5em;
}

.article-card h3 {
  margin: 0 0 15px;
  font-size: 1.3em;
}

.article-card h2 a,
.article-card h3 a {
  color: var(--dark);
  text-decoration: none;
}

.article-card h2 a:hover,
.article-card h3 a:hover {
  color: var(--primary);
}

.article-card p {
  color: var(--text);
  font-size: 0.95em;
  line-height: 1.6;
  margin-bottom: 15px;
}

.tldr {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-left: 3px solid var(--accent);
  padding: 10px 15px;
  margin: 15px 0;
  font-size: 0.95em;
  border-radius: 4px;
}

.read-more {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s;
}

.read-more:hover {
  transform: translateX(5px);
}

/* ====== FAQ SECTION ====== */
.faq-section {
  background: var(--light);
  padding: 40px;
  border-radius: var(--radius);
  margin: 40px 0;
}

.faq-section > h2 {
  text-align: center;
  font-size: 2em;
  margin-bottom: 30px;
  color: var(--dark);
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.faq-card {
  background: var(--white);
  padding: 25px;
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.faq-card h3 {
  color: var(--primary);
  font-size: 1.1em;
  margin: 0 0 15px;
}

.faq-card p {
  color: var(--text);
  line-height: 1.6;
  margin: 0;
}

/* Article page FAQ section */
.faq-item {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.faq-question {
  color: var(--primary);
  margin: 0 0 10px;
  font-size: 1.1em;
}

.faq-answer {
  color: var(--text);
  line-height: 1.6;
}
/* ====== RECENT ARTICLES ====== */
.recent-articles {
  margin: 50px 0;
}

.recent-articles h2 {
  text-align: center;
  font-size: 2em;
  margin-bottom: 30px;
  color: var(--dark);
}

.articles-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
}

.list-card {
  background: var(--white);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.list-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.list-card h3 {
  margin: 0 0 10px;
  font-size: 1.2em;
}

.list-card h3 a {
  color: var(--dark);
  text-decoration: none;
}

.list-card h3 a:hover {
  color: var(--primary);
}

.list-card p {
  color: var(--text);
  line-height: 1.5;
  margin: 0 0 15px;
  font-size: 0.95em;
}

.list-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85em;
  color: var(--text-light);
}

.category-tag {
  background: var(--light);
  color: var(--text-light);
  padding: 4px 12px;
  border-radius: 15px;
}

/* ====== SIDEBAR WIDGETS ====== */
.widget {
  background: #fef6e9;
  border: 1px solid #f5ddb4;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.widget h3 {
  background: #ffaa5c;
  color: var(--white);
  margin: 0;
  padding: 10px 15px;
  font-size: 1em;
  font-weight: 600;
}

.widget > p {
  padding: 15px;
  margin: 0;
  font-size: 0.9em;
  line-height: 1.6;
}

.widget ul {
  list-style: none;
  padding: 15px;
  margin: 0;
}

.widget li {
  padding: 8px 0;
  border-bottom: 1px solid #f5ddb4;
}

.widget li:last-child {
  border-bottom: none;
}

.nav-list a,
.article-list a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9em;
  display: block;
}

.nav-list a:hover,
.article-list a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ====== BREADCRUMBS ====== */
.breadcrumbs {
  font-size: 0.9em;
  color: var(--text-light);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.breadcrumbs a {
  color: var(--text-light);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--primary);
}

/* ====== ARTICLE META ====== */
.meta {
  color: var(--text-light);
  font-size: 0.875em;
  margin: 10px 0;
}

.article-meta {
  color: var(--text-light);
  font-size: 0.9em;
  margin: 15px 0;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.tag {
  display: inline-block;
  background: var(--light);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85em;
  margin-left: 5px;
}

/* ====== ARTICLE CONTENT ====== */
.article-content {
  font-size: 1.125em;
  line-height: 1.8;
}

.article-content h2 {
  margin: 40px 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.article-content h3 {
  margin: 30px 0 15px;
  color: var(--primary);
}

.article-content ul,
.article-content ol {
  margin: 20px 0 20px 30px;
}

.article-content li {
  margin: 10px 0;
}

.article-content blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 20px;
  margin: 25px 0;
  font-style: italic;
  color: var(--text-light);
}

.article-image {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 30px 0;
}

/* ====== TL;DR BOX ====== */
.tldr-box {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 15px 20px;
  margin: 20px 0;
  font-size: 1.05em;
}

.tldr-box strong {
  color: var(--accent);
}

/* ====== AFFILIATE BOX ====== */
.affiliate-box {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 2px solid var(--secondary);
  border-radius: var(--radius);
  padding: 25px;
  margin: 30px 0;
  position: relative;
}

.affiliate-box::before {
  content: "💡 Recommendation";
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--white);
  padding: 0 10px;
  color: var(--secondary);
  font-weight: bold;
  font-size: 0.9em;
}

/* ====== VIDEO WRAPPER ====== */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 30px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ====== RELATED ARTICLES ====== */
.related-articles {
  margin: 40px 0;
  padding: 30px;
  background: var(--light);
  border-radius: var(--radius);
}

.related-articles h2 {
  margin-bottom: 20px;
}

.related-card {
  background: var(--white);
  padding: 20px;
  margin-bottom: 15px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.related-card:last-child {
  margin-bottom: 0;
}

.related-card h3 {
  margin: 0 0 10px;
  font-size: 1.2em;
}

.related-card h3 a {
  color: var(--dark);
}

.related-card h3 a:hover {
  color: var(--primary);
}

.related-card p {
  margin: 0;
  color: var(--text);
  font-size: 0.95em;
}

/* ====== FOOTER ====== */
.site-footer {
  background: var(--dark);
  color: #9ca3af;  /* Light gray for all text */
  padding: 30px;
  text-align: center;
  border-top: 2px solid #374151;
  font-size: 0.85em;
}

.site-footer p {
  margin: 0 0 15px;
  color: #9ca3af;  /* Same light gray */
}

.footer-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;  /* Space between items */
  flex-wrap: wrap;
  color: #9ca3af;  /* Light gray for separators */
}

.footer-nav a {
  color: #9ca3af;  /* Same light gray for all links */
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--white);
  text-decoration: underline;
}

/* Remove the .footer-legal section from CSS since we merged everything into .footer-nav */

/* ====== UTILITIES ====== */
.disclaimer {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 15px;
  margin: 30px 0;
  color: #991b1b;
  font-size: 0.9em;
}

.error-page {
  text-align: center;
  padding: 60px 20px;
}

.error-page h1 {
  font-size: 3em;
  margin-bottom: 20px;
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 12px 30px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

.btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  text-decoration: none;
  color: white;
  opacity: 1;
}

/* ====== PAGE CONTENT ====== */
.page-content {
  line-height: 1.8;
}

.page-content h2 {
  margin: 30px 0 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.page-content h3 {
  margin: 25px 0 15px;
  color: var(--primary);
}

.page-content ul,
.page-content ol {
  margin: 20px 0 20px 30px;
}

.page-content li {
  margin: 8px 0;
}

/* ====== INLINE ADS ====== */
.ad-inline {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 30px 0;
  text-align: center;
  min-height: 100px;
  position: relative;
}

.ad-inline::before {
  content: "Advertisement";
  position: absolute;
  top: -10px;
  left: 15px;
  background: var(--white);
  padding: 0 8px;
  font-size: 0.75em;
  color: var(--text-light);
}

/* ====== RESPONSIVE ====== */
@media (max-width: 1024px) {
  .main-container {
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .site-header {
    height: 150px;  /* Optional: medium size for tablets */
  }
}

@media (max-width: 768px) {
  .site-header {
    height: 100px;
    background: #a2d9f3 !important;  /* Force solid color */
    background-image: none !important;  /* Force remove image */
  }
  
  /* If the image is set via inline style attribute in PHP, this targets it */
  .site-header[style] {
    background-image: none !important;
  }
}

@media (max-width: 768px) {
  .content-wrapper {
    flex-direction: column;
    padding: 20px;
  }
  
  .sidebar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .header-content {
    padding-left: 20px;
  }
  
  .site-header h1 {
    font-size: 1.5em;
  }
  
  .articles-grid {
    grid-template-columns: 1fr;
  }
  
  .faq-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-nav {
    flex-direction: column;
    gap: 10px;
  }
  
  .related-articles {
    padding: 20px;
  }
  
  .faq-section {
    padding: 25px 20px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 15px;
  }
  
  .content-wrapper {
    padding: 15px;
  }
  
  h1 { font-size: 1.875em; }
  h2 { font-size: 1.5em; }
  h3 { font-size: 1.25em; }
  
  .article-card {
    padding: 15px;
  }
  
  .card-image {
    margin: -15px -15px 15px -15px;
  }
}