/*
Theme Name: OpenTracking
Theme URI: https://opentracking.org
Author: OpenTracking Team
Description: Custom theme for OpenTracking.org — privacy-first analytics blog
Version: 1.0.0
License: GNU General Public License v2
Text Domain: opentracking
*/

/* =========================================
   1. DESIGN TOKENS
   ========================================= */
:root {
  --ot-primary: #6366f1;
  --ot-primary-dark: #4f46e5;
  --ot-primary-light: #eef2ff;
  --ot-accent: #f472b6;
  --ot-accent-light: #fdf2f8;
  --ot-success: #34d399;
  --ot-warning: #fbbf24;
  --ot-text: #334155;
  --ot-text-muted: #94a3b8;
  --ot-bg: #ffffff;
  --ot-bg-alt: #f8fafc;
  --ot-bg-card: #ffffff;
  --ot-border: #e2e8f0;
  --ot-radius: 16px;
  --ot-radius-sm: 8px;
  --ot-radius-full: 9999px;
  --ot-shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --ot-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --ot-shadow-lg: 0 12px 32px rgba(0,0,0,0.1);
  --ot-font-heading: 'DM Sans', system-ui, -apple-system, sans-serif;
  --ot-font-body: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --ot-font-code: 'Fira Code', 'Courier New', monospace;
  --ot-font-ui: 'DM Sans', system-ui, -apple-system, sans-serif;
  --ot-content-width: 780px;
  --ot-container-width: 1200px;
  --ot-header-height: 72px;
  --ot-transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--ot-font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ot-text);
  background: var(--ot-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: var(--ot-primary-dark);
  text-decoration: none;
  transition: color var(--ot-transition);
}

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

ul, ol {
  padding-left: 1.5em;
}

/* =========================================
   3. TYPOGRAPHY
   ========================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ot-font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ot-text);
  margin-top: 0;
}

h1 { font-size: 2.5rem; letter-spacing: -0.025em; }
h2 { font-size: 1.875rem; letter-spacing: -0.02em; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1.25em;
}

code, pre {
  font-family: var(--ot-font-code);
  font-size: 0.9em;
}

code {
  background: var(--ot-bg-alt);
  border: 1px solid var(--ot-border);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  background: #f1f5f9;
  color: #334155;
  padding: 1.5em;
  border-radius: var(--ot-radius);
  border: 1px solid var(--ot-border);
  overflow-x: auto;
  margin-bottom: 1.5em;
  line-height: 1.6;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: 0.875rem;
}

blockquote {
  border-left: 4px solid var(--ot-primary);
  background: var(--ot-primary-light);
  padding: 1.25em 1.5em;
  margin: 1.5em 0;
  border-radius: 0 var(--ot-radius-sm) var(--ot-radius-sm) 0;
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--ot-border);
  margin: 2em 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
  font-size: 0.95rem;
}

th, td {
  padding: 0.75em 1em;
  text-align: left;
  border-bottom: 1px solid var(--ot-border);
}

th {
  font-family: var(--ot-font-heading);
  font-weight: 600;
  background: var(--ot-bg-alt);
}

/* =========================================
   4. UTILITY CLASSES
   ========================================= */
.container {
  width: 100%;
  max-width: var(--ot-container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ot-font-ui);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.625em 1.5em;
  border-radius: var(--ot-radius-full);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--ot-transition);
  text-decoration: none;
  line-height: 1.4;
  gap: 0.5em;
}

.btn-primary {
  background: var(--ot-primary);
  color: #fff;
  border-color: var(--ot-primary);
}

.btn-primary:hover {
  background: var(--ot-primary-dark);
  border-color: var(--ot-primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--ot-shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--ot-primary-dark);
  border-color: var(--ot-primary-dark);
}

.btn-outline:hover {
  background: var(--ot-primary);
  color: #fff;
  border-color: var(--ot-primary);
  transform: translateY(-1px);
}

.btn-sm {
  font-size: 0.8125rem;
  padding: 0.4em 1.1em;
}

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
}

