/*
 * Eptamed — Intestazione + Carosello/Card (widget Elementor)
 * Porting delle sezioni #sintomi (carosello) e #inizia (card) di index.html.
 */

/* ─── Intestazione (comune) ─── */

.ept-fs-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 36px;
}

.ept-fs-header--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 56px;
}

.ept-fs-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body, 'Familjen Grotesk', sans-serif);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--c-accent-dark, #9E4A20);
  margin: 0 0 14px;
}

.ept-fs-header--center .ept-fs-eyebrow {
  justify-content: center;
}

.ept-fs-eyebrow-line {
  width: 22px;
  height: 2px;
  flex-shrink: 0;
  background: var(--c-accent, #BC5A29);
  border-radius: 2px;
}

.ept-fs-title {
  font-family: var(--font-heading, 'Familjen Grotesk', sans-serif);
  font-weight: 600;
  font-size: 44px;
  line-height: 1.15;
  color: var(--c-almost-black, #1C2221);
  margin: 0 0 12px;
}

.ept-fs-desc {
  font-family: var(--font-body, 'Familjen Grotesk', sans-serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--c-dark-gray, #4E5655);
  margin: 0;
}

.ept-fs-nav {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  padding-bottom: 4px;
}

/* Elementor "Site Settings > Buttons" applica uno stile globale a tutti i
   <button> nativi della pagina (spesso con !important, per garantire che
   vinca su temi/plugin): queste frecce sono <button>, quindi senza
   protezione ereditano quel colore globale invece del proprio. Le proprietà
   di colore qui sotto sono quindi impostate con !important e passano dalla
   custom property --ept-fs-arr-color (default: navy tema), che il controllo
   Stile "Frecce carosello" del widget può sovrascrivere in editor. */
.ept-fs-arr {
  width: var(--ept-fs-arr-size, 44px) !important;
  height: var(--ept-fs-arr-size, 44px) !important;
  border-radius: 50% !important;
  background: #fff !important;
  border: 1.5px solid var(--c-light-gray, #EBEFEF) !important;
  color: var(--ept-fs-arr-color, var(--c-primary, #134169)) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 !important;
  box-shadow: 0 2px 10px -3px rgba(19, 65, 105, 0.12);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.ept-fs-arr:hover {
  background: var(--ept-fs-arr-color, var(--c-primary, #134169)) !important;
  border-color: var(--ept-fs-arr-color, var(--c-primary, #134169)) !important;
  color: #fff !important;
}

@media (max-width: 767px) {
  .ept-fs-title { font-size: 30px; }
  .ept-fs-desc { font-size: 17px; }
}

/* ─── Carosello ─── */

.ept-fs-track-outer {
  overflow: hidden;
}

.ept-fs-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 8px 4px 24px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ept-fs-track::-webkit-scrollbar {
  display: none;
}

.ept-fs-card-sm {
  flex: 0 0 270px;
  scroll-snap-align: start;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 2px 16px -4px rgba(19, 65, 105, 0.1);
  overflow: hidden;
  border: 1.5px solid transparent;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.ept-fs-card-sm:hover {
  border-color: var(--c-accent, #BC5A29);
  box-shadow: 0 8px 28px -8px rgba(19, 65, 105, 0.2);
}

.ept-fs-card-sm-img {
  height: 200px;
  background: var(--c-primary-light, #EFF2F5);
  overflow: hidden;
}

.ept-fs-card-sm-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ept-fs-card-sm-body {
  display: block;
  padding: 20px;
}

/* Variante cliccabile (apre il modale di dettaglio): stessa card, ma è un
   <button> invece di un <div>/<a> — reset dei default del browser sui
   pulsanti, il box model (flex-basis, ecc.) resta quello di .ept-fs-card-sm
   qui sopra, nessun conflitto di proprietà tra le due classi. !important
   perché Elementor "Site Settings > Pulsanti" stila globalmente ogni
   <button> nativo della pagina (spesso con !important a sua volta): senza
   protezione la card cliccabile erediterebbe quello sfondo invece di
   restare trasparente/bianca come il resto della card. */
.ept-fs-card-sm--clickable {
  text-align: left;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.ept-fs-card-sm--clickable:focus-visible {
  outline: 3px solid var(--c-accent, #BC5A29);
  outline-offset: 2px;
}

.ept-fs-card-sm-title {
  font-family: var(--font-heading, 'Familjen Grotesk', sans-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--c-almost-black, #1C2221);
  margin: 0 0 6px;
  line-height: 1.3;
}

.ept-fs-card-sm-desc {
  font-family: var(--font-body, 'Familjen Grotesk', sans-serif);
  font-size: 13px;
  color: var(--c-dark-gray, #4E5655);
  line-height: 1.5;
  margin: 0 0 14px;
}

.ept-fs-card-sm-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-body, 'Familjen Grotesk', sans-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--c-accent, #BC5A29);
  text-decoration: none;
}

@media (max-width: 599px) {
  .ept-fs-track { padding: 8px 4px 24px; gap: 14px; }
  .ept-fs-card-sm { flex: 0 0 240px; }
  .ept-fs-card-sm-img { height: 160px; }
}

/* ─── Card ─── */

.ept-fs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}

/* Immagine di sfondo + overlay + contenuto sono impilati con CSS Grid
   (stessa singola cella 1/1 per tutti e tre), non con position:absolute:
   con l'assoluto, un <img> (elemento "sostituito") si è dimostrato
   inaffidabile nel riempire un genitore la cui altezza viene da
   min-height + stretch della grid esterna invece che da una "height"
   esplicita (due tentativi falliti, sempre fermo a metà). Con CSS Grid lo
   stretch dei figli sulla cella è il comportamento di default, garantito
   dalla spec, identico per elementi sostituiti e non — niente più
   ambiguità. .ept-fs-card-body usa align-self:end per restare ancorato in
   basso (prima era justify-content:flex-end sul flex-parent) mentre
   immagine e overlay riempiono sempre l'intera cella/card. */
.ept-fs-card {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  border-radius: 24px;
  overflow: hidden;
  min-height: 520px;
  box-shadow: 0 12px 40px -16px rgba(18, 45, 63, 0.18);
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ept-fs-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 56px -20px rgba(18, 45, 63, 0.26);
}

.ept-fs-card--light {
  background: var(--c-beige, #F3ECE2);
}

.ept-fs-card-bg,
.ept-fs-card-overlay,
.ept-fs-card-body {
  grid-area: 1 / 1 / -1 / -1;
}

/* Sfondo come background-image "cover" (non <img>): riempie sempre l'intera
   card zoomando se l'immagine è più bassa/larga, senza dipendere da
   height/object-fit che stili globali del tema (img{height:auto}) possono
   sovrascrivere lasciando la foto ferma a metà. */
.ept-fs-card-bg {
  width: 100%;
  height: 100%;
  background-size: cover !important;
  background-position: center top !important;
  background-repeat: no-repeat !important;
  display: block;
}

.ept-fs-card-overlay {
  width: 100%;
  height: 100%;
}

.ept-fs-card--light .ept-fs-card-overlay {
  background: linear-gradient(to top, var(--c-beige, #F3ECE2) 0%, rgba(243, 236, 226, 0.96) 40%, rgba(243, 236, 226, 0.6) 70%, rgba(243, 236, 226, 0.1) 100%);
}

.ept-fs-card--dark .ept-fs-card-overlay {
  background: linear-gradient(to top, rgba(19, 65, 105, 0.94) 0%, rgba(19, 65, 105, 0.6) 50%, rgba(19, 65, 105, 0.1) 100%);
}

.ept-fs-card-body {
  align-self: end;
  z-index: 1;
  padding: 36px;
}

.ept-fs-card--dark .ept-fs-card-body {
  color: #fff;
}

.ept-fs-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  margin-bottom: 16px;
}

.ept-fs-card-icon svg {
  width: 24px;
  height: 24px;
}

.ept-fs-card--light .ept-fs-card-icon {
  background: rgba(188, 90, 41, 0.12);
  color: var(--c-accent, #BC5A29);
}

.ept-fs-card--dark .ept-fs-card-icon {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.ept-fs-card-title {
  font-family: var(--font-heading, 'Familjen Grotesk', sans-serif);
  font-size: 24px;
  margin: 0 0 12px;
}

.ept-fs-card--light .ept-fs-card-title {
  color: var(--c-primary-dark, #0E2E4B);
}

.ept-fs-card--dark .ept-fs-card-title {
  color: #fff;
}

.ept-fs-card-desc {
  font-family: var(--font-body, 'Familjen Grotesk', sans-serif);
  font-size: 15px;
  line-height: 1.65;
  margin: 0 0 20px;
}

.ept-fs-card--light .ept-fs-card-desc {
  color: var(--c-dark-gray, #4E5655);
}

.ept-fs-card--dark .ept-fs-card-desc {
  color: rgba(255, 255, 255, 0.88);
}

.ept-fs-card-list {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.ept-fs-card-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-body, 'Familjen Grotesk', sans-serif);
  font-size: 14px;
}

.ept-fs-card-list svg {
  flex-shrink: 0;
}

.ept-fs-card--light .ept-fs-card-list li {
  color: var(--c-almost-black, #1C2221);
}
.ept-fs-card--light .ept-fs-card-list svg {
  color: var(--c-accent, #BC5A29);
}

.ept-fs-card--dark .ept-fs-card-list li {
  color: rgba(255, 255, 255, 0.88);
}
.ept-fs-card--dark .ept-fs-card-list svg {
  color: rgba(255, 255, 255, 0.9);
}

.ept-fs-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 10px;
  font-family: var(--font-body, 'Familjen Grotesk', sans-serif);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: background 150ms, border-color 150ms;
}

.ept-fs-card--light .ept-fs-card-cta {
  background: var(--c-accent, #BC5A29);
  color: #fff;
  border: none;
}
.ept-fs-card--light .ept-fs-card-cta:hover {
  background: var(--c-accent-dark, #9E4A20);
}

.ept-fs-card--dark .ept-fs-card-cta {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
}
.ept-fs-card--dark .ept-fs-card-cta:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* ─── Modale di dettaglio (solo modalità Carosello) ─── */

.ept-fs-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ept-fs-modal[hidden] {
  display: none;
}

.ept-fs-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 25, 50, 0.56);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.ept-fs-modal-panel {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 40px 100px -20px rgba(14, 46, 75, 0.38);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  animation: eptFsModalIn 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes eptFsModalIn {
  from { opacity: 0; transform: scale(0.95) translateY(16px); }
  to { opacity: 1; transform: none; }
}

.ept-fs-modal-img-col {
  flex: 0 0 42%;
  background: #F2EBE1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  position: relative;
  overflow: hidden;
}

.ept-fs-modal-img {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
}

.ept-fs-modal-content-col {
  flex: 1;
  padding: 52px 44px 44px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
}

/* .ept-fs-modal-close e .ept-fs-modal-cta-close sono <button> nativi:
   !important necessario per non farli ereditare lo stile globale che
   Elementor "Site Settings > Pulsanti" applica a ogni <button> della
   pagina — altrimenti il colore scelto qui (o nel controllo Stile del
   widget) verrebbe scavalcato. Quello stile globale include anche un
   padding (18px 24px): va sempre ridichiarato qui (padding: 0/proprio
   valore, !important), altrimenti si somma a width/height fissi e
   schiaccia/deforma il bottone — bug reale riscontrato sulla X di
   chiusura, invisibile perché il bottone diventava un ovale sproporzionato. */
.ept-fs-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  padding: 0 !important;
  border-radius: 50% !important;
  background: var(--c-primary, #134169) !important;
  border: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff !important;
  transition: background 150ms;
}
.ept-fs-modal-close:hover {
  filter: brightness(0.85);
}
.ept-fs-modal-close:focus-visible {
  outline: 3px solid var(--c-accent, #BC5A29);
  outline-offset: 2px;
}

.ept-fs-modal-eyebrow {
  font-family: var(--font-body, 'Familjen Grotesk', sans-serif);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-accent, #BC5A29);
  display: block;
  margin-bottom: 8px;
}
.ept-fs-modal-eyebrow:empty {
  display: none;
}

.ept-fs-modal-title {
  font-family: var(--font-heading, 'Familjen Grotesk', sans-serif);
  font-size: clamp(1.375rem, 2vw + 0.5rem, 1.875rem);
  font-weight: 600;
  color: var(--c-almost-black, #1C2221);
  margin: 0 0 16px;
  line-height: 1.2;
}

.ept-fs-modal-desc {
  font-family: var(--font-body, 'Familjen Grotesk', sans-serif);
  font-size: 1rem;
  line-height: 1.72;
  color: var(--c-dark-gray, #4E5655);
  margin: 0;
  flex: 1;
}

.ept-fs-modal-disclaimer {
  font-family: var(--font-body, 'Familjen Grotesk', sans-serif);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--c-medium-gray, #A0ABAB);
  margin: 12px 0 28px;
  line-height: 1.5;
}

.ept-fs-modal-ctas {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ept-fs-modal-cta-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border-radius: 999px;
  background: #BC5A29;
  color: #fff;
  font-family: var(--font-body, 'Familjen Grotesk', sans-serif);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  text-align: center;
  transition: filter 150ms;
}
.ept-fs-modal-cta-primary:hover {
  filter: brightness(0.85);
}

.ept-fs-modal-cta-close {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px !important;
  border-radius: 999px;
  border: 1.5px solid #BC5A29 !important;
  color: #BC5A29 !important;
  font-weight: 700;
  font-size: 0.875rem;
  background: transparent !important;
  cursor: pointer;
  font-family: var(--font-body, 'Familjen Grotesk', sans-serif);
  transition: background 150ms;
}
.ept-fs-modal-cta-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

@media (max-width: 680px) {
  .ept-fs-modal {
    align-items: flex-end;
    padding: 0;
  }
  .ept-fs-modal-panel {
    flex-direction: column;
    border-radius: 20px 20px 0 0;
    max-height: 95vh;
    animation: eptFsModalInMob 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  @keyframes eptFsModalInMob {
    from { transform: translateY(100%); }
    to { transform: none; }
  }
  .ept-fs-modal-img-col { flex: 0 0 auto; padding: 32px 24px 20px; }
  .ept-fs-modal-img { max-height: 150px; }
  .ept-fs-modal-content-col { padding: 24px 24px 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .ept-fs-modal-panel { animation: none !important; }
}
