/*
 Theme Name: New Polo Design Child Theme
 Theme URI: https://ticinoweb.com
 Description: Child theme di ticinoWEB AI Theme per New Polo Design 360° (Riazzino, Ticino): comunicazione visiva, stampa e design. Design fedele al sito originale, contenuti dal pannello ticinoWEB CMS.
 Author: ticinoWEB
 Author URI: https://ticinoweb.com
 Template: ticinoweb-ai-theme
 Version: 1.0.5
 Text Domain: new-polo-design-child-theme
 License: GNU General Public License v2 or later
 License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* Il resto del design e' in assets/css/app.css (CSS compilato del sito originale).
   Qui solo cio' che in WordPress sostituisce JavaScript e animazioni dell'originale. */

/* Browser meno recenti (Firefox < 127, Safari < 16.2, Chrome < 111): "to bottom right in oklab" non e'
   valido e l'intero sfondo sfumato sparisce (testi bianchi su fondo bianco). Senza "in oklab" lo sfondo funziona ovunque. */
@supports not (background-image: linear-gradient(in oklab, red, red)) {
  .bg-gradient-to-b  { --tw-gradient-position: to bottom; }
  .bg-gradient-to-br { --tw-gradient-position: to bottom right; }
  .bg-gradient-to-r  { --tw-gradient-position: to right; }
  .bg-gradient-to-t  { --tw-gradient-position: to top; }
  .bg-gradient-to-tr { --tw-gradient-position: to top right; }
}

html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 6rem; }
.admin-bar .npd-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .npd-header { top: 46px; } }
:root { --bizmart-bar-h: 0rem; }

/* Logo dell'header: grande, proporzioni del file caricato */
.npd-logo { height: 3rem; width: auto; max-width: 62vw; }
@media (min-width: 768px) { .npd-logo { height: 3.5rem; max-width: none; } }

/* Barra di avanzamento della lettura */
.npd-progress { transform: scaleX(0); transition: transform .1s linear; }

