/*
Theme Name: Vigilantia
Author: Ein Autor
Description: A lean, reader-first journal theme — a 2026 revamp of Vigilance.
Version: 0.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vigilantia
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */

:root {
  color-scheme: light;

  --vg-bg: #f7f5f0;
  --vg-bg-panel: #f1ede4;
  --vg-bg-field: #fffdf8;

  --vg-ink: #221f1c;
  --vg-ink-strong: #1a1714;
  --vg-text: #2f2a25;
  --vg-text-soft: #3c362f;
  --vg-muted: #5c554d;
  --vg-muted-light: #8a8177;
  --vg-faint: #a09788;
  --vg-faintest: #b3aa9e;

  --vg-rule: #d8cfc2;
  --vg-rule-soft: #e3dccf;
  --vg-rule-dotted: #ddd5c8;

  --vg-accent: #8c2f2a;
  --vg-accent-dark: #5e1e1a;

  --vg-selection: #e9d9c7;
  --vg-quote: #39332c;

  --vg-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --vg-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --vg-content-width: 1120px;
  --vg-gutter: 64px;

  /* Sidebar widths — the dual values are the ones to tune. */
  --vg-sidebar-width: 288px;       /* one sidebar on its own */
  --vg-sidebar-width-dual: 420px;  /* both sidebars together, gap included */
  --vg-sidebar-gap: 32px;          /* between the two sidebars */

  /* How the pair divides what is left after the gap, secondary : primary.
     1 and 3 give the secondary a quarter of it. Either may be any number. */
  --vg-sidebar-secondary-share: 1;
  --vg-sidebar-primary-share: 2.7;
}

/* Dark variant. It follows the system setting unless the reader has chosen
   with the header toggle, which stamps data-theme on <html>. The two blocks
   below must stay identical. Only colours change; the ink tokens swap roles
   with the paper ones, and --vg-accent-dark stays the hover shade even though
   here it is the lighter of the two. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --vg-bg: #1b1916;
    --vg-bg-panel: #24211d;
    --vg-bg-field: #141210;

    --vg-ink: #ece6dc;
    --vg-ink-strong: #f4efe6;
    --vg-text: #d9d2c6;
    --vg-text-soft: #c9c1b4;
    --vg-muted: #a89f93;
    --vg-muted-light: #938a7e;
    --vg-faint: #7d7569;
    --vg-faintest: #645d53;

    --vg-rule: #3b362f;
    --vg-rule-soft: #2f2b26;
    --vg-rule-dotted: #37322c;

    --vg-accent: #e08a80;
    --vg-accent-dark: #f2b5ad;

    --vg-selection: #4a3b31;
    --vg-quote: #d2cabd;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --vg-bg: #1b1916;
  --vg-bg-panel: #24211d;
  --vg-bg-field: #141210;

  --vg-ink: #ece6dc;
  --vg-ink-strong: #f4efe6;
  --vg-text: #d9d2c6;
  --vg-text-soft: #c9c1b4;
  --vg-muted: #a89f93;
  --vg-muted-light: #938a7e;
  --vg-faint: #7d7569;
  --vg-faintest: #645d53;

  --vg-rule: #3b362f;
  --vg-rule-soft: #2f2b26;
  --vg-rule-dotted: #37322c;

  --vg-accent: #e08a80;
  --vg-accent-dark: #f2b5ad;

  --vg-selection: #4a3b31;
  --vg-quote: #d2cabd;
}

/* ==========================================================================
   2. Base
   ========================================================================== */

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

body {
  margin: 0;
  padding: 0 24px 96px;
  background: var(--vg-bg);
  color: var(--vg-text);
  font-family: var(--vg-serif);
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--vg-accent);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--vg-accent-dark);
}

::selection {
  background: var(--vg-selection);
}

img {
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--vg-ink-strong);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}

p {
  margin: 0 0 1.1em;
}

blockquote {
  margin: 10px 0;
  padding: 22px 26px;
  border-left: 3px solid var(--vg-accent);
  background: var(--vg-bg-panel);
  color: var(--vg-quote);
  font-size: 22px;
  font-style: italic;
  line-height: 1.5;
}

blockquote p:last-child {
  margin-bottom: 0;
}

