/*
 * Dzeņumuiža — modern look for every section.
 *
 * Pagelayer regenerates its per-widget IDs (p-xxxx) when a template is
 * edited, which is what broke the older header fixes. Everything here is
 * targeted by stable structure instead: the header row that holds the site
 * title, the column that holds the menu, the theme's .dz-* page parts.
 * Printed last on the page, so source order wins over earlier styles.
 */

:root {
	--dzm-ink: #17231c;
	--dzm-text: #2b3a31;
	--dzm-muted: #5f6b63;
	--dzm-green: #244734;
	--dzm-green-2: #2f6b47;
	--dzm-soft: #e7f0e9;
	--dzm-line: rgba(23, 35, 28, 0.09);
	--dzm-shadow: 0 1px 2px rgba(23, 35, 28, 0.05), 0 10px 30px rgba(23, 35, 28, 0.07);
	--dzm-head: Poppins, "Segoe UI", system-ui, sans-serif;
}

/* ------------------------------------------------------------------
 * Header
 * ---------------------------------------------------------------- */

html body .pagelayer-header {
	position: relative;
	z-index: 50;
	background: rgba(255, 253, 248, 0.86);
	-webkit-backdrop-filter: saturate(1.4) blur(12px);
	backdrop-filter: saturate(1.4) blur(12px);
	border-bottom: 1px solid var(--dzm-line);
}

/* The template's placeholder contact strip (address, contact@domain.com). */
html body .pagelayer-header > .pagelayer-row:has(.pagelayer-email) {
	display: none !important;
}

html body .pagelayer-header > .pagelayer-row:has(.pagelayer-wp_title) {
	padding: 0 !important;
	margin: 0 !important;
	background: transparent !important;
}

html body .pagelayer-header > .pagelayer-row:has(.pagelayer-wp_title) > .pagelayer-row-holder {
	display: flex !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 10px 28px !important;
	width: 100% !important;
	max-width: 1440px !important;
	min-height: 74px;
	margin: 0 auto !important;
	padding: 12px 24px !important;
}

/* Where the LV/EN pill floats over the header, keep room for it. */
html body:has(.dzenumuiza-lang-switcher.is-floating) .pagelayer-header > .pagelayer-row:has(.pagelayer-wp_title) > .pagelayer-row-holder {
	padding-right: 170px !important;
}

/* On the homepage the pill sits inside the header row itself. */
html body .pagelayer-header .pagelayer-row-holder > .pagelayer-col:has(.pagelayer-wp_title) { order: 1; }
html body .pagelayer-header .pagelayer-row-holder > .pagelayer-col:has(.pagelayer-wp_menu) { order: 2; }
html body .pagelayer-header .pagelayer-row-holder > .dzenumuiza-lang-switcher {
	order: 3;
	flex: 0 0 auto !important;
	margin: 0 !important;
}

/* Site title column. */
html body .pagelayer-header .pagelayer-row-holder > .pagelayer-col:has(.pagelayer-wp_title) {
	flex: 0 0 auto !important;
	width: auto !important;
	max-width: none !important;
	padding: 0 !important;
	position: static !important;
	transform: none !important;
}

html body .pagelayer-header .pagelayer-wp-title-heading {
	font-family: var(--dzm-head) !important;
	font-size: 28px !important;
	font-weight: 700 !important;
	line-height: 1.1 !important;
	letter-spacing: -0.01em !important;
	color: var(--dzm-green) !important;
	white-space: nowrap !important;
}

/* Main menu column (the first column with a menu); the second menu widget
   is Pagelayer's hamburger copy, which is replaced by the row below. */
html body .pagelayer-header .pagelayer-row-holder > .pagelayer-col:has(.pagelayer-wp_menu):not(:has(.pagelayer-wp_title)) {
	display: flex !important;
	flex: 1 1 auto !important;
	justify-content: flex-end !important;
	width: auto !important;
	max-width: none !important;
	min-width: 0 !important;
	padding: 0 !important;
}

html body .pagelayer-header .pagelayer-row-holder > .pagelayer-col:has(.pagelayer-wp_menu) ~ .pagelayer-col:has(.pagelayer-wp_menu) {
	display: none !important;
}

html body .pagelayer-header .pagelayer-col:has(.pagelayer-wp_menu) .pagelayer-col-holder,
html body .pagelayer-header .pagelayer-wp_menu,
html body .pagelayer-header .pagelayer-wp-menu-holder {
	display: flex !important;
	justify-content: flex-end !important;
	width: 100% !important;
	min-width: 0 !important;
}

