/* Layout delle Home: pagine che rendono un Loop di query con classe ccb-home-posts (classe ccb-home sul body, aggiunta dal plugin). */
body.ccb-home {
    --wp--preset--color--contrast: #000000;
    --wp--preset--color--contrast-2: #000000;
    --wp--preset--font-size--small: 1.035rem;
    --wp--preset--font-size--medium: 1.2075rem;
    color: #000000;
    font-size: calc(clamp(.875rem, .875rem + ((1vw - .2rem) * .464), 1.13rem) * 1.15);
}
body.ccb-home h1 { font-size: calc(clamp(1.624rem, 1.624rem + ((1vw - .2rem) * 2.047), 2.75rem) * 1.15); }
body.ccb-home h2 { font-size: calc(clamp(1.25rem, 1.25rem + ((1vw - .2rem) * 1.364), 2rem) * 1.15); }
body.ccb-home h3 { font-size: calc(clamp(1.055rem, 1.055rem + ((1vw - .2rem) * 1.045), 1.63rem) * 1.15); }
body.ccb-home h4 { font-size: calc(clamp(.918rem, .918rem + ((1vw - .2rem) * .84), 1.38rem) * 1.15); }
body.ccb-home .wp-block-search__input {
    font-size: 1.035rem;
    color: #000000;
}
body.ccb-home .wp-block-search__input::placeholder { color: #000000; opacity: 1; }
body.ccb-home .wp-block-navigation { font-size: 1.15rem; }
body.ccb-home #articoli .wp-block-buttons {
    gap: 1rem !important;
}
body.ccb-home .ccb-home-filter {
    flex: 0 0 9rem !important;
    width: 9rem !important;
    margin: 0 !important;
}
body.ccb-home .ccb-home-filter .wp-block-button__link,
body.ccb-home .wp-block-cover .wp-block-search__button {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 9rem !important;
    min-width: 9rem;
    height: 3.25rem;
    min-height: 3.25rem;
    padding: 0 .75rem !important;
    border-radius: var(--ccb-raggio-pulsante, 8px);
    font-family: inherit;
    font-size: 1.035rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    text-decoration: none;
}
body.ccb-home .wp-block-cover .wp-block-search__button { font-size: 1.15rem; }
body.ccb-home .ccb-home-filter .wp-block-button__link {
    border: 1px solid var(--wp--preset--color--contrast-3) !important;
}
body.ccb-home .ccb-home-filter .wp-block-button__link[aria-current="true"] {
    border-color: var(--wp--preset--color--contrast) !important;
}
body.ccb-home #articoli .wp-block-details,
.editor-styles-wrapper .wp-block-details.ccb-home-sort {
    box-sizing: border-box;
    position: relative;
    min-width: 16rem;
    border: 1px solid var(--wp--preset--color--contrast-3);
    border-radius: var(--ccb-raggio-pulsante, 8px);
    padding: 0 !important;
    color: var(--wp--preset--color--contrast);
    background: var(--wp--preset--color--base);
    font-family: inherit;
    font-size: 1.035rem !important;
    font-weight: 500;
    line-height: 1.25;
}
body.ccb-home #articoli .wp-block-details > summary,
.editor-styles-wrapper .wp-block-details.ccb-home-sort > summary {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    height: calc(3.25rem - 2px);
    padding: 0 1rem;
    border-radius: var(--ccb-raggio-pulsante, 8px);
    list-style: none;
    cursor: pointer;
}
body.ccb-home #articoli .wp-block-details > summary::-webkit-details-marker,
.editor-styles-wrapper .wp-block-details.ccb-home-sort > summary::-webkit-details-marker { display: none; }
/* Freccia del menu Ordina per: chevron SVG in linea con il testo (sostituisce i caratteri testuali). */
body.ccb-home #articoli .wp-block-details > summary::after,
.editor-styles-wrapper .wp-block-details.ccb-home-sort > summary::after {
    content: '';
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
    transition: transform .2s ease;
}
body.ccb-home #articoli .wp-block-details[open] > summary::after,
.editor-styles-wrapper .wp-block-details.ccb-home-sort[open] > summary::after { transform: rotate(180deg); }
body.ccb-home #articoli .wp-block-details > p {
    position: absolute;
    box-sizing: border-box;
    z-index: 20;
    top: 100%;
    left: -1px;
    right: -1px;
    margin: .375rem 0 0;
    padding: .5rem;
    border: 1px solid var(--wp--preset--color--contrast-3);
    border-radius: var(--ccb-raggio-pulsante, 8px);
    background: var(--wp--preset--color--base);
}
body.ccb-home #articoli .wp-block-details > p > a {
    display: block;
    padding: .5rem;
    border-radius: var(--ccb-raggio-pulsante, 8px);
    text-decoration: none;
}
body.ccb-home #articoli .wp-block-details > p > br { display: none; }
body.ccb-home #articoli .wp-block-details > p > a[aria-current="true"] { font-weight: 700; }
body.ccb-home .ccb-home-filter a:focus-visible,
body.ccb-home #articoli summary:focus-visible,
body.ccb-home #articoli .wp-block-details a:focus-visible {
    outline: 2px solid var(--wp--preset--color--contrast);
    outline-offset: 3px;
}
@media (max-width: 600px) {
    body.ccb-home .wp-block-cover .wp-block-search { width: 100% !important; }
}


