/*
Theme Name: Pipes.Lv v3 — The Study
Theme URI: https://www.pipes.lv/
Author: coldmoon
Description: Dark, warm, story-first theme for pipes.lv. Walnut and brass, serif typography, made for reading fiction by lamplight.
Version: 1.0.0
Text Domain: pipeslv3
*/

/* ---------- Tokens ---------- */
:root {
  --bg: #14100d;
  --surface: #1c1613;
  --surface-2: #261e18;
  --line: #3a2e24;
  --text: #e9decc;
  --muted: #a9987f;
  --brass: #c9a25e;
  --brass-hi: #e3be7c;
  --ember: #c4673a;

  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "Lora", Georgia, "Times New Roman", serif;

  --wrap: 1180px;
  --measure: 40.5rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 3px;
}

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

html { color-scheme: dark; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(201, 162, 94, 0.07), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--brass); text-decoration: none; transition: color .2s; }
a:hover { color: var(--brass-hi); }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 3px; }

::selection { background: var(--brass); color: var(--bg); }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 .5em;
  letter-spacing: .005em;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link { position: absolute; left: -999px; top: 0; background: var(--brass); color: var(--bg); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(20, 16, 13, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; min-height: 4.5rem; }

.brand {
  font-family: var(--font-display);
  font-size: 2rem; font-weight: 700; letter-spacing: .01em;
  color: var(--text); line-height: 1;
}
.brand span { color: var(--brass); font-style: italic; font-weight: 500; }
.brand { display: inline-flex; align-items: center; }
/* crossed-pipes emblem: the site icon recoloured to brass, transparent background */
.brand__mark { width: 2.6rem; height: 2.6rem; flex: none; margin-right: .6rem; }
.brand--lg .brand__mark { width: 3.4rem; height: 3.4rem; margin-right: .75rem; }
@media (max-width: 720px) { .brand__mark { width: 2.2rem; height: 2.2rem; } .brand--lg .brand__mark { width: 3rem; height: 3rem; } }
.brand:hover { color: var(--text); }
.brand--lg { font-size: 2.6rem; }

.primary-nav { display: flex; align-items: center; gap: 1.75rem; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.4rem; }
.primary-nav li a {
  font-family: var(--font-display); white-space: nowrap;
  font-size: 1.02rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
  padding: .35rem 0;
  border-bottom: 1px solid transparent;
}
.primary-nav li a:hover,
.primary-nav li.current-menu-item a,
.primary-nav li.current-cat a { color: var(--text); border-bottom-color: var(--brass); }
.nav-search { color: var(--muted); display: inline-flex; padding: .4rem; }
.nav-search:hover { color: var(--brass-hi); }

.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--text); padding: .45rem .8rem; border-radius: var(--radius); font: inherit; font-size: .85rem; cursor: pointer; align-items: center; gap: .6rem; }
.nav-toggle__bars, .nav-toggle__bars::before { display: block; width: 18px; height: 1.5px; background: currentColor; position: relative; }
.nav-toggle__bars::before { content: ""; position: absolute; top: 5px; }

.progress { position: absolute; left: 0; bottom: -1px; width: 100%; height: 2px; pointer-events: none; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brass), var(--ember)); transform: scaleX(0); transform-origin: 0 50%; }

/* ---------- Shared bits ---------- */
.kicker {
  font-family: var(--font-body);
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 .75rem;
}
.kicker a { color: inherit; }
.kicker a:hover { color: var(--brass-hi); }
.kicker--gold, .kicker--gold a { color: var(--brass); }

.ornament { display: block; width: 100%; max-width: 180px; height: 1px; margin: 2rem 0 0; background: linear-gradient(90deg, var(--brass), transparent); position: relative; }
.ornament::after { content: ""; position: absolute; left: 0; top: -3px; width: 7px; height: 7px; background: var(--brass); transform: rotate(45deg); }
.ornament--end { margin-inline: auto; background: linear-gradient(90deg, transparent, var(--brass), transparent); }
.ornament--end::after { left: calc(50% - 3.5px); }

.button, .search-form button, .more-link {
  display: inline-block;
  font-family: var(--font-body); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
  background: transparent; color: var(--brass);
  border: 1px solid var(--brass); border-radius: var(--radius);
  padding: .85rem 1.5rem; cursor: pointer; transition: background .2s, color .2s;
}
.button:hover, .search-form button:hover, .more-link:hover { background: var(--brass); color: var(--bg); }

