/* ============================================================
   Denali Llama — editorial theme
   v1.0.0
   ============================================================ */

:root {
  /* Midnight Authority palette */
  --dl-charcoal: #1A1F2A;
  --dl-charcoal-soft: #1C1F26;
  --dl-ivory: #F2F0EB;
  --dl-paper: #FBFAF6;
  --dl-gold: #C8973E;
  --dl-gold-light: #D4B36B;
  --dl-gold-lighter: #E2C987;

  /* Text */
  --dl-text: #1C1F26;
  --dl-text-soft: #4A4F58;
  --dl-text-muted: #6B7280;
  --dl-text-dim: #8B8680;
  --dl-text-onDark: #F2F0EB;
  --dl-text-onDark-dim: #B8B5AC;

  /* Rules + borders */
  --dl-rule: #D8D4C8;
  --dl-rule-strong: #BFB9A8;

  /* Typography */
  --dl-serif: Georgia, 'Times New Roman', 'Cambria', serif;
  --dl-sans: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Segoe UI', system-ui, sans-serif;
  --dl-mono: 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', monospace;

  /* Layout */
  --dl-content-max: 1100px;
  --dl-reading-max: 680px;
  --dl-gutter: 24px;
}

/* ============================================================
   Reset + base
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--dl-serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--dl-text);
  background: var(--dl-ivory);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--dl-gold); }

/* Editorial titles: lock to charcoal regardless of inherited a-color */
.home-lead .headline a,
.post-header h1 a,
.archive-item .title a,
.section-row .section-meta h3 a,
.section-row .section-items .item h4 a,
.read-next .item h4 a,
.static-page h1 a {
  color: var(--dl-text);
}
.home-lead .headline a:hover,
.post-header h1 a:hover,
.archive-item .title a:hover,
.section-row .section-meta h3 a:hover,
.section-row .section-items .item h4 a:hover,
.read-next .item h4 a:hover {
  color: var(--dl-gold);
}

button { font-family: inherit; cursor: pointer; }

/* ============================================================
   Site header
   ============================================================ */

.site-header {
  background: var(--dl-charcoal);
  padding: 18px 32px;
}
.site-header-inner {
  max-width: var(--dl-content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.site-brand .mark {
  display: block;
  width: 48px;
  height: 32px;
}
.site-brand .wordmark {
  font-family: var(--dl-serif);
  font-weight: 700;
  letter-spacing: 1.2px;
  line-height: 0.95;
}
.site-brand .wordmark .d {
  display: block;
  color: var(--dl-text-onDark);
  font-size: 15px;
}
.site-brand .wordmark .l {
  display: block;
  color: var(--dl-gold);
  font-size: 15px;
}

.site-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}
.site-nav a {
  font-family: var(--dl-sans);
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--dl-text-onDark-dim);
  transition: color 0.15s ease;
}
.site-nav a:hover,
.site-nav a.is-current {
  color: var(--dl-gold);
}

/* Sign in / Account link — subtly separated from the nav items */
.site-signin {
  font-family: var(--dl-sans);
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--dl-text-onDark-dim);
  padding-left: 22px;
  margin-left: 0;
  border-left: 1px solid rgba(184, 181, 172, 0.22);
  transition: color 0.15s ease;
}
.site-signin:hover { color: var(--dl-gold); }

.site-nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: var(--dl-text-onDark);
  padding: 4px 8px;
  font-size: 18px;
}

/* ============================================================
   Site footer
   ============================================================ */

.site-footer {
  background: var(--dl-charcoal);
  padding: 22px 32px;
  margin-top: 80px;
}
.site-footer-inner {
  max-width: var(--dl-content-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.site-footer-inner span,
.site-footer-inner a {
  font-family: var(--dl-sans);
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--dl-text-onDark-dim);
  text-transform: uppercase;
}
.site-footer-inner a:hover { color: var(--dl-gold); }
.site-footer-links { display: flex; gap: 22px; }

/* ============================================================
   Main container
   ============================================================ */

.site-main {
  max-width: var(--dl-content-max);
  margin: 0 auto;
  padding: 48px 32px 0;
}

/* ============================================================
   Homepage — lead + section rows
   ============================================================ */

.home-lead {
  margin-bottom: 8px;
}
.home-lead .eyebrow {
  font-family: var(--dl-sans);
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--dl-gold);
  font-weight: 600;
  margin-bottom: 14px;
}
.home-lead .headline {
  font-family: var(--dl-serif);
  font-size: 42px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 18px;
  color: var(--dl-text);
}
.home-lead .headline a:hover { color: var(--dl-text); border-bottom: 2px solid var(--dl-gold); }
.home-lead .standfirst {
  font-family: var(--dl-serif);
  font-size: 18px;
  line-height: 1.55;
  color: var(--dl-text-soft);
  font-style: italic;
  margin: 0 0 18px;
  max-width: 760px;
}
.home-lead .byline {
  font-family: var(--dl-sans);
  font-size: 11px;
  letter-spacing: 0.8px;
  color: var(--dl-text-muted);
  text-transform: uppercase;
}

