/* =====================================================================
   blocks.css — anything the client can drop onto a page.

   - Free text: plain paragraphs, lists, captions and quotes she adds
     anywhere pick up the site's sizes and spacing on their own.
   - Block styles: the extra looks in the block sidebar's Styles panel
     (registered in mamt_register_block_styles(), functions.php).
   - The MAMT patterns (patterns/*.php) and the PDF viewer (mamt.js).

   Most rules name two scopes: `.wp-block-post-content` for the site and
   `.editor-styles-wrapper` for the editor. WordPress loads this sheet into
   the editor with no added weight, so without the second selector the
   editor's own blanket p / a / ul rules in editor-style.css would win there
   and the editor would stop looking like the site.
   ===================================================================== */

/* ─── Free text ──────────────────────────────────────────────────────── */
/* Space between plain blocks dropped one after another. Zero weight (:where),
   never for anything with a component class ("__", like exec-row__name), and
   a paragraph only gets it when it is plain text — no class, or just a
   sidebar style or colour (is-style-*, has-*). So every designed component on
   the existing pages (the hero's eyebrow, the panel labels) keeps exactly the
   spacing it already has. */
.wp-block-post-content :where(p, ul, ol, .wp-block-image, .wp-block-quote, .wp-block-file, .wp-block-embed, .wp-block-table, .wp-block-details, .wp-block-gallery, .wp-block-buttons):where(:not([class*="__"]))
+ :where(p:not([class]), p[class^="is-style-"], p[class^="has-"], .wp-block-list, .wp-block-image, .wp-block-quote, .wp-block-file, .wp-block-embed, .wp-block-table, .wp-block-details, .wp-block-gallery):where(:not([class*="__"])) {
  margin-top: 1rem;
}

/* Captions under images, galleries, tables, videos. Zero weight on the site
   so a component's own caption styling (the Spotlight poster's) still wins. */
:where(.wp-block-post-content) figcaption,
.editor-styles-wrapper figcaption {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-light);
  text-align: center;
  margin-top: 0.625rem;
  max-width: none;
}

/* Text on a photo banner (Cover block) is light, whatever it is. */
.wp-block-post-content .wp-block-cover :where(p, li),
.editor-styles-wrapper .wp-block-cover :where(p, li) { color: rgba(255,255,255,0.88); }
.wp-block-post-content .wp-block-cover :where(h1, h2, h3, h4),
.editor-styles-wrapper .wp-block-cover :where(h1, h2, h3, h4) { color: var(--white); margin-top: 0; }

/* Tighter band for a divider or announcement between two sections. */
.wp-block-group.section.section--tight { padding-block: clamp(1.25rem, 3vw, 2rem); }

/* Responsive video embeds (YouTube, Vimeo). */
.wp-block-embed.mamt-video { margin-top: 1rem; }
.wp-block-embed.mamt-video iframe { border: 1px solid var(--rule-mid); }

/* ─── Block styles (Styles panel) ────────────────────────────────────── */

/* Paragraph: Large intro */
.wp-block-post-content p.is-style-mamt-lead,
.editor-styles-wrapper p.is-style-mamt-lead {
  font-size: clamp(1.125rem, 1.6vw, 1.3125rem);
  line-height: 1.7;
  color: var(--text-mid);
}

/* Paragraph: Small label */
.wp-block-post-content p.is-style-mamt-label,
.editor-styles-wrapper p.is-style-mamt-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--blue-deep);
}

/* Group: Card */
.wp-block-group.is-style-mamt-card {
  background: var(--paper);
  border: 1px solid var(--rule-mid);
  padding: clamp(1.25rem, 3vw, 1.75rem);
}

/* Group: Blue panel */
.wp-block-group.is-style-mamt-panel {
  background: var(--blue-deep);
  padding: clamp(1.5rem, 3.5vw, 2.25rem);
}
.wp-block-post-content .is-style-mamt-panel :where(p, li),
.editor-styles-wrapper .is-style-mamt-panel :where(p, li) { color: rgba(255,255,255,0.85); }
.wp-block-post-content .is-style-mamt-panel :where(h2, h3, h4, a),
.editor-styles-wrapper .is-style-mamt-panel :where(h2, h3, h4, a) { color: var(--white); }
.is-style-mamt-panel .wp-block-button__link { background: var(--white) !important; color: var(--blue-deep) !important; border-color: var(--white) !important; }