/* Entrata della prima schermata */
@keyframes npd-in { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
.npd-in { animation: npd-in .6s ease-out both; animation-delay: var(--d, 0s); }
@keyframes npd-spin { to { transform: rotate(360deg); } }
.npd-spin-slow { animation: npd-spin 100s linear infinite; }
.npd-spin-slower { animation: npd-spin 150s linear infinite reverse; }
@media (prefers-reduced-motion: reduce) {
  .npd-sheet, .npd-overlay-sheet { animation: none; }
  html { scroll-behavior: auto; }
  .npd-in, .npd-spin-slow, .npd-spin-slower { animation: none; }
}

/* Selettore lingua */
.npd-lang-menu { position: absolute; right: 0; top: calc(100% + .5rem); min-width: 10rem; background: #fff; border: 1px solid hsl(var(--border)); border-radius: .75rem; box-shadow: 0 10px 30px rgb(0 0 0 / .12); padding: .25rem; z-index: 60; list-style: none; margin: 0; }
.npd-lang-menu[hidden] { display: none; }

/* FAQ */
.npd-faq-item.is-open { border-color: hsl(var(--primary) / .4); box-shadow: 0 4px 6px -1px rgb(0 0 0 / .1); }
.npd-faq-item.is-open .npd-faq-btn svg { transform: rotate(180deg); }

/* Recensioni */
.npd-slide { animation: npd-in .4s ease-out both; }

/* Pannelli a comparsa */
.npd-overlay { position: fixed; inset: 0; z-index: 80; background: rgb(0 0 0 / .8); display: flex; align-items: flex-end; justify-content: center; }
.npd-overlay[hidden] { display: none; }
.npd-overlay-center { align-items: center; padding: 1rem; }
.npd-overlay-sheet { z-index: 45; box-sizing: border-box; padding-top: 5rem; }
.npd-sheet { position: relative; width: 100%; max-height: 100%; display: flex; flex-direction: column; background: hsl(var(--background)); border-radius: 28px 28px 0 0; box-shadow: 0 -12px 48px rgb(0 0 0 / .45); overflow: hidden; animation: npd-sheet .55s cubic-bezier(.22, 1, .36, 1) both; outline: none; }
.npd-sheet-body { overflow-y: auto; overscroll-behavior: contain; }
@keyframes npd-sheet { from { transform: translateY(75%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes npd-fade { from { opacity: 0; } to { opacity: 1; } }
.npd-overlay-sheet { animation: npd-fade .4s ease-out both; }
.npd-handle { width: 64px; height: 6px; border-radius: 9999px; background: hsl(var(--foreground) / .25); margin: .75rem auto .6rem; flex-shrink: 0; }
.npd-sheet .npd-close { top: 1rem; right: 1rem; width: auto; height: 2.75rem; padding: 0 1.1rem 0 .85rem; gap: .45rem; font-size: .95rem; font-weight: 700; background: #fff; box-shadow: 0 4px 16px rgb(0 0 0 / .35); }
.npd-modal { position: relative; width: 100%; max-width: 44rem; max-height: calc(100dvh - 2rem); overflow-y: auto; overscroll-behavior: contain; background: #fff; border-radius: 1.25rem; padding: 2rem 1.5rem; box-shadow: 0 25px 60px rgb(0 0 0 / .35); animation: npd-in .25s ease-out; outline: none; }
.npd-modal-sm { max-width: 32rem; }
@media (min-width: 640px) { .npd-modal { padding: 2.5rem; } }
.npd-close { position: absolute; top: .75rem; right: .75rem; z-index: 5; width: 2.5rem; height: 2.5rem; border-radius: 9999px; display: flex; align-items: center; justify-content: center; background: rgb(255 255 255 / .9); color: hsl(var(--foreground)); box-shadow: 0 2px 8px rgb(0 0 0 / .2); }
.npd-close:hover { background: hsl(var(--accent)); color: #fff; }
body.npd-lock { overflow: hidden; }

/* Moduli */
.npd-field { display: block; }
.npd-field > span { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .5rem; color: hsl(var(--foreground)); }
.npd-field > em { display: block; font-style: normal; font-size: .8rem; color: #dc2626; margin-top: .25rem; min-height: 0; }
.npd-input { width: 100%; min-height: 3rem; border: 1px solid hsl(var(--input)); border-radius: .75rem; background: #fff; padding: .6rem .9rem; font-size: 1rem; color: hsl(var(--foreground)); outline: none; transition: box-shadow .15s, border-color .15s; font-family: inherit; }
textarea.npd-input { resize: none; }
.npd-input:focus { border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / .25); }
.npd-input[aria-invalid="true"] { border-color: #dc2626; }
.npd-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* Pagine interne */
.npd-prose h2, .npd-prose h3 { font-weight: 700; color: hsl(var(--foreground)); margin: 2rem 0 .75rem; }
.npd-prose h2 { font-size: 1.5rem; } .npd-prose h3 { font-size: 1.2rem; }
.npd-prose p, .npd-prose ul, .npd-prose ol { margin: 0 0 1rem; }
.npd-prose ul { list-style: disc; padding-left: 1.5rem; } .npd-prose ol { list-style: decimal; padding-left: 1.5rem; }
.npd-prose a { color: hsl(var(--primary)); text-decoration: underline; }

/* Messaggio di esito della newsletter: nessuno spazio finche' e' vuoto */
[data-npd-newsletter-msg]:empty { display: none; }

/* Banner cookie del parent con lo stile del sito: colori, bordi, pulsanti a pillola, font Inter.
   Selettori con "body" per prevalere sullo <style> che il parent stampa nell'head. */
body { --tw-cookie-primary: hsl(var(--primary)); }
body .tw-cookie-banner, body .tw-cookie-modal { font-family: 'Inter', system-ui, sans-serif; }
body .tw-cookie-banner {
  background: rgb(255 255 255 / .96); border: 1px solid hsl(var(--border)); border-radius: 1rem;
  box-shadow: 0 20px 50px rgb(10 29 58 / .28), 0 4px 12px rgb(10 29 58 / .08);
  bottom: 1.25rem; max-width: 42rem; padding: 1.25rem 1.5rem;
}
body .tw-cookie-text { color: hsl(var(--foreground) / .8); font-size: .9rem; }
body .tw-cookie-text a { color: hsl(var(--primary)); font-weight: 600; }
body .tw-cookie-btn { font-family: inherit; border-radius: 9999px; padding: .65rem 1.4rem; font-weight: 700; font-size: .875rem; }
body .tw-cookie-btn-decline { background: transparent; color: hsl(var(--muted-foreground)); }
body .tw-cookie-btn-decline:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
body .tw-cookie-btn-customize { background: #fff; border: 2px solid hsl(var(--primary)); color: hsl(var(--primary)); }
body .tw-cookie-btn-customize:hover { background: hsl(var(--primary) / .08); border-color: hsl(var(--primary)); color: hsl(var(--primary)); box-shadow: none; }
body .tw-cookie-btn-accept { background: hsl(var(--primary)); color: #fff; box-shadow: 0 6px 16px hsl(var(--primary) / .35); }
body .tw-cookie-btn-accept:hover { background: hsl(var(--primary) / .9); filter: none; }
body .tw-cookie-modal-content { border-radius: 1.25rem; border: 1px solid hsl(var(--border)); }
body .tw-cookie-modal-header h3 { color: hsl(var(--foreground)); font-weight: 800; }
body .tw-cookie-option-row { background: hsl(var(--muted) / .6); border-color: hsl(var(--border)); }
@media (max-width: 639px) {
  /* sopra la barra di navigazione in basso del sito */
  body .tw-cookie-banner { bottom: calc(var(--mobile-nav-h) + 1.75rem); width: calc(100% - 1.5rem); padding: 1rem 1.1rem; }
  body .tw-cookie-actions { flex-wrap: wrap; justify-content: stretch; }
  body .tw-cookie-btn { flex: 1 1 auto; }
}