.home-rule {
  height: 1px;
  background: var(--dl-rule);
  margin: 40px 0 32px;
  border: 0;
}

.section-row {
  display: grid;
  grid-template-columns: 1fr 2.2fr;
  gap: 48px;
  margin-bottom: 8px;
}
.section-row .section-meta h3 {
  font-family: var(--dl-serif);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--dl-text);
}
.section-row .section-meta h3 a:hover { color: var(--dl-gold); }
.section-row .section-meta p {
  font-family: var(--dl-serif);
  font-size: 14px;
  line-height: 1.55;
  color: var(--dl-text-muted);
  font-style: italic;
  margin: 0;
}
.section-row .section-meta .all-link {
  font-family: var(--dl-sans);
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--dl-gold);
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 14px;
  display: inline-block;
}
.section-row .section-meta .all-link:hover { color: var(--dl-text); }

.section-row .section-items .item {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 0.5px solid var(--dl-rule);
}
.section-row .section-items .item:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}
.section-row .section-items .item h4 {
  font-family: var(--dl-serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 6px;
}
.section-row .section-items .item h4 a:hover { color: var(--dl-gold); }
.section-row .section-items .item .excerpt {
  font-family: var(--dl-serif);
  font-size: 15px;
  line-height: 1.5;
  color: var(--dl-text-soft);
  margin: 0 0 8px;
}
.section-row .section-items .item .meta {
  font-family: var(--dl-sans);
  font-size: 10px;
  letter-spacing: 0.8px;
  color: var(--dl-text-dim);
  text-transform: uppercase;
}

/* ============================================================
   Section page (tag.hbs) + author page
   ============================================================ */

.section-page-header,
.author-page-header {
  margin-bottom: 32px;
  max-width: var(--dl-reading-max);
}
.section-page-header .eyebrow,
.author-page-header .eyebrow {
  font-family: var(--dl-sans);
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--dl-gold);
  font-weight: 600;
  margin-bottom: 12px;
}
.section-page-header .title,
.author-page-header .title {
  font-family: var(--dl-serif);
  font-size: 52px;
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.7px;
  margin: 0 0 18px;
  color: var(--dl-text);
}
.section-page-header .standfirst,
.author-page-header .standfirst {
  font-family: var(--dl-serif);
  font-size: 18px;
  line-height: 1.55;
  color: var(--dl-text-soft);
  font-style: italic;
  margin: 0;
  max-width: 600px;
}

.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.archive-item {
  padding: 22px 0;
  border-bottom: 0.5px solid var(--dl-rule);
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 28px;
  align-items: baseline;
}
.archive-item .date {
  font-family: var(--dl-sans);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--dl-text-dim);
  text-transform: uppercase;
  padding-top: 6px;
}
.archive-item .title {
  font-family: var(--dl-serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--dl-text);
}
.archive-item .title a:hover { color: var(--dl-gold); }
.archive-item .excerpt {
  font-family: var(--dl-serif);
  font-size: 15px;
  line-height: 1.55;
  color: var(--dl-text-soft);
  margin: 0;
}

/* ============================================================
   Post page (post.hbs)
   ============================================================ */

.post {
  max-width: var(--dl-reading-max);
  margin: 0 auto;
  padding: 0 8px;
}
.post-header {
  margin-bottom: 36px;
}
.post-header .eyebrow {
  font-family: var(--dl-sans);
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--dl-gold);
  font-weight: 600;
  margin-bottom: 16px;
}
.post-header .eyebrow a:hover { color: var(--dl-text); }
.post-header h1 {
  font-family: var(--dl-serif);
  font-size: 40px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 20px;
  color: var(--dl-text);
}
.post-header .standfirst {
  font-family: var(--dl-serif);
  font-size: 19px;
  line-height: 1.55;
  color: var(--dl-text-soft);
  font-style: italic;
  margin: 0 0 24px;
}
.post-header .byline {
  font-family: var(--dl-sans);
  font-size: 11px;
  letter-spacing: 0.8px;
  color: var(--dl-text-muted);
  text-transform: uppercase;
  padding-bottom: 18px;
  border-bottom: 0.5px solid var(--dl-rule);
}
.post-header .byline .sep { margin: 0 10px; color: var(--dl-rule-strong); }

