/*
Theme Name: ENVI portal okoliša
Description: A custom block theme scaffolded by Studio Code.
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.2
Version: 0.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: envi-portal
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, accessibility-ready, style-variations
*/

/* WordPress inserts a margin-block-start equal to the block gap (24px unless
   theme.json sets styles.spacing.blockGap) between the template's top-level
   sections (header part, main, footer part) — a gap that exists even when no
   markup asks for it. Zero it so sections butt edge-to-edge and own their
   vertical rhythm via padding; this does not affect block gaps inside nested
   layouts. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* With that gap gone, main carries its own vertical padding so templates this
   theme does not author (WooCommerce shop, product, cart…) still clear the
   header and footer. A descendant selector, not a child one: WooCommerce wraps
   the single-product main in an extra group. Templates built from full-bleed
   sections opt out with is-flush and let the sections own the rhythm. */
.wp-block-template-part .custom-logo-link img {
	width: 44px !important;
	height: auto;
}

.wp-site-blocks main {
	padding-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--70);
}
.wp-site-blocks main.is-flush {
	padding-block: 0;
}

/* === hero === */
.hero-eyebrow,
.hero-title,
.hero-sub {
	color: #ffffff !important;
}

.hero-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-weight: 600;
}

.hero-logo {
	margin-bottom: 1rem;
}

.hero-logo img {
	width: 96px;
	height: auto;
	border-radius: 12px;
	box-shadow: 0 6px 24px rgb(0 0 0 / 0.25);
}

.hero-title {
	max-width: 58ch;
}

.wp-block-cover .hero-title {
	margin-bottom: 2.25rem;
}

.hero-btn {
	margin-top: 0;
}

.hero-sub {
	max-width: 52ch;
}

/* === hero slider === */
.envi-hero-slider {
	position: relative;
	min-height: 60vh;
}

.envi-hero-slider .envi-hero-slide {
	position: absolute;
	inset: 0;
	margin: 0 !important;
	opacity: 0;
	transition: opacity 0.6s ease;
	pointer-events: none;
}

.envi-hero-slider .envi-hero-slide.is-active {
	opacity: 1;
	pointer-events: auto;
}

.envi-hero-slider .hero-eyebrow {
	margin-bottom: 0.5rem;
	font-size: clamp(1.5rem, 3.2vw, 2.4rem);
	letter-spacing: 0.1em;
	text-transform: none;
}

.envi-hero-slider .hero-title {
	margin-right: auto !important;
	margin-left: 0 !important;
}

.envi-hero-slider .hero-eyebrow {
	margin-right: auto !important;
	margin-left: 0 !important;
}

.envi-hero-slider .hero-eyebrow {
	display: inline;
}

.envi-hero-slider .hero-eyebrow + h2.hero-title,
.envi-hero-slider .hero-eyebrow + .wp-block-heading {
	display: inline;
}

.envi-hero-slider .hero-eyebrow + h2.hero-title,
.envi-hero-slider .hero-eyebrow + .wp-block-heading {
	font-size: clamp(1.3rem, 2.8vw, 1.8rem) !important;
	line-height: 1.3 !important;
}

.envi-hero-slider .hero-eyebrow + .wp-block-heading::before {
	content: "— ";
	letter-spacing: 0;
}

.envi-hero-slider .wp-block-buttons {
	margin-top: 2.5rem;
}

