/* Autofficina MA.CLA. — foglio di stile del sito.
   Idea: il reparto officina. Antracite delle tute da lavoro, giallo della bandiera a scacchi del logo,
   bianco intonaco delle pareti; il rosso e il blu dei ponti li portano le fotografie. */

@font-face { font-family: "Barlow Condensed"; src: url(font/barlow-condensed-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(font/barlow-condensed-latin-800-normal.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(font/barlow-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(font/barlow-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --ink: #15171a;          /* antracite */
  --ink-2: #2a2e33;
  --text: #22252a;
  --muted: #5d636b;
  --paper: #f4f3ef;        /* intonaco */
  --white: #ffffff;
  --line: #dcdad3;
  --yellow: #f2c400;       /* bandiera del logo */
  --yellow-dark: #c99f00;
  --on-dark: #e9eaec;
  --on-dark-muted: #a9aeb5;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 6px;
  --cc-accent: #15171a;    /* bottoni del banner cookie */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--paper); color: var(--text); font: 400 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.02; letter-spacing: .005em; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(34px, 5vw, 52px); text-transform: uppercase; }
h3 { font-size: 23px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
p { margin: 0 0 1em; max-width: 64ch; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.eyebrow { font: 600 15px/1.2 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 22px; height: 10px; background: conic-gradient(var(--ink) 25%, var(--yellow) 0 50%, var(--ink) 0 75%, var(--yellow) 0) 0 0 / 10px 10px; }
.dark .eyebrow { color: var(--on-dark-muted); }
.dark .eyebrow::before { background: conic-gradient(var(--white) 25%, var(--yellow) 0 50%, var(--white) 0 75%, var(--yellow) 0) 0 0 / 10px 10px; }
.section { padding-block: clamp(64px, 9vw, 112px); }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(32px, 4vw, 48px); }
.section-head p { color: var(--muted); font-size: 18px; margin: 0; }
.dark { background: var(--ink); color: var(--on-dark); }
.dark .section-head p { color: var(--on-dark-muted); }
.white { background: var(--white); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--yellow); color: var(--ink); padding: 8px 14px; z-index: 100; font-weight: 600; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* bande a scacchi: una sola idea grafica, ripetuta con parsimonia */
.checker { height: 16px; background: conic-gradient(var(--ink) 25%, var(--yellow) 0 50%, var(--ink) 0 75%, var(--yellow) 0) 0 0 / 16px 16px; }

/* bottoni */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 24px; border-radius: var(--radius); font: 600 19px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .15s; }
.btn:active { transform: translateY(1px); }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-yellow:hover { background: #ffd31a; }
.btn-line { border-color: currentColor; color: inherit; background: transparent; }
.btn-line:hover { background: rgba(255,255,255,.08); }
.white .btn-line:hover, .section:not(.dark) .btn-line:hover { background: rgba(0,0,0,.05); }
.btn svg { width: 20px; height: 20px; flex: none; }

/* avviso del pannello (ferie, chiusure): striscia gialla sopra la testata */
.avviso { background: var(--yellow); color: var(--ink); text-align: center; font: 600 17px/1.35 var(--body); padding: 10px var(--gutter); }

/* testata del sito */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: rgba(21,23,26,.96); backdrop-filter: blur(6px); color: var(--on-dark); border-bottom: 1px solid rgba(255,255,255,.06); }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand img { height: 58px; width: auto; }   /* logo-scuro.webp: bordo bianco per leggerlo sull'antracite */
@media (max-width: 520px) { .brand img { height: 50px; } }
.brand span { font: 800 20px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; display: none; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { font: 600 17px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; padding: 10px 12px; border-radius: var(--radius); color: var(--on-dark-muted); }
.nav a:hover { color: var(--white); background: rgba(255,255,255,.06); }
.top .btn { min-height: 42px; padding: 0 16px; font-size: 17px; white-space: nowrap; flex: none; }
.nav a { white-space: nowrap; }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; color: var(--white); width: 46px; height: 46px; cursor: pointer; border-radius: var(--radius); }
.menu-btn svg { width: 28px; height: 28px; }
@media (max-width: 1080px) {
  .brand span { display: inline; }
  .menu-btn { display: inline-grid; place-items: center; }
  .top .btn { margin-left: 0; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; background: var(--ink); padding: 8px var(--gutter) 18px; border-bottom: 1px solid rgba(255,255,255,.08); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 14px 4px; font-size: 20px; border-bottom: 1px solid rgba(255,255,255,.06); border-radius: 0; }
}
@media (max-width: 520px) { .brand span { display: none; } }
@media (max-width: 420px) { .top .btn .lbl { display: none; } .top .btn { padding: 0 12px; } }

/* apertura */
.hero { background: var(--ink); color: var(--on-dark); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); min-height: min(640px, calc(100svh - 72px)); }
.hero-text { padding: clamp(48px, 7vw, 96px) var(--gutter) clamp(48px, 6vw, 80px) max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter))); display: flex; flex-direction: column; justify-content: center; }
.hero h1 { font-size: clamp(44px, 6.4vw, 84px); text-transform: uppercase; color: var(--white); margin-bottom: 22px; }
.hero h1 em { font-style: normal; color: var(--yellow); }
.hero .lead { font-size: clamp(18px, 1.6vw, 20px); color: var(--on-dark); max-width: 46ch; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.hero-photo { position: relative; margin: 0; min-height: 320px; }
.hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 40% 55%; }
.hero-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--ink) 0, rgba(21,23,26,0) 22%); pointer-events: none; }
.badge-mctc { position: absolute; right: clamp(16px, 3vw, 32px); bottom: clamp(16px, 3vw, 32px); background: var(--yellow); color: var(--ink); padding: 14px 18px; border-radius: var(--radius); font: 800 20px/1.05 var(--display); text-transform: uppercase; letter-spacing: .03em; box-shadow: 0 10px 30px rgba(0,0,0,.35); z-index: 1; }
.badge-mctc small { display: block; font-weight: 600; font-size: 14px; letter-spacing: .1em; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-photo { order: -1; aspect-ratio: 16 / 10; min-height: 0; }
  .hero-photo::after { background: linear-gradient(0deg, var(--ink) 0, rgba(21,23,26,0) 30%); }
  .hero-text { padding: 28px var(--gutter) 52px; }
}
.facts { background: var(--ink-2); color: var(--on-dark); }
.facts ul { list-style: none; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.facts li { padding: 22px 18px 22px 0; display: flex; gap: 12px; align-items: center; font: 600 18px/1.15 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.facts li + li { border-left: 1px solid rgba(255,255,255,.1); padding-left: 18px; }
.facts svg { width: 30px; height: 30px; color: var(--yellow); flex: none; }
@media (max-width: 860px) { .facts ul { grid-template-columns: 1fr 1fr; } .facts li:nth-child(3) { border-left: 0; padding-left: 0; } .facts li:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.1); } }