html body .pagelayer-header .pagelayer-wp-menu-container,
html body .pagelayer-header .pagelayer-wp-menu-container[data-align="right"] {
	display: flex !important;
	justify-content: flex-end !important;
	width: 100% !important;
	min-width: 0 !important;
	margin: 0 !important;
	gap: 0 !important;
}

html body .pagelayer-header .pagelayer-wp-menu-container ul,
html body .pagelayer-header .pagelayer-wp_menu-ul {
	display: flex !important;
	flex-wrap: nowrap !important;
	/* Pushed right with margin rather than justify-content, so a menu that
	   does not fit scrolls instead of spilling over the site title. */
	justify-content: flex-start !important;
	margin-left: auto !important;
	max-width: 100% !important;
	min-width: 0 !important;
	align-items: center !important;
	gap: 2px !important;
	margin-top: 0 !important;
	margin-right: 0 !important;
	margin-bottom: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	overflow-x: auto;
	scrollbar-width: none;
}

html body .pagelayer-header .pagelayer-wp-menu-container ul::-webkit-scrollbar { display: none; }

html body .pagelayer-header .pagelayer-wp-menu-container li {
	flex: 0 0 auto !important;
	margin: 0 !important;
}

html body .pagelayer-header .pagelayer-wp-menu-container a,
html body .pagelayer-header .pagelayer-wp-menu-container a:visited {
	display: block !important;
	padding: 9px 13px !important;
	border-radius: 999px !important;
	color: var(--dzm-text) !important;
	font-family: var(--dzm-head) !important;
	font-size: 15px !important;
	font-weight: 500 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-decoration: none !important;
	white-space: nowrap !important;
	transition: background 0.15s, color 0.15s;
}

html body .pagelayer-header .pagelayer-wp-menu-container a:hover,
html body .pagelayer-header .pagelayer-wp-menu-container a:focus-visible {
	background: var(--dzm-soft) !important;
	color: var(--dzm-green) !important;
}

html body .pagelayer-header .pagelayer-wp-menu-container .current-menu-item > a,
html body .pagelayer-header .pagelayer-wp-menu-container .current_page_item > a {
	background: var(--dzm-green) !important;
	color: #fff !important;
}

html body .pagelayer-header .pagelayer-wp-menu-container a .pagelayer-nav-menu-title { color: inherit !important; }

/* Close "×" of Pagelayer's mobile drawer; the menu is always shown instead. */
html body .pagelayer-header .pagelayer-wp_menu-close { display: none !important; }

/* LV/EN pill: part of the header, scrolls away with it. */
html body .dzenumuiza-lang-switcher.is-floating {
	position: absolute !important;
	top: 19px !important;
	right: max(20px, calc((100vw - 1440px) / 2 + 20px)) !important;
	z-index: 60 !important;
}

/* Medium screens: menu on its own row under the title. */
@media (max-width: 1440px) {
	html body .pagelayer-header > .pagelayer-row:has(.pagelayer-wp_title) > .pagelayer-row-holder {
		flex-wrap: wrap !important;
		padding: 12px 24px 10px !important;
	}

	html body .pagelayer-header .pagelayer-row-holder > .pagelayer-col:has(.pagelayer-wp_title) {
		flex: 1 1 auto !important;
		min-height: 46px;
		display: flex !important;
		align-items: center !important;
	}

	html body .pagelayer-header .pagelayer-row-holder > .dzenumuiza-lang-switcher { order: 2; }
	html body .pagelayer-header .pagelayer-row-holder > .pagelayer-col:has(.pagelayer-wp_menu) { order: 3; }

	html body .pagelayer-header .pagelayer-row-holder > .pagelayer-col:has(.pagelayer-wp_menu):not(:has(.pagelayer-wp_title)),
	html body .pagelayer-header .pagelayer-col:has(.pagelayer-wp_menu) .pagelayer-col-holder,
	html body .pagelayer-header .pagelayer-wp_menu,
	html body .pagelayer-header .pagelayer-wp-menu-holder,
	html body .pagelayer-header .pagelayer-wp-menu-container,
	html body .pagelayer-header .pagelayer-wp-menu-container[data-align],
	html body .pagelayer-header .pagelayer-wp-menu-container ul,
	html body .pagelayer-header .pagelayer-wp_menu-ul {
		justify-content: flex-start !important;
	}

	html body .pagelayer-header .pagelayer-col:has(.pagelayer-wp_menu) .pagelayer-col-holder { padding: 0 !important; }

	/* Menu row takes the full width and scrolls sideways instead of
	   stretching the page. */
	html body .pagelayer-header .pagelayer-row-holder > .pagelayer-col:has(.pagelayer-wp_menu):not(:has(.pagelayer-wp_title)) {
		flex: 1 1 100% !important;
	}

	html body .pagelayer-header .pagelayer-wp-menu-container > div,
	html body .pagelayer-header .pagelayer-wp-menu-container ul {
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
	}

	html body .pagelayer-header .pagelayer-wp-menu-container ul {
		margin: 0 0 0 -13px !important;
	}

	html body .dzenumuiza-lang-switcher.is-floating { top: 17px !important; }
}

