/* _blog-style.css
   Slim styling for blog*.qmd posts so they visually match
   adamdennett.co.uk — typography (Fraunces + Inter + JetBrains Mono),
   palette (off-white paper + terracotta accent), basic prose details.
   Sits on top of whatever bootstrap theme the project uses
   (cosmo by default). */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT@0,9..144,300..700,0..100;1,9..144,300..700,0..100&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --site-accent:   #C2542D;
  --site-bg:       #FAF7F0;
  --site-text:     #1A1A1A;
  --site-muted:    #6E6862;
  --site-border:   #E8E2D4;
  --site-code-bg:  #F2EEE3;
  --site-code-fg:  #8B3A24;
}

/* ----- Body & global typography ----- */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--site-bg);
  color: var(--site-text);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings: "ss01" on, "cv11" on;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ----- Headings (Fraunces serif with optical sizing) ----- */
h1, h2, h3, h4, h5, h6,
.quarto-title h1 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-variation-settings: "opsz" 80, "SOFT" 30;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: #111111;
}
h1, .quarto-title-block .title {
  font-variation-settings: "opsz" 144, "SOFT" 50;
  letter-spacing: -0.025em;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}
h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--site-border);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
}
h3 { margin-top: 1.8rem; font-size: 1.4rem; }

/* Italicised subtitle / description / lead */
.subtitle, .quarto-title-block .subtitle,
.description, .quarto-title-meta .description,
.lead {
  font-family: "Fraunces", Georgia, serif;
  font-variation-settings: "opsz" 30, "SOFT" 50;
  font-weight: 300;
  font-style: italic;
  color: #4a4a4a;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.45;
}

/* ----- Links: underline-grow with terracotta hover ----- */
a {
  color: var(--site-text);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 180ms ease, color 180ms ease;
}
a:hover {
  color: var(--site-accent);
  background-size: 100% 1px;
}

/* ----- Code ----- */
code, kbd, pre, samp {
  font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  font-feature-settings: "calt" 0;
  font-size: 0.92em;
}
:not(pre) > code {
  background-color: var(--site-code-bg);
  color: var(--site-code-fg);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}
pre.sourceCode {
  border: 1px solid var(--site-border);
  border-radius: 6px;
  background-color: var(--site-code-bg);
}

/* ----- Blockquote: terracotta sidebar ----- */
blockquote, .blockquote {
  border-left: 3px solid var(--site-accent);
  padding-left: 1rem;
  color: #4a4a4a;
  font-style: italic;
  margin-left: 0;
}

/* ----- Tables ----- */
table {
  border-collapse: collapse;
}
table th, table td {
  border-color: var(--site-border) !important;
}
table th {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: #5E5E5E;
}

/* ----- Selection ----- */
::selection {
  background: rgba(194, 84, 45, 0.25);
  color: #1A1A1A;
}

/* ----- Body container: a comfortable reading column ----- */
main.content, #quarto-document-content {
  max-width: 760px;
}

/* Default Quarto navbar — neutralise so the page reads as a quiet article.
   Project repos that have their own navbar can keep it; this just trims
   the cosmo navbar's bright blue to match the paper palette. */
.navbar {
  background-color: var(--site-bg) !important;
  border-bottom: 1px solid var(--site-border);
}
.navbar .navbar-brand,
.navbar .nav-link {
  color: var(--site-text) !important;
}
.navbar .nav-link:hover {
  color: var(--site-accent) !important;
}

/* Subtle paper-grain texture, fetched from the main site so it works
   regardless of which repo this CSS is dropped into. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background-image: url("https://adamdennett.co.uk/assets/noise.svg");
}
main, header, footer, nav { position: relative; z-index: 1; }
