/*
Theme Name: WhyExplain
Theme URI: https://whyexplain.com
Author: WhyExplain Editorial Team
Author URI: https://whyexplain.com/about
Description: WhyExplain — A search-first global information platform. Clean, fast, trustworthy. Inspired by the information architecture of leading reference sites.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: Proprietary
License URI: https://whyexplain.com/terms-of-use
Text Domain: whyexplain
Tags: blog, custom-background, custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, rtl-language-support, sticky-post, threaded-comments, translation-ready
*/

/* === DESIGN TOKENS === */
:root {
  --color-primary: #0a3d91;
  --color-primary-dark: #072d6b;
  --color-primary-light: #1a56c4;
  --color-accent: #e85d04;
  --color-accent-hover: #c44d00;
  --color-success: #1a7a4a;
  --color-warning: #b45309;

  --color-text: #1a1a2e;
  --color-text-secondary: #4a4a6a;
  --color-text-muted: #6b7280;
  --color-text-light: #9ca3af;

  --color-bg: #ffffff;
  --color-bg-subtle: #f8f9fc;
  --color-bg-muted: #f0f2f8;
  --color-bg-dark: #0f1f4a;

  --color-border: #e2e6f0;
  --color-border-strong: #c5cde0;

  --color-white: #ffffff;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(10,61,145,0.08), 0 1px 2px rgba(10,61,145,0.06);
  --shadow-md: 0 4px 12px rgba(10,61,145,0.10), 0 2px 6px rgba(10,61,145,0.06);
  --shadow-lg: 0 10px 30px rgba(10,61,145,0.12), 0 4px 12px rgba(10,61,145,0.08);
  --shadow-card: 0 2px 8px rgba(10,61,145,0.08);

  --nav-height: 64px;
  --container-max: 1200px;
  --sidebar-width: 300px;
}

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

h1,h2,h3,h4,h5,h6 {
  font-weight: var(--weight-bold);
  line-height: 1.25;
  color: var(--color-text);
  text-wrap: balance;
}
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

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

.container--narrow { max-width: 860px; margin: 0 auto; padding-inline: 1.5rem; }
.container--wide { max-width: 1400px; margin: 0 auto; padding-inline: 1.5rem; }

.site-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .site-layout { grid-template-columns: 1fr; }
  .site-sidebar { display: none; }
}

/* === HEADER === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.header-top {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--nav-height);
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: var(--weight-bold);
  font-size: var(--text-xl);
  color: var(--color-primary);
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}

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

.logo-mark {
  width: 36px; height: 36px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 1rem;
  font-weight: 800;
}

.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.header-search-form {
  display: flex;
  align-items: center;
  background: var(--color-bg-subtle);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.header-search-form:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(10,61,145,0.1);
  background: var(--color-white);
}

.header-search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
  color: var(--color-text);
  outline: none;
}

.header-search-input::placeholder { color: var(--color-text-muted); }

.header-search-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--color-text-muted);
  display: flex; align-items: center;
}

.header-search-btn:hover { color: var(--color-primary); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  color: var(--color-white);
  transform: translateY(-1px);
}

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

/* PRIMARY NAV */
.primary-nav {
  background: var(--color-primary);
  overflow-x: auto;
  scrollbar-width: none;
}
.primary-nav::-webkit-scrollbar { display: none; }

.primary-nav-list {
  display: flex;
  gap: 0;
  list-style: none;
  width: max-content;
  min-width: 100%;
}

.primary-nav-list > li { position: relative; }

.primary-nav-list > li > a {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.6rem 1.2rem;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: rgba(255,255,255,0.88);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.primary-nav-list > li > a:hover,
.primary-nav-list > li > a.active {
  background: rgba(255,255,255,0.12);
  color: white;
}

/* MOBILE MENU */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
}

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

.mobile-nav {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0; bottom: 0;
  background: var(--color-white);
  overflow-y: auto;
  z-index: 999;
  padding: 1rem 1.5rem 2rem;
  border-top: 1px solid var(--color-border);
}

