/* Pages and news written with the block editor (inc/editor.php), on the site (.blocks) and in the editor
   (.is-root-container): a column of text, wide blocks, full-width sections, and the theme's block styles */

:is(.blocks, .is-root-container) { --section-y: clamp(60px, 8vw, 104px); }
.blocks { padding: var(--section-y) var(--gutter); }
.blocks:has(> :first-child:not(.alignfull)) { padding-top: clamp(32px, 4vw, 48px); }   /* text right under the page's header: no section's gap above it */
.is-root-container { padding: 40px var(--gutter) 80px; }

/* widths: text column, wide, full */
/* the text column starts where the wide blocks and the page header start, as on the theme's own pages */
:is(.blocks, .is-root-container, .is-layout-constrained) > :where(:not(.alignfull, .alignleft, .alignright)) { max-width: 860px; margin-left: max(0px, calc((100% - var(--max)) / 2)) !important; margin-right: auto !important; }
:is(.blocks, .is-root-container, .is-layout-constrained) > .alignwide { max-width: var(--max); margin-inline: auto !important; }
:is(.blocks, .is-root-container, .is-layout-constrained) > .has-text-align-center:not(.alignwide) { margin-inline: auto !important; }
:is(.blocks, .is-root-container) > .alignfull { margin-inline: calc(-1 * var(--gutter)); max-width: none; }
.alignfull.wp-block-group { padding-inline: var(--gutter); }

/* rhythm: as the theme's text (.prose); sections touch each other */
:is(.blocks, .is-root-container, .wp-block-group, .wp-block-column) > * + * { margin-top: 1em; }
:is(.blocks, .is-root-container) > * + :is(h2, .is-style-kicker) { margin-top: 1.6em; }
:is(.blocks, .is-root-container) > .alignfull + .alignfull, .is-style-kicker + :is(h1, h2, h3) { margin-top: 0.6em; }
:is(.blocks, .is-root-container) > .alignfull + .alignfull { margin-top: 0; }
:is(.blocks, .is-root-container) > .is-style-kicker + :is(h1, h2, h3) { margin-top: 0.6em; }
.blocks > .alignfull:first-child { margin-top: calc(-1 * var(--section-y)); }
.blocks > .alignfull:last-child { margin-bottom: calc(-1 * var(--section-y)); }
:is(.blocks, .is-root-container) > .alignfull:not(:first-child, .is-style-section, .is-style-section-alt) { margin-top: var(--section-y); }

/* text (low specificity: the theme's parts drawn by the MOVE.B blocks keep their own styles) */
:where(.blocks, .is-root-container) :where(h2) { font-size: clamp(26px, 3vw, 36px); }
:where(.blocks, .is-root-container) :where(h3) { font-size: 19px; }
:where(.blocks, .is-root-container) :where(h4) { font: 600 16px/1.3 var(--body); color: var(--ink); }
:where(.blocks, .is-root-container) :where(p, li) { color: var(--text); }
:is(.blocks, .is-root-container) :is(ul, ol):not(.is-style-ticks) { padding-left: 1.3em; }
:is(.blocks, .is-root-container) li + li { margin-top: 0.35em; }
:where(.blocks, .is-root-container) :where(p, li) > a:not(.btn) { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--signal) 40%, transparent); text-underline-offset: 3px; }
:is(.blocks, .is-root-container) table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
:is(.blocks, .is-root-container) :is(th, td) { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
:is(.blocks, .is-root-container) .wp-block-table thead { border-bottom: 2px solid var(--line-strong); }
:is(.blocks, .is-root-container) .wp-block-table th { color: var(--ink); }
.is-style-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--signal-text); }
p.is-style-lead { font-size: 17.5px; color: var(--muted); line-height: 1.65; }
p.is-style-figure { font: 700 clamp(34px, 4vw, 46px)/1 var(--head); color: var(--brand); letter-spacing: -0.02em; }
p.is-style-figure .nowrap { white-space: nowrap; }
p.is-style-figure + p { margin-top: 8px; color: var(--muted); font-size: 14.5px; }
.has-text-align-center { text-align: center; }
p.has-text-align-center.is-style-lead { margin-inline: auto; }

/* sections */
.wp-block-group.is-style-section { padding-block: var(--section-y); }
.wp-block-group.is-style-section-alt { padding-block: var(--section-y); background: var(--surface); border-block: 1px solid var(--line); }
.is-style-section-alt .is-style-card { background: var(--bg); box-shadow: none; }

/* cards */
.wp-block-group.is-style-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.wp-block-group.is-style-card > * { margin: 0; max-width: none; }
.is-style-card h3 { font-size: 17px; }
.is-style-card p { color: var(--muted); font-size: 14.5px; }
.is-style-card > :last-child:is(p) a { margin-top: auto; font-size: 14px; font-weight: 600; color: var(--brand); text-decoration: none; }
.is-style-card > :last-child:is(p):has(> a:only-child) { margin-top: auto; }
.wp-block-column > .is-style-card:only-child { height: 100%; }
.wp-block-columns { gap: 22px; }
.wp-block-columns.alignwide, .alignwide > .wp-block-columns { margin-top: 32px; }
.is-style-card .wp-block-image img, .wp-block-image.is-style-photo img { border-radius: 10px; }
/* a photo that opens a card runs to its edges, like the family cards */
.wp-block-group.is-style-card > .wp-block-image:first-child:not(.is-style-portrait) { margin: -24px -24px 6px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; }
.wp-block-group.is-style-card > .wp-block-image:first-child:not(.is-style-portrait) img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
/* a person's portrait at the head of a card, square */
.wp-block-image.is-style-portrait img { width: 112px; height: 112px; object-fit: cover; border-radius: 6px; }
/* key figures in cards: the figure, then its line */
.wp-block-group.is-style-card > p.is-style-figure { font-size: clamp(30px, 3vw, 38px); color: var(--brand); }   /* not the card's muted text */
.wp-block-group.is-style-card > .is-style-figure + p { margin-top: 0; }

