/* =========================================================
   PALEBLUEDOT BLOCK THEME — main stylesheet
   Tokens come from theme.json (var(--wp--preset--*)).
   This file styles named patterns + components that go
   beyond core block defaults.
   ========================================================= */

/* IRANSansX self-hosted fallback for FA when Vazirmatn is unreachable */
@font-face {
  font-family: 'IRANSansX';
  src: url('../fonts/IRANSansX-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IRANSansXFaNum';
  src: url('../fonts/IRANSansXFaNum-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Tokens — surface-level convenience variables reading from WP presets,
   so the rest of the file looks like the design source. */
:root {
  --pbd-primary-50:   var(--wp--preset--color--primary-50);
  --pbd-primary-100:  var(--wp--preset--color--primary-100);
  --pbd-primary-200:  var(--wp--preset--color--primary-200);
  --pbd-primary-300:  var(--wp--preset--color--primary-300);
  --pbd-primary-500:  var(--wp--preset--color--primary-500);
  --pbd-primary-700:  var(--wp--preset--color--primary-700);
  --pbd-primary-900:  var(--wp--preset--color--primary-900);
  --pbd-gold:         var(--wp--preset--color--gold);
  --pbd-bg:           var(--wp--preset--color--bg);
  --pbd-bg-soft:      var(--wp--preset--color--bg-soft);
  --pbd-bg-sunken:    var(--wp--preset--color--bg-sunken);
  --pbd-border:       var(--wp--preset--color--border);
  --pbd-border-strong:var(--wp--preset--color--border-strong);
  --pbd-text:         var(--wp--preset--color--text);
  --pbd-text-muted:   var(--wp--preset--color--text-muted);
  --pbd-text-faint:   var(--wp--preset--color--text-faint);
  --pbd-surface:      var(--wp--preset--color--surface);
  --pbd-surface-2:    var(--wp--preset--color--surface-2);

  --pbd-r-8:    var(--wp--custom--radius--8);
  --pbd-r-12:   var(--wp--custom--radius--12);
  --pbd-r-16:   var(--wp--custom--radius--16);
  --pbd-r-22:   var(--wp--custom--radius--22);
  --pbd-r-28:   var(--wp--custom--radius--28);
  --pbd-r-full: var(--wp--custom--radius--full);

  --pbd-shadow-sm:   var(--wp--preset--shadow--sm);
  --pbd-shadow-md:   var(--wp--preset--shadow--md);
  --pbd-shadow-glow: var(--wp--preset--shadow--glow);

  --pbd-font-sans:  var(--wp--preset--font-family--sans);
  --pbd-font-serif: var(--wp--preset--font-family--serif);
  --pbd-font-mono:  var(--wp--preset--font-family--mono);
  --pbd-font-fa:    var(--wp--preset--font-family--fa);

  --pbd-gutter: var(--wp--custom--gutter);
  --pbd-maxw:   var(--wp--custom--maxw);
  --pbd-duration: var(--wp--custom--transition--duration);
  --pbd-ease:     var(--wp--custom--transition--ease);
}

/* Dark mode override of palette tokens */
body[data-theme="dark"] {
  --pbd-bg:        #0b1220;
  --pbd-bg-soft:   #0f1a2e;
  --pbd-bg-sunken: #08101c;
  --pbd-border:        #1e2a44;
  --pbd-border-strong: #2a3a5e;
  --pbd-text:       #e8eef9;
  --pbd-text-muted: #a3b3cc;
  --pbd-text-faint: #7a89a6;
  --pbd-surface:   #0f1a2e;
  --pbd-surface-2: #14223d;
  --pbd-shadow-sm:   0 1px 2px rgba(0,0,0,.5), 0 1px 3px rgba(0,0,0,.3);
  --pbd-shadow-md:   0 6px 16px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.3);
  --pbd-shadow-glow: 0 8px 40px rgba(102,179,230,.18);
  background: var(--pbd-bg);
  color: var(--pbd-text);
}

/* Resets that core/block don't fully cover */
html { scroll-behavior: smooth; }
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  transition: background-color .35s ease, color .35s ease;
}
body.palebluedot-fa,
body.palebluedot-fa .wp-block-post-content,
body.palebluedot-fa .wp-block-post-title {
  font-family: var(--pbd-font-fa);
}
body.palebluedot-fa .wp-block-code,
body.palebluedot-fa pre.wp-block-code {
  direction: ltr;
  text-align: left;
  font-family: var(--pbd-font-mono);
}

/* =========================================================
   HERO BACKDROP — radial gradients used on home + archive
   ========================================================= */
.pbd-hero-backdrop {
  position: relative;
  isolation: isolate;
}
.pbd-hero-backdrop::before,
.pbd-hero-backdrop::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
}
.pbd-hero-backdrop::before {
  width: 1100px; height: 1100px;
  top: -380px; right: -260px;
  background: radial-gradient(circle, rgba(102,179,230,.18) 0%, rgba(102,179,230,0) 60%);
  animation: pbdPulseA 14s ease-in-out infinite;
}
.pbd-hero-backdrop::after {
  width: 900px; height: 900px;
  bottom: -340px; left: -200px;
  background: radial-gradient(circle, rgba(247,193,80,.12) 0%, rgba(247,193,80,0) 60%);
  animation: pbdPulseB 18s ease-in-out infinite;
}
@keyframes pbdPulseA {
  0%,100% { transform: translateY(0) scale(1); opacity: 1; }
  50%     { transform: translateY(20px) scale(1.04); opacity: .85; }
}
@keyframes pbdPulseB {
  0%,100% { transform: translateY(0) scale(1); opacity: 1; }
  50%     { transform: translateY(-16px) scale(1.05); opacity: .8; }
}
@media (prefers-reduced-motion: reduce) {
  .pbd-hero-backdrop::before, .pbd-hero-backdrop::after { animation: none; }
}

