/* Gutenberg editorial system ------------------------------------------------
 * Shared by frontend and editor. The goal is a curated VR-2027 vocabulary,
 * not a page-builder style free-for-all.
 */

.vpt-editorial-content {
	display: grid;
	grid-template-columns: minmax(0, 1fr) min(100%, var(--vp-content-max)) minmax(0, 1fr);
	column-gap: 0;
}

.vpt-editorial-content > * {
	grid-column: 2;
	min-width: 0;
	width: 100%;
}

.vpt-editorial-content > .alignwide {
	grid-column: 1 / -1;
	width: 100%;
	max-width: var(--vp-container-max);
}

.vpt-editorial-content > .alignfull {
	grid-column: 1 / -1;
	width: 100%;
	max-width: var(--vp-container-max);
}

.vpt-editorial-content > :first-child { margin-top: 0; }
.vpt-editorial-content > :last-child { margin-bottom: 0; }

.vpt-editorial-content p,
.editor-styles-wrapper p {
	line-height: 1.65;
}

.vpt-editorial-content h2,
.vpt-editorial-content h3,
.vpt-editorial-content h4 {
	margin-top: 1.75em;
}

/* Group styles ------------------------------------------------------------ */
.wp-block-group.is-style-vpt-card,
.editor-styles-wrapper .wp-block-group.is-style-vpt-card {
	padding: clamp(1.5rem, 2.5vw, 2.25rem);
	border: 1px solid var(--vp-color-border);
	border-radius: var(--vp-radius-xl);
	background: var(--vp-color-surface);
	box-shadow: var(--vp-shadow-sm);
}

.wp-block-group.is-style-vpt-notice,
.editor-styles-wrapper .wp-block-group.is-style-vpt-notice {
	position: relative;
	padding: clamp(1.25rem, 2.25vw, 2rem);
	border: 1px solid var(--vp-color-border);
	border-left: 4px solid var(--vp-bank-accent);
	border-radius: 0 var(--vp-radius-lg) var(--vp-radius-lg) 0;
	background: var(--vp-color-surface-subtle);
}

.wp-block-group.is-style-vpt-notice > :last-child,
.wp-block-group.is-style-vpt-card > :last-child { margin-bottom: 0; }

/* Images ------------------------------------------------------------------ */
.wp-block-image.is-style-vpt-rounded img,
.editor-styles-wrapper .wp-block-image.is-style-vpt-rounded img {
	border-radius: var(--vp-radius-xl);
}

.wp-block-image figcaption,
.wp-block-gallery figcaption,
.editor-styles-wrapper figcaption {
	color: var(--vp-color-text-soft);
	font-size: var(--vp-font-size-xs);
	line-height: 1.45;
}

/* Buttons ----------------------------------------------------------------- */
.wp-block-button .wp-block-button__link,
.editor-styles-wrapper .wp-block-button .wp-block-button__link {
	min-height: 2.75rem;
	padding: 0.72rem 1.35rem;
	border: 1px solid var(--vp-bank-primary);
	border-radius: var(--vp-radius-pill);
	background: var(--vp-bank-primary);
	color: #fff;
	font-weight: var(--vp-font-weight-bold);
	line-height: 1.2;
	text-decoration: none;
}

.wp-block-button .wp-block-button__link:hover {
	border-color: var(--vp-color-action-hover);
	background: var(--vp-color-action-hover);
}

.wp-block-button.is-style-vpt-secondary .wp-block-button__link,
.editor-styles-wrapper .wp-block-button.is-style-vpt-secondary .wp-block-button__link {
	background: transparent;
	color: var(--vp-bank-primary);
}

.wp-block-button.is-style-vpt-secondary .wp-block-button__link:hover {
	background: var(--vp-color-surface-selected);
}

.wp-block-button.is-style-vpt-link .wp-block-button__link,
.editor-styles-wrapper .wp-block-button.is-style-vpt-link .wp-block-button__link {
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--vp-bank-primary);
}

.wp-block-button.is-style-vpt-link .wp-block-button__link::after,
.editor-styles-wrapper .wp-block-button.is-style-vpt-link .wp-block-button__link::after {
	content: "→";
	margin-left: 0.45em;
}

/* Quote ------------------------------------------------------------------- */
.wp-block-quote.is-style-vpt-quote,
.editor-styles-wrapper .wp-block-quote.is-style-vpt-quote {
	margin-inline: 0;
	padding: var(--vp-space-5) var(--vp-space-6);
	border: 0;
	border-left: 4px solid var(--vp-bank-primary);
	background: var(--vp-color-surface-subtle);
	font-size: var(--vp-font-size-lg);
}

