* {
  box-sizing: border-box;
}

:root {
  --color-bg: #FFEED9;
  --color-text: rgb(51, 51, 51);
  --color-accent: #FF4E02;
  --color-muted: #666;
  --color-faint: #888;
  --color-border: #bbb;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Times/Georgia draw ▽/△ as a narrow isoceles shape, not equilateral;
     Verdana draws them correctly, so the nav triangles borrow it. */
  --font-nav: Verdana, sans-serif;
}

/* Fluid type scale, mirroring practicaltypography.com's own approach:
   grows with viewport width between a mobile and desktop floor/ceiling. */
html {
  font-size: clamp(16px, 2vw, 20px);
}

body {
  margin: 0 auto;
  width: 90%;
  max-width: 700px;
  padding: 1.5rem;
  font-family: serif;
  line-height: 1.4;
  background: var(--color-bg);
  color: var(--color-text);
}

/* --- Header --- */

.site-name,
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

/* Site name sits atop the same heading scale as entry-title below it, rather
   than reading as plain body text with no hierarchy of its own. */
.site-name {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.site-name a {
  color: inherit;
  text-decoration: none;
}

.site-name a:hover {
  color: var(--color-accent);
}

.site-nav {
  font-size: 1rem;
}

/* On hover, the nav triangles swap to a filled glyph instead of the usual
   accent-color treatment: hide the real glyph (keeping its box, so nothing
   shifts) and reveal a filled one in its place via ::after. */
.nav-triangle {
  font-family: var(--font-nav);
  position: relative;
  display: inline-block;
}

.site-name a.nav-triangle,
.site-footer a.nav-triangle {
  text-decoration: none;
}

.site-name a.nav-triangle:hover,
.site-footer a.nav-triangle:hover {
  color: inherit;
  visibility: hidden;
}

.nav-triangle-down:hover::after {
  content: '▼';
}

.nav-triangle-up:hover::after {
  content: '▲';
}

.site-name a.nav-triangle:hover::after,
.site-footer a.nav-triangle:hover::after {
  visibility: visible;
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-nav);
}

/* --- Entry title & meta (permalink page) --- */

.entry-title {
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  margin: 1.5rem 0 0.6rem;
  color: inherit;
}

.entry-meta,
.entry-date {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--color-muted);
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin: 1.2rem 0;
}

.entry-meta a {
  color: inherit;
  text-decoration: none;
}

.entry-meta a:hover {
  text-decoration: underline;
}

.entry-date {
  white-space: nowrap;
}

/* Active tag filters on tag pages: white pills that read as removable chips. */
.tag-pill {
  background: #fff;
  border-radius: 999px;
  padding: 0.05em 0.7em;
}

.entry-meta a.tag-pill:hover {
  text-decoration: none;
  color: var(--color-accent);
}

/* The "x" on an active filter, marking that clicking removes it: accent
   normally, black while the pill is hovered (when the tag text turns accent). */
.tag-remove {
  color: var(--color-accent);
}

.tag-pill:hover .tag-remove {
  color: #000;
}

/* The trailing date links to its day archive: plain until hovered, then the
   text turns the accent color (no underline). */
.entry-date a {
  color: inherit;
  text-decoration: none;
}

.entry-date a:hover {
  color: var(--color-accent);
}

.empty {
  color: var(--color-faint);
}

/* Heading on the day/month archive pages. Same type as .entry-title, but with
   more room below it since it introduces a list of entries rather than one. */
.archive-title {
  font-size: 24px;
  line-height: 30px;
  font-weight: 700;
  margin: 1.5rem 0 1.4rem;
  color: inherit;
}

/* --- Archive page --- */

.archive-select {
  font: inherit;
  font-size: 1rem;
  color: var(--color-text);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.3em 0.6em;
  margin: 0;
}

/* Section labels on the archive page ("By month", "By tags"). */
.archive-subhead {
  font-size: 24px;
  line-height: 30px;
  font-style: italic;
  font-weight: 400;
  margin: 1.8rem 0 0.6rem;
}

.archive-title + .archive-subhead {
  margin-top: 0;
}

/* --- Entry body (post content) --- */

.entry {
  font-size: 24px;
  line-height: 30px;
}

.entry > *:first-child {
  margin-top: 0;
}

.entry > *:last-child {
  margin-bottom: 0;
}

.entry img {
  max-width: 100%;
}

/* robarcand.info's link treatment: black text, quietly marked by a colored,
   offset underline rather than colored link text. Shared with the footer's
   attribution/nav links. */
.entry a:not(.entry-marker):not(.entry-date a),
.site-footer a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-underline-offset: 4px;
}

.entry a:not(.entry-marker):not(.entry-date a):hover,
.site-footer a:hover {
  color: var(--color-accent);
}

.entry-marker {
  color: var(--color-accent);
  text-decoration: none;
}

.entry-marker:hover {
  text-decoration: underline;
}

.entry-sep {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1.5rem 0;
}

/* --- Footer --- */

.site-footer {
  font-size: 24px;
  margin: 0;
  /* The triangle sits on the footer's last line ("Archive / RSS"), not the
     first. flex-end is the fallback for browsers without `last baseline`. */
  align-items: flex-end;
  align-items: last baseline;
}

.site-footer p {
  margin: 0;
}

.site-footer p + p {
  margin-top: 0.5em;
}

/* Mobile: matches robarcand.info's own paragraph-text breakpoint — it steps
   the post body down a size rather than scaling it fluidly; entry-title
   stays fixed there too, same as robarcand's own h1. */
@media (max-width: 768px) {
  .entry,
  .archive-subhead,
  .site-footer {
    font-size: 20px;
    line-height: 28px;
  }
}
