/*
Theme Name: Siberia Child
Theme URI: https://palermobakery.com
Description: Child theme for Siberia, holding the Palermo customisations.
Author: Speak Creative
Author URI: https://madebyspeak.com
Template: siberia
Version: 1.1.2
Text Domain: siberia-child
*/

/* ---------------------------------------------------------------------------
   Design tokens

   Cormorant Garamond + Montserrat is the Palermo brand pairing, matching the
   Palermo Custom Cakes build. Both are enqueued in functions.php.
   --------------------------------------------------------------------------- */

:root {
	--palermo-serif: "Cormorant Garamond", Georgia, serif;
	--palermo-sans: "Montserrat", "Noto Sans", sans-serif;

	--palermo-gold: #b8963f;
	--palermo-gold-rule: rgba(184, 150, 63, 0.32);

	--palermo-ink: #23232b;
	--palermo-body: #5f5f66;

	--palermo-card: #fff;
	--palermo-card-rule: #e7ded0;
	--palermo-button: #16161a;
	--palermo-dark: #14140f;
}

/* ---------------------------------------------------------------------------
   Background artwork

   inc/render.php prints the image URLs inline per request:
     --palermo-background-image
     --palermo-background-image-mobile

   The mobile breakpoint matches Elementor's default mobile tier. A negative
   z-index keeps the backdrop above the body's background colour and below the
   page content, so it needs no help from the parent theme's stacking.
   --------------------------------------------------------------------------- */

.palermo-background {
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-image: var(--palermo-background-image, none);
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
}

@media (max-width: 767px) {

	.palermo-background {
		background-image: var(--palermo-background-image-mobile, var(--palermo-background-image, none));
	}
}

/* ---------------------------------------------------------------------------
   Splash intro — headline, ornament rule, subhead

   Sections are targeted by attribute rather than `#id` so the selector stays
   at class-level specificity and anything set in Elementor still wins.
   --------------------------------------------------------------------------- */

#palermo-splash-intro {
	padding-top: clamp(3rem, 7vw, 6.5rem);
	padding-bottom: clamp(2rem, 4vw, 3.5rem);
}

@media (max-width: 768px) {
	#palermo-splash-intro {
		padding-top: 0;
		padding-bottom: 0;
	}
	
	#palermo-splash-intro .elementor-widget:not(:last-child) {
		margin-bottom: 0;
	}
}

.palermo-splash-headline .elementor-heading-title {
	font-family: var(--palermo-serif);
	font-weight: 400;
	font-size: clamp(1.85rem, 4.4vw, 3.4rem);
	line-height: 1.14;
	letter-spacing: 0.035em;
	text-transform: uppercase;
	color: var(--palermo-ink);
}

.palermo-splash-headline .elementor-heading-subtitle {
	color: var(--palermo-gold);
	text-transform: none;
}

.palermo-splash-subhead {
	position: relative;
	max-width: 40rem;
	margin-left: auto;
	margin-right: auto;
	padding-top: 3.5rem;
	font-family: var(--palermo-sans);
	font-weight: 300;
	font-size: 0.95rem;
	line-height: 1.85;
	letter-spacing: 0.012em;
	color: var(--palermo-body);
}

.palermo-splash-subhead p {
	margin: 0;
}

/* Ornament: a hairline rule broken by a small diamond, sitting between the
   headline and the subhead. Drawn from the subhead's two pseudo-elements. */
.palermo-splash-subhead::before {
	content: "";
	position: absolute;
	top: 1.6rem;
	left: 50%;
	width: 11rem;
	height: 1px;
	transform: translateX(-50%);
	background:
		linear-gradient(
			to right,
			transparent 0%,
			var(--palermo-gold) 18%,
			var(--palermo-gold) 41%,
			transparent 41%,
			transparent 59%,
			var(--palermo-gold) 59%,
			var(--palermo-gold) 82%,
			transparent 100%
		);
}

.palermo-splash-subhead::after {
	content: "";
	position: absolute;
	top: calc(1.6rem - 3px);
	left: 50%;
	width: 7px;
	height: 7px;
	transform: translateX(-50%) rotate(45deg);
	border: 1px solid var(--palermo-gold);
}

/* ---------------------------------------------------------------------------
   Experiences carousel (Elementor widget: palermo_experiences)

   Defaults live in these custom properties; the widget's Style tab writes
   real declarations that override them.
   --------------------------------------------------------------------------- */

