/* Consorzio Abaco – foglio di stile principale */
:root {
  --accent: #f15808;
  --accent-dark: #c94602;
  --sand: #e5d7d1;
  --sand-light: #f6f0ed;
  --text: #353535;
  --heading: #1c0d0a;
  --muted: #6b6b6b;
  --border: #e5d7d1;
  --bg: #ffffff;
  --max: 1200px;
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { color: var(--accent-dark); text-decoration: underline; }
h1, h2, h3, h4 { color: var(--heading); line-height: 1.25; font-weight: 600; margin: 1.6em 0 .6em; }
h1 { font-size: 2rem; margin-top: 0; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.4em; margin: 0 0 1.2em; }
li { margin-bottom: .35em; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff; padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 10px; top: 10px; }

/* ---------- Barra superiore ---------- */
.topbar { background: var(--sand); font-size: .9rem; }
.topbar .container { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px 22px; padding-top: 8px; padding-bottom: 8px; }
.topbar a, .topbar span { color: var(--text); display: inline-flex; align-items: center; gap: 7px; }
.topbar svg { width: 15px; height: 15px; fill: currentColor; flex: none; }
.topbar .ico-mail { color: #ea4335; }
.topbar .ico-clock { color: #e96651; }

/* ---------- Header ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; min-height: 84px; }
.logo img { width: 167px; height: 60px; }

.nav ul { list-style: none; margin: 0; padding: 0; }
.nav > ul { display: flex; align-items: center; gap: 4px; }
.nav li { margin: 0; position: relative; }
.nav a, .nav .submenu-toggle {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  color: var(--text);
  text-transform: uppercase;
  font-size: 1rem;
  font: inherit;
  background: none; border: 0; cursor: pointer;
  text-decoration: none;
}
.nav a:hover, .nav .submenu-toggle:hover, .nav .current > a, .nav .current > .submenu-toggle { color: var(--accent); text-decoration: none; }
.nav .submenu-toggle svg { width: 10px; height: 10px; fill: currentColor; transition: transform .2s; }
.nav .submenu {
  position: absolute; top: 100%; left: 0; min-width: 260px;
  background: #fff; border-top: 2px solid var(--accent);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.nav .submenu a { text-transform: none; padding: 10px 18px; border-bottom: 1px solid #f1eae7; }
.nav .submenu li:last-child a { border-bottom: 0; }
.nav .has-sub:hover > .submenu, .nav .has-sub:focus-within > .submenu, .nav .has-sub.open > .submenu { opacity: 1; visibility: visible; transform: none; }
.nav .has-sub.open > .submenu-toggle svg { transform: rotate(180deg); }

.menu-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; cursor: pointer; color: var(--text); }
.menu-toggle svg { width: 22px; height: 22px; fill: currentColor; display: block; }

/* ---------- Citazione ---------- */
.quote-bar { background: var(--sand-light); border-bottom: 1px solid var(--border); }
.quote-bar p { margin: 0; padding: 14px 0; font-size: 1.15rem; font-weight: 600; color: var(--heading); }

/* ---------- Contenuto ---------- */
main { padding: 48px 0 64px; }
.hero-img { width: 100%; max-height: 520px; object-fit: cover; margin-bottom: 40px; }
.home main { padding-top: 0; }
.page-title { margin-bottom: 28px; padding-bottom: 14px; border-bottom: 3px solid var(--accent); display: inline-block; }
.content { max-width: 900px; }
.content.wide { max-width: none; }
.lead { font-size: 1.15rem; }
.uppercase-lead { text-transform: uppercase; font-weight: 600; color: var(--heading); letter-spacing: .01em; }
.float-right { float: right; margin: 0 0 20px 28px; max-width: 45%; border-radius: var(--radius); }
.float-left { float: left; margin: 0 28px 20px 0; max-width: 45%; border-radius: var(--radius); }
.clear { clear: both; }
.rounded { border-radius: var(--radius); }

.media-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin: 28px 0; }
.media-row img { width: 100%; height: 240px; object-fit: cover; border-radius: var(--radius); }

.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }

/* Elenchi puntati con accento */
.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 28px; }
.checklist li::before { content: ""; position: absolute; left: 4px; top: .6em; width: 10px; height: 10px; background: var(--accent); border-radius: 2px; }

