/* fenixara.com theme: shared stylesheet for every platform (Ghost, WordPress,
   Hugo, Jekyll). Edit THIS file, then run `python3 theme/sync.py` to copy it
   into each platform's theme. Platform-specific class names (Ghost .kg-*,
   WordPress .wp-block-*, .alignwide) are covered at the bottom. */

/* ------------------------------------------------------------ tokens */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --surface: #ffffff;
  --text: #0f172a;
  --text-soft: #475569;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #0369a1;
  --accent-soft: #e0f2fe;
  --hero-from: #0f172a;
  --hero-to: #1e293b;
  --hero-text: #f8fafc;
  --hero-accent: #38bdf8;
  --code-bg: #0b1220;
  --code-text: #e2e8f0;
  --inline-code-bg: #eef2f7;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --radius: 14px;
  --content: 720px;
  --wide: 1080px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120;
    --bg-soft: #0f172a;
    --surface: #111a2e;
    --text: #e2e8f0;
    --text-soft: #b6c2d4;
    --muted: #8a99b0;
    --border: #1e293b;
    --accent: #38bdf8;
    --accent-soft: #0c2a3d;
    --inline-code-bg: #1b2538;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1120;
  --bg-soft: #0f172a;
  --surface: #111a2e;
  --text: #e2e8f0;
  --text-soft: #b6c2d4;
  --muted: #8a99b0;
  --border: #1e293b;
  --accent: #38bdf8;
  --accent-soft: #0c2a3d;
  --inline-code-bg: #1b2538;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--gh-font-body, var(--font-sans));
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; height: auto; }
.fx-container { max-width: var(--wide); margin: 0 auto; padding: 0 20px; }
.fx-narrow { max-width: var(--content); margin: 0 auto; padding: 0 20px; }
.fx-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

h1, h2, h3, h4, .fx-logo, .fx-card-title { font-family: var(--gh-font-heading, var(--font-sans)); }

/* ------------------------------------------------------------ header */
.fx-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
/* topic bar (secondary navigation), sits above the main header row */
.fx-topics { background: var(--bg-soft); border-bottom: 1px solid var(--border); font-size: 13.5px; }
.fx-topics-inner { display: flex; align-items: center; gap: 14px; height: 38px; }
.fx-topics-label { color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; flex: none; }
.fx-topics nav { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.fx-topics nav::-webkit-scrollbar { display: none; }
.fx-topics ul { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; white-space: nowrap; }
.fx-topics a { display: inline-block; padding: 3px 10px; border-radius: 999px; color: var(--text-soft); font-weight: 500; }
.fx-topics a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.fx-topics .nav-current a, .fx-topics a[aria-current="page"] { background: var(--accent); color: #fff; }
.fx-header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.fx-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--text); letter-spacing: -.02em; }
.fx-logo:hover { text-decoration: none; }
.fx-logo img { height: 32px; width: auto; }
/* white logos (made for dark headers): dark in light mode, as-is in dark mode */
.fx-white-logo .fx-logo img { filter: brightness(0); opacity: .85; }
:root[data-theme="dark"] .fx-white-logo .fx-logo img { filter: none; opacity: 1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fx-white-logo .fx-logo img { filter: none; opacity: 1; } }
/* optional dark-mode logo (Ghost custom setting logo_dark): swap images when it's set */
.fx-logo .fx-logo-dark { display: none; }
:root[data-theme="dark"] .fx-has-dark-logo .fx-logo .fx-logo-light { display: none; }
:root[data-theme="dark"] .fx-has-dark-logo .fx-logo .fx-logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fx-has-dark-logo .fx-logo .fx-logo-light { display: none; }
  :root:not([data-theme="light"]) .fx-has-dark-logo .fx-logo .fx-logo-dark { display: block; }
}
.fx-logo-mark {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #0ea5e9, #6366f1); color: #fff; font-size: 17px;
}
.fx-nav { flex: 1; }
.fx-nav ul { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; margin: 0; padding: 0; }
.fx-nav a { color: var(--text-soft); font-size: 15px; font-weight: 500; }
.fx-nav a:hover, .fx-nav .nav-current a, .fx-nav .current-menu-item a { color: var(--text); text-decoration: none; }
.fx-actions { display: flex; align-items: center; gap: 10px; }
.fx-icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft); cursor: pointer;
}
.fx-icon-btn:hover { color: var(--text); }
.fx-icon-btn svg { width: 18px; height: 18px; }
.fx-btn {
  display: inline-block; padding: 8px 16px; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; font: 600 15px/1.4 var(--font-sans);
}
.fx-btn:hover { text-decoration: none; filter: brightness(1.08); }
@media (max-width: 760px) {
  .fx-header-inner { height: auto; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; gap: 10px 16px; }
  .fx-nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .fx-nav ul { flex-wrap: nowrap; white-space: nowrap; }
  .fx-actions { margin-left: auto; }
}

