/* Block styles and container blocks for editable pages. Loaded after main.css.
   These give core blocks the same look as the :::columns cards, :::steps, :::note, :::cta and :::faq
   markdown blocks (rules duplicated from main.css). */

/* Cards: core/columns "ds-cards" and the ds/cards container. Never more than 4 per row. */
.wp-block-columns.is-style-ds-cards,
.ds-cols--cards {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(max(15rem, calc((100% - 3.75rem) / 4)), 1fr));
	gap: 1.25rem; margin-block: 1.5rem; flex-wrap: wrap;
}
.wp-block-columns.is-style-ds-cards > .wp-block-column,
.ds-cols--cards > .wp-block-column,
.ds-cols--cards > .ds-cols__col {
	display: flex; flex-direction: column; flex: none; min-width: 0; margin: 0; background: #fff; border: 1px solid var(--c-line);
	border-radius: var(--radius); padding: 1.4rem 1.4rem 1.5rem; box-shadow: 0 6px 16px rgba(107, 47, 163, 0.06);
}
.is-style-ds-cards > .wp-block-column > :first-child,
.ds-cols--cards > .wp-block-column > :first-child { margin-top: 0; }
.is-style-ds-cards > .wp-block-column > :last-child,
.ds-cols--cards > .wp-block-column > :last-child { margin-bottom: 0; }
.is-style-ds-cards h2, .ds-cols--cards > .wp-block-column h2 { font-size: clamp(1.4rem, 3vw, 1.7rem); }
.is-style-ds-cards h3, .ds-cols--cards > .wp-block-column h3 { font-size: 1.2rem; }
.is-style-ds-cards p, .ds-cols--cards > .wp-block-column p { font-size: 1rem; }
@media (min-width: 1180px) {
	.ds-prose .wp-block-columns.is-style-ds-cards { grid-auto-flow: row; align-items: stretch; }
}

