/*
 * Studio Floris - News condominio
 * Il componente resta SEMPRE nel normale flusso della pagina:
 * niente position: fixed, niente sovrapposizioni su altri contenuti.
 */

.news-section {
  padding: clamp(58px, 7vw, 88px) 0;
  background: var(--paper);
  border-top: 1px solid rgba(18, 49, 77, 0.08);
  border-bottom: 1px solid rgba(18, 49, 77, 0.08);
}

.sf-news,
.sf-news * {
  box-sizing: border-box;
}

.sf-news {
  width: 100%;
}

.sf-news__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(24px, 5vw, 64px);
  margin-bottom: clamp(25px, 4vw, 36px);
}

.sf-news__header h2 {
  max-width: 820px;
}

.sf-news__subtitle {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.sf-news__updated {
  flex: 0 0 auto;
  margin: 4px 0 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.sf-news__viewport {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background:
    radial-gradient(circle at 100% 0%, rgba(18, 49, 77, 0.055), transparent 40%),
    #fff;
  box-shadow: 0 18px 50px rgba(22, 43, 59, 0.065);
  touch-action: pan-y;
}

.sf-news__track {
  display: flex;
  width: 100%;
  will-change: transform;
  transition: transform 480ms cubic-bezier(.22, .61, .36, 1);
}

.sf-news__slide {
  flex: 0 0 100%;
  min-width: 0;
  min-height: 225px;
  padding: clamp(28px, 4.5vw, 50px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sf-news__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.76rem;
}

.sf-news__source,
.sf-news__category {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 700;
}

.sf-news__source {
  background: #eaf0f5;
  color: var(--navy);
}

.sf-news__category {
  background: var(--soft);
  color: #455765;
}

.sf-news__date {
  white-space: nowrap;
}

.sf-news__date::before {
  content: "•";
  margin-right: 9px;
  color: #a8b2bb;
}

.sf-news__headline {
  max-width: 970px;
  margin: 0;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 3.6vw, 2.65rem);
  font-weight: 400;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.sf-news__headline a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(18, 49, 77, 0.12);
}

.sf-news__headline a:hover,
.sf-news__headline a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 5px;
}


.sf-news__controls {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.sf-news__arrow {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  font: inherit;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.sf-news__arrow:hover {
  background: var(--soft);
}

.sf-news__arrow:focus-visible,
.sf-news__dot:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.sf-news__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 24px;
}

.sf-news__dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #c7d0d7;
  cursor: pointer;
  transition: width 180ms ease, background 180ms ease, border-radius 180ms ease;
}

.sf-news__dot.is-active {
  width: 24px;
  border-radius: 999px;
  background: var(--navy);
}

.sf-news__sources {
  margin: 19px auto 0;
  text-align: center;
  color: #7b8994;
  font-size: 0.72rem;
  line-height: 1.55;
}

.sf-news__loading,
.sf-news__empty {
  min-height: 225px;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.sf-news__spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid #d6dee4;
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: sfNewsSpin .75s linear infinite;
}

@keyframes sfNewsSpin {
  to { transform: rotate(360deg); }
}

/* Tablet */
@media (max-width: 900px) {
  .sf-news__header {
    display: block;
  }

  .sf-news__updated {
    display: inline-block;
    margin-top: 18px;
  }
}

/* Smartphone */
@media (max-width: 760px) {
  .news-section {
    padding: 52px 0;
  }

  .sf-news__header {
    margin-bottom: 24px;
  }

  .sf-news__subtitle {
    margin-top: 13px;
    font-size: 0.94rem;
  }

  .sf-news__slide {
    min-height: 250px;
    padding: 27px 24px 29px;
    justify-content: flex-start;
  }

  .sf-news__headline {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }

  .sf-news__controls {
    margin-top: 16px;
  }

  .sf-news__sources {
    padding-inline: 10px;
  }
}

@media (max-width: 420px) {
  .sf-news__slide {
    min-height: 270px;
    padding: 24px 20px 27px;
  }

  .sf-news__meta {
    gap: 7px;
  }

  .sf-news__source,
  .sf-news__category {
    font-size: 0.71rem;
  }

  .sf-news__date {
    width: 100%;
  }

  .sf-news__date::before {
    content: "";
    margin: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sf-news__track,
  .sf-news__dot {
    transition: none;
  }

  .sf-news__spinner {
    animation: none;
  }
}
