/*
Theme Name: Bilderatlas
Theme URI: https://example.com/bilderatlas
Author: Cowork
Author URI: https://example.com
Description: An author-profile WordPress theme in the manner of Aby Warburg's Bilderatlas Mnemosyne (1924-29). Black hessian-cloth background, irregular constellations of cream plates standing in for black-and-white photographs, scholarly Palatino-equivalent serif, numbered "Plates" in lieu of sections, museum-style identity card, and a "Recent fragments" panel for the latest writings. Each plate is replaceable via the Customizer with a real image.
Version: 1.7.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bilderatlas
Tags: blog, author, custom-colors, custom-menu, featured-images, threaded-comments, archival
*/

@import url("https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap");

/* ============================================================
   BILDERATLAS — author profile after the Mnemosyne Atlas
   1.  Reset & Variables
   2.  Hessian background
   3.  Typography
   4.  Layout shell
   5.  Header / Plate label / Identity rail
   6.  Plate I — Author constellation
   7.  Plate motifs (SVG container)
   8.  Identity card + curatorial paragraph
   9.  Plate II — Works
   10. Plate III — Recent fragments
   11. Single fragment
   12. Comments
   13. Forms / search
   14. Footer
   15. Pagination
   16. Responsive (mobile constellation)
   17. Reduced motion / accessibility
   ============================================================ */

/* ---- 1. Reset & Variables ---- */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --b-bg:        #14120E;
  --b-bg-2:      #1B1812;
  --b-cream:     #E2D4B5;
  --b-cream-lo:  #A09478;
  --b-cream-vlo: #6E624C;
  --b-ink:       #14120E;
  --b-ochre:     #9E6E3C;
  --b-line:      rgba(226, 212, 181, 0.18);
  --b-line-2:    rgba(226, 212, 181, 0.32);

  --b-serif: "EB Garamond", "Palatino", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --b-meta:  "EB Garamond", "Palatino", Georgia, serif;

  --b-shell-max: 1800px;
  --b-radius: 0;
  --b-plate-pad: 0; /* plates sit edge-to-edge inside their figure */
}

/* ---- 2. Hessian background ---- */
/* Apply the dark hessian to BOTH <html> and <body>, with !important
   so that WordPress core's default theme.json, the Customizer's
   "Background Color" setting, page-builder wrappers, or any plugin's
   inline styles cannot cover the page in white. The body then layers
   the woven texture image on top. */
html {
  scroll-behavior: smooth;
  background-color: #14120E !important;
  background-color: var(--b-bg) !important;
  min-height: 100%;
  /* Doubling the root font-size from the browser default of 16px so that
     every rem-based size in the theme scales up proportionally. Captions,
     headings, body copy, navigation labels, etc. all become roughly 2× their
     previous rendered size without me touching every individual rule. */
  font-size: 32px;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: #14120E !important;
  background-color: var(--b-bg) !important;
  color: var(--b-cream);
  font-family: var(--b-serif);
  /* Body copy is now ~42px (1.3 × 32). Use rem so any future html
     font-size changes propagate. */
  font-size: 1.3rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* hessian weave: warp + weft + speckle */
  background-image:
    /* warp (vertical) */
    repeating-linear-gradient(
      90deg,
      rgba(180, 160, 130, 0.07) 0 1px,
      transparent 1px 4px
    ),
    /* weft (horizontal) */
    repeating-linear-gradient(
      0deg,
      rgba(255, 240, 210, 0.05) 0 1px,
      transparent 1px 3px
    ),
    /* speckle */
    radial-gradient(
      circle at 17% 31%,
      rgba(220, 200, 160, 0.18) 0 0.6px,
      transparent 1px
    ),
    radial-gradient(
      circle at 73% 64%,
      rgba(220, 200, 160, 0.14) 0 0.5px,
      transparent 1px
    );
  background-size: auto, auto, 9px 9px, 11px 11px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  /* keep uploads in the Mnemosyne register */
  filter: grayscale(0.85) contrast(1.05) sepia(0.18);
}