.mobile-nav.is-open { display: block; }

.mobile-nav a {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  font-weight: var(--weight-medium);
  font-size: var(--text-base);
}

.mobile-nav a:hover { color: var(--color-primary); }

@media (max-width: 768px) {
  .mobile-menu-toggle { display: flex; }
  .header-search { display: none; }
  .primary-nav { display: none; }
}

/* === HERO SEARCH SECTION === */
.hero-search {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  padding: 3.5rem 0;
  text-align: center;
}

.hero-search__eyebrow {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.hero-search__title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  color: var(--color-white);
  margin-bottom: 0.5rem;
  font-weight: 800;
}

.hero-search__subtitle {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.75);
  margin-bottom: 2rem;
}

.hero-search-bar {
  display: flex;
  align-items: center;
  max-width: 640px;
  margin: 0 auto 1.5rem;
  background: white;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  overflow: hidden;
}

.hero-search-bar input {
  flex: 1;
  border: none;
  padding: 1rem 1.5rem;
  font-size: var(--text-base);
  color: var(--color-text);
  outline: none;
}

.hero-search-bar input::placeholder { color: var(--color-text-muted); }

.hero-search-bar button {
  padding: 0.75rem 1.75rem;
  background: var(--color-accent);
  color: white;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.hero-search-bar button:hover { background: var(--color-accent-hover); }

.hero-search__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.suggestion-chip {
  padding: 0.35rem 0.9rem;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.suggestion-chip:hover {
  background: rgba(255,255,255,0.22);
  color: white;
  border-color: rgba(255,255,255,0.5);
}

/* === SECTION TITLES === */
.section { padding: 3rem 0; }
.section--bg { background: var(--color-bg-subtle); }
.section--dark { background: var(--color-bg-dark); }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.section-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  margin-top: 0.35rem;
}

.view-all {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.view-all:hover { color: var(--color-accent); }

/* === ARTICLE CARDS === */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

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

@media (max-width: 1100px) { .cards-grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .cards-grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .cards-grid--4, .cards-grid--3, .cards-grid--2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card__image {
  aspect-ratio: 16/9;
  background: var(--color-bg-muted);
  overflow: hidden;
  flex-shrink: 0;
}

.card__image img { width: 100%; height: 100%; object-fit: cover; }

.card__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.card__body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card__category {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.card__category:hover { color: var(--color-accent); }

.card__title {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  line-height: 1.35;
  margin: 0;
}

.card__title a { color: inherit; text-decoration: none; }
.card__title a:hover { color: var(--color-primary); }

.card__excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.55;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.card__read-time::before { content: '·'; margin-right: 0.25rem; }

/* FEATURED CARD */
.card--featured {
  grid-column: span 2;
  flex-direction: row;
}

.card--featured .card__image {
  width: 45%;
  flex-shrink: 0;
  aspect-ratio: auto;
}

.card--featured .card__title { font-size: var(--text-xl); }
.card--featured .card__excerpt { -webkit-line-clamp: 3; }

@media (max-width: 640px) {
  .card--featured { flex-direction: column; grid-column: span 1; }
  .card--featured .card__image { width: 100%; aspect-ratio: 16/9; }
}

/* === TOPIC GRID === */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) { .topic-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .topic-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; } }

.topic-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1.1rem 1.25rem;
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--color-text);
}

.topic-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  color: var(--color-primary);
}

.topic-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.topic-card__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
}

.topic-card__count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 0.1rem;
}

/* === TOOLS SECTION === */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 900px) { .tools-grid { grid-template-columns: 1fr; } }

.tool-card {
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all 0.2s;
}

.tool-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); }

.tool-card__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.tool-card__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.tool-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

/* CALCULATOR WIDGET */
.calc-widget { display: flex; flex-direction: column; gap: 0.75rem; }

