/* =====================================================================
   Nahweb — integrazioni al tema Webency originale
   (accessibilità, form, cookie banner, pagine interne, FAQ, legal)
   ===================================================================== */
:root { --nw-accent: var(--tj-color-theme-primary, #5f39ff); --nw-accent2: var(--tj-color-theme-secondary, #20d9a1); --nw-muted: #6b6b6b; }

/* Immagini con width/height reali: niente deformazioni, spazio riservato (CLS) */
img[width][height] { height: auto; }
.preloader { display: none !important; }

/* Titoli con dimensione del tema ma livello semantico corretto */
h2.nw-h4, h3.nw-h4, p.nw-h4 { font-size: var(--tj-fs-h4); }
h2.nw-h5, h3.nw-h5 { font-size: var(--tj-fs-h5); }
.auother-text p.test-title { font-family: var(--tj-ff-heading); font-weight: var(--tj-fw-medium); margin-bottom: 6px; }

/* Accessibilità */
.sa-skip { position: absolute; left: -9999px; top: 0; z-index: 10000; background: var(--nw-accent); color: #fff; padding: 10px 16px; border-radius: 6px; }
.sa-skip:focus { left: 10px; top: 10px; color: #fff; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [role="button"]:focus-visible { outline: 3px solid var(--nw-accent2); outline-offset: 2px; }

/* Hero delle pagine interne: breadcrumb + H1 */
.nw-inner-hero { padding-top: 190px; padding-bottom: 70px; min-height: 0; }
.nw-inner-hero .hero-image-group { min-height: 220px; }
.nw-page-title { color: #fff; font-size: clamp(32px, 4.4vw, 56px); line-height: 1.15; margin: 0; }
.nw-breadcrumb ol { list-style: none; margin: 0 0 14px; padding: 0; font-size: 14px; color: rgba(255,255,255,.75); }
.nw-breadcrumb li { display: inline; }
.nw-breadcrumb li + li:before { content: "›"; padding: 0 8px; color: rgba(255,255,255,.5); }
.nw-breadcrumb a { color: rgba(255,255,255,.85); }
.nw-breadcrumb a:hover { color: var(--nw-accent2); }
@media (max-width: 991px) { .nw-inner-hero { padding-top: 140px; padding-bottom: 40px; } .nw-inner-hero .hero-image-group { display: none; } }

/* Contenuto delle pagine (come il vecchio blocco #scroll-bottom) */
.nw-content { padding-top: 70px; padding-bottom: 20px; }
.nw-content img { max-width: 100%; height: auto; }
.nw-content iframe { max-width: 100%; }
.nw-content h2 { margin-bottom: 20px; }
.nw-lead { font-size: 18px; color: var(--tj-color-common-black); }
.nw-kicker { text-transform: uppercase; letter-spacing: 2px; font-size: 13px; color: var(--nw-accent); margin-bottom: 6px; }
.nw-subtitle { font-size: var(--tj-fs-h3); margin-bottom: 10px; }
.nw-meta { color: var(--nw-muted); font-size: 14px; }
.nw-article-body { text-align: justify; margin-bottom: 20px; }
.nw-article-body h2, .nw-article-body h3 { margin-top: 26px; }
.nw-aside { text-align: center; }
.nw-gallery a { display: block; margin-bottom: 16px; border-radius: 12px; overflow: hidden; }
.nw-gallery img { width: 100%; height: auto; transition: transform .4s; }
.nw-gallery a:hover img { transform: scale(1.03); }
.nw-downloads { text-align: left; }
.nw-downloads li { border-bottom: 1px solid #eee; padding: 10px 0; }
.nw-downloads i { color: #e3342f; font-size: 26px; vertical-align: middle; margin-right: 6px; }
.nw-related { margin-top: 50px; }
.nw-listing { padding-top: 70px; }
.tj-blog-item.nw-noimg .blog-content-area { border-top: 4px solid var(--nw-accent); }
.nw-pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin: 10px 0 40px; flex-wrap: wrap; }
.nw-pager-n { color: var(--nw-muted); }
.nw-btn-sm { padding: 0 22px !important; line-height: 46px !important; }

/* Recapiti (pagina Contatti) */
.nw-recapiti { background: var(--tj-color-grey-5, #fafafc); border: 1px solid var(--tj-color-light-7, #e4e1ff); border-radius: 16px; padding: 28px; }
.nw-recapiti h3 { font-size: var(--tj-fs-h5); margin-bottom: 16px; }
.nw-recapiti li { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; color: var(--tj-color-common-black); }
.nw-recapiti i { color: var(--nw-accent); width: 20px; margin-top: 4px; }

/* FAQ */
.nw-faq-section { padding: 110px 0 100px; }
.nw-faq .accordion-item { border: 1px solid var(--tj-color-light-7, #e4e1ff); border-radius: 12px !important; margin-bottom: 12px; overflow: hidden; }
.nw-faq .accordion-header { margin: 0; font-size: var(--tj-fs-h5); }
.nw-faq .accordion-button { font-family: var(--tj-ff-heading); font-weight: var(--tj-fw-medium); font-size: 18px; color: var(--tj-color-heading-primary); padding: 20px 24px; }
.nw-faq .accordion-button:not(.collapsed) { background: var(--tj-color-light-2, #f8f7ff); color: var(--nw-accent); box-shadow: none; }
.nw-faq .accordion-button:focus { box-shadow: 0 0 0 3px rgba(95,57,255,.2); }
.nw-faq .accordion-body { padding: 4px 24px 20px; }
.nw-faq .accordion-body p:last-child { margin-bottom: 0; }

/* Portfolio: griglia a 3 colonne (prima i riquadri erano dentro tabelle) */
.portfolio-items .portfolio-single-item .portfolio-image img { width: 100%; height: auto; }

/* Ricerca */
.nw-search { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.nw-search input { flex: 1 1 240px; border-radius: 8px; padding: 14px 18px; }
.nw-result { border-bottom: 1px solid #eee; padding: 14px 0; }
.tj-search-box form { position: relative; }
.tj-search-box button { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: inherit; }

/* Pagine legali */
.sa-legal .sa-legal-meta { color: var(--nw-muted); font-size: 14px; }
.sa-legal h3 { font-size: 22px; margin-top: 28px; }
.sa-table { font-size: 14px; }
.sa-table th { background: var(--tj-color-light-2, #f8f7ff); }

/* Form contatti (stile del tema) */
.contact-form-box .form-input input[type=tel], .contact-form-box .form-input input[type=search] { width: 100%; border-radius: 8px; padding: 17px 20px; background: var(--tj-color-grey-5); border: 1px solid var(--tj-color-light-7); }
.contact-form-box .form-input input[readonly] { color: var(--nw-accent); font-weight: 700; }
.sa-contact .sa-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.sa-contact .sa-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; margin-bottom: 12px; }
.sa-contact .sa-check input { margin-top: 4px; flex: 0 0 auto; width: 16px; height: 16px; accent-color: var(--nw-accent); }
.sa-contact .sa-check label { margin: 0; color: var(--tj-color-text-body); }
.sa-contact .sa-check a { text-decoration: underline; }
.sa-contact [aria-invalid="true"] { border-color: #e74c3c !important; box-shadow: 0 0 0 2px rgba(231,76,60,.2); }
.sa-contact .sa-field-err { color: #d93025; font-size: 13px; margin: 6px 0 0; }
.sa-captcha label { color: var(--tj-color-common-black); font-weight: 600; }
.sa-captcha input[name="captcha"] { text-align: center; font-size: 18px; font-weight: 700; }
.sa-form-msg { padding: 14px 16px; margin-bottom: 16px; border-radius: 8px; font-weight: 600; }
.sa-form-msg.is-ok, .sa-form-msg .sa-ok { background: #e8f8ee; color: #17803d; }
.sa-form-msg.is-err, .sa-form-msg .sa-err { background: #fdecea; color: #b3261e; }
.sa-form-msg p { margin: 0; }
.sa-contact button[disabled] { opacity: .6; cursor: wait; }
.sa-privacy-form { max-width: 640px; margin: 20px 0; }
.sa-privacy-form select, .sa-privacy-form input:not([type=checkbox]), .sa-privacy-form textarea { width: 100%; border-radius: 8px; padding: 14px 18px; background: var(--tj-color-grey-5); border: 1px solid var(--tj-color-light-7); }
.sa-privacy-form p { margin-bottom: 14px; }
.nw-promo { max-width: 100%; background: #fff; border-radius: 16px; padding: 28px; box-shadow: 0 10px 40px rgba(14,14,14,.08); }

/* Pulsante WhatsApp (prima: widget con Font Awesome 4 da CDN esterno) */
.nw-whatsapp { position: fixed; right: 20px; bottom: 90px; z-index: 9990; width: 56px; height: 56px; border-radius: 50%; background: #25d366; color: #fff !important; display: flex; align-items: center; justify-content: center; font-size: 30px; box-shadow: 0 6px 18px rgba(0,0,0,.25); transition: transform .2s; }
.nw-whatsapp:hover { transform: scale(1.08); }

/* Link "Modifica" per l'admin loggato */
.sa-admin-edit { position: fixed; left: 16px; bottom: 16px; z-index: 9998; background: var(--nw-accent); color: #fff !important; padding: 10px 16px; border-radius: 30px; box-shadow: 0 4px 14px rgba(0,0,0,.3); font-weight: 600; }

/* ---------------- Cookie banner ---------------- */
.sa-cc[hidden], .sa-cc [hidden] { display: none !important; }
.sa-cc-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 9999; max-width: 980px; margin: 0 auto; background: #fff; color: #222; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.35); padding: 22px 24px 18px; font-size: 14px; line-height: 1.5; }
.sa-cc-title { font-size: 17px; font-weight: 700; margin: 0 30px 6px 0; color: #111; }
.sa-cc-banner p { margin: 0 0 12px; }
.sa-cc a { color: var(--nw-accent); text-decoration: underline; }
.sa-cc-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.sa-cc-btn { border: 2px solid #222; background: #fff; color: #222; padding: 9px 18px; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 14px; min-width: 130px; }
.sa-cc-btn:hover { background: #222; color: #fff; }
.sa-cc-btn[data-cc="accept"], .sa-cc-btn[data-cc="reject"] { background: #222; color: #fff; }
.sa-cc-btn[data-cc="accept"]:hover, .sa-cc-btn[data-cc="reject"]:hover { background: var(--nw-accent); border-color: var(--nw-accent); }
.sa-cc-x { position: absolute; top: 8px; right: 12px; background: none; border: 0; font-size: 28px; line-height: 1; color: #555; cursor: pointer; padding: 4px 8px; }
.sa-cc-modal { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sa-cc-panel { position: relative; background: #fff; color: #222; border-radius: 12px; max-width: 560px; width: 100%; max-height: 90vh; overflow: auto; padding: 24px; font-size: 14px; }
.sa-cc-cat { border: 1px solid #e5e5e5; border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; }
.sa-cc-cat label { margin: 0; cursor: pointer; font-weight: 400; }
.sa-cc-cat p { margin: 6px 0 0; color: #555; font-size: 13px; }
.sa-cc-small { margin: 12px 0 0; font-size: 12px; text-align: right; }
@media (max-width: 600px) { .sa-cc-btn { flex: 1 1 100%; } .sa-cc-banner { left: 8px; right: 8px; bottom: 8px; padding: 18px; } }
@media (prefers-reduced-motion: reduce) { .pulse, .shake-y, .jump { animation: none !important; } }
.sa-contact form.row > .tj-contact-button { align-self: flex-end; }
.sa-contact .sa-captcha label { white-space: nowrap; }
.nw-hero-lead { color: rgba(255,255,255,.8); font-size: 18px; margin: 14px 0 0; max-width: 620px; }
