/*
 * Responsive hardening for Elementor templates/kits.
 * Note: Elementor already handles most breakpoints; this file addresses common overflow/fit issues.
 */

@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:wght@300;400;500;600;700&display=swap');

html, body {
  overflow-x: hidden;
}

img, svg, video, iframe {
  max-width: 100%;
  height: auto;
}

/* Ensure Elementor widgets never create horizontal scroll due to min-width defaults */
.elementor-widget-wrap,
.elementor-column,
.elementor-container,
.elementor-section {
  min-width: 0;
}

/* Buttons + headings should wrap on mobile */
.elementor-button {
  white-space: normal;
  text-align: center;
}

.elementor-heading-title,
.elementor-widget-heading .elementor-heading-title {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Forms: inputs should not overflow their wrappers */
.elementor-form input,
.elementor-form textarea,
.elementor-form select {
  max-width: 100%;
  box-sizing: border-box;
}

.elementor-form textarea {
  width: 100%;
}

/* Video/Embed containers */
.elementor-widget-video .elementor-widget-container,
.elementor-widget-container iframe {
  max-width: 100%;
}

/* Tables: allow horizontal scroll instead of breaking layout */
table {
  max-width: 100%;
}

table, th, td {
  word-break: normal;
}

/* Respect long words/URLs in general content */
body {
  overflow-wrap: anywhere;
}

/* Reduce risk of horizontal overflow from Elementor sections/rows */
.elementor-section,
.elementor-container,
.elementor-row,
.elementor-column {
  overflow-x: hidden;
}

/* Allow wrapping in common flex containers */
.elementor-row,
.elementor-widget-container,
.elementor-widget-wrap {
  flex-wrap: wrap;
}

/* UX overrides: arancioni -> verdi + global font = Fira Sans */
/*
  Nota: per rispettare la richiesta “ripristina solo la home page allo stato originale”,
  questi override vengono applicati SOLO sulle pagine diverse dalla homepage.
*/
body:not(.home){
  --pd-header-green: #25d366;

  /* WordPress block preset colors */
  --wp--preset--color--luminous-vivid-orange: var(--pd-header-green) !important;
  --wp--preset--color--luminous-vivid-amber: var(--pd-header-green) !important;
}

/* If any element uses explicit orange colors/classes, remap them */
body:not(.home) .has-luminous-vivid-orange-color{ color: var(--pd-header-green) !important; }
body:not(.home) .has-luminous-vivid-amber-color{ color: var(--pd-header-green) !important; }
body:not(.home) .has-luminous-vivid-orange-background-color{ background-color: var(--pd-header-green) !important; }
body:not(.home) .has-luminous-vivid-amber-background-color{ background-color: var(--pd-header-green) !important; }
body:not(.home) .has-luminous-vivid-orange-border-color{ border-color: var(--pd-header-green) !important; }
body:not(.home) .has-luminous-vivid-amber-border-color{ border-color: var(--pd-header-green) !important; }

/* Elementor kit global colors (orange palette) -> header green */
body:not(.home) .elementor-kit-8{
  --e-global-color-d3ae19d: var(--pd-header-green) !important; /* #FFC0A1 */
  --e-global-color-785b64d: var(--pd-header-green) !important; /* #FF9C6B */
  --e-global-color-b41e63e: var(--pd-header-green) !important; /* #FF8243 */
  --e-global-color-4ade329: var(--pd-header-green) !important; /* #E64D00 */
  --e-global-color-ec25634: var(--pd-header-green) !important; /* #8A2E00 */
}

/* Global typography to Fira Sans (skip icons i-tag to avoid breaking icon fonts) */
body:not(.home),
body:not(.home) h1,body:not(.home) h2,body:not(.home) h3,body:not(.home) h4,body:not(.home) h5,body:not(.home) h6,
body:not(.home) p,body:not(.home) li,body:not(.home) a,
body:not(.home) .elementor-heading-title,
body:not(.home) .elementor-text-editor,
body:not(.home) .elementor-button,
body:not(.home) .elementor-form input,
body:not(.home) .elementor-form textarea,
body:not(.home) .elementor-form select{
  font-family: 'Fira Sans', sans-serif !important;
}
