/*
Theme Name: Daydream
Theme URI: https://blog.aniss.me/
Author: Aniss Benelmouffok
Author URI: https://aniss.me/
Description: Dispatches from a maladaptive daydream. A typography-first, single-column blog theme: one voice in Source Serif 4, mono metadata, margin sidenotes, full-width travel images, and a dedicated E-ink reading mode built for reflective displays.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: daydream
Tags: blog, one-column, custom-menu, threaded-comments, translation-ready
*/

/* ------------------------------------------------------------------
   1. Fonts (self-hosted)
   Source Serif 4   — SIL OFL, Adobe. Variable: weight 200–900, optical size.
   iA Writer Mono S — SIL OFL, iA / IBM Plex Mono.
   ------------------------------------------------------------------ */
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/SourceSerif4-normal-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/SourceSerif4-normal-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/SourceSerif4-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/SourceSerif4-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "iA Writer Mono S";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/iAWriterMonoS-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "iA Writer Mono S";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/iAWriterMonoS-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "iA Writer Mono S";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/iAWriterMonoS-Bold.woff2") format("woff2");
}

/* ------------------------------------------------------------------
   2. Tokens
   ------------------------------------------------------------------ */
:root {
  color-scheme: dark;

  --bg: #101418;      /* near-black, never pure */
  --fg: #dde2e8;      /* off-white, never pure */
  --link: #7fa9f0;    /* periwinkle: links */
  --rule: #2b4a7e;    /* deep blue: rules, blockquote borders */
  --hot: #4c8dff;     /* bright blue: hover + focus only */
  --muted: #7c8794;   /* slate: timestamps, captions */

  --serif: "Source Serif 4", "Source Serif Pro", Literata, Newsreader, Charter, "Iowan Old Style", Georgia, serif;
  --mono: "Berkeley Mono", "iA Writer Mono S", "iA Writer Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --size: 20px;
  --lh: 1.7;
  --measure: 65ch;
  --gutter: 1rem;

  --sidenote-w: 15rem;
  --sidenote-gap: 2.5rem;
  --site-extra: 0px;  /* room reserved for the sidenote margin on wide screens */

  --meta-size: 0.7em;
  --meta-track: 0.08em;
  --para-space: 1.25em;
  --rule-w: 1px;
  --quote-rule-w: 2px;
}

html.eink {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #000000;
  --link: #000000;
  --rule: #000000;
  --hot: #000000;
  --muted: #555555;
  --size: 22px;
  --lh: 1.75;
  --measure: 60ch;
}

/* ------------------------------------------------------------------
   3. Base
   ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: var(--size);
  line-height: var(--lh);
  font-weight: 400;
  font-optical-sizing: auto;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  hanging-punctuation: first allow-end last;
  overflow-wrap: break-word;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-skip-ink: auto;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}
@media (hover: hover) {
  a:hover { color: var(--hot); text-decoration-color: var(--hot); }
}
a:focus-visible { color: var(--hot); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--hot);
  outline-offset: 3px;
}

img, video, iframe, embed, object {
  max-width: 100%;
  height: auto;
}
img { display: block; }
iframe { border: 0; }

p { margin: 0 0 var(--para-space); text-wrap: pretty; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  text-wrap: balance;
}

em, i { font-style: italic; }
strong, b { font-weight: 700; }
abbr[title] { text-decoration: underline dotted; text-underline-offset: 0.18em; }
sup, sub { font-size: 0.7em; line-height: 0; position: relative; vertical-align: baseline; }
sup { top: -0.55em; }
sub { bottom: -0.25em; }
small { font-size: 0.85em; }
mark { background: transparent; color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-decoration-thickness: 2px; }

hr {
  border: 0;
  height: auto;
  margin: 2.5em 0;
  text-align: center;
  background: none;
  line-height: 1;
}
hr::before { content: "\00a7"; color: var(--muted); font-family: var(--serif); font-size: 1em; }

::selection { background: var(--rule); color: var(--fg); }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed !important;
  top: 1rem; left: 1rem;
  width: auto; height: auto;
  margin: 0; padding: 0.5em 0.9em;
  clip: auto; clip-path: none;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: var(--meta-track);
  z-index: 1000;
  outline: 2px solid var(--hot);
}

/* ------------------------------------------------------------------
   4. Layout: one column
   ------------------------------------------------------------------ */
