/* ============================================================
   D.E.F. Srl — foglio di stile
   Colori e caratteri: sezione :root qui sotto
   ============================================================ */
:root {
  --red: #e02b20;
  --red-dark: #b9221a;
  --ink: #1d2126;
  --text: #3a4049;
  --muted: #6b737e;
  --line: #e4e6ea;
  --soft: #f4f5f7;
  --dark: #16191d;
  --white: #fff;
  --rgb: linear-gradient(90deg, #e02b20 0 33.3%, #2fa84f 33.3% 66.6%, #1f5fbf 66.6%);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Sora', 'Manrope', system-ui, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .08);
  --wrap: 1200px;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.65; color: var(--text); background: var(--white); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red-dark); }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.2; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.center { text-align: center; margin-top: 2.5rem; }
.muted { color: var(--muted); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46em; }
.kicker { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: .8rem; }

.btn { display: inline-flex; align-items: center; gap: .5em; padding: .8em 1.5em; border-radius: 999px; background: var(--red); color: var(--white); font-weight: 700; font-size: .95rem; text-decoration: none; border: 2px solid var(--red); transition: background .2s, color .2s, transform .2s; }
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); color: var(--white); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--white); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.site-header::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--rgb); opacity: .9; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand img { width: auto; height: 46px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav > ul { display: flex; gap: .25rem; align-items: center; }
.site-nav a, .sub-toggle { display: flex; align-items: center; gap: .35em; padding: .55em .85em; border-radius: 8px; color: var(--ink); font: 600 .95rem var(--font); text-decoration: none; background: none; border: 0; cursor: pointer; }
.site-nav a:hover, .sub-toggle:hover { background: var(--soft); color: var(--ink); }
.site-nav .is-active > a, .site-nav .is-active > .sub-toggle { color: var(--red); }
.sub-toggle svg { width: 11px; height: 8px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .2s; }
.has-sub { position: relative; }
.sub { position: absolute; top: calc(100% + 26px); left: 0; min-width: 270px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: .5rem; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .18s; }
.sub::before { content: ''; position: absolute; left: 0; right: 0; top: -28px; height: 28px; }
.has-sub:hover .sub, .has-sub.is-open .sub { opacity: 1; visibility: visible; transform: none; }
.has-sub:hover .sub-toggle svg, .has-sub.is-open .sub-toggle svg { transform: rotate(180deg); }
.sub a { font-weight: 500; }
.sub a[aria-current] { color: var(--red); }
.menu-toggle { display: none; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; padding: 10px; }
.menu-toggle span { display: block; height: 2px; background: var(--ink); margin: 5px 0; transition: .25s; }

@media (max-width: 960px) {
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--white); }
  .menu-toggle { display: block; }
  .site-nav { position: fixed; inset: var(--header-h) 0 0 0; background: var(--white); padding: 1rem 24px 2rem; overflow-y: auto; transform: translateX(100%); transition: transform .3s ease; }
  .nav-open .site-nav { transform: none; }
  .site-nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav a, .sub-toggle { width: 100%; padding: .9em .5em; font-size: 1.1rem; border-bottom: 1px solid var(--line); border-radius: 0; justify-content: space-between; }
  .sub { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 1rem; display: none; min-width: 0; }
  .has-sub.is-open .sub { display: block; }
  .sub::before { display: none; }
  .has-sub:hover .sub-toggle svg { transform: none; }
  .has-sub.is-open .sub-toggle svg { transform: rotate(180deg); }
  .nav-open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-open { overflow: hidden; }
}