/* Schede servizi */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; margin-top: 40px; }
.card { display: block; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; color: var(--text); transition: box-shadow .2s, transform .2s, border-color .2s; background: #fff; }
.card:hover { text-decoration: none; color: var(--text); box-shadow: 0 10px 28px rgba(0,0,0,.08); transform: translateY(-2px); border-color: var(--accent); }
.card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.card p { margin: 0; font-size: .95rem; color: var(--muted); }
.card .more { display: inline-block; margin-top: 12px; color: var(--accent); font-weight: 600; font-size: .9rem; }

.section-sub { border-left: 4px solid var(--accent); padding-left: 14px; margin-top: 2em; }

/* Clienti */
.logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; margin: 10px 0 36px; }
.logos .logo-item { display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: #fff; min-height: 140px; transition: box-shadow .2s; }
.logos .logo-item:hover { box-shadow: 0 8px 22px rgba(0,0,0,.08); }
.logos img { max-height: 100px; width: auto; object-fit: contain; }
.small { font-size: .88rem; color: var(--muted); }

/* Tabelle */
table { width: 100%; border-collapse: collapse; margin: 0 0 1.6em; font-size: .97rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--sand-light); color: var(--heading); }
.table-wrap { overflow-x: auto; }

/* Contatti */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-bottom: 36px; }
.info-box { background: var(--sand-light); border-radius: var(--radius); padding: 24px; }
.info-box h2 { margin-top: 0; font-size: 1.2rem; }
.info-box dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.info-box dt { font-weight: 600; color: var(--heading); }
.info-box dd { margin: 0; word-break: break-word; }
.map { width: 100%; height: 360px; border: 0; border-radius: var(--radius); margin-bottom: 36px; }

/* Navigazione precedente/successivo */
.post-nav { display: flex; justify-content: space-between; gap: 20px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.post-nav a { display: block; max-width: 48%; }
.post-nav small { display: block; color: var(--muted); text-transform: uppercase; font-size: .78rem; letter-spacing: .05em; }
.post-nav .next { text-align: right; margin-left: auto; }

blockquote { margin: 1.4em 0; padding: 14px 20px; background: var(--sand-light); border-left: 4px solid var(--accent); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: #fff; font-size: .9rem; }
.site-footer .container { padding-top: 28px; padding-bottom: 28px; text-align: center; }
.site-footer p { margin: 0 0 8px; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; }

.to-top { position: fixed; right: 18px; bottom: 18px; width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #fff; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity .2s; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.to-top.show { opacity: 1; visibility: visible; }
.to-top svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- Responsive ---------- */
@media (max-width: 921px) {
  .menu-toggle { display: block; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--border); box-shadow: 0 12px 24px rgba(0,0,0,.08); display: none; max-height: calc(100vh - 84px); overflow-y: auto; }
  .nav.open { display: block; }
  .nav > ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0; }
  .nav a, .nav .submenu-toggle { padding: 12px 20px; width: 100%; justify-content: space-between; border-bottom: 1px solid #f4eeeb; }
  .nav .submenu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border-top: 0; display: none; background: var(--sand-light); }
  .nav .has-sub.open > .submenu { display: block; }
  .nav .has-sub:hover > .submenu { display: none; }
  .nav .has-sub.open:hover > .submenu { display: block; }
  .nav .submenu a { padding-left: 34px; }
  .split { grid-template-columns: 1fr; }
  .float-right, .float-left { float: none; margin: 0 0 20px; max-width: 100%; }
}
@media (max-width: 600px) {
  h1 { font-size: 1.6rem; }
  .topbar .container { justify-content: center; font-size: .82rem; }
  .site-header .container { min-height: 72px; }
  .logo img { width: 139px; height: 50px; }
  main { padding: 32px 0 48px; }
  .hero-img { margin-bottom: 28px; max-height: 300px; }
  .quote-bar p { font-size: 1rem; }
  .post-nav { flex-direction: column; }
  .post-nav a { max-width: none; }
  .info-box dl { grid-template-columns: 1fr; gap: 0; }
  .info-box dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
