/* ============================================================
   ELOY TRAINER — BLOG THEME
   Design tokens lifted from eloytrainer.com landing:
   Anton (display) + Inter (body), brand red (Ghost accent, #dc3232) on near-black.
   ============================================================ */

:root {
  --bg: #06070b;
  --bg-soft: #0b0e18;
  --bg-navy: #0a0f20;
  --bg-card: #101421;
  --bg-card-hover: #12162a;
  --white: #f7f7f8;
  --muted: rgba(255, 255, 255, 0.66);
  --muted-soft: rgba(255, 255, 255, 0.5);
  --primary: var(--ghost-accent-color, #dc3232);
  --primary-dark: #a81f1f;
  --primary-glow: rgba(220, 50, 50, 0.45);
  --border: rgba(255, 255, 255, 0.12);
  --border-soft: rgba(255, 255, 255, 0.08);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --wrap: 1120px;
  --wrap-narrow: 720px;
}

/* ---- Reset-ish ---- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font: inherit; }
::selection { background: var(--primary); color: #0a0a0a; }

/* ---- Display type ---- */
.display {
  font-family: "Anton", Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 0.95;
}

/* ---- Layout ---- */
.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 40px, var(--wrap-narrow)); margin-inline: auto; }

.kicker {
  position: relative;
  margin: 0 0 14px;
  padding-left: 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}
.kicker::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 6px; height: 6px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}
.accent { color: var(--primary); }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-head {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 7, 11, 0.86);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.site-head-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: opacity 0.25s var(--ease);
}
.logo:hover { opacity: 0.82; }
.logo-mark {
  position: relative;
  width: 18px; height: 15px;
  display: inline-block;
  flex: 0 0 auto;
}
.logo-mark::before,
.logo-mark::after {
  content: "";
  position: absolute;
  top: 0;
  width: 9px; height: 15px;
  transform: skewX(-34deg);
}
.logo-mark::before { left: 0; background: var(--primary); }
.logo-mark::after { right: 0; background: #fff; }
.logo-text { font-size: 20px; font-weight: 800; line-height: 1; letter-spacing: 0.01em; }
.logo-img { height: 30px; width: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
.site-nav a:not(.btn-pill) {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  position: relative;
  transition: color 0.25s var(--ease);
}
.site-nav a:not(.btn-pill)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--primary);
  transition: width 0.3s var(--ease);
}
.site-nav a:not(.btn-pill):hover { color: var(--primary); }
.site-nav a:not(.btn-pill):hover::after { width: 100%; }

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 9999px;
  background: #fff;
  color: #070707;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 20px;
  transition: background 0.25s var(--ease), transform 0.2s var(--ease),
    box-shadow 0.25s var(--ease);
}
.btn-pill:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--primary) 30%, transparent);
}
/* Primary (brand red) button — used for the "back to site" link */
.btn-pill--primary {
  background: var(--primary);
  color: #fff;
}
.btn-pill--primary:hover {
  background: #fff;
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--primary) 35%, transparent);
}
.btn-pill--ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--border);
}
.btn-pill--ghost:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- Native Ghost navigation ({{navigation}} outputs ul.nav > li) ---- */
.site-nav .nav,
.site-foot-nav .nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 26px;
}
.site-nav .nav li,
.site-foot-nav .nav li { margin: 0; }
.site-foot-nav .nav { gap: 18px; }

/* ---- Mobile menu (CSS-only) ---- */
.nav-toggle { display: none; }
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px; height: 30px;
  z-index: 40;
}
.hamburger span {
  display: block; width: 100%; height: 2px;
  background: #fff; border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}

/* ============================================================
   HERO (site header banner on index)
   ============================================================ */
.hero {
  position: relative;
  padding: 72px 0 56px;
  background:
    radial-gradient(circle at 15% -10%, color-mix(in srgb, var(--primary) 8%, transparent) 0%, transparent 45%),
    linear-gradient(180deg, var(--bg-navy) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border-soft);
}
.hero-title {
  margin: 0 0 16px;
  font-size: clamp(40px, 8vw, 84px);
  max-width: 16ch;
}
.hero-desc {
  margin: 0;
  max-width: 60ch;
  font-size: clamp(15px, 2vw, 18px);
  color: var(--muted);
}

/* ============================================================
   POST FEED
   ============================================================ */
.section { padding: 56px 0 72px; }
.section-head { margin-bottom: 28px; }

.post-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}
.post-card:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}
.post-card--featured {
  grid-column: 1 / -1;
  flex-direction: row;
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}
.post-card-image {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-soft);
}
.post-card--featured .post-card-image { flex: 1 1 55%; aspect-ratio: 16 / 10; }
.post-card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.post-card:hover .post-card-image img { transform: scale(1.04); }
.post-card-image--placeholder {
  display: grid; place-items: center;
  color: rgba(255, 255, 255, 0.08);
}
.post-card-image--placeholder .logo-mark { width: 48px; height: 40px; }
.post-card-image--placeholder .logo-mark::before,
.post-card-image--placeholder .logo-mark::after { width: 24px; height: 40px; }

