/*
Theme Name: DemoSpaces v2
Theme URI: https://demospaces.pt
Author: ATE
Author URI: https://demospaces.pt
Description: Portal DemoSpaces v2 — rede de espaços de demonstração no setor energético em Portugal.
Version: 2.1.33
Requires at least: 6.4
Tested up to: 6.5
Requires PHP: 8.1
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: demospaces
Tags: energy, network, directory
*/

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
:root {
	--font-heading: "Comfortaa", "Trebuchet MS", sans-serif;
	--font-body: "Inter", "Avenir Next", "Avenir", "Nunito Sans", "Segoe UI", Arial, sans-serif;
	--font-ui: "Inter", "Segoe UI", Arial, sans-serif;
}
body { font-family: var(--font-body); color: #3f3a38; background: #fff; overflow-x: hidden; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); }
.ds-font-comfortaa { font-family: var(--font-heading); }
.ds-font-inter { font-family: var(--font-ui); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.ds-space-detail {
	background: #ffffff;
	color: #3f3a38;
}

.ds-space-hero {
	min-height: min(78vh, 35rem);
	background:
		linear-gradient(90deg, rgba(0, 45, 56, 0.84) 0%, rgba(0, 61, 75, 0.72) 46%, rgba(0, 144, 190, 0.18) 100%),
		var(--ds-space-hero-image, linear-gradient(135deg, #07323d, #0090be));
	background-size: cover;
	background-position: center;
}

.ds-space-hero__overlay {
	display: flex;
	flex-direction: column;
	min-height: inherit;
	width: min(100% - 2rem, 78rem);
	margin-inline: auto;
	padding: 2.2rem 0 clamp(3rem, 7vw, 5rem);
}

.ds-space-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 2rem;
	width: 100%;
	margin-bottom: auto;
	color: #ffffff;
	font-family: var(--font-ui);
}

.ds-space-nav__brand {
	font-size: 1.05rem;
	font-weight: 800;
	letter-spacing: 0;
}

.ds-space-nav__links {
	display: flex;
	align-items: center;
	gap: clamp(1rem, 2vw, 1.8rem);
	margin-left: auto;
	font-size: 0.85rem;
	font-weight: 600;
	text-transform: uppercase;
}

.ds-space-nav__links a {
	transition: opacity 0.2s ease;
}

.ds-space-nav__links a:hover {
	opacity: 0.72;
}

.ds-space-nav__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.35rem;
	padding: 0.35rem 1.1rem;
	border: 2px solid #ffffff;
	border-radius: 999px;
	font-family: var(--font-heading);
	font-size: 1rem;
	font-weight: 500;
	text-transform: none;
}

.ds-space-hero__content {
	width: 100%;
	max-width: 46rem;
	margin-top: clamp(3.5rem, 10vw, 6.2rem);
	margin-right: auto;
	color: #ffffff;
}

.ds-space-hero__eyebrow {
	margin: 0 0 0.75rem;
	font-family: var(--font-heading);
	font-size: 1.08rem;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
}

.ds-space-hero h1 {
	margin: 0;
	font-size: clamp(2.3rem, 4.8vw, 3.9rem);
	font-weight: 500;
	line-height: 1.12;
	letter-spacing: 0;
}

.ds-space-hero__meta {
	display: grid;
	gap: 1.45rem;
	margin-top: 2rem;
	font-family: var(--font-heading);
	font-size: 1.12rem;
	line-height: 1.5;
}

.ds-space-hero__meta p {
	margin: 0;
}

.ds-space-hero__cta,
.ds-space-detail__back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 999px;
	font-family: var(--font-ui);
	font-weight: 500;
	transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ds-space-hero__cta {
	margin-top: 2rem;
	min-height: 2.25rem;
	padding: 0.4rem 1.45rem;
	border: 1px solid #ffffff;
	color: #ffffff;
	font-size: 0.95rem;
}

.ds-space-hero__cta:hover {
	transform: translateY(-1px);
	background: #ffffff;
	color: #006d91;
}

.ds-space-detail__body {
	width: min(100% - 2rem, 78rem);
	margin-inline: auto;
	padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(4rem, 8vw, 6rem);
}

.ds-space-gallery {
	margin-top: clamp(2.8rem, 6vw, 4.8rem);
	margin-bottom: clamp(3rem, 6vw, 5rem);
}

.ds-space-gallery h2 {
	margin: 0 0 1.3rem;
	color: #0090be;
	font-size: clamp(1.2rem, 2.4vw, 1.65rem);
	font-weight: 500;
	line-height: 1.2;
}

.ds-space-gallery__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.1rem;
}

.ds-space-gallery__item {
	margin: 0;
	background: #f5f5f5;
	overflow: hidden;
}

.ds-space-gallery__item img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.ds-space-detail__back {
	margin-bottom: 2rem;
	color: #0090be;
	font-size: 0.95rem;
}

.ds-space-detail__back:hover {
	transform: translateX(-2px);
}

.ds-space-section {
	max-width: 68rem;
	margin-bottom: clamp(2rem, 4vw, 3.2rem);
}

.ds-space-section h2 {
	margin: 0 0 1.15rem;
	color: #0090be;
	font-size: clamp(1.2rem, 2.4vw, 1.65rem);
	font-weight: 500;
	line-height: 1.2;
}

.ds-space-section__content {
	font-family: var(--font-heading);
	font-size: clamp(0.98rem, 1.5vw, 1.1rem);
	line-height: 1.45;
}

.ds-space-section__content p,
.ds-space-section__content ul,
.ds-space-section__content ol {
	margin-top: 0;
	margin-bottom: 1rem;
}

.ds-space-section__content ul,
.ds-space-section__content ol {
	padding-left: 1.25rem;
}

.ds-space-contact {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 2rem;
	align-items: center;
	margin-top: clamp(3rem, 6vw, 5rem);
	padding: clamp(1.6rem, 4vw, 2.2rem);
	border-radius: 1.2rem;
	background: #f5f5f5;
}

.ds-space-contact__label {
	margin: 0 0 0.4rem;
	color: #0090be;
	font-family: var(--font-ui);
	font-size: 0.85rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.ds-space-contact h2 {
	margin: 0;
	font-size: clamp(1.35rem, 3vw, 2rem);
	font-weight: 500;
	line-height: 1.2;
}

.ds-space-contact__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.8rem;
	justify-content: flex-end;
}

.ds-space-contact__links a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.55rem;
	padding: 0.55rem 1.2rem;
	border-radius: 999px;
	background: #0090be;
	color: #ffffff;
	font-family: var(--font-ui);
	font-size: 0.95rem;
	font-weight: 600;
}