/* CTA: core/buttons "ds-cta". */
.wp-block-buttons.is-style-ds-cta { margin: 1.5rem 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Steps: core/list "ds-steps", numbered with a counter so it works on ol and ul. */
.is-style-ds-steps {
	list-style: none; counter-reset: ds-step; padding: 0 !important; margin: 1.25rem 0 1.75rem; display: grid; gap: 0.75rem;
}
.is-style-ds-steps > li {
	counter-increment: ds-step; position: relative; background: #fff; border: 1px solid var(--c-line); border-radius: 14px;
	padding: 0.9rem 1rem 0.9rem 3.6rem; margin: 0; min-height: 3.6rem; box-shadow: 0 6px 16px rgba(107, 47, 163, 0.06);
}
.is-style-ds-steps > li::before {
	content: counter(ds-step); position: absolute; left: 0.9rem; top: 0.8rem; width: 2rem; height: 2rem; border-radius: 50%;
	background: var(--c-brand-fill); color: var(--c-on-brand); font: 700 1rem/2rem var(--font-body); text-align: center;
}

/* Note: core/group "ds-note". */
.wp-block-group.is-style-ds-note {
	margin: 1.25rem 0 1.75rem; padding: 0.9rem 1.1rem; background: #fff6f4; border-left: 5px solid var(--c-accent); border-radius: 0 14px 14px 0;
}
.wp-block-group.is-style-ds-note > :first-child { margin-top: 0; }
.wp-block-group.is-style-ds-note > :last-child { margin-bottom: 0; }

/* FAQ: core/group "ds-faq" and the ds/faq container, holding core/details blocks. */
.wp-block-group.is-style-ds-faq,
.ds-faq.wp-block-ds-faq { margin: 1.25rem 0 1.75rem; display: grid; gap: 0.6rem; }
.is-style-ds-faq > .wp-block-details,
.wp-block-ds-faq > .wp-block-details { border: 1px solid var(--c-line); border-radius: 14px; background: #fff; margin: 0; }
.is-style-ds-faq > .wp-block-details > summary,
.wp-block-ds-faq > .wp-block-details > summary {
	display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 52px; padding: 0.6rem 1rem;
	font-weight: 600; cursor: pointer; list-style: none;
}
.is-style-ds-faq > .wp-block-details > summary::-webkit-details-marker,
.wp-block-ds-faq > .wp-block-details > summary::-webkit-details-marker { display: none; }
.is-style-ds-faq > .wp-block-details > summary::after,
.wp-block-ds-faq > .wp-block-details > summary::after { content: "+"; font-size: 1.5rem; color: var(--c-brand-text); line-height: 1; flex: 0 0 auto; }
.is-style-ds-faq > .wp-block-details[open] > summary::after,
.wp-block-ds-faq > .wp-block-details[open] > summary::after { content: "\2212"; }
.is-style-ds-faq > .wp-block-details > :not(summary),
.wp-block-ds-faq > .wp-block-details > :not(summary) { padding: 0 1rem 0.5rem; margin: 0; }

/* Layout safety for block content: long words, long labels and empty-ish items never break the grid. */
.ds-cols--cards > *, .wp-block-columns.is-style-ds-cards > .wp-block-column { min-width: 0; overflow-wrap: anywhere; }
.ds-prices, .ds-prices > *, .wp-block-ds-prices, .wp-block-ds-glance, .ds-glance > * { min-width: 0; overflow-wrap: anywhere; }
.wp-block-button__link, .wp-block-buttons .wp-block-button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.is-style-ds-faq > .wp-block-details > summary, .wp-block-ds-faq > .wp-block-details > summary { overflow-wrap: anywhere; }
.is-style-ds-faq > .wp-block-details > summary > *, .wp-block-ds-faq > .wp-block-details > summary > * { min-width: 0; }
.wp-block-image img, .wp-block-ds-card img, .ds-cols--cards img { max-width: 100%; height: auto; }
.ds-cols--cards .wp-block-image img, .is-style-ds-cards .wp-block-image img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

/* ---- Visual parity with the old markdown markup ---- */

/* CTA buttons look like .ds-btn--solid / .ds-btn--ghost. */
.wp-block-buttons.is-style-ds-cta > .wp-block-button { margin: 0; }
.wp-block-buttons.is-style-ds-cta .wp-block-button__link {
	display: inline-flex; align-items: center; justify-content: center; text-align: center; box-sizing: border-box;
	min-height: 44px; padding: 0.6rem 1.25rem; border: 2px solid transparent; border-radius: 999px;
	font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
	background: var(--c-brand-fill); color: var(--c-on-brand);
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.wp-block-buttons.is-style-ds-cta .is-style-outline > .wp-block-button__link {
	background: #fff; color: var(--c-brand-text); border-color: var(--c-brand-text);
}
.wp-block-buttons.is-style-ds-cta .wp-block-button__link:hover {
	transform: translateY(-1px); box-shadow: 0 6px 16px rgba(29, 27, 34, 0.18); text-decoration: none;
}

/* Plain columns (not cards): stacked below 1180px, wide grid above, like .ds-cols. */
.ds-prose > .wp-block-group .wp-block-columns:not(.is-style-ds-cards) { display: block; margin: 0; max-width: none; }
.ds-prose > .wp-block-group .wp-block-columns:not(.is-style-ds-cards) > .wp-block-column { flex: none; min-width: 0; margin: 0; }
.ds-prose > .wp-block-group .wp-block-columns:not(.is-style-ds-cards) > .wp-block-column > :first-child { margin-top: 0; }
.ds-prose > .wp-block-group .wp-block-columns:not(.is-style-ds-cards) + .wp-block-columns:not(.is-style-ds-cards) { margin-top: 2.5rem; }
@media (max-width: 1179px) {
	.ds-prose > .wp-block-group .wp-block-columns:not(.is-style-ds-cards) > .wp-block-column + .wp-block-column > h2:first-child { margin-top: 2rem; }
}
@media (min-width: 1180px) {
	.ds-prose > .wp-block-group .wp-block-columns:not(.is-style-ds-cards) {
		--cols-w: min(71rem, calc(100vw - 2 * var(--gutter) - 1rem));
		width: var(--cols-w); margin-inline: calc((100% - var(--cols-w)) / 2);
		display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3.5rem; align-items: start;
	}
	.ds-prose > .wp-block-group .wp-block-columns:not(.is-style-ds-cards) .ds-glance { grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }
}
.ds-prose > .wp-block-group .ds-cols--cards { max-width: none; }
.ds-cols--cards > .wp-block-column > .wp-block-buttons:last-child { margin-top: auto; padding-top: 1rem; }
@media (min-width: 1180px) {
	.ds-prose > .wp-block-group .wp-block-columns:not(.is-style-ds-cards) > .wp-block-column > :last-child { margin-bottom: 0; }
	.ds-prose > .wp-block-group .ds-cols.ds-cols--cards { grid-auto-flow: row; gap: 1.25rem; align-items: stretch; }
}

/* WordPress layout classes zero element margins; restore the old element rhythm inside the content area. */
.ds-prose :where(.wp-block-group *):is(.is-layout-flow, .is-layout-constrained, .is-layout-flex) > :is(p, h1, h2, h3, h4),
.ds-prose > .wp-block-group:is(.is-layout-flow, .is-layout-constrained, .is-layout-flex) > :is(p, h1, h2, h3, h4) { margin-block-start: 0; }
.ds-prose :where(.wp-block-group *):is(.is-layout-flow, .is-layout-constrained, .is-layout-flex) > p,
.ds-prose > .wp-block-group:is(.is-layout-flow, .is-layout-constrained, .is-layout-flex) > p { margin-block-end: 1em; }
.ds-prose :where(.wp-block-group *):is(.is-layout-flow, .is-layout-constrained, .is-layout-flex) > :is(ul, ol):not([class]),
.ds-prose > .wp-block-group:is(.is-layout-flow, .is-layout-constrained, .is-layout-flex) > :is(ul, ol):not([class]) { margin-block-start: 0; margin-block-end: 1em; }
.ds-prose :where(.wp-block-group *):is(.is-layout-flow, .is-layout-constrained, .is-layout-flex) > :is(h1, h2, h3, h4),
.ds-prose > .wp-block-group:is(.is-layout-flow, .is-layout-constrained, .is-layout-flex) > :is(h1, h2, h3, h4) { margin-block-end: 0.6em; }
.ds-prose :where(.wp-block-group *):is(.is-layout-flow, .is-layout-constrained, .is-layout-flex) > h2:not(:first-child),
.ds-prose > .wp-block-group:is(.is-layout-flow, .is-layout-constrained, .is-layout-flex) > h2:not(:first-child) { margin-block-start: 2rem; }
.ds-prose :where(.wp-block-group *):is(.is-layout-flow, .is-layout-constrained, .is-layout-flex) > h3:not(:first-child),
.ds-prose > .wp-block-group:is(.is-layout-flow, .is-layout-constrained, .is-layout-flex) > h3:not(:first-child) { margin-block-start: 1.5rem; }
.ds-prose :where(.wp-block-group *):is(.is-layout-flow, .is-layout-constrained, .is-layout-flex) > h4:not(:first-child),
.ds-prose > .wp-block-group:is(.is-layout-flow, .is-layout-constrained, .is-layout-flex) > h4:not(:first-child) { margin-block-start: 1.25rem; }
.ds-prose > .wp-block-group .wp-block-column:only-child > p { max-width: 46rem; }
/* A heading-only region labels the columns under it. */
.ds-prose > .wp-block-group .wp-block-columns:not(.is-style-ds-cards):has(> .wp-block-column:only-child > h2:only-child) + .wp-block-columns { margin-top: 0.9rem; }

/* Steps: a long unbroken word must shrink the item, not stretch the page. */
.is-style-ds-steps { grid-template-columns: minmax(0, 1fr); min-width: 0; max-width: 100%; }
.is-style-ds-steps > li { min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }

/* Region spacing between columns and cards (old .ds-cols + .ds-cols), and core list indent. */
.ds-prose > .wp-block-group :is(.wp-block-columns, .ds-cols) + :is(.wp-block-columns, .ds-cols) { margin-top: 2.5rem; }
.ds-prose > .wp-block-group .ds-cols--cards + .ds-cols--cards { margin-top: 2.5rem; }
.ds-prose > .wp-block-group :is(ul, ol).wp-block-list:not([class*="is-style-"]) { padding-left: 1.4rem; margin: 0 0 1em; }
.ds-prose > .wp-block-group .wp-block-columns:not(.is-style-ds-cards):has(> .wp-block-column:only-child > h2:only-child) + :is(.wp-block-columns, .ds-cols) { margin-top: 0.9rem; }

/* Old quirk kept: a top-level first h2 keeps its 2rem top margin (.ds-prose h2 beat .ds-prose > :first-child). */
.ds-prose > .wp-block-group.is-layout-flow > h2:first-child { margin-block-start: 2rem; }


/* WordPress's 24px flow gap must not push shortcode-built regions down (old markup had none). */
.ds-prose > .wp-block-group .ds-contact { margin-block-start: 0; }
/* The old shortcode wrapper put an extra 2rem above a reviews band that follows a form. */
.ds-prose > .wp-block-group > :is(.ds-contact, .ds-form-wrap) + .ds-reviews--compact { margin-block-start: 4rem; }
.ds-prose > .wp-block-group .is-style-ds-steps { margin-block: 1.25rem 1.75rem; }

/* core/table looks like the old .ds-table-wrap. */
.ds-prose .wp-block-table { overflow-x: auto; max-width: 100%; margin: 1.25rem 0 1.75rem; border: 1px solid var(--c-line); border-radius: 14px; -webkit-overflow-scrolling: touch; }
.ds-prose .wp-block-table table { width: 100%; min-width: 28rem; border-collapse: collapse; font-size: 0.9375rem; border: 0; }
.ds-prose .wp-block-table th, .ds-prose .wp-block-table td { padding: 0.65rem 0.8rem; text-align: left; border: 0; border-bottom: 1px solid var(--c-line); vertical-align: top; }
.ds-prose .wp-block-table th { background: var(--c-tint); font-weight: 700; white-space: nowrap; }
.ds-prose .wp-block-table tbody tr:last-child td, .ds-prose .wp-block-table tbody tr:last-child th { border-bottom: 0; }

/* Event pages: wide regions stay inside the reading column (mirrors main.css, for core/columns). */
@media (min-width: 1024px) {
	.ds-event-page .ds-event__main.ds-prose > .wp-block-group .wp-block-columns:not(.is-style-ds-cards) { width: auto; margin-inline: 0; display: block; }
	.ds-event-page .ds-event__main.ds-prose > .wp-block-group .wp-block-columns:not(.is-style-ds-cards) > .wp-block-column + .wp-block-column { margin-top: 1.5rem; }
	.ds-event-page .ds-event__main.ds-prose > .wp-block-group .ds-cols.ds-cols--cards { width: auto; margin-inline: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
}
.ds-prose .wp-block-table thead { border-bottom: 0; }
.ds-prose .wp-block-table :is(thead, tbody, tfoot) { border: 0; }

/* Tab fields: each ds/tab holds a ds/glance; inside tabs it looks like the old label-over-value field grid
   (.ds-tabset__fields in main.css), not the tinted At a glance box. */
.ds-tabset .ds-glance { display: grid; grid-template-columns: 1fr; gap: 0.9rem; margin: 0; padding: 0; background: none; border: 0; border-radius: 0; }
.ds-tabset.is-tabs .ds-glance { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.25rem 2rem; align-content: start; }
.ds-tabset .ds-glance dd { margin: 0.2rem 0 0; font-weight: 400; }

/* Tables: break long words only when they cannot fit. "anywhere" shrinks min-content, so the table layout
   squeezed columns until words split mid-word ("Lyrica|l" on the Holiday Show schedule). */
.ds-prose .wp-block-table td, .ds-prose .wp-block-table th { overflow-wrap: break-word; }