.post-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 22px 24px;
  flex: 1 1 auto;
}
.post-card--featured .post-card-body { flex: 1 1 45%; justify-content: center; padding: 32px; }
.post-card-tag {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
}
.post-card-title {
  margin: 0;
  font-size: clamp(22px, 2vw, 28px);
}
.post-card--featured .post-card-title { font-size: clamp(28px, 3.4vw, 44px); }
.post-card-title a { transition: color 0.25s var(--ease); }
.post-card:hover .post-card-title a { color: var(--primary); }
.post-card-excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-meta {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted-soft);
}
.post-card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-soft); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  margin-top: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.pagination a, .pagination .page-number {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.pagination a:hover { color: var(--primary); }

/* ============================================================
   POST / PAGE
   ============================================================ */
.post-head {
  padding: 64px 0 32px;
  background: linear-gradient(180deg, var(--bg-navy) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border-soft);
}
.post-head-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted-soft);
}
.post-head-tag { color: var(--primary); font-weight: 800; text-transform: uppercase; letter-spacing: 0.16em; }
.post-title {
  margin: 0 0 18px;
  font-size: clamp(34px, 6vw, 68px);
  max-width: 18ch;
}
.post-excerpt {
  margin: 0;
  font-size: clamp(16px, 2.2vw, 21px);
  color: var(--muted);
  max-width: 60ch;
}
.post-feature-image {
  margin: 32px auto 0;
}
.post-feature-image img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

/* ---- Content typography ---- */
.post-content {
  padding: 48px 0 64px;
  font-size: 18px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.9);
}
.post-content > * { margin-top: 0; margin-bottom: 1.5em; }
.post-content h2 { font-size: clamp(26px, 3.4vw, 36px); margin-top: 1.6em; line-height: 1.15; color: #fff; }
.post-content h3 { font-size: clamp(21px, 2.6vw, 27px); margin-top: 1.4em; line-height: 1.2; color: #fff; }
.post-content h2, .post-content h3, .post-content h4 { font-weight: 800; letter-spacing: -0.01em; }
.post-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post-content a:hover { text-decoration-thickness: 2px; }
.post-content strong { color: #fff; }
.post-content img, .post-content video { border-radius: var(--radius); }
.post-content figure { margin-inline: 0; }
.post-content figcaption { text-align: center; font-size: 13px; color: var(--muted-soft); margin-top: 10px; }
.post-content blockquote {
  margin: 1.8em 0;
  padding: 6px 0 6px 24px;
  border-left: 3px solid var(--primary);
  font-size: 1.15em;
  font-style: italic;
  color: #fff;
}
.post-content ul, .post-content ol { padding-left: 1.4em; }
.post-content li { margin-bottom: 0.5em; }
.post-content li::marker { color: var(--primary); }
.post-content hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }
.post-content code {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 0.9em;
}
.post-content pre {
  background: #0b0e18;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
}
.post-content pre code { background: none; border: 0; padding: 0; }
.kg-bookmark-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.kg-width-wide { width: min(100vw - 40px, 1120px); margin-inline: calc(50% - min(50vw - 20px, 560px)); }
.kg-width-full { width: 100vw; margin-inline: calc(50% - 50vw); }
.kg-width-full img { border-radius: 0; }

/* ---- Post footer / author ---- */
.post-foot {
  padding: 28px 0 64px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.post-author {
  display: flex;
  align-items: center;
  gap: 12px;
}
.post-author img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.post-author-name { margin: 0; font-weight: 700; }
.post-author-bio { margin: 2px 0 0; font-size: 13px; color: var(--muted-soft); }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.post-tags a {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all 0.25s var(--ease);
}
.post-tags a:hover { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 45%, transparent); }

/* ============================================================
   SUBSCRIBE / CTA STRIP
   ============================================================ */
.cta-strip {
  margin: 8px 0 0;
  padding: 40px 32px;
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary) 8%, transparent) 0%,
    color-mix(in srgb, var(--primary) 3%, transparent) 100%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.cta-strip h3 { margin: 0 0 6px; font-size: clamp(22px, 3vw, 30px); }
.cta-strip p { margin: 0; color: var(--muted); font-size: 15px; max-width: 46ch; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-foot {
  background: #07080d;
  border-top: 1px solid var(--border-soft);
  padding: 48px 0 24px;
}
.site-foot-main {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
}
.site-foot-copy { margin: 12px 0 0; max-width: 320px; font-size: 14px; color: var(--muted-soft); }
.site-foot-nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-foot-nav a {
  font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.25s var(--ease);
}
.site-foot-nav a:hover { color: var(--primary); }
.site-foot-bottom {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
}
.site-foot-bottom p { margin: 0; font-size: 12px; color: var(--muted-soft); }

/* ============================================================
   ERROR PAGE
   ============================================================ */
.error-wrap { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 80px 0; }
.error-code { font-size: clamp(80px, 20vw, 200px); color: var(--primary); line-height: 1; }
.error-desc { margin: 8px 0 28px; color: var(--muted); font-size: 18px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
  /* Remove the header's backdrop-filter on mobile: it creates a containing
     block that would trap the fixed full-screen menu inside the 64px bar. */
  .site-head {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(6, 7, 11, 0.92);
  }
  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 50;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 24px;
    background: rgba(6, 7, 11, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
  }
  .site-nav a:not(.btn-pill) { font-size: 18px; letter-spacing: 0.2em; }
  .site-nav .nav { flex-direction: column; align-items: center; gap: 30px; }
  .site-nav .btn-pill { font-size: 14px; padding: 12px 28px; margin-top: 4px; }
  .nav-toggle:checked ~ .site-nav { opacity: 1; visibility: visible; }
  .nav-toggle:checked ~ .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .hamburger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .hamburger { display: flex; position: relative; z-index: 60; }
  .post-card--featured { flex-direction: column; }
  .post-card--featured .post-card-image { aspect-ratio: 16 / 9; }
}