/* ------------------------------------------------------------ hero */
.fx-hero {
  background: radial-gradient(900px 400px at 85% 0%, rgba(56, 189, 248, .18), transparent 60%),
              linear-gradient(160deg, var(--hero-from), var(--hero-to));
  color: var(--hero-text);
  padding: 72px 0 64px;
}
.fx-hero h1 { margin: 0 0 12px; font-size: clamp(32px, 5vw, 52px); line-height: 1.1; letter-spacing: -.03em; }
.fx-hero p { margin: 0; max-width: 640px; color: #cbd5e1; font-size: 20px; }
.fx-hero .fx-kicker { color: var(--hero-accent); }
.fx-kicker { display: inline-block; margin-bottom: 12px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }

/* ------------------------------------------------------------ post grid */
.fx-section { padding: 48px 0 64px; }
.fx-section-title { margin: 0 0 24px; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.fx-grid > .fx-card:first-child.fx-card-featured { grid-column: 1 / -1; }
@media (max-width: 980px) { .fx-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .fx-grid { grid-template-columns: 1fr; } }

.fx-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.fx-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(15, 23, 42, .08), 0 16px 36px rgba(15, 23, 42, .12); }
.fx-card-image { display: block; aspect-ratio: 16 / 9; background: var(--bg-soft); overflow: hidden; }
.fx-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fx-card-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.fx-card-title { margin: 0 0 8px; font-size: 20px; line-height: 1.3; letter-spacing: -.01em; }
.fx-card-title a { color: var(--text); }
.fx-card-excerpt { margin: 0 0 16px; color: var(--text-soft); font-size: 15.5px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fx-meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 14px; }
.fx-tag-pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 600;
}
.fx-tag-pill:hover { text-decoration: none; }
.fx-card-featured { flex-direction: row; }
.fx-card-featured .fx-card-image { flex: 0 0 58%; aspect-ratio: 16 / 9; }
.fx-card-featured .fx-card-body { padding: 32px; justify-content: center; }
.fx-card-featured .fx-card-title { font-size: 30px; }
@media (max-width: 860px) { .fx-card-featured { flex-direction: column; } .fx-card-featured .fx-card-image { flex: none; width: 100%; } .fx-card-featured .fx-card-body { padding: 20px 22px 22px; } .fx-card-featured .fx-card-title { font-size: 22px; } }

/* ------------------------------------------------------------ archive header (tag/author) */
.fx-archive { padding: 56px 0 8px; }
.fx-archive h1 { margin: 0 0 8px; font-size: 40px; letter-spacing: -.02em; }
.fx-archive p { margin: 0; color: var(--text-soft); max-width: 640px; }
.fx-author-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin-bottom: 12px; }

/* ------------------------------------------------------------ article */
.fx-article-header { padding-top: 56px; padding-bottom: 28px; }
.fx-article-title { margin: 6px 0 14px; font-size: clamp(32px, 4.6vw, 46px); line-height: 1.15; letter-spacing: -.025em; }
.fx-article-excerpt { margin: 0 0 18px; font-size: 21px; line-height: 1.55; color: var(--text-soft); }
.fx-byline { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; }
.fx-byline img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.fx-byline a { color: var(--text); font-weight: 600; }
.fx-feature { margin: 8px auto 40px; max-width: var(--wide); padding: 0 20px; }
.fx-feature img { display: block; width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.fx-feature figcaption { margin-top: 8px; text-align: center; color: var(--muted); font-size: 14px; }

.fx-content { font-size: 18.5px; line-height: 1.75; }
.fx-content > * { margin-top: 0; margin-bottom: 1.4em; }
.fx-content h2 { margin: 2em 0 .6em; font-size: 28px; line-height: 1.25; letter-spacing: -.015em; }
.fx-content h3 { margin: 1.7em 0 .5em; font-size: 22px; line-height: 1.3; }
.fx-content h4 { margin: 1.5em 0 .5em; font-size: 18.5px; }
.fx-content a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.fx-content ul, .fx-content ol { padding-left: 1.4em; }
.fx-content li { margin: .35em 0; }
.fx-content blockquote {
  margin-left: 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--accent);
  color: var(--text-soft); font-style: italic;
}
.fx-content hr { border: 0; height: 1px; background: var(--border); margin: 2.5em 0; }
.fx-content table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.fx-content th, .fx-content td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.fx-content th { font-weight: 700; background: var(--bg-soft); }
.fx-content img { border-radius: 10px; }

/* inline code + code blocks */
.fx-content :not(pre) > code {
  padding: .15em .4em; border-radius: 6px; background: var(--inline-code-bg);
  font-family: var(--font-mono); font-size: .86em; word-break: break-word;
}
.fx-content pre {
  position: relative; overflow-x: auto; padding: 20px 22px; border-radius: 12px;
  background: var(--code-bg); color: var(--code-text); border: 1px solid #1e293b;
  font-family: var(--font-mono); font-size: 14.5px; line-height: 1.65; tab-size: 4;
}
.fx-content pre code { background: none; padding: 0; font: inherit; color: inherit; white-space: pre; }
.fx-content pre[data-lang]::before {
  content: attr(data-lang); position: absolute; top: 8px; right: 12px;
  font: 600 11px/1 var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: #64748b;
}
.fx-copy {
  position: absolute; top: 8px; right: 8px; padding: 4px 10px; border-radius: 7px; cursor: pointer;
  border: 1px solid #334155; background: #0f172a; color: #cbd5e1; font: 600 12px/1.4 var(--font-sans); opacity: 0;
  transition: opacity .15s;
}
.fx-content pre:hover .fx-copy, .fx-copy:focus { opacity: 1; }
.fx-content pre:hover[data-lang]::before { opacity: 0; }