/* Group: Note */
.wp-block-group.is-style-mamt-note {
  background: var(--blue-pale);
  border-left: 3px solid var(--blue-deep);
  padding: 1rem 1.25rem;
}
.wp-block-post-content .is-style-mamt-note p,
.editor-styles-wrapper .is-style-mamt-note p { font-size: 1rem; margin: 0; max-width: none; }

/* Image: Framed */
.wp-block-image.is-style-mamt-framed img {
  border: 1px solid var(--rule-mid);
  box-shadow: var(--shadow);
}

/* Image: Poster (click to enlarge) — mamt.js opens it full size. */
.wp-block-image.is-style-mamt-poster img {
  max-width: min(100%, 560px);
  margin-inline: auto;
  box-shadow: var(--shadow-lg);
  transition: transform 300ms ease;
}
.wp-block-image.is-style-mamt-poster.is-zoomable { cursor: zoom-in; }
.wp-block-image.is-style-mamt-poster.is-zoomable:hover img { transform: translateY(-3px); }

/* List: Ticks */
.wp-block-post-content ul.is-style-mamt-ticks,
.editor-styles-wrapper ul.is-style-mamt-ticks { list-style: none; padding-left: 0; }
.wp-block-post-content .is-style-mamt-ticks li,
.editor-styles-wrapper .is-style-mamt-ticks li { position: relative; padding-left: 1.75rem; }
.is-style-mamt-ticks li::before {
  content: '';
  position: absolute;
  left: 0.2rem;
  top: 0.45em;
  width: 0.55rem;
  height: 0.9rem;
  border: solid var(--green);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* Quote: MAMT quote */
.wp-block-post-content .wp-block-quote.is-style-mamt-quote,
.editor-styles-wrapper .wp-block-quote.is-style-mamt-quote {
  border: none;
  padding: 0;
  margin-inline: auto;
  max-width: 44rem;
  text-align: center;
}
.wp-block-quote.is-style-mamt-quote::before {
  content: '\201C';
  display: block;
  font-family: var(--font-serif);
  font-size: 4.5rem;
  line-height: 0.8;
  color: var(--green);
}
.wp-block-post-content .wp-block-quote.is-style-mamt-quote p,
.editor-styles-wrapper .wp-block-quote.is-style-mamt-quote p {
  font-family: var(--font-serif);
  font-size: clamp(1.375rem, 2.6vw, 1.875rem);
  font-style: italic;
  line-height: 1.4;
  color: var(--charcoal);
  max-width: none;
}
.wp-block-quote.is-style-mamt-quote cite {
  display: block;
  margin-top: 1rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
}

/* Table: Clean rows */
.wp-block-post-content .wp-block-table.is-style-mamt-rows table,
.editor-styles-wrapper .wp-block-table.is-style-mamt-rows table { border: none; }
.wp-block-post-content .wp-block-table.is-style-mamt-rows td,
.editor-styles-wrapper .wp-block-table.is-style-mamt-rows td { border: none; border-bottom: 1px solid var(--rule-mid); padding: 0.75rem 0.5rem; }
.wp-block-post-content .wp-block-table.is-style-mamt-rows td:first-child { border-right: none; }

/* Details: FAQ */
.wp-block-details.is-style-mamt-faq {
  border-bottom: 1px solid var(--rule-mid);
  padding: 0;
}
.wp-block-details.is-style-mamt-faq:first-of-type { border-top: 1px solid var(--rule-mid); }
.wp-block-post-content .wp-block-details.is-style-mamt-faq + .wp-block-details.is-style-mamt-faq { margin-top: 0; }
.wp-block-details.is-style-mamt-faq summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding: 1.125rem 2.5rem 1.125rem 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--charcoal);
}
.wp-block-details.is-style-mamt-faq summary::-webkit-details-marker { display: none; }
.wp-block-details.is-style-mamt-faq summary::after {
  content: '+';
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--blue-deep);
  transition: transform var(--transition);
}
.wp-block-details.is-style-mamt-faq[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.wp-block-details.is-style-mamt-faq summary:hover { color: var(--blue-deep); }
.wp-block-details.is-style-mamt-faq > :not(summary) { padding-bottom: 1.125rem; margin-top: 0; }

/* ─── Patterns ───────────────────────────────────────────────────────── */

/* Page Title with Intro */
.wp-block-post-content p.page-header__intro,
.editor-styles-wrapper p.page-header__intro {
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  line-height: 1.7;
  color: var(--text-mid);
  max-width: 56ch;
  margin: 1rem auto 0;
  text-align: center;
}

/* Section Heading & Intro */
.mamt-intro { text-align: center; }
.mamt-intro .eyebrow { justify-content: center; }
.wp-block-post-content .mamt-intro h2,
.editor-styles-wrapper .mamt-intro h2 { margin-top: 0; }
.wp-block-post-content .mamt-intro p.is-style-mamt-lead,
.editor-styles-wrapper .mamt-intro p.is-style-mamt-lead { margin: 1rem auto 0; max-width: 56ch; }

/* Divider */
.wp-block-separator.mamt-divider { height: 1px; border: none; background: var(--rule-mid); margin: 0; opacity: 1; }

/* Image Banner (Cover block) */
.wp-block-cover.mamt-banner { padding: clamp(3rem, 7vw, 5.5rem) clamp(1.25rem, 5vw, 2.5rem); }
.wp-block-cover.mamt-banner .wp-block-cover__inner-container { max-width: 42rem; }
.wp-block-post-content .wp-block-cover.mamt-banner h2,
.editor-styles-wrapper .wp-block-cover.mamt-banner h2 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 0.75rem; }
.wp-block-post-content .wp-block-cover.mamt-banner p,
.editor-styles-wrapper .wp-block-cover.mamt-banner p { font-size: 1.125rem; line-height: 1.7; max-width: none; }
.mamt-banner .wp-block-buttons { margin-top: 1.75rem; }
.mamt-banner .wp-block-button.is-style-outline .wp-block-button__link { color: var(--white) !important; border-color: rgba(255,255,255,0.7) !important; }
.mamt-banner .wp-block-button.is-style-outline .wp-block-button__link:hover { background: rgba(255,255,255,0.14) !important; border-color: var(--white) !important; }
.mamt-banner .wp-block-button:not(.is-style-outline) .wp-block-button__link { background: var(--white) !important; color: var(--blue-deep) !important; border-color: var(--white) !important; }
.mamt-banner .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover { background: var(--blue-pale) !important; border-color: var(--blue-pale) !important; }
/* Text-on-the-left banner: line up with the page's content edge. */
.wp-block-cover.mamt-banner--left .wp-block-cover__inner-container { width: 100%; max-width: var(--max-width); margin-inline: auto; }
.wp-block-cover.mamt-banner--left .wp-block-cover__inner-container > * { max-width: 36rem; }

