/*
Theme Name: CBT Anxiety
Theme URI: https://yoursite.com
Author: Your Name
Author URI: https://yoursite.com
Description: A clean, professional WordPress theme for CBT and mental health content. Designed for high trust, readability, and SEO performance.
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: cbt-anxiety
Tags: blog, health, wellness, clean, professional
*/

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
  --primary: #3a86b8;
  --primary-dark: #2c6a92;
  --secondary: #4caf8a;
  --accent: #e8f4f0;
  --text: #2d3748;
  --text-light: #718096;
  --bg: #ffffff;
  --bg-alt: #f7fbfc;
  --border: #e2e8f0;
  --max-width: 1100px;
  --content-width: 720px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.10);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 1rem;
}

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

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

/* ========================================
   LAYOUT
   ======================================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.site-content {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  padding: 48px 0;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.site-content.full-width {
  grid-template-columns: 1fr;
}

/* ========================================
   HEADER
   ======================================== */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.site-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.site-tagline {
  font-size: 0.75rem;
  color: var(--text-light);
  display: block;
  margin-top: -2px;
}

/* Navigation */
.main-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
}

.main-nav a:hover,
.main-nav .current-menu-item a {
  background: var(--accent);
  color: var(--primary);
}

.nav-cta a {
  background: var(--primary) !important;
  color: white !important;
  padding: 8px 18px !important;
}

