/* Ours: changes made on purpose after the migration (DECISIONS round 56,
   the owner's QA items), each a deviation in DEVIATIONS.md. Loaded last, after
   motion.css, on every page (scripts/gen-css.mjs; the gates derive the same
   list in scripts/lib/document.mjs). Editing this file: re-run gen-css, then
   gen-404 (the 404 page lists this sheet, by its hash, in page-404.json). */

/* D-046: a phone never gets a page wider than its screen. The scroll-in
   animations (AOS, as live) start elements 100 px to the side until they are
   revealed, and two visually hidden elements (the skip link, the form's
   honeypot) sit just past the edge in a right-to-left page; on a phone the
   page then loaded 470-489 px wide on a 390 px screen. Horizontal overflow is
   clipped at the root instead. */
html {
  overflow-x: hidden;
}
body {
  overflow-x: clip;
}

/* D-047: only the site header is fixed. The site's own custom CSS
   (wp-custom-css: "header, .site-header { position: fixed !important; top: 0;
   width: 100%; ... }") fixes every <header> element, not only the site's.
   So on the live site too, every post's title and meta line were pinned over
   the logo and the menu button at the top of a phone screen while reading
   (header.entry-header), the five meta lines on /category/psychology/ were
   pinned there, and the 404's title sat under the header (header.page-header).
   Every other <header> goes back into the page. */
header:not(#masthead) {
  position: static !important;
  width: auto;
}
/* The 404 (the live site's own, D-040) leaves no room for the fixed header
   above its title, so there the site header takes its place in the page and
   the content starts below it, at any width. */
.error404 #masthead {
  position: relative !important;
}

/* D-048: the whole post card on /clinicthoughts/ is the link, not only its
   title. The title's own link is stretched over the card (no markup change:
   the same link, the same address, read once by a screen reader). */
.uagb-post__inner-wrap {
  position: relative;
}
.uagb-post__inner-wrap .uagb-post__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* D-050: the cards on /media/ (page 330) are one grid: every card the same
   width, every image the same size (the owner, round 62). On the live site the
   cards sat in rows of 3, 2, 3, 3 and 4, each row its own container, so at
   1440 px a card was 270 to 560 px wide; the cards of a row were centred on
   one another, so their tops were staggered; and each image was as tall as its
   own file (14 files are 3:2, the mako one 16:9). Markup unchanged:
   - every card image is cropped to 3:2, the ratio of 14 of the 15 files;
   - from 768 px (Spectra's own tablet breakpoint) the rows hand their cards
     to one grid of three columns on the page's content, and stop being boxes
     themselves; below it the cards stay one under the other, as live. */
.page-id-330 .wp-block-uagb-info-box img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
@media (min-width: 768px) {
  .page-id-330 .entry-content {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px 20px;
    align-items: start;
  }
  .page-id-330 .entry-content > * {
    grid-column: 1 / -1;
  }
  /* A row is a container with an image card in it; the page also has an
     empty 27 px row with no image, which stays a full-width row. */
  .page-id-330 .entry-content > .uagb-is-root-container:has(.wp-block-uagb-info-box img),
  .page-id-330 .entry-content > .uagb-is-root-container:has(.wp-block-uagb-info-box img) > .uagb-container-inner-blocks-wrap {
    display: contents;
  }
  .page-id-330 .entry-content .wp-block-uagb-container:has(> .wp-block-uagb-info-box img) {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}