/* =========================================
   5. SITE HEADER
   ========================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--ot-bg);
  height: var(--ot-header-height);
  display: flex;
  align-items: center;
  transition: box-shadow var(--ot-transition);
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
  border-bottom-color: var(--ot-border);
}

.site-header > .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.site-logo img {
  height: 36px;
  width: auto;
}

.site-logo-text {
  font-family: var(--ot-font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ot-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-logo-text:hover {
  color: var(--ot-primary);
}

.site-logo-text svg {
  flex-shrink: 0;
}

.site-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
}

.site-nav a {
  font-family: var(--ot-font-ui);
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--ot-text-muted);
  padding: 0.5em 1em;
  border-radius: var(--ot-radius-sm);
  transition: all var(--ot-transition);
  position: relative;
}

.site-nav a:hover,
.site-nav a[aria-current="page"],
.site-nav .current-menu-item > a {
  color: var(--ot-text);
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1em;
  right: 1em;
  height: 2px;
  background: var(--ot-accent);
  transform: scaleX(0);
  transition: transform var(--ot-transition);
  border-radius: 1px;
}

.site-nav a:hover::after,
.site-nav .current-menu-item > a::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5em;
  border-radius: var(--ot-radius-sm);
  color: var(--ot-text-muted);
  transition: all var(--ot-transition);
  display: flex;
  align-items: center;
}

.search-toggle:hover {
  color: var(--ot-text);
  background: var(--ot-bg-alt);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5em;
  color: var(--ot-text);
}

/* Mobile menu */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--ot-header-height);
  left: 0;
  right: 0;
  background: var(--ot-bg);
  border-bottom: 1px solid var(--ot-border);
  box-shadow: var(--ot-shadow-lg);
  padding: 1.5rem;
  z-index: 999;
}

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

.mobile-nav ul {
  list-style: none;
  padding: 0;
}

.mobile-nav li {
  border-bottom: 1px solid var(--ot-border);
}

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

.mobile-nav a {
  display: block;
  padding: 0.75em 0;
  font-family: var(--ot-font-ui);
  font-weight: 500;
  font-size: 1.0625rem;
  color: var(--ot-text);
}

/* Search overlay */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 2000;
  justify-content: center;
  padding-top: 15vh;
}

.search-overlay.active {
  display: flex;
}

.search-overlay-inner {
  background: var(--ot-bg);
  border-radius: var(--ot-radius);
  padding: 2rem;
  width: 90%;
  max-width: 600px;
  box-shadow: var(--ot-shadow-lg);
  height: fit-content;
}

.search-overlay .search-field {
  width: 100%;
  font-family: var(--ot-font-ui);
  font-size: 1.125rem;
  padding: 0.875em 1.25em;
  border: 2px solid var(--ot-border);
  border-radius: var(--ot-radius);
  outline: none;
  transition: border-color var(--ot-transition);
}

.search-overlay .search-field:focus {
  border-color: var(--ot-primary);
}

.search-overlay-close {
  font-family: var(--ot-font-ui);
  font-size: 0.8125rem;
  color: var(--ot-text-muted);
  margin-top: 0.75rem;
  display: block;
  text-align: center;
  background: none;
  border: none;
  cursor: pointer;
}

/* =========================================
   6. HERO SECTION (Homepage)
   ========================================= */