.post-feature-image {
  margin: 0 -60px 36px;
}
.post-feature-image img {
  width: 100%;
  border-radius: 2px;
}
.post-feature-image figcaption {
  font-family: var(--dl-sans);
  font-size: 11px;
  letter-spacing: 0.3px;
  color: var(--dl-text-dim);
  text-align: center;
  margin-top: 10px;
}

/* Post body typography */
.post-content {
  font-family: var(--dl-serif);
  font-size: 19px;
  line-height: 1.72;
  color: var(--dl-text);
}
.post-content > * { margin-top: 0; margin-bottom: 1.2em; }
.post-content p { margin: 0 0 1.2em; }
.post-content h2 {
  font-family: var(--dl-serif);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.3px;
  margin: 2em 0 0.6em;
  color: var(--dl-text);
}
.post-content h3 {
  font-family: var(--dl-serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  margin: 1.8em 0 0.5em;
  color: var(--dl-text);
}
.post-content h4 {
  font-family: var(--dl-sans);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--dl-text-soft);
  margin: 1.8em 0 0.6em;
}
.post-content a {
  color: var(--dl-text);
  border-bottom: 1px solid var(--dl-gold);
  padding-bottom: 1px;
}
.post-content a:hover { color: var(--dl-gold); }
.post-content strong { font-weight: 700; }
.post-content em { font-style: italic; }
.post-content ul, .post-content ol { padding-left: 1.4em; margin: 1em 0 1.4em; }
.post-content li { margin-bottom: 0.5em; }
.post-content blockquote {
  margin: 1.6em 0;
  padding: 0 0 0 22px;
  border-left: 3px solid var(--dl-gold);
  font-style: italic;
  color: var(--dl-text-soft);
  font-size: 20px;
  line-height: 1.55;
}
.post-content hr {
  border: 0;
  height: 1px;
  background: var(--dl-rule);
  margin: 2.4em auto;
  width: 60%;
}
.post-content pre {
  background: var(--dl-charcoal);
  color: var(--dl-text-onDark);
  padding: 18px 22px;
  border-radius: 4px;
  font-family: var(--dl-mono);
  font-size: 14px;
  line-height: 1.55;
  overflow-x: auto;
  margin: 1.4em 0;
}
.post-content code {
  font-family: var(--dl-mono);
  font-size: 0.88em;
  background: rgba(200, 151, 62, 0.1);
  padding: 2px 6px;
  border-radius: 2px;
  color: var(--dl-charcoal);
}
.post-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 14px;
}
.post-content figure { margin: 1.8em 0; }
.post-content figure img { width: 100%; border-radius: 2px; }
.post-content figcaption {
  font-family: var(--dl-sans);
  font-size: 12px;
  color: var(--dl-text-dim);
  text-align: center;
  margin-top: 10px;
  letter-spacing: 0.3px;
}

/* Koenig editor card sizing */
.post-content .kg-width-wide,
.post-content figure.kg-width-wide {
  margin-left: -80px;
  margin-right: -80px;
  max-width: calc(100% + 160px);
}
.post-content .kg-width-wide img,
.post-content figure.kg-width-wide img {
  width: 100%;
}
.post-content .kg-width-full,
.post-content figure.kg-width-full {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  max-width: 100vw;
  width: 100vw;
}
.post-content .kg-width-full img,
.post-content figure.kg-width-full img {
  width: 100%;
  border-radius: 0;
}
.post-content .kg-image-card { margin: 1.8em 0; }
.post-content .kg-embed-card { margin: 1.8em 0; }
.post-content .kg-gallery-card { margin: 1.8em 0; }
.post-content .kg-bookmark-card { margin: 1.8em 0; }
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 15px;
}
.post-content th, .post-content td {
  border-bottom: 0.5px solid var(--dl-rule);
  padding: 10px 14px;
  text-align: left;
}
.post-content th {
  font-family: var(--dl-sans);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--dl-text-muted);
}

/* Author bio after post */
.post-author-bio {
  max-width: var(--dl-reading-max);
  margin: 56px auto 0;
  padding: 28px 8px 0;
  border-top: 1px solid var(--dl-rule);
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.post-author-bio .avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--dl-charcoal);
  color: var(--dl-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--dl-serif);
  font-weight: 700;
  font-size: 22px;
  flex-shrink: 0;
  overflow: hidden;
}
.post-author-bio .avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-author-bio .meta { flex: 1; }
.post-author-bio .meta .name {
  font-family: var(--dl-serif);
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 4px;
}
.post-author-bio .meta .name a:hover { color: var(--dl-gold); }
.post-author-bio .meta .bio {
  font-family: var(--dl-serif);
  font-size: 15px;
  line-height: 1.55;
  color: var(--dl-text-soft);
  margin: 0;
}

