/* ═══════════════════════════════════════════════════════════
   IMPORTED CONTENT
   Loaded with pages.css, on everything but the front page.

   WHY THIS FILE EXISTS

   Every image rule in acme.css is scoped to a container the build
   controls: .ins-img img, .ev-img img, .portrait img, .ig-tile img. That
   was correct while every image on the site sat in a component somebody
   had designed. It stops being correct the moment a post is imported,
   because imported content carries bare <img> with no wrapper, and with
   no rule to meet it an image renders at its intrinsic pixel width. A
   1600px photograph inside a 70ch column does not shrink: it pushes the
   column wide, takes the page with it, and the reader gets a horizontal
   scrollbar. Nothing in the theme prevented that, because until now
   nothing needed to.

   functions.php had already promised most of what is below and never
   delivered it. It declares responsive-embeds, align-wide,
   wp-block-styles and html5 support for gallery and caption. Each of
   those is a contract with WordPress: WordPress will emit .alignwide,
   .alignfull, .wp-caption, .wp-block-* and embed wrappers, and the theme
   is expected to style them. None of those selectors appeared anywhere
   in the CSS, so the markup arrived and landed on nothing.

   This is scoped to .prose rather than written as a global reset.
   .prose is the content wrapper in all three templates that print
   the_content (single-acme_article.php, single.php, page.php), so
   scoping reaches every route imported content can take while leaving
   the designed components untouched.
   ═══════════════════════════════════════════════════════════ */

/* ── media ───────────────────────────────────────────────── */
/* The fix for the overflow. height:auto matters as much as max-width:
   imported markup often carries width and height attributes from the
   original site, and without height:auto a constrained width leaves the
   old height in place and the picture distorts. */
.prose img,
.prose video,
.prose canvas{max-inline-size:100%;block-size:auto;display:block}

/* SVG is deliberately NOT in that rule. An inline <svg> written without width
   and height has no intrinsic size, so max-inline-size:100% with block-size
   auto does not constrain it, it INFLATES it: the element takes the column's
   full width and the viewBox ratio sets the height. The imported articles
   carry sixteen such icons, and under the earlier rule they rendered at
   590x590 and 568x1137 -- the icons were not large in the content, they were
   made large here. Treated as what they are, they size to the text around
   them and sit on the line. An SVG that does declare its dimensions is left
   to them, capped so it cannot overflow. */
.prose svg{max-inline-size:100%}
.prose svg:not([width]):not([height]){inline-size:1.15em;block-size:1.15em;
  display:inline-block;vertical-align:-.16em;flex:none}

/* An <img> inside a line of text should stay in the line. */
.prose p img,
.prose li img,
.prose a img{display:inline-block;vertical-align:middle}

.prose figure{margin:32px 0}
.prose figure img{border-radius:var(--r);background:var(--off-white)}

/* Captions, both spellings. WordPress has emitted .wp-caption for
   fifteen years and <figcaption> since the block editor; an archive of
   440 posts will contain both. */
.prose figcaption,
.prose .wp-caption-text{font-family:var(--mono);font-size:.68rem;color:var(--muted);
  margin-block-start:10px;letter-spacing:.04em;line-height:1.5}
.prose .wp-caption{max-inline-size:100%;margin:32px 0}
.prose .wp-caption img{margin:0}

/* ── alignment ───────────────────────────────────────────── */
/* add_theme_support('align-wide') told WordPress it could offer the
   wide and full options. Without these two rules it offers them and
   nothing happens. */
.prose .alignnone{margin:32px 0}
.prose .aligncenter,
.prose figure.aligncenter{margin-inline:auto;text-align:center}
.prose .alignleft{float:inline-start;margin:8px 28px 22px 0;max-inline-size:min(50%,340px)}
.prose .alignright{float:inline-end;margin:8px 0 22px 28px;max-inline-size:min(50%,340px)}
html[dir="rtl"] .prose .alignleft{margin:8px 0 22px 28px}
html[dir="rtl"] .prose .alignright{margin:8px 28px 22px 0}

/* The prose column is 70ch. Wide and full break out of it, but only as
   far as the container allows, so they never cause the overflow this
   file exists to stop. */
.prose .alignwide{max-inline-size:min(1100px,100%);margin-inline:auto}
.prose .alignfull{max-inline-size:100%;margin-inline:0}

/* A float must not hang out of the section below it. */
.prose::after{content:"";display:table;clear:both}

/* ── embeds ──────────────────────────────────────────────── */
/* add_theme_support('responsive-embeds') was also declared without the
   CSS to honour it. An unconstrained 560x315 YouTube iframe is a second
   source of horizontal overflow, and $GLOBALS['content_width'] is 1320,
   so WordPress sizes oEmbeds for a column nearly twice the real width. */
.prose iframe,
.prose embed,
.prose object{max-inline-size:100%;border:0}
.prose iframe[src*="youtube"],
.prose iframe[src*="youtu.be"],
.prose iframe[src*="vimeo"],
.prose .wp-block-embed__wrapper iframe{inline-size:100%;aspect-ratio:16/9;block-size:auto}
.prose .wp-block-embed{margin:32px 0}
.prose .wp-block-embed figcaption{text-align:start}

/* ── block editor output ─────────────────────────────────── */
.prose .wp-block-image{margin:32px 0}
.prose .wp-block-image img{margin-inline:auto}
.prose .wp-block-quote{margin:36px 0;padding-inline-start:26px;
  border-inline-start:2px solid var(--brass)}
.prose .wp-block-quote cite{display:block;margin-block-start:12px;font-style:normal;
  font-family:var(--mono);font-size:.68rem;color:var(--muted);letter-spacing:.04em}
.prose .wp-block-separator{margin:40px 0;border:0;border-block-start:1px solid var(--line)}
.prose .wp-block-table{margin-block:30px}
.prose .wp-block-button__link{display:inline-block;padding:12px 24px;
  background:var(--acme-orange);color:var(--brand-black);text-decoration:none;
  border:0;border-radius:var(--r);font-weight:500}

/* ── galleries ───────────────────────────────────────────── */
/* html5 'gallery' support was declared. The classic [gallery] shortcode
   emits .gallery with .gallery-item children and no layout of its own. */
.prose .gallery{display:grid;gap:14px;margin:32px 0;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
.prose .gallery-item{margin:0}
.prose .gallery-icon img{inline-size:100%}
.prose .gallery-caption{font-family:var(--mono);font-size:.66rem;color:var(--muted)}
.prose .wp-block-gallery{margin:32px 0}

/* ── code, which the theme never styled at all ──────────── */
.prose pre{margin:30px 0;padding:18px 20px;background:var(--brand-black);
  color:var(--off-white);border-radius:var(--r);overflow-x:auto;
  font-family:var(--mono);font-size:.82rem;line-height:1.6}
.prose code{font-family:var(--mono);font-size:.86em;
  background:var(--off-white);padding:2px 6px;border-radius:2px}
.prose pre code{background:none;padding:0;font-size:1em;color:inherit}

/* ── defences against imported markup ───────────────────── */
/* An unbroken string with no spaces, a long URL pasted as text most
   often, is the third way a column gets pushed wide. */
.prose{overflow-wrap:break-word}

/* A table from another site may carry its own width attribute, wider
   than this column. Allowing it to scroll on its own keeps the page
   from scrolling instead. */
.prose table{max-inline-size:100%;display:block;overflow-x:auto;
  white-space:normal}
@media(min-width:600px){
  /* On anything but a narrow screen a table that does fit should behave
     as a table again, so the border and cell rules in pages.css read
     the way they were written. */
  .prose table{display:table}
}

/* The spacing rule in pages.css is .prose > * + *, which only reaches
   direct children. Imported content is frequently wrapped one level
   deep, by a page builder or by a plain <div> left over from the old
   theme, and inside that wrapper every paragraph loses its spacing. */
.prose > div > * + *,
.prose > section > * + *,
.prose > article > * + *{margin-block-start:26px}

/* Paragraph spacing stated outright rather than inherited from the
   sibling rule, so a single paragraph in a wrapper still breathes. */
.prose p{margin-block:0}
.prose p + p{margin-block-start:26px}

/* Layout markup from a page builder carries class names this theme has
   no styles for, and its real CSS lives in per-post files on the old
   server that will never be loaded here. Left alone the wrappers keep
   whatever widths and flex properties their inline styles set and the
   content inside them stacks wrongly. Neutralising them to ordinary
   block flow lets the content fall back to this stylesheet, which is
   the best available outcome short of stripping the wrappers out of the
   content itself. */
.prose [class*="elementor-"]{max-inline-size:100% !important;
  inline-size:auto !important;display:block;float:none;
  padding-inline:0 !important;margin-inline:0 !important}
.prose [class*="elementor-"] img{max-inline-size:100%;block-size:auto}
.prose .elementor-widget-container{margin-block-end:26px}

/* ── pagination ──────────────────────────────────────────── */
/* the_posts_pagination() emits .pagination > .nav-links > a.page-numbers.
   None of it was styled, because nothing in the build ever paginated. The
   blog is 442 articles, so this is load-bearing. */
.pagination{margin-block-start:clamp(40px,5vw,64px)}
.pagination .nav-links{display:flex;flex-wrap:wrap;gap:8px;align-items:center;
  justify-content:center}
.pagination .page-numbers{display:inline-flex;align-items:center;justify-content:center;
  min-inline-size:42px;min-block-size:42px;padding:0 14px;
  border:1px solid var(--line);border-radius:var(--r);
  font-size:.92rem;color:var(--charcoal);text-decoration:none;
  transition:border-color .25s var(--ease),background-color .25s var(--ease)}
.pagination .page-numbers:hover{border-color:var(--acme-orange);background:var(--off-white)}
.pagination .page-numbers.current{background:var(--brand-black);border-color:var(--brand-black);
  color:var(--white)}
.pagination .page-numbers.dots{border-color:transparent}
.pagination .screen-reader-text{position:absolute;inline-size:1px;block-size:1px;
  overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* ── article footer: tags, and previous/next ─────────────── */
.art-tags{display:flex;flex-wrap:wrap;gap:8px;max-inline-size:70ch;
  margin-block-start:clamp(32px,4vw,48px)}

.art-nav{display:grid;gap:14px;max-inline-size:70ch;
  margin-block-start:clamp(32px,4vw,48px);
  padding-block-start:clamp(24px,3vw,32px);border-block-start:1px solid var(--line)}
@media(min-width:600px){ .art-nav{grid-template-columns:1fr 1fr} }
.art-nav a{display:block;padding:16px 18px;border:1px solid var(--line);
  border-radius:var(--r);text-decoration:none;
  transition:border-color .25s var(--ease),background-color .25s var(--ease)}
.art-nav a:hover{border-color:var(--acme-orange);background:var(--off-white)}
.art-nav b{display:block;font-family:var(--mono);font-size:.63rem;font-weight:500;
  letter-spacing:.12em;text-transform:uppercase;color:var(--muted);
  margin-block-end:6px}
.art-nav span{display:block;color:var(--charcoal);line-height:1.45}
.art-nav-next{text-align:end}
/* With only a next link, it should sit on the right rather than the left. */
.art-nav-next:only-child{grid-column:2}

/* ── topic chips as links ────────────────────────────────── */
/* The chips on the Articles listing are anchors, not buttons, because that
   page spans 45 pages and filtering the document in front of you would hide
   most of the matches. The existing .chip rules were written for a button:
   the active state keys off aria-pressed, which is not an attribute a link
   may carry, and an anchor underlines by default. */
a.chip{text-decoration:none}
.chip[aria-current="page"]{background:var(--ink);border-color:var(--ink);color:var(--paper)}
.chip[aria-current="page"]:hover{color:var(--paper)}

/* ── cards for articles with no artwork ─────────────────── */
/* .ins-img is a 3:4 tile with a grey ground, which is correct when there is
   artwork and ruinous when there is not: an empty tile is roughly 500px of
   flat grey, and twelve of them to a page reads as a site that failed to
   load. The imported articles have no featured image, so those cards drop
   the tile entirely and take this variant, which is a text card by design
   rather than a picture card with the picture missing.

   The brass rule along the top does the work the image did: it gives the
   card a top edge and a point of colour, at the scale the brand rules allow
   the orange to be used. */
.ins--flat{min-block-size:208px}
.ins--flat::before{content:"";flex:0 0 3px;background:var(--acme-orange)}
.ins--flat .ins-body{padding:26px 24px 24px}
.ins--flat h3{font-size:1.1rem}
/* The body carries the whole card now, so the date is pushed to the foot and
   the rows still line up against any card that does have an image. */
.ins--flat .ins-body time{margin-block-start:auto;padding-block-start:14px}

/* ── banner behind the page head ─────────────────────────── */
/* .page-head is a dark band with a brass glow over it. The banner slides a
   photograph underneath without disturbing either: the band's own ink colour
   becomes a scrim over the picture rather than a flat fill, so the heading
   keeps its contrast whatever image is chosen, and the existing ::before glow
   still reads on top. */
.page-head--banner{background-color:var(--brand-black)}
.page-head--banner .ph-bg{position:absolute;inset:0;z-index:0;overflow:hidden}
.page-head--banner .ph-bg img{inline-size:100%;block-size:100%;object-fit:cover;
  object-position:50% 50%;display:block}
/* Two scrims. The vertical one seats the header and hands off to the section
   below; the horizontal one keeps the left side, where the type sits, dark
   enough to read against a busy photograph. */
.page-head--banner .ph-bg::after{content:"";position:absolute;inset:0;
  background:
    linear-gradient(to right, rgba(13,13,13,.92) 0%, rgba(13,13,13,.82) 42%,
                              rgba(13,13,13,.55) 100%),
    linear-gradient(to bottom, rgba(13,13,13,.78) 0%, rgba(13,13,13,.34) 40%,
                               rgba(13,13,13,.68) 100%)}
html[dir="rtl"] .page-head--banner .ph-bg{transform:scaleX(-1)}
.page-head--banner .container{position:relative;z-index:1}
@media(max-width:767.98px){
  /* Stacked, the type sits over the whole frame, so darken it evenly. */
  .page-head--banner .ph-bg::after{
    background:linear-gradient(to bottom, rgba(13,13,13,.86) 0%,
               rgba(13,13,13,.76) 50%, rgba(13,13,13,.9) 100%)}
}

/* ── the rest of the heading scale ──────────────────────── */
/* pages.css styles .prose h2 and .prose h3 and stops. The hand-written
   articles never went deeper, so nothing was missing until 442 imported ones
   arrived using h4, h5 and h6 throughout. Unstyled, they fall back to the
   browser's sizes, which are 24px bold for h4 and 20px for h5 against a
   styled h3 of 18.6px: every sub-heading renders LARGER than the heading it
   sits under, and the hierarchy reads backwards down the whole article.

   The scale below continues the one already set rather than inventing a new
   one, so each level is visibly smaller than its parent and the weight does
   the work once the sizes get close. */
.prose h4{font-family:var(--display);font-size:1.02rem;font-weight:500;
  line-height:1.4;margin-block-start:30px;color:var(--ink)}
.prose h5{font-family:var(--sans);font-size:.95rem;font-weight:700;
  line-height:1.45;margin-block-start:26px;color:var(--ink)}
.prose h6{font-family:var(--mono);font-size:.7rem;font-weight:500;
  letter-spacing:.1em;text-transform:uppercase;line-height:1.5;
  margin-block-start:24px;color:var(--muted)}
/* The imported articles wrap most of their headings in <strong>, which would
   otherwise double the weight of a heading that is already bold. */
.prose h2 strong,.prose h3 strong,.prose h4 strong,
.prose h5 strong,.prose h6 strong{font-weight:inherit}

/* ── images whose files never arrived ───────────────────── */
/* The content references images on this domain that do not exist on it: the
   addresses were rewritten during the import but the files were never copied
   across. A broken image with no intrinsic size takes the full width of the
   column, so each article carries several large empty boxes. Collapsing them
   is handled in acme.js, which can tell a broken image from a slow one; this
   is only the end state. */
.prose img.is-missing{display:none}
.prose figure.is-missing{display:none}

/* A card whose image failed: the fallback hides the broken <img>, and this
   collapses the tile with it so the card closes up into its flat form
   instead of keeping an empty grey block. */
.ins-img.is-missing{display:none}

/* A featured block with no artwork. .feat is a two-column grid and .feat-img
   carries its own dark gradient, so an empty image column renders as a large
   dark rectangle beside the text. With nothing to show, the block becomes a
   single column and the text takes the full width, with the brass rule doing
   what the picture did on the cards. */
.feat--flat{grid-template-columns:1fr}
.feat--flat::before{content:"";display:block;height:3px;background:var(--acme-orange);
  grid-column:1/-1}
.feat--flat .feat-body{padding-block:clamp(26px,3vw,40px)}
.feat--flat .feat-body p{max-width:70ch}


/* ---------------------------------------------------------------------------
   Image placeholders

   Every imported article records a featured image, and every one of those
   records points at an attachment ID from the old site, so none of them
   resolve here. A card with no tile at all turns a 12-card grid into a ragged
   mix of heights; a card with the plain grey .ins-img tile and nothing in it
   reads as a broken image.

   So an empty tile gets a deliberate one: the brand chevron on the paper
   tones, with the faintest diagonal rule behind it. Light rather than dark on
   purpose. The first version of this was a near-black panel, which is correct
   for one card and oppressive for a page of them - and this listing is 442
   articles with no artwork, so very nearly every tile on the site would have
   been a black rectangle taller than the text beside it. On paper tones the
   tile recedes and the headline carries the card, which is what a text
   listing should look like.

   The chevron comes from --chev, the same mark the section headings use, so
   the placeholder is the brand's own furniture rather than a stand-in. It is
   drawn at accent weight and well under the size at which the deck's rules
   stop orange being an accent.

   No file is requested, so there is nothing left to 404. An image set as the
   Customizer default, or fetched by the media plugin, replaces this
   everywhere without touching it.

   Drawn in CSS rather than as an inline SVG on purpose: a sizeless inline
   <svg> has no intrinsic dimensions, which is what rendered the article icons
   at 590px earlier in this project.
   --------------------------------------------------------------------------- */
/* A shallower tile than the 3:4 the real artwork uses. The supplied post
   artwork is portrait and the tile matches it, which is right for a picture
   and wrong for a placeholder: at 3:4 a twelve-card page is about 6,000px of
   empty paper, and until the article images are fetched nearly every card on
   this site is a placeholder.

   Square, specifically, because that is the shape of the imported artwork -
   37 of a 40-article sample at 1080x1080. A card therefore does not change
   shape at the moment its real image arrives, so a listing refreshed halfway
   through the repair does not reflow around the reader. */
.ins-img--ph {
  aspect-ratio: 1 / 1;
}

.ins-img--ph,
.feat-img--ph {
  background:
    repeating-linear-gradient(135deg,
      rgba(13, 13, 13, .035) 0 1px,
      transparent 1px 16px),
    linear-gradient(168deg,
      var(--cream, #fdf3e0) 0%,
      var(--off-white, #f5f5f5) 56%,
      #edebe6 100%);
  display: grid;
  place-items: center;
}

/* The mark. Held well inside the tile so it reads as a watermark rather than
   an illustration, and kept translucent so it never competes with a real
   image on the card beside it. */
.ins-img--ph::after,
.feat-img--ph::after {
  content: "";
  inline-size: 30%;
  max-inline-size: 64px;
  aspect-ratio: 62 / 56;
  background: var(--chev) center / contain no-repeat;
  opacity: .38;
}

.feat-img--ph {
  /* The featured block's image column has a dark gradient of its own in
     acme.css, which would show through the paper tones at the edges. */
  background-color: var(--off-white, #f5f5f5);
}

.feat-img--ph::after {
  inline-size: 16%;
  max-inline-size: 78px;
}

/* A real image inside a tile that has been marked as a placeholder by the
   browser-side fallback has already failed to load; hiding it stops the
   broken-image glyph showing through the mark. */
.ins-img--ph > *,
.feat-img--ph > * {
  display: none;
}

.ins:hover .ins-img--ph::after {
  opacity: .55;
}

@media (prefers-reduced-motion: no-preference) {
  .ins-img--ph::after {
    transition: opacity .45s var(--ease, ease);
  }
}


/* ---------------------------------------------------------------------------
   Tile shape follows the image

   acme.css fixes .ins-img at 3:4 because the artwork that came with the build
   is portrait. The imported articles are square - 37 of a 40-article sample at
   1080x1080 - so a 3:4 box with object-fit:cover was slicing a quarter off
   each one, top and bottom, which is exactly where the headline and the mark
   sit in those graphics.

   The template measures each attachment and sets --tile-ar, so cover has
   nothing left to crop. Where no attachment dimensions are recorded the
   variable is absent and the 3:4 default stands, which is the old behaviour.
   See acme_tile_ratio() for the clamp that stops one odd upload distorting a
   row.
   --------------------------------------------------------------------------- */
.ins-img {
  aspect-ratio: var(--tile-ar, 3 / 4);
}

.feat-img {
  aspect-ratio: var(--tile-ar, auto);
}

/* The featured block is a two-column grid: letting the image column set its
   own height from a square image would drive the whole block taller than the
   text beside it needs. It keeps its floor and fills the column instead. */
@media (min-width: 768px) {
  .feat-img {
    aspect-ratio: auto;
  }
}
