/*
Theme Name: AC-Projects
Theme URI: https://ac-projects.com
Author: Alessandro Carnovali
Description: Tema leggero e veloce per il sito di un ingegnere strutturale con web app di calcolo, blog e contatti. Ottimizzato SEO, senza dipendenze da page builder.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
License: GNU General Public License v2 or later
Text Domain: acp
*/

/* ---------- Variabili ---------- */
:root {
  --teal: #007f86;
  --teal-dark: #00656b;
  --teal-soft: #e6f3f4;
  --ink: #111315;
  --text: #4a4f54;
  --muted: #7a8086;
  --line: #e4e7e9;
  --bg: #ffffff;
  --bg-alt: #f5f7f8;
  --dark: #0a0b0c;
  --radius: 4px;
  --shadow: 0 4px 24px rgba(0, 0, 0, .07);
  --wrap: 1140px;
  --font-head: "Lato", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Roboto", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Reset essenziale ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration: none; transition: color .2s; }
a:hover { color: var(--teal-dark); }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; text-transform: uppercase; letter-spacing: .01em; }
h3 { font-size: 1.35rem; font-weight: 700; }
p { margin: 0 0 1.2em; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
  position: fixed; top: 8px; left: 8px; z-index: 1000; width: auto; height: auto;
  clip: auto; padding: 10px 16px; background: #fff; color: var(--ink);
}
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section--alt { background: var(--bg-alt); }
.section--dark { background: var(--dark); color: #cfd3d6; }
.section--dark h2, .section--dark h3 { color: #fff; }
.eyebrow {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 8px;
}
.section-head { max-width: 640px; margin: 0 auto 56px; text-align: center; }
.section-head p { color: var(--muted); }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 30px;
  font-family: var(--font-head);
  font-size: .82rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: #fff; background: transparent;
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 999px;
  cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: #fff; color: var(--ink); }
.btn--solid { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn--solid:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.btn--outline { color: var(--teal); border-color: var(--teal); }
.btn--outline:hover { background: var(--teal); color: #fff; }
.btn svg { width: 18px; height: 18px; }

/* ---------- Top bar + header ---------- */
.topbar {
  background: rgba(0, 0, 0, .35);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font-size: .78rem; color: #fff;
}
.topbar .wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.topbar span { display: inline-flex; align-items: center; gap: 8px; }
.topbar svg { width: 14px; height: 14px; color: var(--teal); flex: none; }
.site-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 50;
  color: #fff;
}
.site-header__bar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 22px; padding-bottom: 22px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { color: #fff; }
.brand svg, .brand img { width: 44px; height: 44px; }
.brand__name { font-family: var(--font-head); font-weight: 700; letter-spacing: .08em; font-size: 1.05rem; }
.main-nav ul { list-style: none; display: flex; gap: 34px; margin: 0; padding: 0; }
.main-nav a {
  color: #fff; font-family: var(--font-head);
  font-size: .78rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  padding: 8px 0; border-bottom: 1px solid transparent;
}
.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a { color: #fff; border-bottom-color: var(--teal); }
.nav-toggle {
  display: none; background: none; border: 0; color: #fff; cursor: pointer; padding: 8px;
}
.nav-toggle svg { width: 28px; height: 28px; }

/* header su pagine interne senza hero scuro */
.site-header--solid { position: relative; background: var(--dark); }

/* ---------- Hero ---------- */
.hero {
  position: relative; display: flex; flex-direction: column; justify-content: center;
  min-height: 100vh; min-height: 100svh;
  color: #fff; text-align: center; overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(0, 127, 134, .22), transparent 60%),
    linear-gradient(160deg, #0b0d0e 0%, #1a1f21 48%, #060707 100%);
  background-size: cover; background-position: center;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: url("assets/hero-pattern.svg") center bottom / cover no-repeat;
  opacity: .9;
}
.hero--photo::after {
  content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .62);
}
.hero__inner { position: relative; z-index: 2; padding: 150px 24px 90px; }
.hero__title {
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 14px;
}
.hero__sub {
  font-family: var(--font-head);
  font-size: clamp(1rem, 2.4vw, 1.5rem); font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: #fff;
  margin: 0 0 44px;
}

/* hero pagine interne */
.page-hero {
  position: relative; padding: 190px 0 70px; color: #fff;
  background: linear-gradient(160deg, #0b0d0e, #1a1f21 60%, #060707);
  overflow: hidden;
}
.page-hero::before {
  content: ""; position: absolute; inset: 0;
  background: url("assets/hero-pattern.svg") center bottom / cover no-repeat; opacity: .6;
}
.page-hero .wrap {
  position: relative; display: flex; align-items: flex-end;
  justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.page-hero h1 { color: #fff; margin: 0; text-transform: uppercase; }
.crumbs { font-size: .9rem; color: #cfd3d6; }
.crumbs a { color: #fff; }
.crumbs span.sep { color: var(--teal); margin: 0 8px; }

/* ---------- Chi sono ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.about__text p { max-width: 460px; }
.about__sign {
  font-family: "Segoe Script", "Brush Script MT", cursive;
  font-size: 1.8rem; color: #c8102e; margin-top: 6px;
}
.about__media { position: relative; }
.about__media img, .about__ph {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius);
}
.about__ph {
  background:
    linear-gradient(135deg, rgba(0, 127, 134, .9), rgba(0, 60, 64, .95)),
    url("assets/hero-pattern.svg") center / cover;
}
.quote-card {
  position: absolute; left: -64px; bottom: -40px; max-width: 360px;
  background: #fff; box-shadow: var(--shadow); padding: 26px 28px;
  border-left: 3px solid var(--teal);
  margin-left: 0;
}
.quote-card p { margin: 0 0 10px; font-style: normal; }
.quote-card cite { display: block; text-align: right; font-style: normal; color: var(--ink); font-size: .9rem; font-weight: 400; }

/* ---------- Card (servizi, web app, articoli) ---------- */
.grid { display: grid; gap: 30px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: #fff; box-shadow: var(--shadow); border-radius: var(--radius);
  padding: 40px; display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 34px rgba(0, 0, 0, .1); }
.card__icon { width: 42px; height: 42px; color: var(--teal); margin-bottom: 22px; }
.card h3 { font-weight: 400; font-size: 1.5rem; }
.card h3 a { color: var(--ink); }
.card p { color: var(--text); }
.card__more {
  margin-top: auto; font-family: var(--font-head); font-size: .8rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
}
.card__tag {
  align-self: flex-start; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  background: var(--teal-soft); color: var(--teal-dark); padding: 4px 10px; border-radius: 999px; margin-bottom: 16px;
}
.card--post { padding: 0; overflow: hidden; }
.card--post .card__body { padding: 28px 30px 32px; display: flex; flex-direction: column; flex: 1; }
.card--post img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.meta { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }

/* ---------- Fascia contatti + blog ---------- */
.cta { background: #000; color: #fff; padding: 72px 0; }
.cta__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.cta__col { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 0 48px; }
.cta__col:first-child { padding-left: 0; border-right: 1px solid rgba(255, 255, 255, .15); }
.cta__col:last-child { padding-right: 0; }
.cta h2 { text-transform: none; margin: 0; color: #fff; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.cta p { margin: 0; color: #e8eaeb; }
.cta__posts { list-style: none; margin: 0; padding: 0; width: 100%; }
.cta__posts li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.cta__posts a { color: #fff; font-weight: 400; }
.cta__posts a:hover { color: var(--teal); }
.cta__posts time { color: #9aa1a5; font-size: .85rem; white-space: nowrap; }
.cta .btn { margin-top: auto; }
@media (max-width: 760px) {
  .cta__grid { grid-template-columns: 1fr; gap: 48px; }
  .cta__col, .cta__col:first-child, .cta__col:last-child { padding: 0; border-right: 0; }
  .cta__col:first-child { padding-bottom: 48px; border-bottom: 1px solid rgba(255, 255, 255, .15); }
}

/* ---------- Contenuti (articoli, pagine, web app) ---------- */
.content { padding: 80px 0; }
.content .wrap--narrow { max-width: 820px; }
.entry > * + * { margin-top: 1.2em; }
.entry h2 { text-transform: none; font-size: 1.7rem; margin-top: 1.8em; }
.entry h3 { margin-top: 1.5em; }
.entry ul, .entry ol { padding-left: 1.3em; }
.entry img { border-radius: var(--radius); }
.entry table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.entry th, .entry td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.entry th { background: var(--bg-alt); }
.entry blockquote { margin: 1.5em 0; padding: 6px 0 6px 22px; border-left: 3px solid var(--teal); color: var(--ink); }
.entry code { background: var(--bg-alt); padding: 2px 6px; border-radius: 3px; font-size: .9em; }
.entry pre { background: #14181a; color: #e9eef0; padding: 18px; border-radius: var(--radius); overflow-x: auto; }
.entry pre code { background: none; padding: 0; }

.webapp-embed {
  margin: 0 0 56px; padding: 24px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow-x: auto;
}
.disclaimer {
  margin: 40px 0; padding: 20px 24px; background: var(--teal-soft);
  border-left: 3px solid var(--teal); font-size: .92rem; color: var(--ink);
}

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 56px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 42px; padding: 8px 14px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink);
}
.pagination .current { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ---------- Contatti ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; }
.contact__list { list-style: none; margin: 24px 0 0; padding: 0; }
.contact__list li { display: flex; gap: 14px; margin-bottom: 14px; align-items: flex-start; }
.contact__list svg { width: 18px; height: 18px; color: var(--teal); margin-top: 6px; flex: none; }
.areabox {
  margin-top: 28px; padding: 24px; border-radius: var(--radius);
  background: linear-gradient(135deg, #0f1315, #1b2225); color: #dfe3e5;
}
.areabox strong { color: #fff; }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-size: .85rem; font-weight: 400; color: var(--ink); margin-bottom: 6px; }
.form-row input[type="text"], .form-row input[type="email"], .form-row input[type="tel"], .form-row textarea {
  width: 100%; padding: 12px 14px; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #cdd2d5; border-radius: var(--radius);
}
.form-row input:focus, .form-row textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(0, 127, 134, .15); }
.form-row--check { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; }
.form-row--check input { margin-top: 6px; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.notice { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 24px; font-size: .95rem; }
.notice--ok { background: #e7f5ec; color: #14532d; border-left: 3px solid #22a55a; }
.notice--err { background: #fdecec; color: #7f1d1d; border-left: 3px solid #d63b3b; }

/* ---------- Footer ---------- */
.site-footer { background: #070809; color: #aab0b4; padding: 72px 0 0; font-size: .95rem; }
.site-footer h4 {
  color: #fff; font-size: .85rem; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 18px;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; padding-bottom: 56px; }
.site-footer a { color: #aab0b4; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .08); padding: 22px 0;
  font-size: .82rem; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.footer-note { font-size: .8rem; color: #868c90; margin-top: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .about, .contact { grid-template-columns: 1fr; gap: 48px; }
  .quote-card { position: relative; left: 0; bottom: 0; margin: -30px 16px 0; max-width: none; }
  .grid--3 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .section { padding: 64px 0; }
  .topbar .wrap { flex-direction: column; gap: 4px; align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0; background: rgba(8, 9, 10, .97);
    padding: 8px 24px 24px; display: none;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 4px; }
  .main-nav a { display: block; padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .site-header__bar { position: relative; }
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .card { padding: 30px; }
  .page-hero { padding: 170px 0 50px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .topbar, .site-footer, .cta { display: none; }
}