.envi-hero-dots {
	position: absolute;
	z-index: 2;
	left: 50%;
	transform: translateX(-50%);
	bottom: 20px;
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

.envi-hero-dot {
	width: 12px;
	height: 12px;
	padding: 0;
	border: 2px solid rgba(255, 255, 255, 0.85);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	transition: background 0.2s ease;
	box-sizing: border-box;
}

.envi-hero-dot[aria-selected="true"] {
	background: var(--wp--preset--color--background);
}

.envi-hero-dot:hover {
	background: var(--wp--preset--color--background);
}

/* === broeadsheet lead === */
.lead-heading {
	max-width: 18ch;
}

.media-grid {
	margin-top: 1.5rem;
	flex-wrap: wrap !important;
}

.wp-block-columns.media-grid > .wp-block-column {
	flex-basis: 0;
	flex-grow: 0;
	flex-shrink: 1;
	min-width: calc(33.333% - 18px) !important;
	max-width: calc(33.333% - 18px) !important;
	width: calc(33.333% - 18px) !important;
}

.media-grid video {
	width: 100%;
	height: auto;
	border-radius: 12px;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	background: #000;
}

.media-grid .wp-element-caption {
	font-weight: 600;
	color: var(--wp--preset--color--text);
	padding: 0.4rem 0.2rem 0;
}

.media-placeholder {
	position: relative;
	border-radius: 12px;
	overflow: hidden;
	background: var(--wp--preset--color--surface);
}

.media-placeholder .media-poster {
	margin: 0;
}

.media-placeholder .media-poster img {
	width: 100%;
	display: block;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 12px 12px 0 0;
	opacity: 0.75;
}

.media-placeholder .media-unavailable {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	color: #fff;
	background: rgba(18, 49, 79, 0.55);
	font-weight: 600;
	font-size: 0.95rem;
	letter-spacing: 0.02em;
	text-align: center;
}

.media-placeholder .media-cap {
	margin: 0;
	font-weight: 600;
	color: var(--wp--preset--color--text);
	padding: 0.4rem 0.2rem 0.5rem;
}

.lead-image figure, .lead-image img,
.service-image img, .atlas-image img, .rounded-image img {
	border-radius: 12px;
}

.atlas-image img {
	height: 300px;
	width: 100% !important;
	object-fit: cover;
}

.lead-image {
	margin-bottom: 1.5rem;
}

.news-list {
	list-style: none;
	padding-left: 0;
}

.news-list li {
	position: relative;
	padding-left: 1.4rem;
	margin-bottom: 0.85rem;
	line-height: 1.5;
}

.news-list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.55em;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--wp--preset--color--primary);
}

/* === services === */
.section-note {
	font-weight: 600;
}

.service-card {
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 4px 16px rgb(18 49 79 / 0.08);
	padding: 1.5rem;
}

.service-card .wp-block-image {
	margin-bottom: 1.25rem;
}

.service-card h3 {
	margin-bottom: 0.6rem;
	line-height: 1.4;
}

/* === section heading === */
.news-section-title {
	margin-bottom: 0.5rem;
}

/* === servisi page === */
.servisi-lede {
	max-width: 62ch;
	margin-bottom: 2rem;
}

.wp-block-columns.servisi-grid {
	display: grid !important;
	grid-template-columns: repeat(4, 1fr) !important;
	gap: 24px;
	margin-bottom: 0;
	align-items: stretch;
}

.theme-card {
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 4px 16px rgb(18 49 79 / 0.08);
	padding: 1.5rem;
}

.theme-card-title {
	font-size: 1.1rem;
	margin-bottom: 0.75rem;
	line-height: 1.35;
}

.theme-card-url {
	margin-bottom: 0.65rem;
	font-size: 0.9rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.theme-card-url:last-of-type {
	margin-bottom: 1rem;
}

.svc-tag {
	flex: 0 0 auto;
	font-size: 0.72rem;
	font-weight: 700;
	color: #ffffff;
	border-radius: 999px;
	padding: 0.15rem 0.55rem;
	letter-spacing: 0.02em;
}

.svc-wms {
	background: var(--wp--preset--color--primary);
}

.svc-wfs {
	background: var(--wp--preset--color--accent);
}

.theme-card-url a {
	text-decoration: none;
	background-image: linear-gradient(currentColor, currentColor);
	background-size: 100% 2px;
	background-position: 0 100%;
	background-repeat: no-repeat;
	color: var(--wp--preset--color--text);
	word-break: break-all;
}

.theme-card-url a:hover {
	color: var(--wp--preset--color--accent);
}

.theme-card .envi-toggle-details {
	margin: 0;
}

.theme-card .envi-details-btn {
	font-size: 0.85rem;
}

.theme-card ul {
	margin: 0;
}

.theme-card ul li {
	margin-bottom: 0.35rem;
}

.service-card h3 a {
	text-decoration: none;
	background-image: linear-gradient(currentColor, currentColor);
	background-size: 100% 2px;
	background-position: 0 100%;
	background-repeat: no-repeat;
	padding-bottom: 0.15rem;
}

.service-card h3 a:hover {
	color: var(--wp--preset--color--accent);
}

.doc-intro {
	max-width: 62ch;
	margin-bottom: 2rem;
}

/* === atlas === */
.section-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-weight: 600;
}

