/* Fematic — tema WordPress | palette derivata dal logo aziendale */

:root {
  --color-primary: #14539c;      /* blu principale, nav/CTA/heading */
  --color-secondary: #2e6ab3;    /* blu logo, hover/link */
  --color-dark: #1b2a38;         /* quasi-nero-blu, footer */
  --color-bg: #f5f6f8;
  --color-white: #ffffff;
  --color-text: #262b30;
  --color-muted: #6f7275;        /* grigio logo */
  --color-border: #e3e6ea;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-white);
}

p { text-align: justify; }

h1, h2, h3, h4, h5, .display-title {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-primary);
}

a { color: var(--color-secondary); }
a:hover { color: var(--color-primary); }

.text-accent { color: var(--color-primary) !important; }
.bg-light-alt { background: var(--color-bg); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-secondary);
}

/* Buttons */
.btn-accent {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
  font-weight: 600;
  padding: 0.7rem 1.6rem;
  border-radius: 2px;
}
.btn-accent:hover {
  background: #0f3d75;
  border-color: #0f3d75;
  color: var(--color-white);
}
.btn-outline-primary-custom {
  border: 1px solid var(--color-white);
  color: var(--color-white);
  font-weight: 600;
  border-radius: 2px;
  padding: 0.7rem 1.6rem;
}
.btn-outline-primary-custom:hover {
  background: var(--color-white);
  color: var(--color-primary);
}

/* Top bar */
.topbar {
  background: var(--color-dark);
  color: #c9d3dc;
  font-size: 0.85rem;
  padding: 0.4rem 0;
}
.topbar a { color: #c9d3dc; text-decoration: none; }
.topbar a:hover { color: var(--color-white); }
.topbar .bi { margin-right: 0.35rem; }

/* Navbar */
.navbar-fematic {
  background: var(--color-white);
  box-shadow: 0 2px 10px rgba(20, 36, 51, 0.06);
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}
.navbar-fematic .navbar-brand img { height: 68px; }
.navbar-fematic .nav-link {
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0.5rem;
}
.navbar-fematic .nav-link.active,
.navbar-fematic .nav-link:hover { color: var(--color-secondary); }

/* Hero */
.hero {
  position: relative;
  background-size: cover;
  background-position: center;
  color: var(--color-white);
  min-height: 50vh;
  display: flex;
  align-items: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(20,42,66,0.92) 0%, rgba(20,42,66,0.55) 60%, rgba(20,42,66,0.35) 100%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: var(--color-white); font-size: 2.8rem; }
.hero p.lead { color: #dfe4e8; max-width: 40rem; }

/* Page banner (inner pages) */
.page-banner {
  position: relative;
  background-size: cover;
  background-position: center;
  color: var(--color-white);
  padding: 5rem 0 3.5rem;
}
.page-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(20, 42, 66, 0.80);
}
.page-banner .container { position: relative; z-index: 1; }
.page-banner h1 { color: var(--color-white); margin-bottom: 0.5rem; }
.page-banner .breadcrumb { background: transparent; margin: 0; padding: 0; }
.page-banner .breadcrumb a { color: #dfe4e8; }
.page-banner .breadcrumb .active { color: var(--color-white); font-weight: 600; }

/* Service cards */
.service-card {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  height: 100%;
  transition: transform .2s ease, box-shadow .2s ease;
  background: var(--color-white);
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(20,36,51,0.10);
}
.service-card img { height: 210px; width: 100%; object-fit: cover; }
.service-card .card-body { padding: 1.5rem; }
.service-card .icon-badge {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20,83,156,0.1);
  color: var(--color-primary);
  border-radius: 50%;
  margin-bottom: 0.75rem;
  font-size: 1.2rem;
}
.service-card .stretched-link-title a::after { content: ""; position: absolute; inset: 0; }

/* Section title */
.section-heading { margin-bottom: 3rem; }
.section-heading .eyebrow { display: block; margin-bottom: 0.5rem; }

/* Stats */
.stat-block { text-align: center; }
.stat-block .num { font-size: 2.4rem; font-weight: 700; color: var(--color-primary); }
.stat-block .label { color: var(--color-muted); text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.06em; }

/* Certifications / brands */
.cert-logo, .brand-logo {
  max-height: 90px;
  filter: grayscale(100%);
  opacity: 0.7;
  transition: filter .2s ease, opacity .2s ease;
}
.cert-logo:hover, .brand-logo:hover { filter: grayscale(0%); opacity: 1; }

/* Brand logo su sfondo scuro (es. wordmark bianco RSF, non leggibile su sfondo chiaro) */
.brand-logo-dark-wrap {
  background: var(--color-dark);
  border-radius: 4px;
  padding: 0.75rem 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-logo-dark-wrap .brand-logo {
  filter: none;
  opacity: 0.9;
  max-height: 40px;
}
.brand-logo-dark-wrap:hover .brand-logo { opacity: 1; }

/* Gallery */
.gallery-item { overflow: hidden; border-radius: 4px; margin-bottom: 1.5rem; }
.gallery-item img { width: 100%; height: 220px; object-fit: cover; transition: transform .3s ease; }
.gallery-item:hover img { transform: scale(1.06); }

/* Team */
.team-member { border-left: 3px solid var(--color-primary); padding-left: 1rem; margin-bottom: 1.25rem; }
.team-member h5 { margin-bottom: 0.15rem; }
.team-member small { color: var(--color-muted); }

.team-card { text-align: center; }
.team-avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.3rem;
  margin: 0 auto 1rem;
}
.team-card h5 { font-size: 1rem; margin-bottom: 0.25rem; }
.team-card small { color: var(--color-muted); font-size: 0.8rem; }

/* Sector cards (Chi Siamo) */
.sector-card {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1.5rem 1rem;
  height: 100%;
  width: 100%;
  text-align: center;
  background: var(--color-white);
  transition: transform .2s ease, box-shadow .2s ease;
}
.sector-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(20,36,51,0.10); }
.sector-card .icon-badge {
  margin: 0 auto 0.75rem;
  width: 64px; height: 64px;
  font-size: 1.8rem;
}
.sector-card span { display: block; font-weight: 600; font-size: 0.9rem; }