.site {
  box-sizing: content-box;
  max-width: calc(var(--measure) + var(--site-extra));
  margin: 0 auto;
  padding: 0 var(--gutter);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site > * { max-width: var(--measure); width: 100%; }
.site-main { flex: 1 0 auto; }

@media (min-width: 640px) {
  :root { --gutter: 1.5rem; }
}
@media (min-width: 1200px) {
  :root { --site-extra: calc(var(--sidenote-w) + var(--sidenote-gap)); }
}

/* ------------------------------------------------------------------
   5. Header
   ------------------------------------------------------------------ */
.site-header { padding: 2.25rem 0 3rem; }
.site-header__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
}
.site-title {
  font-size: 1em;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  letter-spacing: -0.005em;
}
.site-title a { color: var(--fg); text-decoration: none; }
@media (hover: hover) { .site-title a:hover { color: var(--hot); } }
.site-description {
  margin: 0.35em 0 0;
  font-style: italic;
  color: var(--muted);
  font-size: 0.9em;
}

/* E-ink toggle: visible, mono, not decorative. A plain link when JavaScript is off. */
.eink-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  flex: none;
  padding: 0.5em 0;
  font-family: var(--mono);
  font-size: var(--meta-size);
  letter-spacing: 0.12em;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  cursor: pointer;
}
.eink-toggle__box {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  border: 1px solid currentColor;
  background: transparent;
  transform: translateY(-0.05em);
}
@media (hover: hover) { .eink-toggle:hover { color: var(--hot); } }
html.eink .eink-toggle { color: #000; }
html.eink .eink-toggle__box { background: #000; }

/* ------------------------------------------------------------------
   6. Index: a typographic list, not a feed
   ------------------------------------------------------------------ */
.index-group + .index-group { margin-top: 2.5rem; }
.index-year {
  font-family: var(--mono);
  font-size: var(--meta-size);
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 1.25em;
  padding-bottom: 0.6em;
  border-bottom: var(--rule-w) solid var(--rule);
}
.index {
  list-style: none;
  margin: 0;
  padding: 0;
}
.index-item { margin: 0 0 1.75em; }
.index-item:last-child { margin-bottom: 0; }
.index-date {
  display: block;
  font-family: var(--mono);
  font-size: var(--meta-size);
  letter-spacing: var(--meta-track);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4em;
  line-height: 1.4;
}
.index-title {
  font-size: 1em;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
}
.index-title a { color: var(--fg); text-decoration: none; }
@media (hover: hover) {
  .index-title a:hover { color: var(--hot); text-decoration: underline; text-decoration-color: var(--hot); }
}
.index-title a:focus-visible { text-decoration: underline; }
.index-dek {
  margin: 0.3em 0 0;
  font-size: 0.9em;
  line-height: 1.5;
  color: var(--fg);
}
.index-empty { color: var(--muted); font-style: italic; }

.index-nav, .post-nav {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 3.5rem;
  font-family: var(--mono);
  font-size: var(--meta-size);
  letter-spacing: var(--meta-track);
  text-transform: uppercase;
  line-height: 1.5;
}
.index-nav a, .post-nav a { color: var(--muted); text-decoration: none; }
@media (hover: hover) { .index-nav a:hover, .post-nav a:hover { color: var(--hot); text-decoration: underline; } }
.index-nav__newer, .post-nav__newer { margin-left: auto; text-align: right; }
.post-nav a { display: block; max-width: 48%; }
.post-nav__label { display: block; color: var(--muted); }
.post-nav__title {
  display: block;
  font-family: var(--serif);
  font-size: 1.25em;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg);
  margin-top: 0.3em;
}
@media (hover: hover) { .post-nav a:hover .post-nav__title { color: var(--hot); } }

/* Archive / category / search headings */
.page-title {
  font-family: var(--mono);
  font-size: var(--meta-size);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 2.5rem;
  line-height: 1.5;
}
.page-title__term {
  font-family: var(--serif);
  font-size: 1.4rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg);
  font-weight: 700;
  display: block;
  margin-top: 0.35em;
}

