/* ════════════════════════════════════════════════════════════════════
   themisf.it — Ghost theme stylesheet

   Font architecture
   ─────────────────
   --gh-font-heading  →  Ghost admin "Heading font" (display serif)
   --gh-font-body     →  Ghost admin "Body font" (running serif)
   --font-mono        →  theme-controlled monospace (meta, labels, code)

   Color architecture
   ──────────────────
   --accent  →  Ghost admin "Accent color" if set, else terracotta default
   ════════════════════════════════════════════════════════════════════ */

:root {
  /* Fonts — admin-controllable for serif, theme-controlled for mono */
  --gh-font-heading: 'Fraunces', Georgia, 'Times New Roman', serif;
  --gh-font-body: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Palette */
  --bg: #F4EFE6;
  --bg-deep: #ECE4D2;
  --text: #1C1814;
  --text-muted: #6E6256;
  --text-faint: #A39885;
  --accent: var(--ghost-accent-color, #B8472A);
  --olive: #5F6B2A;
  --slate: #3D5A7A;
  --gold: #8B6914;
  --burgundy: #6B2828;
  --rule: #D9CFB8;
  --code-bg: #2A2520;
  --code-text: #ECE4D2;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--gh-font-body);
  font-variation-settings: "opsz" 14, "SOFT" 50;
  font-size: 22px;
  line-height: 1.65;
  background-image:
    radial-gradient(circle at 12% 6%, rgba(184, 71, 42, 0.05) 0%, transparent 38%),
    radial-gradient(circle at 88% 94%, rgba(95, 107, 42, 0.045) 0%, transparent 38%);
  min-height: 100vh;
}

.wrap { max-width: 1300px; margin: 0 auto; padding: 1.75rem 1.75rem 5rem; }

/* ───── Top bar ───── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0 1.25rem;
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  font-family: var(--gh-font-heading);
  font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 450;
  font-size: 25px;
  letter-spacing: -0.4px;
  color: var(--text);
  text-decoration: none;
}
.wordmark .dot { color: var(--accent); margin: 0 0.5px; }

nav {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
nav a:hover { color: var(--accent); }

/* ───── Hero (homepage) ───── */
.hero { padding: 5.5rem 0 4.5rem; max-width: 1025px; }
.hero h1 {
  font-family: var(--gh-font-heading);
  font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 380;
  font-size: 75px;
  line-height: 1.04;
  letter-spacing: -0.028em;
  margin-bottom: 2rem;
  font-weight: 400;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 320;
}
.hero .ornament {
  font-family: var(--gh-font-heading);
  font-style: italic;
  font-size: 35px;
  color: var(--accent);
  opacity: 0.55;
  margin: 0 0 1.75rem;
  letter-spacing: 0.4em;
  line-height: 1;
}
.hero p.intro {
  font-family: var(--gh-font-body);
  font-size: 22px;
  color: var(--text-muted);
  max-width: 52ch;
  line-height: 1.6;
  font-variation-settings: "opsz" 18, "SOFT" 80, "wght" 400;
}

/* Tag archive kicker */
.kicker-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

/* ───── Section divider ───── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 3rem 0 2.5rem;
}
.section-divider::before {
  content: '';
  flex: 0 0 40px;
  height: 1px;
  background: var(--rule);
}
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}
.section-divider .label {
  font-family: var(--font-mono);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 500;
}

/* ───── Mosaic ───── */
.mosaic {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 2.5rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

/* Featured (left) */
.featured-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}
.featured-meta .date { color: var(--text-faint); }
.featured-meta .bullet {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
  display: inline-block;
}
.featured h2 {
  font-family: var(--gh-font-heading);
  font-variation-settings: "opsz" 144, "SOFT" 80, "wght" 500;
  font-size: 45px;
  line-height: 1.12;
  letter-spacing: -0.018em;
  margin-bottom: 1.5rem;
}
.featured h2 a {
  color: var(--text);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s ease, color 0.2s ease;
}
.featured h2 a:hover {
  color: var(--accent);
  background-size: 100% 1.5px;
}
.featured p.lede {
  font-family: var(--gh-font-body);
  font-size: 21px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  font-variation-settings: "opsz" 18, "SOFT" 80, "wght" 400;
}
.featured p.lede::first-letter {
  font-family: var(--gh-font-heading);
  font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 500;
  font-size: 75px;
  float: left;
  line-height: 0.82;
  margin: 8px 10px -2px 0;
  color: var(--accent);
}
.featured p.lede.no-drop-cap::first-letter {
  font-family: inherit;
  font-size: inherit;
  float: none;
  line-height: inherit;
  margin: 0;
  color: inherit;
  font-variation-settings: inherit;
}
.continue {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, gap 0.2s ease;
}
.continue:hover {
  border-bottom-color: var(--accent);
  gap: 0.75rem;
}

/* Side column */
.mosaic-side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-left: 2.5rem;
  border-left: 1px solid var(--rule);
  margin-left: -2.5rem;
}
.side-post {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.side-post:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.side-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.75rem;
  display: flex;
  gap: 0.85rem;
  align-items: center;
}
.side-meta .date { color: var(--text-faint); }
.side-meta .bullet {
  width: 2.5px; height: 2.5px;
  border-radius: 50%;
  background: var(--text-faint);
  display: inline-block;
}
.side-post h3 {
  font-family: var(--gh-font-heading);
  font-variation-settings: "opsz" 80, "SOFT" 60, "wght" 500;
  font-size: 28px;
  line-height: 1.22;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  font-weight: 500;
}
.side-post h3 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}
.side-post h3 a:hover { color: var(--accent); }
.side-post p {
  font-family: var(--gh-font-body);
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.55;
  font-variation-settings: "opsz" 14, "SOFT" 80, "wght" 400;
}