.wp-block-quote.is-style-vpt-quote cite,
.editor-styles-wrapper .wp-block-quote.is-style-vpt-quote cite {
	color: var(--vp-color-text-muted);
	font-size: var(--vp-font-size-sm);
	font-style: normal;
}

/* Checklist --------------------------------------------------------------- */
.wp-block-list.is-style-vpt-checklist,
.editor-styles-wrapper .wp-block-list.is-style-vpt-checklist {
	padding-left: 0;
	list-style: none;
}

.wp-block-list.is-style-vpt-checklist > li,
.editor-styles-wrapper .wp-block-list.is-style-vpt-checklist > li {
	position: relative;
	padding-left: 1.75rem;
	margin-block: 0.55rem;
}

.wp-block-list.is-style-vpt-checklist > li::before,
.editor-styles-wrapper .wp-block-list.is-style-vpt-checklist > li::before {
	content: "✓";
	position: absolute;
	left: 0;
	top: 0;
	color: var(--vp-status-success);
	font-weight: var(--vp-font-weight-bold);
}

/* Pattern-specific composition ------------------------------------------- */
.vpt-pattern-intro,
.editor-styles-wrapper .vpt-pattern-intro {
	padding-block: clamp(1rem, 2vw, 2rem);
}

.vpt-pattern-eyebrow,
.editor-styles-wrapper .vpt-pattern-eyebrow {
	margin-bottom: var(--vp-space-2);
	color: var(--vp-bank-primary);
	font-size: var(--vp-font-size-sm);
	font-weight: var(--vp-font-weight-bold);
}

.vpt-pattern-intro h2,
.editor-styles-wrapper .vpt-pattern-intro h2 {
	max-width: 24ch;
	margin-bottom: var(--vp-space-4);
}

.vpt-pattern-lead,
.editor-styles-wrapper .vpt-pattern-lead {
	max-width: 46rem;
	color: var(--vp-color-text-muted);
	font-size: var(--vp-font-size-lg);
}

.vpt-pattern-media,
.editor-styles-wrapper .vpt-pattern-media {
	align-items: center;
	gap: clamp(1.5rem, 4vw, 4rem);
}

.vpt-pattern-media .wp-block-image,
.editor-styles-wrapper .vpt-pattern-media .wp-block-image {
	margin: 0;
}

.vpt-pattern-cta,
.editor-styles-wrapper .vpt-pattern-cta {
	padding: clamp(1.75rem, 4vw, 3.25rem);
	border-radius: var(--vp-radius-xl);
	background: var(--vp-bank-deep);
	color: var(--vp-color-text-on-dark);
}

.vpt-pattern-cta h2,
.vpt-pattern-cta h3,
.vpt-pattern-cta p,
.editor-styles-wrapper .vpt-pattern-cta h2,
.editor-styles-wrapper .vpt-pattern-cta h3,
.editor-styles-wrapper .vpt-pattern-cta p {
	color: inherit;
}

.vpt-pattern-cta p,
.editor-styles-wrapper .vpt-pattern-cta p {
	max-width: 44rem;
	color: rgb(255 255 255 / 82%);
}

.vpt-pattern-cta .wp-block-button .wp-block-button__link,
.editor-styles-wrapper .vpt-pattern-cta .wp-block-button .wp-block-button__link {
	border-color: #fff;
	background: #fff;
	color: var(--vp-bank-deep);
}

/* Core blocks receive a restrained baseline ------------------------------ */
.vpt-editorial-content .wp-block-separator,
.editor-styles-wrapper .wp-block-separator {
	border: 0;
	border-top: 1px solid var(--vp-color-border);
}

.vpt-editorial-content .wp-block-table table,
.editor-styles-wrapper .wp-block-table table {
	border-collapse: collapse;
}

.vpt-editorial-content .wp-block-table th,
.vpt-editorial-content .wp-block-table td,
.editor-styles-wrapper .wp-block-table th,
.editor-styles-wrapper .wp-block-table td {
	padding: 0.8rem 1rem;
	border-color: var(--vp-color-border);
}

.vpt-editorial-content .wp-block-table th,
.editor-styles-wrapper .wp-block-table th {
	background: var(--vp-color-surface-subtle);
	font-weight: var(--vp-font-weight-bold);
}

