/* ESI Spa — site styles.
 * Ported from the June 2026 design (_dev/archive/esi-spa-new-2026-06/public_html/Assets/CSS/main/,
 * six files merged into one request), which reproduces the old Joomla template:
 * brand green #02922d (now #5ab24e, the logo green: PM 2026-10-23), logo green #5ab24e, 'Billion Web Font' headings.
 * Improved here: document lists (IR), data tables, image heroes, map loaded on click.
 * 2026-10-22: sharp and flat (square corners, lines instead of shadows, square buttons with a
 * chevron on the "go to" ones), after studioquagliero. The rounded version is archived in
 * _dev/archive/style-rounded-2026-10-22/ (project folder).
 */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  /* --esi-green: #02922d;  old site template green, before 2026-10-23 */
  --esi-green: #5ab24e;   /* PM 2026-10-23: the logo green */
  --esi-green-dark: #027324;
  --esi-green-light: #03bf3b;
  --esi-green-logo: #5ab24e;
  --esi-green-tint: #e8f5ec;
  --esi-green-band: #8dc63f;
  /* the download icon of svg_icon('download'), for links that cannot carry an <svg> */
  --ico-download: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3'/%3E%3C/svg%3E");

  --gray-900: #1f1f1f; --gray-800: #333; --gray-700: #444; --gray-600: #555; --gray-500: #6b6b6b;
  --gray-400: #999; --gray-300: #ccc; --gray-200: #ddd; --gray-100: #ededed; --gray-050: #f5f5f5;

  --text: var(--gray-800); --text-muted: var(--gray-500); --heading: var(--gray-900);
  --link: var(--esi-green-dark); --link-hover: var(--esi-green);
  --bg: #fff; --bg-alt: var(--gray-050); --border: var(--gray-200);

  --font-display: 'Billion Web Font', 'Roboto', Arial, sans-serif;
  --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;

  --container: 1180px; --container-narrow: 820px;
  --radius: 0; --radius-lg: 0;
  --shadow-sm: none; --shadow: 0 10px 28px rgba(0,0,0,.10);   /* only floating layers (menus, banner) */
  --header-h: 78px; --topbar-h: 38px;
  --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem; --sp-7: 3rem; --sp-8: 4.5rem;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Billion Web Font';
  src: url('../fonts/billion-web.woff') format('woff');
  font-weight: normal; font-style: normal; font-display: swap;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + var(--header-h) + 1rem); }