/* ---------- Hero / slider home ---------- */
.hero { position: relative; background: radial-gradient(1200px 500px at 85% 20%, #fdecea 0, transparent 60%), linear-gradient(180deg, #f7f8fa, #eef0f3); overflow: hidden; }
.slides { display: grid; }
.slide { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .8s ease, visibility .8s; }
.slide.is-active { opacity: 1; visibility: visible; }
.slide-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; min-height: min(440px, 70vh); padding-top: 2.5rem; padding-bottom: 4rem; }
.slide-text h2 { font-size: clamp(2rem, 4.4vw, 3.3rem); margin-bottom: .4em; }
.slide-text p { font-size: 1.15rem; color: var(--muted); max-width: 30em; margin-bottom: 1.8rem; }
.slide-media img { width: auto; max-width: 100%; max-height: 220px; margin: 0 auto; object-fit: contain; border-radius: var(--radius); filter: drop-shadow(0 14px 24px rgba(16, 24, 40, .14)); }
.slide.is-active .slide-text > * { animation: rise .8s both; }
.slide.is-active .slide-text > :nth-child(2) { animation-delay: .08s; }
.slide.is-active .slide-text > :nth-child(3) { animation-delay: .16s; }
.slide.is-active .slide-text > :nth-child(4) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero-dots { position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%); display: flex; gap: .6rem; }
.hero-dots button { width: 34px; height: 4px; border-radius: 4px; border: 0; padding: 0; background: rgba(29, 33, 38, .2); cursor: pointer; position: relative; overflow: hidden; }
.hero-dots button::before { content: ''; position: absolute; inset: -10px 0; }
.hero-dots button.is-active { background: var(--red); }
@media (max-width: 800px) {
  .slide-inner { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 2rem; text-align: left; }
  .slide-media { order: -1; }
  .slide-media img { max-height: 140px; }
}
@media (prefers-reduced-motion: reduce) { .slide, .slide.is-active .slide-text > * { transition: none; animation: none; } }

/* ---------- Sezioni ---------- */
.section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section-tight { padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 6vw, 5rem); }
.section-soft { background: var(--soft); }
.section-dark { background: var(--dark); color: #c9ced6; }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-head { max-width: 760px; margin-bottom: 2.5rem; }
.h-line { display: flex; align-items: center; gap: 1rem; font-size: 1.35rem; margin-bottom: 1.5rem; }
.h-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.page-hero { background: linear-gradient(180deg, #f7f8fa, #fff); padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2.5rem); border-bottom: 1px solid var(--line); }
.page-hero h1 { margin-bottom: .4em; }
.page-hero .lead { margin-bottom: 0; }
.back { display: inline-block; font-weight: 600; font-size: .92rem; text-decoration: none; margin-bottom: 1rem; }

.cards-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 980px) { .cards-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .cards-4, .cards-3 { grid-template-columns: 1fr; } }

.feature { padding: 1.75rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); transition: box-shadow .2s, transform .2s; }
.feature:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.feature-num { display: block; font: 700 .85rem var(--font-head); color: var(--red); margin-bottom: 1rem; }
.feature h3 { margin-bottom: .4em; }
.feature p { margin: 0; color: var(--muted); font-size: .97rem; }

.course { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; text-decoration: none; background: #23272d; border: 1px solid #2c3138; transition: transform .2s, border-color .2s; }
.course img { width: 100%; height: 140px; object-fit: contain; padding: 1.25rem 2.5rem; background: var(--white); }
.course::after { content: none; }
.course span { display: block; padding: 1.1rem 1.4rem 1.3rem; color: #c9ced6; }
.course strong { display: block; font: 700 1.25rem var(--font-head); color: var(--white); }
.course:hover { border-color: var(--red); transform: translateY(-2px); }
.course:hover { color: var(--white); }

/* ---------- Gallerie ---------- */
.gallery-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; }
.gcard { position: relative; display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; text-decoration: none; background: #ddd; }
.gcard img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.gcard::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, .75)); }
.gcard-title, .gcard-count { position: absolute; left: 1.25rem; right: 1.25rem; z-index: 1; color: var(--white); }
.gcard-title { bottom: 2.6rem; font: 700 1.2rem/1.25 var(--font-head); }
.gcard-count { bottom: 1.1rem; font-size: .85rem; opacity: .8; }
.gcard:hover img { transform: scale(1.05); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.photo { display: block; border-radius: 10px; overflow: hidden; aspect-ratio: 400 / 516; background: var(--soft); }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s, opacity .3s; }
.photo:hover img { transform: scale(1.04); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10, 12, 14, .94); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: calc(100vw - 120px); max-height: calc(100vh - 100px); border-radius: 6px; }
.lightbox button { position: absolute; background: rgba(255, 255, 255, .08); border: 0; color: var(--white); cursor: pointer; border-radius: 50%; width: 52px; height: 52px; font-size: 2rem; line-height: 1; }
.lightbox button:hover { background: rgba(255, 255, 255, .2); }
.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: 18px; left: 50%; transform: translateX(-50%); color: #aab; font-size: .9rem; }
@media (max-width: 700px) { .lightbox img { max-width: 100vw; } .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; } }

