/* =====================================================
   CHILD /assets/css/overrides.css
   FASE 7 — Pulizia finale.
   Ruolo: solo fix chirurgici verificati.
   - NON è una skin
   - NON è un theme layer
   - NON contiene primitive globali (sono nella skin)
   - NON contiene token BrandKit (sono in variables.css)
   - NON contiene shape globali (sono nella skin)
   ===================================================== */

/* =====================================================
   1) OVERLAY / BACKDROP (fix chirurgico)
   Motivo: i backdrop dei modali non sono coperti dalla
   skin (la skin gestisce solo lo shell del dialog).
   ===================================================== */

body #am-calendar-modal,
body .subscription-otp-modal__backdrop,
body .rooms-booking-otp-modal__backdrop {
  background: var(--overlay_backdrop);
}

/* Calendar OTP: backdrop piu' leggibile e campo codice non compresso a 56px. */
body #am-calendar-modal {
  background: rgba(36, 20, 15, 0.75);
}

body #am-calendar-modal .am-otp-input,
body .subscription-otp-input {
  width: min(250px, 100%);
}

body .subscription-otp-modal__backdrop {
  background: rgba(36, 20, 15, 0.75);
}

/* Complianz: contenimento iniziale anche mentre il CSS del banner sta caricando. */
html.webuno-cmplz-initial-delay #cmplz-cookiebanner-container .cmplz-cookiebanner,
html.webuno-cmplz-initial-delay #cmplz-manage-consent .cmplz-manage-consent {
  visibility: hidden !important;
  pointer-events: none !important;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner {
  box-sizing: border-box;
  position: fixed;
  top: auto;
  left: auto;
  right: 10px;
  bottom: 10px;
  width: min(732px, calc(100vw - 20px));
  min-width: 0;
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  transform: none;
  z-index: 99999;
  border-radius: 20px;
  padding: 15px 20px;
  display: grid;
  gap: 10px;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-categories .cmplz-category {
  background-color: rgba(239, 239, 239, 0.0) !important;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner.cmplz-hidden,
#cmplz-cookiebanner-container .cmplz-cookiebanner.cmplz-dismissed {
  display: none !important;
}

#cmplz-manage-consent .cmplz-manage-consent.cmplz-hidden,
#cmplz-manage-consent .cmplz-manage-consent.cmplz-dismissed {
  display: none !important;
}

#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-close,
#cmplz-cookiebanner-container .cmplz-cookiebanner .cmplz-close svg {
  width: 20px;
  height: 20px;
}

#cmplz-manage-consent .cmplz-manage-consent {
  box-sizing: border-box;
  position: fixed;
  right: 40px;
  bottom: -35px;
  min-width: 100px;
  height: 50px;
  z-index: 9998;
}

@media (max-width: 768px) {
  #cmplz-cookiebanner-container .cmplz-cookiebanner {
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
  }

  #cmplz-manage-consent .cmplz-manage-consent {
    right: 0;
  }
}

/* =====================================================
   2) ROOMS BOOKING CALENDAR — STATI FUNZIONALI
   Motivo: stati specifici del calendario non gestibili
   da skin/master (semantica is-busy / is-selected /
   is-in-range). Solo colori da BrandKit, niente shape.
   ===================================================== */

body .rooms-calendar__day.is-selected,
body .rooms-calendar__day.is-checkin,
body .rooms-calendar__day.is-checkout,
body .rooms-calendar__day[aria-selected="true"] {
  background: color-mix(in srgb, var(--brand-primary) 12%, var(--surface_soft));
  border-color: var(--brand-primary);
  color: var(--text);
}

body .rooms-calendar__day.is-in-range {
  background: color-mix(in srgb, var(--brand-primary) 7%, var(--surface_soft));
  border-color: color-mix(in srgb, var(--brand-primary) 24%, var(--border));
}

body .rooms-calendar__day.is-busy,
body .rooms-calendar__day--busy {
  background: var(--error_bg);
  border-color: var(--error_border_strong, var(--error_border));
  color: var(--error_text);
}

body .rooms-calendar__dot.is-selected,
body .rooms-calendar__legend-dot.is-selected {
  background: var(--brand-primary);
}

body .rooms-calendar__dot.is-busy,
body .rooms-calendar__legend-dot.is-busy {
  background: var(--error_text);
}

/* =====================================================
   3) ROOMS OTP NOTICE / SUBSCRIPTION MESSAGE
   Motivo: classi specifiche non coperte dai selettori
   notice generici della skin (.am-info / .notice-info).
   ===================================================== */

