/*
Theme Name:   Hello Elementor Child — OPI Crotone
Theme URI:    https://thinkthevibe.com
Description:  Child theme di Hello Elementor per il sito OPI Crotone. Design system "Ionio" — sviluppo VIBE S.R.L.S.
Author:       VIBE S.R.L.S.
Author URI:   https://thinkthevibe.com
Template:     hello-elementor
Version:      1.0.0
Text Domain:  hello-elementor-child-opi
*/

/* ==========================================================================
   OPI CROTONE — Design system "Ionio"
   Variabili di riferimento (i colori si impostano nei Global di Elementor;
   qui servono solo per il CSS custom)
   ========================================================================== */
:root {
  --opi-petrolio: #0B3C49;
  --opi-petrolio-scuro: #072B35;
  --opi-teal: #10707E;
  --opi-acqua: #E9F4F4;
  --opi-acqua-chiara: #F5FAFA;
  --opi-corallo: #E8604C;
  --opi-corallo-scuro: #D14A36;
  --opi-bordo: #D6E5E5;
  --opi-azzurro: #8FD3D9;
}

/* ==========================================================================
   1. STICKY HEADER (Elementor Header & Footer Builder)
   Il builder applica la classe .ehf-header al body e #masthead al wrapper.
   ========================================================================== */
.ehf-header #masthead {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #fff;
}

/* Ombra leggera quando la pagina scorre sotto l'header */
.ehf-header #masthead {
  box-shadow: 0 1px 0 var(--opi-bordo);
}

/* ==========================================================================
   2. HOVER CARD — aggiungere la classe "opi-card" nel campo
      Avanzate > Classi CSS del container in Elementor
   ========================================================================== */
.opi-card {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.opi-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 52px rgba(11, 60, 73, .16) !important;
  border-color: var(--opi-teal) !important;
}

/* Variante per card su fondo scuro (sezione Formazione) */
.opi-card-dark {
  transition: background .2s ease, border-color .2s ease;
}
.opi-card-dark:hover {
  background: rgba(255, 255, 255, .10) !important;
  border-color: rgba(255, 255, 255, .30) !important;
}

/* ==========================================================================
   3. BOTTONI — classe "opi-btn" sul widget Pulsante (Avanzate > Classi CSS)
   ========================================================================== */
.opi-btn .elementor-button {
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}
.opi-btn:hover .elementor-button {
  transform: translateY(-2px);
}
.opi-btn-corallo .elementor-button {
  box-shadow: 0 8px 24px rgba(232, 96, 76, .35);
}
.opi-btn-corallo:hover .elementor-button {
  background-color: var(--opi-corallo-scuro) !important;
}

/* ==========================================================================
   4. LINEA ECG — animazione del battito
      Classe "opi-pulse" sul widget HTML che contiene l'SVG
   ========================================================================== */
.opi-pulse svg path {
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
  animation: opi-battito 4.5s ease-out forwards;
}
@keyframes opi-battito {
  to { stroke-dashoffset: 0; }
}

/* ==========================================================================
   5. ACCESSIBILITÀ
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .opi-pulse svg path {
    animation: none;
    stroke-dashoffset: 0;
  }
  .opi-card:hover,
  .opi-btn:hover .elementor-button {
    transform: none;
  }
}

/* Focus visibile su link e bottoni (requisito WCAG per ente pubblico) */
a:focus-visible,
button:focus-visible,
.elementor-button:focus-visible {
  outline: 3px solid var(--opi-corallo);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   6. RIFINITURE
   ========================================================================== */
/* Smoothing dei font display */
h1, h2, h3 {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Link nelle liste documenti: micro-slide su hover
   (classe "opi-lista-doc" sul widget Icon List) */
.opi-lista-doc .elementor-icon-list-item a {
  transition: color .15s ease, padding-left .15s ease;
}
.opi-lista-doc .elementor-icon-list-item a:hover {
  color: var(--opi-teal);
  padding-left: 10px;
}

/* ==========================================================================
   7. TEMPLATE ARTICOLO SINGOLO (single.php)
   ========================================================================== */
.opi-single-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 28px;
}

/* Fascia titolo */
.opi-single-hero {
  background: linear-gradient(160deg, var(--opi-petrolio) 0%, var(--opi-teal) 100%);
  color: #fff;
  padding-top: 52px;
}
.opi-breadcrumb {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--opi-azzurro);
  margin-bottom: 18px;
}
.opi-breadcrumb a { color: var(--opi-azzurro); text-decoration: none; }
.opi-breadcrumb a:hover { color: #fff; }
.opi-cat-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--opi-corallo);
  color: #fff;
  padding: 5px 14px;
  border-radius: 100px;
  text-decoration: none;
  margin-bottom: 16px;
}
.opi-cat-badge:hover { background: var(--opi-corallo-scuro); color: #fff; }
.opi-single-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.5px;
  color: #fff;
  margin: 0 0 14px;
}
.opi-single-meta {
  font-size: 14.5px;
  color: #D7ECEE;
  padding-bottom: 36px;
}
.opi-pulse-divider { line-height: 0; }
.opi-pulse-divider svg { width: 100%; height: 52px; display: block; }
.opi-pulse-divider svg path {
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
  animation: opi-battito 4s ease-out forwards;
}