/* call to action */
.wp-block-group.is-style-cta-band { background: var(--brand); color: #dfe2ff; border-radius: 22px; padding: clamp(32px, 5vw, 56px); display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.wp-block-group.is-style-cta-band > * { margin: 0; }
.is-style-cta-band :is(h2, h3) { color: #fff; }
.is-style-cta-band :is(p, li) { color: #c9ccf5; }
.is-style-cta-band .is-style-kicker { color: #8fdcf7; }
.is-style-cta-band .wp-block-button:not(.is-style-outline) .wp-block-button__link { background: #fff; color: var(--brand); box-shadow: none; }
.is-style-cta-band .is-style-outline .wp-block-button__link { color: #fff; border-color: rgba(255, 255, 255, 0.5); background: transparent; }
.blocks > .is-style-cta-band.alignwide, .is-root-container > .is-style-cta-band.alignwide { margin-top: var(--section-y); }

/* buttons: Fill = the site's primary button, Outline = its ghost button */
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.wp-block-buttons.is-content-justification-center { justify-content: center; }
.wp-block-button__link { display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; padding: 12px 20px; font: 600 14.5px/1 var(--body); background: var(--brand); color: #fff; border: 1px solid transparent; box-shadow: 0 6px 18px rgba(40, 38, 101, 0.22); text-decoration: none; transition: background 0.2s, transform 0.2s, border-color 0.2s; }
.wp-block-button__link:hover { background: var(--brand-2); color: #fff; transform: translateY(-1px); }
.wp-block-button.is-style-outline .wp-block-button__link { background: var(--surface); color: var(--brand); border: 1px solid var(--line-strong); padding: 12px 20px; box-shadow: none; }   /* as Fill: WordPress's own outline style sets 2px and em paddings */
.wp-block-button.is-style-outline .wp-block-button__link:hover { border-color: var(--brand); color: var(--brand); }

/* lists, images, quotes, questions */
ul.is-style-ticks { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; }
ul.is-style-ticks li { position: relative; padding-left: 22px; margin: 0; }   /* the text flows as one line, bold words and links inside it */
ul.is-style-ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--signal); font-weight: 700; }
/* tags: each item a pill, its link the whole pill (courses beside a service); the last one, "All… →", dashed */
ul.is-style-tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
ul.is-style-tags li { margin: 0; }
ul.is-style-tags li > a { display: inline-block; font: 500 13px/1 var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 13px; text-decoration: none; transition: border-color 0.2s, color 0.2s; }
ul.is-style-tags li > a:hover { border-color: var(--brand); color: var(--brand); }
ul.is-style-tags li:last-child:not(:first-child) > a { color: var(--brand); font-weight: 600; background: none; border-style: dashed; }
.wp-block-image.is-style-photo img { border-radius: 20px; box-shadow: var(--shadow-hover); width: 100%; object-fit: cover; }
.wp-block-image figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.wp-block-media-text { gap: clamp(24px, 4vw, 48px); }
.wp-block-media-text .wp-block-media-text__media img { border-radius: 20px; box-shadow: var(--shadow-hover); }
.wp-block-media-text .wp-block-media-text__content { padding: 0; display: flex; flex-direction: column; gap: 14px; }
.wp-block-media-text .wp-block-media-text__content > * { margin: 0; }
.wp-block-quote { margin-inline: 0; border-left: 3px solid var(--signal); padding: 4px 0 4px 20px; }
.wp-block-quote p { font-size: 17px; color: var(--ink); }
.wp-block-quote cite { display: block; margin-top: 8px; font-size: 13px; font-style: normal; color: var(--muted); }
.wp-block-details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.wp-block-details + .wp-block-details { margin-top: 0; }
.wp-block-details summary { cursor: pointer; font-weight: 600; color: var(--ink); font-size: 16px; }
.wp-block-details > :not(summary) { margin-top: 10px; }
.wp-block-separator { border: 0; border-top: 1px solid var(--line); margin-block: 2em; }

/* MOVE.B blocks */
[class*="wp-block-moveb-"] .logos-label:first-child { margin-top: 0; }
.wp-block-moveb-chiptrace .ct-box { margin: 0; }
.moveb-block-empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* the editor shows everything at once (no reveal on scroll) */
.is-root-container .reveal { opacity: 1; transform: none; }

@media (max-width: 780px) {
  .wp-block-columns { flex-wrap: wrap !important; }
  .wp-block-columns > .wp-block-column { flex-basis: 100% !important; }
}

/* key figures in cards: two by row on a phone, not one tall column */
@media (max-width: 781px) {
  .wp-block-columns:has(> .wp-block-column > .is-style-card > .is-style-figure) { flex-direction: row; flex-wrap: wrap !important; gap: 12px; }
  .wp-block-columns:has(> .wp-block-column > .is-style-card > .is-style-figure) > .wp-block-column { flex: 1 1 calc(50% - 6px) !important; }
  .wp-block-group.is-style-card > .is-style-figure { font-size: 28px; }
  .wp-block-group.is-style-card:has(> .is-style-figure) { padding: 18px; }
}