.calc-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.calc-field label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calc-field input, .calc-field select {
  padding: 0.6rem 0.875rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--color-bg-subtle);
}

.calc-field input:focus, .calc-field select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(10,61,145,0.1);
  background: white;
}

.calc-btn {
  padding: 0.7rem 1.25rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  cursor: pointer;
  transition: background 0.15s;
}

.calc-btn:hover { background: var(--color-primary-dark); }

.calc-result {
  background: var(--color-bg-muted);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  min-height: 2.5rem;
}

.calc-result.has-result {
  border-color: var(--color-primary);
  background: rgba(10,61,145,0.04);
  color: var(--color-text);
  font-weight: var(--weight-semibold);
}

/* === TRUST SIGNALS === */
.trust-bar {
  background: var(--color-bg-subtle);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}

.trust-bar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-weight: var(--weight-medium);
}

.trust-item svg, .trust-item .trust-icon {
  color: var(--color-primary);
  font-size: 1.1rem;
}

/* === NEWSLETTER === */
.newsletter-section {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  padding: 3rem 0;
  text-align: center;
}

.newsletter-section .section-title { color: white; }
.newsletter-section .section-title::after { background: rgba(255,255,255,0.4); }

.newsletter-section p { color: rgba(255,255,255,0.78); }

.newsletter-form {
  display: flex;
  gap: 0.5rem;
  max-width: 480px;
  margin: 1.5rem auto 0;
}

.newsletter-form input {
  flex: 1;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  outline: none;
  color: var(--color-text);
}

.newsletter-form button {
  padding: 0.75rem 1.5rem;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.newsletter-form button:hover { background: var(--color-accent-hover); }

.newsletter-disclaimer {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.5);
  margin-top: 0.75rem;
}

@media (max-width: 480px) {
  .newsletter-form { flex-direction: column; }
  .newsletter-form input, .newsletter-form button { width: 100%; }
}

/* === FOOTER === */
.site-footer {
  background: var(--color-bg-dark);
  color: rgba(255,255,255,0.7);
  padding: 3.5rem 0 1.5rem;
}

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

@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; } }

.footer-brand .site-logo { color: white; font-size: var(--text-lg); }
.footer-brand .logo-mark { background: rgba(255,255,255,0.15); }

.footer-brand__desc {
  margin-top: 0.875rem;
  font-size: var(--text-sm);
  line-height: 1.65;
  color: rgba(255,255,255,0.55);
}

.footer-col-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 1rem;
}

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

.footer-links a {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: color 0.15s;
  line-height: 1.4;
}

.footer-links a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-legal {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.35);
}

.footer-bottom-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-bottom-links a {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.4);
  text-decoration: none;
}

.footer-bottom-links a:hover { color: rgba(255,255,255,0.7); }

/* === ARTICLE SINGLE === */
.article-hero {
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border);
  padding: 2.5rem 0;
}

.article-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.article-breadcrumb a { color: var(--color-primary); text-decoration: none; }
.article-breadcrumb a:hover { text-decoration: underline; }
.article-breadcrumb span { color: var(--color-text-muted); }

.article-header__category {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  text-decoration: none;
}

.article-header__title {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-text);
  margin-bottom: 1rem;
  max-width: 760px;
}

.article-header__excerpt {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: 1.65;
  max-width: 680px;
  margin-bottom: 1.25rem;
}

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

.article-meta__author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
}

.author-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}

.article-content {
  padding: 2.5rem 0;
}

/* Key Takeaways */
.we-takeaways {
  background: var(--color-bg-subtle) !important;
  border: 1px solid var(--color-border) !important;
  border-left: 4px solid var(--color-primary) !important;
  border-radius: var(--radius-md) !important;
  padding: 1.25rem 1.5rem !important;
  margin: 1.75rem 0 !important;
}