/* Stili generali Comac: B6 sui bottoni core, L3 sui link editoriali. Le esclusioni .ccb-interaction-lab sono un aggancio neutro usato dal laboratorio in staging; senza quella classe non agiscono. */
/* Colori oro (link, passaggio del mouse, anello): letti dalla palette degli stili globali (Aspetto > Editor > Stili > Colori). Nessuna copia qui. */
:where(.wp-site-blocks,.editor-styles-wrapper) :is(.wp-block-button__link,.wp-block-search__button):not(.ccb-interaction-lab *) {
 position:relative;isolation:isolate;overflow:visible;background:#000 !important;color:#fff !important;border-radius:var(--ccb-raggio-pulsante,8px);box-shadow:none !important;text-decoration:none !important;transition:none;
}
:where(.wp-site-blocks,.editor-styles-wrapper) :is(.is-style-outline .wp-block-button__link,.wp-block-button__link.has-base-background-color,.wp-block-button__link.has-base-2-background-color):not(.ccb-interaction-lab *) {
 background:#fff !important;color:#000 !important;
}
:where(.wp-site-blocks,.editor-styles-wrapper) :is(.wp-block-button__link,.wp-block-search__button):not(.ccb-interaction-lab *)::after {
 content:"";position:absolute;inset:calc(-1 * var(--ccb-anello-distanza,.75vh));border:2px solid var(--wp--preset--color--custom-oro-tcb);border-radius:calc(var(--ccb-raggio-pulsante,8px) + var(--ccb-anello-distanza,.75vh));pointer-events:none;opacity:0;transform:scale(.96,.88);transition:transform .28s ease-out,opacity .28s ease-out;
}
:where(.wp-site-blocks,.editor-styles-wrapper) :is(.wp-block-button__link,.wp-block-search__button):not(.ccb-interaction-lab *):is(:hover,:focus-visible)::after {opacity:1;transform:scale(1);}
:where(.wp-site-blocks,.editor-styles-wrapper) :is(.wp-block-button__link,.wp-block-search__button):not(.ccb-interaction-lab *):focus-visible {outline:2px solid var(--wp--preset--color--custom-oro-link-tcb);outline-offset:3px;}
:where(.wp-site-blocks,.editor-styles-wrapper) :is(p a,li a,.wp-block-read-more):not(.wp-element-button):not(.wp-block-button__link):not(.ccb-interaction-lab *):not(.wp-block-navigation *):not(.wp-block-details *):not(footer *):not(.wp-block-social-links *):not(.wp-block-post-title *):not(.has-base-color):not(.has-base-color *) {
 color:var(--wp--preset--color--custom-oro-link-tcb);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:.14em;background-image:linear-gradient(var(--wp--preset--color--custom-oro-tcb),var(--wp--preset--color--custom-oro-tcb));background-repeat:no-repeat;background-position:0 100%;background-size:0% 3px;transition:color .2s ease,background-size .2s ease;box-decoration-break:clone;-webkit-box-decoration-break:clone;
}
:where(.wp-site-blocks,.editor-styles-wrapper) :is(p a,li a,.wp-block-read-more):not(.wp-element-button):not(.wp-block-button__link):not(.ccb-interaction-lab *):not(.wp-block-navigation *):not(.wp-block-details *):not(footer *):not(.wp-block-social-links *):not(.wp-block-post-title *):not(.has-base-color):not(.has-base-color *):is(:hover,:focus-visible) {background-size:100% 3px;color:var(--wp--preset--color--custom-oro-link-hover-tcb);}
@media(prefers-reduced-motion:reduce){:where(.wp-site-blocks,.editor-styles-wrapper) a,:where(.wp-site-blocks,.editor-styles-wrapper) :is(.wp-block-button__link,.wp-block-search__button)::after{transition:none !important;}}

