/* =====================================================================
   Giorgio Pentenero — integrazioni al tema originale
   (carosello, griglia news, accessibilità, form, cookie, pagine interne)
   ===================================================================== */
:root { --nw-accent: #2f78fb; --nw-accent2: #acc700; --gp-navy: #062241; --gp-orange: #e18a5b; --nw-muted: #6b6b6b; }
img[width][height] { height: auto; }

/* Carosello della home (prima: CSS dentro slider.php) */
.carousel-fade .carousel-inner .item { transition-property: opacity; }
.carousel-fade .carousel-inner .item, .carousel-fade .carousel-inner .active.left, .carousel-fade .carousel-inner .active.right { opacity: 0; }
.carousel-fade .carousel-inner .active, .carousel-fade .carousel-inner .next.left, .carousel-fade .carousel-inner .prev.right { opacity: 1; }
.carousel-fade .carousel-inner .next, .carousel-fade .carousel-inner .prev, .carousel-fade .carousel-inner .active.left, .carousel-fade .carousel-inner .active.right { left: 0; transform: translate3d(0, 0, 0); }
.carousel-fade .carousel-control { z-index: 2; }
#carousel { position: relative; }
#carousel.carousel, #carousel .carousel-inner, #carousel .carousel-inner .item { height: 100%; margin-top: 35px; }
#carousel .item:nth-child(1) { background: #74C390; }
#carousel .item:nth-child(2) { background: #51BCE8; }
#carousel .item:nth-child(3) { background: #E46653; }
#carousel .item img { width: 100%; height: auto; }

/* Griglia news della home (prima: CSS e Masonry da CDN dentro news.php) */
.masonry-grid { position: relative; }
.grid-sizer, .grid-item { width: 33.333%; }
@media (max-width: 767px) { .grid-sizer, .grid-item { width: 50%; } }
@media (max-width: 480px) { .grid-sizer, .grid-item { width: 100%; } }
.grid-item { float: left; padding: 10px; box-sizing: border-box; }
.masonry-grid::after { content: ""; display: block; clear: both; }
.grid-item img { width: 100%; height: auto; display: block; }

/* Titoli: livello semantico corretto, stesso aspetto di prima */
h1.gp-h1-as-h4 { font-size: 26px; line-height: 32px; }
h1.gp-h1-as-h2 { font-size: 42px; line-height: 46px; }
h2.gp-h2-as-h1 { font-size: 48px; line-height: 52px; }
h2.gp-h2-as-h3 { font-size: 34px; line-height: 40px; font-weight: 500; }
h2.gp-h2-as-h4 { font-size: 26px; line-height: 32px; }
.section-headline h1.gp-intro-title { font-size: 34px; line-height: 40px; font-weight: 500; margin: -50px 0 20px; text-align: left; color: #fff; max-width: 100%; }
.gp-intro-title small { display: block; font-size: 16px; line-height: 1.4; font-weight: 400; letter-spacing: .5px; color: #d7e86e; margin-top: 8px; }
@media (max-width: 991px) { .section-headline h1.gp-intro-title { font-size: 24px; line-height: 36px; margin-top: 0; } h2.gp-h2-as-h1 { font-size: 34px; line-height: 40px; } }
.gp-page-title { text-align: center; background-color: var(--nw-accent2); color: #000; max-width: 720px; margin: 0 auto 30px; padding: 15px; font-size: 30px; line-height: 1.25; }
.gp-section-title { text-align: center; max-width: 690px; margin: 0 auto; padding: 15px; }

/* Pagine interne */
.gp-spacer { width: 100%; padding: 20px; }
.gp-breadcrumb-wrap { padding-top: 70px; }
.gp-breadcrumb ol { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--nw-muted); }
.gp-breadcrumb li { display: inline; }
.gp-breadcrumb li + li:before { content: "›"; padding: 0 8px; color: #aaa; }
.gp-breadcrumb a { color: var(--nw-muted); }
.gp-breadcrumb a:hover { color: var(--nw-accent); }
.gp-content { padding-top: 20px; }
.gp-content .all-wel-services { margin-top: 10px; }
.gp-content img { max-width: 100%; height: auto; }
.gp-content iframe { max-width: 100%; }
.gp-detail .gp-meta { color: var(--nw-muted); font-size: 14px; margin-bottom: 15px; }
.gp-detail .gp-article-body { margin-bottom: 25px; }
.gp-gallery a { display: block; margin-bottom: 20px; border-radius: 4px; overflow: hidden; }
.gp-gallery img { width: 100%; height: auto; transition: transform .4s; }
.gp-gallery a:hover img { transform: scale(1.03); }
.gp-downloads { list-style: none; padding: 0; margin: 10px 0 25px; }
.gp-downloads li { padding: 8px 0; border-bottom: 1px solid #eee; }
.gp-downloads i { color: #e3342f; font-size: 22px; margin-right: 6px; }
.gp-related { margin-top: 40px; }
.gp-card { background: #fbfbfb; box-shadow: 0 0 25px #d4d9d7; padding: 5px; margin-bottom: 25px; }
.gp-card .gp-card-img { height: 175px; overflow: hidden; display: block; }
.gp-card .gp-card-img img { width: 100%; height: 100%; object-fit: cover; }
.gp-card .gp-card-body { padding: 10px; }
.gp-card .gp-card-title { font-size: 17px; line-height: 1.35; height: 69px; overflow: hidden; margin: 6px 0 8px; font-weight: 500; }
.gp-card .gp-card-title a { color: #151b2c; }
.gp-card .gp-card-title a:hover { color: var(--gp-orange); }
.gp-card p { height: 66px; overflow: hidden; color: #666; font-size: 14px; line-height: 22px; margin-bottom: 8px; }
.gp-card .gp-card-more { font-size: 14px; font-weight: 600; color: var(--gp-navy); }
.gp-card .gp-card-date { font-size: 12px; color: var(--nw-muted); }
.gp-lead { font-size: 17px; text-align: center; max-width: 760px; margin: 0 auto 30px; }
.gp-pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin: 10px 0 40px; clear: both; }
.gp-pager a { border: 1px solid var(--gp-navy); padding: 8px 18px; color: var(--gp-navy); }
.gp-pager a:hover { background: var(--gp-navy); color: #fff; }
.gp-header-btn { margin-top: 30px; }

/* Dettaglio news (ex dettaglio.php) */
.gp-detail-title { font-size: 42px; line-height: 46px; }
.gp-detail-sub { font-size: 18px; color: #555; margin: -5px 0 20px; }
.gp-detail-body { margin-bottom: 25px; }
.gp-dotted { border: 0; border-top: 1px dotted #ccc; margin: 25px 0; }
.gp-pdf a { display: block; text-align: center; margin-bottom: 20px; color: #333; }
.gp-pdf .flaticon-pdf:before { font-size: 90px; color: #f00; margin: 0; }
.gp-pdf-label { display: block; font-size: 12px; padding: 5px; }
.gp-detail-nav { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.gp-detail-nav .quote-btn, .gp-pager .quote-btn, .gp-newsletter-page .quote-btn, .sa-legal .quote-btn, .sa-privacy-form .quote-btn, .gp-search .quote-btn { display: inline-block; background: var(--gp-navy); color: #fff; border: 0; padding: 10px 24px; width: auto; margin: 0; }
.gp-detail-nav .quote-btn:hover, .gp-pager .quote-btn:hover { background: var(--gp-orange); color: #fff; }
.gp-newsletter-page { text-align: center; max-width: 640px; margin: 0 auto 40px; font-size: 17px; }
@media (max-width: 767px) { .gp-detail-title { font-size: 28px; line-height: 34px; } .gp-page-title { font-size: 24px; } h1.gp-h1-as-h2 { font-size: 30px; line-height: 36px; } }

/* Recapiti (pagina Contatti) */
.gp-recapiti { background: #f7f9fc; border-left: 6px solid var(--nw-accent2); padding: 25px 30px; margin-top: 25px; }
.gp-recapiti h2 { font-size: 22px; line-height: 30px; margin-bottom: 15px; }
.gp-recapiti ul { list-style: none; padding: 0; margin: 0; }
.gp-recapiti li { margin-bottom: 10px; display: flex; gap: 10px; }
.gp-recapiti i { color: var(--nw-accent); width: 18px; margin-top: 4px; }
.gp-recapiti .gp-albo { font-size: 13px; color: #555; margin-top: 15px; border-top: 1px solid #e3e7ee; padding-top: 12px; }

/* Accessibilità */
.sa-skip { position: absolute; left: -9999px; top: 0; z-index: 10000; background: var(--gp-navy); color: #fff; padding: 10px 16px; }
.sa-skip:focus { left: 10px; top: 10px; color: #fff; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--nw-accent2); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Ricerca */
.gp-search { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.gp-search input { flex: 1 1 240px; }
.gp-search button { background: var(--gp-navy); color: #fff; border: 0; padding: 0 24px; }
.gp-result { border-bottom: 1px solid #eee; padding: 14px 0; }

/* Modulo contatti (stile del tema: sezione arancione) */
.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: 4px 0 12px; color: #fff; }
.sa-contact .sa-check input { margin-top: 3px; flex: 0 0 auto; width: 16px; height: 16px; }
.sa-contact .sa-check label { margin: 0; font-weight: 400; color: #fff; }
.sa-contact .sa-check a { color: #fff; text-decoration: underline; }
.sa-contact [aria-invalid="true"] { border-color: #b3261e !important; box-shadow: 0 0 0 2px rgba(179,38,30,.35); }
.sa-contact .sa-field-err { color: #fff; background: #b3261e; display: inline-block; font-size: 12px; padding: 2px 8px; margin: 2px 0 8px; }
.sa-contact .sa-captcha label { color: #fff; font-weight: 600; margin-bottom: 6px; display: block; }
.sa-form-msg { padding: 14px 16px; margin-bottom: 16px; 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; }
.quote-area .sa-contact .form-control { margin-bottom: 10px; }
.gp-contact form { margin: 0; }
.gp-contact .sa-captcha input { max-width: 120px; }
.gp-contact .quote-btn { margin-top: 6px; }
.gp-contact .sa-form-msg { margin: 0 15px 16px; }
.sa-privacy-form { max-width: 640px; margin: 20px 0; }
.sa-privacy-form .sa-check, .sa-privacy-form .sa-check label, .sa-privacy-form .sa-check a { color: #333; }
.sa-privacy-form select, .sa-privacy-form input:not([type=checkbox]), .sa-privacy-form textarea { width: 100%; padding: 10px 14px; border: 1px solid #ccd3df; }
.sa-privacy-form p { margin-bottom: 14px; }
.sa-privacy-form button { background: var(--gp-navy); color: #fff; border: 0; padding: 12px 26px; font-weight: 600; }

/* Newsletter (footer) */
.gp-newsletter .sa-form-msg { margin: 10px 0; font-size: 14px; }
.gp-newsletter .sa-check { color: #555; }
.gp-newsletter .sa-check label, .gp-newsletter .sa-check a { color: #2f78fb; }
.gp-newsletter .gp-nl-row { display: flex; }
.gp-newsletter .gp-nl-row input[type=email] { flex: 1 1 auto; }
.gp-newsletter .gp-nl-row button { flex: 0 0 30%; border: none; padding: 4px; background: #5cb85c; color: #fff; }
.gp-newsletter .gp-nl-cap { display: flex; gap: 8px; align-items: center; margin: 10px 0 4px; font-size: 14px; }
.gp-newsletter .gp-nl-cap label { color: #555; font-weight: 400; margin: 0; }
.gp-newsletter .gp-nl-cap input { width: 70px; }
.gp-newsletter .sa-check input { margin-top: 3px; }

/* Pagine legali */
.sa-legal .sa-legal-meta { color: var(--nw-muted); font-size: 14px; }
.sa-legal h2 { font-size: 24px; line-height: 32px; margin-top: 28px; }
.sa-legal h3 { font-size: 20px; line-height: 28px; }
.sa-table { font-size: 14px; }
.sa-table th { background: #f3f6fb; }

/* 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; } }
/* Pulsante preferenze cookie (in basso a sinistra; sopra "Modifica" quando l'admin è loggato) */
.sa-cc-fab { position: fixed; left: 16px; bottom: 16px; z-index: 9980; width: 48px; height: 48px; border-radius: 50%; border: 0; background: #fff; color: var(--nw-accent); box-shadow: 0 6px 18px rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .2s, background .2s, color .2s; }
.sa-cc-fab:hover, .sa-cc-fab:focus-visible { transform: scale(1.08); background: var(--nw-accent); color: #fff; }
.nw-is-admin .sa-cc-fab { bottom: 72px; }
@media print { .sa-cc-fab, .sa-admin-edit { display: none !important; } }

/* Etichette nascoste (Bootstrap 3) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Titoli delle schede: ora sono link (navigazione interna), stesso colore del testo di prima */
.service-content h4 a, .wel-content h4 a { color: inherit; }
.service-content h4 a:hover, .wel-content h4 a:hover { color: var(--gp-orange); }
.quote-area .gp-contact input.form-control { border: 1px solid #fff; border-radius: 3px; height: 54px; margin-bottom: 20px; padding-left: 20px; width: 100%; color: #3d5368; }
.quote-area .gp-contact textarea.form-control { height: 127px; border: 1px solid #fff; border-radius: 3px; margin-bottom: 20px; padding: 15px 20px; }
.gp-contact .sa-captcha input.form-control { height: 44px; margin-bottom: 10px; }