.lead-text { font-size: 1.1rem; color: var(--color-muted); }

/* Organigramma (albero in puro CSS, colori fedeli allo schema aziendale) */
.org-tree-wrap { padding-bottom: 0.5rem; }
.org-tree {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  justify-content: center;
}
.org-tree > li { display: flex; flex-direction: column; align-items: center; }

.org-row {
  list-style: none;
  margin: 0;
  padding-top: 38px;
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  position: relative;
}
.org-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  height: 38px;
  border-left: 2px solid var(--color-border);
}
.org-row > li {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 38px 6px 0;
  position: relative;
}
.org-row > li::before,
.org-row > li::after {
  content: "";
  position: absolute;
  top: 0;
  right: 50%;
  width: 50%;
  height: 38px;
  border-top: 2px solid var(--color-border);
}
.org-row > li::after {
  right: auto;
  left: 50%;
  border-left: 2px solid var(--color-border);
}
.org-row > li:only-child::before,
.org-row > li:only-child::after { display: none; }
.org-row > li:only-child { padding-top: 0; }
.org-row > li:first-child::before,
.org-row > li:last-child::after { border: 0 none; }
.org-row > li:last-child::before { border-right: 2px solid var(--color-border); }

/* Liste verticali delle funzioni sotto ogni reparto (come nell'organigramma originale) */
.org-children {
  list-style: none;
  margin: 18px 0 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}
.org-children::before {
  content: "";
  position: absolute;
  left: 6px;
  top: -14px;
  bottom: 14px;
  border-left: 2px solid var(--color-border);
}
.org-children li { position: relative; padding-left: 13px; }
.org-children li::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  width: 14px;
  border-top: 2px solid var(--color-border);
}

.org-box {
  display: block;
  width: 98px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.5rem 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1b2a38;
  background: var(--color-white);
  line-height: 1.3;
  overflow-wrap: break-word;
  hyphens: auto;
}
.org-box small { display: block; font-weight: 400; font-size: 0.76rem; }

/* Colori fedeli all'organigramma originale */
.org-box.org-top { width: 114px; background: #8dc63f; border-color: #6ea82f; }
.org-box.org-mid { background: #aecbeb; border-color: #7fa3cc; }
.org-box.org-dept { width: 104px; background: #f6ad80; border-color: #d97a4a; }
.org-box.org-leaf { width: 104px; font-weight: 400; background: var(--color-white); border: 1px solid var(--color-primary); }

@media (max-width: 991.98px) {
  .org-tree-wrap { overflow-x: auto; }
  .org-row { flex-wrap: nowrap; width: max-content; margin: 0 auto; }
  .org-tree { width: max-content; }
}

/* Certificazioni page */
.cert-card {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  height: 100%;
  background: var(--color-white);
}
.cert-card img { width: 100%; border-bottom: 1px solid var(--color-border); }
.cert-card .card-body { padding: 1.5rem; }
.cert-card .cert-meta { font-size: 0.85rem; color: var(--color-muted); }
.cert-card .cert-meta strong { color: var(--color-text); }

/* Tabella macchinari */
.table-macchinari th {
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.table-macchinari td { vertical-align: middle; font-size: 0.92rem; }
.table-macchinari tr.is-new td { background: rgba(20,83,156,0.06); }
.badge-new {
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25em 0.6em;
  border-radius: 2px;
}

/* Contact */
.contact-info-item { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.contact-info-item .icon {
  width: 46px; height: 46px; flex: 0 0 46px;
  background: var(--color-primary); color: var(--color-white);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
#map { height: 420px; width: 100%; border-radius: 4px; z-index: 0; }

/* CTA band */
.cta-band {
  background: var(--color-dark);
  color: var(--color-white);
  padding: 3.5rem 0;
}
.cta-band h2 { color: var(--color-white); }
.cta-band p { text-align: center; }

/* Pagine legali (Privacy / Cookie Policy) */
.legal-content p,
.legal-content li { text-align: justify; }

/* Footer */
.site-footer { background: var(--color-dark); color: #c9d3dc; }
.site-footer a { color: #c9d3dc; text-decoration: none; }
.site-footer a:hover { color: var(--color-white); }
.site-footer h5 { color: var(--color-white); margin-bottom: 1.1rem; }
.site-footer .footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding: 1.25rem 0; font-size: 0.85rem; }
.site-footer .social-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: inline-flex; align-items: center; justify-content: center;
  margin-right: 0.5rem;
}
.site-footer .social-icon:hover { background: var(--color-primary); }

@media (max-width: 767.98px) {
  .hero { min-height: 42vh; }
  .hero h1 { font-size: 2rem; }
}

/* Honeypot anti-spam: nascosto ai reali visitatori, visibile ai bot */
.fematic-hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