/* Stile editoriale degli articoli: testi neri su tutti gli articoli singoli, come sul pilota 2951. Link oro, bottoni e riquadri scuri restano governati dalle regole sopra e dai colori dei blocchi. */
body.single-post {--wp--preset--color--contrast:#000;--wp--preset--color--contrast-2:#000;color:#000;}

/* Ordinamento: testo nero e contorno oro per mouse e tastiera. Titoli ridotti sul Loop di query con ccb-home-compact (clone). */
body.ccb-home #articoli .wp-block-details > p > a {color:#000;background:none;text-decoration:none;position:relative;outline:2px solid transparent;outline-offset:0;transition:outline-color .2s ease;}
body.ccb-home #articoli .wp-block-details > p > a:is(:hover,:focus-visible) {color:#000;outline-color:var(--wp--preset--color--custom-oro-tcb);background:none;text-decoration:none;}
body.ccb-home #articoli .ccb-home-posts .wp-block-post-title {font-size:1.375rem;line-height:1.2;}
@media(prefers-reduced-motion:reduce){body.ccb-home #articoli .wp-block-details > p > a{transition:none;}}

/* Prova editoriale: barra di avanzamento legata allo scorrimento della pagina. */
body:has(.ccb-gold-header-preview) { --wp--preset--color--contrast:#000; --wp--preset--color--contrast-2:#000; color:#000; }
body:has(.ccb-gold-header-preview) .wp-site-blocks > header { position:sticky; top:var(--wp-admin--admin-bar--height,0px); z-index:20; background:#fff; padding-bottom:.75rem !important; }
body:has(.ccb-gold-header-preview) .wp-site-blocks > header::before,
body:has(.ccb-gold-header-preview) .wp-site-blocks > header::after { content:""; position:absolute; bottom:0; left:50%; width:min(84%,1008px); background:var(--wp--preset--color--custom-oro-tcb); transform:translateX(-50%); pointer-events:none; }
body:has(.ccb-gold-header-preview) .wp-site-blocks > header::before { height:1px; }
body:has(.ccb-gold-header-preview) .wp-site-blocks > header::after { height:3px; clip-path:inset(0 100% 0 0); }
body:has(.ccb-gold-header-preview) header .custom-logo { width:200px; height:auto; }
.ccb-gold-header-preview { margin-top:.75rem !important; color:#000; }
.ccb-gold-header-preview > h1 { margin-top:0; }
.ccb-gold-header-preview [id] { scroll-margin-top:9rem; }
@supports (animation-timeline:scroll()) {
 @media (prefers-reduced-motion:no-preference) {
  body:has(.ccb-gold-header-preview) .wp-site-blocks > header::after { animation:ccb-gold-reading-progress linear both; animation-timeline:scroll(root block); animation-range:0% 100%; }
 }
}
@keyframes ccb-gold-reading-progress { from { clip-path:inset(0 100% 0 0); } to { clip-path:inset(0 0% 0 0); } }
@media (max-width:600px) { body:has(.ccb-gold-header-preview) header .custom-logo { width:160px; } }
/* Respiro tra la conclusione editoriale e il footer. */
body.single-post .entry-content,
.ccb-gold-header-preview { padding-bottom:2rem; }

/* Mesi in minuscolo nella data visibile degli articoli italiani. */
html[lang^="it"] body.single-post .wp-block-post-date { text-transform:lowercase; }

/* Mobile: integrazione per ricerca, controlli e touch; layout nei blocchi core. */
body:has(.ccb-recovery) { --wp--preset--color--contrast:#000; --wp--preset--color--contrast-2:#000; color:#000; }
@media (max-width:600px) {
 body.ccb-home .wp-block-cover { background-color:#fff; }
 body.ccb-home .wp-block-cover__image-background { opacity:.18; }
 body.ccb-home .wp-block-search__inside-wrapper, .ccb-recovery .wp-block-search__inside-wrapper { width:100% !important; }
 body.ccb-home .wp-block-cover .wp-block-search__button, .ccb-recovery .wp-block-search__button { width:5.25rem !important; min-width:5.25rem; padding:.5rem !important; font-size:1rem; }
 body.ccb-home #articoli .wp-block-buttons { width:100%; gap:.5rem !important; }
 body.ccb-home .ccb-home-filter { flex:0 0 calc((100% - 1rem) / 3) !important; width:calc((100% - 1rem) / 3) !important; }
 body.ccb-home .ccb-home-filter .wp-block-button__link { width:100% !important; min-width:0; height:2.5rem; min-height:2.5rem; padding:0 .2rem !important; font-size:clamp(.8125rem,3.6vw,.875rem)!important; white-space:nowrap; word-break:normal; }
 body.ccb-home #articoli .wp-block-details { width:100%; min-width:0; }
 .wp-site-blocks :is(header .wp-block-navigation__responsive-container-open,header .wp-block-navigation__responsive-container-close,footer .wp-social-link a) { min-width:44px; min-height:44px; display:inline-flex; align-items:center; justify-content:center; }
 .wp-site-blocks .wp-block-search__input { min-width:0; font-size:1rem; }
 body.single-post .wp-block-button__link { white-space:normal; max-width:100%; overflow-wrap:anywhere; }
 body.single-post .wp-block-cover__image-background.has-parallax { background-attachment:scroll; }
 .wp-site-blocks .wp-block-navigation__responsive-container.is-menu-open { padding:1.5rem; }
 .wp-site-blocks .wp-block-navigation__responsive-container.is-menu-open a { padding:.75rem 0; font-size:1.25rem; }
}

/* Home mobile compatta: ricerca e ordinamento, comune alle due Home. */
@media(max-width:600px){
 body.ccb-home .wp-block-cover p br{display:none;}
 body.ccb-home .wp-block-cover .wp-block-search__inside-wrapper{padding:2px;}
 body.ccb-home .wp-block-cover .wp-block-search__button{height:2.75rem;min-height:2.75rem;width:4.5rem!important;min-width:4.5rem;font-size:.875rem;}
 body.ccb-home #articoli .wp-block-details{font-size:.875rem!important;}
 body.ccb-home #articoli .wp-block-details>summary{height:2.5rem;padding:0 .75rem;}
}

/* Card Home mobile: immagine e titolo, senza estratto o link duplicato. */
@media(max-width:600px){body.ccb-home .ccb-home-posts .wp-block-post-excerpt{display:none;}}

/* Schede articolo e barra filtri delle Home Comac. */
body.ccb-home #articoli .ccb-home-posts :is(.wp-block-post-title a,.wp-block-read-more,.wp-block-post-excerpt__more-link){text-decoration:none!important;background-image:none!important;}
body.ccb-home #articoli .ccb-home-posts :is(.wp-block-post-title a,.wp-block-read-more,.wp-block-post-excerpt__more-link):is(:hover,:focus-visible){text-decoration:underline!important;text-underline-offset:.14em;}
body.ccb-home #articoli .ccb-home-posts .wp-block-post-title{margin-block-end:0!important;}
body.ccb-home #articoli .ccb-home-posts :is(.wp-block-post-excerpt,.wp-block-read-more){margin-block:0!important;}
body.ccb-home #articoli .ccb-home-posts .wp-block-post-excerpt__more-text{margin-block-start:auto!important;margin-block-end:0!important;padding-top:6px;}
body.ccb-home #articoli .ccb-home-posts .wp-block-post-template > li > .wp-block-group{row-gap:8px;}
body.ccb-home #articoli .ccb-home-posts .wp-block-post-excerpt__excerpt{margin-block:0!important;}
@media(min-width:1024px){
 body.ccb-home #articoli .wp-block-buttons:has(.ccb-home-filter){gap:.5rem!important;}
 body.ccb-home #articoli .ccb-home-filter{width:auto!important;flex:0 0 auto!important;}
 body.ccb-home #articoli .ccb-home-filter .wp-block-button__link{width:auto!important;min-width:0;padding-inline:.75rem!important;}
 body.ccb-home #articoli .ccb-home-sort{min-width:11rem;}
}

/* Copertina scorrevole del confronto macchine: 70% del formato 16:9. */
@media (min-width:768px) and (prefers-reduced-motion:no-preference){
 body.postid-8543 .entry-content .wp-block-cover.has-parallax{aspect-ratio:160/63;min-height:0;height:auto;box-sizing:border-box;overflow:hidden;}
 body.postid-8543 .entry-content .wp-block-cover.has-parallax > .wp-block-cover__image-background{background-attachment:scroll;background-size:100% auto;background-repeat:no-repeat;}
 @supports (animation-timeline:view()){
 body.postid-8543 .entry-content .wp-block-cover.has-parallax{view-timeline-name:--comac-cover-8543;view-timeline-axis:block;}
 body.postid-8543 .entry-content .wp-block-cover.has-parallax > .wp-block-cover__image-background{animation:comac-cover-8543 linear both;animation-timeline:--comac-cover-8543;animation-range:entry 0% exit 100%;}
 }
}
@keyframes comac-cover-8543{from{background-position:50% 0%;}to{background-position:50% 100%;}}