/* =========================================================
   SITE HEADER (template part)
   ========================================================= */
.pbd-site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--pbd-border);
  background: color-mix(in srgb, var(--pbd-bg) 80%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
}
.pbd-site-header .pbd-inner {
  max-width: var(--pbd-maxw);
  margin: 0 auto;
  padding: 18px var(--pbd-gutter);
  display: flex; align-items: center; gap: 28px;
}
.pbd-brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--pbd-text);
  text-decoration: none;
}
.pbd-brand .pbd-mark { width: 32px; height: 32px; flex: none; }
.pbd-brand .pbd-wordmark {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.012em;
  font-family: var(--pbd-font-sans);
}
.pbd-brand .pbd-wordmark .accent { color: var(--pbd-primary-700); }
body[data-theme="dark"] .pbd-brand .pbd-wordmark .accent { color: var(--pbd-primary-300); }
body.palebluedot-fa .pbd-brand .pbd-wordmark { font-family: var(--pbd-font-fa); }

.pbd-nav { display: flex; gap: 4px; margin-inline-start: 20px; }
.pbd-nav a {
  padding: 8px 14px;
  border-radius: var(--pbd-r-8);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--pbd-text-muted);
  text-decoration: none;
  transition: color .15s, background .15s;
}
.pbd-nav a:hover { color: var(--pbd-text); background: var(--pbd-bg-soft); }
.pbd-nav a.is-active,
.pbd-nav a[aria-current="page"] { color: var(--pbd-primary-700); }
body[data-theme="dark"] .pbd-nav a.is-active,
body[data-theme="dark"] .pbd-nav a[aria-current="page"] { color: var(--pbd-primary-300); }

