/*
Theme Name: SoftVerdict Reviews
Theme URI: http://softverdict.com
Author: SoftVerdict Team
Description: Custom WordPress theme designed for SaaS software review and affiliate content. Features modern dark header, review score badges, styled TOC, pros/cons sections, and affiliate CTA buttons.
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: softverdict-reviews
*/

/* ============ RESET & BASE ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --dark: #0f172a;
  --dark-2: #1e293b;
  --dark-3: #334155;
  --gray: #64748b;
  --gray-light: #94a3b8;
  --gray-bg: #f1f5f9;
  --white: #ffffff;
  --green: #22c55e;
  --red: #ef4444;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 800px;
  --max-width-wide: 1200px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--dark);
  background: var(--gray-bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
}

/* ============ HEADER ============ */
.site-header {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
}

.site-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: white;
}

.site-logo .logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.site-logo .logo-text span {
  color: var(--primary);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.header-nav a {
  color: var(--gray-light);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.header-nav a:hover {
  color: var(--white);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--gray-light);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.header-search:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

/* ============ MAIN CONTENT ============ */
.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px;
}

.site-main.wide {
  max-width: var(--max-width-wide);
}

/* ============ ARTICLE CARD (LIST) ============ */
.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.article-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.article-card .card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 200px;
}

.article-card .card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
}

.card-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--dark);
}

.card-title a {
  color: inherit;
}

.card-title a:hover {
  color: var(--primary);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--gray);
}

.card-meta .meta-author {
  font-weight: 500;
  color: var(--dark-3);
}

.card-excerpt {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-score {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.score-badge {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: white;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}

.score-label {
  font-size: 12px;
  color: var(--gray);
}

/* ============ SINGLE ARTICLE ============ */
.article-header {
  margin-bottom: 32px;
}

.article-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 16px;
}

.article-breadcrumb a {
  color: var(--primary);
}

.article-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--dark);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.article-meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--gray);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-item strong {
  color: var(--dark-3);
  font-weight: 600;
}

.article-featured-image {
  width: 100%;
  border-radius: var(--radius-lg);
  margin: 24px 0;
  box-shadow: var(--shadow-md);
}

/* ============ ARTICLE CONTENT ============ */
.article-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

.article-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
}

.article-content h2:first-child {
  margin-top: 0;
}

.article-content h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--dark-2);
  margin: 30px 0 12px;
}

.article-content p {
  margin-bottom: 16px;
  color: var(--dark-3);
  line-height: 1.8;
}

.article-content ul,
.article-content ol {
  margin: 16px 0;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
  line-height: 1.7;
  color: var(--dark-3);
}

.article-content strong {
  color: var(--dark);
}

.article-content blockquote {
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--dark-2);
}

/* ============ TABLE OF CONTENTS ============ */
.toc-container {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 24px 0;
}

.toc-container h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 12px;
}

.toc-container ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-container li {
  padding: 4px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.toc-container li:last-child {
  border-bottom: none;
}

.toc-container a {
  color: var(--dark-3);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  display: block;
  padding: 4px 0;
  transition: all 0.2s;
}

.toc-container a:hover {
  color: var(--primary);
  padding-left: 8px;
}

/* ============ IMAGES / FIGURES ============ */
.wp-block-image {
  margin: 28px 0;
  text-align: center;
}

.wp-block-image img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-width: 100%;
}

.wp-block-image figcaption {
  font-size: 13px;
  color: var(--gray);
  font-style: italic;
  margin-top: 8px;
}

/* ============ TABLES ============ */
.wp-block-table,
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.wp-block-table th,
.article-content th {
  background: var(--dark);
  color: var(--white);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
}

.wp-block-table td,
.article-content td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.wp-block-table tr:nth-child(even) td {
  background: var(--gray-bg);
}

.wp-block-table tr:hover td {
  background: var(--primary-light);
}

/* ============ AFFILIATE CTA ============ */
.article-content a[rel*="sponsored"] {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: white !important;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.article-content a[rel*="sponsored"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* ============ DISCLOSURE ============ */
.disclosure-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid var(--accent);
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--dark-3);
  margin: 24px 0;
}

/* ============ AUTHOR BOX (Theme level - basic) ============ */
.author-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  gap: 20px;
  box-shadow: var(--shadow);
  margin: 32px 0;
  border: 1px solid var(--border);
}