/* chi siamo */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.about-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.about-photos figure { margin: 0; overflow: hidden; border-radius: var(--radius); }
.about-photos figure:first-child { grid-column: 1 / -1; }
.about-photos img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.about-photos figcaption { font-size: 14px; color: var(--muted); padding-top: 8px; }
.about h2 { margin-bottom: 20px; }
.about .big { font-size: 20px; color: var(--text); }
.parking { margin-top: 24px; padding: 18px 20px; border-left: 4px solid var(--yellow); background: var(--white); border-radius: 0 var(--radius) var(--radius) 0; }
.parking h3 { margin-bottom: 6px; font-size: 20px; }
.parking p { margin: 0; color: var(--muted); }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }

/* servizi */
.services { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.service { background: var(--white); padding: 26px 24px 28px; display: grid; grid-template-rows: auto auto 1fr; gap: 10px; min-width: 0; }
.service svg { width: 38px; height: 38px; color: var(--ink); }
.service svg .y { color: var(--yellow-dark); }
.service h3 { font-size: 22px; }
.service p { margin: 0; color: var(--muted); font-size: 16px; }
.service-cta { background: var(--yellow); color: var(--ink); text-decoration: none; grid-template-rows: auto 1fr auto; }
.service-cta p { color: var(--ink-2); }
.service-cta .more { font: 600 18px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; display: inline-flex; gap: 8px; align-items: center; }
.service-cta .more::after { content: "→"; transition: transform .15s; }
.service-cta:hover .more::after { transform: translateX(4px); }
@media (min-width: 600px) { .service-cta { grid-column: span 2; } }
@media (max-width: 599px) {
  .service { grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 16px; row-gap: 4px; padding: 18px 18px 20px; }
  .service svg { grid-row: 1 / 3; width: 34px; height: 34px; }
  .service h3 { font-size: 20px; align-self: end; }
  .service-cta { grid-template-columns: 1fr; }
}

/* revisioni */
.mctc { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 72px); align-items: center; }
.mctc figure { margin: 0; position: relative; }
.mctc figure img { border-radius: var(--radius); width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.mctc h2 { color: var(--white); margin-bottom: 18px; }
.mctc h2 span { color: var(--yellow); }
.mctc ul { list-style: none; padding: 0; margin: 4px 0 28px; display: grid; gap: 10px; }
.mctc li { display: flex; gap: 12px; align-items: baseline; }
.mctc li::before { content: ""; width: 10px; height: 10px; background: var(--yellow); flex: none; transform: translateY(-1px); }
.mctc .actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 860px) { .mctc { grid-template-columns: 1fr; } }