.pbd-header-actions {
  margin-inline-start: auto;
  display: flex; align-items: center; gap: 6px;
}
.pbd-icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--pbd-r-8);
  border: 1px solid transparent;
  background: transparent;
  color: var(--pbd-text-muted);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.pbd-icon-btn:hover {
  background: var(--pbd-bg-soft);
  color: var(--pbd-text);
  border-color: var(--pbd-border);
}
.pbd-icon-btn svg { width: 18px; height: 18px; }

.pbd-lang-switch {
  display: inline-flex;
  border: 1px solid var(--pbd-border);
  border-radius: var(--pbd-r-full);
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--pbd-surface);
}
.pbd-lang-switch a,
.pbd-lang-switch button {
  padding: 6px 12px;
  border: 0;
  background: transparent;
  color: var(--pbd-text-faint);
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.pbd-lang-switch .is-active,
.pbd-lang-switch [aria-current="true"] {
  background: var(--pbd-primary-700);
  color: #fff;
}
body[data-theme="dark"] .pbd-lang-switch .is-active,
body[data-theme="dark"] .pbd-lang-switch [aria-current="true"] {
  background: var(--pbd-primary-500);
  color: var(--pbd-primary-900);
}

/* =========================================================
   HERO (homepage)
   ========================================================= */
.pbd-hero {
  position: relative;
  padding: 64px var(--pbd-gutter) 32px;
  max-width: var(--pbd-maxw);
  margin: 0 auto;
}
.pbd-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--pbd-primary-700);
}
body[data-theme="dark"] .pbd-hero-eyebrow { color: var(--pbd-primary-300); }
.pbd-hero-eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--pbd-gold);
  box-shadow: 0 0 0 3px rgba(247,193,80,.2);
}
.pbd-hero h1,
.pbd-hero .pbd-h1 {
  margin: 18px 0 16px;
  font-family: var(--pbd-font-serif);
  font-size: clamp(36px, 5.2vw, 60px);
  line-height: 1.08;
  letter-spacing: -.022em;
  font-weight: 500;
  max-width: 18ch;
  color: var(--pbd-text);
  text-wrap: balance;
}
.pbd-hero h1 em { font-style: italic; color: var(--pbd-primary-700); }
body[data-theme="dark"] .pbd-hero h1 em { color: var(--pbd-primary-300); }
.pbd-hero .pbd-deck {
  font-size: 19px;
  line-height: 1.6;
  color: var(--pbd-text-muted);
  max-width: 60ch;
  margin: 0 0 28px;
}

/* =========================================================
   FEATURED CARD
   ========================================================= */