/* Announcement Bar */
.mamt-announcement {
  display: flex;
  align-items: center;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  background: var(--blue-pale);
  border-left: 3px solid var(--green);
  padding: 1rem 1.25rem;
}
/* A row, so no block may carry a top margin into it — the editor adds one to
   every block after the first, which dropped the text below the label. */
.mamt-announcement > *,
.editor-styles-wrapper .mamt-announcement > .wp-block { margin-top: 0 !important; margin-bottom: 0 !important; }
.wp-block-post-content p.mamt-announcement__label,
.editor-styles-wrapper p.mamt-announcement__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--green);
  margin: 0;
  flex-shrink: 0;
}
.wp-block-post-content p.mamt-announcement__text,
.editor-styles-wrapper p.mamt-announcement__text { font-size: 1rem; line-height: 1.6; margin: 0; max-width: none; color: var(--charcoal); flex: 1; min-width: 12rem; }

/* Image Cards */
.wp-block-columns.mamt-image-cards { margin-top: 1.5rem; }
.mamt-image-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--rule-mid);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.mamt-image-card:hover { border-color: var(--blue-deep); box-shadow: var(--shadow); transform: translateY(-2px); }
.wp-block-image.mamt-image-card__image { margin: 0 !important; }
.wp-block-image.mamt-image-card__image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.mamt-image-card__body { padding: 1.25rem 1.375rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.wp-block-post-content .mamt-image-card__body h3,
.editor-styles-wrapper .mamt-image-card__body h3 { font-size: 1.375rem; margin: 0 0 0.5rem; }
.wp-block-post-content .mamt-image-card__body p,
.editor-styles-wrapper .mamt-image-card__body p { font-size: 0.9375rem; line-height: 1.7; max-width: none; }
.wp-block-post-content p.mamt-image-card__link,
.editor-styles-wrapper p.mamt-image-card__link { margin-top: auto; padding-top: 0.875rem; font-size: 0.875rem; font-weight: 600; }
.wp-block-post-content .mamt-image-card__link a,
.editor-styles-wrapper .mamt-image-card__link a { text-decoration: none; color: var(--blue-deep); }

/* Numbers */
.mamt-stats { text-align: center; }
.wp-block-post-content p.mamt-stats__number,
.editor-styles-wrapper p.mamt-stats__number {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 600;
  line-height: 1;
  color: var(--blue-deep);
  max-width: none;
}
.wp-block-post-content p.mamt-stats__label,
.editor-styles-wrapper p.mamt-stats__label { font-size: 0.9375rem; line-height: 1.5; margin: 0.625rem auto 0; max-width: 22ch; }

/* Image and Text / Text and Image (Media & Text block) */
.wp-block-media-text.mamt-media-text { gap: 0; }
.mamt-media-text .wp-block-media-text__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--rule-mid); }
.mamt-media-text .wp-block-media-text__content { padding: 0 0 0 clamp(1.5rem, 4vw, 3.5rem); }
.mamt-media-text.has-media-on-the-right .wp-block-media-text__content { padding: 0 clamp(1.5rem, 4vw, 3.5rem) 0 0; }
.wp-block-post-content .mamt-media-text h2,
.editor-styles-wrapper .mamt-media-text h2 { margin-top: 0; }
@media (max-width: 600px) {
  .mamt-media-text .wp-block-media-text__content,
  .mamt-media-text.has-media-on-the-right .wp-block-media-text__content { padding: 1.5rem 0 0; }
}