.we-takeaways-title {
  font-size: var(--text-base) !important;
  font-weight: var(--weight-bold) !important;
  color: var(--color-primary) !important;
  margin-bottom: 0.75rem !important;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.we-takeaways ul {
  margin: 0 !important;
  padding-left: 1.25rem !important;
  list-style: disc !important;
}

.we-takeaways ul li {
  margin-bottom: 0.4rem !important;
  color: var(--color-text-secondary) !important;
  font-size: 0.95rem !important;
}

/* Article body styles */
.entry-content {
  max-width: 760px;
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--color-text);
}

.entry-content h2 {
  font-size: var(--text-2xl);
  margin: 2rem 0 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text);
}

.entry-content h3 {
  font-size: var(--text-xl);
  margin: 1.5rem 0 0.75rem;
  color: var(--color-text);
}

.entry-content h4 {
  font-size: var(--text-lg);
  margin: 1.25rem 0 0.6rem;
}

.entry-content p { margin-bottom: 1.25rem; }
.entry-content ul, .entry-content ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.entry-content li { margin-bottom: 0.4rem; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }

.entry-content a { color: var(--color-primary); text-decoration: underline; }
.entry-content a:hover { color: var(--color-accent); }

.entry-content blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 0.875rem 1.25rem;
  background: var(--color-bg-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

.entry-content img {
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin: 1.5rem 0;
}

.entry-content table th {
  background: var(--color-primary);
  color: white;
  padding: 0.6rem 0.875rem;
  text-align: left;
  font-weight: var(--weight-semibold);
}

.entry-content table td {
  padding: 0.6rem 0.875rem;
  border-bottom: 1px solid var(--color-border);
}

.entry-content table tr:nth-child(even) td { background: var(--color-bg-subtle); }

.entry-content code {
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.875em;
  background: var(--color-bg-muted);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--color-primary-dark);
}

/* === SIDEBAR === */
.sidebar-widget {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.sidebar-widget-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.related-post {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border);
}

.related-post:last-child { border-bottom: none; }

.related-post__thumb {
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  background: var(--color-bg-muted);
  flex-shrink: 0;
  overflow: hidden;
  font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center;
}

.related-post__thumb img { width: 100%; height: 100%; object-fit: cover; }

.related-post__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.35;
  color: var(--color-text);
}

.related-post__title a { color: inherit; text-decoration: none; }
.related-post__title a:hover { color: var(--color-primary); }

.related-post__cat {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

/* Ad Placeholder */
.ad-zone {
  background: var(--color-bg-muted);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-size: var(--text-xs);
  color: var(--color-text-light);
  letter-spacing: 0.04em;
}

.ad-zone--banner { height: 90px; }
.ad-zone--rectangle { height: 250px; }
.ad-zone--leaderboard { height: 90px; width: 100%; }

/* === CATEGORY ARCHIVE === */
.archive-header {
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border);
  padding: 2rem 0;
  margin-bottom: 2rem;
}

.archive-header__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.archive-header__title {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.archive-header__desc {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  max-width: 600px;
}

/* === SEARCH RESULTS === */
.search-results-header {
  background: var(--color-bg-subtle);
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

.search-results-header h1 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
}

.search-result-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 1.25rem;
}

.search-result-item:last-child { border-bottom: none; }

.search-result__thumb {
  width: 80px; height: 80px;
  border-radius: var(--radius-md);
  background: var(--color-bg-muted);
  flex-shrink: 0;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}

.search-result__body { flex: 1; }

.search-result__cat {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.search-result__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.search-result__title a { color: var(--color-text); text-decoration: none; }
.search-result__title a:hover { color: var(--color-primary); }

.search-result__excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.55;
}

/* === 404 === */
.not-found-wrap {
  text-align: center;
  padding: 5rem 1.5rem;
}

.not-found-wrap h1 { font-size: 6rem; color: var(--color-primary); opacity: 0.15; }
.not-found-wrap h2 { font-size: var(--text-2xl); margin-bottom: 1rem; }
.not-found-wrap p { color: var(--color-text-secondary); margin-bottom: 2rem; }

