/* ═══════════════════════════════════════════════
   The Eternal Cluster — Main Stylesheet
   ═══════════════════════════════════════════════ */

:root {
  --void:     #0a0a10;
  --ink:      #13131d;
  --card:     #16161f;
  --line:     #262633;
  --crimson:  #c8102e;
  --ember:    #ff5a36;
  --gold:     #e8c477;
  --gold-dim: #b89a4a;
  --parchment:#f1e9d6;
  --ready:    #3fb950;
  --mute:     #8a8a9a;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, svg { max-width: 100%; height: auto; display: block; }

/* ── BASE ── */
body {
  background: var(--void);
  color: var(--parchment);
  font-family: "EB Garamond", Georgia, serif;
  font-size: 19px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--ember); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5, h6 {
  font-family: "Cinzel", serif;
  font-weight: 600;
  color: var(--parchment);
  line-height: 1.15;
  letter-spacing: .02em;
}
h1 { font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 1.2rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-bottom: 1rem; }
h3 { font-size: 1.35rem; margin-bottom: .8rem; color: var(--gold); }
h4 { font-size: 1.1rem; margin-bottom: .6rem; }
p  { margin-bottom: 1.1rem; color: #ded7c6; }
p:last-child { margin-bottom: 0; }

blockquote {
  border-left: 3px solid var(--gold);
  margin: 1.8rem 0;
  padding: .4rem 0 .4rem 1.4rem;
  font-style: italic;
  color: var(--gold);
  font-size: 1.15rem;
}
blockquote cite {
  display: block;
  font-style: normal;
  font-family: "IBM Plex Mono", monospace;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mute);
  margin-top: .6rem;
}
code, pre {
  font-family: "IBM Plex Mono", monospace;
  font-size: .85em;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
}
code { padding: .15em .4em; color: var(--ember); }
pre  { padding: 1.2rem; overflow-x: auto; color: #c0b898; line-height: 1.8; }
pre code { background: none; border: none; padding: 0; color: inherit; }

ul, ol { margin: 0 0 1.1rem 1.4rem; color: #ded7c6; }
ul li, ol li { margin-bottom: .35rem; }
hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.4rem 0;
}

/* ── LAYOUT ── */
.site-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.site-main  { flex: 1; }

.container       { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: 720px; margin: 0 auto; padding: 0 1.5rem; }

/* ── HEADER / NAV ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,10,16,.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: .8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-branding {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--parchment);
  text-decoration: none;
  flex: none;
}
.site-branding:hover { color: var(--gold); }
.site-branding .helm { width: 22px; height: 22px; }

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
}
.main-nav a {
  font-family: "IBM Plex Mono", monospace;
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mute);
}
.main-nav a:hover,
.main-nav .current-menu-item > a { color: var(--gold); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .4rem .7rem;
  color: var(--mute);
  font-family: "IBM Plex Mono", monospace;
  font-size: .72rem;
  cursor: pointer;
}

/* ── PAGE HERO ── */
.page-hero {
  background: radial-gradient(ellipse at 50% 0%, rgba(200,16,46,.12), transparent 60%);
  border-bottom: 1px solid var(--line);
  padding: 4.5rem 1.5rem 3.5rem;
  text-align: center;
}
.page-hero .eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: .68rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--crimson);
  display: block;
  margin-bottom: 1rem;
}
.page-hero .eyebrow::before { content: "// "; }
.page-hero h1 { color: var(--parchment); margin-bottom: .6rem; }
.page-hero .subtitle {
  font-style: italic;
  color: var(--gold);
  font-size: 1.15rem;
}

/* ── POST TYPE BADGE ── */
.type-badge {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: .22rem .55rem;
  margin-bottom: .8rem;
}
.type-badge--sermon        { color: var(--gold);   border: 1px solid rgba(232,196,119,.4); }
.type-badge--incident      { color: var(--crimson); border: 1px solid rgba(200,16,46,.4); }
.type-badge--wisdom        { color: var(--ready);   border: 1px solid rgba(63,185,80,.4); }

/* ── ARCHIVE GRID ── */
.archive-section { padding: 4rem 0 5rem; }
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
}
.post-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.8rem 1.6rem;
  display: flex;
  flex-direction: column;
  transition: border-color .22s, transform .22s;
}
.post-card:hover { border-color: var(--crimson); transform: translateY(-3px); }
.post-card .card-meta {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 1rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: .64rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mute);
}
.post-card h2 {
  font-size: 1.15rem;
  margin-bottom: .7rem;
  color: var(--parchment);
}
.post-card h2 a { color: inherit; }
.post-card h2 a:hover { color: var(--gold); }
.post-card .excerpt { font-size: .98rem; color: #c8c0ae; flex: 1; margin-bottom: 1.2rem; }
.read-more {
  font-family: "IBM Plex Mono", monospace;
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  align-self: flex-start;
}
.read-more:hover { color: var(--ember); }

/* ── SINGLE POST ── */
.single-post { padding: 4rem 0 5rem; }
.single-header { margin-bottom: 2.8rem; }
.single-header .post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .8rem;
  margin-bottom: 1.4rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mute);
}
.single-header h1 { margin-bottom: .8rem; }
.single-header .post-subtitle {
  font-style: italic;
  color: var(--gold);
  font-size: 1.15rem;
}

