/*
 * Block editor content: layout, rhythm and the OrbixWP block style variants.
 * Loaded on the front end and in the editor canvas (enqueue_block_assets).
 * Presets (--wp--preset--*) come from theme.json; --color-ptvx-* carry the
 * ACF site-settings overrides and are used first where a brand color is needed.
 */

/* ---- Layout wrappers ---------------------------------------------------- */
.ptvx-block-content,
.ptvx-canvas__content {
	--wp--style--root--padding-left: 1.25rem;
	--wp--style--root--padding-right: 1.25rem;
}

.ptvx-block-content {
	padding-block: clamp(3.5rem, 8vw, 6rem);
}

.ptvx-canvas__content {
	padding-block: 0;
}

.entry-content {
	display: flow-root;
}

.ptvx-canvas .entry-content > .alignfull:first-child {
	margin-top: 0;
}

@media (max-width: 37.5rem) {
	.ptvx-block-content,
	.ptvx-canvas__content {
		--wp--style--root--padding-left: 1rem;
		--wp--style--root--padding-right: 1rem;
	}
}

/* Wide/full blocks cannot exceed the article column next to the sidebar. */
.ptvx-article-content > .alignwide,
.ptvx-article-content > .alignfull {
	width: auto;
	max-width: 100%;
	margin-inline: 0;
}

/* ---- Block rhythm (beats the base reset and paragraph margins) ---------- */
body.ptvx-site .entry-content :is(.is-layout-flow, .is-layout-constrained) > * {
	margin-block-end: 0;
}

body.ptvx-site .entry-content :is(.is-layout-flow, .is-layout-constrained) > * + * {
	margin-block-start: var(--wp--style--block-gap, 1.25rem);
}

body.ptvx-site .entry-content :is(.is-layout-flow, .is-layout-constrained) > :is(h1, h2, h3, h4, h5, h6) + * {
	margin-block-start: 0.75rem;
}

body.ptvx-site .entry-content.is-layout-constrained > :is(h2, h3, h4, h5, h6):not(:first-child) {
	margin-block-start: 2em;
}

body.ptvx-site .entry-content :is(.is-layout-flow, .is-layout-constrained) > :first-child {
	margin-block-start: 0;
}