.more { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
.more span { display: inline-block; transition: transform .2s; }
.more:hover span { transform: translateX(4px); }

.section { padding-block: 4rem; }
.section--flush { padding-top: 1rem; }
.section__head { margin-bottom: 2.25rem; }
.section__title { font-size: clamp(1.9rem, 3vw, 2.5rem); margin: 0; font-weight: 600; }
.section__head .ornament { margin-top: 1rem; }

.notice { padding: 1.5rem; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); color: var(--muted); }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; min-height: min(78vh, 720px); display: flex; align-items: flex-end; border-bottom: 1px solid var(--line); overflow: hidden; background: var(--surface); }
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) brightness(.8); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background:
  linear-gradient(0deg, var(--bg) 2%, rgba(20,16,13,.78) 38%, rgba(20,16,13,.25) 100%),
  linear-gradient(90deg, rgba(20,16,13,.7), transparent 65%); }
.hero__inner { padding-block: clamp(3rem, 8vw, 6rem); }
.hero__text { max-width: 40rem; }
.hero__title { font-size: clamp(2.6rem, 6.2vw, 4.9rem); font-weight: 600; margin-bottom: 1rem; }
.hero__title a { color: var(--text); }
.hero__title a:hover { color: var(--brass-hi); }
.hero__excerpt { color: #d6c9b4; font-size: 1.1rem; max-width: 34rem; }
.hero__excerpt p { margin: 0 0 1rem; }
.hero__meta { color: var(--muted); font-size: .82rem; letter-spacing: .06em; margin: 0 0 1.75rem; }

/* ---------- Characters ---------- */
.characters { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.character {
  display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; align-items: center;
  padding: 1.1rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); transition: border-color .2s, background .2s, transform .2s;
}
.character:hover { border-color: var(--brass); background: var(--surface-2); color: var(--text); transform: translateY(-2px); }
.character__mark { grid-row: span 2; width: 2.9rem; height: 2.9rem; display: grid; place-items: center; border: 1px solid var(--brass); border-radius: 50%; font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--brass); }
.character__name { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; line-height: 1.1; }
.character__count { font-size: .75rem; letter-spacing: .08em; color: var(--muted); }