/* article footer */
.fx-article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 40px 0 0; }
.fx-author-box {
  display: flex; gap: 18px; align-items: flex-start; margin: 40px 0 0; padding: 22px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft);
}
.fx-author-box img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; flex: none; }
.fx-author-box h4 { margin: 0 0 4px; font-size: 17px; }
.fx-author-box p { margin: 0; color: var(--text-soft); font-size: 15.5px; line-height: 1.6; }
.fx-prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 40px 0 0; }
.fx-prev-next a { display: block; padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); }
.fx-prev-next a:hover { border-color: var(--accent); text-decoration: none; }
.fx-prev-next small { display: block; color: var(--muted); font-size: 13px; }
.fx-prev-next .fx-next { text-align: right; grid-column: 2; }
@media (max-width: 640px) { .fx-prev-next { grid-template-columns: 1fr; } .fx-prev-next .fx-next { grid-column: 1; } }
.fx-related { background: var(--bg-soft); border-top: 1px solid var(--border); margin-top: 64px; }

/* subscribe band */
.fx-subscribe {
  margin: 48px 0 0; padding: 28px; border-radius: var(--radius); text-align: center;
  background: linear-gradient(160deg, var(--hero-from), var(--hero-to)); color: var(--hero-text);
}
.fx-subscribe h3 { margin: 0 0 6px; font-size: 22px; }
.fx-subscribe p { margin: 0 0 16px; color: #cbd5e1; font-size: 16px; }

/* ------------------------------------------------------------ pagination + footer */
.fx-pagination { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 40px; color: var(--muted); font-size: 15px; }
.fx-pagination a { padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); }
.fx-pagination a:hover { border-color: var(--accent); text-decoration: none; }
.fx-footer { border-top: 1px solid var(--border); padding: 32px 0; color: var(--muted); font-size: 14.5px; }
.fx-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.fx-footer ul { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0; padding: 0; }
.fx-footer a { color: var(--text-soft); }
.fx-error { padding: 120px 0; text-align: center; }
.fx-error h1 { font-size: 88px; margin: 0; letter-spacing: -.04em; }

/* ------------------------------------------------------------ syntax highlighting (Prism tokens) */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #64748b; font-style: italic; }
.token.punctuation { color: #94a3b8; }
.token.property, .token.tag, .token.constant, .token.symbol, .token.deleted { color: #f472b6; }
.token.boolean, .token.number { color: #fb923c; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #86efac; }
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string, .token.variable { color: #fcd34d; }
.token.atrule, .token.attr-value, .token.keyword { color: #7dd3fc; }
.token.function, .token.class-name { color: #c4b5fd; }
.token.regex, .token.important { color: #fdba74; }
.token.important, .token.bold { font-weight: 700; }
.token.italic { font-style: italic; }

/* ------------------------------------------------------------ Ghost editor cards */
.kg-width-wide { position: relative; width: min(var(--wide), calc(100vw - 40px)); left: 50%; transform: translateX(-50%); }
.kg-width-full { position: relative; width: 100vw; left: 50%; transform: translateX(-50%); }
.kg-width-full img { border-radius: 0; }
.kg-image-card img, .kg-gallery-image img { display: block; margin: 0 auto; }
.kg-card figcaption, .wp-block-image figcaption, figure figcaption { margin-top: 8px; text-align: center; color: var(--muted); font-size: 14.5px; }
.kg-embed-card { display: flex; flex-direction: column; align-items: center; }
.kg-bookmark-card a.kg-bookmark-container { color: var(--text); text-decoration: none; border-color: var(--border); }
.kg-callout-card { border-radius: 12px; }

/* ------------------------------------------------------------ WordPress block classes */
.alignwide { position: relative; width: min(var(--wide), calc(100vw - 40px)); left: 50%; transform: translateX(-50%); }
.alignfull { position: relative; width: 100vw; left: 50%; transform: translateX(-50%); }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignleft { float: left; margin: .3em 1.4em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.4em; }
.wp-caption-text, .wp-element-caption { text-align: center; color: var(--muted); font-size: 14.5px; }
.wp-block-code { padding: 0; border: 0; background: none; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sticky, .gallery-caption, .bypostauthor { display: block; }

/* ------------------------------------------------------------ small extras */
.fx-card-tag { margin-bottom: 10px; min-height: 1px; }
.fx-article-header .fx-card-tag { margin-bottom: 4px; }
