/* ==========================================================================
   DIMIDIUM — BLOG STYLESHEET
   Shared dark design for all non-front-page templates
   ========================================================================== */

/* Inherit the same design tokens as front-page.css */
:root {
  --bg:          #080b14;
  --bg-alt:      #0d1120;
  --glass:       rgba(255,255,255,0.045);
  --glass-hover: rgba(255,255,255,0.08);
  --border:      rgba(255,255,255,0.09);
  --border-med:  rgba(255,255,255,0.14);
  --text:        #edeae5;
  --muted:       rgba(237,234,229,0.55);
  --subtle:      rgba(237,234,229,0.30);
  --accent:      #e85d3c;
  --accent-dark: #c44828;

  --ff-serif: 'DM Serif Display', Georgia, serif;
  --ff-sans:  'Inter', system-ui, -apple-system, sans-serif;

  --radius:    4px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --pill:      100px;
  --ease:      cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:  cubic-bezier(0, 0, 0.2, 1);
  --dur:       260ms;

  --nav-h:     72px;
  --max-w:     1280px;
  --pad-x:     clamp(20px, 5vw, 80px);
}

/* --------------------------------------------------------------------------
   BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

.fp-body {
  font-family: var(--ff-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.fp-body img { max-width: 100%; height: auto; display: block; }
.fp-body a   { color: var(--text); text-decoration: none; }
.fp-body ul  { list-style: none; }

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   SHARED UTILITIES  (duplicated from front-page.css for isolation)
   -------------------------------------------------------------------------- */
.fp-container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.fp-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.fp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--pill);
  font-family: var(--ff-sans);
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
  white-space: nowrap;
  line-height: 1;
}

.fp-btn--outline,
a.fp-btn--outline       { background: transparent; border-color: var(--border-med); color: var(--text); }
.fp-btn--outline:hover,
a.fp-btn--outline:hover { border-color: var(--text); transform: translateY(-2px); color: var(--text); }

/* --------------------------------------------------------------------------
   NAV  (same structure as front-page.css — always solid on blog pages)
   -------------------------------------------------------------------------- */
.fp-nav {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 900;
  height: var(--nav-h);
}

.fp-nav--scrolled {
  background: rgba(8,11,20,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 var(--border);
}

.fp-nav__inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--pad-x);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.fp-nav__logo { display: flex; align-items: center; }
.fp-nav__logo img { height: 28px; width: auto; filter: brightness(0) invert(1); }
.fp-nav__wordmark {
  font-family: var(--ff-serif);
  font-size: 21px;
  letter-spacing: -0.025em;
  color: var(--text);
}

.fp-nav__menu { display: flex; align-items: center; gap: 12px; }

.fp-nav__menu #fp-primary-menu {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-med);
  border-radius: var(--pill);
  padding: 5px 6px;
}

.fp-nav__menu #fp-primary-menu li a {
  display: block;
  padding: 8px 18px;
  border-radius: var(--pill);
  font-size: 14px;
  font-weight: 450;
  color: rgba(237,234,229,0.75);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.fp-nav__menu #fp-primary-menu li a:hover { background: rgba(255,255,255,0.11); color: var(--text); }