/* Corpo articolo */
.opi-single-body { padding: 44px 28px 72px; }
.opi-single-thumb img { border-radius: 16px; margin-bottom: 28px; height: auto; }
.opi-single-content {
  font-size: 17px;
  line-height: 1.7;
  color: var(--opi-petrolio-scuro);
}
.opi-single-content p { margin: 0 0 18px; }
.opi-single-content h2,
.opi-single-content h3 {
  color: var(--opi-petrolio);
  line-height: 1.2;
  margin: 34px 0 12px;
}
.opi-single-content a { color: var(--opi-teal); font-weight: 600; }
.opi-single-content a:hover { color: var(--opi-petrolio); }

/* Link a PDF e documenti: stile "scheda" automatico */
.opi-single-content a[href$=".pdf"],
.opi-single-content a[href$=".PDF"] {
  display: block;
  background: var(--opi-acqua-chiara);
  border: 1px solid var(--opi-bordo);
  border-left: 4px solid var(--opi-corallo);
  border-radius: 0 12px 12px 0;
  padding: 15px 20px;
  margin: 10px 0;
  text-decoration: none;
  color: var(--opi-petrolio);
  font-weight: 700;
  transition: border-color .15s ease, transform .15s ease;
}
.opi-single-content a[href$=".pdf"]:hover,
.opi-single-content a[href$=".PDF"]:hover {
  border-left-color: var(--opi-teal);
  transform: translateX(4px);
}
.opi-single-content a[href$=".pdf"]::before,
.opi-single-content a[href$=".PDF"]::before {
  content: "📄 ";
}

