/* WP Tabley — stili condivisi blocchi Gutenberg */
.wtb-card { transition: transform .25s cubic-bezier(.25,.8,.25,1), box-shadow .25s cubic-bezier(.25,.8,.25,1); }
.wtb-card:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 0 30px rgba(0,0,0,0.14) !important; }
.wtb-btn { transition: transform .2s ease, box-shadow .2s ease, filter .2s ease; }
.wtb-btn:hover { transform: scale(1.045); filter: brightness(1.07); box-shadow: 0 8px 22px rgba(0,0,0,0.25); }
/* Varianti hover blocco Bottone */
.wtb-btn-hv-lift:hover { transform: translateY(-4px) !important; filter: none !important; box-shadow: 0 14px 30px rgba(0,0,0,0.28) !important; }
.wtb-btn-hv-glow:hover { transform: scale(1.03) !important; filter: none !important; box-shadow: 0 0 26px rgba(251,191,36,0.6) !important; }
.wtb-btn-hv-dark:hover { transform: none !important; filter: brightness(0.85) !important; box-shadow: none !important; }
.wtb-btn-hv-none:hover { transform: none !important; filter: none !important; box-shadow: none !important; }
.wtb-caret { display:inline-block; width:0; overflow:visible; color:#fbbf24; font-weight:400; animation: wtb-blink .9s step-end infinite; }
@keyframes wtb-blink { 0%,100% { opacity:1; } 50% { opacity:0; } }
html, body { overflow-x: hidden; }

/* Galleria */
.wtb-gallery-track { scrollbar-width: none; -ms-overflow-style: none; }
.wtb-gallery-track::-webkit-scrollbar { display: none; }
.wtb-gallery-track.wtb-dragging { cursor: grabbing !important; scroll-behavior: auto !important; }
.wtb-gallery-track.wtb-dragging * { pointer-events: none !important; }

/* Editor: anteprima card galleria */
.wtb-gallery-item-edit { flex: 0 0 240px; background:#fff; border-radius:18px; overflow:hidden; border:1px solid #eef0f3; box-shadow:0 2px 8px rgba(0,0,0,0.06); padding-bottom:16px; }
.wtb-gallery-item-edit img, .wtb-gallery-item-edit video { width:100%; aspect-ratio:9/16; object-fit:cover; display:block; }
.wtb-gallery-item-edit .wtb-media-actions { padding:8px 14px 0; }
.wtb-gallery-item-edit h3 { font-size:16.5px; margin:8px 14px 4px !important; }
.wtb-gallery-item-edit p { font-size:13.5px; margin:0 14px !important; color:#4b5563; }

/* Step "Come funziona" */
.wtb-step { transition: transform .25s ease; }
.wtb-step:hover { transform: translateY(-5px); }

/* Contenitore: i figli non-colonna in direzione riga si dividono lo spazio */
.wtb-cols-row > *:not(.wtb-col) { flex: 1 1 200px; min-width: 200px; }

/* Editor: contenitore in direzione riga -> figli affiancati */
.wtb-cols-ed-r > .block-editor-inner-blocks > .block-editor-block-list__layout {
    display: flex !important; flex-wrap: wrap; gap: var(--wtb-gap, 14px);
}
.wtb-cols-ed-r > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block {
    flex: 1 1 0; min-width: 0; margin-top: 0 !important; margin-bottom: 0 !important;
}
.wtb-col-ed .block-editor-block-list__layout > .wp-block { min-height: 40px; }

/* Regole pagine con hero viola (home + pagine interne con Testa pagina/Hero) */
.wtb-hero-page .site-content, .wtb-hero-page #content, .wtb-hero-page #page { padding-bottom: 0 !important; margin-bottom: 0 !important; padding-top: 0 !important; }
.wtb-hero-page .entry-content, .wtb-hero-page .entry, .wtb-hero-page .ast-article-single,
.wtb-hero-page .ast-separate-container .ast-article-single { margin-bottom: 0 !important; padding-bottom: 0 !important; margin-top: 0 !important; padding-top: 0 !important; }
.wtb-hero-page .site-main, .wtb-hero-page article, .wtb-hero-page main { margin-bottom: 0 !important; padding-bottom: 0 !important; }
.wtb-hero-page .entry-footer, .wtb-hero-page .post-navigation, .wtb-hero-page .comments-area,
.wtb-hero-page .navigation, .wtb-hero-page .entry-title, .wtb-hero-page .wp-block-post-title,
.wtb-hero-page .ast-single-entry-header { display: none !important; }
.wtb-hero-page .wp-site-blocks { padding-bottom: 0 !important; }
.wtb-hero-page .wp-block-template-part { margin-top: 0 !important; margin-bottom: 0 !important; }
.wtb-hero-page .site-footer, .wtb-hero-page footer, .wtb-hero-page #colophon { margin-top: 0 !important; }
.wtb-hero-page:has(.wtb-cta-btns) .site-footer, .wtb-hero-page:has(.wtb-cta-btns) footer, .wtb-hero-page:has(.wtb-cta-btns) #colophon { margin-top: -110px !important; }
.wtb-hero-page .site-footer p, .wtb-hero-page footer p, .wtb-hero-page #colophon p,
.wtb-hero-page .site-footer .ast-footer-copyright, .wtb-hero-page .footer-copyright,
.wtb-hero-page .copyright { padding-top: 40px !important; }
.wtb-hero-page .entry-content > * + * { margin-top: 0 !important; }
.wtb-hero-page .site-header, .wtb-hero-page .ast-header, .wtb-hero-page .main-header-bar,
.wtb-hero-page .ast-primary-header-bar, .wtb-hero-page .ast-header-break-point .main-header-bar,
.wtb-hero-page .ast-mobile-header, .wtb-hero-page .ast-above-header-wrap, .wtb-hero-page .ast-below-header-wrap {
    background: transparent !important;
    box-shadow: none !important; position: relative; z-index: 50;
}
.wtb-hero-page .site-title a, .wtb-hero-page .site-title, .wtb-hero-page .main-header-menu a,
.wtb-hero-page .menu-item a, .wtb-hero-page .ast-menu-toggle { color: #ffffff !important; }
.wtb-hero-page .menu-item a { display: inline-block; padding: 0 14px !important; line-height: 1.4 !important; margin: 8px 0; transition: transform .25s cubic-bezier(.25,.8,.25,1), color .2s ease, text-shadow .2s ease; }
.wtb-hero-page .menu-item a:hover { color:#fde68a !important; transform: scale(1.08); text-shadow: 0 0 1px #fde68a, 0 0 1px #fde68a; }
.wtb-hero-page .current-menu-item > a, .wtb-hero-page .current_page_item > a,
.wtb-hero-page .current-menu-ancestor > a { color:#fde68a !important; font-weight: 700; }
/* aria-current e' il segnaposto piu' affidabile: WP lo mette direttamente sul link attivo */
body.wtb-hero-page #ast-hf-menu-1 .menu-item.current-menu-item > a,
body.wtb-hero-page #ast-hf-menu-1 .menu-item.current-menu-item > .menu-link,
body.wtb-hero-page #ast-hf-menu-1 .menu-item.current_page_item > a,
body.wtb-hero-page #ast-hf-menu-1 .menu-item.current-menu-ancestor > a,
body.wtb-hero-page #ast-hf-menu-1 .menu-item > a[aria-current="page"],
body.wtb-hero-page #ast-hf-menu-1 .menu-item.current-menu-item > a.menu-link,
body.wtb-hero-page #ast-hf-menu-1 .menu-item.current_page_item > a.menu-link {
    color:#fde68a !important; font-weight: 700;
}
/* Voce attiva anche su pagine senza hero (header Astra normale) */
.current-menu-item > a, .current_page_item > a, .current-menu-ancestor > a,
.main-header-menu a[aria-current="page"] { font-weight: 700; }
/* Home: la voce "Home" puo' non avere current-menu-item -> usiamo menu-item-home */
.home.wtb-hero-page .menu-item-home > a { color:#fde68a !important; font-weight: 700; }
.home .menu-item-home > a { font-weight: 700; }

@media (max-width: 860px) {
  .wtb-hero { flex-direction: column !important; text-align: center !important; }
  .wtb-hero-btns { justify-content: center !important; }
  .wtb-hero-sub { margin-left:auto !important; margin-right:auto !important; }
  .wtb-cta-btns { justify-content: center !important; }
  .wtb-h1 { min-height: 4.7em !important; max-height: 4.7em !important; font-size: 30px !important; }
}

/* ===== Effetti slogan hero (rotazione in/out) ===== */
.wtb-type { display:inline-block; transition:opacity .35s ease, transform .35s ease, filter .35s ease; will-change:opacity,transform,filter; }
.wtb-fx-out-slide, .wtb-fx-out-fadeup    { opacity:0; transform:translateY(-.55em); }
.wtb-fx-in-slide,  .wtb-fx-in-fadeup     { opacity:0; transform:translateY(.55em); }
.wtb-fx-out-fadedown                     { opacity:0; transform:translateY(.55em); }
.wtb-fx-in-fadedown                      { opacity:0; transform:translateY(-.55em); }
.wtb-fx-out-fadeleft                     { opacity:0; transform:translateX(.9em); }
.wtb-fx-in-fadeleft                      { opacity:0; transform:translateX(-.9em); }
.wtb-fx-out-faderight                    { opacity:0; transform:translateX(-.9em); }
.wtb-fx-in-faderight                     { opacity:0; transform:translateX(.9em); }
.wtb-fx-out-blur, .wtb-fx-out-glow       { opacity:0; filter:blur(10px); }
.wtb-fx-in-blur,  .wtb-fx-in-glow        { opacity:0; filter:blur(10px); }
.wtb-fx-out-flip                         { opacity:0; transform:perspective(500px) rotateX(80deg); }
.wtb-fx-in-flip                          { opacity:0; transform:perspective(500px) rotateX(-80deg); }
.wtb-fx-out-bounce                       { opacity:0; transform:translateY(-.9em) scaleY(.85); }
.wtb-fx-in-bounce                        { opacity:0; transform:translateY(.8em); }
.wtb-h1-glow { animation:wtbGlow 3s ease-in-out infinite; }
@keyframes wtbGlow { 0%,100% { text-shadow:0 0 10px rgba(255,255,255,.2); } 50% { text-shadow:0 0 28px rgba(255,255,255,.55), 0 0 60px rgba(255,255,255,.2); } }
.wtb-h1 { transition:transform .12s ease-out; }

/* Anteprima effetto nell'editor Gutenberg (una tantum al cambio effetto) */
.wtb-ed-fx-slide     { animation:wtbEdUp .7s ease; }
.wtb-ed-fx-fadeup    { animation:wtbEdUp .7s ease; }
.wtb-ed-fx-fadedown  { animation:wtbEdDown .7s ease; }
.wtb-ed-fx-fadeleft  { animation:wtbEdLeft .7s ease; }
.wtb-ed-fx-faderight { animation:wtbEdRight .7s ease; }
.wtb-ed-fx-blur      { animation:wtbEdBlur .9s ease; }
.wtb-ed-fx-flip      { animation:wtbEdFlip .8s ease; }
.wtb-ed-fx-bounce    { animation:wtbEdBounce .9s ease; }
.wtb-ed-fx-glow      { animation:wtbGlow 3s ease-in-out infinite; }
@keyframes wtbEdUp    { from { opacity:0; transform:translateY(.55em); } to { opacity:1; transform:none; } }
@keyframes wtbEdDown  { from { opacity:0; transform:translateY(-.55em); } to { opacity:1; transform:none; } }
@keyframes wtbEdLeft  { from { opacity:0; transform:translateX(-.9em); } to { opacity:1; transform:none; } }
@keyframes wtbEdRight { from { opacity:0; transform:translateX(.9em); } to { opacity:1; transform:none; } }
@keyframes wtbEdBlur  { from { opacity:0; filter:blur(10px); } to { opacity:1; filter:none; } }
@keyframes wtbEdFlip  { from { opacity:0; transform:perspective(500px) rotateX(-80deg); } to { opacity:1; transform:none; } }
@keyframes wtbEdBounce { 0% { opacity:0; transform:translateY(.8em); } 55% { opacity:1; transform:translateY(-.12em); } 80% { transform:translateY(.05em); } 100% { transform:none; } }

/* Scorrevole da destra a sinistra (marquee) */
.wtb-marq { display:inline-block; white-space:nowrap; animation:wtbMarq 18s linear infinite; will-change:transform; }
@keyframes wtbMarq { from { transform:translateX(0); } to { transform:translateX(-50%); } }

/* CRT: monitor anni 70 — schermo curvo ovalizzato, ghost e slice RGB disturbate */
.wtb-fx-out-crt { opacity:0; filter:brightness(3) blur(3px); }
.wtb-fx-in-crt  { opacity:0; filter:brightness(3) blur(3px); }
.wtb-h1-crt { position:relative; animation:wtbFlicker 5s infinite; }
.wtb-h1-crt::after, .wtb-ed-fx-crt::after {
  content:''; position:absolute; inset:0; pointer-events:none; border-radius:14px;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.42) 100%);
}
.wtb-h1-crt .wtb-type { position:relative; text-shadow:0 0 6px rgba(255,255,255,.55), 3px 0 rgba(255,0,90,.3), -3px 0 rgba(0,220,255,.3), 0 5px 16px rgba(255,255,255,.15); }
.wtb-h1-crt .wtb-type::before,
.wtb-h1-crt .wtb-type::after {
  content:attr(data-text); position:absolute; left:0; top:0; width:100%;
  overflow:hidden; opacity:0; pointer-events:none; filter:blur(.6px);
}
.wtb-h1-crt .wtb-type::before { color:rgba(0,230,255,.85); animation:wtbCrtGlitchA 3.4s infinite; }
.wtb-h1-crt .wtb-type::after  { color:rgba(255,0,90,.85); animation:wtbCrtGlitchB 4.1s infinite; }
@keyframes wtbCrtGlitchA {
  0%,86%,100% { opacity:0; transform:none; clip-path:inset(0 0 0 0); }
  87% { opacity:.9; transform:translateX(-7px); clip-path:inset(8% 0 62% 0); }
  89% { opacity:.9; transform:translateX(5px);  clip-path:inset(55% 0 18% 0); }
  91% { opacity:.9; transform:translateX(-4px); clip-path:inset(30% 0 45% 0); }
  93% { opacity:0; }
}
@keyframes wtbCrtGlitchB {
  0%,90%,100% { opacity:0; transform:none; clip-path:inset(0 0 0 0); }
  91% { opacity:.9; transform:translateX(6px);  clip-path:inset(65% 0 8% 0); }
  93% { opacity:.9; transform:translateX(-5px); clip-path:inset(20% 0 55% 0); }
  95% { opacity:.9; transform:translateX(3px);  clip-path:inset(45% 0 30% 0); }
  97% { opacity:0; }
}
@keyframes wtbFlicker { 0%,91%,94%,98%,100% { opacity:1; } 92% { opacity:.8; } 96% { opacity:.9; } }

/* Pixel stile PLAY: canali RGB separati + blocchi a scatto */
.wtb-type.wtb-px { transition:opacity .5s steps(5), transform .5s steps(5), filter .5s steps(5); }
.wtb-fx-out-pixel { opacity:0; transform:scale(.85); filter:blur(10px); }
.wtb-fx-in-pixel  { opacity:0; transform:scale(1.6); filter:blur(12px) contrast(2); }
.wtb-h1-pixel .wtb-type { position:relative; text-shadow:2px 0 rgba(0,230,255,.6), -2px 0 rgba(255,45,120,.6); animation:wtbPxJit 2.4s steps(2) infinite; }
.wtb-h1-pixel .wtb-type::before,
.wtb-h1-pixel .wtb-type::after {
  content:attr(data-text); position:absolute; left:0; top:0; width:100%;
  overflow:hidden; pointer-events:none;
}
.wtb-h1-pixel .wtb-type::before { color:rgba(0,230,255,.9); animation:wtbPxA 2.1s steps(3) infinite; }
.wtb-h1-pixel .wtb-type::after  { color:rgba(255,45,120,.9); animation:wtbPxB 2.7s steps(3) infinite; }
@keyframes wtbPxA {
  0%   { clip-path:inset(0 0 0 0); transform:translate(-3px,0); }
  25%  { clip-path:inset(12% 0 58% 0); transform:translate(-8px,1px); }
  50%  { clip-path:inset(52% 0 22% 0); transform:translate(-4px,-2px); }
  75%  { clip-path:inset(78% 0 5% 0); transform:translate(-9px,0); }
  100% { clip-path:inset(0 0 0 0); transform:translate(-3px,0); }
}
@keyframes wtbPxB {
  0%   { clip-path:inset(0 0 0 0); transform:translate(3px,0); }
  25%  { clip-path:inset(60% 0 15% 0); transform:translate(7px,-1px); }
  50%  { clip-path:inset(18% 0 62% 0); transform:translate(4px,2px); }
  75%  { clip-path:inset(40% 0 38% 0); transform:translate(9px,0); }
  100% { clip-path:inset(0 0 0 0); transform:translate(3px,0); }
}
@keyframes wtbPxJit { 0%,100% { transform:translateX(0); } 20% { transform:translateX(-1px); } 60% { transform:translateX(1px); } 80% { transform:translateX(-2px); } }

/* Anteprime editor dei nuovi effetti */
.wtb-ed-fx-crt   { position:relative; animation:wtbFlicker 5s infinite; text-shadow:0 0 6px rgba(255,255,255,.55), 3px 0 rgba(255,0,90,.3), -3px 0 rgba(0,220,255,.3); }
.wtb-ed-fx-pixel { position:relative; text-shadow:3px 0 rgba(0,230,255,.8), -3px 0 rgba(255,45,120,.8); animation:wtbPxJit 2.4s steps(2) infinite; }
