/*
Theme Name: Dronest
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: dronest
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-site-blocks main {
	padding-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--70);
}
.wp-site-blocks main.is-flush {
	padding-block: 0;
}

/* === dronest: tokens === */
:root {
	--c-nav: var( --wp--preset--color--navy );
	--c-primary: var( --wp--preset--color--primary );
	--c-text: var( --wp--preset--color--text );
	--c-muted: var( --wp--preset--color--muted );
	--c-surface: var( --wp--preset--color--surface );
	--c-surface2: var( --wp--preset--color--surface2 );
	--c-bg: var( --wp--preset--color--background );
	--root-pad: var( --wp--style--root--padding-left );
	--c-on-navy: #e7ebf2;
	--c-line-navy: rgba(255,255,255,.18);
}

/* === header === */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var( --c-bg );
	box-shadow: 0 1px 0 var( --c-surface2 );
}
.site-header .brand-wordmark a {
	color: #111 !important;
	font-size: 1.3rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	text-decoration: none !important;
}
/* Brand wordmark accent letters */
.brand-wordmark .brand-d { color: #2f5bff !important; } /* blu elettrico */
.brand-wordmark .brand-n { color: #14b8a6 !important; } /* turchese */
.site-header .wp-block-navigation .wp-block-navigation-item a {
	color: var( --c-text );
	font-weight: 500;
}
.site-header .wp-block-navigation .wp-block-navigation-item a:hover {
	color: var( --c-primary );
}

/* === hero === */
.wp-block-cover.hero-cover {
	min-height: 64vh;
}
.wp-block-cover.hero-cover .hero-eyebrow {
	color: #cdd6e6;
}
.wp-block-cover.hero-cover h1,
.wp-block-cover.hero-cover .hero-title {
	color: #fff;
	max-width: 16ch;
}
.wp-block-cover.hero-cover .hero-sub {
	color: #e7ebf2;
	max-width: 52ch;
}
.wp-block-cover.hero-cover .wp-block-buttons {
	margin-top: 2rem;
}
.hero-eyebrow {
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var( --c-primary );
}
/* Contact/preventivo hero band: white centered title and light sub on navy. */
.hero-band h1 {
	color: #fff !important;
	font-size: clamp(2rem, 4.5vw, 3.5rem) !important;
}
.hero-band .hero-sub {
	color: #e7ebf2;
  max-width: 60ch;
  margin-inline: auto;
}
/* Punchy tagline line under the hero title */
.hero-band .hero-tagline {
	color: #dbe3f2;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 600;
  line-height: 1.45;
  margin: 6px auto 0;
  max-width: 60ch;
}
/* Perche noi hero: centre the whole hero block like the homepage hero */
body.page-id-16 .hero-band {
	text-align: center;
}
body.page-id-16 .hero-band .hero-eyebrow {
	margin-inline: auto;
}
body.page-id-16 .hero-band .wp-block-buttons {
	justify-content: center;
}
body.page-id-16 .hero-band .hero-title {
	font-size: clamp(2rem, 4.5vw, 3.5rem) !important;
}
/* Approfondimenti hero: centre the title and text like the other pages */
body.page-id-17 .hero-band {
	text-align: center;
}
body.page-id-17 .hero-band .hero-eyebrow {
	margin-inline: auto;
}
/* Perche noi hero: satellite view of the earth as a full background with a
   translucent navy overlay so the text stays legible. */
body.page-id-16 .hero-band {
	position: relative;
	background-image: url("http://localhost:8881/wp-content/uploads/2026/10/terra-da-satellite.png");
	background-size: cover;
	background-position: center;
}
body.page-id-16 .hero-band::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(8, 20, 52, 0.45);
	z-index: 0;
}
body.page-id-16 .hero-band > .wp-block-group {
	position: relative;
	z-index: 1;
}
body.page-id-16 .hero-band .hero-eyebrow,
body.page-id-16 .hero-band h1,
body.page-id-16 .hero-band .hero-tagline,
body.page-id-16 .hero-band .hero-sub {
	position: relative;
	z-index: 1;
}

/* === Crossfade image carousel (Perche noi) === */
.partner-carousel {
	position: relative;
	overflow: hidden;
	border-radius: var(--radius, 14px);
	height: 100%;
	min-height: 360px;
	background: #dbe3ef;
}
.partner-carousel .wp-block-image {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	transition: opacity 1.8s ease;
}
.partner-carousel .wp-block-image.is-active,
.partner-carousel .wp-block-image:first-child {
	opacity: 1;
}
.partner-carousel .wp-block-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* === sections === */
.section-band.navy-band {
	color: var( --c-on-navy );
}
/* Centre the credential/attestation blocks so the three items read as an
   even, evenly-spaced row. */
.navy-band .wp-block-column {
	text-align: center;
}
.navy-band .wp-block-columns {
	gap: 1.5rem;
}
.navy-band h2,
.navy-band h3 {
	color: #fff;
}
.section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
}
.section-head .section-note {
	color: var( --c-muted );
	font-size: 0.95rem;
}
/* === cards === */
.is-style-card {
	background: var( --c-surface );
	border: 1px solid var( --c-surface2 );
	border-radius: var( --wp--custom--rounded--sm );
	padding: 1.5rem;
	transition: box-shadow .18s ease, transform .18s ease;
}
.is-style-card:hover {
	box-shadow: 0 8px 20px rgb(16 24 40 / .08);
	transform: translateY(-2px);
}
.is-style-card .card-kicker {
	font-size: .75rem;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var( --c-primary );
	margin-bottom: .6rem;
}
.is-style-card h3,
.is-style-card h4,
.is-style-card .card-title {
	color: var( --c-nav );
	margin: 0 0 .4rem;
}
.is-style-card p {
	color: var( --c-muted );
	font-size: .95rem;
	line-height: 1.55;
}
.is-style-card a {
	font-weight: 600;
	color: var( --c-primary );
	text-decoration: none;
}
.is-style-card hr.wp-block-separator {
	margin: 1rem 0;
}
/* Equal card height in a row: stretch each card to fill its column so all
   service-card boxes in the same row are identical in height. */