/* Navigazione precedente/successivo */
.opi-post-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--opi-bordo);
  margin-top: 48px;
  padding-top: 22px;
  font-size: 14.5px;
}
.opi-post-nav a { color: var(--opi-grigio, #5B6E73); text-decoration: none; font-weight: 600; }
.opi-post-nav a:hover { color: var(--opi-teal); }
.opi-post-nav-next { text-align: right; }

.opi-back-link {
  display: inline-block;
  margin-top: 30px;
  background: var(--opi-petrolio);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 26px;
  border-radius: 100px;
  text-decoration: none;
  transition: background .2s ease;
}
.opi-back-link:hover { background: var(--opi-teal); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .opi-pulse-divider svg path { animation: none; stroke-dashoffset: 0; }
  .opi-single-content a[href$=".pdf"]:hover { transform: none; }
}

/* ==========================================================================
   8. ARCHIVIO COMUNICAZIONI (home.php / archive.php)
   ========================================================================== */
.opi-arch-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 28px;
}
.opi-arch-body { padding: 40px 28px 72px; }

/* Filtri a pillole */
.opi-filtri {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.opi-filtro {
  font-weight: 700;
  font-size: 14.5px;
  padding: 8px 20px;
  border-radius: 100px;
  border: 1.5px solid var(--opi-bordo);
  background: #fff;
  color: var(--opi-grigio, #5B6E73);
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.opi-filtro:hover { border-color: var(--opi-teal); color: var(--opi-teal); }
.opi-filtro.attivo {
  background: var(--opi-petrolio);
  border-color: var(--opi-petrolio);
  color: #fff;
}

/* Righe news */
.opi-news-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 26px;
  align-items: center;
  padding: 26px 10px;
  border-top: 1px solid var(--opi-bordo);
  position: relative;
  transition: background .15s ease;
}
.opi-news-row:last-child { border-bottom: 1px solid var(--opi-bordo); }
.opi-news-row:hover { background: var(--opi-acqua-chiara); }

.opi-news-data { text-align: center; }
.opi-news-giorno {
  display: block;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  color: var(--opi-petrolio);
}
.opi-news-mese {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--opi-grigio, #5B6E73);
  margin-top: 4px;
}

.opi-news-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--opi-acqua);
  color: var(--opi-teal);
  padding: 3px 11px;
  border-radius: 100px;
  margin-bottom: 8px;
}
.opi-news-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 5px;
}
.opi-news-title a {
  color: var(--opi-petrolio);
  text-decoration: none;
}
.opi-news-title a::after { content: ""; position: absolute; inset: 0; } /* riga intera cliccabile */
.opi-news-title a:hover { color: var(--opi-teal); }
.opi-news-excerpt {
  font-size: 15px;
  color: var(--opi-grigio, #5B6E73);
  line-height: 1.5;
  margin: 0;
}
.opi-news-freccia {
  color: var(--opi-corallo);
  font-weight: 700;
  font-size: 20px;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .18s ease, transform .18s ease;
}
.opi-news-row:hover .opi-news-freccia { opacity: 1; transform: translateX(0); }

/* Paginazione */
.opi-paginazione { margin-top: 40px; text-align: center; }
.opi-paginazione .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  margin: 0 3px;
  border-radius: 10px;
  border: 1.5px solid var(--opi-bordo);
  font-weight: 700;
  font-size: 15px;
  color: var(--opi-grigio, #5B6E73);
  text-decoration: none;
}
.opi-paginazione .page-numbers.current,
.opi-paginazione .page-numbers:hover {
  background: var(--opi-petrolio);
  border-color: var(--opi-petrolio);
  color: #fff;
}

.opi-nessun-articolo {
  padding: 40px 0;
  color: var(--opi-grigio, #5B6E73);
  font-size: 16px;
}

@media (max-width: 640px) {
  .opi-news-row { grid-template-columns: 64px 1fr; }
  .opi-news-freccia { display: none; }
  .opi-news-giorno { font-size: 24px; }
}

/* ==========================================================================
   9. RISULTATI DI RICERCA (search.php)
   ========================================================================== */
.opi-search-form {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 18px 0 6px;
}
.opi-search-form input[type="search"] {
  flex: 1;
  font-family: inherit;
  font-size: 16px;
  padding: 13px 18px;
  border: 1.5px solid rgba(255,255,255,.35);
  border-radius: 100px;
  background: rgba(255,255,255,.1);
  color: #fff;
}
.opi-search-form input[type="search"]::placeholder { color: rgba(255,255,255,.6); }
.opi-search-form input[type="search"]:focus {
  outline: none;
  border-color: #fff;
  background: rgba(255,255,255,.16);
}
.opi-search-form button {
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 28px;
  border: none;
  border-radius: 100px;
  background: var(--opi-corallo);
  color: #fff;
  cursor: pointer;
  transition: background .2s ease;
}
.opi-search-form button:hover { background: var(--opi-corallo-scuro); }

/* Righe risultato: come le news ma senza blocco data */
.opi-search-row { grid-template-columns: 1fr auto; }

/* Nessun risultato */
.opi-search-vuota { padding: 30px 0 10px; max-width: 640px; }
.opi-search-vuota h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--opi-petrolio);
  letter-spacing: -0.3px;
  margin: 0 0 10px;
}
.opi-search-vuota p { color: var(--opi-grigio, #5B6E73); margin: 0 0 18px; }
.opi-search-suggerimenti {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.opi-search-suggerimenti a {
  display: inline-block;
  font-weight: 700;
  font-size: 14.5px;
  padding: 8px 20px;
  border-radius: 100px;
  border: 1.5px solid var(--opi-bordo);
  color: var(--opi-teal);
  text-decoration: none;
  transition: all .15s ease;
}
.opi-search-suggerimenti a:hover {
  background: var(--opi-petrolio);
  border-color: var(--opi-petrolio);
  color: #fff;
}

/* ==========================================================================
   10. WPFORMS — allineamento al design system
   ========================================================================== */
.wpforms-form .wpforms-field-label {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: var(--opi-petrolio) !important;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 7px !important;
}
.wpforms-form input[type="text"],
.wpforms-form input[type="email"],
.wpforms-form input[type="tel"],
.wpforms-form select,
.wpforms-form textarea {
  font-family: inherit !important;
  font-size: 16px !important;
  padding: 13px 16px !important;
  border: 1.5px solid var(--opi-bordo) !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: var(--opi-petrolio-scuro) !important;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.wpforms-form input:focus,
.wpforms-form select:focus,
.wpforms-form textarea:focus {
  border-color: var(--opi-teal) !important;
  box-shadow: 0 0 0 3px rgba(16, 112, 126, .12) !important;
  outline: none !important;
}
.wpforms-form textarea { min-height: 150px; }
.wpforms-form .wpforms-field-checkbox label,
.wpforms-form .wpforms-field-gdpr-checkbox label {
  font-size: 14px !important;
  font-weight: 400 !important;
  text-transform: none;
  letter-spacing: 0;
  color: var(--opi-grigio, #5B6E73) !important;
}
.wpforms-form button[type="submit"],
.wpforms-form .wpforms-submit {
  font-family: inherit !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  padding: 14px 32px !important;
  border: none !important;
  border-radius: 100px !important;
  background: var(--opi-corallo) !important;
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(232, 96, 76, .30);
  transition: background .2s ease, transform .15s ease !important;
  cursor: pointer;
}
.wpforms-form button[type="submit"]:hover {
  background: var(--opi-corallo-scuro) !important;
  transform: translateY(-2px);
}
.wpforms-form .wpforms-error {
  color: #B3261E !important;
  font-size: 13px !important;
  font-weight: 600;
}
.wpforms-form input.wpforms-error,
.wpforms-form textarea.wpforms-error {
  border-color: #B3261E !important;
}
.wpforms-confirmation-container-full {
  background: var(--opi-acqua) !important;
  border: none !important;
  border-left: 4px solid var(--opi-teal) !important;
  border-radius: 0 12px 12px 0 !important;
  color: var(--opi-petrolio-scuro) !important;
  padding: 22px 26px !important;
}
@media (prefers-reduced-motion: reduce) {
  .wpforms-form button[type="submit"]:hover { transform: none; }
}

/* ==========================================================================
   11. PAGINA 404
   ========================================================================== */
.opi-404-codice {
  font-size: clamp(72px, 12vw, 120px);
  font-weight: 800;
  line-height: 1;
  color: rgba(255, 255, 255, .14);
  letter-spacing: -4px;
  margin-bottom: -14px;
  user-select: none;
}
.opi-404 .opi-single-title { margin-bottom: 8px; }
.opi-404 .opi-single-meta { max-width: 520px; }

.opi-404-titolo {
  font-size: 22px;
  font-weight: 800;
  color: var(--opi-petrolio);
  letter-spacing: -0.3px;
  margin: 0 0 20px;
}
.opi-404-griglia {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 48px;
}
.opi-404-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: var(--opi-acqua-chiara);
  border: 1px solid var(--opi-bordo);
  border-radius: 16px;
  padding: 22px 24px;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.opi-404-card:hover {
  transform: translateY(-4px);
  border-color: var(--opi-teal);
  box-shadow: 0 16px 36px rgba(11, 60, 73, .10);
}
.opi-404-card strong {
  font-size: 17px;
  font-weight: 700;
  color: var(--opi-petrolio);
}
.opi-404-card span {
  font-size: 13.5px;
  color: var(--opi-grigio, #5B6E73);
  line-height: 1.45;
}

.opi-404-ultimi { margin-bottom: 40px; }
.opi-404-lista { list-style: none; padding: 0; margin: 0; }
.opi-404-lista li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 13px 4px;
  border-top: 1px solid var(--opi-bordo);
}
.opi-404-lista li:last-child { border-bottom: 1px solid var(--opi-bordo); }
.opi-404-lista a {
  font-weight: 600;
  font-size: 15.5px;
  color: var(--opi-petrolio);
  text-decoration: none;
}
.opi-404-lista a:hover { color: var(--opi-teal); }
.opi-404-lista time {
  font-size: 13px;
  font-weight: 600;
  color: var(--opi-grigio, #5B6E73);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .opi-404-griglia { grid-template-columns: 1fr; }
  .opi-404-lista li { flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .opi-404-card:hover { transform: none; }
}