/* ------------------------------------------------------------------
   7. Single post / page
   ------------------------------------------------------------------ */
.entry-header { margin-bottom: 2.5rem; }
.entry-title {
  font-size: 1.6em;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.008em;
  margin: 0;
}
.entry-meta {
  margin: 0.8em 0 0;
  font-family: var(--mono);
  font-size: var(--meta-size);
  letter-spacing: var(--meta-track);
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.6;
}
.entry-meta a { color: var(--muted); text-decoration: none; }
@media (hover: hover) { .entry-meta a:hover { color: var(--hot); text-decoration: underline; } }
.entry-meta__sep { margin: 0 0.5em; }

.entry-content { counter-reset: sidenote-counter; }
.entry-content > :first-child { margin-top: 0; }
.entry-content > :last-child { margin-bottom: 0; }

.entry-content h2 {
  font-size: 1.05em;
  font-weight: 600;
  font-variant-caps: small-caps;
  letter-spacing: 0.08em;
  line-height: 1.4;
  margin: 2.5em 0 0.9em;
}
.entry-content h3 {
  font-size: 1em;
  font-weight: 700;
  margin: 2em 0 0.7em;
}
.entry-content h4, .entry-content h5, .entry-content h6 {
  font-size: 1em;
  font-weight: 500;
  font-style: italic;
  margin: 1.75em 0 0.6em;
}