/* ---- Text, links, lists ------------------------------------------------- */
body.ptvx-site .entry-content :is(p, li, td, figcaption, blockquote) a:not(.wp-block-button__link, .wp-element-button) {
	color: var(--wp--preset--color--highlight, #c45b50);
	text-decoration: underline;
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.16em;
}

body.ptvx-site .entry-content :is(p, li, td, figcaption, blockquote) a:not(.wp-block-button__link, .wp-element-button):hover {
	color: var(--wp--preset--color--highlight-dark, #9e443b);
}

.entry-content :is(ul.wp-block-list, ol.wp-block-list, ul:not([class]), ol:not([class])) {
	padding-left: 1.5rem;
	list-style-position: outside;
}

.entry-content :is(ul.wp-block-list, ul:not([class])) {
	list-style-type: disc;
}

.entry-content :is(ol.wp-block-list, ol:not([class])) {
	list-style-type: decimal;
}

.entry-content :is(ul, ol) :is(ul, ol) {
	margin-top: 0.5rem;
}

.entry-content :is(ul.wp-block-list, ol.wp-block-list) > li + li {
	margin-top: 0.5rem;
}

/* Headings inside coloured or dark containers inherit their color. */
body.ptvx-site :is(.has-text-color, .is-style-ptvx-dark-panel) :is(h1, h2, h3, h4, h5, h6) {
	color: inherit;
}

/* ---- Buttons ------------------------------------------------------------ */
body.ptvx-site .wp-block-button__link:not(.has-text-color) {
	color: #fff;
	text-decoration: none;
}

.wp-block-button__link {
	display: inline-flex;
	min-height: 2.875rem;
	align-items: center;
	justify-content: center;
	text-align: center;
	transition: transform 200ms ease, background-color 200ms ease, box-shadow 200ms ease, color 200ms ease;
}

.wp-block-button__link:hover {
	transform: translateY(-0.125rem);
}

.wp-block-button__link:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent, #d6a84f);
	outline-offset: 3px;
}

body.ptvx-site .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) {
	border: 1px solid var(--wp--preset--color--highlight, #c45b50);
	background: transparent;
	box-shadow: none;
	color: var(--wp--preset--color--highlight, #c45b50);
}

body.ptvx-site .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color):hover {
	background: var(--wp--preset--color--highlight, #c45b50);
	color: #fff;
}

body.ptvx-site .wp-block-button.is-style-ptvx-dark > .wp-block-button__link:not(.has-background) {
	border-color: var(--wp--preset--color--primary, #243b53);
	background: var(--wp--preset--color--primary, #243b53);
	box-shadow: 0 10px 24px rgb(8 23 44 / 18%);
	color: #fff;
}

body.ptvx-site .wp-block-button.is-style-ptvx-dark > .wp-block-button__link:not(.has-background):hover {
	border-color: var(--wp--preset--color--primary-deep, #172b3f);
	background: var(--wp--preset--color--primary-deep, #172b3f);
}

body.ptvx-site .wp-block-button.is-style-ptvx-ghost > .wp-block-button__link:not(.has-background) {
	border-color: rgb(255 255 255 / 70%);
	background: transparent;
	box-shadow: none;
	color: #fff;
}

body.ptvx-site .wp-block-button.is-style-ptvx-ghost > .wp-block-button__link:not(.has-background):hover {
	background: #fff;
	color: var(--wp--preset--color--primary, #243b53);
}

/* ---- Group variants ----------------------------------------------------- */
.wp-block-group.is-style-ptvx-card {
	border: 1px solid var(--wp--preset--color--line, #d9e2ec);
	border-radius: var(--wp--custom--radius--card, 1.125rem);
	background: #fff;
	box-shadow: var(--wp--preset--shadow--card, 0 8px 24px rgb(8 23 44 / 5%));
}

.wp-block-group.is-style-ptvx-card:where(:not([style*="padding"])) {
	padding: clamp(1.25rem, 3vw, 1.75rem);
}

.wp-block-group.is-style-ptvx-surface:where(:not(.has-background)) {
	background: var(--wp--preset--color--surface, #f5f7f8);
}

.wp-block-group.is-style-ptvx-surface:where(:not([style*="padding"])) {
	padding-block: clamp(3.875rem, 8vw, 6.875rem);
}

.wp-block-group.is-style-ptvx-dark-panel {
	border-radius: var(--wp--custom--radius--card, 1.125rem);
	background: var(--wp--preset--color--primary-deep, #172b3f);
	color: #fff;
}

.wp-block-group.is-style-ptvx-dark-panel:where(:not([style*="padding"])) {
	padding: clamp(1.75rem, 5vw, 3.5rem);
}

/* ---- Paragraph, list and image variants -------------------------------- */
body.ptvx-site p.is-style-ptvx-eyebrow {
	margin-bottom: 0.75rem;
	color: var(--wp--preset--color--highlight, #c45b50);
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

.entry-content ul.is-style-ptvx-checklist {
	padding-left: 0;
	list-style: none;
}

.entry-content ul.is-style-ptvx-checklist > li {
	position: relative;
	padding-left: 1.75rem;
}

.entry-content ul.is-style-ptvx-checklist > li::before {
	position: absolute;
	top: 0.2em;
	left: 0;
	display: inline-flex;
	width: 1.15rem;
	height: 1.15rem;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--wp--preset--color--success, #4b8065);
	color: #fff;
	content: "\2713";
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1;
}

.wp-block-image.is-style-ptvx-soft img {
	box-shadow: var(--wp--preset--shadow--lifted, 0 20px 45px rgb(8 23 44 / 12%));
}

/* ---- Core blocks that the base reset flattens -------------------------- */
.wp-block-details {
	background: #fff;
}

.wp-block-details summary {
	cursor: pointer;
	color: var(--wp--preset--color--primary, #243b53);
	font-weight: 600;
}

.wp-block-details[open] summary {
	margin-bottom: 0.75rem;
}

.wp-block-details summary:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent, #d6a84f);
	outline-offset: 3px;
}

.wp-block-table table {
	width: 100%;
	border-collapse: collapse;
}

.wp-block-table :where(th, td) {
	border: 1px solid var(--wp--preset--color--line, #d9e2ec);
	padding: 0.75rem 1rem;
	text-align: left;
	vertical-align: top;
}

.wp-block-table thead th {
	background: var(--wp--preset--color--surface, #f5f7f8);
	color: var(--wp--preset--color--primary, #243b53);
	font-weight: 700;
}

.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
	background: var(--wp--preset--color--surface, #f5f7f8);
}

.wp-block-quote {
	margin: 0;
}

.wp-block-pullquote {
	margin-inline: 0;
	text-align: center;
}

.wp-block-pullquote blockquote {
	margin: 0;
	border: 0;
	background: transparent;
	padding: 0;
}

.wp-block-separator {
	margin-block: 2rem;
}

.wp-block-image img,
.wp-block-gallery img {
	height: auto;
}

.wp-block-image :where(figcaption),
.wp-block-gallery :where(figcaption) {
	margin-top: 0.5rem;
}

.wp-block-post-template {
	padding: 0;
	list-style: none;
}

.wp-block-query-pagination {
	gap: 0.75rem;
}

body.ptvx-site .wp-block-post-title a,
body.ptvx-site .wp-block-post-featured-image a {
	color: inherit;
	text-decoration: none;
}

body.ptvx-site .wp-block-post-title a:hover {
	color: var(--wp--preset--color--highlight, #c45b50);
}
