/* Article sponsored: form, logo partner, disclosure, CTA. */

/* =========================================================
   Sponsored author / partner
   Colonna sinistra = testi; colonna destra = logo
   ========================================================= */

body.single-post .article-author--sponsored {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem 1.5rem;
  align-items: center;
  margin-top: var(--space-md);
  margin-bottom: var(--space-lg);
  line-height: 1.2;
}

body.single-post .article-author__sponsored-text {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

body.single-post .article-author--sponsored .article-author__label {
  display: block;
  margin: 0;
  font-family: var(--font-ui);
  font-size: clamp(0.82rem, 1vw, 0.98rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--color-text-primary);
  text-transform: uppercase;
}

body.single-post .article-author--sponsored .article-author__label strong {
  font-weight: 700;
}

body.single-post .article-author__partner {
  display: block;
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 1.08vw, 1rem);
  font-weight: 400;
  line-height: 1.22;
  color: var(--color-text-secondary);
  text-transform: none;
  white-space: normal;
}

body.single-post .article-author__sponsored-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

body.single-post .article-author__sponsored-logo {
  display: block;
  width: auto;
  max-width: 260px;
  max-height: 78px;
  object-fit: contain;
  box-shadow: none;
  filter: none;
  background: transparent;
}

@media (max-width: 768px) {
body.single-post .article-author--sponsored {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  body.single-post .article-author__sponsored-logo-wrap {
    justify-content: flex-start;
  }

  body.single-post .article-author__sponsored-logo {
    max-width: 210px;
    max-height: 64px;
  }
}

@media (max-width: 480px) {
body.single-post .article-author__partner {
    font-size: 1.05rem;
  }

  body.single-post .article-author__sponsored-logo {
    max-width: 180px;
    max-height: 56px;
  }
}

/* =========================================================
   Form sponsored
   ========================================================= */

body.single-post .article-contact-form {
  scroll-margin-top: 96px;
  margin-top: var(--space-2xl);
  padding: var(--space-xl);
  border: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
}

body.single-post .article-contact-form h2 {
  margin: 0 0 var(--space-md);
  font-family: var(--font-heading);
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
}

body.single-post .article-contact-form input,
body.single-post .article-contact-form textarea,
body.single-post .article-contact-form select {
  max-width: 100%;
}

body.single-post .article-contact-form input:focus-visible,
body.single-post .article-contact-form textarea:focus-visible,
body.single-post .article-contact-form select:focus-visible,
body.single-post .article-contact-form button:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

/* =========================================================
   Article disclosure - contenuto sponsorizzato
   ========================================================= */

body.single-post .article-disclosure {
  margin: var(--space-xl) 0;
  padding: var(--space-md) var(--space-lg);
  border-left: 4px solid var(--color-accent);
  background: var(--color-bg-secondary);
}

body.single-post .article-disclosure__text {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-meta);
  line-height: var(--lh-normal);
  color: var(--color-text-primary);
}

/* =========================================================
   CTA metà articolo sponsorizzato
   Background decorativo: /assets/images/cta-sponsored-bg.webp
   ========================================================= */

body.single-post .article-page--sponsored .sponsored-mid-cta {
  --sponsored-cta-bg: url("../images/cta-sponsored-bg.webp");
  --sponsored-cta-image-opacity: 0.86;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  margin: var(--space-2xl) 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-bg-secondary);
}

body.single-post .article-page--sponsored .sponsored-mid-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--sponsored-cta-bg);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  opacity: var(--sponsored-cta-image-opacity);
  pointer-events: none;
}

body.single-post .article-page--sponsored .sponsored-mid-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.42) 0%,
      rgba(255, 255, 255, 0.26) 38%,
      rgba(255, 255, 255, 0.12) 68%,
      rgba(255, 255, 255, 0.04) 100%
    );
  pointer-events: none;
}

body.single-post .article-page--sponsored .sponsored-mid-cta__inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.5rem, 3vw, 3rem);
  min-height: 250px;
  padding: clamp(var(--space-xl), 4vw, var(--space-2xl));
}

body.single-post .article-page--sponsored .sponsored-mid-cta__content {
  flex: 0 1 560px;
  max-width: 560px;
  min-width: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  backdrop-filter: none;
}

