/* ========================= BLOCCO PARITA ========================= */

.wave-container {
  position: relative;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 3rem;
  display: block;
  overflow: hidden;
  background-color: #f3f4ee;
  padding: 0;
  border-radius: 24px;
}

/* Larghezza allineata al contenuto (max-w-7xl) ad ogni breakpoint */
@media (min-width: 768px)  { .wave-container { max-width: 720px; } }
@media (min-width: 992px)  { .wave-container { max-width: 960px; } }
@media (min-width: 1400px) { .wave-container { max-width: 1320px; } }

/* Onda decorativa (solo desktop >=992) */
.wave-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120'%3E%3Cpath fill='%23bbcfb3' d='M0,64L48,58.7C96,53,192,43,288,48C384,53,480,75,576,80C672,85,768,75,864,64C960,53,1056,43,1152,48C1248,53,1344,75,1392,85.3L1440,96L1440,120L0,120Z'/%3E%3C/svg%3E") no-repeat bottom;
  background-size: cover;
  pointer-events: none;
}

.parita-content-container {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

/* Pannello verde con bordo tratteggiato (mask). Desktop: tratteggio piu marcato e tondo */
.parita-content-container::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 10px;
  right: 10px;
  z-index: 2;
  background-color: var(--holzhof-color-green);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='6' y='6' width='calc(100%25 - 12px)' height='calc(100%25 - 12px)' fill='none' rx='24' ry='24' stroke='white' stroke-width='3' stroke-dasharray='10 6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='6' y='6' width='calc(100%25 - 12px)' height='calc(100%25 - 12px)' fill='none' rx='24' ry='24' stroke='white' stroke-width='3' stroke-dasharray='10 6'/%3E%3C/svg%3E");
  pointer-events: none;
}

.parita-img-container {
  display: block;
  line-height: 0;
  max-height: 280px;
  overflow: hidden;
}

.parita-img {
  max-width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.parita-text-container {
  position: absolute;
  left: 50px;
  top: 50px;
}

.parita-text-container.markdown h1 {
  margin-top: 2px;
  margin-bottom: 4px;
  font-size: 1.6rem;
  font-family: var(--holzhof-font-family-roboto);
  line-height: 1.2;
}

.parita-text-container.markdown h3 {
  font-size: 1.1rem;
  line-height: 1.25;
  margin-top: 5px;
  margin-bottom: 0;
}

.parita-button-container {
  position: absolute;
  top: 210px;
  left: 50px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 22px;
  background-color: var(--holzhof-color-green);
  color: var(--holzhof-color-white);
  border: 1px solid var(--holzhof-color-white);
  border-radius: 48px;
  font-size: 13px;
  font-family: var(--holzhof-font-family-roboto);
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.parita-button-container:hover {
  background-color: var(--holzhof-color-white);
  color: var(--holzhof-color-green);
  border-color: var(--holzhof-color-green);
}

/* ===== Desktop intermedio (992-1399): banner piu compatto per stare nel 960 ===== */
@media (min-width: 992px) and (max-width: 1399px) {
  .parita-img-container { max-height: 220px; }
  .parita-img { height: 220px; }
  .parita-text-container.markdown h1 { font-size: 1.4rem !important; }
  .parita-text-container.markdown h3 { font-size: 0.95rem !important; }
  .parita-button-container { top: 165px; height: 34px; font-size: 12px; padding: 0 18px; }
}

/* ===== LAYOUT STACKED (tablet + mobile, <=991) ===== */
@media (max-width: 991px) {
  .wave-container {
    height: auto;
    background-color: transparent;
  }
  .wave-container::after {
    display: none;
  }
  .parita-content-container {
    zoom: 1;
    flex-direction: column;
    justify-content: flex-start;
  }
  /* bordo tratteggiato piu fine e meno tondo */
  .parita-content-container::after {
    top: 8px;
    bottom: 8px;
    left: 8px;
    right: 8px;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='4' y='4' width='calc(100%25 - 8px)' height='calc(100%25 - 8px)' fill='none' rx='8' ry='8' stroke='white' stroke-width='2' stroke-dasharray='8 5'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='4' y='4' width='calc(100%25 - 8px)' height='calc(100%25 - 8px)' fill='none' rx='8' ry='8' stroke='white' stroke-width='2' stroke-dasharray='8 5'/%3E%3C/svg%3E");
  }
  .parita-text-container {
    position: relative;
    z-index: 3;
    left: auto;
    top: auto;
    width: auto;
  }
  .parita-text-container.markdown h1 {
    line-height: 1.15 !important;
    margin: 2px 0 !important;
  }
  .parita-text-container.markdown h3 {
    line-height: 1.25 !important;
    margin: 3px 0 0 !important;
  }
  .parita-button-container {
    position: relative;
    z-index: 3;
    top: auto;
    left: auto;
    align-self: flex-start;
  }
  .parita-img-container {
    position: relative;
    z-index: 3;
    order: 2;
    max-height: none;
  }
  .parita-img {
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
  }
}

/* ===== TABLET (768-991) ===== */
@media (min-width: 768px) and (max-width: 991px) {
  .parita-text-container { padding: 28px 32px 8px; }
  .parita-text-container.markdown h1 { font-size: 1.4rem !important; }
  .parita-text-container.markdown h3 { font-size: 1.05rem !important; }
  .parita-button-container {
    margin: 16px 32px 0;
    font-size: 14px;
    height: 38px;
    padding: 0 20px;
  }
  .parita-img-container { width: calc(100% - 64px); margin: 18px 32px 28px; }
  .parita-img { height: 220px; }
}

/* ===== MOBILE (<=767) ===== */
@media (max-width: 767px) {
  /* allargato del "round" del bordo: i trattini si allineano ai blocchi sopra */
  .wave-container { width: calc(80% + 24px); }
  .parita-text-container { padding: 30px 24px 8px; }
  .parita-text-container.markdown h1 { font-size: 1.2rem !important; }
  .parita-text-container.markdown h3 { font-size: 0.9rem !important; }
  .parita-button-container {
    margin: 14px 24px 0;
    font-size: 12px;
    height: 32px;
    padding: 0 16px;
  }
  .parita-img-container { width: calc(100% - 48px); margin: 16px 24px 28px; }
  .parita-img { height: 165px; }
}
