/* ==========================================================================
   Wildlight — theme styles (loaded on the front end and in the editor)
   ========================================================================== */

:root {
	--wl-gap: clamp(0.75rem, 1.5vw, 1.25rem);
	--wl-header-h: 76px;
	/* Left/right padding for the header bar and hero text. Change this one value to adjust. */
	--wl-edge-pad: clamp(1.5rem, 5vw, 4.5rem);
}

img {
	height: auto;
}

/* --------------------------------------------------------------------------
   Eyebrow / small caps labels
   -------------------------------------------------------------------------- */

.wl-eyebrow {
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	margin-bottom: 0.5rem;
}

.wl-lede {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 300;
	line-height: 1.55;
	color: var(--wp--preset--color--muted);
}

.wl-section {
	padding-block: var(--wp--preset--spacing--60);
}

.wl-section--surface {
	background: var(--wp--preset--color--surface);
}

/* Outline buttons */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* Focal point (Image block sidebar → "Focal point"): keeps that spot in view when cropped */
.wp-block-image img {
	object-position: var(--wl-focal, 50% 50%);
}

/* --------------------------------------------------------------------------
   Ken Burns slideshow  (Gallery block → Styles → "Ken Burns slideshow")
   -------------------------------------------------------------------------- */

/* Before the script runs on the live site, show only the first photo */
:where(body:not(.wp-admin):not(.editor-styles-wrapper)) .wp-block-gallery.is-style-wl-ken-burns:not(.kb-ready) > figure:not(:first-of-type) {
	display: none !important;
}

:where(body:not(.wp-admin):not(.editor-styles-wrapper)) .wp-block-gallery.is-style-wl-ken-burns:not(.kb-ready) > figure:first-of-type {
	width: 100% !important;
	height: var(--kb-height, calc(100vh - var(--wl-header-h)));
	max-height: 960px;
}

.wp-block-gallery.has-nested-images.is-style-wl-ken-burns.kb-ready {
	position: relative;
	display: block;
	height: var(--kb-height, calc(100vh - var(--wl-header-h)));
	min-height: 420px;
	max-height: 960px;
	overflow: hidden;
	background: #1b1b1a;
	margin-block: 0;
	gap: 0;
}

.wp-block-gallery.has-nested-images.is-style-wl-ken-burns.kb-ready figure.wp-block-image:not(#individual-image) {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	transition: opacity var(--kb-fade, 1800ms) ease-in-out;
	overflow: hidden;
}

.wp-block-gallery.has-nested-images.is-style-wl-ken-burns.kb-ready figure.wp-block-image.is-active:not(#individual-image) {
	opacity: 1;
	z-index: 2;
}

.wp-block-gallery.has-nested-images.is-style-wl-ken-burns.kb-ready figure.wp-block-image.is-leaving:not(#individual-image) {
	z-index: 1;
}

.wp-block-gallery.has-nested-images.is-style-wl-ken-burns figure.wp-block-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.wp-block-gallery.has-nested-images.is-style-wl-ken-burns.kb-ready figure.wp-block-image img {
	will-change: transform;
	backface-visibility: hidden;
}

.wp-block-gallery.is-style-wl-ken-burns img.kb-in {
	animation: wl-kb-in var(--kb-duration, 9000ms) linear forwards;
}

.wp-block-gallery.is-style-wl-ken-burns img.kb-out {
	animation: wl-kb-out var(--kb-duration, 9000ms) linear forwards;
}

/* Zoom amount: set per slideshow with a kb-zoom-NN class (see readme), or change the defaults here. */
@keyframes wl-kb-in {
	from { transform: scale(var(--kb-zoom-from, 1.02)); }
	to   { transform: scale(var(--kb-zoom-to, 1.16)); }
}

@keyframes wl-kb-out {
	from { transform: scale(var(--kb-zoom-to, 1.16)); }
	to   { transform: scale(var(--kb-zoom-from, 1.02)); }
}

/* Captions in the slideshow: small, bottom-right */
.wp-block-gallery.has-nested-images.is-style-wl-ken-burns.kb-ready figure.wp-block-image figcaption {
	left: auto;
	right: 0;
	bottom: 0;
	width: auto;
	max-width: 60%;
	padding: 0.75rem 1.25rem;
	background: none;
	text-align: right;
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.08em;
	color: rgba(255, 255, 255, 0.85);
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
	z-index: 3;
}

@media (max-width: 781px) {
	.wp-block-gallery.has-nested-images.is-style-wl-ken-burns.kb-ready {
		height: var(--kb-height-mobile, 72vh);
	}
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-gallery.is-style-wl-ken-burns img.kb-in,
	.wp-block-gallery.is-style-wl-ken-burns img.kb-out {
		animation: none;
	}
}

/* Editor: label the slideshow so it's obvious what it does */
.editor-styles-wrapper .wp-block-gallery.is-style-wl-ken-burns::before {
	content: "Ken Burns slideshow \2014  plays on the live site. Add, remove, or reorder photos here.";
	flex-basis: 100%;
	display: block;
	padding: 0.5rem 0.75rem;
	font-size: 12px;
	letter-spacing: 0.04em;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--muted);
}

/* Hero: text overlay on top of the slideshow */
.wl-hero {
	position: relative;
}

:is(.wl-hero.kb-hero-ready, body:not(.wp-admin):not(.editor-styles-wrapper) .wl-video-hero) > .wl-hero__overlay {
	position: absolute;
	inset: auto 0 0 0;
	z-index: 5;
	margin: 0;
	padding: clamp(2rem, 7vw, 5.5rem) var(--wl-edge-pad) clamp(2rem, 6vw, 4.5rem) var(--wl-edge-pad);
	background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.25) 55%, rgba(0, 0, 0, 0) 100%);
	color: #fff;
	pointer-events: none;
}

:is(.wl-hero.kb-hero-ready, body:not(.wp-admin):not(.editor-styles-wrapper) .wl-video-hero) > .wl-hero__overlay > * {
	max-width: 760px;
	pointer-events: auto;
}

:is(.wl-hero.kb-hero-ready, body:not(.wp-admin):not(.editor-styles-wrapper) .wl-video-hero) > .wl-hero__overlay :is(h1, h2, p) {
	color: #fff;
}

:is(.wl-hero.kb-hero-ready, body:not(.wp-admin):not(.editor-styles-wrapper) .wl-video-hero) > .wl-hero__overlay .wl-eyebrow {
	color: rgba(255, 255, 255, 0.8);
}

:is(.wl-hero.kb-hero-ready, body:not(.wp-admin):not(.editor-styles-wrapper) .wl-video-hero) > .wl-hero__overlay .wp-block-button__link {
	background: transparent;
	color: #fff;
	border-color: rgba(255, 255, 255, 0.85);
}

:is(.wl-hero.kb-hero-ready, body:not(.wp-admin):not(.editor-styles-wrapper) .wl-video-hero) > .wl-hero__overlay .wp-block-button__link:hover {
	background: #fff;
	color: var(--wp--preset--color--contrast);
	border-color: #fff;
}

.wl-hero__overlay {
	padding-block: var(--wp--preset--spacing--40);
}

/* --------------------------------------------------------------------------
   Full-width video hero  (pattern: "Hero — full-width video")
   -------------------------------------------------------------------------- */

.wl-video-hero {
	position: relative;
	overflow: hidden;
	background: #1b1b1a;
}

.wl-video-hero > .wp-block-video {
	margin: 0;
}

.wl-video-hero > .wp-block-video video {
	display: block;
	width: 100%;
	height: var(--vh-height, calc(100vh - var(--wl-header-h)));
	min-height: 420px;
	max-height: 960px;
	object-fit: cover;
}

@media (max-width: 781px) {
	.wl-video-hero > .wp-block-video video {
		height: var(--vh-height-mobile, 72vh);
	}
}

.wl-video-toggle {
	position: absolute;
	top: 1rem;
	right: var(--wl-edge-pad);
	z-index: 6;
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.7);
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.25);
	color: #fff;
	cursor: pointer;
	transition: background 0.2s ease;
}

