/* ============================================================
   main.css — Age Calculator Site
   Design System: Inter font, Indigo + Cyan palette
   Mobile-first, vanilla CSS
   ============================================================ */

/* ─── Custom Properties ─────────────────────────────────────── */
:root {
  --primary:        #4F46E5;
  --primary-dark:   #3730A3;
  --primary-light:  #EEF2FF;
  --secondary:      #06B6D4;
  --secondary-light:#ECFEFF;
  --bg:             #FFFFFF;
  --bg-subtle:      #F8FAFC;
  --bg-card:        #FFFFFF;
  --text-primary:   #0F172A;
  --text-secondary: #475569;
  --text-muted:     #94A3B8;
  --border:         #E2E8F0;
  --border-focus:   #4F46E5;
  --success:        #10B981;
  --error:          #EF4444;
  --warning:        #F59E0B;
  --radius:         14px;
  --radius-sm:      8px;
  --radius-lg:      20px;
  --shadow:         0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  --shadow-md:      0 4px 12px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.06);
  --shadow-lg:      0 8px 32px rgba(79,70,229,.14);
  --font:           'Inter', system-ui, -apple-system, sans-serif;
  --transition:     .2s cubic-bezier(.4,0,.2,1);
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, ::before, ::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
button { cursor: pointer; font-family: inherit; }
ul, ol { list-style: none; }

/* ─── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.02em;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.375rem, 3vw, 2rem); }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }
p  { color: var(--text-secondary); line-height: 1.75; }
p + p { margin-top: .875rem; }

/* ─── Layout ─────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.container--narrow { max-width: 760px; }
.section { padding: 4rem 0; }
.section--lg { padding: 6rem 0; }

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  font-weight: 600;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79,70,229,.3);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  box-shadow: 0 4px 16px rgba(79,70,229,.4);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.btn-sm { padding: .5rem 1.125rem; font-size: .875rem; }
.btn-lg { padding: 1rem 2.25rem; font-size: 1.0625rem; border-radius: var(--radius); }

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-body { padding: 1.75rem; }
.card-body--lg { padding: 2.5rem; }

/* ─── Forms ─────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-label { font-size: .9375rem; font-weight: 600; color: var(--text-primary); }
.form-label.required::after { content: ' *'; color: var(--error); }
.form-control {
  width: 100%;
  padding: .75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 120px; }

/* ─── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .25rem .625rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-secondary { background: var(--secondary-light); color: #0891B2; }
.badge-success { background: #D1FAE5; color: #059669; }
.badge-warning { background: #FEF3C7; color: #D97706; }
.badge-muted { background: var(--bg-subtle); color: var(--text-muted); }

/* ─── Site Header — Floating Glassmorphism ──────────────────
   Core styles are inlined in header.php for FOUC prevention.
   Only supplementary responsive rules here.
   ─────────────────────────────────────────────────────────── */
.site-header { }   /* base set inline */

@media (max-width: 767px) {
  .site-header .inner { padding: 0 1rem; }
  .nav-links { display: none !important; }
  .nav-mobile-toggle { display: flex !important; }
}
@media (min-width: 768px) {
  .nav-mobile-toggle { display: none !important; }
  .nav-links { display: flex !important; }
}

/* Footer logo uses same class — keep its colour */
.footer-section .site-logo { color: #fff; }
.footer-section .site-logo .logo-dot { color: var(--secondary); }


/* ─── Hero / Calculator Section ─────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 100%);
  padding: 4rem 0 3rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(79,70,229,.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  background: var(--primary);
  color: #fff;
  padding: .25rem .75rem;
  border-radius: 20px;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.hero h1 {
  margin-bottom: 1rem;
  max-width: 100%;
  text-align: center;
}
.hero-subtitle {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 100%;
  margin-bottom: 2rem;
  text-align: center;
}
.hero-eyebrow-wrap {
  text-align: center;
}
.hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ─── Calculator Card ───────────────────────────────────────── */
.calc-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  max-width: 860px;
  width: 100%;
}

.calc-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 480px) {
  .calc-fields { grid-template-columns: 1fr; }
}

.calc-submit-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.calc-btn {
  flex: 1;
  min-width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .875rem 2rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -.01em;
  box-shadow: 0 4px 14px rgba(79,70,229,.4);
  transition: all var(--transition);
}
.calc-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79,70,229,.5);
}
.calc-btn:active { transform: translateY(0); }

.calc-btn svg { width: 20px; height: 20px; }

.calc-error {
  display: none;
  color: var(--error);
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-size: .9375rem;
  margin-top: 1rem;
}