.wp-block-column .is-style-card {
	height: 100%;
	display: flex;
	flex-direction: column;
}
/* Pin the trailing link (e.g. “Scopri il servizio”) to the bottom of every
   card so the call-to-action lines up across a row whatever the copy length,
   aligned to the left of the card rather than centered. The block layout rule
   centers children with inline auto margins, so override them explicitly. */
.is-style-card > p:last-child {
	margin-top: auto;
	margin-left: 0 !important;
	margin-right: auto !important;
	align-self: flex-start;
	text-align: left;
	width: fit-content;
}
/* Uniform service-card imagery: force every card image into the same
   fixed-height rectangle with full cover-crop so all three sector shots
   render at identical size and proportion. */
.is-style-card .card-img {
	margin: 0 0 1.2rem;
	position: relative;
	height: 170px;
	overflow: hidden;
}
.is-style-card .card-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	margin: 0;
}
/* Brighten the duller first service-card image. */
.is-style-card .card-img-bright img {
	filter: brightness(1.22) saturate(1.05);
}
/* Show the survey-data section image clearly lit. */
.data-img-light img {
	filter: brightness(1.25) saturate(1.1);
}
/* Keep the hero cover photo visible under the navy overlay. */
.hero-cover .wp-block-cover__image-background {
	filter: brightness(1.3) saturate(1.08);
}
/* Match the 'operatori sul campo' image to the height of the neighbouring
   text column so the two columns stay balanced in the section. */
img.wp-image-72 {
	width: 100%;
	height: 535px;
	object-fit: cover;
	object-position: center;
}
/* Match the photovoltaic-drone image to the height of its text column. */
img.wp-image-81 {
	width: 100%;
	height: 542px;
	object-fit: cover;
	object-position: center;
}
/* Distinguish the 'Servizi' dropdown items with a balanced face that
   echoes the homepage text (sans) rather than the monospace look. */
.site-nav .wp-block-navigation__submenu-container a {
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	letter-spacing: 0;
}
/* Colour-code the three service dropdown entries. */
.site-nav .wp-block-navigation__submenu-container li.nav-serv-agricoltura a {
	color: #4f9e54;
}
.site-nav .wp-block-navigation__submenu-container li.nav-serv-fotovoltaico a {
	color: #e07a1f;
}
.site-nav .wp-block-navigation__submenu-container li.nav-serv-cantieri a {
	color: inherit;
}
/* --- Contact form: compact inputs, generous description field --- */
.wp-block-jetpack-contact-form input[type="text"],
.wp-block-jetpack-contact-form input[type="email"],
.wp-block-jetpack-contact-form input[type="tel"] {
	padding-top: 9px;
	padding-bottom: 9px;
}
/* Keep the quote form card a comfortable, centered width. */
body.page-id-13 .section-band .is-style-card {
	max-width: 720px;
	margin-left: auto;
	margin-right: auto;
}
/* Field validation states — clear, on-brand, auto-clearing. */
.wp-block-jetpack-contact-form .grunion-field[aria-invalid="true"],
.wp-block-jetpack-contact-form textarea[aria-invalid="true"] {
	border-color: #e03131;
	border-width: 2px;
	background-color: #fff7f7;
}
.contact-form__input-error {
	display: none;
}
.contact-form__input-error.has-errors {
	display: flex;
	align-items: flex-start;
	gap: 7px;
	margin-top: 6px;
	color: #e03131;
	font-size: 14px;
	line-height: 1.4;
	font-style: italic;
}
.contact-form__input-error.has-errors .contact-form__warning-icon {
	flex: 0 0 auto;
	display: inline-flex;
	margin-top: 1px;
}
.contact-form__input-error.has-errors svg path {
	fill: #e03131;
}
/* Form-level error notice — matches the field error treatment. */
.contact-form__error {
	background-color: #fff7f7;
	border: 1px solid #e03131;
	color: #b3261e;
	padding: 12px 14px;
	border-radius: 6px;
}
.contact-form__error .contact-form__error-message {
	color: #b3261e;
	font-style: italic;
}
.wp-block-jetpack-contact-form .grunion-field:focus {
	border-color: var( --c-primary, #2f5bff );
	outline: none;
	box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.15);
}
.wp-block-jetpack-contact-form textarea {
	min-height: 240px;
}
.wp-block-jetpack-contact-form input::placeholder,
.wp-block-jetpack-contact-form textarea::placeholder {
	color: #a2aab5;
}