/* === UTILITIES === */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.badge--primary { background: rgba(10,61,145,0.1); color: var(--color-primary); }
.badge--accent { background: rgba(232,93,4,0.1); color: var(--color-accent); }
.badge--green { background: rgba(26,122,74,0.1); color: var(--color-success); }

/* Page content styles */
.page-content {
  padding: 2.5rem 0;
}

.page-content .entry-content {
  max-width: 760px;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px; height: 36px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  padding: 0 0.5rem;
}

.page-numbers:hover, .page-numbers.current {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: white;
}

/* Focus styles */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 9999;
  background: var(--color-primary);
  color: white;
  padding: 0.75rem 1.5rem;
  font-weight: var(--weight-bold);
}

.skip-link:focus { top: 0; }

/* Responsive tweaks */
@media (max-width: 480px) {
  :root { --nav-height: 56px; }
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  .section { padding: 2rem 0; }
  .article-header__title { font-size: var(--text-2xl); }
  .article-header__excerpt { font-size: var(--text-base); }
  .trust-bar__inner { gap: 1rem; }
}

@media print {
  .site-header, .site-footer, .site-sidebar, .newsletter-section { display: none !important; }
  .site-layout { grid-template-columns: 1fr; }
  .entry-content { max-width: 100%; }
}

/* ================================================================
   ARTICLE (SINGLE) STYLES
   ================================================================ */

/* Breadcrumb bar */
.breadcrumb-bar {
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border);
  padding: 0.6rem 0;
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.breadcrumb__item a { color: var(--color-primary); text-decoration: none; }
.breadcrumb__item a:hover { text-decoration: underline; }
.breadcrumb__item + .breadcrumb__item::before {
  content: '›';
  margin-right: 0.25rem;
  color: var(--color-text-light);
}
/* Non-list breadcrumb (used in category.php) */
nav.breadcrumb { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: 1rem; }
nav.breadcrumb a { color: var(--color-primary); text-decoration: none; }
nav.breadcrumb a:hover { text-decoration: underline; }

/* Article hero */
.article-hero {
  background: var(--color-bg);
  padding: 2.5rem 0 2rem;
}
.article-hero__inner { max-width: 760px; }
.article-hero__category {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  margin-bottom: 0.75rem;
}
.article-hero__title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: var(--weight-bold);
  line-height: 1.2;
  color: var(--color-text);
  text-wrap: balance;
  margin-bottom: 1rem;
}
.article-hero__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}
.article-hero__meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.article-hero__stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.article-hero__updated {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Author chip */
.author-chip { display: flex; align-items: center; gap: 0.65rem; }
.author-chip__avatar {
  width: 36px; height: 36px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  flex-shrink: 0;
}
.author-chip__name { display: block; font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text); }
.author-chip__date { display: block; font-size: var(--text-xs); color: var(--color-text-muted); }

/* Read time badge */
.read-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--color-bg-muted);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

/* Article layout */
.article-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 3rem;
  padding: 2rem 0 4rem;
  align-items: start;
}

/* Article featured image */
.article-featured-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.75rem;
  background: var(--color-bg-muted);
}
.article-featured-img img { width: 100%; display: block; }
.article-featured-img figcaption {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding: 0.5rem 0.75rem;
}

/* Entry content styles */
.entry-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--color-text);
  max-width: 720px;
}
.entry-content > * + * { margin-top: 1.25rem; }
.entry-content h2 { font-size: var(--text-2xl); font-weight: var(--weight-bold); color: var(--color-text); margin-top: 2.5rem; margin-bottom: 0.75rem; scroll-margin-top: 80px; }
.entry-content h3 { font-size: var(--text-xl); font-weight: var(--weight-semibold); color: var(--color-text); margin-top: 2rem; margin-bottom: 0.6rem; scroll-margin-top: 80px; }
.entry-content h4 { font-size: var(--text-lg); font-weight: var(--weight-semibold); margin-top: 1.5rem; }
.entry-content p { margin-bottom: 1.25rem; }
.entry-content ul, .entry-content ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.entry-content li { margin-bottom: 0.5rem; }
.entry-content a { color: var(--color-primary); text-decoration: underline; }
.entry-content a:hover { color: var(--color-accent); }
.entry-content strong { font-weight: var(--weight-bold); color: var(--color-text); }
.entry-content blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 0.75rem 1.25rem;
  background: var(--color-bg-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--color-text-secondary);
  margin: 1.5rem 0;
}
.entry-content code {
  font-family: 'Courier New', monospace;
  font-size: 0.875em;
  background: var(--color-bg-muted);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}
