/* =========================================================
   user.css — Child template Cassiopeia Extended
   Stile personalizzato basato sul mockup del sito
   ========================================================= */

:root {
  --brand-primary: #0d3b8c;
  --brand-primary-dark: #082a66;
  --brand-light-bg: #f3f5f8;
  --brand-dark-bg: #0b1930;
  --brand-text: #22262b;
  --brand-text-light: #5b6470;
  --radius: 8px;
  --shadow-card: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* -------------------------------------------------
   1) TOPBAR — modulo HTML personalizzato, posizione top-a
   ------------------------------------------------- */
.topbar-wrapper {
  background: var(--brand-dark-bg);
  color: #fff;
  font-size: 0.85rem;
  padding: 8px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-contact span {
  margin-right: 20px;
}

.topbar-contact i {
  margin-right: 6px;
}

.topbar-social a {
  color: #fff;
  margin-left: 12px;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.topbar-social a:hover {
  opacity: 1;
}

/* -------------------------------------------------
   TOPBAR — larghezza piena, colore blu, testo con margine da sinistra
   ------------------------------------------------- */
.container-top-a {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
}

.top-a.card {
  border: none !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

.top-a.card .card-body {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}

#mod-custom113 {
  background: var(--brand-primary-dark);
  color: #fff;
  font-size: 0.85rem;
  padding: 10px 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

/* -------------------------------------------------
   2) HERO — modulo HTML personalizzato con suffisso classe: hero-section
   ------------------------------------------------- */

#mod-custom114 {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 60px 40px;
}
#mod-custom114::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 15, 30, 0.75) 0%, rgba(8, 15, 30, 0.25) 60%, rgba(8, 15, 30, 0.05) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.hero-content h1 {
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 18px;
}

.hero-content p {
  font-size: 1.1rem;
  margin-bottom: 28px;
  color: #e6e9ef;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-primary);
  color: #fff;
  padding: 12px 26px;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: background 0.2s ease;
}

.btn-hero:hover {
  background: var(--brand-primary-dark);
  color: #fff;
}

#mod-custom114 {
  background-image: url('/images/hero/ProcedamusSlider.jpg');
  /* ...il resto della regola resta invariato... */
}

.container-banner.full-width {
  margin-bottom: 0 !important;
}

/* -------------------------------------------------
   3) CHI SIAMO — modulo HTML, id: mod-custom116
   ------------------------------------------------- */
#mod-custom116 {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: center;
  padding: 50px 20px;
}

#mod-custom116 .chi-siamo-image {
  flex: 1 1 400px;
}


#mod-custom116 .chi-siamo-image img {
  width: 100%;
  border-radius: var(--radius);
  display: block;
}

#mod-custom116 .chi-siamo-text {
  flex: 1 1 400px;
}

#mod-custom116 .eyebrow {
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

#mod-custom116 .chi-siamo-image img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

#mod-custom116 p {
  color: var(--brand-text-light);
  margin-bottom: 20px;
}

/* -------------------------------------------------
   4) SERVIZI — modulo HTML con suffisso classe: services-section
   ------------------------------------------------- */
#mod-custom115 {
  background: var(--brand-light-bg);
  padding: 50px 20px;
  text-align: center;
}

#mod-custom115 .eyebrow {
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#mod-custom115 h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 30px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.service-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 28px 22px;
  text-align: left;
  transition: transform 0.2s ease;
}

.service-card:hover {
  transform: translateY(-4px);
}

.service-card .icon {
  margin-bottom: 14px;
}

.service-card .icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
}

.service-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.service-card p {
  color: var(--brand-text-light);
  font-size: 0.92rem;
  margin-bottom: 12px;
}

.service-card a {
  color: var(--brand-primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
}

/* -------------------------------------------------
   5) NEWS — usato su mod_articles_news, suffisso classe: news-section
   ------------------------------------------------- */
.news-section {
  padding: 50px 20px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.news-card {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.news-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.news-card .news-body {
  padding: 18px;
}

.news-card .news-date {
  font-size: 0.78rem;
  color: var(--brand-text-light);
  margin-bottom: 6px;
}

.news-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.news-card a.read-more {
  color: var(--brand-primary);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
}

/* -------------------------------------------------
   5) NEWS — modulo HTML, id: mod-custom117
   ------------------------------------------------- */
#mod-custom117 {
  padding: 50px 20px;
}

#mod-custom117 .eyebrow {
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#mod-custom117 h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 10px;
}


/* -------------------------------------------------
   6) CTA BANNER — modulo HTML, id: mod-custom118
   ------------------------------------------------- */
#mod-custom118 {
  background: linear-gradient(90deg, var(--brand-primary), #1a56c4) !important;
  color: #fff;
  padding: 40px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

#mod-custom118 h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff;
}

#mod-custom118 p {
  opacity: 0.9;
  margin: 0;
}

#mod-custom118 .btn-cta {
  background: #fff;
  color: var(--brand-primary);
  padding: 12px 26px;
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

/* -------------------------------------------------
   MAIN-TOP — elimina il wrapper "card" per tutti i moduli
   (Chi siamo, Servizi, News, CTA Banner) e li rende full-width,
   attaccati tra loro senza spazi bianchi
   ------------------------------------------------- */