.pbd-featured-card {
  position: relative;
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 0;
  background: var(--pbd-surface);
  border: 1px solid var(--pbd-border);
  border-radius: var(--pbd-r-22);
  overflow: hidden;
  box-shadow: var(--pbd-shadow-md);
}
.pbd-featured-card .pbd-cover {
  position: relative;
  min-height: 380px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(102,179,230,.35) 0%, transparent 60%),
    radial-gradient(80% 70% at 0% 100%, rgba(247,193,80,.25) 0%, transparent 60%),
    linear-gradient(135deg, #0c4a6e 0%, #0369a1 50%, #0c4a6e 100%);
  overflow: hidden;
}
.pbd-featured-card .pbd-glyph {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  opacity: .9;
}
.pbd-grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
.pbd-stat-grid {
  position: absolute;
  inset: auto 32px 32px 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--pbd-r-12);
  overflow: hidden;
  font-family: var(--pbd-font-mono);
}
.pbd-stat-grid > div {
  background: rgba(12,74,110,.85);
  padding: 12px 14px;
  color: #e8eef9;
}
.pbd-stat-grid .k {
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--pbd-primary-300);
  margin-bottom: 4px;
}
.pbd-stat-grid .v { font-size: 18px; font-weight: 600; color: #fff; }
.pbd-stat-grid .v .pct { color: var(--pbd-gold); }

.pbd-featured-card .pbd-body {
  padding: 36px 36px 32px;
  display: flex; flex-direction: column; justify-content: center;
}
.pbd-featured-card .pbd-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 12.5px; color: var(--pbd-text-faint);
  margin-bottom: 18px;
}
.pbd-featured-card .pbd-cat,
.pbd-post-card .pbd-cat,
.pbd-archive-row .pbd-cat {
  color: var(--pbd-primary-700);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11.5px;
}
body[data-theme="dark"] .pbd-featured-card .pbd-cat,
body[data-theme="dark"] .pbd-post-card .pbd-cat,
body[data-theme="dark"] .pbd-archive-row .pbd-cat { color: var(--pbd-primary-300); }
.pbd-featured-card h2,
.pbd-featured-card .pbd-h2 {
  margin: 0 0 14px;
  font-family: var(--pbd-font-serif);
  font-size: 30px;
  line-height: 1.18;
  font-weight: 500;
  letter-spacing: -.012em;
  color: var(--pbd-text);
  text-wrap: balance;
}
.pbd-featured-card .pbd-body p {
  margin: 0 0 24px;
  font-size: 16px; line-height: 1.65;
  color: var(--pbd-text-muted);
}
.pbd-byline {
  display: flex; align-items: center; gap: 12px;
  font-size: 13.5px;
  color: var(--pbd-text-muted);
}
.pbd-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pbd-primary-500), var(--pbd-primary-700));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #fff;
  flex: none; overflow: hidden;
}
.pbd-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pbd-avatar.gold { background: linear-gradient(135deg, var(--pbd-gold), #d4951f); color: #4a2e00; }

/* =========================================================
   CHIP ROW
   ========================================================= */
.pbd-chip-row {
  max-width: var(--pbd-maxw);
  margin: 8px auto 0;
  padding: 24px var(--pbd-gutter) 8px;
  display: flex; gap: 8px; flex-wrap: wrap;
  align-items: center;
}
.pbd-chip-row .pbd-label {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--pbd-text-faint);
  font-weight: 600;
  margin-inline-end: 4px;
}
.pbd-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: var(--pbd-r-full);
  font-size: 13px;
  font-weight: 500;
  background: var(--pbd-surface);
  border: 1px solid var(--pbd-border);
  color: var(--pbd-text-muted);
  transition: all .18s ease;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.pbd-chip:hover {
  border-color: var(--pbd-primary-500);
  color: var(--pbd-primary-700);
  background: var(--pbd-primary-50);
}
body[data-theme="dark"] .pbd-chip:hover {
  color: var(--pbd-primary-300);
  background: rgba(102,179,230,.08);
}
.pbd-chip.is-active,
.pbd-chip[aria-current="page"] {
  background: var(--pbd-primary-700);
  color: #fff;
  border-color: var(--pbd-primary-700);
}
.pbd-chip .pbd-ct {
  font-family: var(--pbd-font-mono);
  font-size: 11px;
  color: var(--pbd-text-faint);
  margin-inline-start: 4px;
}
.pbd-chip.is-active .pbd-ct,
.pbd-chip[aria-current="page"] .pbd-ct { color: rgba(255,255,255,.7); }

/* =========================================================
   SECTION HEAD + POST GRID
   ========================================================= */
.pbd-section-head {
  max-width: var(--pbd-maxw);
  margin: 64px auto 24px;
  padding: 0 var(--pbd-gutter);
  display: flex; align-items: end; justify-content: space-between; gap: 24px;
}
.pbd-section-head h3,
.pbd-section-head .pbd-h3 {
  margin: 0;
  font-family: var(--pbd-font-serif);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -.014em;
  color: var(--pbd-text);
}
.pbd-all-link {
  font-size: 14px; font-weight: 500;
  color: var(--pbd-primary-700);
  display: inline-flex; align-items: center; gap: 4px;
  text-decoration: none;
}
body[data-theme="dark"] .pbd-all-link { color: var(--pbd-primary-300); }
.pbd-all-link svg { width: 14px; height: 14px; transition: transform .18s; }
.pbd-all-link:hover svg { transform: translateX(3px); }
[dir="rtl"] .pbd-all-link:hover svg { transform: translateX(-3px); }

.pbd-post-grid {
  max-width: var(--pbd-maxw);
  margin: 0 auto;
  padding: 0 var(--pbd-gutter);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.pbd-post-card {
  display: flex; flex-direction: column;
  background: var(--pbd-surface);
  border: 1px solid var(--pbd-border);
  border-radius: var(--pbd-r-16);
  overflow: hidden;
  transition: transform .22s var(--pbd-ease),
              box-shadow .22s var(--pbd-ease),
              border-color .22s var(--pbd-ease);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.pbd-post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--pbd-shadow-md);
  border-color: var(--pbd-border-strong);
}
.pbd-post-card .pbd-thumb {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
}
.pbd-post-card .pbd-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.pbd-post-card .pbd-thumb-fallback {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--pbd-primary-900), var(--pbd-primary-700));
  display: grid; place-items: center;
  color: rgba(255,255,255,.75);
  font-family: var(--pbd-font-mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.pbd-post-card .pbd-body {
  padding: 22px 22px 24px;
  display: flex; flex-direction: column; gap: 10px;
  flex: 1;
}
.pbd-post-card .pbd-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 11.5px;
  color: var(--pbd-text-faint);
}
.pbd-post-card h3,
.pbd-post-card .pbd-h3 {
  margin: 0;
  font-family: var(--pbd-font-serif);
  font-size: 21px;
  line-height: 1.28;
  font-weight: 500;
  letter-spacing: -.008em;
  color: var(--pbd-text);
  text-wrap: balance;
}
.pbd-post-card .pbd-body p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--pbd-text-muted);
}
.pbd-post-card .pbd-byline {
  margin-top: auto;
  padding-top: 14px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px;
  color: var(--pbd-text-faint);
  border-top: 1px solid var(--pbd-border);
}