.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-info h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

.author-info p {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.5;
}

/* ============ AUTHOR DETAIL BOX (Publisher-injected) ============ */
.author-detail-box {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin: 40px 0 20px;
  box-shadow: var(--shadow-md);
}

.author-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.author-detail-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.author-detail-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.author-detail-avatar.author-initials {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  border: none;
}

.author-detail-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 4px;
}

.author-detail-role {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.author-detail-bio {
  font-size: 14px;
  color: var(--dark-3);
  line-height: 1.7;
  margin: 0 0 16px;
}

.author-detail-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.author-detail-links .author-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.2s;
}

.author-detail-links .author-link:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============ FOOTER ============ */
.site-footer {
  background: var(--dark);
  color: var(--gray-light);
  padding: 48px 0 24px;
  margin-top: 60px;
}

.footer-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .footer-logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 12px;
}

.footer-brand .footer-logo span {
  color: var(--primary);
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray);
}

.footer-col h5 {
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col li {
  margin-bottom: 8px;
}

.footer-col a {
  color: var(--gray);
  font-size: 14px;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid var(--dark-3);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .article-card {
    grid-template-columns: 1fr;
  }

  .article-card .card-image {
    height: 200px;
  }

  .article-content {
    padding: 24px;
  }

  .article-title {
    font-size: 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .header-nav {
    display: none;
  }

  .header-search {
    display: none;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .article-meta-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .author-box {
    flex-direction: column;
    text-align: center;
  }
}

/* ============ SCROLL TO TOP ============ */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  font-size: 18px;
  z-index: 999;
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--primary-dark);
}

/* ============ HOMEPAGE HERO ============ */
.hero-section {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 50%, #1e1b4b 100%);
  color: white;
  padding: 60px 24px;
  text-align: center;
}

.hero-inner {
  max-width: 700px;
  margin: 0 auto;
}

.hero-title {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -1px;
  line-height: 1.2;
}

.hero-title span {
  background: linear-gradient(135deg, var(--primary), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--gray-light);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ============ CATEGORY FILTER ============ */
.category-filter {
  max-width: var(--max-width-wide);
  margin: -20px auto 0;
  padding: 0 24px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 10;
}

.category-pill {
  background: var(--white);
  color: var(--dark-3);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

.category-pill:hover,
.category-pill.active {
  background: var(--primary);
  color: white;
}

/* ============ SEARCH OVERLAY ============ */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.search-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.search-overlay-inner {
  width: 100%;
  max-width: 640px;
  padding: 0 1.5rem;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.search-overlay.active .search-overlay-inner {
  transform: translateY(0);
}

.search-overlay h2 {
  color: white;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.search-overlay form {
  display: flex;
  gap: 0.75rem;
}

.search-overlay .search-input {
  flex: 1;
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  border: 2px solid var(--dark-3);
  border-radius: 12px;
  background: var(--dark-2);
  color: white;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.search-overlay .search-input:focus {
  border-color: var(--primary);
}

.search-overlay .search-input::placeholder {
  color: var(--gray);
}

.search-overlay .search-submit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.search-overlay .search-submit:hover {
  background: var(--primary-dark);
}

.search-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: none;
  border: none;
  color: var(--gray-light);
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.search-close:hover {
  color: white;
}

/* ============ SEARCH RESULTS PAGE ============ */
.search-results-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.search-results-page h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.search-results-count {
  color: var(--gray);
  margin-bottom: 2rem;
}

.search-result-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.search-result-item h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.search-result-item h2 a {
  color: var(--text);
  text-decoration: none;
}

.search-result-item h2 a:hover {
  color: var(--primary);
}

.search-result-excerpt {
  color: var(--gray);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Search keyword highlight */
.search-highlight,
mark.search-highlight {
  background: #fef08a;
  color: #1e293b;
  padding: 0.1em 0.2em;
  border-radius: 3px;
  font-weight: 600;
}

/* ============ STATIC PAGES (About, Privacy, etc.) ============ */
.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.page-content h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  font-weight: 800;
}

.page-content h2 {
  font-size: 1.4rem;
  margin: 2rem 0 1rem;
  font-weight: 700;
}

.page-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.page-content ul,
.page-content ol {
  margin: 1rem 0 1rem 1.5rem;
  line-height: 1.8;
  color: var(--text-secondary);
}