/* Quiet Room — stefanerasmus.com
   Tokens are the single source of truth. Do not hardcode colours below. */

:root{
  --bg:#1A1A1A;
  --surface:#222222;
  --ink:#EDEDED;
  --accent:#FFFFFF;
  --muted:#8A8A8A;
  --line:#333333;

  --font:'Space Grotesk',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;

  --xs:8px; --sm:16px; --md:32px; --lg:64px; --xl:120px;

  --gutter:24px;
  --maxw:1400px;
  --measure:720px;
}

@media (min-width:900px){ :root{ --gutter:48px; } }

/* Neutralise UA defaults at zero specificity so component rules always win. */
:where(h1,h2,h3,h4,h5,h6,p,figure,blockquote,dl,dd,ul,ol){margin:0;padding:0}
:where(ul,ol){list-style:none}
:where(img,video,iframe){display:block;max-width:100%;height:auto;border:0}
:where(button,input,textarea,select){font:inherit;color:inherit;background:none;border:0;border-radius:0}

*,*::before,*::after{box-sizing:border-box}

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

body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--font);
  font-weight:400;
  font-size:19px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  font-synthesis-weight:none;
}

a{color:inherit;text-decoration:none}

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

:focus-visible{outline:1px solid var(--accent);outline-offset:3px;border-radius:0}

/* ---------- Shared container. Every template uses this one. ---------- */

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

/* ---------- Small tracked label. The only tracked type on the site. ---------- */

.label{
  font-size:12px;
  line-height:1.4;
  font-weight:400;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:var(--muted);
}

/* ---------- Header ---------- */

.site-header{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:var(--md);
  padding-block:var(--md);
}

.wordmark{
  font-size:15px;
  font-weight:500;
  text-transform:uppercase;
  letter-spacing:.1em;
  color:var(--ink);
  white-space:nowrap;
  transition:color .2s ease;
}
.wordmark:hover{color:var(--accent)}

.site-nav ul{
  display:flex;
  gap:var(--md);
}

.site-nav a{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:var(--muted);
  padding-bottom:2px;
  border-bottom:1px solid transparent;
  transition:color .2s ease,border-color .2s ease;
}
.site-nav a:hover{color:var(--accent)}
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a,
.site-nav .is-current > a,
.site-nav a[aria-current="page"]{
  color:var(--ink);
  border-bottom-color:var(--ink);
}

@media (max-width:520px){
  .site-header{flex-direction:column;align-items:flex-start;gap:var(--sm)}
  .site-nav ul{gap:var(--sm)}
}

/* ---------- Journal grid ---------- */

.journal{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  column-gap:var(--sm);
  row-gap:var(--lg);
  padding-top:var(--lg);
  padding-bottom:var(--xl);
}

@media (max-width:1100px){ .journal{grid-template-columns:repeat(2,1fr);row-gap:var(--md)} }
@media (max-width:600px){ .journal{grid-template-columns:1fr;row-gap:var(--lg)} }

.entry__media{
  display:block;
  aspect-ratio:2/3;
  overflow:hidden;
  background:var(--surface);
  margin-bottom:var(--sm);
}
.entry__media img{width:100%;height:100%;object-fit:cover}

/* Posts with no image keep the layout intact rather than collapsing. */
.entry__media--empty{
  background:
    repeating-linear-gradient(135deg,var(--surface) 0 10px,var(--bg) 10px 20px);
}

.entry__meta{margin-bottom:var(--xs)}

.entry__title{
  font-size:clamp(1.25rem,1.5vw,1.5rem);
  font-weight:500;
  line-height:1.15;
  letter-spacing:-.01em;
  color:var(--ink);
  margin-bottom:var(--sm);
}
.entry__title a{transition:color .2s ease}
.entry__title a:hover{color:var(--accent)}

.entry__more{
  font-size:13px;
  color:var(--muted);
  border-bottom:1px solid var(--line);
  padding-bottom:1px;
  transition:color .2s ease,border-color .2s ease;
}
.entry__more:hover{color:var(--accent);border-bottom-color:var(--accent)}

/* ---------- Filter row ---------- */

.filters{
  display:flex;
  flex-wrap:wrap;
  gap:var(--sm) var(--md);
  padding-top:var(--md);
  padding-bottom:var(--xs);
}
.filters a{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:var(--muted);
  padding-bottom:2px;
  border-bottom:1px solid transparent;
  transition:color .2s ease,border-color .2s ease;
}
.filters a:hover{color:var(--accent)}
.filters a.is-current{color:var(--ink);border-bottom-color:var(--ink)}

/* ---------- Reading column ---------- */

.reading{
  max-width:var(--measure);
  margin-inline:auto;
  padding-top:var(--lg);
  padding-bottom:var(--xl);
}

.reading__meta{margin-bottom:var(--sm)}

