/* Shell 2027 applicata alle viste ancora renderizzate da BeTheme. */
.dm27-legacy { background: #f3f6f8; }
.dm27-legacy #Header_wrapper,
.dm27-legacy #Footer,
.dm27-legacy #Side_slide,
.dm27-legacy #body_overlay,
.dm27-legacy #back_to_top { display: none !important; }
.dm27-legacy.error404 .dm27-legacy-header,
.dm27-legacy.error404 .dm27-legacy-footer { display: block !important; }
.dm27-legacy #Wrapper { width: 100%; max-width: none; margin: 0; background: #f3f6f8; }
.dm27-legacy #Content { padding: 0; background: #f3f6f8; }
.dm27-legacy #Content > .content_wrapper { width: 100%; max-width: none; margin: 0; }
.dm27-legacy #Content .sections_group { width: 100%; float: none; }
.dm27-legacy.admin-bar .dm27-header { top: 32px; }

.dm27-legacy-hero { position: relative; min-height: 350px; padding: 142px 0 68px; background: var(--dm27-navy); color: #f7f9fc; overflow: hidden; }
.dm27-legacy-hero__inner { position: relative; z-index: 2; }
.dm27-legacy-hero__context { display: block; margin-bottom: 18px; color: #c4d2e4; font-size: .78rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.dm27-legacy-hero h1 { width: min(100%,1000px); margin: 0 0 24px; color: #f7f9fc; font-size: clamp(3rem,6vw,6.25rem); font-weight: 850; letter-spacing: -.055em; line-height: .92; overflow-wrap: anywhere; text-wrap: balance; }
.dm27-legacy-hero__accent { position: absolute; z-index: 1; bottom: -72px; width: 310px; height: 128px; transform: skewX(-28deg); }
.dm27-legacy-hero__accent--red { left: -96px; background: var(--dm27-red); }
.dm27-legacy-hero__accent--blue { right: -82px; background: var(--dm27-blue); }

/* Tipografia e controlli condivisi, senza alterare i contenuti Muffin Builder. */
.dm27-legacy #Content h2,
.dm27-legacy #Content h3,
.dm27-legacy #Content h4,
.dm27-legacy #Content h5 { color: var(--dm27-ink); font-family: "Segoe UI", Arial, sans-serif; font-weight: 820; letter-spacing: -.035em; line-height: 1.08; }
.dm27-legacy #Content p,
.dm27-legacy #Content li { color: #344158; line-height: 1.65; }
.dm27-legacy #Content a { text-underline-offset: .18em; }
.dm27-legacy #Content .button,
.dm27-legacy #Content button,
.dm27-legacy #Content input[type="submit"] { min-height: 46px; border: 0; border-radius: 0; background: var(--dm27-red); color: #f7f9fc; font-family: "Segoe UI", Arial, sans-serif; font-weight: 800; box-shadow: none; }
.dm27-legacy #Content input[type="text"],
.dm27-legacy #Content input[type="email"],
.dm27-legacy #Content input[type="password"],
.dm27-legacy #Content input[type="tel"],
.dm27-legacy #Content input[type="search"],
.dm27-legacy #Content textarea,
.dm27-legacy #Content select { min-height: 50px; border: 1px solid #c7d0dc; border-radius: 0; background: #f7f9fc; color: var(--dm27-ink); box-shadow: none; }
.dm27-legacy #Content input:focus,
.dm27-legacy #Content textarea:focus,
.dm27-legacy #Content select:focus { border-color: var(--dm27-blue); outline: 3px solid rgba(7,94,232,.18); }

/* Pagine con contenuto standard e UserPro. */
.dm27-legacy #Content .section.the_content.has_content { padding: clamp(58px,7vw,96px) 0; }
.dm27-legacy #Content .section.the_content.has_content > .section_wrapper { width: min(1180px,calc(100% - 56px)); max-width: none; }
.dm27-legacy .userpro { width: min(100%,780px) !important; max-width: 780px !important; margin: 0 auto 30px !important; border: 0 !important; border-radius: 0 !important; background: #f7f9fc !important; box-shadow: 0 22px 58px rgba(3,19,41,.1) !important; }
.dm27-legacy .userpro-head { min-height: 68px; padding: 22px 26px !important; border: 0 !important; background: var(--dm27-navy) !important; color: #f7f9fc !important; font-family: "Segoe UI", Arial, sans-serif !important; font-size: 1rem !important; font-weight: 850 !important; }
.dm27-legacy .userpro-head a { color: #d9e5f5 !important; }
.dm27-legacy .userpro-body { padding: clamp(22px,4vw,40px) !important; border: 0 !important; }
.dm27-legacy .userpro-field { padding: 12px 0 !important; }
.dm27-legacy .userpro-label label { color: var(--dm27-ink) !important; font-family: "Segoe UI", Arial, sans-serif !important; font-weight: 750 !important; }
.dm27-legacy .userpro-input input { width: 100% !important; min-height: 50px !important; border: 1px solid #c7d0dc !important; border-radius: 0 !important; background: #fff !important; box-shadow: none !important; }
.dm27-legacy .userpro-field-icon { color: var(--dm27-blue) !important; }
.dm27-legacy .userpro-submit input[type="submit"],
.dm27-legacy .userpro-button { min-height: 48px !important; padding: 12px 22px !important; border: 0 !important; border-radius: 0 !important; background: var(--dm27-red) !important; color: #f7f9fc !important; text-shadow: none !important; box-shadow: none !important; }
.dm27-legacy .userpro-button.secondary { background: var(--dm27-navy) !important; }
.dm27-legacy .userpro-close-popup { display: none !important; }

/* Archivi News, Eventi e risultati di ricerca. */
.dm27-legacy.archive #Content .section,
.dm27-legacy.search #Content .section { padding: clamp(58px,7vw,96px) 0; }
.dm27-legacy.archive #Content .section_wrapper,
.dm27-legacy.search #Content .section_wrapper { width: min(1180px,calc(100% - 56px)); max-width: none; }
.dm27-legacy .posts_group.grid { display: grid !important; height: auto !important; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; background: #cbd4df; }
.dm27-legacy .posts_group.grid .post-item { position: relative !important; inset: auto !important; display: flex; width: auto !important; margin: 0 !important; flex-direction: column; transform: none !important; background: #f7f9fc; }
.dm27-legacy .posts_group.grid .post-photo-wrapper { width: 100%; margin: 0; }
.dm27-legacy .posts_group.grid .post-photo-wrapper img { width: 100%; height: 250px; object-fit: cover; }
.dm27-legacy .posts_group.grid .date_label,
.dm27-legacy .posts_group.grid .image_links,
.dm27-legacy .posts_group.grid .category,
.dm27-legacy .posts_group.grid .button-love { display: none !important; }
.dm27-legacy .posts_group.grid .post-desc-wrapper { display: flex; flex: 1; background: #f7f9fc !important; }
.dm27-legacy .posts_group.grid .post-desc { display: flex; padding: 25px !important; flex: 1; flex-direction: column; }
.dm27-legacy .posts_group.grid .post-meta { margin-bottom: 12px; color: var(--dm27-muted); font-size: .78rem; }
.dm27-legacy .posts_group.grid .entry-title { margin-bottom: 14px; font-size: clamp(1.3rem,1.8vw,1.65rem); }
.dm27-legacy .posts_group.grid .entry-title a { color: var(--dm27-ink); text-decoration: none; }
.dm27-legacy .posts_group.grid .post-excerpt { color: #46536a; line-height: 1.58; }
.dm27-legacy .posts_group.grid .post-footer { margin-top: auto; padding: 20px 0 0; border: 0; background: transparent; }
.dm27-legacy .posts_group.grid .post-more { color: var(--dm27-blue); font-weight: 800; }

/* Referenze: stessa griglia tecnica, immagini reali preservate. */
.dm27-legacy .portfolio_wrapper { margin: 0; }
.dm27-legacy .portfolio_group { display: grid !important; height: auto !important; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; background: #cbd4df; }
.dm27-legacy .portfolio_group .portfolio-item { position: relative !important; inset: auto !important; width: auto !important; margin: 0 !important; transform: none !important; background: #f7f9fc; }
.dm27-legacy .portfolio_group .masonry-hover-wrapper { min-height: 330px; }
.dm27-legacy .portfolio_group .image-wrapper,
.dm27-legacy .portfolio_group .image-wrapper a { display: block; height: 330px; }
.dm27-legacy .portfolio_group .image-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.dm27-legacy .portfolio_group .hover-desc { background: rgba(3,19,41,.94) !important; color: #f7f9fc; }
.dm27-legacy .portfolio_group .entry-title a { color: #f7f9fc; font-size: 1.35rem; text-decoration: none; }
.dm27-legacy .pager a,
.dm27-legacy .pager .page { border: 0; border-radius: 0; background: #dfe6ef; color: var(--dm27-ink); }
.dm27-legacy .pager .page.active,
.dm27-legacy .pager a:hover { background: var(--dm27-blue); color: #f7f9fc; }

/* 404 BeTheme: contenuto minimo, shell completa. */
.dm27-legacy.error404 #Wrapper { min-height: 260px; padding: 64px 28px; }
.dm27-legacy.error404 #Wrapper::before { display: block; width: min(1180px,100%); margin: 0 auto; color: var(--dm27-ink); font-size: clamp(1.2rem,2vw,1.6rem); font-weight: 700; content: "La pagina richiesta non esiste. Torna alla homepage o usa la ricerca."; }

@media (max-width: 1040px) {
    .dm27-legacy .posts_group.grid,
    .dm27-legacy .portfolio_group { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 782px) {
    .dm27-legacy.admin-bar .dm27-header { top: 46px; }
}

@media (max-width: 719px) {
    .dm27-legacy-hero { min-height: 300px; padding: 112px 0 54px; }
    .dm27-legacy-hero h1 { font-size: clamp(2.55rem,12vw,4rem); white-space: normal !important; text-wrap: wrap; }
    .dm27-legacy .dm27-menu-button { position: relative; z-index: 40; display: inline-flex !important; border-color: var(--dm27-blue); background: var(--dm27-blue); opacity: 1; visibility: visible; }
    .dm27-legacy #Content .section.the_content.has_content > .section_wrapper,
    .dm27-legacy.archive #Content .section_wrapper,
    .dm27-legacy.search #Content .section_wrapper { width: calc(100% - 28px); }
    .dm27-legacy .userpro-body { padding: 20px 16px !important; }
    .dm27-legacy .userpro-field { display: grid !important; grid-template-columns: 1fr !important; }
    .dm27-legacy .userpro-label,
    .dm27-legacy .userpro-input { width: 100% !important; float: none !important; }
    .dm27-legacy .posts_group.grid,
    .dm27-legacy .portfolio_group { grid-template-columns: 1fr; }
    .dm27-legacy .posts_group.grid .post-photo-wrapper img { height: 270px; }
    .dm27-legacy .portfolio_group .masonry-hover-wrapper,
    .dm27-legacy .portfolio_group .image-wrapper,
    .dm27-legacy .portfolio_group .image-wrapper a { height: 310px; min-height: 310px; }
}