/* All link states explicitly locked. !important is needed because Chrome
   restricts which properties it accepts on :visited and gives the browser
   default a stubborn cascade position; without !important, certain
   pseudo-class combinations or theme.json output can still bleed
   browser-default purple/blue through. */
a,
a:link,
a:visited,
a:active {
  color: var(--b-cream) !important;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--b-ochre);
}
a:hover, a:focus {
  color: var(--b-ochre) !important;
  text-decoration-color: var(--b-cream);
}

/* ---- 3. Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--b-serif);
  font-weight: 700;
  letter-spacing: 0.005em;
  margin: 0 0 0.5em;
  color: var(--b-cream);
}
h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.4rem; }

p { margin: 0 0 1em; }
em, i, .b-italic { font-style: italic; }

blockquote {
  margin: 1.5em 0;
  padding: 0 1.25em;
  border-left: 1px solid var(--b-line-2);
  font-style: italic;
  color: var(--b-cream);
}

code, pre {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", monospace;
  background: rgba(226, 212, 181, 0.08);
  padding: 0 .25em;
  font-size: .9em;
}

/* small italic label utility */
.b-caption {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--b-cream-lo);
  letter-spacing: 0.01em;
}
.b-eyebrow {
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.92rem;
  font-variant-caps: all-small-caps;
}

/* ---- 4. Layout shell ---- */
/* Defensive overrides for any WordPress / page-builder wrapper that
   might inject a white background between <body> and our content,
   or that might constrain the layout to a narrow column (block-theme
   layout system, Twenty-* themes, Elementor, classic-theme container
   plugins, etc.). Backgrounds become transparent and widths become
   full so the body's hessian and our shell extend edge to edge. */
html,
body,
.wp-site-blocks,
.wp-site-blocks > *,
#page,
#wrapper,
#main-wrap,
.site,
.site-content,
.site-main,
.entry-content,
main,
main#main,
article,
.elementor,
.elementor-section-wrap,
.elementor-section,
.elementor-container,
.is-layout-constrained,
.is-layout-flow,
.has-global-padding {
  max-width: none !important;
  width: auto !important;
  background-color: transparent !important;
  background-image: none !important;
}

/* Body background is set in §2 with !important and must NOT be reset to
   transparent by the rule above — re-assert it here at higher specificity. */
html, body {
  background-color: #14120E !important;
  background-color: var(--b-bg) !important;
}

.b-shell {
  /* Edge-to-edge: no max-width cap. Minimal side padding so plates and
     section labels don't literally touch the viewport edge. */
  max-width: none !important;
  width: 100%;
  margin: 0 !important;
  padding: 0 clamp(1rem, 2vw, 2rem) 4rem;
  position: relative;
  background-color: transparent;
  box-sizing: border-box;
}
.b-rule {
  height: 1px;
  background: var(--b-line);
  border: 0;
  margin: 2.5rem 0 1.25rem;
}

/* ---- 5. Header / Plate label / Identity rail ---- */
.b-header {
  padding: 2.25rem 0 0.75rem;
}

.b-plate-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.b-plate-label .lh {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
.b-plate-label .num {
  font-weight: 700;
  letter-spacing: 0.22em;
  font-size: 1.1rem;
  color: var(--b-cream);
  text-transform: uppercase;
}
.b-plate-label .sub {
  font-style: italic;
  color: var(--b-cream-lo);
  font-size: 1.1rem;
}
.b-plate-label .stamp {
  font-style: italic;
  color: var(--b-cream-lo);
  font-size: 1rem;
}

/* Top bar */
.b-topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-style: italic;
  color: var(--b-cream-lo);
  font-size: 1rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid var(--b-line);
  margin-bottom: 1.5rem;
}
.b-topbar nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; gap: 1.5rem;
}
.b-topbar nav a { color: var(--b-cream); text-decoration: none; }
.b-topbar nav a:hover { color: var(--b-ochre); }
.b-topbar .site-name {
  font-style: italic;
  color: var(--b-cream);
}

/* ---- 6. Plate I — Author constellation ---- */
.b-constellation {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  /* Plate row height scales with viewport AND now with the larger root
     font-size so plates feel proportionate to the bigger captions. */
  grid-auto-rows: clamp(96px, 7vw, 168px);
  gap: clamp(14px, 1.4vw, 24px) clamp(12px, 1.2vw, 22px);
  margin: 1.25rem 0 2rem;
}

