/*
Theme Name: EnviroMatters
Description: Tema a blocchi EnviroMatters con sette lingue, consulenza industriale, dossier, mappe, profili e modulo di contatto.
Version: 0.5.0
Requires at least: 6.6
Requires PHP: 7.4
Text Domain: enviromatters
License: GNU General Public License v2 or later
*/
:root {
  --em-paper: #f8fbf9;
  --em-ink: #142721;
  --em-deep: #164b43;
  --em-muted: #485b52;
  --em-line: #cbdcd1;
  --em-accent: #8ebb9a;
  --em-mint: #eaf5ef;
  --em-shell: 76rem;
  --em-gutter: clamp(1.3rem, 4.8vw, 5rem);
  --em-space: clamp(3.75rem, 8vw, 7rem);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--em-paper); color: var(--em-ink); }
body, .editor-styles-wrapper {
  font-family: "Aptos", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}
h1, h2, h3, p { margin: 0; }
.em-main, .wp-site-blocks { padding: 0; }
.em-anchor, .em-main [id] { scroll-margin-top: 1.5rem; }
.em-wrap { max-width: var(--em-shell); margin-inline: auto; padding-inline: var(--em-gutter); }
.em-header { position: relative; z-index: 2; background: var(--em-paper); border-bottom: 1px solid var(--em-line); }
.em-header-inner { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .65rem 1.15rem; min-height: 5.25rem; }
.em-brand { flex: none; width: clamp(13.75rem, 26vw, 18.5rem); max-width: 100%; margin: 0; }
.em-brand a { display: block; }
.em-brand img { display: block; width: 100%; height: auto; aspect-ratio: 934 / 172; }
.em-brand a, .em-nav a { color: inherit; text-decoration: none; }
.em-nav {
  grid-area: 1 / 2; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .6rem clamp(.65rem, 1.45vw, 1.4rem);
}
.em-nav a { font-size: .95rem; font-weight: 650; white-space: nowrap; }
.em-nav a:hover { text-decoration: underline; text-underline-offset: .2em; }
.em-nav .em-nav-contact a, .em-nav a.em-nav-contact {
  padding: .55rem .9rem; border: 1px solid var(--em-ink); border-radius: .35rem; white-space: nowrap;
}
.em-language { grid-area: 1 / 3; position: relative; justify-self: end; min-width: 0; }
.em-language summary, .em-language a { display: flex; align-items: center; gap: .55rem; font-size: .9rem; }
.em-language summary {
  cursor: pointer; list-style: none; border: 1px solid var(--em-line); border-radius: .35rem; padding: .48rem .62rem;
  min-height: 2.5rem; font-weight: 700;
}
.em-language summary::-webkit-details-marker { display: none; }
.em-language summary::after { content: ""; width: .43rem; height: .43rem; margin-inline: .1rem; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-.12rem) rotate(45deg); }
.em-language ul {
  position: absolute; right: 0; z-index: 3; top: 100%; width: max-content; min-width: 10.5rem;
  margin: .4rem 0 0; padding: .3rem; list-style: none; background: var(--em-paper);
  border: 1px solid var(--em-line); border-radius: .45rem; box-shadow: 0 .65rem 1.75rem #164b4320;
}
.em-language a { border-radius: .25rem; padding: .42rem .55rem; color: var(--em-ink); text-decoration: none; }
.em-language a:hover, .em-language a[aria-current="page"] { background: var(--em-mint); }
.em-language a[aria-current="page"] { font-weight: 750; }
.em-flag { display: block; flex: none; width: 1.3rem; height: .87rem; overflow: hidden; border-radius: 2px; box-shadow: 0 0 0 1px #164b4325; }
.em-hero { position: relative; isolation: isolate; display: grid; align-items: end; min-height: clamp(32rem, 66vh, 45rem); color: #f7f9f1; background: var(--em-deep); }
.em-hero::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(93deg, #102824 5%, #102824ee 20%, #102824ac 51%, #10282424 100%); }
.em-hero-asset { position: absolute; inset: 0; z-index: -2; overflow: hidden; margin: 0; }
.em-main .em-hero-asset img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 52%; opacity: 0; transition: opacity .65s ease-in-out; }
.em-main .em-hero-asset .is-active { opacity: 1; }
.em-hero-content { width: 100%; padding-block: clamp(3.5rem, 8vw, 7rem); }
.em-eyebrow { color: #41604b; font-size: .875rem; font-weight: 750; letter-spacing: .115em; text-transform: uppercase; }
.em-hero .em-eyebrow { color: var(--em-accent); }
.em-hero h1 { max-width: 15ch; margin-top: 1.2rem; font-size: clamp(2.8rem, 6.2vw, 5.75rem); font-weight: 770; line-height: .99; letter-spacing: -.065em; text-wrap: balance; }
.em-hero .em-lead { max-width: 34rem; margin-top: 1.45rem; color: #e8f1e8; font-size: clamp(1.05rem, 1.7vw, 1.29rem); }
.em-buttons { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.85rem; }
.em-button .wp-block-button__link, .em-button a {
  display: inline-block; background: var(--em-accent); color: #12241b; border: 1px solid var(--em-accent);
  padding: .73rem 1.12rem; min-height: 2.75rem; border-radius: .38rem; text-decoration: none;
  font-size: .97rem; line-height: 1.3; font-weight: 780;
}
.em-button a:hover { background: var(--em-mint); border-color: var(--em-mint); }
.em-dark-button .wp-block-button__link, .em-dark-button a { color: #fff; background: var(--em-deep); border-color: var(--em-deep); }
.em-dark-button a:hover { color: #fff; background: #284e40; border-color: #284e40; }
.em-cover-controls { display: flex; align-items: center; gap: .2rem; margin-top: 1.05rem; }
.em-cover-controls[hidden] { display: none; }
.em-cover-controls button { display: grid; place-items: center; width: 2rem; height: 2rem; padding: 0; cursor: pointer; color: #fff; background: transparent; border: 0; border-radius: .3rem; }
.em-cover-controls button:hover { background: #ffffff21; }
.em-cover-controls button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.em-cover-choice::before { content: ""; width: .53rem; height: .53rem; border-radius: 50%; border: 1px solid #fff; }
.em-cover-choice[aria-pressed="true"]::before { background: var(--em-accent); border-color: var(--em-accent); transform: scale(1.35); }
.em-cover-controls svg { fill: currentColor; }
.em-cover-controls.is-rotating .em-cover-play, .em-cover-controls:not(.is-rotating) .em-cover-pause { display: none; }
:where(a, summary):focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }
.em-section { padding-block: var(--em-space); }
.em-section-head { display: grid; grid-template-columns: .98fr 1fr; gap: clamp(1rem, 4vw, 4rem); align-items: end; margin-bottom: 2.5rem; }
.em-section-head p:not(.em-eyebrow) { color: var(--em-muted); max-width: 39ch; }
.em-section h2, .em-contact h2, .em-plain h1 {
  font-size: clamp(2.05rem, 4.5vw, 3.7rem); line-height: 1.03; font-weight: 755; letter-spacing: -.055em; text-wrap: balance;
}
.em-section h2, .em-contact h2 { margin-top: .6rem; }
.em-about { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); align-items: start; gap: clamp(1.5rem,5vw,4rem); padding-bottom: .25rem; }
.em-about-copy p { color: var(--em-muted); margin-top: .85rem; max-width: 45ch; }
.em-profiles { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,17rem),1fr)); gap: .85rem; }
.em-profile { padding: clamp(1.1rem,3vw,1.7rem); border: 1px solid var(--em-line); border-radius: .45rem; }
.em-profile img { width: 5rem; height: 5rem; object-fit: cover; border-radius: 50%; margin-bottom: .65rem; }
.em-profile h3 { font-size: 1.4rem; line-height: 1.2; letter-spacing: -.025em; }
.em-profile p { margin-top: .5rem; color: var(--em-muted); }
.em-profile .em-profile-role { font-weight: 720; color: var(--em-deep); }
.em-profile a { display: inline-block; margin-top: .65rem; color: var(--em-deep); text-underline-offset: .2em; font-weight: 700; }
.em-areas { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border-top: 1px solid var(--em-line); border-bottom: 1px solid var(--em-line); }
.em-card { display: flex; flex-direction: column; align-items: start; padding: 1.8rem 1.55rem 2rem; min-width: 0; }
.em-card:first-child { padding-left: 0; }
.em-card + .em-card { border-left: 1px solid var(--em-line); }
.em-card-mark { color: #41604b; font-size: .88rem; font-weight: 720; }
.em-card h3 { font-size: clamp(1.38rem, 2.2vw, 1.85rem); letter-spacing: -.045em; line-height: 1.12; margin-top: .55rem; }
.em-card p:not(.em-card-mark) { margin-top: .8rem; color: var(--em-muted); }
.em-industry { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.04fr); gap: clamp(1.4rem,4vw,3.4rem); align-items: start; margin-top: clamp(2.2rem,5vw,4.2rem); }
.em-industry-image { margin: 0; }
.em-industry-image img { display: block; width: 100%; height: auto; aspect-ratio: 6 / 5; object-fit: cover; object-position: 67% center; border-radius: .45rem; }
.em-industry-image figcaption { margin-top: .4rem; font-size: .875rem; color: var(--em-muted); }
.em-industry-copy h2 { font-size: clamp(1.8rem,3.6vw,2.9rem); margin: 0 0 .68rem; }
.em-industry-copy > p, .em-industry-topic p { color: var(--em-muted); }
.em-industry-topic { border-top: 1px solid var(--em-line); margin-top: .8rem; padding-top: .55rem; }
.em-industry-topic h3 { font-size: 1.07rem; line-height: 1.27; margin-bottom: .2rem; }
.em-representation { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(1.75rem, 5vw, 4.25rem); align-items: start; padding-bottom: var(--em-space); }
.em-representation-copy h2 { margin-top: .65rem; font-size: clamp(1.9rem, 4vw, 3.05rem); line-height: 1.07; letter-spacing: -.045em; }
.em-representation-copy p:not(.em-eyebrow) { max-width: 58ch; margin-top: .9rem; color: var(--em-muted); }
.em-representation-note { padding: clamp(1.25rem, 3.5vw, 2.25rem); background: var(--em-mint); border-top: 3px solid var(--em-accent); }
.em-representation-note h3 { font-size: clamp(1.25rem, 2.3vw, 1.65rem); line-height: 1.14; letter-spacing: -.035em; }
.em-representation-note > p { margin-top: .75rem; color: #3a5045; }
.em-source-panel { margin-top: 1.1rem; padding-top: .75rem; border-top: 1px solid #c5d1c4; }
.em-source-panel .em-source-label { margin: 0; font-size: .89rem; font-weight: 750; color: #395445; }
.em-source-panel .em-source-list { margin: .35rem 0 0; padding-left: 1.2rem; font-size: .92rem; }
.em-source-list li + li { margin-top: .23rem; }
.em-source-list a { color: #244f3f; text-underline-offset: .18em; overflow-wrap: anywhere; }
.em-source-list a:hover { color: #142721; text-decoration-thickness: 2px; }
.em-method { background: var(--em-mint); }
.em-method-inner { display: grid; grid-template-columns: 1.04fr 1fr; gap: clamp(2rem, 6vw, 5.5rem); align-items: center; }
.em-method-image { margin: 0; }
.em-method-image img { display: block; width: 100%; height: auto; aspect-ratio: 6/5; object-fit: cover; border-radius: .45rem; }
.em-steps { margin-top: 1.65rem; }
.em-step { padding-block: .85rem; border-top: 1px solid #becdc1; }
.em-step h3 { font-size: 1.13rem; line-height: 1.25; letter-spacing: -.02em; }
.em-step p { margin-top: .35rem; color: #3a4d43; }
.em-dossier { background: #f1f7f3; }
.em-dossier h2 { margin-top: 0; }
.em-dossier-heading .em-dossier-date { margin-top: .65rem; font-size: .89rem; }
.em-dossier-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 1rem; }
.em-dossier-card { display: flex; flex-direction: column; min-height: 15.3rem; padding: clamp(1.1rem, 2.6vw, 1.8rem); border: 1px solid var(--em-line); border-radius: .45rem; background: var(--em-paper); }
.em-dossier-category { color: #3f624c; font-size: .88rem; font-weight: 720; }
.em-dossier-card h3 { margin-top: .5rem; line-height: 1.12; font-size: clamp(1.3rem, 2.25vw, 1.82rem); letter-spacing: -.045em; }
.em-dossier-summary { margin-top: .7rem; margin-bottom: 1rem; color: var(--em-muted); }
.em-dossier-detail { margin-top: auto; border-top: 1px solid var(--em-line); }
.em-dossier-detail summary { cursor: pointer; padding: .72rem 0 .16rem; color: #234d3a; font-weight: 750; }
.em-dossier-detail summary::marker { color: #486c56; }
.em-dossier-detail > p { margin-top: .8rem; }
.em-dossier-detail > p.em-dossier-next { margin-top: 1rem; font-weight: 750; }
.em-dossier-detail .em-dossier-next + p { margin-top: .25rem; }
.em-map-views { display: grid; grid-template-columns: minmax(0,1.17fr) minmax(0,1fr); gap: 1rem; }
.em-map-panel h3 { font-size: 1rem; color: var(--em-deep); margin: 0 0 .45rem; }
.em-map-view { position: relative; overflow: hidden; border-radius: .45rem; border: 1px solid var(--em-line); }
.em-map-view img { display: block; height: auto; width: 100%; margin: 0; }
.em-map-region { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%,-50%); pointer-events: none; max-width: 24%; text-align: center; font-size: clamp(.63rem, 1.03vw, .83rem); font-weight: 750; line-height: 1.07; color: #274e43; text-shadow: 0 1px 2px #ffffffc0; }
.em-map-pin {
  position: absolute; display: grid; place-items: center; left: calc(var(--x) + var(--dx)); top: calc(var(--y) + var(--dy));
  transform: translate(-50%,-50%); width: 2.05rem; height: 2.05rem; border: 2px solid #fff; border-radius: 50%;
  background: var(--em-deep); color: #fff; text-decoration: none; font-size: .85rem; font-weight: 800; box-shadow: 0 1px 4px #163c36a0;
}
.em-map-pin-office { background: #143831; box-shadow: 0 0 0 3px #719f80; }
.em-map-pin:hover, .em-map-pin:focus-visible { z-index: 1; background: #0b3029; outline: 2px solid #0b3029; outline-offset: 2px; }
.em-map-credit { margin-top: .35rem; font-size: .8rem; color: var(--em-muted); text-align: right; }
.em-map-credit a { color: inherit; }
.em-places { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem 1rem; list-style: none; padding: 0; margin: 1.2rem 0 0; }
.em-places li { display: flex; align-items: start; gap: .75rem; padding: .95rem; border: 1px solid var(--em-line); border-radius: .4rem; }
.em-places li:target, .em-places .em-map-office { background: var(--em-mint); }
.em-places li:target { outline: 2px solid var(--em-deep); }
.em-place-index { flex: none; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; color: #fff; background: var(--em-deep); font-size: .85rem; font-weight: 750; }
.em-places h3 { font-size: 1.04rem; line-height: 1.3; margin-bottom: .28rem; overflow-wrap: anywhere; }
.em-places p, .em-place-links { font-size: .93rem; color: var(--em-muted); }
.em-place-city { font-weight: 720; }
.em-place-links { display: flex; gap: .3rem .9rem; flex-wrap: wrap; margin-top: .45rem; }
.em-place-links a { color: var(--em-deep); text-underline-offset: .18em; }
.em-contact { background: var(--em-mint); }
.em-contact-inner { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.em-contact .em-copy { max-width: 36ch; margin-top: 1rem; }
.em-contact-addresses { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .95rem 1.25rem; margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--em-accent); }
.em-contact-addresses a { color: var(--em-deep); overflow-wrap: anywhere; text-underline-offset: .2em; }
.em-contact-note { margin-top: 1.15rem; border-top: 1px solid var(--em-accent); padding-top: .7rem; }
.em-contact-note summary { cursor: pointer; color: var(--em-deep); font-weight: 730; }
.em-contact-note p { margin-top: .4rem; }
.em-form { min-width: 0; display: grid; align-items: start; gap: .5rem; background: var(--em-paper); border: 1px solid var(--em-line); padding: clamp(1.15rem,3vw,1.9rem); border-radius: .5rem; }
.em-form h3 { font-size: clamp(1.35rem,3vw,1.75rem); line-height: 1.2; margin-bottom: .25rem; }
.em-form p { color: var(--em-muted); font-size: .92rem; }
.em-form label { font-size: .94rem; font-weight: 700; }
.em-form input:not([type="hidden"]), .em-form textarea { width: 100%; min-width: 0; padding: .58rem .65rem; margin-bottom: .45rem; border-radius: .28rem; border: 1px solid #9fb9ac; font: inherit; color: var(--em-ink); background: #fff; }
.em-form textarea { resize: vertical; }
.em-form :is(input,textarea,button):focus-visible { outline: 2px solid var(--em-deep); outline-offset: 2px; }
.em-form button { justify-self: start; cursor: pointer; border: 1px solid var(--em-deep); border-radius: .36rem; padding: .64rem .95rem; margin-top: .4rem; color: #fff; background: var(--em-deep); font: inherit; font-size: .97rem; font-weight: 720; }
.em-form button:disabled { opacity: .65; cursor: default; }
.em-form .em-form-status { background: var(--em-mint); color: var(--em-deep); padding: .6rem .7rem; border-radius: .3rem; font-weight: 700; }
.em-form .em-form-error { color: #772e24; background: #faebe7; }
.em-form [hidden] { display: none; }
.em-form a { color: var(--em-deep); text-underline-offset: .17em; }
.em-footer { background: var(--em-deep); color: var(--em-mint); }
.em-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.4rem 2rem; padding-block: 2rem; align-items: start; }
.em-footer-identity, .em-footer-contacts { min-width: 0; }
.em-footer .em-brand { width: 14.5rem; }
.em-footer p { font-size: .92rem; }
.em-footer-identity p, .em-footer-contacts p + p { margin-top: .55rem; }
.em-footer a { color: inherit; overflow-wrap: anywhere; text-underline-offset: .2em; }
.em-preview-note { padding: .35rem var(--em-gutter); background: var(--em-mint); color: var(--em-ink); font-size: .875rem; text-align: center; }
.em-plain { min-height: 52vh; padding-block: var(--em-space); }
.em-plain > p, .em-plain .wp-block-post-content { margin-top: 1.1rem; max-width: 68ch; }
.em-plain .wp-block-post-template > li { margin-bottom: 1.4rem; }
@media (max-width:1100px) {
  .em-header-inner { grid-template-columns: minmax(0,1fr) auto; padding-block: .8rem; }
  .em-language { grid-area: 1 / 2; }
  .em-nav { grid-area: 2 / 1 / 3 / -1; justify-content: flex-start; }
}
@media (max-width:800px) {
  .em-hero::before { background: linear-gradient(92deg,#0f2724ef 0%,#0f2724af 66%,#0f27244d 100%); }
  .em-section-head, .em-contact-inner { grid-template-columns: 1fr; gap: 1.25rem; }
  .em-method-inner, .em-representation, .em-about { grid-template-columns: 1fr; }
  .em-industry { grid-template-columns: 1fr; }
  .em-industry-image img { aspect-ratio: 3 / 2; }
  .em-method-image img { aspect-ratio: 3/2; }
}
@media (max-width:625px) {
  .em-header-inner { min-height: 0; gap: .6rem; }
  .em-nav { gap: .38rem .8rem; }
  .em-nav .em-nav-contact a, .em-nav a.em-nav-contact { padding: .38rem .53rem; }
  .em-hero { min-height: 31rem; }
  .em-hero::before { background: linear-gradient(0deg,#0f2724f5 3%,#0f2724c7 65%,#0f272447 100%); }
  .em-hero h1 { max-width: 13ch; font-size: clamp(2.65rem, 9vw, 3.6rem); }
  .em-areas, .em-dossier-grid, .em-contact-addresses, .em-map-views, .em-places { grid-template-columns: 1fr; }
  .em-dossier-card { min-height: 0; }
  .em-card { padding: 1.3rem 0; }
  .em-card + .em-card { border-left: 0; border-top: 1px solid var(--em-line); }
  .em-footer-inner { flex-direction: column; }
}
@media (max-width:475px) {
  .em-language summary span { display: none; }
  .em-language summary { gap: .32rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .em-main .em-hero-asset img { transition: none; }
}