.entry-content ul, .entry-content ol {
  margin: 0 0 var(--para-space);
  padding-left: 1.5em;
}
.entry-content li + li { margin-top: 0.35em; }
.entry-content li > ul, .entry-content li > ol { margin: 0.35em 0 0; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content ::marker { color: var(--muted); }

/* Drop cap: only when the author turns it on for a paragraph */
.entry-content .has-drop-cap:not(:focus)::first-letter {
  float: left;
  font-family: var(--serif);
  font-size: 3.6em;
  font-weight: 500;
  font-style: normal;
  line-height: 0.8;
  margin: 0.1em 0.14em 0 0;
  padding: 0;
  text-transform: uppercase;
  color: var(--fg);
}
.entry-content .has-drop-cap:not(:focus)::after {
  content: "";
  display: table;
  clear: both;
}

/* Blockquotes */
.entry-content blockquote,
.entry-content .wp-block-quote {
  margin: 1.75em 0;
  padding: 0 0 0 1.25em;
  border-left: var(--quote-rule-w) solid var(--rule);
  font-style: normal;
}
.entry-content blockquote > :last-child { margin-bottom: 0; }
.entry-content blockquote cite,
.entry-content .wp-block-quote cite,
.entry-content .wp-block-pullquote cite {
  display: block;
  margin-top: 0.75em;
  font-family: var(--mono);
  font-size: var(--meta-size);
  font-style: normal;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.entry-content .wp-block-pullquote {
  margin: 2.5em 0;
  padding: 1.25em 0;
  border-top: var(--rule-w) solid var(--rule);
  border-bottom: var(--rule-w) solid var(--rule);
  text-align: left;
}
.entry-content .wp-block-pullquote blockquote { margin: 0; padding: 0; border: 0; }
.entry-content .wp-block-pullquote p {
  font-size: 1.15em;
  line-height: 1.5;
  margin: 0;
}

/* Code */
code, kbd, samp {
  font-family: var(--mono);
  font-size: 0.85em;
  font-variant-ligatures: none;
}
.entry-content pre,
.entry-content .wp-block-code,
.entry-content .wp-block-preformatted {
  font-family: var(--mono);
  font-size: 0.8em;
  line-height: 1.55;
  margin: 0 0 1.5em;
  padding: 1em 1.25em;
  border: var(--rule-w) solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  overflow-x: auto;
  white-space: pre;
  tab-size: 4;
}
.entry-content pre code { font-size: 1em; padding: 0; background: none; }
.entry-content .wp-block-preformatted { white-space: pre-wrap; }

/* Images and figures */
.entry-content figure,
.entry-content .wp-block-image,
.entry-content .wp-block-gallery,
.entry-content .wp-block-embed,
.entry-content .wp-block-video {
  margin: 2em 0;
}
.entry-content .wp-block-image img,
.entry-content figure img { width: 100%; height: auto; }
.entry-content .wp-block-image.is-resized img { width: auto; max-width: 100%; }
.entry-content .wp-block-gallery img { width: auto; }
.entry-content figcaption,
.entry-content .wp-block-image figcaption,
.entry-content .wp-block-gallery figcaption,
.entry-content .wp-block-embed figcaption,
.entry-content .wp-block-video figcaption,
.entry-content .wp-element-caption {
  margin: 0.75em 0 0;
  font-family: var(--mono);
  font-size: var(--meta-size);
  line-height: 1.55;
  letter-spacing: 0.02em;
  text-align: left;
  color: var(--muted);
}
.entry-content .wp-block-image.alignleft {
  float: left;
  max-width: 45%;
  margin: 0.35em 1.5em 1em 0;
}
.entry-content .wp-block-image.alignright {
  float: right;
  max-width: 45%;
  margin: 0.35em 0 1em 1.5em;
}
.entry-content .wp-block-image.aligncenter { margin-left: auto; margin-right: auto; }

/* Travel posts: every image breaks the measure, deliberately.
   Wide and full alignments break it in any post. Add the class
   "no-breakout" to an image block to keep it inside the measure. */
.category-travel .entry-content .wp-block-image:not(.alignleft):not(.alignright):not(.aligncenter):not(.is-resized):not(.no-breakout),
.category-travel .entry-content .wp-block-gallery:not(.no-breakout),
.category-travel .entry-content .wp-block-video:not(.no-breakout),
.entry-content .alignwide,
.entry-content .alignfull {
  width: calc(100% + var(--site-extra) + 2 * var(--gutter));
  max-width: none;
  margin-left: calc(-1 * var(--gutter));
  margin-right: calc(-1 * (var(--gutter) + var(--site-extra)));
}
.category-travel .entry-content .wp-block-image:not(.alignleft):not(.alignright):not(.aligncenter):not(.is-resized):not(.no-breakout) > figcaption,
.category-travel .entry-content .wp-block-gallery:not(.no-breakout) > figcaption,
.category-travel .entry-content .wp-block-video:not(.no-breakout) > figcaption,
.entry-content .alignwide > figcaption,
.entry-content .alignfull > figcaption {
  padding: 0 var(--gutter);
  max-width: calc(var(--measure) + 2 * var(--gutter));
}

/* Embeds */
.wp-embed-responsive .wp-has-aspect-ratio .wp-block-embed__wrapper { position: relative; }
.wp-embed-responsive .wp-has-aspect-ratio .wp-block-embed__wrapper::before { content: ""; display: block; padding-top: 56.25%; }
.wp-embed-responsive .wp-has-aspect-ratio iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Tables */
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  margin: 0 0 1.5em;
}
.entry-content th, .entry-content td {
  text-align: left;
  vertical-align: top;
  padding: 0.5em 1em 0.5em 0;
  border-bottom: var(--rule-w) solid var(--rule);
}
.entry-content th {
  font-family: var(--mono);
  font-size: 0.75em;
  font-weight: 400;
  letter-spacing: var(--meta-track);
  text-transform: uppercase;
  color: var(--muted);
}

/* Separator block */
.entry-content .wp-block-separator {
  border: 0;
  width: auto;
  opacity: 1;
  background: none;
  height: auto;
}

/* Footnotes list: fallback if the sidenote transform did not run */
.entry-content .wp-block-footnotes {
  margin-top: 3em;
  padding-top: 1.25em;
  padding-left: 1.5em;
  border-top: var(--rule-w) solid var(--rule);
  font-size: 0.85em;
}

/* Columns, alignment helpers, buttons: kept sane in a narrow column */
.entry-content .wp-block-columns { display: flex; flex-wrap: wrap; gap: 1.5em; margin: 0 0 var(--para-space); }
.entry-content .wp-block-column { flex: 1 1 14em; min-width: 0; }
.entry-content .has-text-align-center { text-align: center; }
.entry-content .has-text-align-right { text-align: right; }
.entry-content .wp-block-buttons .wp-block-button__link {
  display: inline-block;
  padding: 0.5em 1em;
  border: var(--rule-w) solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--link);
  font-family: var(--mono);
  font-size: 0.8em;
  letter-spacing: var(--meta-track);
  text-decoration: none;
}

