/*
Theme Name: Meringo Gomme
Theme URI: https://www.meringogomme.it/
Author: Meringo Gomme
Description: Tema su misura, one-page, per Meringo Gomme - gommista e officina meccanica a Ripi (FR). Costruito per Core Web Vitals e per l'ottimizzazione AEO/GEO: nessun page builder, nessun jQuery, dati strutturati generati automaticamente dai contenuti reali.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: meringo
Tags: one-page, local-business, performance, seo
*/

/* ==========================================================================
   I font Archivo sono dichiarati qui. I file .woff2 stanno in assets/fonts/
   e vengono precaricati da inc/cleanup.php per non bloccare il rendering.
   ========================================================================== */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/archivo-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("assets/fonts/archivo-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --bg: #111214;
    --bg-alt: #17181b;
    --ink: #f3f2f2;
    --muted: #d7d3d3;
    --dim: #9b9797;
    --line: #2a2b2e;
    --red: #e4002b;
    --green: #25d366;
    --pad: 64px;
  }
  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Archivo, system-ui, -apple-system, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    text-wrap: pretty;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
  }
  a { color: inherit; text-decoration: none; }
  a:hover { color: var(--red); }
  :focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
  p { margin: 10px 0 0; color: var(--muted); }
  h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.03em; }
  img, svg, iframe { display: block; max-width: 100%; }

  .skip-link { position: absolute; left: -9999px; background: var(--red); color: #fff; padding: 12px 18px; z-index: 300; }
  .skip-link:focus { left: 16px; top: 16px; }
  .visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

  .wrap { padding-inline: var(--pad); max-width: 1280px; margin-inline: auto; }
  .kicker { font-size: 13px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--red); margin: 0 0 26px; }
  .label { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }

  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    padding: 15px 24px; border: 2px solid transparent; border-radius: 2px;
    font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; text-align: center;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
  }
  .btn:active { transform: translateY(1px); }
  .btn-primary { background: var(--red); color: #fff; }
  .btn-primary:hover { background: #c30025; color: #fff; }
  .btn-wa { background: var(--green); color: #08331a; }
  .btn-wa:hover { background: #1fbb59; color: #08331a; }
  .btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
  .btn-outline:hover { border-color: var(--ink); color: var(--ink); }
  .btn svg { flex: none; }

  header.top {
    position: sticky; top: 0; z-index: 120;
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    padding-block: 20px;
    background: rgba(17,18,20,.88); backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent; transition: border-color .2s ease;
  }
  header.top.scrolled { border-bottom-color: var(--line); }
  .brand { display: flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 800; white-space: nowrap; }
  .brand svg { width: 28px; height: 28px; }
  nav.menu { display: flex; gap: 28px; font-size: 14px; color: var(--dim); }
  nav.menu a { padding: 4px 0; border-bottom: 2px solid transparent; }
  nav.menu a:hover, nav.menu a.active { color: var(--ink); }
  nav.menu a.active { border-bottom-color: var(--red); }
  .header-actions { display: flex; align-items: center; gap: 12px; }
  .menu-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--ink); padding: 11px 13px; cursor: pointer; border-radius: 2px; }

  /* HERO */
  .hero { padding-block: 116px 96px; }
  .hero h1 { font-size: clamp(30px, 8.4vw, 80px); line-height: .95; letter-spacing: -.045em; max-width: 16ch; }
  .hero .lede { font-size: 20px; max-width: 54ch; margin-top: 30px; }
  .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
  .status-pill { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--muted); margin-top: 26px; }
  .status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); flex: none; }
  .status-dot.open { background: var(--green); box-shadow: 0 0 0 4px rgba(37,211,102,.16); }
  .status-dot.closed { background: var(--red); box-shadow: 0 0 0 4px rgba(228,0,43,.16); }

  .trust-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px 40px; margin-top: 60px; padding-top: 32px; border-top: 1px solid var(--line); }
  .trust-item { font-size: 14px; color: var(--dim); }
  .trust-item strong { display: block; font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -.03em; }

  /* ANSWER BOX — blocco pensato per LLM e featured snippet */
  .answer-box { border: 1px solid var(--line); border-left: 3px solid var(--red); background: var(--bg-alt); padding: 30px 34px; }
  .answer-box h2 { font-size: 20px; letter-spacing: -.02em; }
  .answer-box p { font-size: 17px; }
  .answer-list { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
  .answer-list li { display: flex; gap: 11px; color: var(--muted); font-size: 16px; }
  .answer-list li::before { content: "→"; color: var(--red); flex: none; font-weight: 700; }

  .sections { display: grid; gap: 104px; padding-bottom: 110px; }
  section { scroll-margin-top: 92px; }
  .section-head { max-width: 62ch; margin-bottom: 44px; }
  .section-head h2 { font-size: clamp(25px, 5.8vw, 44px); line-height: 1.06; letter-spacing: -.035em; }
  .section-head p { font-size: 18px; margin-top: 16px; }

  .duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 52px 72px; }
  .duo-card { display: flex; gap: 20px; }
  .duo-card .icon { flex: none; width: 42px; height: 42px; color: var(--red); }
  .duo h3 { font-size: 25px; letter-spacing: -.02em; }
  .duo ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; font-size: 15px; color: var(--dim); }
  .duo ul li::before { content: "·"; margin-right: 8px; color: var(--red); }

  .statement { font-size: clamp(25px, 6.2vw, 46px); line-height: 1.06; max-width: 20ch; letter-spacing: -.035em; }

  .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 56px 88px; align-items: start; }
  .split .statement { max-width: 13ch; }
  .split-copy p + p { margin-top: 15px; }
  .spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 22px 40px; margin-top: 34px; padding-top: 30px; border-top: 1px solid var(--line); }
  .spec-grid strong { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
  .spec-grid span { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }

  .brands { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
  .brand-chip { border: 1px solid var(--line); padding: 8px 16px; font-size: 14px; color: var(--muted); border-radius: 2px; }

  .steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; counter-reset: step; }
  .step { border-top: 2px solid var(--red); padding-top: 20px; }
  .step .num { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--red); font-weight: 700; }
  .step h3 { font-size: 19px; margin-top: 10px; letter-spacing: -.01em; }
  .step p { font-size: 15px; }

  .zones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
  .zone-chip { border: 1px solid var(--line); background: var(--bg-alt); padding: 10px 18px; font-size: 15px; color: var(--muted); border-radius: 2px; }

  /* FAQ accordion */
  .faq-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
  .faq-item { border-bottom: 1px solid var(--line); }
  .faq-item summary {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    padding: 22px 0; cursor: pointer; list-style: none;
    font-size: 19px; font-weight: 700; letter-spacing: -.015em;
  }
  .faq-item summary::-webkit-details-marker { display: none; }
  .faq-item summary:hover { color: var(--red); }
  .faq-item summary .chev { flex: none; width: 16px; height: 16px; color: var(--dim); transition: transform .2s ease; }
  .faq-item[open] summary .chev { transform: rotate(45deg); color: var(--red); }
  .faq-item .answer { padding: 0 0 24px; max-width: 72ch; }
  .faq-item .answer p { margin-top: 0; font-size: 16px; }

  /* CONTATTI */
  .address { font-size: clamp(21px, 5.4vw, 33px); letter-spacing: -.03em; line-height: 1.2; color: var(--ink); }
  .contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
  .contacts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 30px 40px; margin-top: 32px; }
  .contacts strong { display: block; font-size: 24px; font-weight: 800; margin-top: 6px; letter-spacing: -.02em; }
  .hours { margin-top: 8px; color: var(--muted); font-size: 16px; }
  .hours-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 16px; }
  .hours-table th { text-align: left; font-weight: 400; color: var(--dim); padding: 5px 16px 5px 0; white-space: nowrap; }
  .hours-table td { color: var(--muted); padding: 5px 0; }
  .map-frame { border: 1px solid var(--line); background: var(--bg-alt); aspect-ratio: 4/3.2; overflow: hidden; border-radius: 2px; }
  .map-frame iframe { width: 100%; height: 100%; border: 0; filter: grayscale(.35) invert(.92) contrast(.88); }

  /* CTA finale */
  .cta-band { border: 1px solid var(--line); background: var(--bg-alt); padding: 56px; text-align: center; border-radius: 2px; }
  .cta-band h2 { font-size: clamp(24px, 5.8vw, 42px); letter-spacing: -.035em; line-height: 1.05; }
  .cta-band p { margin-inline: auto; max-width: 52ch; font-size: 18px; }
  .cta-band .actions { justify-content: center; }

  footer.bottom { padding-block: 40px 130px; font-size: 14px; color: var(--dim); border-top: 1px solid var(--line); }
  .footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
  .footer-grid h3 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); font-weight: 700; margin-bottom: 12px; }
  .footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
  .footer-legal { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }

  /* barra CTA mobile */
  .mobile-cta { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 140; gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
  .mobile-cta a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px 8px; font-size: 15px; font-weight: 700; }
  .mobile-cta .call { background: var(--red); color: #fff; }
  .mobile-cta .wa { background: var(--green); color: #08331a; }

  [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
  [data-reveal].is-visible { opacity: 1; transform: none; }

  @media (max-width: 1000px) {
    .trust-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 900px) {
    :root { --pad: 20px; }
    body { font-size: 16px; }
    nav.menu { position: fixed; inset: 66px 0 0 0; background: var(--bg); flex-direction: column; gap: 0; padding: 8px 20px 40px; display: none; overflow-y: auto; }
    nav.menu.open { display: flex; }
    nav.menu a { padding: 17px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
    .menu-toggle { display: inline-flex; }
    .header-actions .btn-primary { display: none; }
    .hero { padding-block: 56px 48px; }
    .hero .lede { font-size: 18px; margin-top: 24px; }
    .trust-row { margin-top: 44px; padding-top: 26px; gap: 22px 24px; }
    .answer-box { padding: 24px 22px; }
    .sections { gap: 68px; padding-bottom: 64px; }
    .duo, .split, .contact-grid, .steps { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .contacts { grid-template-columns: minmax(0, 1fr); }
    .spec-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .map-frame { aspect-ratio: 16/11; }
    .cta-band { padding: 36px 22px; }
    .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .mobile-cta { display: flex; }
    footer.bottom { padding-bottom: 110px; }
  }

/* ==========================================================================
   Aggiunte specifiche per WordPress
   ========================================================================== */

/* barra admin: evita che copra l'header sticky */
body.admin-bar header.top { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar header.top { top: 46px; }
}

/* immagini della gallery officina */
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.gallery-grid figure { margin: 0; border: 1px solid var(--line); background: var(--bg-alt); overflow: hidden; border-radius: 2px; }
.gallery-grid img { width: 100%; height: 100%; aspect-ratio: 4/3; object-fit: cover; transition: transform .4s ease; }
.gallery-grid figure:hover img { transform: scale(1.03); }

/* avviso stagionale / chiusura straordinaria */
.notice-band { background: var(--red); color: #fff; text-align: center; padding: 12px var(--pad); font-size: 15px; font-weight: 600; }
.notice-band a { text-decoration: underline; color: #fff; }
.notice-band a:hover { color: #fff; opacity: .85; }

/* listino prezzi indicativi */
.price-list { display: grid; gap: 0; border-top: 1px solid var(--line); max-width: 76ch; }
.price-row { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.price-row .name { font-weight: 700; font-size: 18px; letter-spacing: -.015em; }
.price-row .note { display: block; font-weight: 400; font-size: 15px; color: var(--dim); margin-top: 2px; }
.price-row .value { font-size: 20px; font-weight: 800; white-space: nowrap; letter-spacing: -.02em; }

@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .price-row { flex-direction: column; gap: 4px; }
}

/* ==========================================================================
   Tenuta su schermi stretti
   --------------------------------------------------------------------------
   L'italiano tecnico è pieno di parole lunghe — climatizzatore, equilibratura,
   convergenza — che a corpo grande su un telefono da 360px sfondano il
   contenitore. Qui si permette al testo di andare a capo dentro la parola e
   agli elementi di griglia e flex di restringersi davvero.
   ========================================================================== */

h1, h2, h3, p, li, summary, td, th,
.statement, .address, .brand-chip, .zone-chip, .trust-item, .step, .price-row {
  /* Va a capo dentro la parola solo quando è davvero indispensabile. */
  overflow-wrap: break-word;
  /* Niente sillabazione automatica: su un titolo di grandi dimensioni spezzava
     parole che ci sarebbero state comode ("pro-vincia") e sembrava un refuso.
     "manual" divide solo dove c'è un trattino morbido inserito a mano. */
  hyphens: manual;
}

/* I titoli si spezzano in modo più equilibrato invece di lasciare orfane. */
h1, h2, .statement, .section-head h2, .cta-band h2 { text-wrap: balance; }

/* Figli di griglia e flex: senza questo il minimo resta la larghezza del
   contenuto e il contenitore viene sfondato dall'interno. */
.duo-card > div,
.split-copy,
.section-head,
.trust-item,
.step,
.contacts > div,
.footer-grid > div,
.faq-item,
.faq-item .answer,
.price-row .name { min-width: 0; }

/* Il numero di telefono nell'header non deve mai spezzarsi in due righe. */
.header-actions .btn-primary { white-space: nowrap; }

/* Su schermo stretto l'icona del servizio va sopra al testo: affiancata
   toglieva 60px di larghezza utile alla descrizione. */
@media (max-width: 560px) {
  .duo-card { flex-direction: column; gap: 12px; }
  .duo-card .icon { width: 34px; height: 34px; }
  .faq-item summary { font-size: 17px; gap: 14px; }
  .trust-item strong { font-size: clamp(20px, 6.4vw, 28px); }
  .contacts strong { font-size: clamp(20px, 6vw, 24px); }
  .spec-grid strong { font-size: clamp(22px, 6.6vw, 30px); }
  .hours-table th { padding-right: 10px; }
  .hours-table { font-size: 15px; }
  .btn { padding: 14px 18px; font-size: 15px; }
  .answer-box { padding: 20px 18px; }
  .answer-box h2 { font-size: 18px; }
}

@media (max-width: 380px) {
  :root { --pad: 16px; }
  .hours-table th { white-space: normal; }
  .brand { font-size: 15px; gap: 8px; }
  .brand svg { width: 24px; height: 24px; }
}

/* Il menu mobile si aggancia all'header invece di partire da un'altezza fissa:
   così resta allineato anche con la fascia di avviso attiva o con la barra di
   amministrazione visibile. */
@media (max-width: 900px) {
  nav.menu {
    position: absolute;
    inset: auto auto auto 0;
    top: 100%;
    left: calc(var(--pad) * -1);
    right: calc(var(--pad) * -1);
    width: auto;
    max-height: 72dvh;
    padding: 4px var(--pad) 28px;
    border-bottom: 1px solid var(--line);
  }
}

/* iPhone con la barra gesti in basso: senza questo i due pulsanti finiscono
   sotto l'indicatore di sistema e diventano difficili da premere. */
.mobile-cta a { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }

@media (max-width: 900px) {
  footer.bottom { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
}

/* ==========================================================================
   Pannello al posto della mappa incorporata
   --------------------------------------------------------------------------
   L'embed di Google Maps è la cosa più pesante che ci fosse in pagina e
   depositava cookie di terze parti al primo caricamento. Qui c'è un pannello
   disegnato in CSS: la griglia richiama una mappa senza fingere di esserlo, e
   l'iframe vero nasce solo al clic.
   ========================================================================== */

.map-facade {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: 0;
  color: var(--ink);
  font: inherit;
  text-align: center;
  background:
    repeating-linear-gradient(90deg, transparent 0 41px, rgba(243,242,242,.045) 41px 42px),
    repeating-linear-gradient(0deg, transparent 0 41px, rgba(243,242,242,.045) 41px 42px),
    var(--bg-alt);
  transition: background-color .2s ease;
}

/* La diagonale richiama la Casilina che taglia la zona. */
.map-facade::before {
  content: "";
  position: absolute;
  inset: 0;
  /* Appena percettibile: a piena opacità tagliava l'indirizzo e sembrava
     un difetto di visualizzazione invece di una strada. */
  background: linear-gradient(114deg,
    transparent 0 45.8%,
    rgba(228,0,43,.16) 45.8% 46.9%,
    transparent 46.9% 100%);
  pointer-events: none;
}

.map-facade:hover { background-color: #1b1c20; }

.map-facade-inner {
  position: relative;
  z-index: 1;
  /* Campo scuro sfumato sotto al testo: qualunque cosa passi dietro,
     indirizzo e pulsante restano sempre leggibili. */
  background: radial-gradient(ellipse 88% 66% at 50% 50%,
    rgba(17,18,20,.94) 0%,
    rgba(17,18,20,.78) 55%,
    rgba(17,18,20,0) 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 22px;
}

.map-pin { width: 34px; height: 34px; color: var(--red); }
.map-address { margin: 4px 0 0; color: var(--ink); font-size: 19px; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; }
.map-hint { margin: 0; font-size: 14px; color: var(--dim); max-width: 34ch; }
.map-facade .btn { margin-top: 8px; }
.map-privacy { margin: 2px 0 0; font-size: 12px; color: var(--dim); }

@media (max-width: 560px) {
  .map-address { font-size: 17px; }
  .map-hint { font-size: 13px; }
  .map-facade-inner { gap: 8px; padding: 22px 16px; }
}

/* Con il pannello al posto della mappa l'altezza la decide il contenuto.
   Forzare una proporzione fissa su schermo stretto tagliava fuori il pulsante:
   il riquadro era alto ~247px e il contenuto ne chiedeva ~252. */
.map-frame-facade { aspect-ratio: auto; }
.map-facade { min-height: 250px; }
.map-frame iframe { aspect-ratio: 4/3.2; }

/* Il bordo predefinito del pulsante è troppo tenue su questo pannello:
   qui è l'unica azione disponibile e deve vedersi. */
.map-facade .btn-outline { border-color: #55565c; }
.map-facade .btn-outline:hover { border-color: var(--ink); }
