/* Shared reading defaults. Native block controls and intentional layouts remain editable. */
:is(body.nodosbyg-reading, body.editor-styles-wrapper.post-type-post) {
  --nodos-reading-width: 800px;
  --nodos-reading-wide: 1040px;
  --nodos-reading-ink: #312e39;
  --nodos-reading-muted: #625d67;
  --wp--style--global--content-size: var(--nodos-reading-width);
  --wp--style--global--wide-size: var(--nodos-reading-wide);
}
:is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) {
  color: var(--nodos-reading-ink);
  font-family: Montserrat, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.75;
}
body.nodosbyg-reading.ast-narrow-container .site-content > .ast-container {
  max-width: 1200px;
}
body.nodosbyg-reading #primary {
  margin-block: 48px 64px;
}
body.nodosbyg-reading .entry-content {
  max-width: var(--nodos-reading-wide);
  margin-inline: auto;
}
body.nodosbyg-reading .entry-content > :where(p, h1, h2, h3, h4, h5, h6, ul, ol, blockquote, .wp-block-table, .wp-block-buttons, .wp-block-image, .wp-block-embed, .wp-block-separator, .nodosbyg-reading-end) {
  max-width: var(--nodos-reading-width);
  margin-inline: auto;
}
body.nodosbyg-reading .entry-content > :where(.wp-block-columns, .wp-block-gallery, .alignwide, .alignfull) {
  max-width: var(--nodos-reading-wide);
  width: 100%;
  margin-inline: auto;
}
/* Beat Astra's negative alignwide margins without changing the authored columns. */
body.nodosbyg-reading .entry-content > .wp-block-columns.alignwide {
  margin-inline: auto;
}
body.nodosbyg-reading .entry-content > :where(.wp-block-group, .uagb-is-root-container) {
  max-width: 100%;
}
:is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) p {
  line-height: 1.75;
  margin-block: 0 1.35em;
}
:is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) :where(h2, h3, h4) {
  font-family: Rubik, sans-serif;
  color: #26222f;
  font-weight: 500;
  line-height: 1.25;
  text-wrap: pretty;
  margin-block: 1.6em .65em;
}
:is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) h2 { font-size: 30px; }
:is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) h3 { font-size: 23px; }
:is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) h4 { font-size: 20px; }
/* Nested strong tags must not turn the heading scale into progressively blacker text. */
:is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) :where(h2, h3, h4, figcaption) strong {
  font-weight: inherit;
}
:is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) :is(h2 + h3, h3 + h4) {
  margin-top: 1em;
}
/* Trailing blank lines are spacing, not an intentional break between heading words. */
body.nodosbyg-reading .entry-content :is(h2, h3, h4) > strong:only-child > :is(br:last-child, br:has(+ br:last-child)) {
  display: none;
}
:is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) :where(ul, ol) {
  padding-inline-start: 1.4em;
  margin-bottom: 1.5em;
}
:is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) li { margin-bottom: .4em; }
:is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) figcaption {
  color: var(--nodos-reading-muted);
  font-size: 14px;
  line-height: 1.55;
  margin-top: .75em;
  margin-bottom: 0;
  text-align: center;
}
:is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) .wp-block-image:not(.is-cropped) img {
  height: auto;
}
body.nodosbyg-reading .entry-content > :where(.wp-block-image, .wp-block-gallery, .wp-block-columns, .wp-block-embed) {
  margin-block: 2em;
}
/* An ordinary image-only column belongs to the prose, including stacked figures.
   Preserve explicit wide/full blocks, multi-column pairs, mixed content and authored image sizes. */
body.nodosbyg-reading .entry-content > .wp-block-columns:not(.alignwide, .alignfull):has(> .wp-block-column:only-child > .wp-block-image):not(:has(> .wp-block-column > :not(.wp-block-image:not(.alignwide, .alignfull)))) {
  max-width: var(--nodos-reading-width);
  padding: 0 !important; /* Neutralize legacy inline wrapper padding, not saved content. */
  margin-block: 24px 32px;
}
body.nodosbyg-reading .entry-content > .wp-block-columns:not(.alignwide, .alignfull):has(> .wp-block-column:only-child > .wp-block-image):not(:has(> .wp-block-column > :not(.wp-block-image:not(.alignwide, .alignfull)))) > .wp-block-column > .wp-block-image {
  display: block;
  margin: 0;
}
body.nodosbyg-reading .entry-content > .wp-block-columns:not(.alignwide, .alignfull):has(> .wp-block-column:only-child > .wp-block-image):not(:has(> .wp-block-column > :not(.wp-block-image:not(.alignwide, .alignfull)))) > .wp-block-column > .wp-block-image > figcaption {
  display: block; /* Native table-caption otherwise collapses to a character-wide anonymous table. */
}
/* Classic-theme rendering can omit the native buttons layout stylesheet. */
body.nodosbyg-reading .entry-content > .wp-block-buttons.is-content-justification-center:has(> .wp-block-button:only-child) {
  display: flex;
  justify-content: center;
}
/* Desktop photo pairs with an existing centred italic caption form one reading unit.
   Match structure, not post IDs; preserve explicit wide/full layouts and mobile stacking. */