.vpt-editorial-content .wp-block-details,
.editor-styles-wrapper .wp-block-details {
	padding-block: var(--vp-space-4);
	border-top: 1px solid var(--vp-color-border);
}

.vpt-editorial-content .wp-block-details:last-of-type,
.editor-styles-wrapper .wp-block-details:last-of-type {
	border-bottom: 1px solid var(--vp-color-border);
}

.vpt-editorial-content .wp-block-details summary,
.editor-styles-wrapper .wp-block-details summary {
	cursor: pointer;
	font-weight: var(--vp-font-weight-bold);
}

@media (max-width: 47.999rem) {
	.vpt-pattern-media.wp-block-columns,
	.editor-styles-wrapper .vpt-pattern-media.wp-block-columns {
		gap: var(--vp-space-5);
	}
}

.vpt-pattern-text,
.editor-styles-wrapper .vpt-pattern-text {
	padding-block: clamp(1rem, 2vw, 2rem);
}

.vpt-pattern-text h2,
.editor-styles-wrapper .vpt-pattern-text h2 {
	max-width: 28ch;
	margin-bottom: var(--vp-space-4);
}

.vpt-pattern-placeholder-image img,
.editor-styles-wrapper .vpt-pattern-placeholder-image img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

/* FAQ pattern ------------------------------------------------------------- */
.vpt-pattern-faq,
.editor-styles-wrapper .vpt-pattern-faq {
	padding-block: clamp(1rem, 2vw, 2rem);
}

.vpt-pattern-faq > .wp-block-details,
.editor-styles-wrapper .vpt-pattern-faq > .wp-block-details {
	margin: 0;
	padding: 1rem 0;
}

.vpt-pattern-faq > .wp-block-details summary,
.editor-styles-wrapper .vpt-pattern-faq > .wp-block-details summary {
	color: var(--vp-color-text-strong);
	font-size: var(--vp-font-size-md);
}

.vpt-pattern-faq > .wp-block-details p,
.editor-styles-wrapper .vpt-pattern-faq > .wp-block-details p {
	margin: 0.75rem 0 0;
	color: var(--vp-color-text-muted);
}

/* Download / document pattern -------------------------------------------- */
.vpt-pattern-download,
.editor-styles-wrapper .vpt-pattern-download {
	max-width: 100%;
}

.vpt-pattern-download h3,
.editor-styles-wrapper .vpt-pattern-download h3 {
	margin-bottom: var(--vp-space-3);
}

.vpt-pattern-meta,
.editor-styles-wrapper .vpt-pattern-meta {
	margin-top: var(--vp-space-4);
	color: var(--vp-color-text-soft);
	font-size: var(--vp-font-size-sm);
}

/* Contact pattern --------------------------------------------------------- */
.vpt-pattern-contact,
.editor-styles-wrapper .vpt-pattern-contact {
	align-items: center;
	gap: clamp(1.5rem, 4vw, 3.5rem);
	padding: clamp(1.5rem, 3vw, 2.25rem);
}

.vpt-pattern-contact-image,
.editor-styles-wrapper .vpt-pattern-contact-image {
	margin: 0;
}

.vpt-pattern-contact-image img,
.editor-styles-wrapper .vpt-pattern-contact-image img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.vpt-pattern-contact-role,
.editor-styles-wrapper .vpt-pattern-contact-role {
	margin-top: calc(var(--vp-space-2) * -1);
	color: var(--vp-color-text-muted);
	font-weight: var(--vp-font-weight-bold);
}

/* Stats pattern ----------------------------------------------------------- */
.vpt-pattern-stats,
.editor-styles-wrapper .vpt-pattern-stats {
	padding-block: clamp(1rem, 2vw, 2rem);
}

.vpt-pattern-stats-grid,
.editor-styles-wrapper .vpt-pattern-stats-grid {
	gap: var(--vp-space-4);
	margin-top: var(--vp-space-5);
}

.vpt-stat-card,
.editor-styles-wrapper .vpt-stat-card {
	height: 100%;
	padding: clamp(1.25rem, 2.5vw, 1.75rem);
	border: 1px solid var(--vp-color-border);
	border-radius: var(--vp-radius-lg);
	background: var(--vp-color-surface-subtle);
}

.vpt-stat-value,
.editor-styles-wrapper .vpt-stat-value {
	margin: 0 0 var(--vp-space-2);
	color: var(--vp-bank-deep);
	font-size: clamp(1.9rem, 3vw, 2.7rem);
	font-weight: var(--vp-font-weight-bold);
	line-height: 1;
	letter-spacing: -0.025em;
}

