/* Palette and type follow the WordPress "Luminance" theme the site used */
:root {
  --base: #eae8db;
  --contrast: #29281f;
  --muted: #5d5b4c;
  --rule: #cfccba;
  --code-bg: #29281f;
  --code-fg: #ffffff;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --content: 800px;
  --wide: 1200px;
}

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

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

body {
  margin: 0;
  background: var(--base);
  color: var(--contrast);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.65;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 32px; } }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; background: var(--contrast); color: var(--base); padding: 8px 12px; z-index: 10; }

/* Header / footer */
.site-header { border-bottom: 1px solid var(--rule); margin-bottom: clamp(2rem, 5vw, 4rem); }
.header-inner { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem; padding-top: 1.5rem; padding-bottom: 1.25rem; }
.site-title { font-family: var(--serif); font-size: clamp(2rem, 1.5rem + 2vw, 2.986rem); line-height: 1; text-decoration: none; }
.site-description { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.95rem; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-nav a { text-decoration: none; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; }

.site-footer { border-top: 1px solid var(--rule); margin-top: clamp(3rem, 8vw, 6rem); font-size: 0.9rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 1.5rem; padding-bottom: 2rem; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }

/* Post grid (home and archives) */
.post-grid { display: grid; gap: clamp(2rem, 4vw, 3rem) 2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.post-card-image { display: block; aspect-ratio: 4 / 3; overflow: hidden; margin-bottom: 1rem; background: var(--rule); }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.44rem, 1.2rem + 0.8vw, 2.074rem); line-height: 1.15; margin: 0 0 0.35rem; }
.post-card-title a { text-decoration: none; }
.post-card-title a:hover { text-decoration: underline; }
.post-card-excerpt { margin: 0.5rem 0 0; color: var(--muted); }
.post-meta { color: var(--muted); font-size: 0.9rem; }

.archive-header { margin-bottom: 2.5rem; }
.archive-label { margin: 0; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--muted); }

/* Single post / page */
.entry { max-width: var(--content); margin: 0 auto; }
.entry-title { font-family: var(--serif); font-weight: 400; font-size: clamp(2.074rem, 1.5rem + 2.5vw, 4.3rem); line-height: 1.05; margin: 0 0 0.75rem; overflow-wrap: anywhere; }
.entry-header { margin-bottom: 2rem; }

.entry-content h1, .entry-content h2, .entry-content h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 2.25rem 0 0.75rem; }
.entry-content h1 { font-size: clamp(1.8rem, 1.4rem + 1.5vw, 2.6rem); }
.entry-content h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.074rem); }
.entry-content h3 { font-size: clamp(1.3rem, 1.15rem + 0.5vw, 1.6rem); }
.entry-content figure { margin: 2rem 0; }
.entry-content figcaption { font-size: 0.875rem; color: var(--muted); margin-top: 0.5rem; }
.entry-content .aligncenter { text-align: center; }
.entry-content .alignleft { float: left; margin: 0.5rem 1.5rem 1rem 0; max-width: 50%; }
.entry-content blockquote { border-left: 3px solid var(--contrast); margin: 1.5rem 0; padding-left: 1.25rem; font-style: italic; }
.entry-content pre { background: var(--code-bg); color: var(--code-fg); padding: 1rem 1.25rem; overflow-x: auto; font-size: 0.9rem; }
.entry-content code { font-family: ui-monospace, Consolas, monospace; }
.entry-content table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.entry-content th, .entry-content td { border-top: 1px solid var(--rule); padding: 0.5rem; text-align: left; vertical-align: top; }
.entry-content .wp-block-table { overflow-x: auto; }
.has-large-font-size { font-family: var(--serif); font-size: clamp(1.44rem, 1.2rem + 0.8vw, 2.074rem); line-height: 1.2; margin-top: 2rem; }
.entry-content::after { content: ""; display: table; clear: both; }

/* File downloads */
.wp-block-file { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin: 1.5rem 0; }
.wp-block-file__embed { width: 100%; border: 1px solid var(--rule); }
.wp-block-file__button { display: inline-block; background: var(--contrast); color: var(--base); padding: 0.4rem 1rem; text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.wp-block-file__button:hover { opacity: 0.85; }

/* Video embeds */
.video-embed { position: relative; aspect-ratio: 16 / 9; margin: 2rem 0; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Tags and prev/next */
.entry-footer { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); font-size: 0.9rem; }
.tags-label { color: var(--muted); margin-right: 0.25rem; }
.tag { display: inline-block; margin: 0 0.4rem 0.4rem 0; padding: 0.1rem 0.6rem; border: 1px solid var(--rule); text-decoration: none; }
.tag:hover { border-color: var(--contrast); }
.post-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 2rem; }
.post-nav a { text-decoration: none; font-family: var(--serif); font-size: 1.2rem; }
.post-nav .next { margin-left: auto; text-align: right; }

@media (max-width: 600px) {
  .entry-content .alignleft { float: none; max-width: 100%; margin: 1.5rem 0; }
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