/* Tablets and phones: Pagelayer hides the menu column and its own hamburger
   is switched off, which left phones without any navigation. Show the menu
   as a row of swipeable pills instead. */
@media (max-width: 1024px) {
	html body .pagelayer-header .pagelayer-row-holder > .pagelayer-col.pagelayer-hide-tablet:has(.pagelayer-wp_menu),
	html body .pagelayer-header .pagelayer-row-holder > .pagelayer-col.pagelayer-hide-mobile:has(.pagelayer-wp_menu) {
		display: flex !important;
	}

	html body .pagelayer-header .pagelayer-wp-menu-container,
	html body .pagelayer-header .pagelayer-wp-menu-holder .pagelayer-wp_menu-ul,
	html body .pagelayer-header .pagelayer-wp-menu-container ul {
		display: flex !important;
		visibility: visible !important;
		opacity: 1 !important;
		position: static !important;
		height: auto !important;
		width: auto !important;
		max-width: 100% !important;
		transform: none !important;
		background: transparent !important;
		box-shadow: none !important;
	}

	html body .pagelayer-header .pagelayer-wp-menu-container ul {
		margin: 0 !important;
		gap: 6px !important;
		padding: 2px 0 4px !important;
		-webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
		mask-image: linear-gradient(90deg, #000 88%, transparent);
	}

	html body .pagelayer-header .pagelayer-wp-menu-container a,
	html body .pagelayer-header .pagelayer-wp-menu-container a:visited {
		padding: 8px 14px !important;
		font-size: 14px !important;
		background: #fff !important;
		border: 1px solid var(--dzm-line) !important;
	}

	html body .pagelayer-header .pagelayer-wp-menu-container .current-menu-item > a,
	html body .pagelayer-header .pagelayer-wp-menu-container .current_page_item > a {
		background: var(--dzm-green) !important;
		border-color: var(--dzm-green) !important;
	}
}

@media (max-width: 600px) {
	html body .pagelayer-header > .pagelayer-row:has(.pagelayer-wp_title) > .pagelayer-row-holder {
		padding: 10px 14px 8px !important;
		min-height: 0;
	}

	html body .pagelayer-header .pagelayer-wp-title-heading { font-size: 23px !important; }
	html body .dzenumuiza-lang-switcher.is-floating { top: 12px !important; right: 12px !important; }
}

/* ------------------------------------------------------------------
 * Page title and content (theme pages: Ekskursijas, Nakšņošana, …)
 * ---------------------------------------------------------------- */

/* Article layout: title and content card share one readable column. */
html body.pagelayer-body:not(.dzsb-app) .dz-content {
	width: min(960px, calc(100% - 32px)) !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

/* Content blocks made by dzenumuiza-tools bring their own centring and
   padding; inside the card they would double up. */
html body.pagelayer-body:not(.dzsb-app) .dz-content__body > div[class^="dzenumuiza-"] {
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

html body.pagelayer-body:not(.dzsb-app) .dz-content .dz-page-hero {
	display: block !important;
	max-width: 900px;
	margin: 0 0 24px !important;
	padding: 0 !important;
	background: none !important;
	min-height: 0 !important;
}

html body.pagelayer-body:not(.dzsb-app) .dz-page-hero .dz-eyebrow {
	margin: 0 0 6px !important;
	font-family: var(--dzm-head) !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	letter-spacing: 0.12em !important;
	text-transform: uppercase !important;
	color: var(--dzm-green-2) !important;
}

html body.pagelayer-body:not(.dzsb-app) .dz-page-hero h1 {
	margin: 0 !important;
	font-family: var(--dzm-head) !important;
	font-size: clamp(34px, 6vw, 58px) !important;
	font-weight: 800 !important;
	line-height: 1.05 !important;
	letter-spacing: -0.02em !important;
	color: var(--dzm-ink) !important;
}

html body.pagelayer-body:not(.dzsb-app) .dz-content__body {
	max-width: none !important;
	padding: clamp(20px, 4vw, 44px) !important;
	border-radius: 24px !important;
	background: rgba(255, 255, 255, 0.92) !important;
	border: 1px solid var(--dzm-line) !important;
	box-shadow: var(--dzm-shadow) !important;
}


html body.pagelayer-body:not(.dzsb-app) .dz-content__body p,
html body.pagelayer-body:not(.dzsb-app) .dz-content__body li {
	font-family: var(--dzm-head) !important;
	font-size: 17px !important;
	font-weight: 400 !important;
	line-height: 1.7 !important;
	color: var(--dzm-text) !important;
}

html body.pagelayer-body:not(.dzsb-app) .dz-content__body p { margin: 0 0 14px !important; }

html body.pagelayer-body:not(.dzsb-app) .dz-content__body ul,
html body.pagelayer-body:not(.dzsb-app) .dz-content__body ol {
	margin: 4px 0 18px !important;
	padding-left: 22px !important;
}

html body.pagelayer-body:not(.dzsb-app) .dz-content__body li { margin-bottom: 6px !important; }
html body.pagelayer-body:not(.dzsb-app) .dz-content__body li::marker { color: var(--dzm-green-2); }

html body.pagelayer-body:not(.dzsb-app) .dz-content__body h2,
html body.pagelayer-body:not(.dzsb-app) .dz-content__body h3,
html body.pagelayer-body:not(.dzsb-app) .dz-content__body h4 {
	font-family: var(--dzm-head) !important;
	font-weight: 700 !important;
	color: var(--dzm-ink) !important;
	line-height: 1.2 !important;
	margin: 26px 0 10px !important;
}

html body.pagelayer-body:not(.dzsb-app) .dz-content__body a:not(.dz-button):not([class*="btn"]) {
	color: var(--dzm-green-2) !important;
	text-decoration: underline !important;
	text-decoration-color: rgba(47, 107, 71, 0.35) !important;
	text-underline-offset: 3px;
}

html body.pagelayer-body:not(.dzsb-app) .dz-content__body img {
	border-radius: 14px !important;
}

html body.pagelayer-body:not(.dzsb-app) .dz-content__body [class*="gallery"] {
	margin-top: 26px !important;
	gap: 12px !important;
}

html body.pagelayer-body:not(.dzsb-app) .dz-content__body [class*="gallery"] img {
	box-shadow: 0 4px 14px rgba(23, 35, 28, 0.12);
	transition: transform 0.25s, box-shadow 0.25s;
	cursor: zoom-in;
}

html body.pagelayer-body:not(.dzsb-app) .dz-content__body [class*="gallery"] img:hover {
	transform: translateY(-3px) scale(1.02);
	box-shadow: 0 12px 26px rgba(23, 35, 28, 0.18);
}

/* ------------------------------------------------------------------
 * Buttons (Pagelayer buttons everywhere)
 * ---------------------------------------------------------------- */

html body .pagelayer-btn-holder,
html body .pagelayer-contact-submit-btn {
	border-radius: 999px !important;
	transition: transform 0.15s, box-shadow 0.15s, background 0.15s !important;
}

html body .pagelayer-btn-holder:hover { transform: translateY(-1px); }

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

/* The site name in the footer was dark green on dark green. */
html body footer.pagelayer-footer .pagelayer-wp-title-heading {
	color: #e4f1e2 !important;
	font-family: var(--dzm-head) !important;
	font-weight: 700 !important;
}

html body footer.pagelayer-footer a:hover { color: #bfe3c4 !important; }

html body footer.pagelayer-footer input[type="text"],
html body footer.pagelayer-footer input[type="email"],
html body footer.pagelayer-footer textarea {
	background: rgba(255, 255, 255, 0.08) !important;
	border: 1px solid rgba(255, 255, 255, 0.22) !important;
	border-radius: 12px !important;
	color: #fff !important;
	padding: 10px 14px !important;
}

html body footer.pagelayer-footer input::placeholder,
html body footer.pagelayer-footer textarea::placeholder { color: rgba(255, 255, 255, 0.7) !important; }

html body footer.pagelayer-footer .pagelayer-contact-submit-btn {
	background: #e4f1e2 !important;
	color: var(--dzm-green) !important;
	border: 0 !important;
	font-weight: 700 !important;
	padding: 12px 26px !important;
}

html body footer.pagelayer-footer .pagelayer-contact-submit-btn:hover { background: #fff !important; }

@media (prefers-reduced-motion: reduce) {
	html body * { transition: none !important; }
}

/* English homepage: it is an ordinary page, so the template's generic
   title banner (stock photo + breadcrumb) would show above our own title. */
html body.page-id-491 .pagelayer-row:has(.pagelayer-post_title),
html body.page-id-491 .dz-breadcrumbs {
	display: none !important;
}
