/* BEC Sagl - template responsive (ricostruzione del layout originale) */
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 300; font-display: swap; src: url('../Fonts/lato-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 400; font-display: swap; src: url('../Fonts/lato-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 700; font-display: swap; src: url('../Fonts/lato-latin-700-normal.woff2') format('woff2'); }

:root {
  --red: #cd0019;
  --red-2: #dc2b19;
  --yellow: #f2ea0c;
  --dark: #333;
  --darker: #262626;
  --grey: #f2f2f2;
  --text: #1a1a1a;
  --muted: #666;
  --container: 1170px;
  --header-h: 110px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); }
a:hover { color: var(--red-2); }
h1, h2, h3, h4 { font-weight: 400; line-height: 1.2; margin: 0 0 .6em; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.35rem; color: var(--red); }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
li { margin-bottom: .25em; }
strong, b { font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: #fff; padding: 8px 14px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }

/* Pulsanti */
.btn {
  display: inline-block; padding: 10px 22px; border: 2px solid transparent; border-radius: 0;
  font: inherit; font-weight: 400; font-size: 1.05rem; line-height: 1.3; text-decoration: none;
  cursor: pointer; transition: background-color .2s, color .2s, border-color .2s;
}
.btn-yellow { background: var(--yellow); color: #000; }
.btn-yellow:hover, .btn-yellow:focus { background: var(--red); color: #fff; }
.btn-outline { background: transparent; border-color: #999; color: var(--text); }
.btn-outline:hover { border-color: var(--red); color: var(--red); }
.btn-lg { padding: 12px 28px; font-size: 1.15rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #fff url('../Images/header-transparent.jpg') center / cover no-repeat;
  border-bottom: 3px solid var(--red);
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 24px; }
.logo { flex: 0 0 auto; display: block; padding: 10px 0; }
.logo img { width: auto; height: 90px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.main-nav li { margin: 0; }
.main-nav a {
  display: block; padding: 10px 28px; color: #000; text-decoration: none;
  text-transform: uppercase; font-size: 1.1rem; letter-spacing: .03em; position: relative;
}
.main-nav a::after {
  content: ''; position: absolute; left: 28px; right: 28px; bottom: 4px; height: 2px;
  background: var(--red); transform: scaleX(0); transition: transform .2s;
}
.main-nav a:hover, .main-nav .active > a { color: var(--red); }
.main-nav a:hover::after, .main-nav .active > a::after { transform: scaleX(1); }
.nav-toggle { display: none; }

@media (max-width: 991px) {
  :root { --header-h: 76px; }
  .logo img { height: 60px; }
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 46px; height: 46px; padding: 10px; background: #fff; border: 1px solid #ddd; cursor: pointer;
  }
  .nav-toggle-bar { display: block; height: 3px; background: var(--red); transition: transform .2s, opacity .2s; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(4) { transform: translateY(-8px) rotate(-45deg); }
  .main-nav {
    position: absolute; left: 0; right: 0; top: 100%; background: #fff;
    border-bottom: 3px solid var(--red); box-shadow: 0 8px 16px rgba(0,0,0,.12);
    display: none;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; padding: 8px 0; }
  .main-nav a { padding: 14px 24px; border-top: 1px solid #eee; }
  .main-nav a::after { display: none; }
}

/* Banner pagine interne */
.banner {
  position: relative; display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 342px; padding: 40px 16px;
  background: var(--dark) center / cover no-repeat;
}
.banner::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.28); }
.banner h1 {
  position: relative; margin: 0; color: #fff; font-weight: 400;
  font-size: clamp(1.6rem, 4.5vw, 3.6rem); text-shadow: 0 2px 8px rgba(0,0,0,.45);
}
.banner-plain { min-height: 200px; background: var(--red); }
.banner-plain::before { display: none; }
@media (max-width: 767px) { .banner { min-height: 180px; } }

/* Breadcrumb */
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; margin: 0; padding: 14px 0 0; font-size: .8rem; text-transform: uppercase; }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: '/'; margin: 0 .5em; color: #aaa; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--red); }
.breadcrumb [aria-current] { color: var(--red); }

/* Sezioni */
.section { padding: 40px 0; }
.section-main .frame { margin-bottom: 30px; }
.section-main .frame:last-child { margin-bottom: 0; }
.frame-layout-1 { text-align: center; font-size: 1.15rem; max-width: 900px; margin-left: auto; margin-right: auto; }
.frame-layout-1 h2, .frame-layout-1 h3 { color: var(--red); }
.section-main .frame-type-textmedia header h2, .section-main .frame-type-text header h2 { color: var(--red); font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.3rem); }

/* Hero / slider home */
.hero { position: relative; min-height: clamp(380px, 62vh, 640px); background: var(--dark); overflow: hidden; }
.hero-slide {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center;
  background: center / cover no-repeat; opacity: 0; transition: opacity 1s ease; padding: 0 16px 60px;
}
.hero-slide.is-active { opacity: 1; z-index: 1; }
.hero-text { max-width: 900px; text-align: center; background: rgba(0,0,0,.45); padding: 24px 28px; color: #fff; }
.hero-text h1, .hero-text .h1 { font-size: clamp(1.5rem, 3.4vw, 2.6rem); font-weight: 400; margin: 0 0 18px; color: #fff; }
.hero-text p { color: #fff; }

/* Banda rossa punti di forza */
.usp-band { background: var(--red); color: #fff; padding: 26px 0; font-size: 1.25rem; }
.usp-band ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 24px; }
.usp-band li { margin: 0; display: flex; align-items: center; justify-content: center; gap: 10px; text-align: left; }
.usp-band li::before {
  content: ''; flex: 0 0 26px; height: 26px; background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.6 14.6-4.2-4.2 1.4-1.4 2.8 2.8 6-6 1.4 1.4-7.4 7.4z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.6 14.6-4.2-4.2 1.4-1.4 2.8 2.8 6-6 1.4 1.4-7.4 7.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.usp-band p { margin: 0; text-align: center; }
@media (max-width: 767px) {
  .usp-band ul { grid-template-columns: 1fr; }
  .usp-band li { justify-content: flex-start; }
}

/* Box in griglia */
.section-boxes { padding: 50px 0; }
.box-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.box { display: flex; flex-direction: column; text-align: center; background: #fff; }
.box-media { aspect-ratio: 3 / 2; overflow: hidden; background: var(--grey); }
.box-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.box:hover .box-media img { transform: scale(1.04); }
.box-text { display: flex; flex-direction: column; align-items: center; flex: 1; padding: 22px 10px 10px; }
.box-text h3 { color: var(--text); font-size: 1.8rem; font-weight: 300; }
.box-text p { font-size: .95rem; }
.box-text .btn { margin-top: auto; }
@media (max-width: 991px) { .box-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 599px) { .box-grid { grid-template-columns: 1fr; } }

/* Call to action */
.cta-band { background: var(--grey); text-align: center; padding: 60px 0; font-size: 1.15rem; }
.cta-band h2 { color: var(--red); font-size: clamp(1.6rem, 3.6vw, 2.6rem); font-weight: 700; }
.cta-band .btn { margin-top: 8px; }
.cta-photo {
  background: #333 url('../Images/background-servizi.jpg') center / cover no-repeat fixed;
  color: #fff; padding: 100px 0; position: relative;
}
.cta-photo::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.cta-photo .container { position: relative; }
.cta-photo h2 { color: #fff; font-weight: 400; }
@media (max-width: 991px) { .cta-photo { background-attachment: scroll; padding: 60px 0; } }

/* fluid_styled_content: testo + immagini affiancate, responsive */
.ce-textpic.ce-right.ce-intext.ce-nowrap, .ce-textpic.ce-left.ce-intext.ce-nowrap { display: flex; gap: 40px; align-items: flex-start; }
.ce-textpic.ce-right.ce-intext.ce-nowrap { flex-direction: row-reverse; }
.ce-textpic.ce-nowrap .ce-gallery { flex: 0 0 48%; margin: 0 !important; float: none !important; }
.ce-textpic.ce-nowrap .ce-bodytext { flex: 1; overflow: visible !important; }
.ce-gallery figure { margin: 0; }
.ce-gallery .ce-row { display: flex; gap: 10px; margin-bottom: 10px; }
.ce-gallery .ce-column { flex: 1; margin: 0 !important; float: none !important; }
.ce-gallery img { width: 100%; height: auto; }
.ce-gallery a.lightbox { display: block; overflow: hidden; }
.ce-gallery a.lightbox img { transition: transform .3s; }
.ce-gallery a.lightbox:hover img { transform: scale(1.04); }
.ce-gallery[data-ce-columns="4"] .ce-column img, .ce-gallery[data-ce-columns="3"] .ce-column img, .ce-gallery[data-ce-columns="2"] .ce-column img { aspect-ratio: 4 / 3; object-fit: cover; }
.image-caption { font-size: .85rem; color: var(--muted); padding-top: 4px; }
@media (max-width: 991px) {
  .ce-textpic.ce-nowrap { flex-direction: column !important; }
  .ce-textpic.ce-right.ce-nowrap { flex-direction: column-reverse !important; }
  .ce-textpic.ce-nowrap .ce-gallery { flex-basis: auto; width: 100%; }
}
@media (max-width: 599px) {
  .ce-gallery[data-ce-columns="4"] .ce-row, .ce-gallery[data-ce-columns="3"] .ce-row { flex-wrap: wrap; }
  .ce-gallery[data-ce-columns="4"] .ce-column, .ce-gallery[data-ce-columns="3"] .ce-column { flex: 0 0 calc(50% - 5px); }
}

/* Contatti */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: stretch; }
.contact-card { background: var(--grey); padding: 30px; }
.contact-card h3 { margin-top: 0; }
.contact-card .btn { margin-top: 10px; }
.contact-list { list-style: none; padding: 0; margin: 0 0 20px; }
.contact-list li { margin-bottom: 8px; }
@media (max-width: 767px) { .contact-grid { grid-template-columns: 1fr; } }

/* Contenuti esterni con consenso (mappe, video) */
.consent-embed { position: relative; min-height: 380px; background: #e9e9e9; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.consent-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.consent-embed .consent-placeholder p { max-width: 420px; margin: 0 auto 14px; font-size: .95rem; }
.consent-embed.is-loaded .consent-placeholder { display: none; }

/* Mappa del sito */
.frame-type-menu_sitemap ul { list-style: none; padding-left: 0; }
.frame-type-menu_sitemap ul ul { padding-left: 1.4em; }
.frame-type-menu_sitemap a { text-decoration: none; }

/* Footer */
.site-footer { background: var(--dark); color: #fff; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; padding-top: 40px; padding-bottom: 40px; }
.site-footer h2 { color: #fff; font-size: 1.2rem; text-transform: uppercase; border-bottom: 1px solid #777; padding-bottom: 10px; margin-bottom: 16px; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--yellow); }
.site-footer .claim { text-transform: uppercase; font-weight: 700; font-size: .85rem; }
.copyright { background: var(--darker); padding: 16px 0; font-size: .85rem; }
.copyright-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.copyright nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.copyright a { text-decoration: none; }
@media (max-width: 767px) { .footer-grid { grid-template-columns: 1fr; } .footer-col:empty { display: none; } }

.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 44px; height: 44px; background: var(--red);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.to-top::before { content: ''; position: absolute; left: 15px; top: 18px; width: 12px; height: 12px; border-left: 3px solid #fff; border-top: 3px solid #fff; transform: rotate(45deg); }
.to-top.is-visible { opacity: 1; pointer-events: auto; }

/* Banner cookie */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90; display: flex; justify-content: center; }
.cookie-banner[hidden] { display: none; }
.cookie-inner {
  max-width: 820px; width: 100%; background: #fff; border-top: 4px solid var(--red);
  box-shadow: 0 6px 30px rgba(0,0,0,.25); padding: 20px 24px; display: flex; gap: 20px; align-items: center;
}
.cookie-inner p { margin: 0; font-size: .92rem; }
.cookie-actions { display: flex; gap: 10px; flex: 0 0 auto; }
@media (max-width: 767px) {
  .cookie-inner { flex-direction: column; align-items: stretch; }
  .cookie-actions { flex-direction: column-reverse; }
  .cookie-actions .btn { width: 100%; text-align: center; }
}

/* Lightbox */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; }
.lb img { max-width: 92vw; max-height: 86vh; width: auto; }
.lb button { position: absolute; background: rgba(255,255,255,.12); border: 0; color: #fff; font-size: 2rem; width: 52px; height: 52px; cursor: pointer; line-height: 1; }
.lb button:hover { background: var(--red); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #ccc; font-size: .9rem; }

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