/* Read next */
.read-next {
  max-width: var(--dl-reading-max);
  margin: 56px auto 0;
  padding: 0 8px;
}
.read-next .eyebrow {
  font-family: var(--dl-sans);
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--dl-text-muted);
  font-weight: 600;
  margin-bottom: 18px;
}
.read-next .items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.read-next .item h4 {
  font-family: var(--dl-serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 6px;
}
.read-next .item h4 a:hover { color: var(--dl-gold); }
.read-next .item .meta {
  font-family: var(--dl-sans);
  font-size: 10px;
  letter-spacing: 0.8px;
  color: var(--dl-text-dim);
  text-transform: uppercase;
}

/* ============================================================
   Static page (page.hbs)
   ============================================================ */

.static-page {
  max-width: var(--dl-reading-max);
  margin: 0 auto;
  padding: 0 8px;
}
.static-page h1 {
  font-family: var(--dl-serif);
  font-size: 44px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.5px;
  margin: 0 0 36px;
  color: var(--dl-text);
}
.static-page .content {
  font-family: var(--dl-serif);
  font-size: 18px;
  line-height: 1.72;
  color: var(--dl-text);
}
.static-page .content p { margin: 0 0 1.2em; }
.static-page .content h2 {
  font-family: var(--dl-serif);
  font-size: 26px;
  margin: 1.6em 0 0.5em;
}
.static-page .content a {
  color: var(--dl-text);
  border-bottom: 1px solid var(--dl-gold);
}
.static-page .content a:hover { color: var(--dl-gold); }

/* ============================================================
   Error page
   ============================================================ */

.error-page {
  max-width: var(--dl-reading-max);
  margin: 0 auto;
  padding: 60px 8px;
  text-align: center;
}
.error-page .code {
  font-family: var(--dl-serif);
  font-size: 96px;
  font-weight: 700;
  color: var(--dl-gold);
  line-height: 1;
  margin: 0 0 12px;
}
.error-page h1 {
  font-family: var(--dl-serif);
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 12px;
}
.error-page p {
  font-family: var(--dl-serif);
  font-size: 17px;
  color: var(--dl-text-soft);
  margin: 0 0 28px;
}
.error-page .home-link {
  font-family: var(--dl-sans);
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--dl-gold);
  font-weight: 600;
}

/* ============================================================
   Pagination
   ============================================================ */

.pagination {
  max-width: var(--dl-content-max);
  margin: 48px auto 0;
  padding: 24px 32px 0;
  border-top: 0.5px solid var(--dl-rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pagination a, .pagination span {
  font-family: var(--dl-sans);
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--dl-text-muted);
  font-weight: 500;
}
.pagination a:hover { color: var(--dl-gold); }
.pagination .page-number { color: var(--dl-text-dim); }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 900px) {
  .home-lead .headline { font-size: 34px; }
  .section-page-header .title,
  .author-page-header .title { font-size: 40px; }
  .post-header h1 { font-size: 32px; }
  .post-feature-image { margin-left: 0; margin-right: 0; }
}

@media (max-width: 720px) {
  body { font-size: 17px; }
  .site-header { padding: 14px 20px; }
  .site-header-inner { gap: 16px; }
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--dl-charcoal);
    flex-direction: column;
    gap: 4px;
    padding: 12px 20px 20px;
    z-index: 100;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 10px 0; }
  .site-signin {
    padding-left: 0;
    margin-left: 0;
    border-left: 0;
    border-top: 1px solid rgba(184, 181, 172, 0.22);
    margin-top: 6px;
    padding-top: 16px;
  }
  .site-nav-toggle { display: block; }

  .site-main { padding: 32px 20px 0; }

  .home-lead .headline { font-size: 28px; letter-spacing: -0.3px; }
  .home-lead .standfirst { font-size: 16px; }

  .section-row {
    grid-template-columns: 1fr;
    gap: 22px;
    margin-bottom: 0;
  }
  .section-row .section-meta { padding-bottom: 6px; }
  .home-rule { margin: 32px 0 28px; }

  .section-page-header .title,
  .author-page-header .title { font-size: 32px; }
  .section-page-header .standfirst,
  .author-page-header .standfirst { font-size: 16px; }

  .archive-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .archive-item .date { padding-top: 0; }
  .archive-item .title { font-size: 20px; }

  .post-header h1 { font-size: 28px; }
  .post-header .standfirst { font-size: 17px; }
  .post-content { font-size: 17px; line-height: 1.7; }
  .post-content h2 { font-size: 24px; }
  .post-content h3 { font-size: 19px; }
  .post-content blockquote { font-size: 18px; }

  .read-next .items { grid-template-columns: 1fr; gap: 22px; }

  .static-page h1 { font-size: 32px; }

  .site-footer { padding: 18px 20px; margin-top: 56px; }
  .site-footer-inner { gap: 14px; }
}