.ds-space-contact__links a:hover {
	background: #007ea7;
}

@media (max-width: 900px) {
	.ds-space-nav {
		align-items: flex-start;
	}

	.ds-space-nav__links {
		flex-wrap: wrap;
		justify-content: flex-end;
		gap: 0.8rem 1rem;
	}

	.ds-space-contact {
		grid-template-columns: 1fr;
	}

	.ds-space-contact__links {
		justify-content: flex-start;
	}
}

@media (max-width: 640px) {
	.ds-space-hero {
		min-height: 34rem;
	}

	.ds-space-hero__overlay {
		padding-top: 1.5rem;
	}

	.ds-space-nav {
		display: grid;
		gap: 1.2rem;
	}

	.ds-space-nav__links {
		justify-content: flex-start;
		font-size: 0.78rem;
	}

	.ds-space-nav__cta {
		font-size: 0.92rem;
	}

	.ds-space-gallery__grid {
		grid-template-columns: 1fr;
	}

	.ds-space-section__content {
		font-family: var(--font-body);
	}
}

.ds-network-map {
	position: relative;
	aspect-ratio: 283 / 578;
	width: min(100%, 19rem);
	margin-inline: auto;
	overflow: hidden;
	background: transparent;
}

.ds-network-map__image {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ds-network-map__marker {
	position: absolute;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 0.45rem;
	transform: translate(-50%, -50%);
	z-index: 2;
}

.ds-network-map__dot {
	width: 1rem;
	height: 1rem;
	border-radius: 999px;
	border: 3px solid #ffffff;
	background: #111111;
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.ds-network-map__label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2rem;
	padding: 0.45rem 0.95rem;
	border-radius: 999px;
	background: #ffffff;
	color: #3f3a38;
	font-family: var(--font-heading);
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ds-network-map__marker:hover .ds-network-map__label,
.ds-network-map__marker:focus-visible .ds-network-map__label {
	transform: translateY(-1px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.ds-network-map__marker:focus-visible {
	outline: none;
}

.ds-network-map__marker--living-lab .ds-network-map__dot {
	background: #19554d;
}

.ds-network-map__marker--piloto .ds-network-map__dot {
	background: #0090be;
}

.ds-network-map__marker--demonstrador .ds-network-map__dot {
	background: #1f2937;
}

.ds-network-map__marker--planta-industrial .ds-network-map__dot {
	background: #5f6f52;
}

@media (max-width: 767px) {
	.ds-network-map {
		width: min(100%, 15rem);
	}
}

.ds-chart-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (min-width: 1024px) { .ds-chart-scroll { overflow-x: visible; } }

.ds-trl-chart {
	min-width: 980px;
}

.ds-trl-chart__panel {
	display: grid;
	grid-template-columns: 140px minmax(760px, 1fr);
	grid-template-rows: 1fr 1fr;
	column-gap: 1.25rem;
	align-items: center;
}

.ds-trl-chart__y-label {
	color: #4c4745;
	font-family: var(--font-ui);
	font-size: 0.95rem;
	font-weight: 400;
	line-height: 1.25;
	display: flex;
	justify-content: flex-end;
	align-items: center;
	text-align: right;
	width: 100%;
	padding-right: 0.75rem;
	box-sizing: border-box;
}

.ds-trl-chart__y-label--top {
	grid-column: 1;
	grid-row: 1;
}

.ds-trl-chart__y-label--bottom {
	grid-column: 1;
	grid-row: 2;
}

.ds-trl-chart__plot {
	position: relative;
	grid-column: 2;
	grid-row: 1 / span 2;
	height: 162px;
	padding: 0 1.75rem 0 0.75rem;
}

.ds-trl-chart__axis-y,
.ds-trl-chart__axis-x {
	position: absolute;
	background: #bcbcbc;
}

.ds-trl-chart__axis-y {
	left: 0;
	top: 8px;
	bottom: 22px;
	width: 2px;
}

.ds-trl-chart__axis-y::before {
	content: "";
	position: absolute;
	top: -7px;
	left: 50%;
	width: 12px;
	height: 12px;
	border-top: 2px solid #bcbcbc;
	border-right: 2px solid #bcbcbc;
	transform: translateX(-50%) rotate(-45deg);
	transform-origin: center;
}

.ds-trl-chart__axis-x {
	left: 0;
	right: 1rem;
	bottom: 22px;
	height: 2px;
}

.ds-trl-chart__axis-x::after {
	content: "";
	position: absolute;
	top: 50%;
	right: -1px;
	width: 11px;
	height: 11px;
	border-top: 2px solid #bcbcbc;
	border-right: 2px solid #bcbcbc;
	transform: translateY(-50%) rotate(45deg);
	transform-origin: center;
}

.ds-trl-chart__bar {
	position: absolute;
	height: 1.95rem;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 1.75rem;
	border-radius: 9999px;
	background: #0090be;
	color: #fff;
	font-family: var(--font-ui);
	font-size: 0.96rem;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	box-sizing: border-box;
}

.ds-trl-chart__bar--top {
	top: 10px;
}

.ds-trl-chart__bar--middle {
	top: 58px;
}

.ds-trl-chart__bar--bottom {
	top: 96px;
}

.ds-trl-chart__ticks {
	display: grid;
	grid-template-columns: 140px repeat(9, minmax(0, 1fr));
	column-gap: 1.25rem;
	align-items: center;
	margin-top: 0.25rem;
}

.ds-trl-chart__ticks-label,
.ds-trl-chart__tick {
	color: #4c4745;
	font-family: var(--font-ui);
	font-size: 0.95rem;
	font-weight: 400;
	line-height: 1.2;
}

.ds-trl-chart__ticks-label {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	text-align: right;
	width: 100%;
	padding-right: 0.75rem;
	box-sizing: border-box;
}

.ds-trl-chart__tick {
	text-align: center;
}

.ds-guide-grid {
	align-items: start;
}

.ds-guide-column {
	width: 100%;
}

.ds-guide-column__title {
	margin: 0 0 1.1rem;
	color: #3f3a38;
	font-family: var(--font-heading);
	font-size: 1.05rem;
	font-weight: 500;
	line-height: 1.2;
}

.ds-guide-stack {
	display: grid;
	gap: 0.9rem;
}

.ds-guide-stack--operational {
	gap: 0.9rem;
}

.ds-guide-card {
	position: relative;
	background: #f7f7f5;
	border-radius: 0;
	padding: 0.95rem 1.15rem 0.9rem 1.45rem;
	width: 100%;
	max-width: 100%;
	min-height: 5.55rem;
}

.ds-guide-card::before {
	content: "";
	position: absolute;
	left: 1.15rem;
	top: 0.9rem;
	bottom: 0.9rem;
	width: 0.125rem;
	background: #0090be;
}

.ds-guide-card__name {
	margin: 0 0 0.15rem;
	color: #3f3a38;
	font-family: var(--font-heading);
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.2;
	padding-left: 0.95rem;
}

.ds-guide-card__desc {
	margin: 0;
	color: #3f3a38;
	font-family: var(--font-heading);
	font-size: 0.74rem;
	font-weight: 400;
	line-height: 1.22;
	padding-left: 0.95rem;
}

.ds-guide-card--trl {
	display: block;
	width: 100%;
	max-width: 100%;
	min-height: 3.55rem;
	padding: 0.82rem 1rem 0.78rem 1.45rem;
}

.ds-guide-card__trl {
	color: #3f3a38;
	font-family: var(--font-heading);
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.1;
	white-space: nowrap;
	display: block;
	padding-left: 0.95rem;
	margin-bottom: 0.08rem;
}

.ds-guide-card__trl-desc {
	margin: 0;
	color: #3f3a38;
	font-family: var(--font-heading);
	font-size: 0.72rem;
	font-weight: 400;
	line-height: 1.18;
	padding-left: 0.95rem;
}

.ds-footer-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	align-items: start;
}

.ds-footer-logos {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: flex-end;
	gap: 1.25rem;
	width: 100%;
	min-width: 0;
}

.ds-footer-logo {
	display: block;
	flex: 0 0 auto;
	width: auto;
	object-fit: contain;
}

.ds-footer-logo--inesc {
	height: 2rem;
	mix-blend-mode: screen;
}

.ds-footer-logo--funding {
	height: 2.3rem;
}

@media (min-width: 1024px) {
	.ds-footer-grid {
		grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.9fr) minmax(0, 0.9fr) auto;
	}
}

/* Align hero H1 metrics with v1 visual baseline (max 48px, lh 1.2). */
.ds-hero-title {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: clamp(1.875rem, 4vw, 3rem);
	line-height: 1.2;
	letter-spacing: 0;
}

.ds-tipologia-cards {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
}

.ds-tipologia-card {
	position: relative;
	background: #fff;
	border-radius: 0;
	padding: 1.25rem 1.5rem 1rem 3rem;
	min-height: 10.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.ds-tipologia-card::before {
	content: "";
	position: absolute;
	left: 1.5rem;
	top: 1.25rem;
	bottom: 1.25rem;
	width: 2px;
	background: #0090be;
}

.ds-tipologia-card__title {
	margin: 0;
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 2rem;
	line-height: 1.2;
	color: #3f3a38;
}

.ds-tipologia-card__desc {
	margin: 0;
	font-family: var(--font-heading);
	font-weight: 500;
	font-size: 1.25rem;
	line-height: 1.35;
	color: #3f3a38;
}

.ds-tipologia-card__trl {
	margin: auto 0 0;
	font-family: var(--font-heading);
	font-weight: 500;
	font-size: 1rem;
	line-height: 1.2;
	color: #3f3a38;
}

@media (max-width: 768px) {
	.ds-tipologia-card {
		padding: 1rem 1rem 0.875rem 2.25rem;
		min-height: 0;
	}

	.ds-tipologia-card::before {
		left: 1rem;
		top: 1rem;
		bottom: 1rem;
	}

	.ds-tipologia-card__title {
		font-size: 1.5rem;
	}

	.ds-tipologia-card__desc {
		font-size: 1rem;
	}

	.ds-tipologia-card__trl {
		font-size: 0.875rem;
	}

	.ds-trl-chart {
		min-width: 860px;
	}

	.ds-trl-chart__panel {
		grid-template-columns: 120px minmax(680px, 1fr);
		column-gap: 1rem;
	}

	.ds-trl-chart__plot {
		height: 152px;
		padding-right: 1.5rem;
	}

	.ds-trl-chart__bar {
		height: 1.75rem;
		padding: 0 1.35rem;
		font-size: 0.84rem;
	}

	.ds-trl-chart__bar--top {
		top: 10px;
	}

	.ds-trl-chart__bar--middle {
		top: 56px;
	}

	.ds-trl-chart__bar--bottom {
		top: 92px;
	}

	.ds-trl-chart__ticks {
		grid-template-columns: 120px repeat(9, minmax(0, 1fr));
		column-gap: 1rem;
	}

	.ds-trl-chart__y-label,
	.ds-trl-chart__ticks-label,
	.ds-trl-chart__tick {
		font-size: 0.875rem;
	}

	.ds-guide-column__title {
		font-size: 0.98rem;
	}

	.ds-guide-card {
		padding: 0.9rem 0.95rem 0.85rem 1.25rem;
		max-width: none;
	}

	.ds-guide-card__name {
		font-size: 0.88rem;
	}

	.ds-guide-card__desc,
	.ds-guide-card__trl-desc {
		font-size: 0.68rem;
	}

	.ds-guide-card--trl {
		padding: 0.76rem 0.9rem 0.72rem 1.25rem;
		max-width: none;
	}

	.ds-guide-card__trl {
		font-size: 0.88rem;
	}

	.ds-footer-logos {
		justify-content: flex-start;
		gap: 0.9rem;
		flex-wrap: wrap;
	}

	.ds-footer-logo--inesc {
		height: 1.8rem;
	}

	.ds-footer-logo--funding {
		height: 2.1rem;
	}
}

@media (min-width: 640px) and (max-width: 1023px) {
	.ds-footer-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