.vpt-stat-label,
.editor-styles-wrapper .vpt-stat-label {
	margin: 0;
	color: var(--vp-color-text-muted);
	font-size: var(--vp-font-size-sm);
	line-height: 1.45;
}

@media (max-width: 47.999rem) {
	.vpt-pattern-contact.wp-block-columns,
	.editor-styles-wrapper .vpt-pattern-contact.wp-block-columns,
	.vpt-pattern-stats-grid.wp-block-columns,
	.editor-styles-wrapper .vpt-pattern-stats-grid.wp-block-columns {
		gap: var(--vp-space-4);
	}
}

/* VR photo gallery -------------------------------------------------------- */
.wp-block-gallery.is-style-vpt-gallery,
.editor-styles-wrapper .wp-block-gallery.is-style-vpt-gallery {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-auto-flow: dense;
	gap: clamp(0.65rem, 1.4vw, 1rem) !important;
	margin-block: var(--vp-space-6) 0;
}

.wp-block-gallery.is-style-vpt-gallery > .wp-block-image,
.editor-styles-wrapper .wp-block-gallery.is-style-vpt-gallery > .wp-block-image {
	position: relative;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: var(--vp-radius-lg);
	background: var(--vp-color-surface-subtle);
}

.wp-block-gallery.is-style-vpt-gallery > .wp-block-image:first-child,
.editor-styles-wrapper .wp-block-gallery.is-style-vpt-gallery > .wp-block-image:first-child {
	grid-column: span 2;
	grid-row: span 2;
	/*
	 * Keep the lead image geometrically aligned with the four 1:1 tiles beside it:
	 * two column widths + one gap equal two row heights + one gap. This prevents
	 * large empty grid areas when the first source image is portrait-oriented.
	 */
	aspect-ratio: 1 / 1;
}

.wp-block-gallery.is-style-vpt-gallery > .wp-block-image img,
.editor-styles-wrapper .wp-block-gallery.is-style-vpt-gallery > .wp-block-image img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	transition: transform 180ms ease;
}

.wp-block-gallery.is-style-vpt-gallery > .wp-block-image figcaption,
.editor-styles-wrapper .wp-block-gallery.is-style-vpt-gallery > .wp-block-image figcaption {
	margin: 0;
	padding: 2.4rem 0.75rem 0.65rem;
	background: linear-gradient(to top, rgb(0 45 103 / 78%), transparent);
	color: #fff;
	font-size: var(--vp-font-size-xs);
	line-height: 1.35;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.wp-block-gallery.is-style-vpt-gallery > .wp-block-image:hover img {
		transform: scale(1.025);
	}
}

@media (max-width: 63.999rem) {
	.wp-block-gallery.is-style-vpt-gallery,
	.editor-styles-wrapper .wp-block-gallery.is-style-vpt-gallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wp-block-gallery.is-style-vpt-gallery > .wp-block-image:first-child,
	.editor-styles-wrapper .wp-block-gallery.is-style-vpt-gallery > .wp-block-image:first-child {
		grid-column: 1 / -1;
		grid-row: auto;
		aspect-ratio: 16 / 9;
	}
}

@media (max-width: 34.999rem) {
	.wp-block-gallery.is-style-vpt-gallery,
	.editor-styles-wrapper .wp-block-gallery.is-style-vpt-gallery {
		grid-template-columns: 1fr;
	}

	.wp-block-gallery.is-style-vpt-gallery > .wp-block-image:first-child,
	.editor-styles-wrapper .wp-block-gallery.is-style-vpt-gallery > .wp-block-image:first-child {
		grid-column: auto;
		aspect-ratio: 4 / 3;
	}

	.wp-block-gallery.is-style-vpt-gallery > .wp-block-image,
	.editor-styles-wrapper .wp-block-gallery.is-style-vpt-gallery > .wp-block-image {
		aspect-ratio: 4 / 3;
	}
}

/* Gallery interaction / grouped lightbox --------------------------------- */
.wp-block-gallery.is-style-vpt-gallery .vpt-gallery__trigger {
	cursor: zoom-in;
}

.wp-block-gallery.is-style-vpt-gallery a.vpt-gallery__trigger {
	display: block;
	width: 100%;
	height: 100%;
	color: inherit;
}