.hero-section {
  background: linear-gradient(160deg, #ffffff 0%, #eef2ff 40%, #fdf2f8 100%);
  padding: 5rem 0 4rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: var(--ot-primary-light);
  color: var(--ot-primary-dark);
  font-family: var(--ot-font-ui);
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.5em 1.25em;
  border-radius: var(--ot-radius-full);
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

.hero-section h1 {
  font-size: 3.25rem;
  max-width: 720px;
  margin: 0 auto 1.25rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-subtitle {
  font-size: 1.1875rem;
  color: var(--ot-text-muted);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.65;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

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

.hero-stat-number {
  font-family: var(--ot-font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ot-primary-dark);
  display: block;
}

.hero-stat-label {
  font-family: var(--ot-font-ui);
  font-size: 0.8125rem;
  color: var(--ot-text-muted);
}

/* =========================================
   7. SECTION LAYOUTS
   ========================================= */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--ot-bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--ot-text-muted);
  font-size: 1.0625rem;
  max-width: 560px;
  margin: 0 auto;
}

/* =========================================
   8. POST CARDS
   ========================================= */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.post-card {
  background: var(--ot-bg-card);
  border: 1px solid var(--ot-border);
  border-radius: var(--ot-radius);
  overflow: hidden;
  transition: transform var(--ot-transition), box-shadow var(--ot-transition);
}

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

.post-card-image {
  display: block;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--ot-bg-alt);
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-card-image img {
  transform: scale(1.03);
}

.post-card-content {
  padding: 1.25rem 1.5rem 1.5rem;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.category-badge {
  font-family: var(--ot-font-ui);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3em 0.8em;
  border-radius: var(--ot-radius-full);
  display: inline-block;
}

.reading-time {
  font-family: var(--ot-font-ui);
  font-size: 0.8125rem;
  color: var(--ot-text-muted);
}

.post-card-content h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.post-card-content h3 a {
  color: var(--ot-text);
  text-decoration: none;
}

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

.post-card-excerpt {
  font-size: 0.9375rem;
  color: var(--ot-text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--ot-font-ui);
  font-size: 0.8125rem;
  color: var(--ot-text-muted);
}

.author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.author-name {
  font-weight: 600;
  color: var(--ot-text);
}

.post-date::before {
  content: '\00b7';
  margin-right: 0.5rem;
}

/* Featured post card */
.featured-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
  background: var(--ot-bg-card);
  border: 1px solid var(--ot-border);
  border-radius: var(--ot-radius);
  overflow: hidden;
  margin-bottom: 3rem;
  transition: box-shadow var(--ot-transition);
}

.featured-card:hover {
  box-shadow: var(--ot-shadow-lg);
}

.featured-card .post-card-image {
  aspect-ratio: auto;
  min-height: 320px;
}

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

.featured-card .post-card-content h3 {
  font-size: 1.5rem;
}

.featured-label {
  font-family: var(--ot-font-ui);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ot-accent);
  margin-bottom: 0.5rem;
}

/* =========================================
   9. CATEGORY FILTER PILLS
   ========================================= */
.category-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  justify-content: center;
}

.category-filter {
  font-family: var(--ot-font-ui);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5em 1.25em;
  border-radius: var(--ot-radius-full);
  border: 1px solid var(--ot-border);
  background: var(--ot-bg);
  color: var(--ot-text-muted);
  text-decoration: none;
  transition: all var(--ot-transition);
}

.category-filter:hover,
.category-filter.active {
  background: var(--ot-primary);
  color: #fff;
  border-color: var(--ot-primary);
}

/* =========================================
   10. EXPLORE TOPICS (Category cards)
   ========================================= */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.topic-card {
  background: var(--ot-bg-card);
  border: 1px solid var(--ot-border);
  border-radius: var(--ot-radius);
  padding: 2rem;
  text-decoration: none;
  transition: all var(--ot-transition);
  display: block;
}

.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--ot-shadow-md);
  border-color: var(--ot-primary-light);
}

.topic-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.topic-card-icon svg {
  width: 24px;
  height: 24px;
}

.topic-card h3 {
  font-size: 1.0625rem;
  margin-bottom: 0.25rem;
  color: var(--ot-text);
}

.topic-card-count {
  font-family: var(--ot-font-ui);
  font-size: 0.8125rem;
  color: var(--ot-text-muted);
  margin-bottom: 0.5rem;
}

.topic-card p {
  font-size: 0.9375rem;
  color: var(--ot-text-muted);
  line-height: 1.5;
  margin: 0;
}

/* =========================================
   11. NEWSLETTER CTA
   ========================================= */