/* Tags line under a post */
.entry-footer {
  margin-top: 3rem;
  font-family: var(--mono);
  font-size: var(--meta-size);
  letter-spacing: var(--meta-track);
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.8;
}
.entry-footer a { color: var(--muted); text-decoration: none; }
@media (hover: hover) { .entry-footer a:hover { color: var(--hot); text-decoration: underline; } }

/* Paged posts */
.page-links {
  margin-top: 2em;
  font-family: var(--mono);
  font-size: var(--meta-size);
  letter-spacing: var(--meta-track);
  text-transform: uppercase;
  color: var(--muted);
}

/* ------------------------------------------------------------------
   8. Sidenotes: margin on desktop, inline toggle on narrow screens.
   CSS-only toggle (label + checkbox) so it works with JavaScript off.
   ------------------------------------------------------------------ */
.sidenote-number { counter-increment: sidenote-counter; cursor: pointer; }
.sidenote-number::after,
.sidenote::before {
  font-family: var(--mono);
  font-size: 0.65em;
  color: var(--link);
  vertical-align: super;
  line-height: 0;
  position: relative;
}
.sidenote-number::after { content: counter(sidenote-counter); top: -0.05em; padding: 0 0.15em; }
.sidenote::before { content: counter(sidenote-counter) "\2009"; top: -0.1em; }
@media (hover: hover) { .sidenote-number:hover::after { color: var(--hot); } }
.sidenote-number:focus-visible { outline: 2px solid var(--hot); outline-offset: 2px; }
.sidenote-toggle {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

/* Narrow: hidden until tapped, then a quiet inline block */
.sidenote { display: none; }
.sidenote-toggle:checked + .sidenote {
  display: block;
  margin: 0.75em 0 1em;
  padding-left: 1em;
  border-left: var(--rule-w) solid var(--rule);
  font-size: 0.85em;
  line-height: 1.55;
}

/* Wide: float into the right margin */
@media (min-width: 1200px) {
  .sidenote,
  .sidenote-toggle:checked + .sidenote {
    display: block;
    float: right;
    clear: right;
    width: var(--sidenote-w);
    margin: 0.15em calc(-1 * (var(--sidenote-w) + var(--sidenote-gap))) 1em 0;
    padding: 0;
    border: 0;
    font-size: 0.8em;
    line-height: 1.55;
    position: relative;
  }
  .sidenote-number { cursor: default; }
}

/* ------------------------------------------------------------------
   9. Comments (quiet, text only)
   ------------------------------------------------------------------ */
.comments-area {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: var(--rule-w) solid var(--rule);
}
.comments-title, .comment-reply-title {
  font-family: var(--mono);
  font-size: var(--meta-size);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5em;
}
.comment-reply-title small { font-size: 1em; margin-left: 1em; }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { margin-left: 1.5em; }
.comment { margin: 0 0 2em; }
.comment-meta {
  font-family: var(--mono);
  font-size: var(--meta-size);
  letter-spacing: var(--meta-track);
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0.5em;
}
.comment-meta a { color: var(--muted); text-decoration: none; }
.comment-author { color: var(--fg); }
.comment-content { font-size: 0.95em; }
.comment-content > :last-child { margin-bottom: 0; }
.comment-reply-link, .comment-edit-link {
  font-family: var(--mono);
  font-size: var(--meta-size);
  letter-spacing: var(--meta-track);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
}
.comment-awaiting-moderation { font-style: italic; color: var(--muted); font-size: 0.85em; }
.no-comments { color: var(--muted); font-style: italic; }
.comment-navigation { font-family: var(--mono); font-size: var(--meta-size); letter-spacing: var(--meta-track); text-transform: uppercase; margin: 1em 0 2em; }

.comment-form label,
.search-form label {
  display: block;
  font-family: var(--mono);
  font-size: var(--meta-size);
  letter-spacing: var(--meta-track);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4em;
}
.comment-form p { margin-bottom: 1.25em; }
.comment-form-cookies-consent { display: flex; gap: 0.6em; align-items: baseline; }
.comment-form-cookies-consent label { display: inline; text-transform: none; letter-spacing: 0; font-family: var(--serif); font-size: 0.85em; }
input[type="text"], input[type="email"], input[type="url"], input[type="search"], textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95em;
  color: var(--fg);
  background: transparent;
  border: var(--rule-w) solid var(--rule);
  border-radius: 0;
  padding: 0.5em 0.7em;
  -webkit-appearance: none;
  appearance: none;
}
input:focus-visible, textarea:focus-visible { border-color: var(--hot); outline: none; }
textarea { min-height: 8em; resize: vertical; }
button, input[type="submit"], .button {
  font-family: var(--mono);
  font-size: var(--meta-size);
  letter-spacing: var(--meta-track);
  text-transform: uppercase;
  color: var(--link);
  background: transparent;
  border: var(--rule-w) solid var(--rule);
  border-radius: 0;
  padding: 0.7em 1.2em;
  cursor: pointer;
}
@media (hover: hover) { button:hover, input[type="submit"]:hover, .button:hover { color: var(--hot); border-color: var(--hot); } }
.search-form { display: flex; gap: 0.75em; align-items: stretch; margin: 0 0 2.5rem; }
.search-form .search-field { flex: 1 1 auto; }
.search-form .search-submit { flex: none; }