body.single-post .article-page--sponsored .sponsored-mid-cta__label {
  margin: 0 0 var(--space-sm);
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
  color: var(--color-brand-primary);
  text-transform: uppercase;
}

body.single-post .article-page--sponsored .sponsored-mid-cta__title {
  max-width: 540px;
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.85rem, 2.7vw, 2.65rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--color-text-primary);
}

body.single-post .article-page--sponsored .sponsored-mid-cta__text {
  max-width: 480px;
  margin: var(--space-md) 0 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.25vw, 1.12rem);
  line-height: 1.5;
  color: var(--color-text-secondary);
}

body.single-post .article-page--sponsored .sponsored-mid-cta__action {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

body.single-post .article-page--sponsored .sponsored-mid-cta__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  min-height: 54px;
  padding: 0.85rem 1.5rem;
  border: 2px solid var(--color-brand-primary);
  border-radius: 999px;
  background: var(--color-brand-primary);
  color: var(--color-bg-primary);
  font-family: var(--font-ui);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 28px rgba(23, 71, 149, 0.22);
  transition: background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

body.single-post .article-page--sponsored .sponsored-mid-cta__button:hover,
body.single-post .article-page--sponsored .sponsored-mid-cta__button:focus-visible {
  border-color: var(--color-text-primary);
  background: var(--color-text-primary);
  color: var(--color-bg-primary);
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

body.single-post .article-page--sponsored .sponsored-mid-cta__button:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 4px;
}

@media (max-width: 900px) {
body.single-post .article-page--sponsored .sponsored-mid-cta__inner {
    gap: var(--space-lg);
  }

  body.single-post .article-page--sponsored .sponsored-mid-cta__content {
    flex-basis: 500px;
  }

  body.single-post .article-page--sponsored .sponsored-mid-cta__button {
    min-width: 170px;
  }
}

@media (max-width: 768px) {
body.single-post .article-page--sponsored .sponsored-mid-cta {
    --sponsored-cta-image-opacity: 0.52;
  }

  body.single-post .article-page--sponsored .sponsored-mid-cta::before {
    background-position: center center;
    background-size: cover;
  }

  body.single-post .article-page--sponsored .sponsored-mid-cta::after {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.62) 0%,
        rgba(255, 255, 255, 0.44) 52%,
        rgba(255, 255, 255, 0.26) 100%
      );
  }

  body.single-post .article-page--sponsored .sponsored-mid-cta__inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 0;
    gap: var(--space-lg);
    padding: var(--space-xl);
  }

  body.single-post .article-page--sponsored .sponsored-mid-cta__content {
    flex: 0 1 auto;
    max-width: none;
  }

  body.single-post .article-page--sponsored .sponsored-mid-cta__title {
    max-width: none;
    font-size: clamp(1.75rem, 7.5vw, 2.25rem);
  }

  body.single-post .article-page--sponsored .sponsored-mid-cta__text {
    max-width: none;
    font-size: 1rem;
  }

  body.single-post .article-page--sponsored .sponsored-mid-cta__action {
    justify-content: flex-start;
  }

  body.single-post .article-page--sponsored .sponsored-mid-cta__button {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 480px) {
body.single-post .article-page--sponsored .sponsored-mid-cta {
    --sponsored-cta-image-opacity: 0.42;
  }

  body.single-post .article-page--sponsored .sponsored-mid-cta__inner {
    padding: var(--space-lg);
  }

  body.single-post .article-page--sponsored .sponsored-mid-cta__label {
    font-size: 0.78rem;
    letter-spacing: 0.07em;
  }

  body.single-post .article-page--sponsored .sponsored-mid-cta__title {
    font-size: clamp(1.55rem, 8vw, 2rem);
    line-height: 1.12;
  }

  body.single-post .article-page--sponsored .sponsored-mid-cta__text {
    margin-top: var(--space-sm);
    font-size: 0.98rem;
  }

  body.single-post .article-page--sponsored .sponsored-mid-cta__button {
    min-height: 52px;
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
body.single-post .article-page--sponsored .sponsored-mid-cta__button {
    transition: none;
  }

  body.single-post .article-page--sponsored .sponsored-mid-cta__button:hover,
  body.single-post .article-page--sponsored .sponsored-mid-cta__button:focus-visible {
    transform: none;
  }
}