.atlas-topic-title {
	margin-bottom: 0.5rem;
}

.atlas-topic-intro {
	max-width: 46ch;
	margin-bottom: 2rem;
}

.atlas-topic-row {
	align-items: stretch;
	gap: 32px;
}

.wp-block-columns.atlas-link-grid {
	display: grid !important;
	grid-template-columns: repeat(2, 1fr) !important;
	column-gap: 16px;
	row-gap: 24px;
	margin-bottom: 12px;
	align-items: stretch;
}

.atlas-link-grid:last-child {
	margin-bottom: 0;
}

.atlas-link {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 0.55rem 0.4rem;
	background: #ffffff;
	border-radius: 10px;
	box-shadow: 0 3px 12px rgb(18 49 79 / 0.08);
}

.atlas-link .atlas-link-icon a {
	position: static;
}

.atlas-link .atlas-link-icon a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.atlas-link .atlas-link-icon {
	margin-bottom: 0.2rem;
}

.atlas-link .atlas-link-icon img {
	width: 56px;
	height: auto;
	transition: transform 300ms ease-out;
}

.atlas-link .atlas-link-icon:hover img {
	transform: scale(1.08);
}

.atlas-link-label {
	margin-bottom: 0;
	line-height: 1.2;
}

/* Image column: fills the full height of the link block */
.atlas-img-col {
	display: flex;
}

.atlas-img-col .atlas-side-img {
	width: 100%;
	margin: 0;
}