body .rooms-booking-otp-modal__notice,
body .subscription-message {
  background: var(--info_bg);
  border-color: var(--info_border);
  color: var(--info_text);
}

/* =====================================================
   4) ROOMS PRICE WARNING (classi custom)
   Motivo: classi specifiche non coperte da .am-warning
   skin block.
   ===================================================== */

body .rooms-price-warning,
body .rooms-booking-price-warning {
  background: var(--warning_bg);
  border-color: var(--warning_border);
  color: var(--warning_text);
}

/* =====================================================
   5) FAQ / STEPS / TESTIMONIALS — ACTIVE / FEATURED
   Motivo: stati attivi/featured non coperti dalla skin
   (richiedono accent del BrandKit).
   ===================================================== */

body .am-section--faq details[open] > summary,
body .am-section--steps [class*="is-active"],
body .am-section--testimonials [class*="is-featured"] {
  background: color-mix(in srgb, var(--brand-primary) 8%, var(--surface_soft));
  border-color: color-mix(in srgb, var(--brand-primary) 18%, var(--border));
}

/* =====================================================
   6) FOOTER generic selectors
   Motivo: la skin copre .footer-base/.footer-premium.
   Questi selettori (footer, #colophon, .site-footer,
   .am-footer) coprono markup non gestito dalla skin
   per casi WordPress legacy.
   ===================================================== */

body > footer,
body #colophon,
body .site-footer,
body .am-footer {
  background: var(--footer-bg, var(--brand-footer-bg));
  color: var(--footer-text);
}

/* ============================================================
   7) BLOG FONT OVERRIDE — source of truth child
   Motivo: il blog usa famiglie custom (--blog-font-heading /
   --blog-font-body). I selettori master applicano font-family
   con specificità sufficiente a essere sovrascritti solo qui.
   Da rivedere in QA finale: se la specificità master regge
   senza !important, questo blocco va rimosso.
============================================================ */

.am-blog,
.am-article,
.am-related-posts,
.am-blog-sidebar {
  --blog-font-heading: "BlogHeadingFont";
  --blog-font-body: "BlogBodyFont";

  font-family: var(--blog-font-body) !important;
}

.am-blog h1,
.am-blog h2,
.am-blog h3,
.am-blog h4,
.am-blog h5,
.am-blog h6,
.am-article h1,
.am-article h2,
.am-article h3,
.am-article h4,
.am-article h5,
.am-article h6,
.am-related-posts h1,
.am-related-posts h2,
.am-related-posts h3,
.am-related-posts h4,
.am-related-posts h5,
.am-related-posts h6,
.am-blog-hero-title,
.am-blog-archive-title,
.am-article-title,
.am-related-posts-title,
.am-blog-section-title,
.am-blog-widget-title,
.am-blog-card-title,
.am-blog-card-title a,
.am-blog-mini-post-title,
.am-blog-mini-post-title a,
.am-article-content h1,
.am-article-content h2,
.am-article-content h3,
.am-article-content h4,
.am-article-content h5,
.am-article-content h6 {
  font-family: var(--blog-font-heading) !important;
}

.am-blog p,
.am-blog li,
.am-blog blockquote,
.am-blog figcaption,
.am-blog .am-blog-hero-text,
.am-blog .am-blog-archive-description,
.am-blog .am-blog-card-excerpt,
.am-article p,
.am-article li,
.am-article blockquote,
.am-article figcaption,
.am-article .am-article-content,
.am-article .am-article-content p,
.am-article .am-article-content li,
.am-article .am-article-content blockquote,
.am-article .am-article-content figcaption,
.am-related-posts p,
.am-related-posts li {
  font-family: var(--blog-font-body) !important;
  color: var(--text_secondary_color, var(--text_secondary, inherit));
}

/* =========================================================
   8) CLEAN OUTER SECTION BACKGROUNDS
   Motivo: WordPress core / blocchi (wp-block-group,
   wp-block-columns, alignwide) e i wrapper <section>
   generici tendono a ereditare un background dal layout.
   Questo blocco li neutralizza, mantenendo le superfici
   solo su card/panel/box interni (skin).
   Da rivedere in QA finale: rimuoverlo se i wrapper sono
   gia' trasparenti via master/skin.
   ========================================================= */

body .site-main section:not(.am-card):not([class*="__card"]):not([class*="__panel"]):not([class*="__box"]),
body .site-main .section:not(.am-card):not([class*="__card"]):not([class*="__panel"]):not([class*="__box"]),
body .entry-content > .wp-block-group:not(.has-background),
body .entry-content > .wp-block-columns:not(.has-background),
body .entry-content > .alignwide:not(.has-background) {
  background: transparent;
}