/* ---------- Cards / grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem 2rem; }
.card { display: flex; flex-direction: column; }
.card__media { display: block; aspect-ratio: 10 / 7; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.25rem; }
.card__media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.88); transition: transform .6s ease, filter .3s; }
.card:hover .card__media img { transform: scale(1.04); filter: saturate(1); }
.card__placeholder { width: 100%; height: 100%; display: grid; place-items: center; font-family: var(--font-display); font-size: 5rem; color: var(--brass); background: radial-gradient(circle at 30% 20%, var(--surface-2), var(--surface)); }
.card__title { font-size: 1.7rem; margin-bottom: .6rem; }
.card__title a { color: var(--text); }
.card__title a:hover { color: var(--brass-hi); }
.card__excerpt { color: #c9bca6; font-size: .97rem; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 1rem; }
.card__excerpt p { margin: 0; }

/* ---------- Archive head ---------- */
.archive-head { padding-block: clamp(3rem, 7vw, 5.5rem) 2rem; }
.archive-title { font-size: clamp(2.6rem, 6vw, 4.6rem); margin-bottom: 1rem; }
.archive-desc { max-width: 40rem; color: #d6c9b4; font-size: 1.1rem; }
.archive-desc p { margin: 0 0 1rem; }

/* ---------- Story ---------- */
.story-head { max-width: calc(var(--measure) + 2 * var(--gutter)); padding-block: clamp(3rem, 7vw, 5.5rem) 2.5rem; text-align: left; }
.story-title { font-size: clamp(2.5rem, 6vw, 4.4rem); font-weight: 600; margin-bottom: 1rem; }
.story-meta { color: var(--muted); font-size: .85rem; letter-spacing: .06em; margin: 0; }

.story-figure { margin: 0 auto 3.5rem; max-width: 1100px; padding-inline: var(--gutter); }
.story-figure img { width: 100%; max-height: 640px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }

.entry-content { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.entry-content > * { max-width: var(--measure); margin-inline: auto; }
.entry-content p { margin: 0 auto 1.5em; }
.entry-content > p:first-of-type { font-size: 1.15rem; color: #f1e7d6; }
.entry-content > p:first-of-type::first-letter {
  float: left; font-family: var(--font-display); font-weight: 600; color: var(--brass);
  font-size: 5.1rem; line-height: .78; padding: .45rem .75rem 0 0;
}
.entry-content h2 { font-size: 2.2rem; margin: 2.5em auto .6em; }
.entry-content h3 { font-size: 1.7rem; margin: 2em auto .5em; color: var(--brass-hi); }
.entry-content h4 { font-size: 1.35rem; margin: 1.8em auto .4em; }
.entry-content a { text-decoration: underline; text-decoration-color: rgba(201,162,94,.4); text-underline-offset: 3px; }
.entry-content a:hover { text-decoration-color: var(--brass-hi); }
.entry-content ul, .entry-content ol { padding-left: 1.4em; margin-bottom: 1.5em; }
.entry-content li { margin-bottom: .4em; }
.entry-content li::marker { color: var(--brass); }

.entry-content blockquote {
  margin: 2.5rem auto; padding: .25rem 0 .25rem 1.75rem;
  border-left: 2px solid var(--brass);
  font-family: var(--font-display); font-size: 1.75rem; font-style: italic; line-height: 1.35; color: var(--text);
}
.entry-content blockquote p { margin-bottom: .6em; }
.entry-content blockquote cite { font-family: var(--font-body); font-size: .8rem; font-style: normal; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.entry-content hr { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--brass), transparent); margin: 3rem auto; }
.entry-content .wp-block-separator { opacity: 1; }

.entry-content figure { margin: 2.5rem auto; }
.entry-content img { border-radius: var(--radius); }
.entry-content figcaption, .wp-caption-text { font-size: .82rem; color: var(--muted); text-align: center; margin-top: .6rem; font-style: italic; }
.entry-content .alignwide { max-width: 1000px; }
.entry-content .alignfull { max-width: none; }
.entry-content .alignleft { float: left; margin: .3rem 2rem 1rem 0; max-width: 45%; }
.entry-content .alignright { float: right; margin: .3rem 0 1rem 2rem; max-width: 45%; }
.entry-content .aligncenter { margin-inline: auto; }
.entry-content .article-image-left { float: left; margin: .3rem 2rem 1rem 0; }
.entry-content .wp-block-columns { max-width: 1000px; display: flex; gap: 1.75rem; align-items: stretch; margin-block: 0; }
.entry-content .wp-block-column { flex: 1 1 0; min-width: 0; position: relative; }
.entry-content .wp-block-columns > .wp-block-column:not(:first-child) { margin-left: 0; } /* cancel WordPress core's extra 32px */
/* same thin rule between columns as .story-columns, centred in the gap */
.entry-content .wp-block-column + .wp-block-column::before { content: ""; position: absolute; top: 0; bottom: 0; left: -.875rem; width: 1px; background: var(--line); }
.entry-content .wp-block-column > *:last-child { margin-bottom: 0; }
.entry-content .wp-block-column p { font-size: 1rem; }
.entry-content .wp-block-column figure { margin-block: 0 1.5rem; }

.entry-content table { width: 100%; border-collapse: collapse; margin-block: 2rem; font-size: .95rem; background: var(--surface); border: 1px solid var(--line); }
.entry-content td, .entry-content th { padding: .65rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.entry-content th { font-family: var(--font-display); font-size: 1.1rem; color: var(--brass-hi); background: var(--surface-2); }
.entry-content .wp-block-table, .entry-content .top-list, .entry-content .value-table { max-width: 1000px; overflow-x: auto; }
.value-table table { border-left: 3px solid var(--brass); }
.value-table table > tbody > tr > td:first-child { font-weight: 600; color: var(--text); }
.value-table table > tbody > tr > td:last-child { color: var(--brass-hi); }

.entry-content iframe { width: 100%; border: 0; }
.entry-content pre, .entry-content code { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: .9em; }
.entry-content code { padding: .1em .35em; }
.entry-content pre { padding: 1rem; overflow-x: auto; }
.entry-content .wp-block-gallery { max-width: 1000px; }
.entry-content::after { content: ""; display: block; clear: both; }

.entry-content--page { padding-bottom: 4rem; }


/* Story text in columns — [columns] shortcode */
.entry-content .story-columns { max-width: 1000px; column-gap: 1.75rem; column-count: 3; column-rule: 1px solid var(--line); }
.entry-content .story-columns--2 { column-count: 2; }
.entry-content .story-columns--4 { column-count: 4; }
.entry-content .story-columns > * { max-width: none; }
/* author's signature under a dated story, right edge of the columns */
.entry-content .story-signature { max-width: 1000px; margin: 2rem auto 0; text-align: right; }
.story-signature img { display: inline-block; width: 190px; height: auto; opacity: .85; }
@media (max-width: 782px) { .story-signature img { width: 160px; } }
.entry-content .story-columns p { font-size: 1rem; margin-inline: 0; }
.entry-content .story-columns blockquote p { font-size: inherit; }
.entry-content .story-columns > p:first-of-type { font-size: 1rem; color: inherit; }
.entry-content .story-columns > p:first-of-type::first-letter { float: left; font-family: var(--font-display); font-weight: 600; color: var(--brass); font-size: 3.6rem; line-height: .78; padding: .3rem .5rem 0 0; }
.entry-content .story-columns h2, .entry-content .story-columns h3, .entry-content .story-columns h4 { break-after: avoid; margin-inline: 0; margin-top: 1.4em; }
.entry-content .story-columns > :first-child { margin-top: 0; }
.entry-content .story-columns figure, .entry-content .story-columns img { break-inside: avoid; margin-inline: 0; }
.entry-content .story-columns blockquote { column-span: all; max-width: var(--measure); margin-inline: auto; }
/* the tobacco box lives inside a single column so it never splits the text flow */
.entry-content .story-columns .pipe-box { break-inside: avoid; margin: .25rem 0 1.75rem; padding: 1.1rem 1.25rem 1rem; }
.entry-content .story-columns .pipe-box dl { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem 1.5rem; }
.entry-content .story-columns .pipe-box dd { font-size: 1.2rem; }
@media (max-width: 1100px) { .entry-content .story-columns, .entry-content .story-columns--4 { column-count: 2; } }
@media (max-width: 782px) {
  .entry-content .story-columns, .entry-content .story-columns--2, .entry-content .story-columns--4 { column-count: 1; column-rule: 0; max-width: var(--measure); }
  /* one wide column again: the tobacco box can go back to its grid */
  .entry-content .story-columns .pipe-box { padding: 1.5rem 1.75rem 1.25rem; margin: 2rem 0; }
  .entry-content .story-columns .pipe-box dl { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem 2rem; }
}

/* "In the pipe" box — [pipe_box] shortcode */
.pipe-box {
  margin: 2.75rem auto; padding: 1.5rem 1.75rem 1.25rem;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-top: 2px solid var(--brass); border-radius: var(--radius);
  clear: both;
}
.pipe-box__title { font-size: .78rem; font-family: var(--font-body); font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--brass); margin: 0 0 1rem; }
.pipe-box dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem 2rem; }
.pipe-box dt { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.pipe-box dd { margin: .1rem 0 0; font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; line-height: 1.2; color: var(--text); }

/* Story footer */
.story-foot { max-width: calc(var(--measure) + 2 * var(--gutter)); padding-block: 3rem 1rem; text-align: center; }
.story-foot__series { color: var(--muted); font-size: .9rem; margin: 1.5rem 0 2.5rem; }
.story-foot__note { color: var(--muted); font-size: .8rem; font-style: italic; max-width: 34rem; margin: -1.5rem auto 2.5rem; opacity: .8; }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; text-align: left; }
.post-navigation a { display: block; padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; line-height: 1.2; color: var(--text); height: 100%; transition: border-color .2s; }
.post-navigation a:hover { border-color: var(--brass); color: var(--brass-hi); }
.post-navigation a span { display: block; font-family: var(--font-body); font-size: .68rem; font-weight: 400; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: .35rem; }
.post-navigation .nav-next { text-align: right; grid-column: 2; }
.post-navigation .nav-previous:only-child { grid-column: 1; }

/* ---------- Pagination ---------- */
.pagination { margin-top: 4rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; align-items: center; }
.pagination .page-numbers { min-width: 2.6rem; padding: .55rem .9rem; text-align: center; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); font-size: .9rem; }
.pagination a.page-numbers:hover { border-color: var(--brass); color: var(--brass-hi); }
.pagination .current { border-color: var(--brass); color: var(--bg); background: var(--brass); }
.pagination .dots { border: 0; }