/* ─── Result Card ───────────────────────────────────────────── */
.result-card {
  display: none;
  background: linear-gradient(135deg, var(--primary) 0%, #6D28D9 100%);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 860px;
  width: 100%;
  margin-top: 1.5rem;
  position: relative;
  overflow: hidden;
}
.result-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}

@keyframes resultReveal {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.result-animate {
  animation: resultReveal .4s cubic-bezier(.4,0,.2,1) forwards;
}

.result-main {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.result-chunk {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  min-width: 90px;
  flex: 1;
}
.result-number {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
}
.result-label {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .8;
  margin-top: .25rem;
}
.result-sep {
  font-size: 1.75rem;
  font-weight: 300;
  opacity: .4;
  align-self: center;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 480px) {
  .result-stats { grid-template-columns: repeat(4, 1fr); }
}

.stat-item {
  background: rgba(255,255,255,.1);
  border-radius: 10px;
  padding: .875rem .75rem;
  text-align: center;
}
.stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  display: block;
}
.stat-label {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .75;
  margin-top: .125rem;
}

.birthday-msg {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.15);
  border-radius: 10px;
  padding: .875rem 1rem;
  font-size: .9375rem;
  font-weight: 500;
}
.birthday-today {
  background: rgba(16,185,129,.25);
  border: 1px solid rgba(16,185,129,.4);
}

/* ════════════════════════════════════════════════════════
   INTRO / CONTENT SECTION — Full Width Premium Layout
   ════════════════════════════════════════════════════════ */
.intro-section {
  padding: 0 0 4rem;
  background: #fff;
}

/* ── Intro body wrapper ─────────────────────────────────── */
.intro-body {
  width: 100%;
  padding-top: 2rem;
}

/* ── Each h2 becomes a full-width section block ─────────── */
.intro-body > h2 {
  display: flex;
  align-items: center;
  gap: .875rem;
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.02em;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 0 -1.25rem;
  padding: 1.125rem 1.25rem;
}
/* Gradient left border on section headings */
.intro-body > h2::before {
  content: '';
  display: block;
  width: 4px;
  height: 1.5rem;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 2px;
  flex-shrink: 0;
}

/* Make the h2 labels full-bleed within the 1100px container */
@media (min-width: 1140px) {
  .intro-body > h2 {
    margin: 0 calc(-50vw + 550px);
    padding: 1.125rem calc(50vw - 538px);
  }
}

/* Content after each h2 lives inside the normal flow */
.intro-body > p {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin: 1.25rem 0;
  max-width: 72ch;
}

.intro-body > h2 + p {
  margin-top: 1.5rem;
}

/* ── Two-column grid for sections that have wide content ─── */
.intro-body {
  display: grid;
  grid-template-columns: 1fr;
}

/* ── h3 sub-headings ────────────────────────────────────── */
.intro-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.75rem 0 .625rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.intro-body h3::before {
  content: '';
  display: inline-block;
  width: .5rem;
  height: .5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Paragraph text ─────────────────────────────────────── */
.intro-body p {
  font-size: .9875rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin: .875rem 0;
}

/* ── Unordered list — premium card style ────────────────── */
.intro-body ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem;
}
@media (min-width: 640px) {
  .intro-body ul {
    grid-template-columns: repeat(2, 1fr);
  }
}
.intro-body ul li {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.intro-body ul li:hover {
  border-color: rgba(79,70,229,.3);
  box-shadow: 0 2px 8px rgba(79,70,229,.06);
}
.intro-body ul li::before {
  content: '';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8'%3E%3Cpath d='M1 4l2.5 2.5L9 1' stroke='%23fff' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 60%;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
  margin-top: .125rem;
}

/* ── Ordered list — numbered steps ─────────────────────── */
.intro-body ol {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .625rem;
  counter-reset: step-counter;
}
.intro-body ol li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: .875rem 1.125rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  line-height: 1.7;
  color: var(--text-secondary);
  counter-increment: step-counter;
  position: relative;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}
.intro-body ol li:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(3px);
}
.intro-body ol li::before {
  content: counter(step-counter);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: .8125rem;
  font-weight: 800;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(79,70,229,.35);
  margin-top: .1em;
}

/* ── Code / formula block ───────────────────────────────── */
.intro-body div[style*="monospace"],
.intro-body code {
  display: block;
  background: #0f172a !important;
  color: #7dd3fc !important;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace !important;
  border-radius: var(--radius-sm) !important;
  padding: 1.125rem 1.25rem !important;
  font-size: .875rem !important;
  border: none !important;
  box-shadow: 0 4px 20px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.05);
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  letter-spacing: .01em;
  line-height: 1.7;
}