body {
  margin: 0; font-family: var(--font-body); font-size: 16px; line-height: 1.65;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--link-hover); }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--heading); line-height: 1.2; margin: 0 0 var(--sp-4); font-weight: 700; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.8rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 var(--sp-4); }
ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.4em; }
li { margin-bottom: .35em; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-6) 0; }
:focus-visible { outline: 2px solid var(--esi-green); outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--esi-green); color: #fff; padding: .6rem 1rem; z-index: 1000; }
.skip-link:focus { left: 0; color: #fff; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding-inline: var(--sp-4); }
.container--narrow { max-width: var(--container-narrow); }
.section { padding-block: var(--sp-7); }
.section--alt { background: var(--bg-alt); }
.section-head { max-width: 720px; margin: 0 auto var(--sp-6); text-align: center; }
.section-head p { color: var(--text-muted); font-size: 1.05rem; }
.eyebrow { display: inline-flex; align-items: center; gap: .6rem; text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--esi-green-dark); margin-bottom: var(--sp-3); }
.eyebrow::before { content: ""; width: 28px; height: 3px; background: var(--esi-green-logo); flex: none; }
.hero .eyebrow { color: #fff; }
.section-head .eyebrow { justify-content: center; }

/* ── Buttons ────────────────────────────────────────────────────────────
   Square and bold. Ghost buttons lead to another page: a chevron says so and nudges right. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .85rem 1.35rem; border: 2px solid transparent; border-radius: 0;
  font-weight: 700; font-size: .95rem; line-height: 1.2; letter-spacing: .01em; cursor: pointer; text-align: center;
  background: var(--esi-green); color: #fff; transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.btn:hover { background: var(--esi-green-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--esi-green); color: #fff; }
.btn--ghost { background: transparent; color: var(--heading); border-color: currentColor; }
.btn--ghost:hover { background: var(--heading); color: #fff; border-color: var(--heading); }
.btn--ghost::after {
  content: ""; flex: none; width: .42em; height: .42em; margin: 0 .15em 0 .05em;
  border: solid currentColor; border-width: 2px 2px 0 0; transform: rotate(45deg); transition: transform .18s;
}
.btn--ghost:hover::after, .btn--ghost:focus-visible::after { transform: translateX(4px) rotate(45deg); }
.btn--light { background: #fff; color: var(--esi-green-dark); border-color: #fff; }
.btn--light:hover { background: var(--esi-green-tint); color: var(--esi-green-dark); border-color: var(--esi-green-tint); }
.actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.actions--center { justify-content: center; margin-top: var(--sp-6); }

/* ── Top bar, header, navigation ────────────────────────────────────────── */
/* top bar + header stick together (PM 2026-10-23: the top bar is always visible) */
.site-top { position: sticky; top: 0; z-index: 100; }
.topbar { position: relative; z-index: 2; background: var(--gray-900); color: var(--gray-300); font-size: .82rem; }
.topbar .container { display: flex; align-items: center; gap: var(--sp-4); min-height: var(--topbar-h); }
.topbar a { color: var(--gray-300); }
.topbar a:hover { color: #fff; }
.topbar .ticker { font-weight: 600; color: #fff; letter-spacing: .02em; }
.topbar .spacer { flex: 1; }
.topbar .social { display: inline-flex; align-items: center; gap: 6px; }
.ico { width: 16px; height: 16px; display: inline-block; vertical-align: middle; fill: currentColor; }
.topbar-ir { position: relative; font-weight: 600; }
.topbar-ir > a { color: #fff; }
.topbar-ir > a:hover { color: var(--esi-green-light); }
.topbar-drop {
  position: absolute; top: 100%; right: 0; min-width: 260px; z-index: 200; background: #fff; border: 1px solid var(--border);
  border-top: 3px solid var(--esi-green); box-shadow: var(--shadow); padding: var(--sp-2) 0; display: none; flex-direction: column;
}
.topbar-ir:hover .topbar-drop, .topbar-ir:focus-within .topbar-drop { display: flex; }
.topbar-drop a { color: var(--gray-800); padding: .45rem 1rem; font-size: .85rem; font-weight: 500; }
.topbar-drop a:hover { color: var(--esi-green-dark); background: var(--bg-alt); }
.langswitch { display: inline-flex; gap: .25rem; align-items: center; }
.langswitch a { padding: .1rem .45rem; border-radius: 0; font-weight: 600; text-transform: uppercase; font-size: .78rem; color: var(--gray-300); }
.langswitch a[aria-current] { background: var(--esi-green); color: #fff; }
@media (max-width: 700px) { .topbar-ir, .topbar .ticker { display: none; } }

.site-header { position: relative; z-index: 1; background: #fff; border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: var(--sp-5); }
.brand-row { display: flex; align-items: center; gap: var(--sp-4); }
.brand img { height: 50px; width: auto; }
.euronext-badge { height: 52px; width: auto; border-left: 1px solid var(--border); padding-left: var(--sp-4); }
@media (max-width: 600px) { .euronext-badge { display: none; } }

.mainnav ul { list-style: none; display: flex; gap: var(--sp-2); margin: 0; padding: 0; }
.mainnav li { position: relative; margin: 0; }
.mainnav a { display: block; padding: .65rem .9rem; color: var(--gray-800); font-weight: 600; font-size: .96rem; border-radius: var(--radius); }
.mainnav a:hover, .mainnav [aria-current] > a, .mainnav .is-active > a { color: var(--esi-green-dark); }
@media (min-width: 901px) {
  .mainnav > ul > li > a { position: relative; }
  .mainnav > ul > li > a::before { content: ""; position: absolute; left: .9rem; right: .9rem; bottom: .25rem; height: 2px; background: var(--esi-green-logo); transform: scaleX(0); transform-origin: left; transition: transform .2s; }
  .mainnav > ul > li:hover > a::before, .mainnav > ul > li.is-active > a::before { transform: scaleX(1); }
}
.mainnav .has-children > a::after { content: " ▾"; color: var(--gray-400); font-size: .8em; }
.mainnav .submenu {
  position: absolute; top: 100%; left: 0; min-width: 220px; background: #fff; border: 1px solid var(--border);
  border-top: 3px solid var(--esi-green); box-shadow: var(--shadow); padding: var(--sp-2) 0; display: none; flex-direction: column; z-index: 50;
}
.mainnav .has-children:hover .submenu, .mainnav .has-children:focus-within .submenu { display: flex; }
.mainnav .submenu a { padding: .5rem 1rem; font-weight: 500; }
.mainnav .submenu a:hover { background: var(--bg-alt); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: .5rem; color: var(--esi-green); }
.nav-toggle svg { width: 28px; height: 28px; }
.mainnav .nav-ir { display: none; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .mainnav { position: absolute; top: var(--header-h); left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); display: none; max-height: calc(100vh - var(--topbar-h) - var(--header-h)); overflow-y: auto; }
  .mainnav.is-open { display: block; }
  .mainnav ul { flex-direction: column; gap: 0; padding: var(--sp-3); }
  .mainnav .submenu { position: static; display: flex; border: 0; box-shadow: none; padding: 0 0 0 var(--sp-4); }
  .mainnav .nav-ir { display: block; border-top: 1px solid var(--border); margin-top: var(--sp-2); }
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { background: var(--gray-900); color: var(--gray-300); }
.site-footer a { color: var(--gray-300); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--sp-6); padding: var(--sp-7) 0 var(--sp-6); }
.site-footer h2 { color: #fff; font-size: 1rem; margin-bottom: var(--sp-3); font-family: var(--font-body); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .5rem; }
.footer-brand img.logo { height: 52px; width: auto; margin-bottom: var(--sp-3); filter: brightness(0) invert(1); }
.footer-award img { height: 90px; width: auto; margin-top: var(--sp-4); background: #fff; padding: 4px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; color: var(--gray-400); padding: var(--sp-4) 0; display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); align-items: center; }
.footer-bottom .spacer { flex: 1; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* ── Heroes ─────────────────────────────────────────────────────────────── */
.hero { position: relative; color: #fff; background: var(--gray-900); display: flex; align-items: center; min-height: 460px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.hero .container { position: relative; z-index: 2; padding-block: var(--sp-8); }
.hero h1, .hero .eyebrow, .hero .hero-sub, .hero .lead { text-shadow: 0 2px 14px rgba(0,0,0,.55), 0 1px 3px rgba(0,0,0,.5); color: #fff; }
.hero h1 { max-width: min(820px, 94%); }
.hero .hero-sub { font-size: 1.1rem; max-width: min(640px, 92%); margin: 0; }
.hero--page { min-height: 420px; }
.hero--home { min-height: calc(100vh - var(--header-h) - var(--topbar-h)); }
/* photo heroes (news, projects): busy pictures and long titles — a dark gradient behind the
   text, a smaller heading, the text at the bottom of the picture */
.hero--photo { align-items: flex-end; }
.hero--photo::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,0) 75%); }
.hero--photo .container { padding-block: var(--sp-7) var(--sp-6); }
.hero--photo h1 { font-size: clamp(1.6rem, 1.15rem + 1.6vw, 2.3rem); max-width: 900px; }
.hero--home h1 { font-size: clamp(2.2rem, 1.4rem + 3vw, 3.4rem); }
.hero-slider .slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease; }
.hero-slider .slide.is-active { opacity: 1; }
.hero-slider .slide img { width: 100%; height: 100%; object-fit: cover; }
.page-head { background: var(--bg-alt); padding-block: var(--sp-6); border-bottom: 1px solid var(--border); }
.page-head h1 { margin: 0; }
.page-head .meta { color: var(--text-muted); margin: var(--sp-2) 0 0; }
@media (max-width: 560px) { .hero { min-height: 340px; } .hero--page { min-height: 300px; } }

/* ── Content (sanitized page bodies) ────────────────────────────────────── */
.content { font-size: 1.05rem; }
.content > :last-child { margin-bottom: 0; }
.content h2 { margin-top: var(--sp-6); }
.content h2:first-child, .content h3:first-child { margin-top: 0; }
.content h3 { margin-top: var(--sp-5); }
.content a { text-decoration: underline; text-underline-offset: 2px; }
.content figure { margin: var(--sp-5) 0; }
.content img { border-radius: var(--radius); }
.content video { width: 100%; border-radius: var(--radius); margin: var(--sp-5) 0; background: #000; }
.content mark.review { background: #fff3b0; padding: 0 .15em; }
.article { padding-block: var(--sp-6) var(--sp-7); }
.article .content { max-width: var(--container-narrow); margin: 0 auto; }
.article--plain { background: #f2f3f7; }
.back-link { display: inline-block; margin-top: var(--sp-6); font-weight: 600; }
.back-link::before { content: "← "; }

/* Tables: horizontal scroll on phones, quiet grid, readable cells. A first row of
   bold/strong cells (the old editor never used <th>) reads as a header. */
.table-wrap { overflow-x: auto; margin: 0 0 var(--sp-5); border: 1px solid var(--border); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
/* no fixed minimum width: narrow tables wrap their text; only wide ones scroll */
.table-wrap table { border-collapse: collapse; width: 100%; margin: 0; font-size: .97rem; }
.table-wrap td, .table-wrap th { min-width: 5.5rem; }
.table-wrap td, .table-wrap th, .table-wrap td *, .table-wrap th * { overflow-wrap: anywhere; }
.content p, .content li { overflow-wrap: break-word; }
@media (max-width: 560px) { .table-wrap td, .table-wrap th { padding: .55rem .6rem; font-size: .92rem; } }
.table-wrap td, .table-wrap th { padding: .65rem .9rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:nth-child(even) td { background: #fafafa; }
.table-wrap th, .table-wrap tr.is-head td { background: var(--esi-green-tint); color: var(--esi-green-dark); font-weight: 700; }
.table-wrap td p { margin: 0; }
.table-wrap td p + p { margin-top: .35rem; }

/* File links inside text (page bodies, admin texts) become download buttons, with the same
   download icon as .doc-btn, drawn by CSS since the text is stored HTML (PM 2026-10-23) */
.content :is(a[href$=".pdf" i], a[href$=".zip" i], a[href$=".doc" i], a[href$=".docx" i], a[href$=".xls" i], a[href$=".xlsx" i]):not(.doc-btn, .chip) {
  display: inline-flex; align-items: center; gap: .45rem; margin: .3rem 0; background: var(--esi-green); color: #fff;
  text-decoration: none; font-weight: 600; font-size: .9rem; padding: .45rem .85rem; border-radius: var(--radius); line-height: 1.2;
}
.content :is(a[href$=".pdf" i], a[href$=".zip" i], a[href$=".doc" i], a[href$=".docx" i], a[href$=".xls" i], a[href$=".xlsx" i]):not(.doc-btn, .chip)::before {
  content: ""; flex: none; width: 15px; height: 15px; background: currentColor;
  -webkit-mask: var(--ico-download) center / contain no-repeat; mask: var(--ico-download) center / contain no-repeat;
}
.content :is(a[href$=".pdf" i], a[href$=".zip" i], a[href$=".doc" i], a[href$=".docx" i], a[href$=".xls" i], a[href$=".xlsx" i]):not(.doc-btn, .chip):hover { background: var(--esi-green-dark); color: #fff; }

/* Stat boxes (.tavola) — Chi Siamo intro and Sostenibilità highlights */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); margin: var(--sp-5) 0 0; }
.tavola { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5) var(--sp-3); text-align: center; }
.tavola p { margin: 0; }
.tavola p:first-child { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--esi-green); line-height: 1.1; margin-bottom: .3rem; }
@media (max-width: 760px) { .stats-row { grid-template-columns: 1fr 1fr; } }

/* ── Cards, grids ───────────────────────────────────────────────────────── */
.card-grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { position: relative; background: #fff; border: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; transition: background .2s; color: var(--text); }
.card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; z-index: 1; background: var(--esi-green); transform: scaleX(0); transform-origin: left; transition: transform .25s; }
.card:hover { background: var(--bg-alt); color: var(--text); }
.card:hover::before, .card:focus-visible::before { transform: scaleX(1); }
.card .thumb img { transition: transform .5s; }
.card:hover .thumb img { transform: scale(1.04); }
.card .thumb { aspect-ratio: 16/10; background: var(--bg-alt); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; }
.card .cat { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--esi-green-dark); font-weight: 700; }
.card h3 { font-size: 1.08rem; margin: 0; font-family: var(--font-body); }
.card time { font-size: .82rem; color: var(--text-muted); }

/* Home intro */
.intro-grid { display: grid; grid-template-columns: 1fr 2.4fr; gap: var(--sp-6); align-items: start; }
.intro-aside .eyebrow { font-size: 1.4rem; letter-spacing: .06em; }
.intro-lead { font-size: 1.25rem; color: var(--gray-800); margin-bottom: var(--sp-6); max-width: 60ch; }
.intro-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
.intro-card img { width: 100%; height: auto; margin-bottom: var(--sp-4); border-radius: var(--radius); }
.intro-card h2 { font-size: 1.5rem; margin-bottom: var(--sp-3); }
.intro-card p { color: var(--text-muted); }
@media (max-width: 880px) { .intro-grid, .intro-cards { grid-template-columns: 1fr; } }

/* Video bands (home "Con la luce portiamo diritti", sustainability Burundi) */
.video-band { position: relative; color: #fff; text-align: center; padding-block: var(--sp-8); min-height: 62vh; display: flex; flex-direction: column; justify-content: center; background: var(--gray-900); overflow: hidden; }
.video-band > img.band-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-band::before { content: ""; position: absolute; inset: 0; background: rgba(8,18,10,.5); z-index: 1; }
.video-band .container { position: relative; z-index: 2; }
.video-band h2, .video-band p, .video-band em { color: #fff; }
.video-band h2 { font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem); }
.play {
  margin: var(--sp-4) auto 0; width: 84px; height: 84px; border-radius: 0; background: rgba(0,0,0,.28); border: 3px solid #fff;
  cursor: pointer; display: grid; place-items: center; transition: background .2s, transform .2s;
}
.play:hover { background: var(--esi-green); border-color: var(--esi-green); }
.play svg { width: 42px; height: 42px; fill: #fff; margin-left: 5px; }
.band-caption { position: relative; z-index: 2; background: #3aa63f; font-size: .8rem; text-align: center; }
.band-caption p { margin: .3rem 0; color: #fff; }
.band-caption a { color: #fff; text-decoration: underline; }

/* Green "Con la luce portiamo i diritti" band (Chi Siamo) */
.diritti-band { background: var(--esi-green-band); color: #fff; text-align: center; padding-block: var(--sp-7); }
.diritti-band img { margin: 0 auto var(--sp-4); max-width: 140px; }
.diritti-band h2 { color: #fff; }
.diritti-band p { color: #fff; max-width: 60ch; margin-inline: auto; }

/* Values */
.valori { display: grid; gap: var(--sp-5); grid-template-columns: repeat(4, 1fr); }
.valore { text-align: center; padding: var(--sp-4); }
.valore img { width: 76px; height: 76px; object-fit: contain; margin: 0 auto var(--sp-3); }
.valore h4 { color: var(--esi-green-dark); margin-bottom: var(--sp-2); }
.valore h4:first-child:has(img) { margin: 0; }
.valore p { color: var(--text-muted); font-size: .95rem; }
@media (max-width: 880px) { .valori { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .valori { grid-template-columns: 1fr; } }

/* People (management, board, auditors): three cards per row, a shorter last row centred
   (5 = 3 + 2); one line per role, links as small chips */
.people { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-5); margin-top: var(--sp-5); }
.people--section { margin-bottom: var(--sp-8); }
.person {
  flex: 0 1 calc((100% - 2 * var(--sp-5)) / 3); min-width: 230px;
  position: relative; background: #fff; border: 1px solid var(--border);
  padding: var(--sp-5); text-align: center; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; transition: background .2s;
}
.person::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--esi-green); transform: scaleX(0); transform-origin: left; transition: transform .25s; }
.person:hover { background: #fcfdfc; }
.person:hover::before { transform: scaleX(1); }
.person h3 { color: var(--heading); font-size: 1.15rem; margin: 0 0 .35rem; }
.person .role { color: var(--gray-600); line-height: 1.45; margin: 0; font-size: .95rem; }
.person .links { margin-top: auto; padding-top: var(--sp-5); display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; font-weight: 600; line-height: 1;
  padding: .45rem .7rem; border-radius: 0; border: 1px solid var(--border); color: var(--gray-700); background: #fff;
}
.chip:hover { border-color: var(--heading); color: #fff; background: var(--heading); }
.chip .ico { width: 15px; height: 15px; }
.section-head + .people { margin-top: 0; }
@media (max-width: 560px) { .person { flex-basis: 100%; } }

/* Timeline (Come nasce ESI Spa): the old two-column table, green spine on the left column */
.timeline .table-wrap { border: 0; }
.timeline table { min-width: 0; max-width: 880px; margin: 0 auto; }
.timeline td { border: 0 !important; background: transparent !important; padding: var(--sp-3) var(--sp-4); vertical-align: middle; }
.timeline td:first-child { border-right: 8px solid #51b84c !important; text-align: right; width: 30%; }
.timeline td:first-child img { display: inline-block; max-height: 70px; max-width: 150px; width: auto; height: auto; object-fit: contain; }
.timeline h2 { font-size: 1.3rem; margin: .2rem 0 .4rem; }

/* Activity photo band (EPC / System Integrator) */
.photo-band { position: relative; min-height: 50vh; display: flex; align-items: center; color: #fff; background: var(--gray-900); overflow: hidden; }
.photo-band > img.band-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-band::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.25); z-index: 1; }
.photo-band .container { position: relative; z-index: 2; text-align: center; padding-block: var(--sp-8); }
.photo-band p { max-width: 700px; margin: 0 auto; font-size: 1.5rem; line-height: 1.5; color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,.55); }
.cta-box { max-width: var(--container-narrow); margin: 0 auto; text-align: center; background: var(--esi-green-tint); border: 0; border-left: 4px solid var(--esi-green); border-radius: var(--radius-lg); padding: var(--sp-7) var(--sp-5); }
.cta-box p { margin: .2rem 0; }
.cta-box a { display: inline-block; margin-top: var(--sp-4); background: var(--esi-green); color: #fff; font-weight: 700; padding: .8rem 1.8rem; border-radius: var(--radius); text-transform: uppercase; letter-spacing: .04em; font-size: .9rem; text-decoration: none; }
.cta-box a:hover { background: var(--esi-green-dark); color: #fff; }

/* ── Case History ───────────────────────────────────────────────────────── */
.filterbar { display: flex; gap: var(--sp-2); justify-content: center; margin-bottom: var(--sp-5); flex-wrap: wrap; }
.filterbar a { font-weight: 700; font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500); padding: .55rem 1.1rem; border-bottom: 3px solid transparent; }
.filterbar a:hover { color: var(--esi-green-dark); }
.filterbar a[aria-current] { color: var(--esi-green-dark); border-bottom-color: var(--esi-green); }
.project-grid { display: grid; gap: 6px; grid-template-columns: repeat(3, 1fr); }
.tile { position: relative; overflow: hidden; aspect-ratio: 4/3; display: block; background: var(--gray-900); --tile-t: .45s cubic-bezier(.25,.8,.25,1); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.25,.8,.25,1); }
/* The text stays anchored at the bottom: on hover the shade deepens and the button grows in
   under the title (height + opacity), so nothing jumps, in either direction. */
.tile .overlay {
  position: absolute; inset: 0; z-index: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  text-align: center; padding: var(--sp-5) var(--sp-4); color: #fff;
}
.tile .overlay::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(10,20,12,.85) 0%, rgba(10,20,12,.45) 45%, rgba(10,20,12,0) 75%);
  opacity: .85; transition: opacity var(--tile-t);
}
.tile .overlay h3 { color: #fff; margin: 0 0 .2rem; font-size: 1.1rem; font-family: var(--font-body); }
.tile .overlay .date { font-size: .85rem; color: rgba(255,255,255,.9); }
/* "Scopri di più": the same "go to" button as .btn--ghost, in white — a chevron that nudges
   right while the tile is hovered, and a white fill when the pointer is on the button itself. */
.tile .overlay .more {
  display: inline-flex; align-items: center; gap: .5rem;
  max-height: 0; margin-top: 0; opacity: 0; transform: translateY(6px); overflow: hidden;
  border: 2px solid #fff; border-width: 0 2px; padding: 0 1rem; border-radius: 0; color: #fff;
  font-weight: 700; font-size: .8rem; line-height: 1.2; text-transform: uppercase; letter-spacing: .04em;
  transition: max-height var(--tile-t), margin-top var(--tile-t), padding var(--tile-t), border-width var(--tile-t), opacity var(--tile-t), transform var(--tile-t), background .18s, color .18s;
}
.tile .overlay .more::after {
  content: ""; flex: none; width: .45em; height: .45em; margin-right: .1em;
  border: solid currentColor; border-width: 2px 2px 0 0; transform: rotate(45deg); transition: transform .25s;
}
.tile:hover .overlay .more::after, .tile:focus-visible .overlay .more::after { transform: translateX(3px) rotate(45deg); }
.tile .overlay .more:hover { background: #fff; color: var(--esi-green-dark); }
.tile:hover img, .tile:focus-visible img { transform: scale(1.05); }
.tile:hover .overlay::before, .tile:focus-visible .overlay::before { opacity: 1; }
.tile:hover .overlay .more, .tile:focus-visible .overlay .more {
  max-height: 3rem; margin-top: var(--sp-3); padding: .55rem 1rem; border-width: 2px; opacity: 1; transform: none;
}
@media (prefers-reduced-motion: reduce) { .tile img, .tile .overlay::before, .tile .overlay .more { transition: none; } }
@media (max-width: 820px) { .project-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .project-grid { grid-template-columns: 1fr; } .tile .overlay .more { display: none; } }
.project-map { height: 460px; width: 100%; border-radius: var(--radius-lg); overflow: hidden; position: relative; z-index: 0; border: 1px solid var(--border); background: #f4f7f5; }
.project-map.leaflet-container { background: #f4f7f5; font: inherit; }
.project-map .leaflet-tooltip { font-weight: 600; }
.map-eyebrow { text-align: center; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-size: .8rem; font-weight: 700; margin: 0 0 var(--sp-4); }
@media (max-width: 600px) { .project-map { height: 360px; } }

/* Single project */
.specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); margin: 0 0 var(--sp-6); }
.spec { background: var(--bg-alt); border-radius: var(--radius); padding: var(--sp-4) var(--sp-5); line-height: 1.4; }
.spec dt { color: var(--esi-green-logo); font-weight: 700; font-size: 1.02rem; margin-bottom: .25rem; }
.spec dd { margin: 0; }
.figures { display: flex; flex-wrap: wrap; gap: var(--sp-5) var(--sp-7); margin: 0 0 var(--sp-6); }
.figure { display: flex; align-items: center; gap: var(--sp-4); }
.figure img { width: 56px; height: auto; }
.figure .label { display: block; color: var(--gray-700); }
.figure .value { display: block; font-family: var(--font-display); font-size: 2rem; line-height: 1.1; color: var(--esi-green-logo); font-weight: 700; }
@media (max-width: 640px) { .specs { grid-template-columns: 1fr; } }
.project-body { max-width: var(--container-narrow); }
.gallery-grid { display: grid; gap: 6px; grid-template-columns: repeat(4, 1fr); margin: var(--sp-6) 0; }
.gallery-grid a { aspect-ratio: 1/1; overflow: hidden; display: block; background: var(--bg-alt); cursor: zoom-in; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.gallery-grid a:hover img { transform: scale(1.07); }
@media (max-width: 760px) { .gallery-grid { grid-template-columns: 1fr 1fr; } }
/* Google map / YouTube video behind the cookie choice (partials/embed.php) */
.embed-consent { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); background: #eaeef0; min-height: 320px; display: grid; place-items: center; text-align: center; padding: var(--sp-5); margin-top: var(--sp-6); }
.embed-consent .embed-msg { display: none; }
.embed-consent[data-state="pending"] .embed-msg[data-for="pending"], .embed-consent[data-state="no"] .embed-msg[data-for="no"] { display: block; }
@media (min-width: 760px) { .embed-consent--map { min-height: 0; aspect-ratio: 16/7; } .embed-consent--video { min-height: 0; aspect-ratio: 16/9; } }
/* a loaded video keeps its own shape on phones too (no letterbox in the 320px message box) */
.embed-consent--video[data-state="loaded"] { min-height: 0; aspect-ratio: 16/9; padding: 0; background: #000; border-color: #000; }
.embed-consent p { max-width: 46ch; color: var(--gray-700); font-size: .92rem; }
.embed-consent iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Lightbox + video modal */
.lightbox, .video-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(8,12,9,.92); display: flex; align-items: center; justify-content: center; padding: var(--sp-5); }
.lightbox[hidden], .video-modal[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: var(--radius); }
.lb-btn { position: absolute; background: rgba(255,255,255,.12); border: 0; color: #fff; cursor: pointer; width: 54px; height: 54px; border-radius: 0; display: grid; place-items: center; font-size: 28px; line-height: 1; }
.lb-btn:hover { background: rgba(255,255,255,.28); }
.lb-close { top: 20px; right: 24px; width: 46px; height: 46px; font-size: 24px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.85); font-size: .9rem; }
.video-modal__inner { width: 100%; max-width: 980px; }
.video-modal video { width: 100%; max-height: 84vh; border-radius: var(--radius); background: #000; }

/* ── Investor Relations ─────────────────────────────────────────────────── */
.ir-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: var(--sp-7); align-items: start; }
.ir-side { position: sticky; top: calc(var(--topbar-h) + var(--header-h) + 1rem); font-size: .92rem; }
.ir-side h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-family: var(--font-body); margin-bottom: var(--sp-2); }
.ir-side ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.ir-side li { margin: 0; }
.ir-side a { display: block; padding: .35rem .9rem; color: var(--gray-700); margin-left: -2px; border-left: 2px solid transparent; }
.ir-side a:hover { color: var(--esi-green-dark); }
.ir-side a[aria-current] { color: var(--esi-green-dark); border-left-color: var(--esi-green); font-weight: 600; }
@media (max-width: 960px) { .ir-layout { grid-template-columns: minmax(0, 1fr); } .ir-side { position: static; } }
.ir-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
.ir-card { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--esi-green); border-radius: var(--radius); padding: var(--sp-4) var(--sp-5); }
.ir-card h3 { margin: 0 0 .25rem; font-size: 1.12rem; font-family: var(--font-body); }
.ir-card p { margin: 0; font-size: .9rem; color: var(--text-muted); }
.ir-card p a { color: var(--gray-600); }
@media (max-width: 760px) { .ir-grid { grid-template-columns: 1fr; } }
.ir-notice { background: var(--bg-alt); border-left: 3px solid var(--gray-300); padding: var(--sp-3) var(--sp-4); font-size: .9rem; color: var(--gray-600); margin-bottom: var(--sp-5); }

/* Document lists: one row per document — date, title, one button per file */
.docs { margin: 0 0 var(--sp-7); }
.docs-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.docs-head h2 { margin: 0; }
.docs-search { flex: 0 1 280px; padding: .55rem .8rem; border: 1px solid var(--gray-300); border-radius: var(--radius); font: inherit; font-size: .95rem; }
.docs-empty { color: var(--text-muted); font-style: italic; }
.docs-year { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: var(--sp-3); background: #fff; }
.docs-year > summary {
  cursor: pointer; list-style: none; padding: .8rem 1rem; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700;
  display: flex; align-items: center; gap: var(--sp-3); color: var(--heading);
}
.docs-year > summary::-webkit-details-marker { display: none; }
.docs-year > summary::after { content: ""; margin-left: auto; width: 10px; height: 10px; border-right: 2px solid var(--gray-500); border-bottom: 2px solid var(--gray-500); transform: rotate(45deg); transition: transform .2s; }
.docs-year[open] > summary::after { transform: rotate(-135deg); }
.docs-year .count { font-family: var(--font-body); font-size: .8rem; font-weight: 600; color: var(--text-muted); background: var(--bg-alt); padding: .1rem .6rem; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.docs-year .doc-list { border-top: 1px solid var(--border); }
.doc { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; gap: var(--sp-2) var(--sp-4); align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--gray-100); margin: 0; }
.doc:last-child { border-bottom: 0; }
.doc:hover { background: #fafcfa; }
.doc time { font-variant-numeric: tabular-nums; color: var(--esi-green-dark); font-weight: 600; font-size: .92rem; }
.doc .doc-title { line-height: 1.45; }
.doc-files { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: flex-end; }
.doc-btn {
  display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; background: var(--esi-green); color: #fff;
  font-weight: 700; font-size: .85rem; padding: .5rem .8rem; border: 2px solid var(--esi-green); line-height: 1.2; transition: background .18s, color .18s, border-color .18s;
}
.doc-btn:hover { background: var(--esi-green-dark); border-color: var(--esi-green-dark); color: #fff; }
.doc-btn small { font-weight: 400; opacity: .85; }
.doc-btn--en { background: #fff; color: var(--esi-green-dark); }
.doc-btn--en:hover { background: var(--esi-green-dark); border-color: var(--esi-green-dark); color: #fff; }
.doc-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.doc-list--undated .doc { grid-template-columns: minmax(0, 1fr) auto; }
.doc.is-hidden, .docs-year.is-hidden { display: none; }
@media (max-width: 640px) {
  .doc, .doc-list--undated .doc { grid-template-columns: 1fr; gap: .3rem; }
  .doc-files { justify-content: flex-start; }
}
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--sp-4); }
.cert { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-5) var(--sp-4); text-align: center; background: #fff; }
.cert strong { display: block; margin-bottom: var(--sp-3); color: var(--gray-700); font-size: 1.05rem; }

/* Disclaimer (Documento di Ammissione): download only after accepting */
.gate { margin-top: var(--sp-6); padding: var(--sp-5); border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-alt); }
.gate label { display: flex; gap: var(--sp-3); align-items: flex-start; font-weight: 600; cursor: pointer; }
.gate input { width: 20px; height: 20px; margin-top: .2rem; accent-color: var(--esi-green); }
.gate .doc-btn[aria-disabled="true"] { background: var(--gray-300); color: var(--gray-600); pointer-events: none; }

/* Contacts */
.contact-2col { display: grid; grid-template-columns: 1.05fr .95fr; gap: var(--sp-6); align-items: stretch; }
.contact-2col .content h2 { font-size: 1.4rem; }
.contact-photo { margin: 0; border-radius: var(--radius-lg); overflow: hidden; min-height: 320px; }
.contact-photo img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; }
@media (max-width: 760px) { .contact-2col { grid-template-columns: 1fr; } }

/* News article */
.news-meta { color: var(--text-muted); margin-bottom: var(--sp-5); }
.attachments { margin-top: var(--sp-6); }

/* Cookie banner: bottom of the screen, both choices equally visible, × = reject */
.consent {
  position: fixed; z-index: 900; left: 50%; bottom: var(--sp-4); transform: translateX(-50%);
  width: min(960px, calc(100% - 2 * var(--sp-4))); background: #fff; border: 1px solid var(--border);
  border-top: 3px solid var(--esi-green); box-shadow: 0 10px 40px rgba(0,0,0,.16); padding: var(--sp-5) var(--sp-6) var(--sp-5) var(--sp-5);
  font-size: .93rem; display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2) var(--sp-5); align-items: center;
}
.consent[hidden] { display: none; }
.consent__title { grid-column: 1 / -1; font-weight: 700; color: var(--heading); margin: 0; }
.consent p { margin: 0; }
.consent a { text-decoration: underline; }
.consent__actions { display: flex; gap: var(--sp-3); }
.consent__actions .btn { min-width: 8.5rem; }
.consent__close { position: absolute; top: .4rem; right: .5rem; background: none; border: 0; font-size: 1.6rem; line-height: 1; color: var(--gray-500); cursor: pointer; padding: .2rem .45rem; }
.consent__close:hover { color: var(--heading); background: var(--bg-alt); }
@media (max-width: 700px) {
  .consent { grid-template-columns: 1fr; bottom: 0; width: 100%; padding: var(--sp-5) var(--sp-4); }
  .consent__actions .btn { flex: 1; min-width: 0; }
}
.footer-link { background: none; border: 0; padding: 0; font: inherit; color: var(--gray-300); cursor: pointer; }
.footer-link:hover { color: #fff; text-decoration: underline; }

/* ── Error page (404) ─────────────────────────────────────────────────── */
.error-page { position: relative; overflow: hidden; padding-block: clamp(3rem, 8vw, 6rem); background: var(--bg-alt); border-bottom: 1px solid var(--border); }
.error-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--sp-7); align-items: start; position: relative; }
.error-main { position: relative; z-index: 1; }
.error-code {
  position: absolute; z-index: -1; top: -.18em; left: -.05em; margin: 0; pointer-events: none;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(7rem, 4rem + 14vw, 15rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 2px rgba(2, 146, 45, .16);
}
.error-main h1 { margin-top: var(--sp-2); }
.error-main .lead { font-size: 1.15rem; color: var(--gray-600); max-width: 52ch; margin-bottom: var(--sp-6); }
.error-links { background: #fff; border: 1px solid var(--border); border-top: 3px solid var(--esi-green); padding: var(--sp-5) var(--sp-6); }
.error-links h2 { font-size: .8rem; font-family: var(--font-body); text-transform: uppercase; letter-spacing: .12em; color: var(--text-muted); margin: 0 0 var(--sp-3); }
.error-links ul { list-style: none; margin: 0; padding: 0; }
.error-links li { margin: 0; border-top: 1px solid var(--gray-100); }
.error-links li:first-child { border-top: 0; }
.error-links a { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: .7rem 0; color: var(--heading); font-weight: 600; }
.error-links a::after { content: ""; flex: none; width: .45em; height: .45em; border: solid currentColor; border-width: 2px 2px 0 0; transform: rotate(45deg); transition: transform .18s; color: var(--esi-green); }
.error-links a:hover { color: var(--esi-green-dark); }
.error-links a:hover::after { transform: translateX(3px) rotate(45deg); }
@media (max-width: 820px) { .error-grid { grid-template-columns: 1fr; gap: var(--sp-6); } }