/* ───── Tag colors ───── */
/* Map tag slugs → colors. Add new tags here as you create them. */
.tag.technical, .ml-tag.technical { color: var(--olive); font-weight: 500; }
.tag.it-operations, .ml-tag.it-operations { color: var(--slate); font-weight: 500; }
.tag.leadership, .ml-tag.leadership { color: var(--gold); font-weight: 500; }
.tag.security, .ml-tag.security { color: var(--burgundy); font-weight: 500; }
.tag.personal, .ml-tag.personal { color: var(--accent); font-weight: 500; }
.tag, .ml-tag { color: var(--text-muted); font-weight: 500; }

/* ───── More list (tail) ───── */
.more-list {
  list-style: none;
  margin: 0.5rem 0 0;
}
.more-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}
.more-list li:first-child { border-top: 1px solid var(--rule); }
.more-list .ml-title {
  font-family: var(--gh-font-heading);
  font-variation-settings: "opsz" 60, "SOFT" 50, "wght" 500;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.005em;
  font-weight: 500;
}
.more-list .ml-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}
.more-list .ml-title a:hover { color: var(--accent); }
.more-list .ml-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}
.more-list .ml-date {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-faint);
  white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════════════
   Single post / page
   ════════════════════════════════════════════════════════════════════ */

.single-post {
  max-width: 850px;
  margin: 4rem auto 0;
  padding: 0;
}

.post-header {
  margin-bottom: 3rem;
}
.post-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
  color: var(--text-faint);
}
.post-meta .date { color: var(--text-faint); }
.post-meta .bullet {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
  display: inline-block;
}
.post-title {
  font-family: var(--gh-font-heading);
  font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 420;
  font-size: 65px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
  font-weight: 400;
}
.post-subtitle {
  font-family: var(--gh-font-heading);
  font-variation-settings: "opsz" 80, "SOFT" 80, "wght" 350;
  font-style: italic;
  font-size: 28px;
  line-height: 1.4;
  color: var(--text-muted);
  max-width: 56ch;
}
.static-page .post-title { font-size: 55px; }

.post-feature-image {
  margin: 0 0 3rem;
}
.post-feature-image img {
  width: 100%;
  height: auto;
  border-radius: 2px;
  display: block;
}
.post-feature-image figcaption {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-faint);
  margin-top: 0.75rem;
  letter-spacing: 0.5px;
}

/* ───── Post content ───── */
.post-content {
  font-family: var(--gh-font-body);
  font-size: 22px;
  line-height: 1.7;
  font-variation-settings: "opsz" 18, "SOFT" 80, "wght" 400;
}
.post-content > * + * { margin-top: 1.25rem; }
.post-content > h2 + *, .post-content > h3 + *, .post-content > h4 + * {
  margin-top: 0.75rem;
}

.post-content p {
  color: var(--text);
}

.post-content h2 {
  font-family: var(--gh-font-heading);
  font-variation-settings: "opsz" 100, "SOFT" 80, "wght" 500;
  font-size: 38px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-top: 3rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.post-content h3 {
  font-family: var(--gh-font-heading);
  font-variation-settings: "opsz" 60, "SOFT" 60, "wght" 500;
  font-size: 28px;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.post-content h4 {
  font-family: var(--font-mono);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 500;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.post-content a {
  color: var(--text);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 100% 1px;
  background-position: 0 95%;
  background-repeat: no-repeat;
  transition: color 0.2s ease;
}
.post-content a:hover { color: var(--accent); }

.post-content blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  font-variation-settings: "opsz" 18, "SOFT" 100, "wght" 380;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1.55;
}
.post-content blockquote p { color: var(--text-muted); }

.post-content ul, .post-content ol {
  padding-left: 1.5rem;
}
.post-content li { margin-bottom: 0.4rem; }
.post-content li::marker { color: var(--accent); }

.post-content hr {
  border: 0;
  text-align: center;
  margin: 3rem 0;
}
.post-content hr::before {
  content: '· · ·';
  font-family: var(--gh-font-heading);
  font-style: italic;
  font-size: 28px;
  color: var(--accent);
  opacity: 0.55;
  letter-spacing: 0.4em;
}

/* Inline code */
.post-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-deep);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  color: var(--text);
}