/* Side padding gives the row page gutters and stops the last card colliding
   with the viewport edge — the section itself is full-bleed. */
.palermo-experiences {
	--palermo-experience-gold: var(--palermo-gold);
	--palermo-experience-ink: var(--palermo-button);
	--palermo-experience-rule: var(--palermo-card-rule);
	position: relative;
	padding: 0 clamp(1rem, 4vw, 3.5rem) 0.5rem;
}

.palermo-experiences__viewport {
	overflow: hidden;
}

.palermo-experiences .swiper-slide {
	height: auto;
}

.palermo-experience {
	display: flex;
	flex-direction: column;
	height: 100%;
	background-color: var(--palermo-card);
	border: 1px solid var(--palermo-experience-rule);
	border-radius: 0;
	box-shadow: 0 1px 3px rgba(35, 35, 43, 0.04);
}

/* The card art is inset, leaving a white gutter inside the border.
   No overflow clipping — the icon badge deliberately hangs over the bottom
   edge, and the image is already constrained by object-fit below. */
.palermo-experience__media {
	position: relative;
	height: 250px;
	margin: 10px 10px 0;
	flex: 0 0 auto;
}

/* Doubled up on the class to outrank Elementor's `.elementor-widget img`,
   which sets height:auto and otherwise wins on load order. */
.palermo-experience .palermo-experience__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.palermo-experience__icon {
	position: absolute;
	left: 50%;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	transform: translate(-50%, 50%);
	border: 1px solid var(--palermo-experience-gold);
	border-radius: 50%;
	background-color: var(--palermo-card);
}

.palermo-experience .palermo-experience__icon img {
	width: 50%;
	height: 50%;
	object-fit: contain;
}

/* Top padding clears the 32px the icon badge hangs down by. */
.palermo-experience__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: center;
	padding: 3.25rem 1.6rem 2.25rem;
	text-align: center;
}

.palermo-experience__title {
	margin: 0;
	font-family: var(--palermo-serif);
	font-weight: 500;
	font-size: 1.35rem;
	line-height: 1.3;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--palermo-ink);
}

.palermo-experience__subtitle {
	margin: 0.45rem 0 0;
	font-family: var(--palermo-sans);
	font-weight: 500;
	font-size: 0.68rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--palermo-experience-gold);
}

.palermo-experience__divider {
	display: block;
	width: 2.5rem;
	height: 1px;
	margin: 1.15rem 0 1.25rem;
	background-color: var(--palermo-experience-gold);
}

.palermo-experience__description {
	margin: 0 0 2rem;
	font-family: var(--palermo-sans);
	font-weight: 300;
	font-size: 0.85rem;
	line-height: 1.75;
	color: var(--palermo-body);
}

/* Pins the link to the bottom so buttons line up across uneven cards. */
.palermo-experience__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.9rem;
	margin-top: auto;
	padding: 1rem 1.85rem;
	border: 1px solid var(--palermo-experience-ink);
	border-radius: 0;
	background-color: var(--palermo-experience-ink);
	color: #fff;
	font-family: var(--palermo-sans);
	font-weight: 500;
	font-size: 0.72rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color 200ms ease, color 200ms ease;
}

/* Inverts rather than shifting to gold — gold behind white text falls short
   of a readable contrast ratio at this size. Gated on a real pointer, since a
   touch device holds the state after a tap and the card comes back inverted. */
@media (hover: hover) {

	.palermo-experience__link:hover {
		background-color: transparent;
		color: var(--palermo-experience-ink);
	}
}

.palermo-experience__link:focus {
	outline: none;
}

.palermo-experience__link:focus-visible {
	background-color: transparent;
	color: var(--palermo-experience-ink);
	outline: 2px solid var(--palermo-gold);
	outline-offset: 2px;
}

.palermo-experience__link .palermo-arrow {
	width: 1rem;
	height: 0.75rem;
}

.palermo-arrow {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.palermo-arrow--prev {
	transform: scaleX(-1);
}

.palermo-experiences__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	transform: translateY(-50%);
	border: 1px solid var(--palermo-gold-rule);
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.94);
	color: var(--palermo-ink);
	cursor: pointer;
	transition: opacity 200ms ease, background-color 200ms ease;
	-webkit-tap-highlight-color: transparent;
}