.newsletter-section {
  background: linear-gradient(135deg, #eef2ff 0%, #fdf2f8 100%);
  padding: 4rem 0;
  text-align: center;
}

.newsletter-section h2 {
  margin-bottom: 0.5rem;
}

.newsletter-section p {
  color: var(--ot-text-muted);
  max-width: 480px;
  margin: 0 auto 1.5rem;
}

.newsletter-form {
  display: flex;
  gap: 0.75rem;
  max-width: 460px;
  margin: 0 auto;
}

.newsletter-form input[type="email"] {
  flex: 1;
  font-family: var(--ot-font-ui);
  font-size: 0.9375rem;
  padding: 0.75em 1.25em;
  border: 2px solid var(--ot-border);
  border-radius: var(--ot-radius-full);
  outline: none;
  background: var(--ot-bg);
  transition: border-color var(--ot-transition);
}

.newsletter-form input[type="email"]:focus {
  border-color: var(--ot-primary);
}

.newsletter-form .btn {
  flex-shrink: 0;
}

/* =========================================
   12. ARTICLE LAYOUT (single.php)
   ========================================= */
.article-header {
  max-width: var(--ot-content-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1.5rem;
  text-align: center;
}

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

.article-header h1 {
  margin-bottom: 1.25rem;
  font-size: 2.5rem;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-family: var(--ot-font-ui);
  font-size: 0.875rem;
  color: var(--ot-text-muted);
  flex-wrap: wrap;
}

.article-meta .author-avatar {
  width: 40px;
  height: 40px;
}

.article-meta .author-name {
  color: var(--ot-text);
  font-weight: 600;
}

.article-meta-separator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ot-border);
}

.article-featured-image {
  max-width: 960px;
  margin: 0 auto 2.5rem;
  padding: 0 1.5rem;
}

.article-featured-image img {
  border-radius: var(--ot-radius);
  width: 100%;
}

.article-layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 3rem;
  align-items: start;
}

.article-content {
  max-width: var(--ot-content-width);
  font-size: 1.0625rem;
  line-height: 1.8;
}

.article-content h2 {
  margin-top: 2.5em;
  margin-bottom: 0.75em;
  padding-top: 0.5em;
}

.article-content h3 {
  margin-top: 2em;
  margin-bottom: 0.5em;
}

.article-content p {
  margin-bottom: 1.375em;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.375em;
}

.article-content li {
  margin-bottom: 0.4em;
}

.article-content img {
  border-radius: var(--ot-radius-sm);
  margin: 1.5em 0;
}

.article-content figure {
  margin: 2em 0;
}

.article-content figcaption {
  font-family: var(--ot-font-ui);
  font-size: 0.8125rem;
  color: var(--ot-text-muted);
  text-align: center;
  margin-top: 0.75rem;
}

/* Article sidebar / TOC */
.article-sidebar {
  position: sticky;
  top: calc(var(--ot-header-height) + 2rem);
}

.article-toc {
  background: var(--ot-bg-alt);
  border-radius: var(--ot-radius);
  padding: 1.5rem;
}

.article-toc-title {
  font-family: var(--ot-font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ot-text-muted);
  margin-bottom: 0.75rem;
}

.article-toc ul {
  list-style: none;
  padding: 0;
}

.article-toc li {
  margin-bottom: 0.375rem;
}

.article-toc a {
  font-family: var(--ot-font-ui);
  font-size: 0.8125rem;
  color: var(--ot-text-muted);
  text-decoration: none;
  display: block;
  padding: 0.25em 0.75em;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: all var(--ot-transition);
  line-height: 1.4;
}

.article-toc a:hover {
  color: var(--ot-primary-dark);
}

.article-toc a.active {
  color: var(--ot-primary-dark);
  border-left-color: var(--ot-primary);
  background: var(--ot-primary-light);
  font-weight: 500;
}

.article-toc li.toc-h3 a {
  padding-left: 1.5em;
  font-size: 0.75rem;
}

/* =========================================
   13. CUSTOM ARTICLE BLOCKS
   ========================================= */
.ot-intro {
  font-size: 1.1875rem;
  color: var(--ot-text-muted);
  line-height: 1.75;
  margin-bottom: 2em;
  padding-bottom: 2em;
  border-bottom: 1px solid var(--ot-border);
}

.ot-takeaway {
  background: var(--ot-primary-light);
  border-radius: var(--ot-radius);
  padding: 1.5rem 2rem;
  margin: 2em 0;
}