.entry-content pre {
  background: #1a1a2e;
  color: #e2e6f0;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: var(--text-sm);
  margin: 1.5rem 0;
}
.entry-content pre code { background: none; padding: 0; color: inherit; }
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin: 1.5rem 0;
}
.entry-content th {
  background: var(--color-bg-muted);
  padding: 0.6rem 0.875rem;
  text-align: left;
  font-weight: var(--weight-semibold);
  border: 1px solid var(--color-border);
}
.entry-content td {
  padding: 0.6rem 0.875rem;
  border: 1px solid var(--color-border);
}
.entry-content tr:nth-child(even) td { background: var(--color-bg-subtle); }
.entry-content img { border-radius: var(--radius-md); max-width: 100%; }

/* Takeaways box (existing site feature) */
.we-takeaways, .entry-content .we-takeaways {
  border-left: 4px solid var(--color-primary);
  background: var(--color-bg-subtle);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}
.we-takeaways h3, .we-takeaways h4 {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  margin-top: 0;
}
.we-takeaways ul { padding-left: 1.25rem; }
.we-takeaways li { margin-bottom: 0.4rem; }

/* Trust note */
.article-trust-note {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: #f0f7ff;
  border: 1px solid #c0d9f5;
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin: 2rem 0;
}
.article-trust-note svg { color: var(--color-primary); flex-shrink: 0; margin-top: 0.1rem; }
.article-trust-note a { color: var(--color-primary); font-weight: var(--weight-semibold); }

/* Tags */
.article-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 1.5rem 0; }
.article-tags__label { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text-muted); }
.tag-chip {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--color-bg-muted);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.tag-chip:hover { background: var(--color-primary); color: white; }

/* Author box */
.author-box {
  display: flex;
  gap: 1.25rem;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 2.5rem;
}
.author-box__avatar {
  width: 56px; height: 56px;
  min-width: 56px;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
}
.author-box__name { font-weight: var(--weight-bold); font-size: var(--text-base); margin-bottom: 0.25rem; }
.author-box__bio { font-size: var(--text-sm); color: var(--color-text-secondary); line-height: 1.5; }
.author-box__link { display: inline-block; margin-top: 0.5rem; font-size: var(--text-sm); color: var(--color-primary); font-weight: var(--weight-semibold); text-decoration: none; }
.author-box__link:hover { text-decoration: underline; }

/* Sidebar */
.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: calc(var(--nav-height) + 72px + 1rem);
  max-height: calc(100vh - var(--nav-height) - 72px - 2rem);
  overflow-y: auto;
}
.sidebar-widget { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.25rem; }
.sidebar-widget-title { font-size: var(--text-sm); font-weight: var(--weight-bold); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); margin-bottom: 1rem; }
.sidebar-post-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.sidebar-post-item { display: flex; flex-direction: column; gap: 0.2rem; }
.sidebar-post-link { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text); text-decoration: none; line-height: 1.4; }
.sidebar-post-link:hover { color: var(--color-primary); }
.sidebar-post-meta { font-size: var(--text-xs); color: var(--color-text-muted); }
.sidebar-view-all { display: inline-block; margin-top: 0.75rem; font-size: var(--text-sm); color: var(--color-primary); font-weight: var(--weight-semibold); text-decoration: none; }
.sidebar-view-all:hover { text-decoration: underline; }
.sidebar-widget--newsletter { background: linear-gradient(135deg, #0a3d91, #1a56c4); color: white; border: none; text-align: center; }
.sidebar-widget--newsletter .sidebar-widget-title { color: rgba(255,255,255,0.75); }
.sidebar-newsletter-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.sidebar-newsletter-desc { font-size: var(--text-sm); opacity: 0.85; margin-bottom: 1rem; line-height: 1.5; }
.sidebar-newsletter-form { display: flex; flex-direction: column; gap: 0.5rem; }
.sidebar-newsletter-form input { padding: 0.6rem 0.875rem; border: none; border-radius: var(--radius-md); font-size: var(--text-sm); }
.sidebar-newsletter-form button { background: var(--color-accent); color: white; font-weight: var(--weight-bold); font-size: var(--text-sm); border: none; border-radius: var(--radius-md); padding: 0.6rem; cursor: pointer; transition: background 0.15s; }
.sidebar-newsletter-form button:hover { background: var(--color-accent-hover); }
.sidebar-newsletter-fine { font-size: var(--text-xs); opacity: 0.6; margin-top: 0.5rem; }
.sidebar-tools-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.sidebar-tools-list a { font-size: var(--text-sm); color: var(--color-primary); text-decoration: none; font-weight: var(--weight-medium); }
.sidebar-tools-list a:hover { text-decoration: underline; }
.sidebar-ad-sticky { margin-top: auto; }

/* Ad zone - sidebar */
.ad-zone--sidebar { min-height: 250px; }

/* ================================================================
   CATEGORY HERO
   ================================================================ */
.category-hero {
  background: var(--color-bg-subtle);
  padding: 2rem 0 2rem;
  border-bottom: 1px solid var(--color-border);
}
.category-hero__inner {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-top: 0.75rem;
}
.category-hero__icon {
  font-size: 2.5rem;
  width: 64px; height: 64px;
  min-width: 64px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-xl);
}
.category-hero__title { font-size: var(--text-3xl); font-weight: var(--weight-bold); line-height: 1.2; }
.category-hero__desc { font-size: var(--text-base); color: var(--color-text-secondary); margin-top: 0.5rem; line-height: 1.6; }
.category-hero__count { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: 0.4rem; }

/* ================================================================
   SEARCH RESULTS PAGE
   ================================================================ */
.search-results-header {
  background: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border);
  padding: 2rem 0;
}
.search-results-header__title { font-size: var(--text-3xl); font-weight: var(--weight-bold); margin-bottom: 0.5rem; }
.search-results-header__title em { font-style: normal; color: var(--color-primary); }
.search-results-header__count { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: 1rem; }
.search-refine-form { display: flex; gap: 0; max-width: 520px; border: 2px solid var(--color-primary); border-radius: var(--radius-lg); overflow: hidden; }
.search-refine-form input { flex: 1; border: none; padding: 0.7rem 1rem; font-size: var(--text-base); outline: none; background: white; }
.search-refine-form button { background: var(--color-primary); color: white; font-weight: var(--weight-bold); border: none; padding: 0 1.25rem; cursor: pointer; }

.search-filter-bar { background: var(--color-bg); border-bottom: 1px solid var(--color-border); padding: 0.875rem 0; }
.search-filter-bar__label { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text-muted); margin-right: 0.5rem; }
.search-filter-chips { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; }
.filter-chip { font-size: var(--text-xs); font-weight: var(--weight-semibold); padding: 0.3rem 0.75rem; border-radius: var(--radius-full); border: 1.5px solid var(--color-border); color: var(--color-text-secondary); text-decoration: none; transition: all 0.15s; }
.filter-chip:hover, .filter-chip--active { background: var(--color-primary); color: white; border-color: var(--color-primary); }