.reading__title{
  font-size:clamp(2rem,4.5vw,3.25rem);
  font-weight:500;
  line-height:1.08;
  letter-spacing:-.02em;
  margin-bottom:var(--md);
}

.reading__hero{margin-bottom:var(--md)}
.reading__hero img{width:100%}

.prose > * + *{margin-top:.58em}
.prose h2{font-size:1.5rem;font-weight:500;line-height:1.2;margin-top:2em}
.prose h3{font-size:1.2rem;font-weight:500;line-height:1.25;margin-top:1.8em}
.prose a{border-bottom:1px solid var(--line);transition:color .2s ease,border-color .2s ease}
.prose a:hover{color:var(--accent);border-bottom-color:var(--accent)}
.prose img,.prose figure{margin-block:var(--md)}
.prose figcaption{font-size:13px;color:var(--muted);margin-top:var(--xs)}
.prose ul{list-style:disc;padding-left:1.2em}
.prose ol{list-style:decimal;padding-left:1.2em}
.prose li + li{margin-top:.4em}
.prose blockquote{
  border:0;margin:var(--md) 0;padding:0 0 0 var(--sm);
  border-left:1px solid var(--line);color:var(--muted);
}
.prose hr{border:0;border-top:1px solid var(--line);margin-block:var(--lg)}

/* Poetry keeps its own line breaks and never justifies. */
.prose .poem,.prose pre{
  white-space:pre-wrap;
  font-family:var(--font);
  font-size:inherit;
  line-height:1.5;
}

/* Embeds stay 16:9 and responsive. */
.prose iframe,.prose .wp-block-embed__wrapper iframe{width:100%;aspect-ratio:16/9;height:auto}
.prose audio{width:100%}

/* ---------- Post footer nav ---------- */

.postnav{
  display:flex;
  justify-content:space-between;
  gap:var(--md);
  margin-top:var(--lg);
  padding-top:var(--md);
  border-top:1px solid var(--line);
}
.postnav a{
  font-size:11px;text-transform:uppercase;letter-spacing:.12em;
  color:var(--muted);transition:color .2s ease;
}
.postnav a:hover{color:var(--accent)}

/* ---------- Pagination ---------- */

.pagination{
  display:flex;gap:var(--sm);
  padding-bottom:var(--xl);
}
.pagination .page-numbers{
  font-size:11px;text-transform:uppercase;letter-spacing:.12em;
  color:var(--muted);padding-bottom:2px;
  border-bottom:1px solid transparent;transition:color .2s ease,border-color .2s ease;
}
.pagination .page-numbers:hover{color:var(--accent)}
.pagination .page-numbers.current{color:var(--ink);border-bottom-color:var(--ink)}

/* ---------- Footer ---------- */

.site-footer{
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  justify-content:space-between;
  gap:var(--sm) var(--md);
  padding-block:var(--md);
  border-top:1px solid var(--line);
}
.site-footer a{transition:color .2s ease}
.site-footer a:hover{color:var(--accent)}
.site-footer ul{display:flex;gap:var(--md)}

/* ---------- Forms (contact) ---------- */

.field{margin-bottom:var(--md)}
.field label{display:block;margin-bottom:var(--xs)}
.field input,.field textarea{
  width:100%;
  background:transparent;
  color:var(--ink);
  border:1px solid var(--line);
  padding:12px 14px;
  transition:border-color .2s ease;
}
.field input:focus,.field textarea:focus{border-color:var(--ink);outline:0}
.field textarea{min-height:180px;resize:vertical}
.field ::placeholder{color:var(--muted);opacity:1}

.submit{
  font-size:11px;text-transform:uppercase;letter-spacing:.12em;
  color:var(--ink);cursor:pointer;
  border-bottom:1px solid var(--ink);padding-bottom:2px;
  transition:color .2s ease,border-color .2s ease;
}
.submit:hover{color:var(--accent);border-bottom-color:var(--accent)}

/* ---------- Utility ---------- */

.screen-reader-text{
  position:absolute;width:1px;height:1px;overflow:hidden;
  clip:rect(1px,1px,1px,1px);white-space:nowrap;
}

.skip-link{
  position:absolute;left:-9999px;top:0;
  background:var(--ink);color:var(--bg);padding:10px 16px;z-index:100;
}
.skip-link:focus{left:var(--gutter)}

/* Motion dial is 0.05. Colour and border transitions only, and even those
   collapse when the visitor asks for reduced motion. */
@media (prefers-reduced-motion:reduce){
  *{transition:none !important;animation:none !important;scroll-behavior:auto !important}
}

/* Poetry titles are set lowercase, matching how the poems are written.
   Driven by the post's category, so new poems inherit it automatically.
   text-transform only changes the rendering; the stored title is untouched. */
.category-poetry .entry__title,
.category-poetry .reading__title{
  text-transform:lowercase;
}