.container-main-top {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.main-top.card {
  border: none !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

.main-top.card .card-body {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}

/* -------------------------------------------------
   MAIN-TOP — elimina il wrapper "card" per ogni modulo
   (Chi siamo, Servizi, News, CTA Banner)
   ------------------------------------------------- */
.main-top.card {
  border: none !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}

.main-top.card .card-body {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}

.grid-child.container-component {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.site-grid > .grid-child.container-component {
  grid-column: 1 / -1 !important;
}

.site-grid {
  row-gap: 0 !important;
  gap: 0 !important;
}

.main-top.card {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}


/* -------------------------------------------------
   7) FOOTER — 4 colonne (id: 122, 119, 120, 121)
   ------------------------------------------------- */
.container-footer .grid-child {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  padding: 50px 20px;
}

.container-footer h3 {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}

.container-footer p,
.container-footer a {
  color: #d7e0e8;
  font-size: 0.9rem;
}

.container-footer a {
  display: block;
  text-decoration: none;
  margin-bottom: 8px;
}

.container-footer a:hover {
  color: #fff;
}

/* Colonna 1 (logo/descrizione, id 122) ha già l'h3, le altre no: aggiungiamo un titolo via CSS usando il campo Titolo di Joomla nascosto, oppure lascialo così se hai messo l'h3 a mano nell'HTML */

/* -------------------------------------------------
   Responsive
   ------------------------------------------------- */
@media (max-width: 768px) {
  .topbar-wrapper {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  .hero-content h1 {
    font-size: 1.9rem;
  }

  .chi-siamo-section {
    flex-direction: column;
  }
}

/* -------------------------------------------------
   HEADER — logo ridotto e menu in linea
   ------------------------------------------------- */
.header.container-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px 20px;
}

.header.container-header > .grid-child {
  display: flex;
  align-items: center;
}

.header .navbar-brand img {
  height: 48px;
  width: auto;
  max-width: none;
}

.header .mod-menu {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.header .mod-menu .nav-item {
  margin: 0;
}

.header.container-header > .grid-child {
  flex: 0 1 auto;
  width: auto;
}

/* Logo più a sinistra */
.header.container-header {
  padding: 14px 20px 14px 0 !important;
}

.header .navbar-brand,
.header .navbar-brand a.brand-logo {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* Voci di menu in stile "mockup": testo scuro, sottile sottolineatura blu su hover/attivo */
.header .mod-menu .nav-item a,
.header .mod-menu .nav-item span {
  color: var(--brand-text);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  padding-bottom: 6px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.header .mod-menu .nav-item a:hover {
  color: var(--brand-primary);
}

.header .mod-menu .nav-item.active a,
.header .mod-menu .nav-item.current a {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.header.container-header {
  padding-left: 50px !important;
  padding-right: 50px !important;
}

.header.container-header .grid-child {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Elimina lo spazio verticale tra i moduli in main-top */
.grid-child.container-component {
  gap: 0 !important;
}

.main-top.card {
  margin-bottom: 0 !important;
}

/* Footer: sfondo blu scuro come header/topbar */
footer.container-footer {
  background: var(--brand-primary-dark) !important;
}

.container-component .mod-custom {
  margin: 0 !important;
}

.container-component .card-body {
  margin: 0 !important;
  padding: 0 !important;
}

/* Contenuto principale del sito */
.container-component > main {
    width: calc(100% - 48px);
    max-width: 1320px;
    margin: 0 auto !important;
}

/* Margini ridotti su smartphone */
@media (max-width: 767px) {
    .container-component > main {
        width: calc(100% - 30px);
    }
}

footer.container-footer {
  margin: 0 !important;
}

/* Sezione News della homepage */
.moduletable.news-home {
    width: calc(100% - 40px);
    margin-inline: auto;
    box-sizing: border-box;
}

/* Nasconde l'etichetta "News" */
.moduletable.news-home .eyebrow {
    display: none;
}

@media (max-width: 767px) {
    .moduletable.news-home {
        width: calc(100% - 30px);
    }
}

/* -------------------------------------------------
   CERCA — lente a destra del menu, campo che si apre al passaggio
   ------------------------------------------------- */
.header .container-search {
  display: flex;
  align-items: center;
  margin-left: 24px;
}

.header .container-search search {
  display: block;
}

.header .mod-finder {
  display: flex;
  align-items: center;
  margin: 0;
}

/* Etichetta "Cerca nel sito": nascosta alla vista, ma letta dagli screen reader */
.header .mod-finder label.finder {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.header .mod-finder .awesomplete {
  display: block;
  position: relative;
}

.header .mod-finder .input-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: auto;
}

/* Campo di testo: chiuso di default */
.header .mod-finder input[type="text"],
.header .mod-finder input[type="search"] {
  width: 0;
  padding: 0;
  border: none;
  opacity: 0;
  background: transparent;
  transition: width 0.25s ease, opacity 0.25s ease, padding 0.25s ease;
}

/* ...si apre al passaggio del mouse o quando ha il focus */
.header .mod-finder:hover input[type="text"],
.header .mod-finder:hover input[type="search"],
.header .mod-finder:focus-within input[type="text"],
.header .mod-finder:focus-within input[type="search"] {
  width: 200px;
  padding: 6px 12px;
  border: 1px solid #ccd3dd;
  border-radius: 4px;
  background: #fff;
  opacity: 1;
}

/* Pulsante: lente disegnata in SVG, nessuna dipendenza dal font delle icone */
.header .mod-finder button,
.header .mod-finder button.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  border: none;
  border-radius: 4px;
  box-shadow: none;
  font-size: 0;
  color: transparent;
  cursor: pointer;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322262b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='20' y1='20' x2='16.2' y2='16.2'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
}

/* Nasconde l'icona/testo originali dentro il pulsante */
.header .mod-finder button > * {
  display: none;
}

/* Lente blu al passaggio del mouse */
.header .mod-finder button:hover,
.header .mod-finder button:focus-visible {
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230d3b8c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='20' y1='20' x2='16.2' y2='16.2'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
}

/* Suggerimenti di ricerca sopra gli altri elementi */
.header .awesomplete > ul {
  z-index: 50;
}