/* galleria */
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.gallery button { all: unset; cursor: zoom-in; display: block; position: relative; overflow: hidden; border-radius: var(--radius); background: var(--ink); aspect-ratio: 3 / 2; }
.gallery button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease, opacity .3s; }
.gallery button:hover img { transform: scale(1.04); opacity: .9; }
.gallery button:nth-child(1), .gallery button:nth-child(8) { grid-column: span 2; grid-row: span 2; }
@media (max-width: 860px) { .gallery { grid-template-columns: 1fr 1fr; } .gallery button:nth-child(8) { grid-column: auto; grid-row: auto; } .gallery button:nth-child(1), .gallery button:last-child { grid-column: 1 / -1; grid-row: auto; } }

/* visore delle foto */
.lightbox { border: 0; padding: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: rgba(10,11,13,.94); color: var(--white); }
.lightbox::backdrop { background: rgba(10,11,13,.94); }
.lightbox .stage { position: absolute; inset: 56px 64px 72px; display: grid; place-items: center; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; touch-action: pan-y; user-select: none; }
.lightbox .cap { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; font-size: 16px; color: var(--on-dark-muted); padding-inline: 16px; }
.lightbox .cap b { color: var(--white); font-weight: 600; }
.lb-btn { position: absolute; background: rgba(255,255,255,.08); border: 0; color: var(--white); width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.lb-btn:hover { background: rgba(255,255,255,.18); }
.lb-btn svg { width: 26px; height: 26px; }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) { .lightbox .stage { inset: 56px 8px 72px; } .lb-prev, .lb-next { top: auto; bottom: 10px; transform: none; } }

/* marchi */
.brands { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr)); gap: 12px; }
@media (max-width: 599px) { .brands { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; } .brands li { padding: 8px; } .brands img { max-height: 40px; } }
.brands li { list-style: none; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); display: grid; place-items: center; padding: 16px; aspect-ratio: 4 / 3; }
.brands img { max-height: 56px; width: auto; max-width: 100%; filter: grayscale(1); opacity: .8; transition: filter .2s, opacity .2s; }
.brands li:hover img { filter: none; opacity: 1; }
.brands-all { margin-top: 28px; color: var(--muted); font-size: 15px; line-height: 1.9; max-width: none; }
.brands-all b { color: var(--text); font-weight: 600; }