@media (min-width: 782px) {
  body.nodosbyg-reading .entry-content > .wp-block-columns:not(.alignwide, .alignfull):has(> .wp-block-column:first-child:nth-last-child(2) > :is(.wp-block-image, .wp-block-uagb-image):only-child):has(> .wp-block-column:last-child > :is(.wp-block-image, .wp-block-uagb-image):only-child):has(+ p.has-text-align-center > em:only-child) {
    max-width: var(--nodos-reading-width);
    padding: 0;
    margin-block: 28px 0;
  }
  body.nodosbyg-reading .entry-content > .wp-block-columns:not(.alignwide, .alignfull):has(> .wp-block-column:first-child:nth-last-child(2) > :is(.wp-block-image, .wp-block-uagb-image):only-child):has(> .wp-block-column:last-child > :is(.wp-block-image, .wp-block-uagb-image):only-child) + p.has-text-align-center:has(> em:only-child) {
    color: var(--nodos-reading-muted);
    font-size: 14px;
    line-height: 1.55;
    margin-block: 12px 32px;
  }
}
/* Classic-theme output omits native block-gap styles. Keep native photo pairs
   with one shared caption separated, including at the stacking breakpoint. */
body.nodosbyg-reading .entry-content > .wp-block-columns:not(.alignwide, .alignfull):has(> .wp-block-column:first-child:nth-last-child(2) > .wp-block-image:only-child):has(> .wp-block-column:last-child > .wp-block-image:only-child):has(+ p.has-text-align-center > em:only-child) {
  gap: 24px;
}
body.nodosbyg-reading .entry-content > .wp-block-columns:not(.alignwide, .alignfull):has(> .wp-block-column:first-child:nth-last-child(2) > .wp-block-image:only-child):has(> .wp-block-column:last-child > .wp-block-image:only-child):has(+ p.has-text-align-center > em:only-child) > .wp-block-column {
  margin-block: 0;
}
body.nodosbyg-reading .entry-content > .wp-block-columns:not(.alignwide, .alignfull):has(> .wp-block-column:first-child:nth-last-child(2) > .wp-block-image:only-child):has(> .wp-block-column:last-child > .wp-block-image:only-child):has(+ p.has-text-align-center > em:only-child) > .wp-block-column > .wp-block-image img {
  width: 100%;
  height: auto;
}
/* Two native photos with separate captions share the reading column and a real gutter.
   Leave mixed-content columns, common-caption pairs and explicit wide/full blocks alone. */