/* Post thumbnail */
.post-thumbnail {
  margin-bottom: 2.4rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.post-thumbnail img { width: 100%; }

/* Post content */
.entry-content { max-width: 680px; }
.entry-content p,
.entry-content li { color: #ded7c6; font-size: 1.08rem; }
.entry-content h2,
.entry-content h3,
.entry-content h4 { margin-top: 2rem; }

/* Incident report specific */
.incident-meta {
  background: var(--ink);
  border: 1px solid var(--line);
  border-left: 4px solid var(--crimson);
  border-radius: 8px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 2rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: .78rem;
  line-height: 1.9;
}
.incident-meta .im-row { display: grid; grid-template-columns: 130px 1fr; gap: .4rem; }
.incident-meta .im-key { color: var(--mute); }
.incident-meta .im-val { color: var(--parchment); }
.incident-meta .im-val.severity-high { color: var(--crimson); }
.incident-meta .im-val.severity-low  { color: var(--ready); }

/* Operator wisdom pull */
.wisdom-pull {
  margin: 2rem 0;
  padding: 1.4rem 1.6rem;
  background: var(--ink);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--gold);
}

/* Post footer / tags */
.post-footer {
  margin-top: 3rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
}
.tag-link {
  font-family: "IBM Plex Mono", monospace;
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mute);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .25rem .6rem;
  transition: border-color .18s, color .18s;
}
.tag-link:hover { border-color: var(--gold); color: var(--gold); }

/* ── COMMENTS ── */
.comments-section {
  max-width: 680px;
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--line);
}
.comments-title {
  font-family: "Cinzel", serif;
  font-size: 1.3rem;
  color: var(--parchment);
  margin-bottom: 2rem;
}
.comments-title::before {
  content: "// ";
  font-family: "IBM Plex Mono", monospace;
  font-size: .8rem;
  color: var(--crimson);
  letter-spacing: .14em;
}

/* Comment list */
.comment-list { list-style: none; padding: 0; margin: 0 0 3rem; }
.comment { padding: 1.4rem 0; border-top: 1px solid var(--line); }
.comment .comment-author {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: .7rem;
}
.comment .avatar { border-radius: 50%; border: 1px solid var(--line); }
.comment .fn {
  font-family: "Cinzel", serif;
  font-size: .95rem;
  color: var(--parchment);
}
.comment .comment-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mute);
  margin-top: .15rem;
}
.comment .comment-body p { font-size: 1rem; }
.comment .reply a {
  font-family: "IBM Plex Mono", monospace;
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mute);
  margin-top: .5rem;
  display: inline-block;
}
.comment .reply a:hover { color: var(--gold); }
.children { padding-left: 2rem; border-left: 1px solid var(--line); margin-top: .5rem; }

/* Comment form */
.comment-respond { margin-top: 2rem; }
.comment-reply-title {
  font-family: "Cinzel", serif;
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: 1.4rem;
}
.comment-form label {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .5rem;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--parchment);
  font-family: "EB Garamond", serif;
  font-size: 1rem;
  padding: .75rem 1rem;
  margin-bottom: 1.2rem;
  transition: border-color .2s;
}
.comment-form input:focus,
.comment-form textarea:focus { outline: none; border-color: var(--crimson); }
.comment-form textarea { min-height: 140px; resize: vertical; }
.comment-form .form-submit { margin-top: .5rem; }
.comment-form .submit,
.btn {
  background: var(--crimson);
  color: var(--parchment);
  border: none;
  border-radius: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: .76rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: .9rem 1.8rem;
  cursor: pointer;
  transition: background .2s;
}
.comment-form .submit:hover,
.btn:hover { background: var(--ember); }

/* ── PAGINATION ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: .6rem;
  padding: 3rem 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: .74rem;
  letter-spacing: .1em;
}
.pagination a,
.pagination span {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .55rem .9rem;
  color: var(--mute);
}
.pagination a:hover { border-color: var(--gold); color: var(--gold); }
.pagination .current { border-color: var(--crimson); color: var(--parchment); }

/* ── SIDEBAR ── */
.content-sidebar { display: grid; grid-template-columns: 1fr 280px; gap: 3rem; padding: 4rem 0 5rem; }
.widget { margin-bottom: 2.4rem; }
.widget-title {
  font-family: "IBM Plex Mono", monospace;
  font-size: .68rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--line);
}
.widget-title::before { content: "// "; color: var(--crimson); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li {
  padding: .4rem 0;
  border-bottom: 1px solid var(--line);
  font-size: .95rem;
  color: #ded7c6;
}
.widget ul li a { color: #ded7c6; }
.widget ul li a:hover { color: var(--gold); }

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.5rem;
  text-align: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: .68rem;
  letter-spacing: .12em;
  color: var(--mute);
}
.site-footer a { color: var(--mute); }
.site-footer a:hover { color: var(--gold); }
.footer-nav { display: flex; justify-content: center; gap: 1.4rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* ── NO POSTS ── */
.no-results {
  text-align: center;
  padding: 5rem 1.5rem;
  color: var(--mute);
  font-style: italic;
}
.no-results .mono {
  font-family: "IBM Plex Mono", monospace;
  font-size: .8rem;
  color: var(--crimson);
  margin-bottom: 1rem;
  display: block;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .content-sidebar { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
@media (max-width: 680px) {
  .archive-grid { grid-template-columns: 1fr; }
  .main-nav { display: none; }
  .main-nav.open { display: block; position: absolute; top: 100%; left: 0; right: 0; background: var(--ink); border-bottom: 1px solid var(--line); padding: 1rem 1.5rem; }
  .main-nav.open ul { flex-direction: column; gap: .8rem; }
  .nav-toggle { display: block; }
  .site-header { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
