/* 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;
  }
}

/* D-051: a post's text is easier to read (the owner, round 64): space
   between paragraphs, and section headings smaller than the post's title.
   On the live site a post's paragraphs had no space between them (the
   theme's margin is 0, and paragraphs pasted from Word say 0cm inline), and
   its section headings were larger than its title (at 1440: the title 30 px,
   an h2 40 px, an h1 64 px). Every post whose body is plain HTML; not a block
   layout (/alarmchildren/), whose blocks space themselves and whose first
   heading is its title. */
.single-post .entry-content:not([data-ast-blocks-layout]) p {
  margin-bottom: 1em !important; /* over the pasted paragraphs' inline 0cm */
}
.single-post .entry-content:not([data-ast-blocks-layout]) :is(h1, h2) {
  font-size: 1.5em;
  line-height: 1.3;
}
.single-post .entry-content:not([data-ast-blocks-layout]) :is(h3, h4) {
  font-size: 1.2em;
  line-height: 1.4;
}
/* D-052: a post's reference list (the owner, round 65: the sources as APA
   references only). The references are in English, so the list is written
   left to right (<ul class="references" dir="ltr" lang="en">). The theme's
   right-to-left list margin would leave a gap on the list's right and hang
   its bullets outside the text on the left. Laid out instead as an APA list:
   no bullets, the full width of the text, each entry's later lines indented
   (a hanging indent), the entries apart; and its links in the text's colour,
   underlined, since the theme's link colour is 2 to 1 against the page. */
.single-post .entry-content ul.references {
  list-style: none;
  margin: 0 0 1.5em;
  padding: 0;
}
.single-post .entry-content ul.references > li {
  padding-inline-start: 2em; /* the start side: right in a Hebrew entry, left in an English one */
  text-indent: -2em;
  margin-bottom: 0.5em;
}
.single-post .entry-content ul.references a {
  color: inherit;
  text-decoration: underline;
}

/* D-053: links readable (the owner, round 66: "להכהות"). The theme draws a
   text link in its accent gold, #DCA54A: 2.02 to 1 against the page's
   #FAF5E5 and 2.20 against white, where WCAG AA asks 4.5 to 1 for text; the
   current page's item in the desktop menu in #D09A40, 1.63 to 1 on the
   header's #DDCFB7. The same gold (hue 37°, saturation 68%), darker:
   - a link: #8D621B (4.94 to 1 on the page, 5.39 on white, 4.83 on the
     cards' #F7F2E9);
   - hovered or focused, the current menu item (in the desktop menu and the
     phone menu, where on the home page its three section links are all
     "current", gold on white, 2.20 to 1), and a link in the home
     page's "about" panel (#E8DFD0): #6F4D15 (7.01 on the page, 4.98 on the
     header, 5.78 on the panel).
   Only the colour of text links: the gold of buttons, icons, lines and
   backgrounds is unchanged, and the header's menu, the footer, the post
   cards and the reference list (D-052) keep their own colours. The posts'
   "previous" and "next" links have a rule of their own in the theme, so
   they are named here too. */
a,
.single .post-navigation a {
  color: #8D621B;
}
a:hover,
a:focus,
.single .post-navigation a:hover,
.single .post-navigation a:focus {
  color: #6F4D15;
}
#about .uagb-heading-text a:not(:hover),
.ast-builder-menu-1 .menu-item.current-menu-item > .menu-link,
.ast-builder-menu-1 .current-menu-ancestor > .menu-link,
.ast-builder-menu-mobile .main-navigation .menu-item.current-menu-item > .menu-link,
.ast-builder-menu-mobile .main-navigation .menu-item.current-menu-ancestor > .menu-link {
  color: #6F4D15;
}
/* D-053, the phone menu under a transparent header (the home page): the
   theme's own rule there, in the same selectors, colours a hovered,
   focused or current item with the gold; the same selectors, later, take
   the darker one (7.64 to 1 on the menu's white). */
@media (max-width: 921px) {
  .ast-theme-transparent-header .ast-builder-menu .main-header-menu .menu-item:hover > .menu-link,
  .ast-theme-transparent-header .ast-builder-menu .main-header-menu .focus > .menu-link,
  .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-item > .menu-link,
  .ast-theme-transparent-header .ast-builder-menu .main-header-menu .current-menu-ancestor > .menu-link,
  .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-item > .menu-link,
  .ast-theme-transparent-header [CLASS*="ast-builder-menu-"] .main-header-menu .current-menu-ancestor > .menu-link,
  .ast-theme-transparent-header .main-header-menu .menu-item:hover > .menu-link,
  .ast-theme-transparent-header .main-header-menu .current-menu-item > .menu-link,
  .ast-theme-transparent-header .main-header-menu .current-menu-ancestor > .menu-link {
    color: #6F4D15;
  }
}