body.nodosbyg-reading .entry-content > .wp-block-columns:not(.alignwide, .alignfull):has(> .wp-block-column:first-child:nth-last-child(2) > .wp-block-image:only-child > figcaption):has(> .wp-block-column:last-child > .wp-block-image:only-child > figcaption) {
  max-width: var(--nodos-reading-width);
  padding: 0 !important; /* Remove legacy wrapper padding, including saved vertical padding. */
  gap: 24px;
  margin-block: 24px 32px;
}
body.nodosbyg-reading .entry-content > .wp-block-columns:not(.alignwide, .alignfull):has(> .wp-block-column:first-child:nth-last-child(2) > .wp-block-image:only-child > figcaption):has(> .wp-block-column:last-child > .wp-block-image:only-child > figcaption) > .wp-block-column {
  margin-block: 0; /* The gap replaces Astra's extra mobile column margin. */
}
body.nodosbyg-reading .entry-content > .wp-block-columns:not(.alignwide, .alignfull):has(> .wp-block-column:first-child:nth-last-child(2) > .wp-block-image:only-child > figcaption):has(> .wp-block-column:last-child > .wp-block-image:only-child > figcaption) > .wp-block-column > .wp-block-image {
  display: block;
  float: none;
  margin: 0;
}
body.nodosbyg-reading .entry-content > .wp-block-columns:not(.alignwide, .alignfull):has(> .wp-block-column:first-child:nth-last-child(2) > .wp-block-image:only-child > figcaption):has(> .wp-block-column:last-child > .wp-block-image:only-child > figcaption) > .wp-block-column > .wp-block-image > figcaption {
  display: block;
}
/* Opt-in article galleries retain full photographs and the surrounding reading measure. */
body.nodosbyg-reading .entry-content > .nodos-reading-gallery {
  max-width: var(--nodos-reading-width);
  margin: 28px auto 32px;
}
body.nodosbyg-reading .nodos-reading-gallery .spectra-image-gallery__layout--grid {
  align-items: start;
}
body.nodosbyg-reading .nodos-reading-gallery .spectra-image-gallery__media--grid {
  aspect-ratio: auto;
}
body.nodosbyg-reading .nodos-reading-gallery .spectra-image-gallery__media-thumbnail--grid {
  height: auto !important; /* Spectra forces square thumbnails with an important height. */
  object-fit: contain;
  display: block;
}
body.nodosbyg-reading .nodos-interview-video {
  scroll-margin-top: 120px;
}
/* Native Gutenberg aspect classes work in the editor and frontend. Do not guess video format by post ID. */
:is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) .wp-block-embed.is-type-video .wp-block-embed__wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
}
:is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) .wp-block-embed.is-type-video .wp-block-embed__wrapper::before {
  display: none;
}
:is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) .wp-block-embed.is-type-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  margin: 0;
}
:is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) .wp-block-embed.wp-embed-aspect-9-16 {
  width: min(100%, 348px);
  margin-inline: auto;
}
:is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) .wp-block-embed.wp-embed-aspect-9-16 .wp-block-embed__wrapper { aspect-ratio: 9 / 16; }
:is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) .wp-block-embed.wp-embed-aspect-4-3 .wp-block-embed__wrapper { aspect-ratio: 4 / 3; }
/* Retain the site's existing title/byline markup, including its author and SEO semantics. */
body.nodosbyg-reading .ast-single-entry-banner {
  padding-block: 56px 44px;
}
body.nodosbyg-reading .ast-single-entry-banner .ast-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
body.nodosbyg-reading :is(.ast-single-entry-banner, .entry-header) .entry-title,
body.editor-styles-wrapper.post-type-post .editor-post-title {
  font-family: Rubik, sans-serif;
  font-size: clamp(32px, 3.6vw, 46px);
  font-weight: 400;
  line-height: 1.15;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  text-wrap: balance;
}
body.nodosbyg-reading .ast-single-entry-banner .entry-meta {
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  text-align: center;
}
body.nodosbyg-reading .ast-single-entry-banner .post-thumb {
  max-width: 960px;
  margin-inline: auto;
}
body.nodosbyg-reading .nodosbyg-reading-end {
  max-width: var(--nodos-reading-width);
  margin-inline: auto;
  border-top: 1px solid #ccc6cc;
  margin-top: 56px;
  padding-top: 24px;
  font-size: 15px;
}
body.nodosbyg-reading .nodosbyg-reading-end a {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
}
body.nodosbyg-reading .nodosbyg-reading-end a:hover { text-decoration: underline; }
/* The custom-title case studies retain their full-width composition, with real mobile gutters. */
body.nodosbyg-reading-project .entry-content > .uagb-is-root-container {
  max-width: 100%;
  width: 100%;
  margin-inline: 0;
}
body.nodosbyg-reading-project .wp-block-uagb-image-gallery .slick-list {
  margin-inline: 0;
  max-width: 100%;
}
/* Style the canvas, not Gutenberg's toolbar, sidebar or internal React markup. */
body.editor-styles-wrapper.post-type-post {
  padding: 36px 24px;
  background: #f7f5f2;
}
body.editor-styles-wrapper.post-type-post .block-editor-block-list__layout.is-root-container {
  width: 100%;
  max-width: var(--nodos-reading-wide);
  margin-inline: auto;
}
body.editor-styles-wrapper.post-type-post .block-editor-block-list__layout.is-root-container > .wp-block {
  max-width: var(--nodos-reading-width);
  margin-inline: auto;
}
body.editor-styles-wrapper.post-type-post .block-editor-block-list__layout.is-root-container > :is(.alignwide, .alignfull, .wp-block-columns, .wp-block-gallery) {
  max-width: var(--nodos-reading-wide);
}
body.editor-styles-wrapper.post-type-post .editor-post-title { margin-bottom: 40px; }
/* A single landscape video follows the prose measure, without a second set of gutters. */
body.nodosbyg-reading .entry-content > .wp-block-columns:has(> .wp-block-column:only-child > .wp-block-embed.is-type-video.wp-embed-aspect-16-9) {
  max-width: var(--nodos-reading-width);
  padding-inline: 0;
}
@media (max-width: 767px) {
  :is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) { font-size: 17px; }
  :is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) h2 { font-size: 26px; }
  :is(body.nodosbyg-reading .entry-content, body.editor-styles-wrapper.post-type-post) h3 { font-size: 21px; }
  body.nodosbyg-reading #primary { margin-block: 32px 48px; }
  body.nodosbyg-reading .ast-single-entry-banner { padding-block: 36px 30px; }
  body.nodosbyg-reading .entry-content > :where(.wp-block-image, .wp-block-gallery, .wp-block-columns, .wp-block-embed) { margin-block: 1.5em; }
  body.nodosbyg-reading .nodosbyg-reading-end { margin-top: 40px; }
}