.search-results-list { display: flex; flex-direction: column; gap: 1.25rem; }
.search-result-item {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: box-shadow 0.15s;
}
.search-result-item:hover { box-shadow: var(--shadow-md); border-color: var(--color-primary); }
.search-result-thumb { width: 80px; min-width: 80px; height: 80px; border-radius: var(--radius-md); overflow: hidden; }
.search-result-thumb img { width: 100%; height: 100%; object-fit: cover; }
.search-result-thumb__emoji { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2rem; border-radius: var(--radius-md); }
.search-result-body { flex: 1; min-width: 0; }
.search-result-cat { font-size: var(--text-xs); font-weight: var(--weight-bold); text-transform: uppercase; letter-spacing: 0.05em; text-decoration: none; }
.search-result-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: 1.3; margin: 0.25rem 0 0.4rem; }
.search-result-title a { color: var(--color-text); text-decoration: none; }
.search-result-title a:hover { color: var(--color-primary); }
.search-result-excerpt { font-size: var(--text-sm); color: var(--color-text-secondary); line-height: 1.5; }
.search-result-meta { display: flex; gap: 1rem; font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 0.5rem; }

/* ================================================================
   GENERIC PAGE & NOT FOUND
   ================================================================ */
.page-hero {
  background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-primary) 100%);
  color: white;
  padding: 3rem 0 2.5rem;
}
.page-hero__title { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: var(--weight-bold); line-height: 1.2; }
.page-hero__subtitle { margin-top: 0.75rem; opacity: 0.85; font-size: var(--text-lg); }

.page-content-wrap { max-width: 760px; }
.page-entry-content { max-width: 100%; }

.not-found { text-align: center; max-width: 600px; margin: 0 auto; padding: 2rem 0; }
.not-found__code { font-size: clamp(5rem, 15vw, 9rem); font-weight: 800; color: var(--color-bg-muted); line-height: 1; margin-bottom: -1rem; }
.not-found__emoji { font-size: 3rem; }
.not-found__title { font-size: var(--text-3xl); font-weight: var(--weight-bold); margin: 1rem 0 0.75rem; }
.not-found__text { font-size: var(--text-lg); color: var(--color-text-secondary); margin-bottom: 1.5rem; }
.not-found__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1rem; }

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination-wrap {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
}
.pagination-wrap .nav-links { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.pagination-wrap .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px; height: 40px;
  padding: 0 0.75rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  color: var(--color-text);
  text-decoration: none;
  transition: all 0.15s;
}
.pagination-wrap .page-numbers:hover { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.pagination-wrap .page-numbers.current { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.pagination-wrap .page-numbers.dots { border: none; }

/* ================================================================
   TOC (Table of Contents)
   ================================================================ */
.toc-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.toc-list li a { font-size: var(--text-sm); color: var(--color-text-secondary); text-decoration: none; display: block; padding: 0.15rem 0; border-left: 2px solid transparent; padding-left: 0.5rem; transition: all 0.1s; }
.toc-list li a:hover { color: var(--color-primary); border-color: var(--color-primary); }
.toc-sub { list-style: none; padding-left: 1rem; margin-top: 0.25rem; }

/* ================================================================
   HEADER SCROLL STATES
   ================================================================ */
.header--scrolled { box-shadow: var(--shadow-md); }
.header--hidden { transform: translateY(-100%); transition: transform 0.25s ease; }
.header--visible { transform: translateY(0); transition: transform 0.25s ease; }
.site-header { transition: transform 0.25s ease, box-shadow 0.2s; }

/* ================================================================
   CALC RESULT STATES
   ================================================================ */
.calc-result--success { color: var(--color-success); background: #f0fdf4; border-color: #bbf7d0; }
.calc-result--error   { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }

/* ================================================================
   RESPONSIVE — ARTICLE & SIDEBAR
   ================================================================ */
@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .article-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .sidebar-ad-sticky { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .article-sidebar { grid-template-columns: 1fr; }
  .author-box { flex-direction: column; }
  .search-result-item { flex-direction: column; }
  .search-result-thumb { width: 100%; height: 140px; }
  .category-hero__inner { flex-direction: column; }
}
