/*
Theme Name: ItaliaWallet
Theme URI: https://italiawallet.it
Author: ItaliaWallet
Description: Tema a blocchi informativo sul Sistema IT-Wallet, il portafoglio digitale italiano. Design pulito sui toni del blu, contenuti modificabili dall'editor.
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
Version: 1.4.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: italiawallet
Tags: full-site-editing, block-patterns, one-column, custom-colors, editor-style
*/

html { scroll-behavior: smooth; }
:where(section, .wp-block-group)[id] { scroll-margin-top: 96px; }

/* Header sticky */
.iw-sticky { position: sticky; top: 0; z-index: 100; margin-block: 0 !important; }
.admin-bar .iw-sticky { top: 32px; }
@media (max-width: 782px) { .admin-bar .iw-sticky { top: 46px; } }
@media (max-width: 600px) { .admin-bar .iw-sticky { top: 0; } }
.iw-sticky + * { margin-block-start: 0 !important; }
.iw-header { position: relative; isolation: isolate; transition: box-shadow .2s ease; background: transparent !important; border-bottom: 1px solid var(--wp--preset--color--line); }
/* Il blur sta su uno pseudo-elemento: un backdrop-filter sull'header bloccherebbe l'overlay del menu mobile */
.iw-header::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(255,255,255,.88); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); }
.iw-header.is-scrolled { box-shadow: 0 8px 24px -16px rgba(11,31,75,.35); }
.iw-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.iw-logo svg { display: block; flex: none; }
.iw-header .wp-block-site-title a { text-decoration: none; }

/* Kicker / eyebrow */
.iw-kicker { display: block; letter-spacing: .08em; text-transform: uppercase; }
.iw-pill { display: inline-flex !important; align-items: center; gap: 8px; border-radius: 999px; padding: 6px 14px !important; }
.iw-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--wp--preset--color--accent); box-shadow: 0 0 0 4px rgba(56,189,248,.25); }

/* Hero */
.iw-hero { position: relative; overflow: hidden; isolation: isolate; }
.iw-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(60% 70% at 85% 20%, rgba(56,189,248,.28), transparent 60%),
  radial-gradient(50% 60% at 10% 100%, rgba(37,99,235,.45), transparent 60%); }
.iw-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: linear-gradient(to bottom, #000 30%, transparent 90%); -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 90%); }
.iw-hero .wp-block-image img { width: 100%; max-width: 520px; height: auto; filter: drop-shadow(0 40px 60px rgba(2,8,40,.45)); }
.iw-stat { border-left: 2px solid rgba(255,255,255,.22); padding-left: 16px; }

/* Cards */
.iw-card { border: 1px solid var(--wp--preset--color--line); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; height: 100%; }
.iw-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -18px rgba(11,31,75,.25); border-color: #c7d6f7; }
.iw-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--wp--preset--color--primary-soft); color: var(--wp--preset--color--primary); margin: 0 0 18px !important; }
.iw-icon svg { width: 24px; height: 24px; }
.wp-block-columns.iw-equal > .wp-block-column > .iw-card { height: 100%; }

/* Steps */
.iw-step-num { font-family: var(--wp--preset--font-family--heading); font-weight: 800; font-size: 14px; letter-spacing: .06em; color: var(--wp--preset--color--primary); }
.iw-flow { counter-reset: none; }

/* Document chips */
.iw-doc { display: flex !important; align-items: center; gap: 14px; }
.iw-doc .iw-icon { margin: 0 !important; flex: none; }
.iw-tag { display: inline-block; font-size: 12px !important; font-weight: 600; padding: 3px 10px !important; border-radius: 999px; }

/* Timeline */
.iw-timeline { position: relative; padding-left: 28px !important; }
.iw-timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--wp--preset--color--primary), var(--wp--preset--color--line)); }
.iw-tl-item { position: relative; }
.iw-tl-item::before { content: ""; position: absolute; left: -28px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--wp--preset--color--primary); }
.iw-tl-item.is-future::before { border-color: var(--wp--preset--color--accent); background: var(--wp--preset--color--accent); }

/* FAQ */
.iw-faq .wp-block-details { border: 1px solid var(--wp--preset--color--line); border-radius: 14px; padding: 18px 22px; background: #fff; }
.iw-faq .wp-block-details summary { font-family: var(--wp--preset--font-family--heading); font-weight: 700; cursor: pointer; list-style: none; position: relative; padding-right: 32px; }
.iw-faq .wp-block-details summary::-webkit-details-marker { display: none; }
.iw-faq .wp-block-details summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 24px; font-weight: 400; color: var(--wp--preset--color--primary); transition: transform .2s; }
.iw-faq .wp-block-details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.iw-faq .wp-block-details[open] summary { margin-bottom: 10px; }