.b-plate {
  position: relative;
  display: block;
  background: var(--b-cream);
  overflow: hidden;
  /* subtle inner photographic edge */
  box-shadow:
    inset 0 0 0 1px rgba(180, 165, 135, 0.35),
    inset 0 0 22px rgba(120, 100, 70, 0.12);
}
.b-plate__media,
.b-plate__media svg,
.b-plate__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.b-plate__media svg {
  /* let the SVGs fill the plate */
  background: var(--b-cream);
}
/* user-uploaded photographs adopt the bilderatlas register */
.b-plate__media img {
  filter: grayscale(0.95) contrast(1.06) brightness(1.02) sepia(0.06);
}

/* Caption sits OUTSIDE the plate — italic, slightly subdued cream */
.b-plate-caption {
  font-style: italic;
  color: var(--b-cream-lo);
  font-size: 0.95rem;
  margin: 0.45rem 0 0;
  padding: 0 0.05rem;
  letter-spacing: 0.01em;
  line-height: 1.4;
}
.b-plate-caption .num {
  color: var(--b-cream-vlo);
  font-style: italic;
  margin-right: 0.35rem;
}

/* The figure wrappers carry the plate's grid placement.
   Each fig is a flex column so its inner plate (or .b-plate-link wrapping
   the plate) fills whatever space is left after the caption's natural
   height is subtracted — fixing the overflow that happened when captions
   wrapped to two lines on narrower viewports. */
.b-plate-fig {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;            /* let grid items shrink instead of overflowing */
  height: 100%;
  align-self: stretch;
  overflow: hidden;        /* defensive — prevent any inner overflow leaking */
}
/* 12-col × 7-row constellation. Every cell filled, no overlap. */
.b-plate-fig.is-1  { grid-column: 1 / span 3;  grid-row: 1 / span 5; } /* portrait — tall */
.b-plate-fig.is-2  { grid-column: 4 / span 2;  grid-row: 1 / span 3; } /* concentric */
.b-plate-fig.is-3  { grid-column: 6 / span 4;  grid-row: 1 / span 3; } /* constellation */
.b-plate-fig.is-4  { grid-column: 10 / span 2; grid-row: 1 / span 3; } /* column — was span 4, overlapped is-7 */
.b-plate-fig.is-5  { grid-column: 4 / span 2;  grid-row: 4 / span 2; } /* fragment — was span 3, repacked */
.b-plate-fig.is-6  { grid-column: 6 / span 3;  grid-row: 4 / span 2; } /* wave */
.b-plate-fig.is-7  { grid-column: 9 / span 3;  grid-row: 4 / span 4; } /* ray — large square */
.b-plate-fig.is-8  { grid-column: 1 / span 3;  grid-row: 6 / span 2; } /* schematic */
.b-plate-fig.is-9  { grid-column: 4 / span 2;  grid-row: 6 / span 2; } /* manuscript — was rows 7-8, now 6-7 */
.b-plate-fig.is-10 { grid-column: 6 / span 3;  grid-row: 6 / span 2; } /* stamp */

/* Plate (when no link wrapper) — direct child of the figure, fills
   remaining space after the caption. */
.b-plate-fig > .b-plate {
  flex: 1 1 auto;
  min-height: 0;           /* required so flex children can shrink */
  width: 100%;
}

/* Plate-link wrapper (when a URL is set) — same flex behaviour. */
.b-plate-fig > .b-plate-link {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: block;
  cursor: pointer;
  outline: none;
}
.b-plate-link,
.b-plate-link:link,
.b-plate-link:visited,
.b-plate-link:hover,
.b-plate-link:active,
.b-plate-link:focus,
.b-plate-link *,
.b-plate-link:visited * {
  color: inherit !important;
  text-decoration: none !important;
}
.b-plate-link > .b-plate {
  width: 100%;
  height: 100%;
  transition: box-shadow 160ms ease;
}
.b-plate-link:hover > .b-plate {
  box-shadow:
    inset 0 0 0 1px var(--b-ochre),
    inset 0 0 22px rgba(120, 100, 70, 0.16),
    0 0 0 1px rgba(158, 110, 60, 0.35);
}
.b-plate-link:hover .b-plate__media img {
  filter: grayscale(0.55) contrast(1.08) brightness(1.04) sepia(0.04);
}
.b-plate-link:focus-visible > .b-plate {
  outline: 2px solid var(--b-ochre);
  outline-offset: 3px;
}