/* ── Data table — premium gradient header ───────────────── */
.intro-body div[style*="overflow-x"],
.intro-body table { 
  margin: 1.25rem 0 1.75rem;
}
.intro-body div[style*="overflow-x"] {
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.intro-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
  min-width: 500px;
}
.intro-body th {
  background: linear-gradient(135deg, #312e81 0%, var(--primary) 50%, var(--secondary) 100%);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: .875rem 1.125rem;
  font-size: .8125rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.intro-body td {
  padding: .875rem 1.125rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  line-height: 1.6;
  vertical-align: top;
}
.intro-body tr:last-child td { border-bottom: none; }
.intro-body tr:nth-child(odd) td  { background: #fff; }
.intro-body tr:nth-child(even) td { background: #f8fafc; }
.intro-body td:first-child {
  font-weight: 700;
  color: var(--primary-dark);
  white-space: nowrap;
}
.intro-body tr:hover td { background: var(--primary-light); }

/* ── Strong text ────────────────────────────────────────── */
.intro-body strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* ── "Try It Now" closing paragraph — CTA style ────────── */
.intro-body > p:last-child {
  background: linear-gradient(135deg, var(--primary-light) 0%, rgba(6,182,212,.08) 100%);
  border: 1px solid rgba(79,70,229,.2);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 2.5rem;
}
.intro-body > p:last-child strong {
  color: var(--primary-dark);
}

/* ─── FAQ Section ───────────────────────────────────────────── */
.faq-section { background: var(--bg-subtle); padding: 4rem 0; }
.faq-section h2 { margin-bottom: 2rem; }

.faq-list { display: flex; flex-direction: column; gap: .75rem; max-width: 760px; }
.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.faq-item:hover { box-shadow: var(--shadow); }
.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 1.125rem 1.25rem;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  line-height: 1.4;
}
.faq-question .icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
  color: var(--primary);
  font-size: 1.25rem;
  line-height: 1;
}
.faq-item.open .faq-question .icon {
  background: var(--primary);
  color: #fff;
  transform: rotate(45deg);
}
.faq-answer {
  display: none;
  padding: 0 1.25rem 1.125rem;
  color: var(--text-secondary);
  font-size: .9375rem;
  line-height: 1.7;
}
.faq-item.open .faq-answer { display: block; }

/* ─── Blog Grid ─────────────────────────────────────────────── */
.blog-section { padding: 4rem 0; }
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.section-heading h2 { margin: 0; }
.section-heading a { font-size: .9375rem; font-weight: 600; }

.blog-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }

.post-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
}
.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.post-card-img {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-subtle);
}
.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.post-card:hover .post-card-img img { transform: scale(1.04); }
.post-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: .5rem;
}
.post-card-cat { font-size: .75rem; font-weight: 700; color: var(--secondary); text-transform: uppercase; letter-spacing: .05em; }
.post-card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  flex: 1;
}
.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--primary); }
.post-card-excerpt { font-size: .875rem; color: var(--text-secondary); line-height: 1.6; }
.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: .8125rem;
  color: var(--text-muted);
}
.post-card-date { font-weight: 500; }
.post-card-read { color: var(--primary); font-weight: 600; }

/* ─── Blog Page Layout ──────────────────────────────────────── */
.blog-page { padding: 3rem 0; }
.blog-layout {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr;
}
@media (min-width: 960px) {
  .blog-layout { grid-template-columns: 1fr 300px; }
}