/* dicono di noi */
.press { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 72px); align-items: center; }
.press blockquote { margin: 0 0 28px; font: 800 clamp(30px, 4vw, 44px)/1.05 var(--display); text-transform: uppercase; color: var(--ink); }
.press blockquote::before { content: "“"; display: block; color: var(--yellow-dark); font-size: 1.6em; line-height: .6; margin-bottom: 8px; }
.press cite { display: block; font: italic 400 17px/1.4 var(--body); text-transform: none; color: var(--muted); margin-top: 14px; }
.scores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 26px; padding: 0; list-style: none; }
.scores li { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 12px; display: grid; gap: 4px; }
.scores span { font: 600 14px/1.2 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.scores b { font: 800 36px/1 var(--display); color: var(--ink); }
.scores b small { font-size: 18px; color: var(--muted); font-weight: 600; }
.press figure { margin: 0; }
.press figure a { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: 0 18px 40px rgba(0,0,0,.14); transform: rotate(-1.2deg); transition: transform .2s; }
.press figure a:hover { transform: rotate(0); }
.press figcaption { font-size: 14px; color: var(--muted); margin-top: 14px; }
@media (max-width: 860px) { .press { grid-template-columns: 1fr; } .press figure { order: -1; } }
@media (max-width: 420px) { .scores li { padding: 10px; } .scores span { font-size: 12px; letter-spacing: .06em; } .scores b { font-size: 28px; } }

/* dove siamo e contatti */
.where { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: clamp(28px, 5vw, 56px); }
.where dl { margin: 0 0 24px; display: grid; gap: 16px; }
.where dt { font: 600 14px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.where dd { margin: 0; font-size: 19px; }
.where dd a { text-decoration: none; border-bottom: 2px solid var(--yellow); }
.orari { border-collapse: collapse; font-size: 17px; margin-top: 2px; }
.orari th { text-align: left; font-weight: 600; padding: 3px 18px 3px 0; white-space: nowrap; }
.orari td { padding: 3px 0; }
.orari tr.chiuso td { color: var(--muted); }
.orari tr.oggi th, .orari tr.oggi td { box-shadow: inset 0 -2px 0 var(--yellow); }
.orari-nota { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.map { position: relative; border-radius: var(--radius); overflow: hidden; background: #d8d6cf url(img/mappa-segnaposto.svg) center / cover; min-height: 380px; border: 1px solid var(--line); }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-gate { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 14px; padding: 24px; background: rgba(244,243,239,.88); }
.map-gate p { margin: 0 auto; color: var(--muted); font-size: 15px; max-width: 40ch; }
.map-gate .btn { justify-self: center; }
.map.loaded .map-gate { display: none; }
@media (max-width: 860px) { .where { grid-template-columns: 1fr; } .map { min-height: 320px; } }

.contact { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 72px); align-items: start; }
.contact h2 { color: var(--white); margin-bottom: 18px; }
.contact .direct { display: grid; gap: 12px; margin-top: 24px; }
.contact .direct a { display: flex; align-items: center; gap: 14px; text-decoration: none; font: 600 26px/1.1 var(--display); letter-spacing: .03em; color: var(--white); }
.contact .direct a span { font: 400 15px/1.3 var(--body); color: var(--on-dark-muted); display: block; letter-spacing: 0; }
.contact .direct svg { width: 26px; height: 26px; color: var(--yellow); flex: none; }
.form { background: var(--white); color: var(--text); border-radius: var(--radius); padding: clamp(22px, 3vw, 34px); display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form .full { grid-column: 1 / -1; }
.form label { display: block; font: 600 15px/1.2 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
.form input[type=text], .form input[type=email], .form input[type=tel], .form select, .form textarea { width: 100%; font: 400 17px/1.4 var(--body); color: var(--text); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.form textarea { min-height: 130px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: var(--ink); background: var(--white); }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--muted); }
.form .check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--ink); }
.form .check label { font: inherit; text-transform: none; letter-spacing: 0; color: inherit; margin: 0; }
.captcha { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.captcha img { height: 52px; width: auto; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.captcha input { max-width: 170px; }
.captcha button { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; color: var(--muted); }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.field-error { color: #b42318; font-size: 14px; margin-top: 4px; min-height: 0; }
.form-status { grid-column: 1 / -1; border-radius: var(--radius); padding: 12px 14px; font-size: 16px; }
.form-status.ok { background: #e7f5ea; color: #1d5e2c; }
.form-status.err { background: #fdecea; color: #8a1c13; }
.form .req { color: var(--muted); font-size: 14px; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .form { grid-template-columns: 1fr; } }

/* piè di pagina */
.foot { background: var(--ink); color: var(--on-dark-muted); font-size: 15px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center; padding-block: 28px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { color: var(--on-dark); text-decoration: none; }
.foot a:hover { color: var(--yellow); }

/* comparsa leggera allo scorrimento (solo con JavaScript attivo) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }
