/* ── Fonts ── */
@font-face {
  font-family: "FuturaNowVariableRoman";
  src: url('/fonts/FuturaNowVariableRoman/font.woff2') format('woff2'),
       url('/fonts/FuturaNowVariableRoman/font.woff') format('woff');
  font-display: block;
}

/* ── Layout ── */
html { background-color: #fefefe; }
body {
  background: transparent;
  color: var(--ink);
  font-weight: 350;
  font-family: "FuturaNowVariableRoman", "Century Gothic", Futura, sans-serif;
  letter-spacing: 0.015em;
  font-size: 1.45rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1.2em 6vw 0;
}

body > main { max-width: 52rem; width: 100%; justify-self: center; position: relative; }

/* Article prose — cap reading line width */
.article-page { max-width: 42rem; }

@media (max-width: 600px) { body { padding: 0 1rem; } }
@media (max-width: 390px) { body { padding: 0 0.75rem; } }

/* ── Colour ── */
:root {
  --red:       #dc3d2e;  /* warm red — between terracotta and logo-red */
  --red-logo:   #dc3d2e;  /* unified with --red */
  --ink:   #111111;  /* crisp neutral black */
  --paper: #ffffff;
  --rule:  color-mix(in srgb, var(--red) 14%, #e8e8e8);  /* muted rule — grey base pulls out the orange cast */
  --muted: #8c8c8c;  /* neutral mid-grey */
}

/* ── Base type ── */
a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  text-decoration-color: #ccc;
}
a:hover { color: var(--red); }

/* Annotated text — dotted muted underline, help cursor */
.info, abbr[title] { text-decoration: underline dotted var(--muted); text-underline-offset: 0.18em; text-decoration-thickness: 1px; cursor: help; }
dfn { font-style: normal; font-weight: 500; }

/* Structural chrome — no underline */
body > header nav a,
body > header h1 a,
.article-date a,
.article-updated a,
footer.meta a,
.post-date a { text-decoration: none; }

/* Riso ink spill — randomised underline colours on prose links, set via JS */
.article-page a { text-decoration-thickness: 2px; }

/* Date links — never riso, no underline */
a.date-year-link, a.date-month-link, a.date-day-link {
  text-decoration: none;
}

/* Body — tight, rhythmic. Notes close together. */
p { margin-top: 0; margin-bottom: 0.8rem; line-height: 1.42; }
/* Two paragraphs in a row breathe slightly more */
p + p { margin-top: 0.2rem; }
/* Prose lists — a beat of air between items */
.article-page ul, .article-page ol { margin-top: 0; }
.article-page li { margin-bottom: 0.35rem; }

/* Headings — base scale, modest spacing */
h1 { font-size: 2.4rem; font-weight: 700; line-height: 1.05; margin-top: 0.8em; margin-bottom: 0.2em; font-stretch: semi-condensed; text-shadow: 0 1px 0 rgba(255,255,255,0.6); }
h2 { font-size: 1.6rem; font-weight: 600; line-height: 1.15; margin-top: 1.2em; margin-bottom: 0.15em; text-shadow: 0 1px 0 rgba(255,255,255,0.6); }
h3 { font-size: 1.2rem; font-weight: 600; line-height: 1.2; margin-top: 1em; margin-bottom: 0.1em; }
h4, h5, h6 { font-size: 1rem; font-weight: 600; margin-top: 0.8em; margin-bottom: 0; }
h1, h2, h3 { text-wrap: balance; }
article > p { text-wrap: pretty; }
code, pre, kbd, samp { font-size: 0.85em; }

/* Article headings — the jazz pause. Air before the statement. */
article h1 { margin-top: 2.8em; }
article h2 { margin-top: 2.2em; }
article h3 { margin-top: 1.8em; }

/* No h1 — article opens straight with text, give it breathing room */
article.article-page > p:first-child { margin-top: 2.4rem; }

/* ── Header ── */
body > header { position: relative; }

/* alias:saila logo */
body > header h1 {
  font-family: "Futura", "Jost", "Century Gothic", sans-serif;
  font-weight: 600;
  font-size: 20px;
  line-height: 1;
  text-align: right;
  position: absolute;
  right: 0;
  top: 0;
  letter-spacing: 0.02em;
  font-stretch: normal;
  text-shadow: none;
}
.logo-alias { color: var(--red-logo); }
.logo-colon { color: var(--muted); }
.logo-saila { color: var(--ink); }
body > header h1 a { text-decoration: none; font-weight: 600; }
body > header h1 a:hover .logo-alias { color: var(--ink); }
body > header h1 a:hover .logo-saila { color: var(--red-logo); }

/* Red rule + section name */
body > header hgroup { border-top: 2px solid var(--red); padding-top: 0.6rem; margin-top: 2.6rem; margin-bottom: 0; }
body > header h2 { display: none; }
body > header h3 { font-size: 0.8rem; font-weight: 400; color: #999; margin-top: 0.2rem; margin-bottom: 0; }

/* Nav */
body > header nav { font-size: 0.75rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.1em; margin-top: -0.6rem; margin-left: 0.2rem; }
body > header nav ul { list-style: none; padding: 0; display: flex; gap: 1.5em; }
body > header nav a { color: var(--muted); text-decoration: none; }
body > header nav a:hover { color: var(--red); }
body > header nav li.active a { color: var(--red); font-weight: 500; }

/* ── Article date — close to title, like a subtitle whispered ── */
.article-date { font-size: 0.8rem; font-weight: 375; letter-spacing: 0.04em; color: var(--muted); margin-top: 0.2rem; margin-bottom: 1.6rem; }
.article-date a { color: inherit; text-decoration: none; }
.article-date a:hover { color: var(--red); }
.article-updated { display: block; margin-top: 0.2rem; opacity: 0.7; }

/* ── Metadata footer — coda, sits close after content ── */
footer.meta { font-size: 0.8rem; font-weight: 375; letter-spacing: 0.04em; color: var(--muted); margin-top: 2.4rem; }
footer.meta dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.2em 0.75em; align-items: baseline; }
footer.meta dt { font-weight: 400; }
footer.meta dt a { color: var(--muted); text-decoration: none; }
footer.meta dt a:hover { color: var(--red); }
footer.meta dt::after { content: ':'; color: var(--muted); }
footer.meta dd { margin: 0; color: var(--ink); }
.meta-topics a { color: var(--muted); text-decoration: none; }
.meta-topics a:hover { color: var(--red); }
.tag-sep { color: var(--muted); }
footer.meta a.date-year-link  { font-weight: 375; color: var(--muted); text-decoration: none; }
footer.meta a.date-month-link { font-weight: 500; color: var(--ink); text-decoration: none; }
footer.meta a.date-day-link   { font-weight: 700; color: var(--ink); text-decoration: none; }
footer.meta a:hover { color: var(--red); }

/* ── Site footer ── */
body > footer { font-size: 0.75rem; font-weight: 375; letter-spacing: 0.04em; color: var(--muted); border-top: 1px solid color-mix(in srgb, var(--red) 20%, transparent); margin-top: 3.2rem; padding-top: 0.8rem; }
body > footer address { font-style: normal; }
body > footer a { color: inherit; text-decoration: none; }
body > footer a:hover { color: var(--red); text-decoration-color: var(--red); }
#colophon object { height: 1rem; width: auto; vertical-align: text-bottom; opacity: 0.4; pointer-events: none; }
.sidebar-section a:hover { text-decoration-color: var(--red); }

/* ── Notices ── */
/* Draft/unpublished stamps */
.status-indicators {
  position: absolute;
  top: 2vw;
  right: 6vw;
  display: flex;
  gap: 0.6em;
  pointer-events: none;
}
.draft-notice, .unpublished-notice {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bg, #fefefe);
  background: #c0392b;
  padding: 0.5em 0.5em 0.2em;
  border-radius: 2px;
  opacity: 0.7;
  transform: rotate(4deg);
  border: 1px solid var(--red-logo);
}

/* ── Column archives (LCKY index) ── */
.year-group { margin-bottom: 0.4rem; }
.year-heading a { font-weight: 700; color: var(--ink); }
.year-heading a.year-link--archive { color: #999; }

/* Month grid */
.month-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0.2em; margin-bottom: 1em; margin-top: 0.2em; }
.month-cell { font-size: 1rem; text-align: center; padding: 0.2em 0.1em; }
.month-cell--empty { color: #ddd; }
.month-cell--active { font-weight: 375; }
.month-cell--cms { color: var(--ink); }
.month-cell--archive { color: #999; }
.post-count { font-weight: 375; color: var(--muted); font-size: 0.8em; margin-left: 0.4em; }
.badge--archive { font-weight: 375; color: var(--muted); font-size: 0.8em; margin-left: 0.4em; }

/* ── Year / month / day archive pages ── */
.month-container { margin-bottom: 2.4rem; }
.month-heading { margin-top: 0; margin-bottom: 0.3rem; }
.month-heading a { color: var(--ink); }
.post-list { display: flex; flex-direction: column; gap: 0.3em; }
.post-item { display: flex; gap: 0.75em; align-items: baseline; }
.post-date { font-size: 0.8rem; font-weight: 375; letter-spacing: 0.03em; color: var(--muted); min-width: 1.5em; text-align: right; flex-shrink: 0; }
.post-date a { color: inherit; text-decoration: none; }
.post-date a:hover { color: var(--red); }
.topic-posts .post-date { width: 5.5em; text-align: center; }
.post-item > a { color: var(--ink); }

/* Archive navigation — .post-nav CSS handles all color/weight/hover; no overrides needed */

/* ── Topic page ── */


/* Draft badge — own line, below title */
.draft-badge { display: block; font-size: 0.65rem; font-weight: 400; color: var(--muted); margin-top: 0.15em; letter-spacing: 0.06em; text-transform: uppercase; }

/* post-item layout — block stack, title then meta */
article.post-item { display: block; }
article.post-item h2, article.post-item h3 { margin: 0; }
.post-description { font-size: 0.8rem; font-weight: 375; color: var(--muted); margin: 0.3em 0 0; }
.updated-notice { font-size: 0.8rem; font-weight: 375; color: var(--muted); margin: 0.2em 0 0; }

/* post-item footer.meta — compact version of the article metadata */
article.post-item footer.meta { margin-top: 0.3em; }
article.post-item footer.meta dl { gap: 0.1em 0.6em; }
article.post-item footer.meta dt { font-size: 0.7rem; }
article.post-item footer.meta dd { font-size: 0.7rem; }


.sort-options { font-size: 0.8rem; font-weight: 375; letter-spacing: 0.04em; color: var(--ink); margin-top: 1.6rem; margin-bottom: 1.6rem; }
.sort-options a { color: var(--muted); text-decoration: none; }
.sort-options a:hover { color: var(--red); text-decoration-color: currentColor; }
.sort-options a.active, .sort-options .sort-link.active { color: var(--red); font-weight: 500; text-decoration-color: currentColor; }

/* ── Article bold ── */
article.article-page p strong,
article.article-page p b { font-weight: 500; }

/* ── Horizontal rules ── */
hr:not(.section-break) { border: none; border-top: 1px solid #e8d8d8; margin: 2.4rem 0; }

/* ── Blockquotes ── */
blockquote {
  margin: 1.6rem 0;
  padding-left: 1rem;
  border-left: 2px solid #e8d8d8;
  font-size: 0.9em;
  font-style: italic;
}
blockquote p:last-child { margin-bottom: 0; }

/* ── Callouts ── */
.callout {
  margin: 1.6rem 0;
  padding-left: 1rem;
  border-left: 2px solid #e8d8d8;
  font-size: 0.9em;
}
.callout h2 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.65;
  margin: 0 0 0.4rem;
  line-height: 1.2;
}
.callout-content { font-style: italic; line-height: 1.4; }
.callout-content p:last-child { margin-bottom: 0; }

/* Foldable callouts — <details>/<summary> toggle */
.callout details summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.callout details summary::-webkit-details-marker { display: none; }
.callout details summary::marker { display: none; }
.callout details summary h2 { display: inline; }
.callout details summary h2::after { content: ' ▸'; font-size: 0.65em; color: var(--muted); vertical-align: 0.15em; }
.callout details[open] summary h2::after { content: ' ▾'; color: var(--muted); vertical-align: 0.1em; }
.callout details:not([open]) summary h2 { margin-bottom: 0; }
.callout details[open] .callout-content { margin-top: 0.5rem; }

/* ── Section break ── */
hr.section-break { visibility: hidden; padding: 0.8rem 0; }
hr.section-break + p:has(em) { font-weight: 225; letter-spacing: 0; }

/* ── Footnotes ── */
section.footnotes { margin-top: 4.8rem; }
section.footnotes hr { display: none; }
section.footnotes h2 { display: none; }
section.footnotes ol { font-size: 1rem; color: var(--ink); padding-left: 1.5em; letter-spacing: 0.05em; font-weight: 325; border-top: 1px solid #e8d8d8; padding-top: 0.8rem; }
section.footnotes li { margin-bottom: 0.8rem; line-height: 1.5; }

section.footnotes a { color: var(--muted); text-decoration: none; }
section.footnotes a:hover { color: var(--red); text-decoration: underline; }

/* Footnote reference superscripts in body text */
sup a[data-footnote-ref] { font-weight: 100; text-decoration: none !important; text-decoration-color: transparent !important; }
sup a[data-footnote-ref]:hover { text-decoration: underline !important; }

/* ── Tag list ── */
.tag-list { display: flex; flex-wrap: wrap; gap: 0.3em 0.8em; margin: 0.8rem 0; }
.tag-list .tag { font-weight: 600; color: var(--ink); }
.tag-list .tag:hover { color: var(--red); text-decoration-color: currentColor; }
.tag data::after { content: " (" attr(value) ")"; font-weight: 400; color: var(--muted); font-size: 0.85em; opacity: 0.6; }

/* Archive tags — greyed out, mixed into main list */
.tag.tag--archive { font-weight: 400; color: #999; }
.tag.tag--archive:hover { color: var(--red); }
.archive-topics-note { font-size: 0.8rem; font-weight: 375; color: var(--muted); margin-top: 1.6rem; }

/* ── Post prev/next navigation ── */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 0;
  margin-top: 2.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid color-mix(in srgb, var(--rule) 30%, transparent);
  font-size: 0.8rem;
}
a.post-nav-prev, a.post-nav-next { text-decoration: none; color: var(--muted); }
a.post-nav-prev:hover, a.post-nav-next:hover { color: var(--red); }
a.post-nav-prev { display: block; padding-left: 0.7em; text-indent: -0.7em; text-wrap: balance; }
a.post-nav-prev::before { content: '\2039'; color: var(--muted); vertical-align: 0.1em; margin-right: 0.2rem; }
a.post-nav-next { display: block; text-wrap: balance; }
a.post-nav-next::after  { content: '\203a'; color: var(--muted); vertical-align: 0.1em; margin-left: 0.2rem; }
a.post-nav-prev:hover::before { color: var(--red); }
a.post-nav-next:hover::after  { color: var(--red); }
.post-nav-prev { text-align: left; }
.post-nav-next { text-align: right; }
.post-nav-home { color: var(--muted); white-space: nowrap; font-size: 0.8rem; text-align: center; }
a.post-nav-home, .post-nav-home a { color: var(--muted); text-decoration: none; }
a.post-nav-home:hover, .post-nav-home a:hover { color: var(--red); }

/* ── Static sidebar layout ── */
.static-sidebar-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.static-sidebar-content { flex: 0 1 36rem; min-width: 20rem; }
.static-sidebar          { flex: 0 0 12rem; margin-left: auto; display: flex; flex-direction: column; justify-content: space-between; align-self: stretch; text-align: right; padding-top: 2.4rem; font-size: 1rem; font-weight: 325; }
.static-sidebar .sidebar-section:last-child { margin-bottom: 7.6rem; }

.sidebar-section h2 {
  font-size: 1rem;
  font-weight: 400;
  font-stretch: semi-condensed;
  text-shadow: none;
  margin: 0 0 0.55rem;
  line-height: 1;
}

.sidebar-section ul { list-style: none; padding: 0; margin: 0; }
.sidebar-section li { margin-bottom: 0.4rem; }
.sidebar-section mark { font-size: 0.85em; color: var(--muted); white-space: normal; background: none; }
.sidebar-section mark[title] { border-radius: 2px; padding: 0.08em 0.25em; cursor: copy; }
.sidebar-section mark[title]:hover, .sidebar-section mark[title]:focus { background: color-mix(in srgb, #ffe800 18%, transparent); }

@keyframes target-highlight {
  0%   { background-color: transparent; animation-timing-function: ease-in; }
  11%  { background-color: color-mix(in srgb, #ffe800 18%, transparent); animation-timing-function: ease-out; }
  100% { background-color: transparent; }
}
:target { animation: target-highlight 4.5s forwards; }

@media (max-width: 860px) {
  .static-sidebar-layout { flex-direction: column; gap: 1.6rem; }
  .static-sidebar-content { flex: none; width: 100%; }
  .static-sidebar { flex: none; width: 100%; align-self: auto; margin-left: 0; text-align: left; padding-top: 0; font-size: 1.45rem; }
  .static-sidebar .sidebar-section h2 { font-size: 2.4rem; font-weight: 700; line-height: 1.05; color: var(--ink); margin: 0.8em 0 0.2em; }
}

/* ── Homepage layout ── */
.homepage-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-top: calc(6vw * 0.6);
}

.homepage-layout .homepage-content { flex: 0 1 36rem; min-width: 20rem; }
.homepage-layout .homepage-content h1 { margin-top: 0; margin-bottom: 1.24rem; }
.homepage-layout .recent-articles  { flex: 0 0 12rem; margin-left: auto; text-align: right; font-size: 1rem; font-weight: 325; }

@media (max-width: 860px) {
  .homepage-layout { flex-direction: column; gap: 1.6rem; }
  .homepage-layout .homepage-content { flex: none; width: 100%; }
  .homepage-layout .recent-articles { flex: none; width: 100%; margin-left: 0; text-align: left; font-size: 1.45rem; font-weight: 350; }
  .homepage-layout .recent-articles h2 { font-size: 2.4rem; font-weight: 700; line-height: 1.05; color: var(--ink); margin: 0.8em 0 0.2em; text-shadow: none; }
}

/* ── Column index (blog roll) ── */

/* Page header h1 — big and black; description — ghostly, smaller than body */
.column-index-page .page-header h1,
.topics-index-page .page-header h1,
.topics-page .page-header h1,
.archives-page .page-header h1,
.year-archive-page .page-header h1,
.month-archive-page .page-header h1,
.day-archive-page .page-header h1 { font-weight: 900; font-size: 3.2rem; }
.column-index-page .page-header .description,
.topics-index-page .page-header .description,
.topics-page .page-header .description,
.archives-page .page-header .description,
.year-archive-page .page-header .description,
.month-archive-page .page-header .description,
.day-archive-page .page-header .description { font-weight: 400; font-size: 1.25rem; color: var(--muted); }
.page-header .description strong { font-weight: 500; color: var(--ink); }
.page-header .description mark { background: none; color: var(--ink); font-weight: 500; }

/* First article h1 — give it room above */
.column-index-page article:first-of-type h1 { margin-top: 2.4rem; }

/* Article h1 in this context — navigation-style link, no riso underline */
.column-index-page .article-header h1 a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}
.column-index-page .article-header h1 a:hover { color: var(--red); }

/* Full archive link — nav-style, no underline */
.column-index-nav { margin-top: 2.4rem; font-size: 1rem; }
.column-index-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 400;
}
.column-index-nav a:hover { color: var(--red); }

/* ── Embedded video (YouTube iframes) — responsive 16:9 ── */
article iframe,
main iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 4px;
  margin: 1.6rem 0;
/*  box-shadow: 0 0 0.5rem var(--muted); */
  border: 1px solid var(--muted);
}