.wl-video-toggle:hover,
.wl-video-toggle:focus-visible {
	background: rgba(0, 0, 0, 0.55);
}

.wl-video-toggle svg {
	width: 14px;
	height: 14px;
	fill: currentColor;
}

/* --------------------------------------------------------------------------
   Masonry gallery  (Gallery block → Styles → "Masonry")
   -------------------------------------------------------------------------- */

.wp-block-gallery.has-nested-images.is-style-wl-masonry {
	display: block;
	columns: 3 300px;
	column-gap: var(--wl-gap);
}

.wp-block-gallery.has-nested-images.is-style-wl-masonry figure.wp-block-image:not(#individual-image) {
	display: block;
	width: 100%;
	margin: 0 0 var(--wl-gap);
	break-inside: avoid;
}

.wp-block-gallery.has-nested-images.is-style-wl-masonry figure.wp-block-image img {
	width: 100%;
	height: auto;
	transition: opacity 0.4s ease;
}

.wp-block-gallery.has-nested-images.is-style-wl-masonry figure.wp-block-image:hover img {
	opacity: 0.9;
}

/* --------------------------------------------------------------------------
   Collections (homepage / portfolio tiles)
   -------------------------------------------------------------------------- */

.wl-collections .wp-block-image {
	overflow: hidden;
	margin-bottom: 0.9rem;
}

.wl-collections .wp-block-image img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	transition: transform 1.2s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.wl-collections .wp-block-image a:hover img,
.wl-collections .wp-block-image a:focus-visible img {
	transform: scale(1.04);
}

.wl-collections h3 {
	margin: 0;
}

.wl-collections h3 a {
	text-decoration: none;
}

.wl-collections p {
	margin-top: 0.25rem;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

/* --------------------------------------------------------------------------
   Journal cards
   -------------------------------------------------------------------------- */

.wl-cards .wp-block-post-featured-image {
	overflow: hidden;
	margin-bottom: 1rem;
}

.wl-cards .wp-block-post-featured-image img {
	transition: transform 1.2s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.wl-cards .wp-block-post-featured-image a:hover img {
	transform: scale(1.04);
}

.wl-cards .wp-block-post-title {
	margin-block: 0.35rem 0.5rem;
}

.wl-cards .wp-block-post-excerpt {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

.wl-cards .wp-block-post-excerpt__more-text {
	margin-top: 0.5rem;
}

/* --------------------------------------------------------------------------
   Single post
   -------------------------------------------------------------------------- */

.wl-meta {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.wl-meta a {
	color: inherit;
	text-decoration: none;
}

.wl-post-nav {
	border-top: 1px solid var(--wp--preset--color--line);
	padding-top: var(--wp--preset--spacing--40);
	font-size: var(--wp--preset--font-size--small);
}

.wl-post-nav a {
	text-decoration: none;
}

/* --------------------------------------------------------------------------
   360° virtual tours
   -------------------------------------------------------------------------- */

.wl-tour-embed {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	display: grid;
	place-items: center;
	overflow: hidden;
}

.wl-tour-embed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.wl-tour-placeholder {
	margin: 0;
	padding: 1rem;
	text-align: center;
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--muted);
}

/* --------------------------------------------------------------------------
   Prints & licensing
   -------------------------------------------------------------------------- */

.wl-offer {
	border-top: 1px solid var(--wp--preset--color--contrast);
	padding-top: 1.25rem;
}

.wl-offer ul {
	padding-left: 1.1em;
	color: var(--wp--preset--color--muted);
}

.wl-offer li {
	margin-bottom: 0.35rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.wl-footer {
	border-top: 1px solid var(--wp--preset--color--line);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}

.wl-footer a {
	color: inherit;
	text-decoration: none;
}

.wl-footer a:hover {
	color: var(--wp--preset--color--contrast);
}

/* Lightbox: clean white backdrop suits the minimal look */
.wp-lightbox-overlay .scrim {
	background-color: #fff !important;
}

/* Keep videos inside their column */
.wp-block-video video {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
}

.wp-block-columns > .wp-block-column {
	min-width: 0;
}