.ot-takeaway::before {
  content: 'Key Takeaway';
  display: block;
  font-family: var(--ot-font-heading);
  font-weight: 700;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ot-primary-dark);
  margin-bottom: 0.5rem;
}

.ot-tip {
  background: #ecfdf5;
  border-radius: var(--ot-radius);
  padding: 1.5rem 2rem;
  margin: 2em 0;
}

.ot-tip::before {
  content: 'Tip';
  display: block;
  font-family: var(--ot-font-heading);
  font-weight: 700;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ot-success);
  margin-bottom: 0.5rem;
}

.ot-warning {
  background: #fff7ed;
  border-radius: var(--ot-radius);
  padding: 1.5rem 2rem;
  margin: 2em 0;
}

.ot-warning::before {
  content: 'Important';
  display: block;
  font-family: var(--ot-font-heading);
  font-weight: 700;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ot-warning);
  margin-bottom: 0.5rem;
}

.ot-table-wrap {
  overflow-x: auto;
  margin: 2em 0;
  border: 1px solid var(--ot-border);
  border-radius: var(--ot-radius);
}

.ot-table-wrap table {
  margin-bottom: 0;
}

.ot-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 2em 0;
}

.ot-stat {
  background: var(--ot-bg-alt);
  border-radius: var(--ot-radius);
  padding: 1.25rem 1.5rem;
  text-align: center;
}

.ot-stat strong {
  display: block;
  font-family: var(--ot-font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ot-primary-dark);
  margin-bottom: 0.25rem;
}

.ot-stat span {
  font-family: var(--ot-font-ui);
  font-size: 0.8125rem;
  color: var(--ot-text-muted);
}

.ot-checklist {
  list-style: none;
  padding: 0;
  margin: 1.5em 0;
}

.ot-checklist li {
  padding: 0.5em 0 0.5em 2em;
  position: relative;
  border-bottom: 1px solid var(--ot-border);
}

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

.ot-checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ot-success);
  border-radius: 4px;
  background: #ecfdf5;
}

.ot-toc {
  background: var(--ot-bg-alt);
  border-radius: var(--ot-radius);
  padding: 1.5rem 2rem;
  margin: 1.5em 0 2em;
}

.ot-toc strong {
  font-family: var(--ot-font-heading);
  display: block;
  margin-bottom: 0.5rem;
}

.ot-toc ol {
  padding-left: 1.25em;
}

.ot-toc li {
  margin-bottom: 0.25em;
  font-family: var(--ot-font-ui);
  font-size: 0.9375rem;
}

.ot-toc a {
  color: var(--ot-primary-dark);
}

/* =========================================
   14. AUTHOR BOX
   ========================================= */
.author-box {
  display: flex;
  gap: 1.5rem;
  background: var(--ot-bg-alt);
  border-radius: var(--ot-radius);
  padding: 2rem;
  margin: 3rem 0;
  max-width: var(--ot-content-width);
}