.atlas-img-col .atlas-side-img img {
	border-radius: 12px;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* === details toggle === */
.envi-toggle-details {
	margin: 1.5rem 0 0;
}

.envi-details-btn {
	border: none;
	background: transparent;
	padding: 0;
	font: inherit;
	font-weight: 600;
	color: var(--wp--preset--color--accent);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.envi-details-btn::after {
	content: "";
	width: 0;
	height: 0;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 7px solid currentColor;
	transition: transform 300ms ease;
}

.envi-details-btn[aria-expanded="true"]::after {
	transform: rotate(180deg);
}

.envi-details-more {
	display: block;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transition: max-height 500ms ease, opacity 400ms ease, margin 300ms ease;
	margin: 0;
}

.envi-details-more.is-open {
	max-height: 2000px;
	opacity: 1;
	margin-top: 1.25rem;
}

@media (max-width: 782px) {
	.atlas-topic-row {
		gap: 32px;
	}

	.wp-block-columns.servisi-grid {
		grid-template-columns: 1fr !important;
	}

	.wp-block-columns.atlas-link-grid {
		grid-template-columns: 1fr !important;
	}
}

/* === cta === */
.cta-sub {
	max-width: 46ch;
	margin-inline: auto;
}

/* === news cta === */
.news-cta {
	text-align: center;
}

.news-cta .section-eyebrow {
	color: var(--wp--preset--color--accent);
	margin-bottom: 0.75rem;
}

.news-cta-title {
	margin-bottom: 1rem;
}

.news-cta-sub {
	max-width: 56ch;
	margin-inline: auto;
	margin-bottom: 2rem;
}

/* === hover === */
.service-card img {
	transition: transform 300ms ease-out;
}

.service-card:hover img {
	transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation: none !important;
		transition: none !important;
	}
}

/* === inner page heroes === */
.page-hero-title,
.page-hero-sub {
	color: #ffffff !important;
}

.page-hero-title {
	max-width: 16ch;
}

.page-hero-title.geo-hero-title {
	max-width: 26ch;
}

.rounded-image.geo-image img {
	height: 440px;
	width: 100% !important;
	object-fit: cover;
}

.page-hero-sub {
	max-width: 60ch;
}

/* === feature tiles (atlas/inspire) === */
.feature-tile {
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 4px 16px rgb(18 49 79 / 0.08);
	padding: 1.5rem;
}

.feature-grid {
	gap: 24px;
}

/* === big quote === */
.big-quote {
	border-left: 4px solid var(--wp--preset--color--primary);
	padding: 1rem 1.5rem;
	font-size: clamp(1.2rem, 2.5vw, 1.6rem);
	line-height: 1.4;
}

.big-quote cite {
	font-size: 0.9rem;
}

/* === news cards === */
.news-card {
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 4px 16px rgb(18 49 79 / 0.08);
	padding: 1.5rem;
	height: 100%;
}

.news-card .wp-block-post-date {
	color: var(--wp--preset--color--accent);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.news-card .wp-block-post-title {
	margin: 0 0 0.5rem;
}

.news-query .wp-block-post-template {
	gap: 24px;
}

.news-card .wp-block-button__link {
	padding: 8px 20px;
}

/* === doc grid === */
.doc-grid {
	gap: 24px;
}

.doc-grid .service-card {
	margin-bottom: 0;
}

/* === contact === */
.contact-list {
	list-style: none;
	padding-left: 0;
}

.contact-list li {
	margin-bottom: 0.75rem;
}

.wp-block-jetpack-contact-form .wp-block-button__link {
	border: 0;
}

.wp-block-jetpack-contact-form .wp-block-button__link:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* Math anti-spam check */
.envi-math-captcha {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	width: 100%;
	max-width: 320px;
}

.envi-math-label {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--wp--preset--color--text);
}

.envi-math-input {
	width: 100%;
	padding: 0.6rem 0.9rem;
	border: 1px solid var(--wp--preset--color--surface);
	border-radius: 8px;
	font-family: inherit;
	font-size: 1rem;
	background: var(--wp--preset--color--background);
}

.envi-math-captcha.is-valid .envi-math-input {
	border-color: var(--wp--preset--color--primary);
}

/* === header toolbar (search + accessibility) === */
.wp-block-template-part > .alignfull {
	position: relative;
}

.envi-toolbar {
	position: fixed;
	z-index: 998;
	top: 14px;
	right: 24px;
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.envi-tool-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid var(--wp--preset--color--surface);
	border-radius: 999px;
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--primary);
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.envi-tool-btn:hover,
.envi-tool-btn[aria-expanded="true"] {
	background: var(--wp--preset--color--primary);
	color: #ffffff;
}

.envi-popup {
	position: fixed;
	z-index: 999;
	top: 64px;
	right: 24px;
	width: min(420px, calc(100vw - 48px));
	padding: 1.25rem;
	background: #ffffff;
	border: 1px solid var(--wp--preset--color--surface);
	border-radius: 12px;
	box-shadow: 0 12px 32px rgb(18 49 79 / 0.14);
}

.envi-search-popup {
	display: block;
}

.envi-search-popup.is-hidden {
	display: none !important;
}

.envi-search-popup .wp-block-search__input {
	padding: 0.6rem 0.9rem;
	border: 1px solid var(--wp--preset--color--surface);
	border-radius: 8px 0 0 8px;
	font-family: inherit;
	font-size: 1rem;
}

.envi-search-popup .wp-block-search__button {
	border: none;
	border-radius: 0 8px 8px 0;
	background: var(--wp--preset--color--primary);
	color: #ffffff;
	font-weight: 600;
}

.envi-popup label {
	display: block;
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--wp--preset--color--text);
	margin-bottom: 0.5rem;
}

.envi-search-row {
	display: flex;
	gap: 0.5rem;
}

.envi-search-row input[type="search"] {
	flex: 1;
	min-width: 0;
	padding: 0.6rem 0.9rem;
	border: 1px solid var(--wp--preset--color--surface);
	border-radius: 8px;
	font-family: inherit;
	font-size: 1rem;
}

.envi-popup-submit,
.envi-acc-btn {
	display: inline-block;
	padding: 0.55rem 1.1rem;
	border: none;
	border-radius: 999px;
	background: var(--wp--preset--color--primary);
	color: #ffffff;
	font-family: inherit;
	font-weight: 600;
	font-size: 0.9rem;
	cursor: pointer;
}

.envi-acc-title {
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--wp--preset--color--text);
	margin: 0 0 0.75rem;
}

/* Each accessibility row: label on the left, control on the right. */
.envi-acc-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.45rem 0;
	border-bottom: 1px solid #e3eef1;
}

.envi-acc-row:last-child {
	border-bottom: none;
}