.palermo-experiences__arrow:hover {
	background-color: #fff;
}

/* Safari draws its own ring on a tapped arrow, and squares it off rather than
   following the circle. The ring is only worth showing to keyboard users, so
   it is replaced with a round gold one under :focus-visible. */
.palermo-experiences__arrow:focus {
	outline: none;
}

.palermo-experiences__arrow:focus-visible {
	outline: 2px solid var(--palermo-gold);
	outline-offset: 2px;
}

/* Sit in the page gutter beside the cards rather than straddling the edge. */
.palermo-experiences__arrow--prev {
	left: 0;
}

.palermo-experiences__arrow--next {
	right: 0;
}

.palermo-experiences__arrow.swiper-button-disabled,
.palermo-experiences__arrow.swiper-button-lock {
	opacity: 0;
	pointer-events: none;
}

@media (max-width: 1024px) {

	.palermo-experience__media {
		height: 230px;
	}
}

@media (max-width: 767px) {

	.palermo-experience__body {
		padding: 3rem 1.35rem 2rem;
	}

	.palermo-experience__title {
		font-size: 1.25rem;
	}

	/* Nudged off the viewport edge — the gutter is too narrow here to clear
	   the arrow, so flush-right reads as a clipped control. */
	.palermo-experiences__arrow--prev {
		left: 0.35rem;
	}

	.palermo-experiences__arrow--next {
		right: 0.35rem;
	}
}

/* ---------------------------------------------------------------------------
   Feature bar — Elementor Icon List laid out as a divided row on a dark
   ground, icon left of two lines of text.
   Add the class "palermo-feature-list" to the Icon List widget.
   --------------------------------------------------------------------------- */

[id="palermo-splash-features"] {
	margin-top: clamp(2.5rem, 5vw, 4rem);
	padding: 1.6rem 1.25rem;
	background-color: var(--palermo-dark);
}

/* The class is doubled throughout this block to outrank Elementor's own
   `.elementor-widget-icon-list .elementor-icon-list-item` rules, which tie on
   specificity and load after the theme stylesheet. */
.palermo-feature-list.palermo-feature-list .elementor-icon-list-items {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	justify-content: center;
	margin: 0;
	padding: 0;
}

.palermo-feature-list.palermo-feature-list .elementor-icon-list-item {
	display: flex;
	flex: 0 1 auto;
	align-items: center;
	gap: var(--palermo-feature-list-gap, 0.85rem);
	padding: 0.35rem var(--palermo-feature-list-spacing, clamp(1rem, 3vw, 2.75rem));
	text-align: left;
}

.palermo-feature-list.palermo-feature-list .elementor-icon-list-item + .elementor-icon-list-item {
	border-left: 1px solid var(--palermo-feature-list-divider, var(--palermo-gold-rule));
}

.palermo-feature-list .elementor-icon-list-item > a {
	display: flex;
	align-items: center;
	gap: inherit;
	text-align: inherit;
}

.palermo-feature-list .elementor-icon-list-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	margin: 0;
}

.palermo-feature-list.palermo-feature-list .elementor-icon-list-icon i,
.palermo-feature-list.palermo-feature-list .elementor-icon-list-icon svg {
	color: var(--palermo-gold);
	fill: var(--palermo-gold);
	font-size: 1.15rem;
	width: 1.15rem;
	height: 1.15rem;
}

/* Capping the measure wraps each label onto two lines, as in the approved
   design, and keeps all four items on a single row. The reference achieves
   this with a <br> in each item's text; this does it without touching copy. */
.palermo-feature-list.palermo-feature-list .elementor-icon-list-text {
	display: block;
	max-width: 11em;
	padding: 0;
	font-family: var(--palermo-sans);
	font-weight: 500;
	font-size: 0.7rem;
	line-height: 1.5;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: #fff;
}

/* Four across needs more room than a tablet has — below that the row breaks
   3-plus-1, so it becomes a balanced 2x2 grid instead. */
@media (max-width: 1024px) {

	[id="palermo-splash-features"] {
		padding: 1.5rem 1rem;
	}

	.palermo-feature-list.palermo-feature-list .elementor-icon-list-items {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1.25rem 0.75rem;
		justify-items: center;
	}

	.palermo-feature-list.palermo-feature-list .elementor-icon-list-item {
		width: fit-content;
		justify-content: flex-start;
		padding-left: 0;
		padding-right: 0;
	}

	.palermo-feature-list.palermo-feature-list .elementor-icon-list-item + .elementor-icon-list-item {
		border-left: 0;
	}

	.palermo-feature-list.palermo-feature-list .elementor-icon-list-text {
		font-size: 0.62rem;
		letter-spacing: 0.11em;
	}
}