/* Code blocks */
.post-content pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1.25rem 1.5rem;
  border-radius: 4px;
  margin: 2rem 0;
  overflow-x: auto;
  font-size: 18px;
  line-height: 1.6;
  border-left: 3px solid var(--accent);
  font-family: var(--font-mono);
}
.post-content pre code {
  background: transparent;
  padding: 0;
  color: var(--code-text);
  font-size: 18px;
  font-family: var(--font-mono);
}

/* Images */
.post-content figure {
  margin: 2.5rem 0;
}
.post-content figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}
.post-content figcaption {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-faint);
  margin-top: 0.75rem;
  letter-spacing: 0.5px;
}

/* Ghost image card widths */
.post-content .kg-width-wide {
  width: calc(100% + 4rem);
  max-width: calc(100% + 4rem);
  margin-left: -2rem;
  margin-right: -2rem;
}
.post-content .kg-width-full {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  max-width: 100vw;
}
.post-content .kg-width-full img {
  border-radius: 0;
}
@media (max-width: 760px) {
  .post-content .kg-width-wide {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Ghost callout card */
.post-content .kg-callout-card {
  background: var(--bg-deep);
  padding: 1.25rem 1.5rem;
  border-radius: 4px;
  margin: 2rem 0;
  border-left: 3px solid var(--olive);
}

/* Ghost bookmark card */
.post-content .kg-bookmark-card {
  margin: 2rem 0;
}
.post-content .kg-bookmark-container {
  display: flex;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  background: var(--bg-deep);
  transition: border-color 0.2s ease;
}
.post-content .kg-bookmark-container:hover { border-color: var(--accent); background-image: none; }
.post-content .kg-bookmark-content { flex: 1; padding: 1rem 1.25rem; }
.post-content .kg-bookmark-title {
  font-family: var(--gh-font-heading);
  font-weight: 500;
  font-size: 20px;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.post-content .kg-bookmark-description {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-content .kg-bookmark-metadata {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-faint);
  margin-top: 0.6rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.post-content .kg-bookmark-thumbnail { flex: 0 0 140px; }
.post-content .kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

/* ───── Post footer ───── */
.post-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.post-footer-label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-faint);
  margin-right: 0.5rem;
}
.tag-link {
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.tag-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.post-related {
  max-width: 1300px;
  margin: 5rem auto 0;
}

/* ───── Site footer ───── */
footer {
  margin-top: 4.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-faint);
}
footer .links {
  display: flex;
  gap: 1.5rem;
}
footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
footer a:hover { color: var(--accent); }

/* ───── Pagination ───── */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.pagination a {
  color: var(--accent);
  text-decoration: none;
}
.pagination .page-number { color: var(--text-faint); }

/* ───── Error page ───── */
.error-page {
  text-align: center;
  padding: 6rem 0;
}
.error-page .error-code {
  font-family: var(--gh-font-heading);
  font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 350;
  font-size: 150px;
  line-height: 1;
  color: var(--accent);
  margin-bottom: 1rem;
  font-weight: 400;
}
.error-page .error-message {
  font-family: var(--gh-font-heading);
  font-size: 35px;
  margin-bottom: 2rem;
  color: var(--text);
}
.error-page .error-link {
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

/* ───── Responsive ───── */
@media (max-width: 760px) {
  .mosaic {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .mosaic-side {
    padding-left: 0;
    border-left: 0;
    margin-left: 0;
    padding-top: 2rem;
    border-top: 1px solid var(--rule);
  }
}
@media (max-width: 640px) {
  .wrap { padding: 1.25rem 1.25rem 3.5rem; }
  .hero { padding: 3.5rem 0 3rem; }
  .hero h1 { font-size: 48px; }
  .hero .ornament { font-size: 28px; }
  .featured h2 { font-size: 35px; }
  .featured p.lede::first-letter { font-size: 60px; }
  .post-title { font-size: 45px; }
  .post-subtitle { font-size: 22px; }
  .post-content { font-size: 21px; }
  .post-content h2 { font-size: 32px; }
  .error-page .error-code { font-size: 100px; }
  .error-page .error-message { font-size: 28px; }
  .more-list li {
    grid-template-columns: 1fr auto;
    row-gap: 0.4rem;
  }
  .more-list .ml-tag { grid-column: 1; grid-row: 2; }
  .more-list .ml-date { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  nav { gap: 1rem; }
  footer { flex-direction: column; gap: 1rem; align-items: flex-start; }
}