/* ------------------------------------------------------------------
   10. Footer: archive, RSS, site name. Nothing follows you down the page.
   ------------------------------------------------------------------ */
.site-footer {
  margin-top: 5rem;
  padding: 1.5rem 0 3rem;
  border-top: var(--rule-w) solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75em 1.75em;
  font-family: var(--mono);
  font-size: var(--meta-size);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.6;
}
.site-footer__links { display: flex; flex-wrap: wrap; gap: 0.75em 1.75em; }
.site-footer a { color: var(--muted); text-decoration: none; }
@media (hover: hover) { .site-footer a:hover { color: var(--hot); text-decoration: underline; } }
.site-footer__name { margin-left: auto; }

/* ------------------------------------------------------------------
   11. Motion
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------------
   12. E-INK mode: built for reflective displays, not an inverted dark theme.
   Pure white, pure black, one mid-gray. No motion, no hover, no shadows,
   no gradients, no borders lighter than 1px solid black.
   ------------------------------------------------------------------ */
html.eink *, html.eink *::before, html.eink *::after {
  transition: none !important;
  animation: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  background-image: none !important;
}
html.eink body { -webkit-font-smoothing: auto; }
html.eink a { color: #000; text-decoration-color: #000; }
html.eink a:hover { color: #000; text-decoration-color: #000; }
html.eink :focus-visible { outline: 2px solid #000; outline-offset: 3px; }
html.eink ::selection { background: #000; color: #fff; }
html.eink .site-title a:hover,
html.eink .index-title a:hover,
html.eink .eink-toggle:hover,
html.eink .entry-meta a:hover,
html.eink .site-footer a:hover,
html.eink .index-nav a:hover,
html.eink .post-nav a:hover,
html.eink .entry-footer a:hover,
html.eink .post-nav a:hover .post-nav__title,
html.eink .sidenote-number:hover::after { color: inherit; text-decoration: inherit; }
html.eink .index-title a { color: #000; text-decoration: underline; text-decoration-thickness: 1px; }
html.eink .index-dek, html.eink .site-description { color: #000; }
html.eink .index-year, html.eink .page-title, html.eink .site-footer, html.eink .site-footer a,
html.eink .entry-meta, html.eink .entry-meta a, html.eink .index-date, html.eink figcaption,
html.eink .entry-content figcaption, html.eink .entry-content .wp-element-caption,
html.eink .comment-meta, html.eink .entry-footer, html.eink .entry-footer a,
html.eink .index-nav a, html.eink .post-nav a, html.eink .post-nav__label,
html.eink hr::before, html.eink .entry-content ::marker, html.eink .entry-content th,
html.eink .entry-content blockquote cite, html.eink .entry-content .wp-block-quote cite,
html.eink .entry-content .wp-block-pullquote cite { color: #555; }
html.eink .post-nav__title, html.eink .post-nav a .post-nav__title, html.eink .comment-author { color: #000; }
html.eink .sidenote-number::after, html.eink .sidenote::before { color: #000; }
html.eink .entry-content pre, html.eink .entry-content .wp-block-code, html.eink .entry-content .wp-block-preformatted,
html.eink input[type="text"], html.eink input[type="email"], html.eink input[type="url"], html.eink input[type="search"],
html.eink textarea, html.eink button, html.eink input[type="submit"], html.eink .button,
html.eink .entry-content .wp-block-buttons .wp-block-button__link { border: 1px solid #000; color: #000; }
html.eink mark { text-decoration-color: #000; }
html.eink .entry-content img,
html.eink .entry-content video { filter: grayscale(1) contrast(1.35); }
html.eink .eink-hide { display: none !important; }
html.eink .skip-link:focus { outline-color: #000; }

/* ------------------------------------------------------------------
   13. Print
   ------------------------------------------------------------------ */
@media print {
  :root {
    --bg: #fff; --fg: #000; --link: #000; --rule: #000; --hot: #000; --muted: #444;
    --size: 11.5pt; --lh: 1.5; --measure: none; --site-extra: 0px;
  }
  html, body { background: #fff; color: #000; }
  .site { max-width: none; padding: 0; min-height: 0; display: block; }
  .site > * { max-width: none; }
  .site-header { padding: 0 0 1.5rem; }
  .eink-toggle, .skip-link, .post-nav, .index-nav, .comments-area, .comment-respond, .site-footer__links, .search-form { display: none !important; }
  a { text-decoration: none; color: #000; }
  .entry-content a[href^="http"]::after { content: " (" attr(href) ")"; font-family: var(--mono); font-size: 0.75em; color: #444; word-break: break-all; }
  .sidenote, .sidenote-toggle:checked + .sidenote {
    display: inline; float: none; width: auto; margin: 0; padding: 0; border: 0;
    font-size: 0.85em; line-height: inherit;
  }
  .sidenote::before { content: " [" counter(sidenote-counter) "] "; vertical-align: baseline; top: 0; }
  .sidenote::after { content: " "; }
  .sidenote-number::after { content: "[" counter(sidenote-counter) "]"; vertical-align: baseline; top: 0; }
  .entry-content .alignwide, .entry-content .alignfull,
  .category-travel .entry-content .wp-block-image,
  .category-travel .entry-content .wp-block-gallery,
  .category-travel .entry-content .wp-block-video { width: 100%; max-width: 100%; margin-left: 0; margin-right: 0; }
  img { filter: none !important; max-width: 100%; page-break-inside: avoid; }
  h1, h2, h3 { page-break-after: avoid; }
  p, blockquote, pre, figure { page-break-inside: avoid; orphans: 3; widows: 3; }
  .site-footer { border-top: 1px solid #000; margin-top: 3rem; padding: 1rem 0 0; }
}