/* Photo Gallery */
.wp-block-gallery.mamt-gallery { margin-top: 1.5rem; gap: 0.75rem; }
.wp-block-gallery.mamt-gallery .wp-block-image img { aspect-ratio: 4 / 3; object-fit: cover; }

/* Partner Logos */
.mamt-logos__label { justify-content: center; display: flex !important; }
.wp-block-columns.mamt-logos { align-items: center; margin-top: 1rem; }
.mamt-logos .wp-block-image { margin: 0; text-align: center; }
.mamt-logos .wp-block-image img { max-height: 72px; width: auto; margin-inline: auto; object-fit: contain; filter: grayscale(1); opacity: 0.75; transition: filter var(--transition), opacity var(--transition); }
.mamt-logos .wp-block-image img:hover { filter: none; opacity: 1; }

/* Numbered Steps */
.wp-block-post-content ol.mamt-steps,
.editor-styles-wrapper ol.mamt-steps { list-style: none; padding-left: 0; counter-reset: mamt-step; margin-top: 1.5rem; }
.wp-block-post-content .mamt-steps li,
.editor-styles-wrapper .mamt-steps li {
  counter-increment: mamt-step;
  position: relative;
  padding: 0.25rem 0 1.25rem 3.5rem;
  margin: 0;
  min-height: 2.5rem;
}
.mamt-steps li::before {
  content: counter(mamt-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--blue-deep);
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Links & Downloads */
.wp-block-post-content ul.mamt-links,
.editor-styles-wrapper ul.mamt-links { list-style: none; padding-left: 0; margin-top: 1rem; border-top: 1px solid var(--rule-mid); }
.wp-block-post-content .mamt-links li,
.editor-styles-wrapper .mamt-links li { margin: 0; border-bottom: 1px solid var(--rule-mid); }
.wp-block-post-content .mamt-links a,
.editor-styles-wrapper .mamt-links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 0.25rem;
  text-decoration: none;
  color: var(--charcoal);
  font-weight: 500;
}
.mamt-links a::after { content: '\2192'; color: var(--blue-deep); transition: transform var(--transition); }
.wp-block-post-content .mamt-links a:hover { color: var(--blue-deep); }
.mamt-links a:hover::after { transform: translateX(4px); }