/* Caption: natural height, doesn't fight the plate for space. */
.b-plate-caption {
  flex: 0 0 auto;
}

/* ---- 8. Identity card + curatorial paragraph ---- */
.b-id-block {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 2.5rem;
  align-items: start;
  margin: 2rem 0 1rem;
}
.b-id-card {
  border: 1px solid var(--b-line-2);
  padding: 1.25rem 1.5rem 1.4rem;
  background: transparent;
}
.b-id-card .name {
  font-family: var(--b-serif);
  font-weight: 700;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  margin: 0 0 0.4rem;
  color: var(--b-cream);
  letter-spacing: 0.01em;
}
.b-id-card .role,
.b-id-card .place {
  font-style: italic;
  color: var(--b-cream-lo);
  margin: 0;
  font-size: 1.15rem;
}
.b-id-card .ref {
  display: block;
  margin-top: 0.85rem;
  font-style: italic;
  color: var(--b-ochre);
  font-size: 1rem;
  text-decoration: none;
}
.b-id-card .ref:hover { color: var(--b-cream); }

.b-curatorial {
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--b-cream);
  max-width: 64ch;
  padding-top: 0.25rem;
}

/* ---- 9. Plate II — Works ---- */
.b-works {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem 1.25rem;
  margin: 1rem 0 0;
}

/* Slight irregular vertical offsets — looser than a grid */
.b-works .b-work-fig:nth-child(1) { transform: translateY(0.5rem); }
.b-works .b-work-fig:nth-child(2) { transform: translateY(0); }
.b-works .b-work-fig:nth-child(3) { transform: translateY(-0.75rem); }
.b-works .b-work-fig:nth-child(4) { transform: translateY(0.25rem); }

.b-work-fig {
  margin: 0;
}
/* Lock all link states on works so visited covers never go blue/purple. */
.b-work-fig a,
.b-work-fig a:link,
.b-work-fig a:visited,
.b-work-fig a:hover,
.b-work-fig a:active {
  color: inherit;
  text-decoration: none;
}
.b-work {
  position: relative;
  background: var(--b-cream);
  aspect-ratio: 2 / 2.7;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  padding: 0.85rem 0.9rem;
  color: var(--b-ink);
  box-shadow:
    inset 0 0 0 1px rgba(180, 165, 135, 0.4);
}
.b-work .num {
  font-family: var(--b-serif);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--b-ink);
}
.b-work .title-wrap {
  text-align: center;
  margin: auto 0;
}
.b-work .title {
  font-family: var(--b-serif);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--b-ink);
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0.005em;
}
.b-work .title::after {
  content: "";
  display: block;
  width: 60%;
  height: 1px;
  background: var(--b-ink);
  margin: 0.55rem auto 0.5rem;
}
.b-work .seal {
  position: absolute;
  top: 0.75rem; right: 0.85rem;
  width: 16px; height: 16px;
  border: 1px solid var(--b-ochre);
  border-radius: 50%;
}
.b-work .year {
  font-style: italic;
  font-size: 0.95rem;
  text-align: right;
  color: var(--b-ink);
}
.b-work-cap {
  font-style: italic;
  color: var(--b-cream-lo);
  font-size: 0.95rem;
  margin: 0.5rem 0 0;
}

