/* HAIL editorial theme
   Ported from blog-builder/template-post.html and template-index.html.
   Palette and type from hail/brand/hail-brand-tokens.css. */

:root {
  --black: #0F1115;
  --sage: #A8B5A2;
  --sage-dark: #8A9A84;
  --sage-deep: #62725A;   /* links and buttons only. See note below. */
  --cream: #F5F3EF;
  --warm-white: #FAF9F7;
  --sand: #E8E4DE;
  --gold: #C2A46D;
  --text: #2A2A2A;
  --text-muted: #6B6B6B;
  --text-soft: #9B9B9B;
  --border: rgba(15, 17, 21, 0.08);

  /* Ghost injects --gh-font-heading and --gh-font-body when a font is chosen in
     admin. Honour that choice if made, otherwise hold the brand faces. */
  --font-display: var(--gh-font-heading, 'Cormorant Garamond', Georgia, 'Times New Roman', serif);
  --font-body: var(--gh-font-body, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif);

  --measure: 720px;
}

/* --sage-deep exists because the brand sage is a surface colour, not a text
   colour. On the cream ground, --sage is 1.93:1 and --sage-dark is 2.69:1,
   both well under the 4.5:1 that body-size text needs. --sage-deep holds the
   same hue and saturation at 4.65:1 on cream and 5.15:1 behind white text,
   so links and buttons stay legible and stay on brand. */

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.6;
  background: var(--warm-white);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { color: var(--sage-deep); }
a:hover { color: var(--black); }

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding-left: 28px;
  padding-right: 28px;
}

/* ---------------------------------------------------------------- nav */

.site-nav {
  border-bottom: 1px solid var(--border);
  background: var(--warm-white);
}
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-top: 1.15rem;
  padding-bottom: 1.15rem;
}
.site-nav-mark {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--black);
  text-decoration: none;
}
.site-nav-mark img { max-height: 30px; width: auto; }
.site-nav-links ul { list-style: none; display: flex; gap: 1.6rem; padding: 0; margin: 0; }
.site-nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-decoration: none;
}
.site-nav-links a:hover { color: var(--black); }
.site-nav-links .nav-current a { color: var(--black); }

/* -------------------------------------------------------------- index */

.index-head { padding-top: 96px; padding-bottom: 8px; }

.eyebrow {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--sage-dark);
  margin-bottom: 1rem;
}

.index-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.6rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--black);
  margin-bottom: 1.25rem;
}

.index-lede {
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 60ch;
}

.post-list { list-style: none; padding: 0; margin: 3.5rem 0 0; }
.post-list-item { border-top: 1px solid var(--border); }
.post-list-item:last-child { border-bottom: 1px solid var(--border); }
.post-list-link { display: block; padding: 2.25rem 0; text-decoration: none; color: inherit; }
.post-list-link:hover .post-list-title { color: var(--sage-deep); }

.post-list-meta,
.post-meta {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-soft);
  margin-bottom: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;
}
.post-list-tag, .post-tag { color: var(--sage-dark); }

.post-list-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--black);
  margin-bottom: 0.6rem;
  transition: color 0.15s ease;
}

.post-list-excerpt {
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 62ch;
}

/* --------------------------------------------------------------- post */

.post {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 96px 28px 80px;
}

.post-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.6rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--black);
  margin-bottom: 1.25rem;
}

.post-lede {
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 60ch;
  margin-bottom: 2.5rem;
}

.post-image { margin: 0 0 2.5rem; }
.post-image img { border-radius: 4px; }
.post-image figcaption {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-top: 0.6rem;
}

.post-content { font-size: 1.02rem; line-height: 1.7; }

.post-content h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--black);
  margin: 3rem 0 1rem;
}
.post-content h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--black);
  margin: 2rem 0 0.75rem;
}
.post-content p { margin-bottom: 1.3rem; }
.post-content ul, .post-content ol { margin: 0 0 1.5rem 1.5rem; padding: 0; }
.post-content li { margin-bottom: 0.5rem; }
.post-content a {
  color: var(--sage-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.post-content a:hover { color: var(--black); }
.post-content blockquote {
  border-left: 3px solid var(--gold);
  padding: 0.4rem 0 0.4rem 1.5rem;
  margin: 1.8rem 0;
  font-style: italic;
  color: var(--text-muted);
}
.post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--sand);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
.post-content pre {
  background: var(--cream);
  padding: 1.25rem 1.5rem;
  border-radius: 5px;
  overflow-x: auto;
  margin: 1.6rem 0;
  font-size: 0.88rem;
  line-height: 1.55;
}
.post-content pre code { background: none; padding: 0; }
.post-content hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.post-content strong { color: var(--black); }
.post-content figure { margin: 2rem 0; }
.post-content figcaption { font-size: 0.82rem; color: var(--text-soft); margin-top: 0.6rem; }

/* Ghost card widths, kept inside the measure so nothing breaks the column. */
.kg-width-wide, .kg-width-full { max-width: 100%; }

/* ---------------------------------------------------------- post foot */

.post-foot {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}
.post-foot-tags { margin-bottom: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.post-foot-tags a {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--sage-dark);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.3rem 0.7rem;
}
.post-foot-tags a:hover { color: var(--black); border-color: var(--sage-dark); }
.post-foot-author { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 2rem; }
.post-foot-author strong { color: var(--text); }

.cta-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.75rem 2rem;
}
.cta-card h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 0.6rem;
}
.cta-card p { color: var(--text-muted); margin-bottom: 1rem; font-size: 0.95rem; }
.cta-card a {
  display: inline-block;
  background: var(--black);
  color: var(--warm-white);
  padding: 0.7rem 1.4rem;
  border-radius: 3px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.cta-card a:hover { background: var(--sage-deep); color: var(--warm-white); }

/* ---------------------------------------------------- pagination, foot */

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 2.5rem 0 0;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--text-soft);
}
.pagination a { text-decoration: none; }

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 5rem;
  padding: 2.5rem 0 3.5rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-footer-mark {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text-muted);
}
.site-footer-links ul { list-style: none; display: flex; gap: 1.4rem; padding: 0; margin: 0; }
.site-footer-links a {
  font-size: 0.8rem;
  color: var(--text-soft);
  text-decoration: none;
  letter-spacing: 0.03em;
}
.site-footer-links a:hover { color: var(--black); }

/* --------------------------------------------------------- responsive */

@media (max-width: 640px) {
  .index-head { padding-top: 60px; }
  .post { padding-top: 60px; }
  .index-title, .post-title { font-size: 2.05rem; }
  .post-list-title { font-size: 1.45rem; }
  .post-content h2 { font-size: 1.5rem; }
  .site-nav .wrap { flex-direction: column; align-items: flex-start; gap: 0.9rem; }
  .site-nav-links ul { flex-wrap: wrap; gap: 1.1rem; }
}