.nav-cta a:hover {
  background: var(--primary-dark) !important;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
  background: linear-gradient(135deg, #eef6ff 0%, #e8f6f0 100%);
  padding: 72px 24px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-content {
  max-width: 680px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  background: rgba(58,134,184,0.1);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 18px;
  letter-spacing: -0.03em;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 16px rgba(58,134,184,0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(58,134,184,0.4);
  color: white;
  text-decoration: none;
}

.btn-outline {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
  text-decoration: none;
}

/* ========================================
   PILLAR POSTS SECTION
   ======================================== */
.start-here-section {
  padding: 64px 24px;
  background: var(--bg);
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.section-header h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.section-header p {
  color: var(--text-light);
  font-size: 1rem;
}

.pillar-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.pillar-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.pillar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.pillar-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.pillar-icon {
  width: 48px;
  height: 48px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 18px;
}

.pillar-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.pillar-card p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 18px;
}

.pillar-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pillar-link:hover { gap: 8px; text-decoration: none; }

/* ========================================
   BLOG POSTS GRID
   ======================================== */
.blog-section {
  padding: 64px 24px;
  background: var(--bg-alt);
}

.posts-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.post-card {
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.post-card-thumb {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #eef6ff, #e8f6f0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.post-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.post-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(58,134,184,0.1);
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-date {
  font-size: 0.8rem;
  color: var(--text-light);
}

.post-card h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
  color: var(--text);
}

.post-card h3 a {
  color: inherit;
  text-decoration: none;
}

.post-card h3 a:hover { color: var(--primary); }

.post-card p {
  font-size: 0.875rem;
  color: var(--text-light);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
}

.read-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
}

.read-more:hover { gap: 8px; text-decoration: none; }

/* ========================================
   MAIN CONTENT AREA
   ======================================== */
.main-content { min-width: 0; }

/* ========================================
   SINGLE POST
   ======================================== */
.article-header { margin-bottom: 32px; }

.article-categories {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.article-categories a {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(58,134,184,0.1);
  padding: 4px 12px;
  border-radius: 20px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.article-header h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

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

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
}

.author-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.author-role { font-size: 0.8rem; color: var(--text-light); }

.article-stats {
  display: flex;
  gap: 16px;
  color: var(--text-light);
  font-size: 0.85rem;
}

.article-stats span { display: flex; align-items: center; gap: 5px; }

/* Article body */
.article-body { font-size: 1.05rem; line-height: 1.8; }
.article-body h2 { font-size: 1.6rem; font-weight: 700; margin: 2em 0 0.75em; letter-spacing: -0.02em; }
.article-body h3 { font-size: 1.25rem; font-weight: 700; margin: 1.6em 0 0.6em; }
.article-body p { margin-bottom: 1.4em; }
.article-body ul, .article-body ol { padding-left: 1.75em; margin-bottom: 1.4em; }
.article-body li { margin-bottom: 0.5em; }
.article-body blockquote {
  border-left: 4px solid var(--primary);
  background: var(--accent);
  padding: 20px 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 2em 0;
  font-style: italic;
  color: var(--text-light);
}
.article-body img { border-radius: var(--radius); margin: 2em 0; }
.article-body a { text-decoration: underline; }

/* Tip / callout box */
.tip-box {
  background: var(--accent);
  border: 1px solid #c8e6d8;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 2em 0;
}
.tip-box strong { color: var(--secondary); display: block; margin-bottom: 6px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ========================================
   AFFILIATE CTA BOX
   ======================================== */
.cta-box {
  background: linear-gradient(135deg, var(--primary) 0%, #2c8a6a 100%);
  color: white;
  border-radius: 12px;
  padding: 32px;
  margin: 2.5em 0;
  text-align: center;
}
.cta-box h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 10px; color: white; }
.cta-box p { opacity: 0.9; margin-bottom: 20px; font-size: 0.95rem; }
.cta-box .btn { background: white; color: var(--primary); font-weight: 700; }
.cta-box .btn:hover { background: #f0f9ff; transform: none; color: var(--primary-dark); text-decoration: none; }
.cta-disclaimer { font-size: 0.75rem; opacity: 0.7; margin-top: 10px; }

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar { position: relative; }

.sidebar-sticky {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.widget {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.widget-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
}

/* Newsletter widget */
.newsletter-widget {
  background: linear-gradient(135deg, #eef6ff, #e8f6f0);
  border-color: transparent;
  text-align: center;
  padding: 28px 24px;
}
.newsletter-widget h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.newsletter-widget p { font-size: 0.85rem; color: var(--text-light); margin-bottom: 16px; }
.newsletter-widget input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 10px;
  background: white;
  color: var(--text);
}
.newsletter-widget button {
  width: 100%;
  padding: 10px 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.newsletter-widget button:hover { background: var(--primary-dark); }

/* Popular posts widget */
.popular-posts-list { list-style: none; }
.popular-posts-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.popular-posts-list li:last-child { border-bottom: none; padding-bottom: 0; }
.popular-posts-list a { font-size: 0.875rem; font-weight: 500; color: var(--text); text-decoration: none; display: block; line-height: 1.4; }
.popular-posts-list a:hover { color: var(--primary); }
.popular-posts-list span { font-size: 0.75rem; color: var(--text-light); display: block; margin-top: 3px; }

/* Affiliate sidebar widget */
.affiliate-widget { text-align: center; }
.affiliate-widget .affiliate-logo { width: 80px; height: 80px; background: var(--accent); border-radius: 50%; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; font-size: 32px; }
.affiliate-widget h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.affiliate-widget p { font-size: 0.85rem; color: var(--text-light); margin-bottom: 16px; }
.affiliate-widget .btn { width: 100%; justify-content: center; font-size: 0.9rem; }
.affiliate-disclaimer { font-size: 0.7rem; color: var(--text-light); margin-top: 8px; }

/* ========================================
   AUTHOR BOX
   ======================================== */
.author-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 32px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin: 48px 0;
}

.author-box-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.author-box-info h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.author-box-info .author-title { font-size: 0.85rem; color: var(--primary); font-weight: 500; margin-bottom: 10px; }
.author-box-info p { font-size: 0.875rem; color: var(--text-light); line-height: 1.6; }

/* ========================================
   DISCLAIMER BOX
   ======================================== */
.disclaimer-box {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.8rem;
  color: #6d5800;
  margin: 32px 0;
  line-height: 1.6;
}
.disclaimer-box strong { display: block; margin-bottom: 4px; }

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
  background: #1a2332;
  color: #94a3b8;
  padding: 60px 24px 30px;
  margin-top: 64px;
}

.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 30px;
}

.footer-brand .site-title { color: white; font-size: 1.1rem; margin-bottom: 10px; }
.footer-brand p { font-size: 0.875rem; line-height: 1.7; margin-bottom: 16px; }

.footer-col h4 {
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: 0.875rem; color: #94a3b8; text-decoration: none; transition: color 0.2s; }
.footer-col a:hover { color: white; }

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8rem;
}

.footer-disclaimer {
  background: rgba(255,255,255,0.05);
  padding: 16px 20px;
  border-radius: var(--radius);
  font-size: 0.78rem;
  line-height: 1.6;
  max-width: var(--max-width);
  margin: 0 auto 30px;
  color: #64748b;
}

/* ========================================
   PAGE: MONEY PAGES
   ======================================== */
.comparison-table { width: 100%; border-collapse: collapse; margin: 2em 0; font-size: 0.9rem; }
.comparison-table th { background: var(--primary); color: white; padding: 14px 16px; text-align: left; font-size: 0.85rem; }
.comparison-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.comparison-table tr:nth-child(even) { background: var(--bg-alt); }
.comparison-table .check { color: var(--secondary); font-size: 1.1rem; }
.comparison-table .recommended { border: 2px solid var(--secondary); }
.recommended-badge { background: var(--secondary); color: white; font-size: 0.7rem; padding: 2px 8px; border-radius: 10px; margin-left: 8px; }

/* ========================================
   BREADCRUMBS
   ======================================== */
.breadcrumbs {
  padding: 14px 24px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-light);
  max-width: 100%;
}
.breadcrumbs .container { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--text-light); text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .sep { opacity: 0.5; }
.breadcrumbs .current { color: var(--text); font-weight: 500; }

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 48px 0;
}
.pagination a, .pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
}
.pagination a:hover, .pagination .current {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 900px) {
  .site-content {
    grid-template-columns: 1fr;
  }
  .sidebar { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .main-nav { display: none; }
  .main-nav.is-open { display: block; position: absolute; top: 68px; left: 0; right: 0; background: white; border-bottom: 1px solid var(--border); padding: 16px; box-shadow: var(--shadow); }
  .main-nav.is-open ul { flex-direction: column; gap: 4px; }
  .nav-toggle { display: flex; }
  .hero { padding: 48px 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .author-box { flex-direction: column; }
  .pillar-grid { grid-template-columns: 1fr; }
  .posts-grid { grid-template-columns: 1fr; }
}