.fp-nav__cta {
  display: inline-flex;
  align-items: center;
  padding: 9px 20px;
  background: var(--text);
  border-radius: var(--pill);
  font-size: 14px;
  font-weight: 600;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
a.fp-nav__cta       { color: var(--bg); }
a.fp-nav__cta:hover { background: #fff; transform: translateY(-1px); color: var(--bg); }
.fp-nav__cta:hover  { background: #fff; transform: translateY(-1px); }

.fp-nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.fp-nav__toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.admin-bar .fp-nav { top: 32px; }
@media (max-width: 782px) { .admin-bar .fp-nav { top: 46px; } }

/* --------------------------------------------------------------------------
   FOOTER  (same tokens as front-page.css)
   -------------------------------------------------------------------------- */
.fp-footer {
  background: #03040a;
  padding-top: clamp(60px,8vw,96px);
  padding-bottom: 40px;
  border-top: 1px solid var(--border);
}
.fp-footer__top {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
  margin-bottom: clamp(48px,6vw,72px);
  padding-bottom: clamp(48px,6vw,72px);
  border-bottom: 1px solid var(--border);
}
.fp-footer__logo-link { display: inline-flex; margin-bottom: 18px; }
.fp-footer__logo-link img { height: 24px; width: auto; filter: brightness(0) invert(0.8); }
.fp-footer__wordmark { font-family: var(--ff-serif); font-size: 20px; letter-spacing: -0.025em; color: var(--text); }
.fp-footer__tagline  { font-size: 13px; color: var(--subtle); line-height: 1.6; max-width: 240px; }
.fp-footer__nav      { display: grid; grid-template-columns: repeat(3,1fr); gap: 40px; }
.fp-footer__nav-head { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--subtle); margin-bottom: 18px; }
.fp-footer__nav-col ul { display: flex; flex-direction: column; gap: 10px; }
.fp-footer__nav-col ul li a       { font-size: 14px; color: var(--muted); transition: color var(--dur) var(--ease); }
.fp-footer__nav-col ul li a:hover { color: var(--text); }
.fp-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.fp-footer__copy,
.fp-footer__made { font-size: 12px; color: var(--subtle); }

/* --------------------------------------------------------------------------
   BLOG LISTING — Hero
   -------------------------------------------------------------------------- */
.blog-listing { padding-top: var(--nav-h); }

.blog-hero {
  padding: clamp(60px,8vw,120px) 0 clamp(48px,6vw,80px);
  border-bottom: 1px solid var(--border);
}

.blog-hero__title {
  font-family: var(--ff-serif);
  font-size: clamp(36px, 5vw, 68px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 16px;
}

.blog-hero__desc {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 500px;
}

/* --------------------------------------------------------------------------
   BLOG LISTING — Search bar
   -------------------------------------------------------------------------- */
.blog-search {
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.blog-search__form {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: var(--glass);
  border: 1px solid var(--border-med);
  border-radius: var(--pill);
  overflow: hidden;
  width: 100%;
  max-width: 560px;
  transition: border-color var(--dur) var(--ease);
}
.blog-search__form:focus-within { border-color: rgba(255,255,255,0.28); }

.blog-search__icon {
  flex-shrink: 0;
  margin-left: 18px;
  color: var(--subtle);
  pointer-events: none;
}

.blog-search__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 14px 14px 14px 10px;
  font-family: var(--ff-sans);
  font-size: 15px;
  color: var(--text);
  min-width: 0;
}
.blog-search__input::placeholder { color: var(--subtle); }

/* Loading spinner (shown via JS) */
.blog-search__spinner {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-right: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--muted);
  border-radius: 50%;
  display: none;
}
.blog-search__spinner.is-active {
  display: block;
  animation: blog-spin 0.7s linear infinite;
}
@keyframes blog-spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   BLOG LISTING — Post grid
   -------------------------------------------------------------------------- */
.blog-posts { padding: clamp(60px,8vw,100px) 0 clamp(80px,10vw,140px); }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 60px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.blog-card:hover { border-color: var(--border-med); background: var(--glass-hover); }

.blog-card__img-wrap {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-alt);
  flex-shrink: 0;
}
.blog-card__img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.56s var(--ease-out); }
.blog-card:hover .blog-card__img-wrap img { transform: scale(1.04); }

.blog-card__img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-alt) 0%, rgba(255,255,255,0.03) 100%);
}

.blog-card__body { padding: 24px; display: flex; flex-direction: column; flex: 1; }

.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.blog-card__cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  transition: opacity var(--dur) var(--ease);
}
a.blog-card__cat:hover { opacity: 0.8; }

.blog-card__sep { color: var(--subtle); font-size: 12px; }

.blog-card__meta time { font-size: 12px; color: var(--subtle); }

.blog-card__title {
  font-family: var(--ff-serif);
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 12px;
}
.blog-card__title a { color: inherit; transition: color var(--dur) var(--ease); }
.blog-card__title a:hover { color: rgba(237,234,229,0.75); }

.blog-card__excerpt { font-size: 14px; color: var(--muted); line-height: 1.65; margin-bottom: 20px; flex: 1; }

.blog-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  margin-top: auto;
  transition: gap var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
a.blog-card__cta:hover { gap: 10px; }

/* Pagination */
.blog-pagination .nav-links { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.blog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--pill);
  font-size: 14px;
  color: var(--muted);
  border: 1px solid var(--border);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.blog-pagination .page-numbers.current { background: var(--text); color: var(--bg); border-color: var(--text); }
.blog-pagination a.page-numbers:hover  { border-color: var(--text); color: var(--text); }
.blog-pagination .page-numbers.prev,
.blog-pagination .page-numbers.next    { width: auto; padding-inline: 18px; }

/* Empty state */
.blog-empty {
  text-align: center;
  padding: clamp(60px,8vw,120px) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   SINGLE POST — Hero
   -------------------------------------------------------------------------- */
.blog-single { padding-top: var(--nav-h); }

.post-hero {
  position: relative;
  padding: clamp(60px,8vw,120px) 0 clamp(48px,6vw,80px);
  border-bottom: 1px solid var(--border);
}

.post-hero--has-img {
  min-height: 60vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: clamp(48px,6vw,80px);
}

.post-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.post-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(8,11,20,0.4) 0%, rgba(8,11,20,0.85) 100%);
}