/* =========================================================
   SINGLE POST
   ========================================================= */
.pbd-post-cover {
  position: relative;
  height: 420px;
  border-radius: var(--pbd-r-22);
  overflow: hidden;
  background:
    radial-gradient(60% 80% at 80% 20%, rgba(102,179,230,.4) 0%, transparent 60%),
    radial-gradient(50% 60% at 10% 90%, rgba(247,193,80,.25) 0%, transparent 60%),
    linear-gradient(160deg, #0c4a6e 0%, #0369a1 60%, #08101c 100%);
  max-width: var(--pbd-maxw);
  margin: 32px auto 0;
}
.pbd-post-cover .pbd-grid-overlay {
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at 70% 30%, black 20%, transparent 80%);
}
.pbd-post-cover .pbd-cover-glyph {
  position: absolute;
  top: 50%; right: 60px;
  transform: translateY(-50%);
  opacity: .85;
}
[dir="rtl"] .pbd-post-cover .pbd-cover-glyph {
  right: auto; left: 60px;
}
.pbd-post-cover .pbd-cover-meta {
  position: absolute;
  left: 32px; bottom: 28px;
  font-family: var(--pbd-font-mono);
  font-size: 12px;
  color: rgba(255,255,255,.7);
  letter-spacing: .06em;
}
[dir="rtl"] .pbd-post-cover .pbd-cover-meta { left: auto; right: 32px; }
.pbd-post-cover .pbd-cover-meta .accent { color: var(--pbd-gold); }