.envi-acc-label {
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--wp--preset--color--text);
}

.envi-acc-tools {
	display: flex;
	gap: 0.35rem;
	flex-shrink: 0;
}

.envi-acc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	padding: 0.45rem 0.7rem;
	border: 1px solid #cfe4ea;
	border-radius: 8px;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--text);
	font-family: inherit;
	font-weight: 600;
	font-size: 0.9rem;
	cursor: pointer;
}

.envi-acc-btn:hover {
	background: var(--wp--preset--color--primary);
	color: #ffffff;
}

/* On/off switch. */
.envi-switch {
	position: relative;
	width: 46px;
	height: 26px;
	padding: 0;
	border: none;
	border-radius: 999px;
	background: #cfdde2;
	cursor: pointer;
	flex-shrink: 0;
	box-sizing: border-box;
	font: inherit;
}

.envi-switch .envi-switch-knob {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	transition: left 0.2s ease;
}

.envi-switch[aria-checked="true"] {
	background: var(--wp--preset--color--primary);
}

.envi-switch[aria-checked="true"] .envi-switch-knob {
	left: 23px;
}

/* Greyscale mode. */
.envi-grayscale {
	-webkit-filter: grayscale(100%);
	filter: grayscale(100%);
}

/* High contrast mode. */
.envi-contrast,
.envi-contrast * {
	color: #000000 !important;
	background-color: #ffffff !important;
	background-image: none !important;
	border-color: #000000 !important;
}

.envi-contrast a {
	text-decoration: underline !important;
}

.envi-contrast :is(button, .wp-block-button__link, [role="switch"]) {
	background: #000000 !important;
	color: #ffffff !important;
	border: 2px solid #ffffff !important;
}

/* Dyslexia-friendly font + spacing. */
.envi-dyslexia,
.envi-dyslexia * {
	font-family: Verdana, Tahoma, sans-serif !important;
	line-height: 1.8 !important;
	letter-spacing: 0.03em !important;
	word-spacing: 0.1em !important;
}

/* Underline links. */
.envi-underline a {
	text-decoration: underline !important;
}

@media (prefers-reduced-motion: reduce) {
	.envi-tool-btn,
	.envi-popup-submit,
	.envi-acc-btn,
	.envi-switch .envi-switch-knob,
	.envi-hero-dot {
		transition: none;
	}
}

/* === Contact Form 7 === */
.wpcf7 form {
	font-family: inherit;
}

.wpcf7 .cf7-field {
	margin-bottom: 1rem;
}

.wpcf7 .cf7-field label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
	color: var(--wp--preset--color--text);
}

.wpcf7 .cf7-field label .req {
	color: var(--wp--preset--color--primary);
}

.wpcf7-form-control-wrap input[type="text"],
.wpcf7-form-control-wrap input[type="email"],
.wpcf7-form-control-wrap textarea {
	width: 100%;
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--wp--preset--color--surface);
	border-radius: 12px;
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.4;
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--text);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wpcf7-form-control-wrap textarea {
	min-height: 150px;
}

.wpcf7-form-control-wrap input[type="text"]:focus,
.wpcf7-form-control-wrap input[type="email"]:focus,
.wpcf7-form-control-wrap textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--primary);
	box-shadow: 0 0 0 3px rgba(47, 143, 58, 0.15);
}

.wpcf7 input.wpcf7-submit {
	border: 0;
	border-radius: 999px;
	padding: 0.75rem 1.75rem;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	color: #fff;
	background: var(--wp--preset--color--primary);
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.wpcf7 input.wpcf7-submit:hover {
	background: var(--wp--preset--color--navy);
	transform: translateY(-1px);
}

.wpcf7 input.wpcf7-submit:disabled {
	opacity: 0.65;
	cursor: not-allowed;
	transform: none;
}

.wpcf7 .wpcf7-response-output {
	margin: 1rem 0 0;
	padding: 0.9rem 1.1rem;
	border-radius: 12px;
	border: 1px solid var(--wp--preset--color--surface);
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--text);
	font-size: 0.95rem;
}

.wpcf7 .wpcf7-not-valid-tip {
	margin-top: 0.35rem;
	font-size: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
	.wpcf7 input.wpcf7-submit {
		transition: none;
		transform: none;
	}
}

