/*
Theme Name: Side A
Theme URI: https://reidchatham.com
Description: One plain column for reidchatham.com and its blog. Each page or post gets a title, its block-editor content, and a status line linking to the previous and next one; the blog home lists its posts.
Author: Reid Chatham
Version: 1.4.0
Requires at least: 6.6
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: side-a
*/

/* fonts ship with the theme (SIL Open Font License, see fonts/) */
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-400-latin.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-mono-600-latin.woff2) format("woff2"); }

:root {
  --paper: #ffffff; --ink: #151515; --mute: #6b6b6b; --rule: #e2e2df;
  --accent: #e2542b;
  --f-m: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --gut: clamp(16px, 4vw, 40px);
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #121211; --ink: #ebe6da; --mute: #8f8a7f; --rule: #2d2c29; --accent: #f06a3d; color-scheme: dark; }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.6 var(--f-m); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 4px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
a:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

/* one centred column; the status line sticks to the bottom of the screen */
.app { max-width: 720px; min-height: 100dvh; margin: 0 auto; padding: 0 max(var(--gut), env(safe-area-inset-right)) 0 max(var(--gut), env(safe-area-inset-left)); display: flex; flex-direction: column; }
.app main { flex: 1; padding-bottom: 24px; }

.top { display: flex; justify-content: space-between; padding-top: max(18px, env(safe-area-inset-top)); font-size: 13px; }
.top a { text-decoration: none; }
.top a:first-child { font-weight: 600; }

/* the page title, in the same mono type as the page */
.wp-block-post-title, .wp-block-site-title, main > h1 { margin: 56px 0 24px; font-size: 28px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.wp-block-site-tagline { margin: -12px 0 32px; color: var(--mute); }
main > .wp-block-post-date { margin: -12px 0 28px; font-size: 12px; color: var(--mute); }

/* the blog's post list: title, then date, one row each */
.wp-block-post-template { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.wp-block-post-template li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.wp-block-post-template .wp-block-post-title { margin: 0; font-size: 1em; }
.wp-block-post-template .wp-block-post-title a { text-decoration: none; }
.wp-block-post-template .wp-block-post-date { font-size: 12px; color: var(--mute); white-space: nowrap; }
.wp-block-query-pagination { display: flex; justify-content: space-between; padding: 14px 0; font-size: 12px; }
.wp-block-query-pagination a { text-decoration: none; }

/* page content from the block editor */
.wp-block-post-content > * { margin: 0 0 12px; }
.wp-block-post-content :is(h2, h3) { font-size: 1em; margin-top: 24px; }
.wp-block-image { margin: 4px 0 18px; }
.wp-block-image img { display: block; width: 100%; height: auto; border-radius: 3px; }
.wp-block-table { margin: 16px 0; }
.wp-block-table td { border: 0; padding: 1px 16px 1px 0; vertical-align: top; }
.wp-block-table td:first-child { color: var(--mute); font-size: .86em; line-height: 1.9; }
.wp-block-code { padding: 12px 14px; overflow-x: auto; border: 1px solid var(--rule); border-radius: 3px; font-size: .9em; line-height: 1.5; }
.wp-block-embed iframe { display: block; max-width: 100%; }
.wp-block-rss { padding: 0; }
.wp-block-rss__item { padding: 6px 0; }
.wp-block-rss__item-title a { font-weight: 600; text-decoration: none; }
.wp-block-rss__item-publish-date { display: block; font-size: .86em; color: var(--mute); }

/* status line: position, progress, prev / next, key hint */
.bar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 4px; padding: 12px 0 calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); background: var(--paper); font-size: 12px; color: var(--mute); }
.bar .fill { position: absolute; top: -1px; left: 0; height: 2px; background: var(--accent); }
.bar .at { margin-right: 10px; color: var(--ink); font-variant-numeric: tabular-nums; }
.bar a { min-width: 0; padding: 6px 8px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint { margin-left: auto; display: none; }
.js .hint { display: inline; }
.hint kbd { font: inherit; color: var(--ink); }

@media (max-width: 759px) {
  body { font-size: 14px; }
  .wp-block-post-title, .wp-block-site-title, main > h1 { margin: 32px 0 16px; font-size: 22px; }
  .wp-block-post-template .wp-block-post-title { margin: 0; font-size: 1em; }
  .bar a { padding: 13px 8px; margin: -13px 0; }
  .bar a[rel="next"] { margin-left: auto; margin-right: -8px; }
  .js .hint { display: none; }
}