.blog-sidebar {}
.sidebar-widget {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.sidebar-widget h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--primary-light);
}
.sidebar-widget ul { display: flex; flex-direction: column; gap: .5rem; }
.sidebar-widget ul li a {
  font-size: .9375rem;
  color: var(--text-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .375rem;
}
.sidebar-widget ul li a::before { content: '→'; color: var(--primary); font-size: .75rem; }
.sidebar-widget ul li a:hover { color: var(--primary); }

.sidebar-cta {
  background: linear-gradient(135deg, var(--primary) 0%, #6D28D9 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.sidebar-cta h3 { color: #fff; font-size: 1.0625rem; margin-bottom: .5rem; }
.sidebar-cta p  { color: rgba(255,255,255,.8); font-size: .875rem; margin-bottom: 1rem; }

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 .75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ─── Single Post ────────────────────────────────────────────── */
.post-hero {
  background: var(--bg-subtle);
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
}
.post-hero-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  font-size: .875rem;
  color: var(--text-muted);
}
.post-hero-meta .sep { width: 4px; height: 4px; background: var(--border); border-radius: 50%; }
.post-hero h1 { margin-bottom: 1rem; }
.post-hero-excerpt { font-size: 1.0625rem; color: var(--text-secondary); max-width: 680px; }

.post-featured-img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 2rem 0;
}

.post-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-secondary);
}
.post-content h2 { color: var(--text-primary); margin: 2rem 0 .875rem; }
.post-content h3 { color: var(--text-primary); margin: 1.5rem 0 .75rem; }
.post-content p { margin-bottom: 1.25rem; }
.post-content ul,
.post-content ol { margin: 1rem 0 1.25rem 1.5rem; display: flex; flex-direction: column; gap: .375rem; }
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { color: var(--text-secondary); }
.post-content a { color: var(--primary); text-decoration: underline; }
.post-content blockquote {
  border-left: 4px solid var(--primary);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--primary-dark);
}
.post-content pre {
  background: #0F172A;
  color: #E2E8F0;
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-size: .9em;
  margin: 1.25rem 0;
}
.post-content code {
  background: var(--bg-subtle);
  color: var(--primary);
  padding: .15em .4em;
  border-radius: 4px;
  font-size: .9em;
  font-family: 'Courier New', monospace;
}
.post-content pre code { background: none; color: inherit; padding: 0; }
.post-content img { border-radius: var(--radius-sm); margin: 1.5rem 0; }
.post-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.post-content th { background: var(--bg-subtle); font-weight: 600; padding: .75rem 1rem; text-align: left; border: 1px solid var(--border); }
.post-content td { padding: .75rem 1rem; border: 1px solid var(--border); color: var(--text-secondary); }
.post-content hr { border: none; border-top: 2px solid var(--border); margin: 2rem 0; }

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.related-posts { margin-top: 3rem; }
.related-posts h2 { margin-bottom: 1.5rem; }

/* ─── Category Pills ─────────────────────────────────────────── */
.cat-filter {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
}
.cat-pill {
  padding: .4rem 1rem;
  border-radius: 20px;
  font-size: .875rem;
  font-weight: 600;
  border: 2px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}
.cat-pill:hover, .cat-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ─── Page Header ────────────────────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 100%);
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}
.page-header .breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
  flex-wrap: wrap;
}
.page-header .breadcrumb a { color: var(--primary); font-weight: 500; }
.page-header .breadcrumb span { color: var(--text-muted); }

/* ─── Site Footer ────────────────────────────────────────────── */
.site-footer {
  background: var(--text-primary);
  color: rgba(255,255,255,.7);
  padding: 3rem 0 0;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  margin-bottom: 2rem;
}
@media (min-width: 600px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }

.footer-brand .site-logo { color: #fff; margin-bottom: .875rem; display: inline-block; }
.footer-brand .site-logo span { color: var(--secondary); }
.footer-brand p { font-size: .875rem; line-height: 1.6; }

.footer-links h3 {
  font-size: .875rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.footer-links ul { display: flex; flex-direction: column; gap: .5rem; }
.footer-links a { font-size: .9rem; color: rgba(255,255,255,.65); transition: color var(--transition); }
.footer-links a:hover { color: #fff; }

.footer-social h3 {
  font-size: .875rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.social-links { display: flex; gap: .75rem; }
.social-links a {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.8);
  transition: all var(--transition);
}
.social-links a:hover { background: var(--primary); color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 1.25rem 0;
  font-size: .875rem;
  color: rgba(255,255,255,.4);
  text-align: center;
}

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert {
  padding: .875rem 1.125rem;
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  border-left: 4px solid;
  margin-bottom: 1rem;
}
.alert-success { background: #D1FAE5; border-color: var(--success); color: #065F46; }
.alert-error   { background: #FEF2F2; border-color: var(--error);   color: #991B1B; }
.alert-info    { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }
.alert-warning { background: #FEF3C7; border-color: var(--warning); color: #92400E; }

/* ─── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); font-weight: 500; }
.breadcrumb .sep { color: var(--text-muted); }
.breadcrumb .current { color: var(--text-muted); }

/* ─── Utilities ──────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted   { color: var(--text-muted); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.gap-1 { gap: .5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 1.5rem; }

/* ─── Placeholder SVG ────────────────────────────────────────── */
.img-placeholder {
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 2rem;
}

/* ─── No posts ───────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state svg { margin: 0 auto 1rem; opacity: .4; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: .5rem; }