.pbd-post-header {
  max-width: 760px;
  margin: 56px auto 0;
  padding: 0 var(--pbd-gutter);
  text-align: start;
}
.pbd-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--pbd-text-faint);
  margin-bottom: 24px;
}
.pbd-breadcrumb a { color: var(--pbd-primary-700); text-decoration: none; }
body[data-theme="dark"] .pbd-breadcrumb a { color: var(--pbd-primary-300); }
.pbd-post-header h1,
.pbd-post-header .wp-block-post-title {
  margin: 0 0 24px;
  font-family: var(--pbd-font-serif);
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -.018em;
  color: var(--pbd-text);
  text-wrap: balance;
}
.pbd-post-header .pbd-deck {
  font-size: 20px;
  line-height: 1.55;
  color: var(--pbd-text-muted);
  margin: 0 0 32px;
  font-weight: 400;
}
.pbd-post-byline {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-top: 1px solid var(--pbd-border);
  border-bottom: 1px solid var(--pbd-border);
  font-size: 14px;
  color: var(--pbd-text-muted);
}
.pbd-post-byline .pbd-author {
  display: flex; align-items: center; gap: 10px;
  font-weight: 500; color: var(--pbd-text);
}
.pbd-post-byline .pbd-avatar { width: 36px; height: 36px; font-size: 13px; }
.pbd-post-byline .pbd-sep { width: 3px; height: 3px; background: var(--pbd-text-faint); border-radius: 50%; }

/* 3-column post layout: TOC + prose + aside */
.pbd-post-layout {
  max-width: var(--pbd-maxw);
  margin: 56px auto 0;
  padding: 0 var(--pbd-gutter);
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 220px;
  gap: 56px;
  align-items: start;
}
.pbd-toc {
  position: sticky; top: 32px;
  font-size: 13.5px;
}
.pbd-toc h4,
.pbd-aside h4 {
  margin: 0 0 14px;
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--pbd-text-faint);
  font-weight: 600;
  font-family: var(--pbd-font-sans);
}
.pbd-toc ol {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 4px;
  border-inline-start: 1px solid var(--pbd-border);
}
.pbd-toc ol li a {
  display: block;
  padding: 6px 14px;
  margin-inline-start: -1px;
  border-inline-start: 1px solid transparent;
  color: var(--pbd-text-muted);
  line-height: 1.4;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.pbd-toc ol li a:hover { color: var(--pbd-text); }
.pbd-toc ol li.is-active a {
  color: var(--pbd-primary-700);
  border-inline-start-color: var(--pbd-primary-500);
  font-weight: 500;
}
body[data-theme="dark"] .pbd-toc ol li.is-active a { color: var(--pbd-primary-300); }
.pbd-toc ol li.sub a { padding-inline-start: 28px; font-size: 12.5px; }

.pbd-aside { position: sticky; top: 32px; font-size: 13.5px; }
.pbd-related { display: flex; flex-direction: column; gap: 16px; }
.pbd-related a {
  display: block;
  padding: 12px 0;
  border-top: 1px solid var(--pbd-border);
  color: var(--pbd-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  transition: color .15s;
}
.pbd-related a:hover { color: var(--pbd-primary-700); }
body[data-theme="dark"] .pbd-related a:hover { color: var(--pbd-primary-300); }
.pbd-related a .pbd-meta {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--pbd-text-faint);
  margin-top: 4px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Tags */
.pbd-tag-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--pbd-border);
}
.pbd-tag {
  display: inline-flex; align-items: center;
  padding: 5px 11px;
  border-radius: var(--pbd-r-full);
  font-size: 12.5px;
  font-weight: 500;
  background: var(--pbd-bg-soft);
  border: 1px solid var(--pbd-border);
  color: var(--pbd-text-muted);
  font-family: var(--pbd-font-sans);
  text-decoration: none;
}
.pbd-tag::before { content: "#"; color: var(--pbd-text-faint); margin-inline-end: 2px; }