/* ─── PDFs ───────────────────────────────────────────────────────────── */
/* Page one, shown like a picture (File block style, and PDF posters). */
.pdf-cover { position: relative; line-height: 0; }
.wp-block-file .pdf-cover {
  max-width: 560px;
  margin: 0 auto 1rem;
  background: var(--white);
  border: 1px solid var(--rule-mid);
  box-shadow: var(--shadow-lg);
  transition: transform 300ms ease, box-shadow 300ms ease;
}
.wp-block-file .pdf-cover.is-zoomable { cursor: zoom-in; }
.wp-block-file .pdf-cover.is-zoomable:hover { transform: translateY(-3px); box-shadow: 0 18px 48px rgba(0,0,0,0.14); }
.wp-block-file .pdf-cover.is-zoomable:focus-visible { outline: 2px solid var(--blue-deep); outline-offset: 3px; }

.pdf-page { position: relative; width: 100%; background: var(--white); }
.pdf-page canvas { display: block; width: 100%; height: 100%; }
.pdf-page__link { position: absolute; display: block; border-radius: 2px; }
.pdf-page__link:hover,
.pdf-page__link:focus-visible { background: rgba(71,167,200,0.18); outline: 2px solid var(--blue-light); }

/* Every page in a scroll box (File block style). */
.wp-block-file .pdf-viewer {
  max-height: min(80vh, 900px);
  overflow-y: auto;
  margin-bottom: 1rem;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  background: var(--paper);
  border: 1px solid var(--rule-mid);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.wp-block-file .pdf-viewer .pdf-page { box-shadow: var(--shadow-sm); }

/* Once a PDF is drawn, WordPress's own embed is not needed. */
.wp-block-file.is-pdf-ready .wp-block-file__embed { display: none; }

/* The file name and download button under a PDF. */
.wp-block-file.is-style-pdf-page,
.wp-block-file.is-style-pdf-scroll { display: block; text-align: center; }
.wp-block-file.is-style-pdf-page > a:not(.wp-block-file__button),
.wp-block-file.is-style-pdf-scroll > a:not(.wp-block-file__button) { font-size: 0.875rem; color: var(--text-mid); margin-right: 0.75rem; }
.wp-block-file .wp-block-file__button {
  display: inline-flex;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--blue-deep);
  color: var(--white) !important;
  text-decoration: none !important;
}
.wp-block-file .wp-block-file__button:hover { background: #134870; }

/* The viewer that opens on click. */
.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20,20,18,0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.5rem, 3vw, 2rem);
  animation: poster-modal-in 180ms ease;
}
.pdf-modal[hidden] { display: none; }
.pdf-modal__panel {
  width: min(100%, 920px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(0,0,0,0.35);
}
.pdf-modal__bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem 0.75rem 1.25rem;
  background: var(--white);
  border-bottom: 1px solid var(--rule-mid);
}
.pdf-modal__title { flex: 1; margin: 0; font-weight: 600; font-size: 0.9375rem; color: var(--charcoal); max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-modal__open { font-size: 0.8125rem; font-weight: 600; color: var(--blue-deep); text-decoration: underline; white-space: nowrap; }
.pdf-modal__close { font-size: 1.75rem; line-height: 1; color: var(--charcoal); padding: 0 0.25rem; }
.pdf-modal__close:hover { color: var(--blue-deep); }
.pdf-modal__body { overflow-y: auto; padding: clamp(0.75rem, 2.5vw, 1.5rem); }
.pdf-viewer__pages { display: flex; flex-direction: column; gap: 1rem; }
.pdf-viewer__pages .pdf-page { box-shadow: var(--shadow); }
.pdf-viewer__status,
.pdf-viewer__more { text-align: center; color: var(--text-mid); font-size: 0.9375rem; padding: 2rem 1rem; margin: 0 auto; }
.pdf-viewer__more a { color: var(--blue-deep); text-decoration: underline; }

/* Workshop card with a PDF poster: page one fills the poster well. */
.workshop-card__poster .pdf-cover { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; transition: transform 400ms ease; }
.workshop-card__poster .pdf-cover .pdf-page { width: auto; height: 100%; max-width: 100%; background: transparent; }
.workshop-card__poster.is-zoomable:hover .pdf-cover { transform: scale(1.04); }
.pdf-poster__fallback {
  line-height: 1.4;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--blue-deep);
  text-decoration: underline;
  padding: 1.5rem;
  text-align: center;
}