/* D-053, the states the site's custom CSS (wp-custom-css) fixes in its gold
   with !important, which only !important can answer (its review, B1 and S1):
   a menu link hovered (#D8A24A, 1.49 to 1 on the header's #DDCFB7, 2.17 on
   the phone menu's #F9F9F9), and every link once the header has scrolled
   back in (its script's .nav-down: the bar turns #333333, where the gold
   reads 5.53 to 1 and stays, but the phone menu opened from it is white,
   2.29 to 1). The bar itself keeps its gold and its white hover. */
header:not(.nav-down) .main-header-menu .menu-link:hover,
header:not(.nav-down) .main-header-menu .menu-link:focus,
header:not(.nav-down) .site-title a:hover {
  color: #6F4D15 !important;
}
header.nav-down #ast-mobile-header .main-header-menu .menu-link {
  color: #8D621B !important;
}
header.nav-down #ast-mobile-header .main-header-menu .menu-link:hover,
header.nav-down #ast-mobile-header .main-header-menu .menu-link:focus,
header.nav-down #ast-mobile-header .main-header-menu .current-menu-item > .menu-link {
  color: #6F4D15 !important;
}
/* The home page's desktop menu sits over its opening photograph, in white:
   hovered, it stays white and is underlined, rather than a gold or a brown
   that the photograph's light or dark parts would swallow. */
@media (min-width: 922px) {
  .ast-theme-transparent-header header:not(.nav-down) .main-header-menu .menu-link:hover,
  .ast-theme-transparent-header header:not(.nav-down) .main-header-menu .menu-link:focus {
    color: #FFFFFF !important;
    text-decoration: underline;
  }
}
/* The footer's menu, hovered: the theme's #5DADE2 is 4.47 to 1 on the
   footer's #2C3E50; the same blue, lighter: #74BAE7, 5.19. */
#astra-footer-menu .menu-item:hover > a,
#astra-footer-menu .menu-item > a:focus {
  color: #74BAE7;
}
/* A link inside running text is underlined: in the darker brown it is 1.64
   to 1 from the text around it (#4A4A4A), so its colour alone no longer
   marks it (WCAG 1.4.1; the review, S2). The reference list (D-052) is
   already underlined; buttons and cards are not running text. */
.entry-content :is(p, li, dd, td, blockquote) a:not([class*="button"]):not(.uagb-buttons-repeater),
#about .uagb-heading-text a,
[class*="uagb-forms-failed-message"] a,
.uagb-ifb-desc a {
  text-decoration: underline;
}
/* The same gold where it is text but not a link: the posts' meta line
   ("מאת …", 2.02 to 1) and the 404's title, which shares the theme's rule
   with links. */
.single .entry-meta,
.single .entry-meta *:not(a),
.page-title {
  color: #8D621B;
}

/* D-055: the thank-you pages' two buttons readable (the owner, round 67:
   "כן"). Their text is white on the gold, 2.20 to 1 (2.51 hovered or
   focused, on #D09A40), where every other button of the site writes
   #0F172A on the same gold: the same here. Only these two blocks
   (/thankyouclinical/ and /thankyouorganizations/ share them). */
.wp-block-uagb-buttons .uagb-block-5a7fe6fd.wp-block-button .uagb-buttons-repeater,
.wp-block-uagb-buttons .uagb-block-5a7fe6fd.wp-block-button .uagb-buttons-repeater .uagb-button__link,
.wp-block-uagb-buttons .uagb-block-944d6889.wp-block-button .uagb-buttons-repeater,
.wp-block-uagb-buttons .uagb-block-944d6889.wp-block-button .uagb-buttons-repeater .uagb-button__link {
  color: #0F172A;
}
.wp-block-uagb-buttons .uagb-block-5a7fe6fd.wp-block-button .uagb-buttons-repeater .uagb-button__icon > svg {
  fill: #0F172A;
}
/* D-055, found by its gate: the contact form's "שליחה" button, hovered or
   focused. The form's own rules write the theme's gold (#D09A40) on
   #4A4A4A, 3.54 to 1 (/, /workshops/, /workshops/oneonone/); on the four
   pages where those rules carry a broken variable it already reads as
   every other button hovered, #0F172A on #D09A40, 7.12. That, everywhere:
   the same selectors as the form's, later. */
.uagb-block-20cc5d8c .uagb-forms-main-form .uagb-forms-main-submit-button-wrap.wp-block-button:not(.is-style-outline) .uagb-forms-main-submit-button.wp-block-button__link:hover,
.uagb-block-20cc5d8c .uagb-forms-main-form .uagb-forms-main-submit-button-wrap.wp-block-button:not(.is-style-outline) .uagb-forms-main-submit-button.wp-block-button__link:focus {
  color: #0F172A;
  background: #D09A40;
}
/* Its focus from the keyboard: the theme removes a button's outline
   (button:focus { outline: 0 }), and the dark background that marked it
   on three pages is gone with the rule above (its review, finding 1; on the
   four other pages nothing marked it). A dark outline, from the keyboard
   only, as the site's link buttons show their focus. */
.uagb-block-20cc5d8c .uagb-forms-main-form .uagb-forms-main-submit-button.wp-block-button__link:focus-visible {
  outline: 2px solid #0F172A;
  outline-offset: 2px;
}