/* Next CTA */
.pbd-next-cta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  margin: 56px 0 0;
  padding: 32px;
  border-radius: var(--pbd-r-16);
  background: linear-gradient(135deg, var(--pbd-primary-50) 0%, color-mix(in srgb, var(--pbd-gold) 8%, var(--pbd-primary-50)) 100%);
  border: 1px solid var(--pbd-primary-200);
  text-decoration: none;
  color: inherit;
  transition: transform .22s var(--pbd-ease);
}
body[data-theme="dark"] .pbd-next-cta {
  background: linear-gradient(135deg, rgba(102,179,230,.08) 0%, rgba(247,193,80,.06) 100%);
  border-color: rgba(102,179,230,.2);
}
.pbd-next-cta .pbd-label {
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--pbd-primary-700);
  font-weight: 600;
  margin-bottom: 6px;
  font-family: var(--pbd-font-sans);
}
body[data-theme="dark"] .pbd-next-cta .pbd-label { color: var(--pbd-primary-300); }
.pbd-next-cta h4 {
  margin: 0;
  font-family: var(--pbd-font-serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.008em;
  line-height: 1.3;
  color: var(--pbd-text);
}
.pbd-next-cta .pbd-arrow {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--pbd-primary-700);
  color: #fff;
  display: grid; place-items: center;
  flex: none;
  transition: transform .22s var(--pbd-ease);
}
.pbd-next-cta:hover .pbd-arrow { transform: translateX(4px); }
[dir="rtl"] .pbd-next-cta .pbd-arrow { transform: scaleX(-1); }
[dir="rtl"] .pbd-next-cta:hover .pbd-arrow { transform: translateX(-4px) scaleX(-1); }

/* =========================================================
   ARCHIVE
   ========================================================= */
.pbd-archive-header {
  max-width: var(--pbd-maxw);
  margin: 0 auto;
  padding: 64px var(--pbd-gutter) 32px;
  border-bottom: 1px solid var(--pbd-border);
}
.pbd-archive-header .pbd-crumb {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--pbd-primary-700);
  font-weight: 600;
  margin-bottom: 18px;
}
body[data-theme="dark"] .pbd-archive-header .pbd-crumb { color: var(--pbd-primary-300); }
.pbd-archive-header h1 {
  margin: 0 0 16px;
  font-family: var(--pbd-font-serif);
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.pbd-archive-header .pbd-desc {
  font-size: 19px;
  color: var(--pbd-text-muted);
  max-width: 60ch;
  margin: 0 0 24px;
  line-height: 1.6;
}
.pbd-meta-bar {
  display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--pbd-text-faint);
  font-family: var(--pbd-font-mono);
}
.pbd-meta-bar .pbd-stat { display: flex; align-items: center; gap: 6px; }
.pbd-meta-bar .pbd-stat strong { color: var(--pbd-text); font-weight: 600; }

.pbd-archive-list {
  max-width: var(--pbd-maxw);
  margin: 0 auto;
  padding: 24px var(--pbd-gutter) 0;
}
.pbd-archive-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--pbd-border);
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: padding .22s var(--pbd-ease);
}
.pbd-archive-row:hover { padding-inline-start: 8px; }
.pbd-archive-row .pbd-date {
  font-family: var(--pbd-font-mono);
  font-size: 12px;
  color: var(--pbd-text-faint);
  letter-spacing: .04em;
}
.pbd-archive-row .pbd-date .pbd-day {
  display: block;
  font-size: 28px;
  color: var(--pbd-text);
  font-weight: 500;
  font-family: var(--pbd-font-serif);
  letter-spacing: -.01em;
}
.pbd-archive-row .pbd-post {
  display: flex; flex-direction: column; gap: 6px;
}
.pbd-archive-row .pbd-post h3 {
  margin: 0;
  font-family: var(--pbd-font-serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.008em;
  color: var(--pbd-text);
}
.pbd-archive-row .pbd-post p {
  margin: 4px 0 0;
  font-size: 14.5px;
  color: var(--pbd-text-muted);
  line-height: 1.5;
  max-width: 60ch;
}
.pbd-archive-row .pbd-reading {
  font-family: var(--pbd-font-mono);
  font-size: 12px;
  color: var(--pbd-text-faint);
  white-space: nowrap;
}

/* =========================================================
   SITE FOOTER (template part)
   ========================================================= */
.pbd-site-footer {
  margin-top: 96px;
  padding: 64px 0 32px;
  border-top: 1px solid var(--pbd-border);
  background: var(--pbd-bg-soft);
}
.pbd-site-footer .pbd-inner {
  max-width: var(--pbd-maxw);
  margin: 0 auto;
  padding: 0 var(--pbd-gutter);
}
.pbd-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--pbd-border);
}
.pbd-footer-brand p {
  font-size: 14.5px;
  color: var(--pbd-text-muted);
  line-height: 1.6;
  margin: 16px 0 20px;
  max-width: 32ch;
}
.pbd-eco-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pbd-eco-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: var(--pbd-r-full);
  font-size: 12.5px;
  font-weight: 600;
  background: var(--pbd-surface);
  border: 1px solid var(--pbd-border);
  color: var(--pbd-text-muted);
}
.pbd-eco-chip .pbd-swatch {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--pbd-primary-500);
}
.pbd-eco-chip:nth-child(2) .pbd-swatch { background: var(--pbd-gold); }
.pbd-eco-chip:nth-child(3) .pbd-swatch { background: var(--pbd-primary-700); }