/* CTA band */
.iw-cta { position: relative; overflow: hidden; isolation: isolate; }
.iw-cta::before { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; top: -220px; z-index: -1; border-radius: 50%; background: radial-gradient(circle, rgba(56,189,248,.45), transparent 65%); }
.iw-check li { list-style: none; position: relative; padding-left: 30px; margin-bottom: 10px; }
.iw-check { padding-left: 0 !important; }
.iw-check li::before { content: ""; position: absolute; left: 0; top: 5px; width: 18px; height: 18px; border-radius: 50%; background: var(--wp--preset--color--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B1F4B' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/11px no-repeat; }

/* Sources list */
.iw-sources a { text-decoration: none; }
.iw-sources a:hover { text-decoration: underline; }

/* Footer */
.iw-footer a { color: inherit; text-decoration: none; }
.iw-footer a:hover { text-decoration: underline; }
.iw-disclaimer { border-top: 1px solid rgba(255,255,255,.12); }

/* Buttons */
.wp-block-button__link { transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
.wp-block-button__link:hover { transform: translateY(-1px); }
.is-style-iw-ghost .wp-block-button__link { background: transparent !important; color: #fff !important; border: 1.5px solid rgba(255,255,255,.4) !important; }
.is-style-iw-ghost .wp-block-button__link:hover { border-color: #fff !important; background: rgba(255,255,255,.06) !important; }

@media (max-width: 781px) {
  .iw-hero h1 { font-size: 2.4rem !important; }
  .iw-hide-mobile { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .iw-card, .wp-block-button__link { transition: none; } }
.iw-plain { list-style: none; padding-left: 0 !important; }
@media (max-width: 600px) {
  .iw-stat { padding-left: 10px; }
  .iw-stat p:first-child { font-size: 1.3rem !important; }
  .iw-stat p + p { font-size: 0.75rem !important; }
}

/* ===== Cookie banner ===== */
.iw-cc { position: fixed; inset: auto 0 0 0; z-index: 9999; display: flex; justify-content: center; padding: 16px; pointer-events: none; opacity: 0; transform: translateY(16px); transition: opacity .2s ease, transform .2s ease; }
.iw-cc.is-open { opacity: 1; transform: none; }
.iw-cc[hidden] { display: none; }
.iw-cc-banner { pointer-events: auto; position: relative; width: 100%; max-width: 920px; max-height: calc(100vh - 32px); overflow: auto; background: #fff; color: var(--wp--preset--color--ink); border: 1px solid var(--wp--preset--color--line); border-radius: 18px; box-shadow: 0 24px 60px -20px rgba(7,21,54,.45); padding: 22px 24px 20px; font-size: 0.9rem; line-height: 1.55; }
.iw-cc-title { font-family: var(--wp--preset--font-family--heading); font-weight: 800; font-size: 1.05rem; color: var(--wp--preset--color--navy); margin: 0 32px 6px 0; }
.iw-cc-text { margin: 0; color: var(--wp--preset--color--muted); }
.iw-cc-text a { color: var(--wp--preset--color--primary); }
.iw-cc-x { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; font-size: 24px; line-height: 1; color: var(--wp--preset--color--muted); cursor: pointer; }
.iw-cc-x:hover { background: var(--wp--preset--color--surface); color: var(--wp--preset--color--navy); }
.iw-cc-prefs { display: grid; gap: 10px; margin-top: 16px; }
.iw-cc-prefs[hidden] { display: none; }
.iw-cc-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--wp--preset--color--line); border-radius: 12px; background: var(--wp--preset--color--surface); cursor: pointer; color: var(--wp--preset--color--muted); }
.iw-cc-opt strong { color: var(--wp--preset--color--navy); }
.iw-cc-opt input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--wp--preset--color--primary-bright); flex: none; }
.iw-cc-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 16px; }
.iw-cc-btn { font: 650 0.92rem/1 var(--wp--preset--font-family--heading); padding: 12px 20px; border-radius: 10px; border: 1.5px solid var(--wp--preset--color--primary-bright); background: var(--wp--preset--color--primary-bright); color: #fff; cursor: pointer; min-width: 132px; }
.iw-cc-btn:hover { background: var(--wp--preset--color--primary); border-color: var(--wp--preset--color--primary); }
.iw-cc-btn:focus-visible, .iw-cc-x:focus-visible, .iw-cc-opt input:focus-visible { outline: 3px solid var(--wp--preset--color--accent); outline-offset: 2px; }
.iw-cc-ghost { background: #fff; color: var(--wp--preset--color--primary); }
.iw-cc-ghost:hover { background: var(--wp--preset--color--primary-soft); color: var(--wp--preset--color--primary); }
.iw-cc-link { background: transparent; border-color: transparent; color: var(--wp--preset--color--primary); min-width: 0; margin-right: auto; padding-left: 0; text-decoration: underline; text-underline-offset: 3px; }
.iw-cc-link:hover { background: transparent; border-color: transparent; color: var(--wp--preset--color--navy); }
.iw-cc-banner:not(.is-expanded) [data-iw-action="save"], .iw-cc-banner.is-expanded [data-iw-action="customize"] { display: none; }
@media (max-width: 600px) {
  .iw-cc { padding: 10px; }
  .iw-cc-banner { padding: 18px 16px 16px; font-size: 0.85rem; }
  .iw-cc-actions { justify-content: stretch; }
  .iw-cc-btn { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .iw-cc-link { flex-basis: 100%; text-align: left; margin: 0; }
}
@media (prefers-reduced-motion: reduce) { .iw-cc { transition: none; } }

/* Pagine legali */
.iw-legal h2 { font-size: var(--wp--preset--font-size--x-large); margin-top: 2.2em; }
.iw-legal h3 { margin-top: 1.6em; }
.iw-legal table { font-size: 0.9rem; }
.iw-legal td, .iw-legal th { border: 1px solid var(--wp--preset--color--line); padding: 10px 12px; vertical-align: top; }
.iw-legal th { background: var(--wp--preset--color--surface); text-align: left; }

/* Logo */
.iw-logo-img { line-height: 0; }
.iw-logo-img a { display: inline-block; }
.iw-logo-img img { height: auto; display: block; }
.iw-header .iw-logo-img img { width: 148px !important; }
.iw-footer .iw-logo-img img { width: 180px !important; }
@media (max-width: 600px) { .iw-header .iw-logo-img img { width: 122px !important; } }

/* Landing / Homepage come pagina */
.iw-landing .wp-block-post-content > * { margin-block: 0; }
.iw-landing > .wp-block-post-content { margin-block: 0; }

/* ===== Navigazione: desktop vs burger ===== */
nav.iw-nav-mobile { display: none !important; }
@media (max-width: 1000px) {
  nav.iw-nav-desktop, .iw-nav-cta { display: none !important; }
  nav.iw-nav-mobile { display: flex !important; }
}
.iw-nav-mobile .wp-block-navigation__responsive-container-open { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; color: var(--wp--preset--color--navy); }
.iw-nav-mobile .wp-block-navigation__responsive-container-open:hover { background: var(--wp--preset--color--primary-soft); }
.iw-nav-mobile .wp-block-navigation__responsive-container-open svg { width: 28px; height: 28px; }
.iw-nav-mobile .wp-block-navigation__responsive-container.is-menu-open {
  background: linear-gradient(160deg,#071536 0%,#0B1F4B 60%,#12307A 100%) !important; color: #fff !important;
  padding: 24px clamp(20px, 6vw, 48px) 32px !important;
}
.iw-nav-mobile .is-menu-open .wp-block-navigation__responsive-container-close { color: #fff; top: 20px; right: 20px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.08); }
.iw-nav-mobile .is-menu-open .wp-block-navigation__responsive-container-close svg { width: 26px; height: 26px; }
.iw-nav-mobile .is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 64px !important; align-items: stretch !important; }
.iw-nav-mobile .is-menu-open .wp-block-navigation__container { gap: 0 !important; width: 100%; align-items: stretch !important; }
.iw-nav-mobile .is-menu-open .wp-block-navigation-item { width: 100%; border-bottom: 1px solid rgba(255,255,255,.1); }
.iw-nav-mobile .is-menu-open .wp-block-navigation-item__content { display: flex !important; justify-content: space-between; align-items: center; width: 100%; padding: 16px 2px !important; font-family: var(--wp--preset--font-family--heading); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; color: #fff !important; }
.iw-nav-mobile .is-menu-open .wp-block-navigation-item__content::after { content: "→"; color: var(--wp--preset--color--accent); font-weight: 400; }
.iw-nav-mobile .is-menu-open .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--accent) !important; }
body:has(.iw-nav-mobile .is-menu-open) .iw-cc { display: none; }