/* Works "Cf." citation panel — small, off to the side */
.b-citation {
  font-style: italic;
  color: var(--b-cream);
  font-size: 1.1rem;
  border-left: 1px solid var(--b-line-2);
  padding: 0.25rem 0 0.25rem 1rem;
  margin: 1rem 0 0;
  max-width: 32ch;
}
.b-citation .lbl {
  display: block;
  font-style: italic;
  color: var(--b-cream-lo);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

/* ---- 10. Plate III — Recent fragments ---- */
.b-fragments {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 1rem 0 0;
}
/* Fragment cards are themselves <a> tags — lock all link states. */
a.b-fragment,
a.b-fragment:link,
a.b-fragment:visited,
a.b-fragment:hover,
a.b-fragment:active {
  color: var(--b-ink);
  text-decoration: none;
}
.b-fragment {
  position: relative;
  background: var(--b-cream);
  color: var(--b-ink);
  padding: 1rem 1.1rem 1.25rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  min-height: 180px;
  /* "ragged" top edge using clip-path for a torn-paper feel */
  clip-path: polygon(
    0 6px, 4% 0, 8% 6px, 12% 0, 16% 6px, 20% 0, 24% 6px,
    28% 0, 32% 6px, 36% 0, 40% 6px, 44% 0, 48% 6px,
    52% 0, 56% 6px, 60% 0, 64% 6px, 68% 0, 72% 6px,
    76% 0, 80% 6px, 84% 0, 88% 6px, 92% 0, 96% 6px,
    100% 0, 100% 100%, 0 100%
  );
}
.b-fragment .meta {
  font-style: italic;
  color: var(--b-cream-vlo);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}
.b-fragment .title {
  font-family: var(--b-serif);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--b-ink);
  margin: 0 0 0.5rem;
  line-height: 1.25;
}
.b-fragment .excerpt {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--b-ink);
  flex: 1;
}
.b-fragment .more {
  margin-top: 0.5rem;
  font-style: italic;
  font-size: 1rem;
  color: var(--b-ochre);
}
.b-fragment:hover {
  filter: brightness(1.06);
}
.b-fragment:hover .title {
  text-decoration: underline;
  text-decoration-color: var(--b-ochre);
}

/* ---- 11. Single fragment / page ---- */
.b-single {
  max-width: 720px;
  margin: 1rem auto 0;
}
.b-single header.entry {
  margin-bottom: 2rem;
}
.b-single .meta {
  font-style: italic;
  color: var(--b-cream-lo);
  font-size: 0.95rem;
}
.b-single .entry-title {
  font-size: clamp(1.8rem, 3.6vw, 2.5rem);
  margin: 0.5rem 0 0;
}
.b-prose {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--b-cream);
}
.b-prose p, .b-prose ul, .b-prose ol, .b-prose blockquote {
  margin: 0 0 1.2em;
}
.b-prose img {
  margin: 1em 0;
  filter: grayscale(0.95) contrast(1.06) sepia(0.08);
  border: 1px solid var(--b-line);
}
.b-prose a {
  color: var(--b-ochre);
  text-decoration-color: var(--b-line-2);
}

/* prev/next */
.b-postnav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--b-line);
  font-style: italic;
  color: var(--b-cream-lo);
}
.b-postnav a { color: var(--b-cream); }

/* ---- 12. Comments ---- */
.b-comments {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--b-line);
}
.b-comments h2 { font-style: italic; font-weight: 400; color: var(--b-cream); }
.b-comments .comment-list { list-style: none; padding: 0; margin: 0; }
.b-comments .comment {
  border-left: 1px solid var(--b-line-2);
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
}
.b-comments .comment-author { font-style: italic; color: var(--b-cream); }
.b-comments .comment-meta {
  font-style: italic;
  color: var(--b-cream-lo);
  font-size: 0.85rem;
}
.b-comments .comment-respond {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--b-line);
}

/* ---- 13. Forms / search ---- */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="url"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: transparent;
  color: var(--b-cream);
  border: 0;
  border-bottom: 1px solid var(--b-line-2);
  padding: 0.5rem 0.1rem;
  font-family: var(--b-serif);
  font-size: 1rem;
  font-style: italic;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-bottom-color: var(--b-ochre);
}

button, input[type="submit"], .b-button {
  font-family: var(--b-serif);
  font-style: italic;
  font-size: 1rem;
  background: transparent;
  color: var(--b-cream);
  border: 1px solid var(--b-line-2);
  padding: 0.5em 1em;
  cursor: pointer;
}
button:hover, input[type="submit"]:hover {
  border-color: var(--b-ochre);
  color: var(--b-ochre);
}