.pbd-footer-col h5 {
  margin: 0 0 16px;
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--pbd-text);
  font-weight: 600;
  font-family: var(--pbd-font-sans);
}
.pbd-footer-col ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.pbd-footer-col a {
  font-size: 14px;
  color: var(--pbd-text-muted);
  text-decoration: none;
  transition: color .15s;
}
.pbd-footer-col a:hover { color: var(--pbd-primary-700); }
body[data-theme="dark"] .pbd-footer-col a:hover { color: var(--pbd-primary-300); }
.pbd-footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  flex-wrap: wrap;
  padding-top: 24px;
  font-size: 13px;
  color: var(--pbd-text-faint);
}
.pbd-footer-bottom .pbd-legal {
  display: flex; gap: 20px;
}
.pbd-footer-bottom .pbd-legal a { color: var(--pbd-text-faint); text-decoration: none; }

/* =========================================================
   RTL ADJUSTMENTS
   ========================================================= */
body.palebluedot-fa h1,
body.palebluedot-fa h2,
body.palebluedot-fa h3,
body.palebluedot-fa h4,
body.palebluedot-fa .pbd-h1,
body.palebluedot-fa .pbd-h2,
body.palebluedot-fa .pbd-h3 {
  font-family: var(--pbd-font-fa);
  letter-spacing: 0;
  font-weight: 600;
  line-height: 1.45;
}
body.palebluedot-fa .pbd-hero h1 {
  font-weight: 700; line-height: 1.35;
}
body.palebluedot-fa .pbd-hero h1 em { font-style: normal; }
body.palebluedot-fa .pbd-section-head h3 { line-height: 1.45; }
body.palebluedot-fa pre,
body.palebluedot-fa .wp-block-code,
body.palebluedot-fa code {
  direction: ltr; text-align: left; font-family: var(--pbd-font-mono);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
  .pbd-featured-card { grid-template-columns: 1fr; }
  .pbd-featured-card .pbd-cover { min-height: 240px; }
  .pbd-post-grid { grid-template-columns: 1fr 1fr; }
  .pbd-post-layout { grid-template-columns: 1fr; gap: 32px; }
  .pbd-toc, .pbd-aside { position: static; }
  .pbd-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .pbd-nav { display: none; }
}
@media (max-width: 640px) {
  .pbd-post-grid { grid-template-columns: 1fr; }
  .pbd-archive-row { grid-template-columns: 1fr; gap: 8px; }
  .pbd-archive-row .pbd-reading { display: none; }
  .pbd-footer-grid { grid-template-columns: 1fr; }
  .pbd-next-cta { grid-template-columns: 1fr; }
  :root { --pbd-gutter: 20px; }
}