/* ---------- Forms ---------- */
.search-form { display: flex; gap: .5rem; }
.search-form input[type="search"] {
  flex: 1; min-width: 0; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: .75rem 1rem; font: inherit; font-size: .95rem;
}
.search-form input[type="search"]::placeholder { color: var(--muted); }
.search-form input[type="search"]:focus { outline: none; border-color: var(--brass); }
.search-form button { padding: .75rem 1.1rem; }
.search-form--lg { max-width: 34rem; margin-top: 1.5rem; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 3rem; padding-block: 4rem 2.5rem; border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--surface), var(--bg)); }
.footer-brand { margin-bottom: 3rem; }
.footer-tag { margin: .5rem 0 0; color: var(--muted); font-family: var(--font-display); font-style: italic; font-size: 1.2rem; }
.footer-cols { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 3rem; }
.site-footer h5 { font-family: var(--font-body); font-size: .72rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--brass); margin-bottom: 1.1rem; }
.site-footer h5.mt { margin-top: 2.25rem; }
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li { margin-bottom: .85rem; line-height: 1.35; }
.footer-list a { color: var(--text); font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.footer-list a:hover { color: var(--brass-hi); }
.footer-list time { display: block; font-size: .75rem; color: var(--muted); margin-top: .15rem; }
.footer-list--plain li { margin-bottom: .5rem; }
.footer-social { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-legal { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.footer-legal p { margin: 0 0 .4rem; max-width: 60rem; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-cols section:first-child { grid-column: 1 / -1; }
}

@media (max-width: 782px) {
  .entry-content .wp-block-columns { flex-direction: column; gap: 0; max-width: var(--measure); }
  .entry-content .wp-block-column + .wp-block-column::before { display: none; }
}

/* collapse the menu early: the live menu has five long labels ("Tabakas maisījumu TOP" etc.) that
   need about 1180px in one line */
@media (max-width: 1180px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: flex-start; gap: 1rem;
    padding: 1.25rem var(--gutter) 1.75rem; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav ul { flex-direction: column; gap: .9rem; }
}

@media (max-width: 720px) {
  body { font-size: 1.02rem; }
  .grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; gap: 2.5rem; }
  .post-navigation .nav-links { grid-template-columns: 1fr; }
  .post-navigation .nav-next { grid-column: 1; text-align: left; }
  .entry-content blockquote { font-size: 1.45rem; }
  .entry-content > p:first-of-type::first-letter { font-size: 4.2rem; }
  .entry-content .alignleft, .entry-content .alignright, .entry-content .article-image-left { float: none; margin: 1.5rem auto; max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Diary dateline ---------- */
.dateline { margin: 0 0 .9rem; font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: clamp(1.35rem, 2.4vw, 1.75rem); color: var(--brass-hi); line-height: 1.2; }
.dateline:has(+ .byline) { margin-bottom: .35rem; }
.byline { margin: 0 0 .9rem; font-family: var(--font-display); font-variant: small-caps; font-size: 1.15rem; letter-spacing: .08em; color: var(--muted); }
.archive-note { margin: 1.25rem 0 0; font-family: var(--font-display); font-style: italic; font-size: 1.2rem; color: var(--muted); }

/* Illustrated stories: artwork on the right, text on a clean background */
.hero--art .hero__media { left: 36%; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22%); mask-image: linear-gradient(90deg, transparent 0, #000 22%); }
.hero--art .hero__media img { filter: none; object-position: 50% 50%; }
.hero--art .hero__text { max-width: 30rem; }
.hero--art::before { background: linear-gradient(0deg, var(--bg) 0, rgba(20,16,13,0) 22%); }
/* Phones / tablet portrait: the whole picture above the text, nothing cropped or darkened */
@media (max-width: 900px) {
  .hero--art { display: block; min-height: 0; background: var(--bg); }
  .hero--art::before { display: none; }
  .hero--art .hero__media { position: relative; inset: auto; z-index: auto; display: block; aspect-ratio: 16 / 9; -webkit-mask-image: none; mask-image: none; }
  .hero--art .hero__media img { filter: none; object-position: 50% 50% !important; }
  .hero--art .hero__inner { padding-block: 1.75rem 3rem; }
  .hero--art .hero__text { max-width: 40rem; }
}