.author-box-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-box-name {
  font-family: var(--ot-font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.author-box-role {
  font-family: var(--ot-font-ui);
  font-size: 0.8125rem;
  color: var(--ot-text-muted);
  margin-bottom: 0.5rem;
}

.author-box-bio {
  font-size: 0.9375rem;
  color: var(--ot-text-muted);
  margin: 0;
}

/* =========================================
   15. BREADCRUMBS
   ========================================= */
.breadcrumbs {
  font-family: var(--ot-font-ui);
  font-size: 0.8125rem;
  color: var(--ot-text-muted);
  padding: 1rem 0 0;
  max-width: var(--ot-content-width);
  margin: 0 auto;
}

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

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

.breadcrumbs .separator {
  margin: 0 0.5em;
  opacity: 0.5;
}

/* =========================================
   16. RELATED POSTS
   ========================================= */
.related-posts {
  max-width: var(--ot-container-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.related-posts h2 {
  text-align: center;
  margin-bottom: 2rem;
}

/* =========================================
   17. PAGINATION
   ========================================= */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 3rem 0;
  font-family: var(--ot-font-ui);
}

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

.pagination a {
  color: var(--ot-text-muted);
  border: 1px solid var(--ot-border);
}

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

.pagination .current {
  background: var(--ot-primary);
  color: #fff;
  border: 1px solid var(--ot-primary);
}

/* =========================================
   18. BLOG LISTING HEADER
   ========================================= */
.blog-header {
  background: linear-gradient(160deg, #ffffff 0%, #eef2ff 40%, #fdf2f8 100%);
  padding: 3.5rem 0 2.5rem;
  text-align: center;
}

.blog-header h1 {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.blog-header p {
  color: var(--ot-text-muted);
  max-width: 480px;
  margin: 0 auto 1.5rem;
}

.blog-search-form {
  max-width: 420px;
  margin: 0 auto;
  position: relative;
}

.blog-search-form input {
  width: 100%;
  font-family: var(--ot-font-ui);
  font-size: 0.9375rem;
  padding: 0.75em 1.25em 0.75em 3em;
  border: 2px solid var(--ot-border);
  border-radius: var(--ot-radius-full);
  outline: none;
  background: var(--ot-bg);
  transition: border-color var(--ot-transition);
}

.blog-search-form input:focus {
  border-color: var(--ot-primary);
}

.blog-search-form svg {
  position: absolute;
  left: 1em;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ot-text-muted);
}

/* =========================================
   19. CATEGORY ARCHIVE HEADER
   ========================================= */
.category-header {
  padding: 3rem 0 2rem;
  text-align: center;
}

.category-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.category-header .category-badge {
  font-size: 0.75rem;
  margin-bottom: 1rem;
}

.category-header p {
  color: var(--ot-text-muted);
  max-width: 560px;
  margin: 0 auto;
}

.category-post-count {
  font-family: var(--ot-font-ui);
  font-size: 0.875rem;
  color: var(--ot-text-muted);
  margin-bottom: 0.25rem;
}

/* =========================================
   20. FOOTER
   ========================================= */
.site-footer {
  background: var(--ot-bg-alt);
  color: var(--ot-text-muted);
  padding: 4rem 0 0;
  border-top: 1px solid var(--ot-border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--ot-border);
}

.footer-brand p {
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--ot-radius-sm);
  background: var(--ot-bg);
  color: var(--ot-text-muted);
  border: 1px solid var(--ot-border);
  transition: all var(--ot-transition);
}

.footer-social a:hover {
  background: var(--ot-primary);
  color: #fff;
  border-color: var(--ot-primary);
}

.footer-col h4 {
  font-family: var(--ot-font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ot-text);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  font-family: var(--ot-font-ui);
  font-size: 0.875rem;
  color: var(--ot-text-muted);
  transition: color var(--ot-transition);
}

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

.footer-newsletter input[type="email"] {
  width: 100%;
  font-family: var(--ot-font-ui);
  font-size: 0.875rem;
  padding: 0.75em 1em;
  border: 1px solid var(--ot-border);
  border-radius: var(--ot-radius-sm);
  background: var(--ot-bg);
  color: var(--ot-text);
  outline: none;
  margin-bottom: 0.75rem;
  transition: border-color var(--ot-transition);
}

.footer-newsletter input[type="email"]:focus {
  border-color: var(--ot-primary);
}

.footer-newsletter .btn {
  width: 100%;
}

.footer-bottom {
  padding: 1.5rem 0;
  text-align: center;
  font-family: var(--ot-font-ui);
  font-size: 0.8125rem;
  color: var(--ot-text-muted);
}

.footer-bottom p {
  margin: 0;
}

/* =========================================
   21. PAGE TEMPLATE
   ========================================= */
.page-content {
  max-width: var(--ot-content-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.page-content h1 {
  margin-bottom: 1.5rem;
}

/* =========================================
   22. SEARCH RESULTS
   ========================================= */
.search-header {
  padding: 3rem 0 2rem;
  text-align: center;
  background: var(--ot-bg-alt);
}

.search-header h1 span {
  color: var(--ot-primary);
}

.search-results {
  padding: 2rem 0 4rem;
}

/* =========================================
   23. 404 PAGE
   ========================================= */
.error-404 {
  text-align: center;
  padding: 6rem 1.5rem;
}

.error-404 h1 {
  font-size: 5rem;
  color: var(--ot-primary-light);
  margin-bottom: 0.5rem;
}

.error-404 h2 {
  margin-bottom: 1rem;
}

.error-404 p {
  color: var(--ot-text-muted);
  max-width: 480px;
  margin: 0 auto 2rem;
}

/* =========================================
   24. RESPONSIVE
   ========================================= */
@media (max-width: 1200px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

  .hero-section {
    padding: 3rem 0 2.5rem;
  }

  .hero-section h1 {
    font-size: 2.25rem;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  .post-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .featured-card {
    grid-template-columns: 1fr;
  }

  .featured-card .post-card-image {
    min-height: 220px;
  }

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

  .site-nav {
    display: none;
  }

  .header-actions .btn {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .article-header h1 {
    font-size: 2rem;
  }

  .blog-header h1 {
    font-size: 1.875rem;
  }

  .newsletter-form {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .hero-section h1 {
    font-size: 1.75rem;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .topics-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .article-header h1 {
    font-size: 1.75rem;
  }

  .author-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* =========================================
   25. DARK MODE
   ========================================= */
@media (prefers-color-scheme: dark) {
  :root {
    --ot-text: #e2e8f0;
    --ot-text-muted: #94a3b8;
    --ot-bg: #0f172a;
    --ot-bg-alt: #1e293b;
    --ot-bg-card: #1e293b;
    --ot-border: #334155;
    --ot-primary-light: #1e1b4b;
    --ot-accent-light: #500724;
    --ot-shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --ot-shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --ot-shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
  }

  .site-header {
    border-bottom-color: var(--ot-border);
  }

  .site-header.scrolled {
    box-shadow: 0 1px 8px rgba(0,0,0,0.3);
  }

  .hero-section {
    background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 50%, #1e293b 100%);
  }

  .blog-header {
    background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 50%, #1e293b 100%);
  }

  pre {
    background: #1e293b;
    border: 1px solid var(--ot-border);
  }

  code {
    background: var(--ot-bg-alt);
    border-color: var(--ot-border);
  }

  blockquote {
    background: #1e1b4b;
  }

  .ot-takeaway {
    background: #1e1b4b;
  }

  .ot-tip {
    background: #064e3b;
  }

  .ot-warning {
    background: #431407;
  }

  .site-footer {
    background: #020617;
    border-top-color: #1e293b;
  }

  .footer-grid {
    border-bottom-color: #1e293b;
  }

  .footer-social a {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
  }

  .footer-col h4 {
    color: #e2e8f0;
  }

  .footer-col a {
    color: #94a3b8;
  }

  .footer-col a:hover {
    color: #a5b4fc;
  }

  .footer-newsletter input[type="email"] {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
  }

  .newsletter-section {
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
  }

  .search-overlay-inner {
    background: var(--ot-bg-alt);
  }

  img {
    opacity: 0.92;
  }
}

/* =========================================
   26. ANIMATIONS
   ========================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card,
.topic-card {
  animation: fadeInUp 0.4s ease both;
}

.post-grid .post-card:nth-child(2) { animation-delay: 0.05s; }
.post-grid .post-card:nth-child(3) { animation-delay: 0.1s; }
.post-grid .post-card:nth-child(4) { animation-delay: 0.15s; }
.post-grid .post-card:nth-child(5) { animation-delay: 0.2s; }
.post-grid .post-card:nth-child(6) { animation-delay: 0.25s; }

/* WordPress core alignment classes */
.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.alignleft {
  float: left;
  margin-right: 1.5em;
  margin-bottom: 1em;
}

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

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

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

/* WordPress block styles */
.wp-block-image {
  margin: 1.5em 0;
}

.wp-block-image img {
  border-radius: var(--ot-radius-sm);
}

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

.has-text-align-right {
  text-align: right;
}

/* Ensure wp-admin bar doesn't break sticky header */
.admin-bar .site-header {
  top: 32px;
}

@media (max-width: 782px) {
  .admin-bar .site-header {
    top: 46px;
  }
}