.b-search-form {
  display: flex;
  gap: 0.75rem;
  align-items: end;
}

/* ---- 14. Footer ---- */
.b-footer {
  border-top: 1px solid var(--b-line);
  padding: 1.5rem 0 2.5rem;
  margin-top: 4rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-style: italic;
  color: var(--b-cream-lo);
  font-size: 1.05rem;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---- 15. Pagination ---- */
.b-pagination {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: baseline;
  margin: 2rem 0;
  font-style: italic;
}
.b-pagination a,
.b-pagination span {
  padding: 0.25em 0.6em;
  color: var(--b-cream);
  text-decoration: none;
  border: 1px solid var(--b-line);
}
.b-pagination .current {
  border-color: var(--b-ochre);
  color: var(--b-ochre);
}

/* ---- 16. Responsive — mobile constellation ---- */
/* Below ~1100px the 12-column constellation cramps too tightly and plates
   shrink to a width where their captions wrap and overlap. We collapse to
   a 2-column irregular masonry that preserves asymmetry through staggered
   row spans rather than free 2D positioning. */
@media (max-width: 1100px) {
  /* Slightly smaller root size on mobile so 2× proportions don't blow
     out a phone viewport — but still ~1.7× the original size. */
  html { font-size: 26px; }
  body { font-size: 1.25rem; }

  .b-shell { padding: 0 1.1rem 3rem; }

  /* The constellation collapses to a 2-column irregular masonry. */
  .b-constellation {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: clamp(72px, 9vw, 120px);
    gap: 16px 14px;
  }
  /* Override desktop placements; let plates flow but keep height variation */
  .b-plate-fig.is-1  { grid-column: 1; grid-row: span 5; }
  .b-plate-fig.is-2  { grid-column: 2; grid-row: span 3; }
  .b-plate-fig.is-3  { grid-column: 2; grid-row: span 3; }
  .b-plate-fig.is-4  { grid-column: 1; grid-row: span 4; }
  .b-plate-fig.is-5  { grid-column: 2; grid-row: span 3; }
  .b-plate-fig.is-6  { grid-column: 1; grid-row: span 3; }
  .b-plate-fig.is-7  { grid-column: 2; grid-row: span 4; }
  .b-plate-fig.is-8  { grid-column: 1; grid-row: span 3; }
  .b-plate-fig.is-9  { grid-column: 2; grid-row: span 2; }
  .b-plate-fig.is-10 { grid-column: 1; grid-row: span 3; }

  /* Identity stack */
  .b-id-block { grid-template-columns: 1fr; gap: 1.25rem; }

  /* Works become 2x2 with slight height irregularity */
  .b-works { grid-template-columns: 1fr 1fr; gap: 1.5rem 1rem; }
  .b-works .b-work-fig:nth-child(1) { transform: translateY(0); }
  .b-works .b-work-fig:nth-child(2) { transform: translateY(0.5rem); }
  .b-works .b-work-fig:nth-child(3) { transform: translateY(-0.25rem); }
  .b-works .b-work-fig:nth-child(4) { transform: translateY(0.25rem); }

  /* Fragments stack */
  .b-fragments { grid-template-columns: 1fr; gap: 1rem; }

  /* Topbar wraps */
  .b-topbar { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .b-topbar nav ul { gap: 1rem; flex-wrap: wrap; }
}

/* ---- 17. Accessibility ---- */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--b-cream);
  color: var(--b-ink);
  padding: 0.5em 1em;
  text-decoration: none;
  z-index: 999;
  font-style: italic;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* WP helpers */
.alignleft  { float: left;  margin: 0 1.25em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.25em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption  { max-width: 100%; }
.wp-caption-text {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--b-cream-lo);
  text-align: center;
}
.sticky      { border-style: dashed; }
.bypostauthor {}
.gallery-caption {}

/* WordPress block editor color fallbacks */
.has-cream-color  { color: var(--b-cream); }
.has-ochre-color  { color: var(--b-ochre); }
.has-bg-background-color { background-color: var(--b-bg); }