/* Two columns hold down to ~360px once the labels are capped; below that a
   single column is the only thing that fits without the text wrapping raggedly. */
@media (max-width: 359px) {

	.palermo-feature-list.palermo-feature-list .elementor-icon-list-items {
		grid-template-columns: minmax(0, 1fr);
		justify-items: center;
	}

	.palermo-feature-list.palermo-feature-list .elementor-icon-list-item {
		width: fit-content;
	}
}

/* ---------------------------------------------------------------------------
   Interactive Tiles — detail panel, brand skin

   The Palermo Tiles plugin is deliberately unbranded; this dresses its detail
   panel and pop-up in the card language of the experiences row: white card on
   a hairline rule, serif ink title over a gold eyebrow and divider, square
   ink button that inverts on hover. Classes are doubled where the plugin's
   own stylesheet sets the same properties.
   --------------------------------------------------------------------------- */

.ptiles-wrap--panel .ptiles {
	border: 1px solid var(--palermo-card-rule);
}

.ptiles-detail.ptiles-detail {
	background-color: var(--palermo-card);
	color: var(--palermo-ink);
}

.ptiles-detail--docked.ptiles-detail--docked,
.ptiles-detail--stacked.ptiles-detail--stacked {
	border: 1px solid var(--palermo-card-rule);
	box-shadow: 0 1px 3px rgba(35, 35, 43, 0.04);
	padding: clamp(1.5rem, 3vw, 2.75rem);
}

.ptiles-detail--modal.ptiles-detail--modal {
	border: 1px solid var(--palermo-card-rule);
	border-radius: 0;
	box-shadow: 0 24px 80px rgba(20, 20, 15, 0.4);
}

.ptiles-detail.ptiles-detail::backdrop {
	background: rgba(20, 20, 15, 0.6);
}

.ptiles-detail .ptiles-detail__subtitle {
	margin: 0 0 0.6rem;
	font-family: var(--palermo-sans);
	font-weight: 500;
	font-size: 0.68rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--palermo-gold);
}

.ptiles-detail .ptiles-detail__title {
	margin: 0;
	font-family: var(--palermo-serif);
	font-weight: 500;
	font-size: clamp(1.5rem, 2.4vw, 1.9rem);
	line-height: 1.25;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--palermo-ink);
}

/* Gold hairline between title and description, as on the experience cards. */
.ptiles-detail .ptiles-detail__title::after {
	content: "";
	display: block;
	width: 2.5rem;
	height: 1px;
	margin: 1.15rem auto 1.25rem;
	background-color: var(--palermo-gold);
}

.ptiles-detail .ptiles-detail__description {
	font-family: var(--palermo-sans);
	font-weight: 300;
	font-size: 0.9rem;
	line-height: 1.8;
	color: var(--palermo-body);
}

.ptiles-detail .ptiles-detail__cta {
	margin-top: 1.5rem;
	padding: 1rem 1.85rem;
	border: 1px solid var(--palermo-button);
	border-radius: 0;
	background-color: var(--palermo-button);
	color: #fff;
	font-family: var(--palermo-sans);
	font-weight: 500;
	font-size: 0.72rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color 200ms ease, color 200ms ease;
}

/* Inverts rather than shifting to gold, matching the experience cards — and
   gated on a real pointer so a tap does not leave the button stuck inverted. */
@media (hover: hover) {

	.ptiles-detail .ptiles-detail__cta:hover {
		background-color: transparent;
		color: var(--palermo-button);
	}

	.ptiles-detail .ptiles-detail__close:hover,
	.ptiles-detail .ptiles-detail__nav:hover {
		color: var(--palermo-gold);
	}
}

.ptiles-detail .ptiles-detail__cta:focus-visible {
	background-color: transparent;
	color: var(--palermo-button);
	outline: 2px solid var(--palermo-gold);
	outline-offset: 2px;
	box-shadow: none;
}

.ptiles-detail .ptiles-detail__close,
.ptiles-detail .ptiles-detail__nav {
	color: var(--palermo-ink);
}