/* === stats === */
.stat-num {
	font-size: clamp(2.2rem, 5vw, 3.4rem);
	font-weight: 700;
	line-height: 1;
	color: var( --c-primary );
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.02em;
}
.navy-band .stat-num {
	color: #fff;
}
.stat-label {
	font-size: .85rem;
	color: var( --c-muted );
	text-transform: uppercase;
	letter-spacing: .05em;
	margin-top: .5rem;
}
.navy-band .stat-label {
	color: #c9d4ea;
}

/* === cta === */
.cta-band {
	color: var( --c-on-navy );
}

.wp-block-jetpack-contact-form .wp-block-jetpack-input,
.wp-block-jetpack-contact-form input,
.wp-block-jetpack-contact-form textarea,
.wp-block-jetpack-contact-form select {
	border-radius: 6px;
}
.wp-block-jetpack-contact-form .wp-block-jetpack-button,
.wp-block-jetpack-contact-form .wp-block-button {
	margin-top: 0.5rem;
}
.cta-band h2 {
	color: #fff;
}
.cta-band p {
	color: #cdd6e6;
}

/* === buttons ===*/
.is-style-outline .wp-block-button__link,
.is-style-outline .wp-element-button {
	background: transparent;
	color: var( --c-nav );
	border: 1px solid rgba(27,42,74,.35);
}
.is-style-outline .wp-block-button__link:hover,
.is-style-outline .wp-element-button:hover {
	background: var( --c-surface );
}
.wp-block-cover.hero-cover .is-style-outline .wp-block-button__link,
.wp-block-cover.hero-cover .is-style-outline .wp-element-button,
.hero-band .is-style-outline .wp-block-button__link,
.hero-band .is-style-outline .wp-element-button {
	color: #fff;
	border-color: rgba(255,255,255,.75);
	background: transparent;
}
.wp-block-cover.hero-cover .is-style-outline .wp-element-button:hover,
.hero-band .is-style-outline .wp-element-button:hover {
	background: rgba(255,255,255,.15);
	border-color: #fff;
}
/* === footer === */
.site-footer {
	color: var( --c-on-navy );
}
.site-footer a {
	color: #c9d4ea;
	text-decoration: none;
}
.site-footer a:hover {
	color: #fff;
}
.site-footer .brand-wordmark {
	margin-top: -3px;
}
.site-footer .brand-wordmark a {
	color: #111 !important;
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1;
	letter-spacing: -0.01em;
	text-decoration: none !important;
}
.site-footer h3 {
	color: #fff !important;
}
.site-footer .wp-block-list {
	color: var( --c-on-navy );
	list-style: none;
	padding-left: 0;
}
.site-footer .wp-block-list a {
	color: var( --c-on-navy );
}
.site-footer li {
	margin-block: .35rem;
	font-size: .95rem;
}
.site-footer .wp-block-columns {
	column-gap: 2.5rem;
	justify-content: space-between;
}
.site-footer .wp-block-columns .wp-block-column {
	flex-basis: auto;
	flex-grow: 0;
	flex-shrink: 1;
}
.site-footer .wp-block-columns .wp-block-column:first-child {
	max-width: 340px;
}
.site-footer p {
	color: var( --c-on-navy );
}
/* Align the brand-column description with the first list items of the other
   footer columns. */
.site-footer .wp-block-column:first-child > p:not(.footer-brand) {
	margin-top: 17px;
}

/* === responsive === */
@media (max-width: 782px) {
	.site-header .wp-block-buttons {
		display: none;
	}
	.wp-block-cover.hero-cover {
		min-height: 58vh;
	}
	.section-head {
		flex-direction: column;
		gap: .25rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.is-style-card {
		transition: none;
	}
}