/* ---------- Articoli ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.post-card { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); transition: box-shadow .2s, transform .2s; }
.post-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); color: var(--text); }
.post-card-img { aspect-ratio: 16 / 9; overflow: hidden; background: var(--soft); }
.post-card-img img { width: 100%; height: 100%; object-fit: contain; }
.post-card-body { display: flex; flex-direction: column; padding: 1.4rem 1.5rem 1.6rem; }
.post-meta { font-size: .82rem; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.post-card-title { font: 700 1.15rem/1.3 var(--font-head); color: var(--ink); margin: .5rem 0 .6rem; }
.post-card-text { font-size: .95rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.chips a { padding: .45em 1em; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; }
.chips a small { color: var(--muted); font-weight: 500; }
.chips a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.chips a[aria-current] small { color: #c9ced6; }
.article-hero .post-meta a { color: var(--muted); }
.article-cover { margin: 0 0 2rem; }
.article-cover img { width: 100%; border-radius: var(--radius); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding-bottom: 4rem; }
.post-nav a { display: block; padding: 1.2rem 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); font-weight: 600; }
.post-nav a:hover { border-color: var(--red); }
.post-nav small { display: block; color: var(--muted); font-weight: 500; margin-bottom: .25rem; }
.post-nav .next { text-align: right; }
@media (max-width: 700px) { .post-nav { grid-template-columns: 1fr; } }

/* ---------- Testi ---------- */
.prose { color: var(--text); }
.prose-narrow { max-width: 820px; margin-left: auto; margin-right: auto; }
.prose h2 { font-size: 1.5rem; margin-top: 2.2rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.8rem; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose figure { margin: 2rem 0 .5rem; }
.prose figure img { border-radius: 10px; margin: 0 auto; }
.prose .caption { font-size: .9rem; color: var(--muted); text-align: center; margin-bottom: 2rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .95rem; }
.prose td, .prose th { border: 1px solid var(--line); padding: .5em .7em; }
.legal h2 { font-size: 1.15rem; }
.address { font-size: 1.1rem; }

.check-list { list-style: none; padding: 0 !important; }
.check-list li { position: relative; padding-left: 1.8em; }
.check-list li::before { content: ''; position: absolute; left: 0; top: .55em; width: .9em; height: .5em; border-left: 2px solid var(--red); border-bottom: 2px solid var(--red); transform: rotate(-45deg); }
.tag-list { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.5rem; }
.tag-list li { margin: 0; padding: .4em .9em; background: var(--soft); border-radius: 999px; font-size: .92rem; font-weight: 600; color: var(--ink); }

/* Schede (Chi siamo) */
.tabs { padding-top: 2rem; padding-bottom: 5rem; }
.tab-list { display: flex; flex-wrap: wrap; gap: .5rem; border-bottom: 1px solid var(--line); margin-bottom: 2.5rem; }
.tab-list button { font: 700 1rem var(--font); color: var(--muted); background: none; border: 0; padding: .9em 1.1em; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab-list button[aria-selected="true"] { color: var(--ink); border-color: var(--red); }
.tab-panel { max-width: 860px; animation: rise .4s both; }

/* Due colonne testo + mappa */
.split { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.map { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: #e9ecef url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 20h40M20 0v40' stroke='%23dde1e6' stroke-width='1'/%3E%3C/svg%3E"); }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-load { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; border: 0; background: none; cursor: pointer; font: 700 1.05rem var(--font); color: var(--ink); }
.map-load::before { content: ''; width: 46px; height: 46px; border-radius: 50% 50% 50% 0; background: var(--red); transform: rotate(-45deg); margin-bottom: .6rem; box-shadow: inset 0 0 0 14px var(--red), inset 0 0 0 24px #fff; }
.map-load small { font-weight: 500; color: var(--muted); font-size: .85rem; max-width: 26em; text-align: center; }

/* Corsi */
.programs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.program { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); transition: box-shadow .2s, transform .2s; }
.program:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: var(--ink); }
.program img { width: 100%; height: 110px; object-fit: contain; padding: 1rem 1.5rem; background: var(--white); border-bottom: 1px solid var(--line); }
.program-name { font: 700 1.05rem var(--font-head); padding: .9rem 1rem .1rem; }
.program-cta { font-size: .85rem; color: var(--red); font-weight: 700; padding: 0 1rem 1rem; }
.program.is-disabled .program-cta { color: var(--muted); }
.calendar { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.cal-month { background: var(--white); border-radius: var(--radius); padding: 1.4rem 1.5rem; border: 1px solid var(--line); }
.cal-month h3 { font-size: 1.1rem; color: var(--red); margin-bottom: .8rem; }
.cal-month ul { list-style: none; margin: 0; padding: 0; }
.cal-month li { display: flex; flex-direction: column; padding: .7rem 0; border-top: 1px solid var(--line); font-size: .93rem; color: var(--muted); }
.cal-month li strong { color: var(--ink); font-size: 1rem; }

/* Documentazione */
.doc-groups { display: grid; gap: 2.5rem; max-width: 900px; }
.doc-group h2 { font-size: 1.3rem; }
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.doc-list a { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 600; transition: border-color .2s, background .2s; }
.doc-list a:hover { border-color: var(--red); background: #fff8f7; color: var(--ink); }
.doc-icon { flex: none; width: 44px; height: 52px; border-radius: 6px; background: var(--red); color: var(--white); font: 800 .72rem var(--font); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; clip-path: polygon(0 0, 70% 0, 100% 22%, 100% 100%, 0 100%); }
.doc-name { flex: 1; }
.doc-size { color: var(--muted); font-size: .85rem; font-weight: 500; white-space: nowrap; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: #a9b0ba; font-size: .95rem; }
.site-footer a { color: #e6e9ed; }
.site-footer a:hover { color: var(--white); }
.footer-grid { display: grid; grid-template-columns: repeat(5, auto); justify-content: space-between; gap: 2rem; padding-top: 4rem; padding-bottom: 3rem; }
.footer-grid h2, .footer-grid p { white-space: nowrap; }
.footer-grid h2 { color: var(--white); font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 1rem; }
.footer-brand-top { display: flex; align-items: center; gap: .9rem; margin-bottom: .9rem; }
.footer-logo { flex: none; width: 84px; background: var(--white); padding: 8px 10px; border-radius: 10px; }
.footer-brand p { margin: 0; line-height: 1.7; white-space: nowrap; }
.footer-brand strong { color: var(--white); font-weight: 700; font-size: 1.05rem; }
.partners { display: flex; flex-wrap: wrap; gap: .6rem; }
.footer-grid .h-partner { margin-top: 1.5rem; }
.partners .logo-smarthub { height: 76px; }
.partners-stack { flex-direction: column; align-items: flex-start; }
.partners-stack img { height: 44px; }
.footer-grid .lbl { display: inline-block; width: 3.2em; }
.partners img { height: 52px; width: auto; border-radius: 8px; background: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .08); padding: 1.3rem 0; font-size: .85rem; }
.footer-bottom .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; }
@media (max-width: 1100px) { .footer-grid { grid-template-columns: repeat(3, 1fr); justify-content: stretch; } .footer-grid .footer-col:first-child { grid-column: 1 / -1; } }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* Elenco articoli: tutte righe uguali, il primo ha l'etichetta "In evidenza" */
.post-feat { display: grid; grid-template-columns: 200px 1fr; gap: 1.75rem; align-items: center; padding: 1.4rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.post-feat-img { display: block; aspect-ratio: 16 / 10; background: var(--soft); border-radius: 10px; overflow: hidden; }
.post-feat-img img { width: 100%; height: 100%; object-fit: contain; }
.post-feat-body, .post-feat-head { display: block; }
.post-feat-title { display: block; font: 700 1.25rem/1.3 var(--font-head); color: var(--ink); margin: .3rem 0 .4rem; transition: color .2s; }
.post-feat-text { display: block; color: var(--muted); }
.post-more { display: none; }
.post-row { display: grid; grid-template-columns: 200px 1fr; gap: 1.75rem; align-items: center; padding: 1.4rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.post-row-img { display: block; aspect-ratio: 16 / 10; background: var(--soft); border-radius: 10px; overflow: hidden; }
.post-row-img img { width: 100%; height: 100%; object-fit: contain; }
.post-row-body { display: block; }
.post-row-title { display: block; font: 700 1.25rem/1.3 var(--font-head); color: var(--ink); margin: .3rem 0 .4rem; transition: color .2s; }
.post-row-text { display: block; color: var(--muted); }
.post-row:hover .post-row-title, .post-feat:hover .post-feat-title { color: var(--red); }
@media (max-width: 760px) {
  .post-feat { grid-template-columns: 110px 1fr; gap: 1rem; }
  .post-feat-text { display: none; }
  .post-row { grid-template-columns: 110px 1fr; gap: 1rem; }
  .post-row-text { display: none; }
}

/* Banner cookie e mappe */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: var(--white); border-top: 3px solid var(--red); box-shadow: 0 -20px 40px -20px rgba(16, 24, 40, .35); padding: 1.25rem 0 calc(1.25rem + env(safe-area-inset-bottom, 0px)); font-size: 1.02rem; line-height: 1.55; }
.cookie-banner[hidden] { display: none; }
.cookie-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.cookie-inner p { margin: 0; max-width: 46rem; }
.cookie-inner .cookie-title { font: 700 1.3rem var(--font-head); color: var(--ink); margin-bottom: .3rem; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.cookie-actions .btn { min-width: 130px; justify-content: center; }
body.has-banner { padding-bottom: 200px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: #e6e9ed; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--white); }
.legal .btn { margin: .5rem 0; }
.table-wrap { overflow-x: auto; }
.legal th { text-align: left; background: var(--soft); }
@media (max-width: 600px) {
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1 1 0; min-width: 0; }
  body.has-banner { padding-bottom: 300px; }
}

/* Contatti */
.contact-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: 3rem; align-items: start; }
.contact-side { order: -1; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } .contact-side { order: 0; } }
.contact-form { position: relative; display: grid; gap: 1.3rem; padding: clamp(1.4rem, 4vw, 2.2rem); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: border-color .3s, transform .4s cubic-bezier(.2, .7, .2, 1), box-shadow .4s; }
.contact-form:focus-within { border-color: rgba(224, 43, 32, .45); }
.contact-form { overflow: hidden; }
.contact-form > :not(.hp) { position: relative; z-index: 1; }
.contact-form::before { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 30%), rgba(224, 43, 32, .12), transparent 60%); opacity: 0; transition: opacity .4s; }
.contact-form:hover::before, .contact-form:focus-within::before { opacity: 1; }
@media (hover: hover) { .contact-form:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(16, 24, 40, .06), 0 24px 48px -18px rgba(16, 24, 40, .28); } }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.field span { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .45rem; }
.field input, .field textarea { width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--soft); border: 1px solid transparent; border-bottom: 2px solid var(--line); border-radius: 8px 8px 0 0; padding: .75rem .85rem; outline: none; transition: border-color .25s, background .25s; }
.field textarea { resize: vertical; min-height: 150px; line-height: 1.5; }
.field input:focus, .field textarea:focus { background: var(--white); border-color: var(--line); border-bottom-color: var(--red); }
.check { display: flex; align-items: flex-start; gap: .7rem; font-size: .95rem; cursor: pointer; }
.check input { flex: none; width: 20px; height: 20px; margin: .15rem 0 0; accent-color: var(--red); cursor: pointer; }
.contact-send { justify-self: start; margin-top: .3rem; cursor: pointer; font-family: var(--font); }
.contact-note { margin: 0; font-size: .85rem; color: var(--muted); }
.contact-errors { border-left: 3px solid var(--red); background: #fff4f3; padding: .9rem 1.2rem; margin-bottom: 1.4rem; border-radius: 0 10px 10px 0; color: var(--ink); }
.contact-errors p { margin: .2rem 0; }
.contact-done { padding: clamp(1.6rem, 4vw, 2.6rem); border: 1px solid var(--line); border-left: 4px solid #2fa84f; border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.contact-done h2 { font-size: 1.5rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-card { padding: clamp(1.4rem, 4vw, 2rem); background: var(--soft); border-radius: var(--radius); }
.contact-card h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.contact-list { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: .55rem; }
.contact-list li { display: flex; }
.contact-list .lbl { flex: none; width: 3.6em; color: var(--muted); }
.contact-card .map { aspect-ratio: 4 / 3; }
.contact-more { margin: 1rem 0 0; font-weight: 700; }
.contact-more a { text-decoration: none; }

/* Effetto 3D: articoli, copertine delle gallerie e foto si inclinano seguendo il mouse */
.post-card, .gcard, .photo { position: relative; will-change: transform; box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 10px 24px -14px rgba(16, 24, 40, .35); transition: transform .45s cubic-bezier(.2, .7, .2, 1), box-shadow .3s; }
.post-card.tilt-on, .gcard.tilt-on, .photo.tilt-on { transition: transform .12s ease-out, box-shadow .3s; }
.post-card:hover, .gcard:hover, .photo:hover { box-shadow: 0 2px 4px rgba(16, 24, 40, .08), 0 30px 50px -20px rgba(16, 24, 40, .5); }
.post-card::before, .gcard::before, .photo::before { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .32), transparent 55%); opacity: 0; transition: opacity .3s; }
.post-card:hover::before, .gcard:hover::before, .photo:hover::before { opacity: 1; }

/* Immagini degli articoli su fondo bianco (niente bande grigie intorno alle immagini piccole) */
.post-card-img, .post-row-img, .post-feat-img { background: var(--white); }
.post-row-img, .post-feat-img { border: 1px solid var(--line); }

.field-hint { display: block; margin-top: .35rem; font-size: .82rem; color: var(--muted); }

/* Slide con screenshot (E-mobility): più grande del normale */
.slide-media img.is-shot { max-height: 320px; border-radius: 12px; border: 1px solid rgba(16, 24, 40, .08); }
@media (max-width: 800px) { .slide-media img.is-shot { max-height: 210px; } }

/* Corsi: calendario in allestimento */
.cal-soon { background: #fff; border: 1px solid var(--line, #e6e8eb); border-radius: var(--radius); padding: 2rem 2.2rem; max-width: 46rem; }
.cal-soon h3 { color: var(--red, #e02b20); margin-bottom: .5rem; }
.cal-soon p { color: var(--muted); margin: 0; }

/* Footer allineato: i titoli delle colonne stanno all'altezza di "Dal 1995:" e i testi partono alla riga di "Progettazione elettronica" */
@media (min-width: 1101px) {
  .footer-brand-top { height: 40px; }
  .footer-grid .footer-col > h2:first-child { height: 40px; display: flex; align-items: center; margin-bottom: .9rem; }
}