.post-hero__inner { position: relative; z-index: 1; }

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 32px;
  transition: color var(--dur) var(--ease), gap var(--dur) var(--ease);
}
a.post-back:hover { color: var(--text); gap: 12px; }

.post-hero__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.post-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
a.post-cat:hover { opacity: 0.8; }

.post-hero__meta time,
.post-hero__meta span { font-size: 13px; color: var(--muted); }

.post-hero__title {
  font-family: var(--ff-serif);
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  max-width: 900px;
}

/* --------------------------------------------------------------------------
   SINGLE POST — Prose content
   -------------------------------------------------------------------------- */
.post-content {
  padding: clamp(48px,6vw,96px) 0;
}

.post-prose {
  max-width: 720px;
  margin-inline: auto;
  font-size: 17px;
  line-height: 1.8;
  color: rgba(237,234,229,0.85);
}

.post-prose > * + * { margin-top: 1.5em; }

.post-prose h2,
.post-prose h3,
.post-prose h4 {
  font-family: var(--ff-serif);
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-top: 2.25em;
  margin-bottom: 0.6em;
}
.post-prose h2 { font-size: clamp(24px, 3vw, 36px); }
.post-prose h3 { font-size: clamp(20px, 2.5vw, 28px); }
.post-prose h4 { font-size: clamp(17px, 2vw, 22px); }

.post-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; transition: opacity var(--dur) var(--ease); }
.post-prose a:hover { opacity: 0.8; }

.post-prose strong { color: var(--text); font-weight: 600; }
.post-prose em     { font-style: italic; }

.post-prose ul,
.post-prose ol { padding-left: 1.5em; }
.post-prose ul { list-style: disc; }
.post-prose ol { list-style: decimal; }
.post-prose li + li { margin-top: 0.4em; }

.post-prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 16px 24px;
  margin: 2em 0;
  background: var(--glass);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--muted);
}

.post-prose code {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.875em;
  background: var(--glass);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: var(--radius);
  color: var(--accent);
}

.post-prose pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  overflow-x: auto;
  margin: 2em 0;
}
.post-prose pre code { background: none; border: none; padding: 0; color: var(--text); font-size: 14px; }

.post-prose img { border-radius: var(--radius-md); width: 100%; }

.post-prose hr { border: none; border-top: 1px solid var(--border); margin: 2.5em 0; }

/* --------------------------------------------------------------------------
   SINGLE POST — Navigation
   -------------------------------------------------------------------------- */
.post-nav {
  padding: clamp(48px,6vw,80px) 0;
  border-top: 1px solid var(--border);
}

.post-nav .nav-links { display: flex; gap: 20px; flex-wrap: wrap; }
.post-nav .nav-previous,
.post-nav .nav-next { flex: 1; min-width: 200px; }
.post-nav .nav-next { text-align: right; margin-left: auto; }

.post-nav a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 24px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
a.post-nav { color: var(--text); }
.post-nav a:hover { background: var(--glass-hover); border-color: var(--border-med); }

.post-nav__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--subtle);
}

.post-nav__title {
  font-family: var(--ff-serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.3;
}

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .blog-grid          { grid-template-columns: repeat(2,1fr); }
  .fp-footer__top     { grid-template-columns: 1fr; }
  .fp-footer__nav     { grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 768px) {
  .fp-nav__toggle { display: flex; }
  .fp-nav__menu {
    display: none;
    position: fixed;
    inset-block: var(--nav-h) 0;
    inset-inline: 0;
    background: rgba(8,11,20,0.97);
    backdrop-filter: blur(20px);
    padding: 28px var(--pad-x);
    flex-direction: column;
    align-items: flex-start;
    overflow-y: auto;
    z-index: 899;
    border-top: 1px solid var(--border);
  }
  .fp-nav__menu.is-open { display: flex; }
  .fp-nav__menu #fp-primary-menu {
    position: static;
    transform: none;
    background: none;
    backdrop-filter: none;
    border: none;
    padding: 0;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0;
    border-radius: 0;
  }
  .fp-nav__menu #fp-primary-menu li { width: 100%; border-bottom: 1px solid var(--border); }
  .fp-nav__menu #fp-primary-menu li a {
    padding: 16px 0;
    font-family: var(--ff-serif);
    font-size: 22px;
    border-radius: 0;
    display: block;
    color: var(--text);
  }
  .fp-nav__menu #fp-primary-menu li a:hover { background: none; color: var(--accent); }
  .fp-nav__cta { margin: 24px 0 0; width: 100%; justify-content: center; }

  .blog-grid { grid-template-columns: 1fr; }
  .fp-footer__nav { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 480px) {
  .fp-footer__nav { grid-template-columns: 1fr; }
}