code, pre, kbd {
  font-family: var(--vg-mono);
  font-size: 0.85em;
}

pre {
  overflow-x: auto;
  padding: 18px 20px;
  border: 1px solid var(--vg-rule);
  background: var(--vg-bg-panel);
}

/* Small-caps mono label, reused across meta, navigation and widget titles. */
.vg-label {
  font-family: var(--vg-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ==========================================================================
   3. Accessibility helpers
   ========================================================================== */

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  word-wrap: normal !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
}

.skip-link:focus {
  left: 24px;
  top: 12px;
  padding: 10px 14px;
  background: var(--vg-ink);
  color: var(--vg-bg);
  font-family: var(--vg-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:focus-visible {
  outline: 2px solid var(--vg-accent);
  outline-offset: 2px;
}

/* ==========================================================================
   4. Layout
   ========================================================================== */

.site {
  max-width: var(--vg-content-width);
  margin: 0 auto;
}

.site-content {
  display: grid;
  /* The sidebar keeps its width until the page gets narrow, then shrinks
     with it rather than dropping below the main column. */
  grid-template-columns: minmax(0, 1fr) min(var(--vg-sidebar-width), 30%);
  gap: min(var(--vg-gutter), 6vw);
  align-items: start;
  padding-top: 44px;
}

.content-area {
  min-width: 0;
}

.no-sidebar .site-content {
  grid-template-columns: minmax(0, 1fr);
}

.has-two-sidebars .site-content {
  grid-template-columns: minmax(0, 1fr) min(var(--vg-sidebar-width-dual), 40%);
}

/* Holds one or both widget areas inside the single sidebar grid column. */
.sidebars {
  display: flex;
  align-items: flex-start;
  gap: var(--vg-sidebar-gap);
  min-width: 0;
}

/* ==========================================================================
   5. Header
   ========================================================================== */

.site-header {
  position: relative;
  padding: 56px 0 20px;
  border-bottom: 3px solid var(--vg-ink);
}

/* The top padding leaves the theme toggle room above the banner. */
.site-header.site-header--has-image {
  padding: 48px 0 0 0;
}

/* The branding and the menu; a header image sits in its own row above. */
.site-header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

/* The banner carries the branding, sat at its foot. Its min-height comes from
   the Custom Header settings, printed inline in header.php. */
.site-header-image {
  display: flex;
  align-items: flex-end;
  margin-bottom: 12px;
  padding: 20px 24px;
  background-color: var(--vg-bg-panel);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* With the branding in the banner, the bar below holds only the menu. */
.site-header--has-image .site-header-bar {
  justify-content: flex-end;
}

/* Light/dark switch, pinned to the top right corner of the masthead. */
.theme-toggle {
  position: absolute;
  top: 16px;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--vg-muted);
  font-size: 11px;
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: transparent;
  color: var(--vg-accent);
}

.theme-toggle[aria-pressed="true"] .theme-toggle-icon {
  transform: rotate(180deg);
}

/* The hairline that trails the heavy rule under the masthead. */
.site-header::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -5px;
  left: 0;
  height: 1px;
  background: var(--vg-rule);
}

.site-branding {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.site-title {
  margin: 0;
  font-size: 58px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
}

.site-title a {
  color: var(--vg-ink-strong);
}

.site-title a:hover,
.site-title a:focus {
  color: var(--vg-accent);
}

.site-description {
  margin: 0;
  color: var(--vg-muted-light);
  font-family: var(--vg-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.custom-logo-link {
  display: inline-block;
}

/* ==========================================================================
   6. Primary navigation
   ========================================================================== */

.main-navigation {
  padding-bottom: 6px;
  font-family: var(--vg-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.main-navigation ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-navigation a {
  display: inline-block;
  padding-bottom: 6px;
  border-bottom: 2px solid transparent;
  color: var(--vg-muted);
}

.main-navigation a:hover,
.main-navigation a:focus {
  border-bottom-color: var(--vg-rule);
  color: var(--vg-accent);
}

.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current-menu-ancestor > a {
  border-bottom-color: var(--vg-accent);
  color: var(--vg-accent);
}

/* ==========================================================================
   7. Entries
   ========================================================================== */

.entry {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 52px 0;
  border-top: 1px solid var(--vg-rule);
}

.entry:first-child {
  padding-top: 0;
  border-top: 0;
}

.entry-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entry-title {
  margin: 0;
  font-size: 42px;
}

.entry-title a {
  color: inherit;
}

.entry-title a:hover,
.entry-title a:focus {
  color: var(--vg-accent);
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  padding: 9px 0;
  border-top: 1px solid var(--vg-rule-soft);
  border-bottom: 1px solid var(--vg-rule-soft);
  color: var(--vg-muted-light);
  font-family: var(--vg-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.entry-meta .byline {
  color: var(--vg-text-soft);
}

.entry-meta .comments-link {
  margin-left: auto;
}

.entry-summary,
.entry-content {
  max-width: 66ch;
  color: var(--vg-text);
}

.entry-summary > :last-child,
.entry-content > :last-child {
  margin-bottom: 0;
}

.entry-thumbnail {
  display: block;
}

/* Only `display`: the base `img` rule already scales down to fit without ever
   blowing a small picture up, which is how the post's own content behaves. */
.entry-thumbnail img {
  display: block;
}

.entry--lead {
  gap: 20px;
  padding-bottom: 52px;
}

/* The image and the summary both belong under the title, so an entry carrying
   only a picture reads the same way as one carrying only text. */
.entry-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.entry-body .entry-summary {
  min-width: 0;
}

/* Lead entry: a wide image stacked above the summary. */
.entry--lead .entry-body {
  gap: 20px;
}

/* Compact entry: a small image beside the summary. */
.entry--compact .entry-body.has-thumbnail {
  grid-template-columns: 200px minmax(0, 1fr);
}

/* An entry that is nothing but a picture gets the full width rather than the
   narrow column, since it has no text to sit beside. */
.entry-body--media-only {
  grid-template-columns: minmax(0, 1fr);
}

/* Beside a thumbnail the column itself sets the measure. */
.entry--compact .entry-body.has-thumbnail .entry-summary {
  max-width: none;
}

.more-link {
  align-self: flex-start;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--vg-rule);
  font-family: var(--vg-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


/* Single entry: the full article view. */
.entry--single {
  gap: 24px;
  padding: 0;
  border-top: 0;
}

.entry--single .entry-title {
  font-size: 48px;
}

.entry-thumbnail figcaption {
  margin-top: 6px;
  color: var(--vg-muted-light);
  font-family: var(--vg-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

/* Drop cap, as in the design — only when the article opens with a paragraph. */
.entry--single:not(.entry--page) .entry-content > p:first-child::first-letter {
  float: left;
  padding: 6px 10px 0 0;
  color: var(--vg-accent);
  font-size: 62px;
  font-weight: 400;
  line-height: 0.82;
}

.entry-content a {
  border-bottom: 1px solid var(--vg-rule);
}

.entry-content a:hover,
.entry-content a:focus {
  border-bottom-color: var(--vg-accent);
}

.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  margin: 1.7em 0 0.5em;
}

.entry-content h2 {
  font-size: 30px;
}

/* The design sets sub-headings as mono small caps. */
.entry-content h3 {
  color: var(--vg-text-soft);
  font-family: var(--vg-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
}

.entry-content h4 {
  font-size: 21px;
}

.entry-content h5,
.entry-content h6 {
  font-size: 18px;
}

.entry-content ul,
.entry-content ol {
  margin: 0 0 1.1em;
  padding-left: 1.4em;
}

.entry-content li {
  margin-bottom: 0.4em;
}

.entry-content figure {
  margin: 1.7em 0;
}

.entry-content img,
.entry-content iframe,
.entry-content video {
  max-width: 100%;
  height: auto;
}

.entry-content hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px solid var(--vg-rule);
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.entry-content th,
.entry-content td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--vg-rule-soft);
  text-align: left;
}

.entry-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 12px 0;
  border-top: 1px solid var(--vg-rule-soft);
  color: var(--vg-muted-light);
  font-family: var(--vg-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.entry-footer .edit-link,
.entry--page > .edit-link {
  margin-left: auto;
}

/* Pagination inside a single post, from wp_link_pages(). */
.page-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-top: 1.7em;
  font-family: var(--vg-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-links a,
.page-links > span:not(.page-links-title) {
  padding: 3px 8px;
  border: 1px solid var(--vg-rule-dotted);
}

.page-links > .page-links-title {
  padding-left: 0;
  border: 0;
  color: var(--vg-muted-light);
}

/* ==========================================================================
   7a. Page headers (archives, search, 404)
   ========================================================================== */

.page-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 44px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--vg-rule);
}

.archive-label {
  margin: 0;
  color: var(--vg-muted-light);
  font-family: var(--vg-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  font-size: 42px;
}

.archive-description {
  max-width: 66ch;
  margin: 0;
  color: var(--vg-muted);
  font-size: 17px;
}

.archive-description p:last-child {
  margin-bottom: 0;
}

/* After a page header the first entry needs no rule of its own. */
.page-header + .entry {
  padding-top: 0;
  border-top: 0;
}

.no-results .search-form,
.error-404 .search-form {
  max-width: 22em;
  margin-top: 1.4em;
}

.error-404 .recent-articles {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 34em;
  margin-top: 8px;
}

.error-404 .recent-articles ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.error-404 .recent-articles li {
  padding-bottom: 10px;
  border-bottom: 1px dotted var(--vg-rule-dotted);
  line-height: 1.3;
}

.error-404 .recent-articles li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.error-404 .recent-articles .post-date {
  display: block;
  margin-top: 2px;
  color: var(--vg-faint);
  font-family: var(--vg-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Search form. The label is for assistive tech only: in a widget the widget
   title already names the form, and elsewhere the placeholder carries it. */
.search-form-label {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  word-wrap: normal !important;
}

/* The field takes whatever width the button leaves it. */
.search-form .search-field {
  flex: 1;
  min-width: 0;
}

.search-submit {
  flex: none;
}

/* ==========================================================================
   8. Post navigation
   ========================================================================== */

.posts-navigation,
.post-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  border-top: 3px solid var(--vg-ink);
  font-family: var(--vg-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.posts-navigation .nav-disabled {
  color: var(--vg-faintest);
}

.posts-navigation .nav-count {
  color: var(--vg-muted-light);
}

/* the_post_navigation() nests its links one level deeper. */
.post-navigation .nav-links {
  display: flex;
  flex: 1;
  justify-content: space-between;
  gap: 24px;
}

.post-navigation .nav-next {
  margin-left: auto;
  text-align: right;
}

.post-navigation .nav-label {
  display: block;
  color: var(--vg-muted-light);
}

/* Post titles stay in the serif, so long titles are not shouted. */
.post-navigation .nav-title {
  display: block;
  max-width: 34ch;
  margin-top: 4px;
  font-family: var(--vg-serif);
  font-size: 17px;
  letter-spacing: 0;
  line-height: 1.3;
  text-transform: none;
}

/* ==========================================================================
   9. Comments
   ========================================================================== */

.comments-area {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 56px;
}

.comments-title,
.comment-reply-title {
  margin: 0;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--vg-rule);
  color: var(--vg-text-soft);
  font-family: var(--vg-mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.comment-reply-title small {
  font-size: inherit;
}

.comment-list,
.comment-list .children {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.comment-list .children {
  margin-top: 28px;
  padding-left: 28px;
  border-left: 1px solid var(--vg-rule);
}

.comment-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: var(--vg-muted-light);
  font-family: var(--vg-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-author .avatar {
  width: 44px;
  height: 44px;
}

.comment-author .fn {
  color: var(--vg-text-soft);
  font-style: normal;
  font-weight: 500;
}

.comment-author .says {
  display: none;
}

.comment-metadata a,
.comment-meta .edit-link a {
  color: var(--vg-muted-light);
}

.comment-metadata a:hover,
.comment-meta .edit-link a:hover {
  color: var(--vg-accent);
}

/* Comments by the post's own author carry the star. */
.bypostauthor > .comment-body .fn::after {
  content: ' \2605';
  color: var(--vg-accent);
}

.comment-content {
  font-size: 17px;
}

.comment-content > :last-child {
  margin-bottom: 0;
}

.comment-awaiting-moderation {
  color: var(--vg-accent);
  font-family: var(--vg-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reply {
  font-family: var(--vg-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.comments-navigation .nav-links {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--vg-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.comments-navigation .nav-next {
  margin-left: auto;
}

.no-comments {
  margin: 0;
  color: var(--vg-muted-light);
  font-family: var(--vg-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Comment form */
.comment-respond {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 44em;
}

.comment-form p {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

.comment-form label {
  color: var(--vg-muted-light);
  font-family: var(--vg-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.comment-form .required {
  color: var(--vg-accent);
}

.comment-form-cookies-consent {
  flex-direction: row !important;
  align-items: center;
}

.comment-form-cookies-consent input {
  width: auto;
}

.comment-notes,
.logged-in-as {
  color: var(--vg-muted-light);
  font-family: var(--vg-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.6;
}

.form-submit input[type="submit"] {
  align-self: flex-start;
}

#cancel-comment-reply-link {
  margin-left: 10px;
  font-family: var(--vg-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ==========================================================================
   10. Widgets
   ========================================================================== */

.widget-area {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 40px;
  min-width: 0;
}

/* Shares, not fixed widths: whichever area is on its own still fills the column. */
.widget-area--sidebar-2 {
  flex: var(--vg-sidebar-secondary-share);
}

.widget-area--sidebar-1 {
  flex: var(--vg-sidebar-primary-share);
}

.widget {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 16px;
}

.widget-title {
  margin: 0;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--vg-rule);
  color: var(--vg-text-soft);
  font-family: var(--vg-mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.widget p {
  margin: 0;
  color: var(--vg-muted);
  line-height: 1.55;
}

.widget ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.widget li {
  padding-bottom: 10px;
  border-bottom: 1px dotted var(--vg-rule-dotted);
  line-height: 1.3;
}

.widget li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.widget li a {
  font-size: 17px;
}

.widget .post-date,
.widget .rss-date {
  display: block;
  margin-top: 2px;
  color: var(--vg-faint);
  font-family: var(--vg-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.widget ul ul {
  margin-top: 10px;
  padding-left: 14px;
}

/*
 * Recent posts, as the design draws them: an arrow in a narrow first column,
 * the title beside it, the date tucked underneath. The arrow is generated,
 * since the widget's own markup is just a link and an optional date span.
 */
.widget_recent_entries li {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  column-gap: 6px;
  align-items: baseline;
}

.widget_recent_entries li::before {
  content: '\2192';
  grid-column: 1;
  grid-row: 1;
  color: var(--vg-faintest);
  font-family: var(--vg-mono);
  font-size: 11px;
}

/* Both sit in the second column, so the date falls below the title. */
.widget_recent_entries li > a,
.widget_recent_entries li > .post-date {
  grid-column: 2;
}

/* Tag cloud */
.wp-block-tag-cloud,
.tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* The tag cloud prints a per-tag font-size inline, hence the !important. */
.tagcloud a,
.wp-block-tag-cloud a {
  padding: 4px 8px;
  border: 1px solid var(--vg-rule-dotted);
  color: var(--vg-muted);
  font-family: var(--vg-mono);
  font-size: 11px !important;
  letter-spacing: 0.04em;
}

.tagcloud a:hover,
.tagcloud a:focus,
.wp-block-tag-cloud a:hover,
.wp-block-tag-cloud a:focus {
  border-color: var(--vg-accent);
  color: var(--vg-accent);
}

/* Block widgets carry their own markup; keep them in the same key. */
.widget_block h2,
.widget_block h3 {
  margin: 0;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--vg-rule);
  color: var(--vg-text-soft);
  font-family: var(--vg-mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.wp-block-search__label {
  display: block;
  margin-bottom: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--vg-rule);
  color: var(--vg-text-soft);
  font-family: var(--vg-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.wp-block-search__inside-wrapper {
  display: flex;
  gap: 8px;
}

.wp-block-search__input {
  flex: 1;
  min-width: 0;
}

/* Core gives .wp-element-button a filled style; bring it back to the theme's. */
.wp-block-search__button {
  flex: none;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--vg-ink);
  border-radius: 0;
  background: transparent;
  color: var(--vg-ink);
  font-family: var(--vg-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wp-block-search__button:hover,
.wp-block-search__button:focus {
  background: var(--vg-ink);
  color: var(--vg-bg);
}

/* Calendar widget */
.calendar_wrap {
  font-family: var(--vg-mono);
  font-size: 11.5px;
}

.wp-calendar-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.wp-calendar-table caption {
  padding-bottom: 10px;
  color: var(--vg-text-soft);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.wp-calendar-table th {
  padding: 0 0 8px;
  border-bottom: 1px solid var(--vg-rule);
  color: var(--vg-muted-light);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.wp-calendar-table td {
  padding: 6px 0;
  color: var(--vg-faint);
  text-align: center;
}

/* Days carrying posts are the only links in the grid. */
.wp-calendar-table td a {
  display: block;
  color: var(--vg-accent);
  font-weight: 500;
}

.wp-calendar-table td a:hover,
.wp-calendar-table td a:focus {
  color: var(--vg-accent-dark);
  text-decoration: underline;
}

.wp-calendar-table #today {
  background: var(--vg-bg-panel);
  color: var(--vg-ink-strong);
  font-weight: 500;
}

.wp-calendar-nav {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--vg-rule);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* The spacer between the two month links carries only a non-breaking space. */
.wp-calendar-nav .pad {
  display: none;
}

.wp-calendar-nav-next {
  text-align: right;
}

/* ==========================================================================
   11. Forms
   ========================================================================== */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="password"],
textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--vg-rule);
  background: var(--vg-bg-field);
  color: var(--vg-ink);
  font-family: var(--vg-mono);
  font-size: 12px;
}

button,
input[type="submit"] {
  padding: 10px 14px;
  border: 1px solid var(--vg-ink);
  background: transparent;
  color: var(--vg-ink);
  cursor: pointer;
  font-family: var(--vg-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

button:hover,
input[type="submit"]:hover {
  background: var(--vg-ink);
  color: var(--vg-bg);
}

.search-form {
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   12. Footer
   ========================================================================== */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-top: 72px;
  padding-top: 18px;
  border-top: 3px solid var(--vg-ink);
  color: var(--vg-muted-light);
  font-family: var(--vg-mono);
  font-size: 11.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.site-footer a {
  color: inherit;
  border-bottom: 1px solid var(--vg-rule);
}

.site-footer a:hover,
.site-footer a:focus {
  color: var(--vg-accent);
}

/* ==========================================================================
   13. WordPress content classes
   ========================================================================== */

.sticky .entry-title::before {
  content: '★ ';
  color: var(--vg-accent);
}

.alignleft {
  float: left;
  margin: 6px 24px 12px 0;
}

.alignright {
  float: right;
  margin: 6px 0 12px 24px;
}

.aligncenter {
  display: block;
  margin: 12px auto;
}

.wp-caption {
  max-width: 100%;
}

.wp-caption-text,
.wp-block-image figcaption {
  margin: 6px 0 0;
  color: var(--vg-muted-light);
  font-family: var(--vg-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

/* ==========================================================================
   14. Responsive
   ========================================================================== */

@media (max-width: 680px) {
  body {
    font-size: 18px;
    padding-bottom: 64px;
  }

  .site-header {
    padding-top: 40px;
  }

  .site-header-bar {
    align-items: flex-start;
  }

  .site-header-image {
    margin-bottom: 24px;
    padding: 16px 18px;
  }

  .site-title {
    font-size: 44px;
  }

  .entry-title {
    font-size: 32px;
  }

  .entry--compact .entry-body.has-thumbnail {
    grid-template-columns: minmax(0, 1fr);
  }

  .entry-meta .comments-link {
    margin-left: 0;
  }

  .entry--single .entry-title,
  .page-title {
    font-size: 34px;
  }

  .post-navigation .nav-links {
    flex-direction: column;
    gap: 18px;
  }

  .post-navigation .nav-next {
    margin-left: 0;
    text-align: left;
  }

  .comment-list .children {
    padding-left: 16px;
  }

  /* The sidebar is narrow here; leave the search field room beside the button. */
  .search-form,
  .wp-block-search__inside-wrapper {
    gap: 4px;
  }

  .search-field,
  .wp-block-search__input,
  .search-submit,
  .wp-block-search__button {
    padding-right: 8px;
    padding-left: 8px;
  }

  /* Too narrow for two columns of widgets: stack them within the sidebar. */
  .sidebars {
    flex-direction: column;
    gap: 40px;
  }
}