.wp-block-gallery.is-style-vpt-gallery img.vpt-gallery__trigger:focus-visible,
.wp-block-gallery.is-style-vpt-gallery a.vpt-gallery__trigger:focus-visible {
	outline: 3px solid rgb(0 102 179 / 40%);
	outline-offset: -4px;
	border-radius: inherit;
}

html.vpt-gallery-lightbox-open {
	overflow: hidden;
}

.vpt-gallery-lightbox {
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	overflow: hidden;
}

.vpt-gallery-lightbox::backdrop {
	background: rgb(0 20 45 / 92%);
	backdrop-filter: blur(3px);
}

.vpt-gallery-lightbox__surface {
	position: relative;
	display: grid;
	grid-template-columns: minmax(3rem, 6vw) minmax(0, 1fr) minmax(3rem, 6vw);
	grid-template-rows: minmax(0, 1fr) auto;
	align-items: center;
	width: 100vw;
	height: 100dvh;
	padding: clamp(1rem, 2.5vw, 2rem);
	box-sizing: border-box;
}

.vpt-gallery-lightbox__figure {
	grid-column: 2;
	grid-row: 1 / -1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 0;
	margin: 0;
}

.vpt-gallery-lightbox__media {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 0;
	touch-action: pan-y;
}

.vpt-gallery-lightbox__image {
	display: block;
	width: auto;
	max-width: min(100%, 90rem);
	height: auto;
	max-height: calc(100dvh - 9rem);
	border-radius: var(--vp-radius-lg);
	box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 28%);
	object-fit: contain;
}

.vpt-gallery-lightbox__caption {
	max-width: 56rem;
	margin-top: var(--vp-space-3);
	color: rgb(255 255 255 / 82%);
	font-size: var(--vp-font-size-sm);
	line-height: 1.45;
	text-align: center;
}

.vpt-gallery-lightbox__counter {
	position: absolute;
	left: 50%;
	bottom: clamp(0.8rem, 2vw, 1.5rem);
	transform: translateX(-50%);
	padding: 0.35rem 0.7rem;
	border-radius: var(--vp-radius-pill);
	background: rgb(0 0 0 / 28%);
	color: #fff;
	font-size: var(--vp-font-size-xs);
	font-variant-numeric: tabular-nums;
}

.vpt-gallery-lightbox__close,
.vpt-gallery-lightbox__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	padding: 0;
	border: 1px solid rgb(255 255 255 / 26%);
	border-radius: 50%;
	background: rgb(0 20 45 / 58%);
	color: #fff;
	cursor: pointer;
	transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.vpt-gallery-lightbox__close svg,
.vpt-gallery-lightbox__nav svg {
	width: 1.35rem;
	height: 1.35rem;
}

.vpt-gallery-lightbox__close {
	position: absolute;
	top: clamp(1rem, 2vw, 1.75rem);
	right: clamp(1rem, 2vw, 1.75rem);
	z-index: 2;
}

.vpt-gallery-lightbox__nav {
	z-index: 1;
	align-self: center;
	justify-self: center;
}

.vpt-gallery-lightbox__nav--prev {
	grid-column: 1;
	grid-row: 1;
}

.vpt-gallery-lightbox__nav--next {
	grid-column: 3;
	grid-row: 1;
}

.vpt-gallery-lightbox__close:hover,
.vpt-gallery-lightbox__nav:hover {
	border-color: rgb(255 255 255 / 52%);
	background: rgb(0 102 179 / 85%);
}

.vpt-gallery-lightbox__close:focus-visible,
.vpt-gallery-lightbox__nav:focus-visible {
	outline: 3px solid rgb(255 255 255 / 72%);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.vpt-gallery-lightbox__close,
	.vpt-gallery-lightbox__nav {
		transition: none;
	}
}

@media (max-width: 47.999rem) {
	.vpt-gallery-lightbox__surface {
		grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
		padding: 0.85rem;
	}

	.vpt-gallery-lightbox__image {
		max-height: calc(100dvh - 8.5rem);
		border-radius: var(--vp-radius-md);
	}

	.vpt-gallery-lightbox__close,
	.vpt-gallery-lightbox__nav {
		width: 2.6rem;
		height: 2.6rem;
	}

	.vpt-gallery-lightbox__nav--prev {
		justify-self: start;
	}

	.vpt-gallery-lightbox__nav--next {
		justify-self: end;
	}

	.vpt-gallery-lightbox__caption {
		padding-inline: 0.5rem;
		font-size: 0.82rem;
	}
}
