/* ==========================================================
   RENIX — NEWS
   Carosello no; card fronte/retro con flip al click.
   Carica DOPO style.css.
========================================================== */

:root {
  --news-dark: #344041;
  --news-dark-soft: #4c5b5c;
  --news-green: #91c3a2;
  --news-green-light: #cde4c5;
  --news-green-pale: #d8e8cf;
  --news-white: #ffffff;
  --news-text: #344041;

  --news-max: 1120px;
  --news-pad: clamp(28px, 5.3vw, 72px);

  --news-font: "Montserrat", Arial, Helvetica, sans-serif;
}


/* ==========================================================
   BASE
========================================================== */

.news-page {
  margin: 0;
  overflow-x: hidden;

  background: var(--news-white);
  color: var(--news-text);

  font-family: var(--news-font);
}

.news-page *,
.news-page *::before,
.news-page *::after {
  box-sizing: border-box;
}

.news-page img {
  display: block;
  max-width: 100%;
}

.news-container {
  width: 100%;
  max-width: none;

  margin: 0;

  padding-left: 66px;
  padding-right: 66px;
}


/* ==========================================================
   HERO
========================================================== */

.news-hero {
  position: relative;

  width: 100%;
  height: clamp(510px, 57vw, 620px);

  overflow: hidden;

  background: var(--news-dark);
  color: var(--news-white);
}

.news-hero__background {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center center;
}

.news-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;

  background:
    linear-gradient(
      90deg,
      rgba(14, 23, 24, 0.82) 0%,
      rgba(14, 23, 24, 0.62) 35%,
      rgba(14, 23, 24, 0.24) 70%,
      rgba(14, 23, 24, 0.08) 100%
    );
}

.news-hero__content {
  position: relative;
  z-index: 2;

  width: min(100%, 1080px);
  height: 100%;

  margin-left: 66px;
  padding-right: 40px;

  display: flex;
  flex-direction: column;
  justify-content: center;

  transform: translateY(34px);
}

.news-hero h1 {
  max-width: 1040px;

  margin: 0 0 24px;

  color: var(--news-white);

  font-family: var(--news-font);
  font-size: clamp(46px, 5vw, 64px);
  line-height: 1.03;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.news-hero p {
  max-width: 760px;

  margin: 0 0 34px;

  color: var(--news-white);

  font-family: var(--news-font);
  font-size: clamp(20px, 2vw, 25px);
  line-height: 1.35;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.news-hero__button {
  width: fit-content;
  min-width: 224px;
  min-height: 52px;

  padding: 0 18px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  border-radius: 6px;

  background: var(--news-green-light);
  color: var(--news-dark-soft);

  font-family: var(--news-font);
  font-size: 15px;
  line-height: 1;
  font-weight: 600;

  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}

.news-hero__button:hover {
  background: #dff0d9;
  transform: translateY(-2px);
}


/* ==========================================================
   FILTRI
========================================================== */

.news-filter-section {
  padding: 26px 0;

  background: var(--news-dark-soft);
}

.news-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 20px;
}

.news-filter {
  min-height: 44px;

  padding: 0 24px;

  border: 1px solid rgba(52, 64, 65, 0.22);
  border-radius: 8px;

  background: var(--news-white);
  color: var(--news-dark-soft);

  box-shadow: 0 2px 5px rgba(31, 43, 44, 0.16);

  font-family: var(--news-font);
  font-size: 14px;
  font-weight: 500;

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.news-filter:hover {
  transform: translateY(-2px);
}

.news-filter.is-active {
  background: var(--news-dark);
  color: var(--news-white);
}


/* ==========================================================
   CONTENUTO NEWS
========================================================== */

.news-content {
  padding: 64px 0 78px;

  background: var(--news-white);
}

.news-intro {
  margin-bottom: 38px;
}

.news-intro h2 {
  margin: 0 0 13px;

  color: var(--news-dark);

  font-family: var(--news-font);
  font-size: clamp(27px, 2.8vw, 36px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.news-intro h2 span {
  color: var(--news-green);
}

.news-intro p {
  max-width: 1000px;

  margin: 0;

  color: var(--news-dark-soft);

  font-family: var(--news-font);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
}


/* ==========================================================
   FLIP CARD — LOGICA GENERALE
========================================================== */

.flip-card {
  perspective: 1600px;

  cursor: pointer;

  outline: none;
}

.news-featured,
.news-card {
  filter: drop-shadow(0 7px 8px rgba(24, 36, 37, 0.20));
}

.flip-card__inner {
  position: relative;

  width: 100%;
  height: 100%;

  transform-style: preserve-3d;

  transition:
    transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}

.flip-card.is-flipped .flip-card__inner {
  transform: rotateY(180deg);
}

.flip-card__face {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  overflow: hidden;

  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-card__back {
  transform: rotateY(180deg);
}

.flip-card:focus-visible {
  outline: 3px solid var(--news-green);
  outline-offset: 4px;
}

.flip-card[hidden] {
  display: none !important;
}

.flip-hint {
  font-family: var(--news-font);
  font-size: 11px;
  font-weight: 700;
}


/* ==========================================================
   NEWS IN EVIDENZA
========================================================== */

.news-featured {
  position: relative;

  width: 100%;
  height: 305px;

  margin-bottom: 58px;
}

.news-featured__front {
  display: grid;

  grid-template-columns:
    minmax(270px, 0.38fr)
    minmax(0, 0.62fr);

  border-radius: 18px;

  box-shadow:
    0 9px 20px rgba(33, 47, 48, 0.20),
    0 3px 7px rgba(33, 47, 48, 0.12);
}

.news-featured__intro {
  padding: 42px 38px;

  display: flex;
  flex-direction: column;

  background: var(--news-dark);
  color: var(--news-white);
}

.news-featured__eyebrow {
  color: var(--news-green-light);

  font-family: var(--news-font);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
}

.news-featured__category {
  color: var(--news-dark);

  font-family: var(--news-font);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
}

.news-featured__intro h3 {
  margin: 28px 0 18px;

  color: var(--news-white);

  font-family: var(--news-font);
  font-size: clamp(24px, 2.3vw, 31px);
  line-height: 1.1;
  font-weight: 700;
}

.news-featured__intro p {
  margin: 0 0 24px;

  color: rgba(255, 255, 255, 0.92);

  font-family: var(--news-font);
  font-size: 13px;
  line-height: 1.45;
}

.news-featured__badge {
  width: fit-content;

  margin-top: auto;
  padding: 10px 14px;

  border: 1px solid var(--news-green-light);
  border-radius: 4px;

  color: var(--news-green-light);

  font-family: var(--news-font);
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
}

.news-featured__main {
  position: relative;

  padding: 42px 50px 38px;

  background: var(--news-green-pale);
  color: var(--news-dark);
}

.news-featured__main h3 {
  margin: 26px 0 18px;

  color: var(--news-dark-soft);

  font-family: var(--news-font);
  font-size: clamp(25px, 2.5vw, 34px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.news-featured__main p {
  max-width: 680px;

  margin: 0 0 18px;

  color: var(--news-dark-soft);

  font-family: var(--news-font);
  font-size: 13px;
  line-height: 1.45;
}

.news-featured__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 34px;

  padding-top: 0;
}

.news-featured__stats > div {
  position: relative;

  padding-top: 16px;
}

.news-featured__stats > div::before {
  content: "";

  position: absolute;
  left: 0;
  top: 0;

  width: min(100%, 145px);
  height: 2px;

  background: #536164;
}

.news-featured__stats strong {
  display: block;

  margin-bottom: 4px;

  color: var(--news-dark);

  font-size: 13px;
  font-weight: 800;
}

.news-featured__stats span {
  display: block;

  color: var(--news-dark-soft);

  font-size: 9px;
  line-height: 1.25;
  font-weight: 500;
}

.news-featured__front > .flip-hint {
  position: absolute;
  right: 22px;
  bottom: 17px;

  color: var(--news-dark-soft);
}

.news-featured__back {
  padding: 42px 48px;

  border-radius: 18px;

  background: var(--news-dark);
  color: var(--news-white);

  box-shadow:
    0 9px 20px rgba(33, 47, 48, 0.20),
    0 3px 7px rgba(33, 47, 48, 0.12);
}

.news-featured__back h3 {
  max-width: 760px;

  margin: 18px 0 24px;

  color: var(--news-white);

  font-family: var(--news-font);
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.08;
  font-weight: 700;
}

.news-featured__back p {
  max-width: 900px;

  margin: 0 0 14px;

  color: rgba(255, 255, 255, 0.94);

  font-family: var(--news-font);
  font-size: 14px;
  line-height: 1.5;
}

.news-featured__back .flip-hint {
  position: absolute;
  right: 28px;
  bottom: 22px;

  color: var(--news-green-light);
}


/* ==========================================================
   GRID
========================================================== */

.news-grid {
  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 38px 30px;
}

.news-card {
  position: relative;

  height: 370px;
}

.news-card__front,
.news-card__back {
  border: 1px solid rgba(52, 64, 65, 0.30);
  border-radius: 12px;

  box-shadow:
    0 7px 14px rgba(21, 31, 29, 0.18),
    0 2px 5px rgba(21, 31, 29, 0.12);
}

.news-card__front {
  background: var(--news-white);
}

.news-card__front img {
  width: 100%;
  height: 185px;

  object-fit: cover;
}

.news-card__front-body {
  height: calc(100% - 185px);

  padding: 18px 20px 20px;

  display: flex;
  flex-direction: column;
}

.news-card__meta {
  margin-bottom: 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 15px;

  color: var(--news-dark-soft);

  font-size: 9px;
  line-height: 1.2;
  font-weight: 500;
}

.news-card__front h3 {
  margin: 0;

  color: var(--news-dark-soft);

  font-family: var(--news-font);
  font-size: clamp(18px, 1.65vw, 23px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.news-card__front .flip-hint {
  margin-top: auto;

  color: var(--news-green);
}

.news-card__back {
  padding: 28px 25px 25px;

  background: var(--news-dark);
  color: var(--news-white);
}

.news-card__category {
  color: var(--news-green-light);

  font-family: var(--news-font);
  font-size: 9px;
  line-height: 1;
  font-weight: 700;
  text-transform: uppercase;
}

.news-card__back h3 {
  margin: 18px 0 20px;

  color: var(--news-white);

  font-family: var(--news-font);
  font-size: 20px;
  line-height: 1.12;
  font-weight: 700;
}

.news-card__back p {
  margin: 0 0 13px;

  color: rgba(255, 255, 255, 0.94);

  font-family: var(--news-font);
  font-size: 11px;
  line-height: 1.45;
}

.news-card__back .flip-hint {
  position: absolute;
  left: 25px;
  bottom: 22px;

  color: var(--news-green-light);
}


/* ==========================================================
   FOOTER DIVIDER
========================================================== */

.news-footer-divider {
  width: 100%;
  height: 38px;

  background: var(--news-dark);
}


/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 980px) {

  .news-hero__content {
    margin-left: 40px;
  }

  .news-featured {
    height: 335px;
  }

  .news-featured__front {
    grid-template-columns:
      minmax(240px, 0.42fr)
      minmax(0, 0.58fr);
  }

  .news-featured__intro {
    padding: 34px 28px;
  }

  .news-featured__main {
    padding: 34px 34px 30px;
  }

  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .news-card {
    height: 385px;
  }
}


/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 620px) {

  :root {
    --news-pad: 18px;
  }

  .news-container {
    padding-left: 18px;
    padding-right: 18px;
  }

  .desktop-break {
    display: none;
  }

  .news-hero {
    height: 590px;
  }

  .news-hero__background {
    object-position: 70% center;
  }

  .news-hero__overlay {
    background:
      linear-gradient(
        180deg,
        rgba(14, 23, 24, 0.12) 0%,
        rgba(14, 23, 24, 0.46) 38%,
        rgba(14, 23, 24, 0.91) 100%
      );
  }

  .news-hero__content {
    width: 100%;

    margin: 0;
    padding: 0 18px 50px;

    justify-content: flex-end;

    transform: none;
  }

  .news-hero h1 {
    font-size: clamp(34px, 10vw, 44px);
  }

  .news-hero p {
    font-size: 16px;
  }

  .news-hero__button {
    width: 100%;
  }

  .news-filter-section {
    padding: 18px 0;
  }

  .news-filters {
    flex-wrap: nowrap;

    gap: 10px;

    overflow-x: auto;

    padding-bottom: 5px;

    scrollbar-width: none;
  }

  .news-filters::-webkit-scrollbar {
    display: none;
  }

  .news-filter {
    min-width: max-content;
    min-height: 40px;

    padding: 0 18px;
  }

  .news-content {
    padding: 50px 0 60px;
  }

  .news-featured {
    height: 600px;

    margin-bottom: 42px;
  }

  .news-featured__front {
    grid-template-columns: 1fr;
    grid-template-rows: 0.82fr 1.18fr;
  }

  .news-featured__intro {
    padding: 27px 24px;
  }

  .news-featured__intro h3 {
    margin-top: 19px;
    font-size: 24px;
  }

  .news-featured__main {
    padding: 27px 24px 34px;
  }

  .news-featured__main h3 {
    margin-top: 17px;
    font-size: 26px;
  }

  .news-featured__stats {
    gap: 10px;
  }

  .news-featured__back {
    padding: 30px 24px;
  }

  .news-featured__back h3 {
    font-size: 28px;
  }

  .news-grid {
    grid-template-columns: 1fr;

    gap: 26px;
  }

  .news-card {
    height: 405px;
  }

  .news-card__front img {
    height: 205px;
  }

  .news-card__front-body {
    height: calc(100% - 205px);
  }
}


/* ==========================================================
   RIDUZIONE MOVIMENTO
========================================================== */

@media (prefers-reduced-motion: reduce) {

  .flip-card__inner {
    transition: none;
  }

  .news-filter,
  .news-hero__button {
    transition: none;
  }
}


/* ==========================================================
   NEWS IN EVIDENZA — CARD STATICA
   Non ruota, non ha retro, non mostra "continua a leggere".
========================================================== */

.news-featured {
  cursor: default;
}

.news-featured__front {
  position: relative;
  inset: auto;

  width: 100%;
  height: 100%;

  overflow: hidden;
}

.news-featured .flip-hint,
.news-featured__back {
  display: none !important;
}



/* ==========================================================
   MOBILE — News in evidenza senza contenuti tagliati
========================================================== */

@media (max-width: 620px) {

  .news-featured {
    height: auto !important;
    min-height: 0 !important;
  }

  .news-featured__front {
    height: auto !important;
    min-height: 0 !important;

    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
  }

  .news-featured__main {
    padding-bottom: 30px !important;
  }

  .news-featured__stats {
    margin-top: 4px;
    align-items: start;
  }

  .news-featured__stats > div {
    min-width: 0;
    padding-top: 14px;
  }

  .news-featured__stats strong {
    font-size: 13px;
    white-space: nowrap;
  }

  .news-featured__stats span {
    display: block !important;
    min-height: 24px;
    margin-top: 4px;
    font-size: 8px !important;
    line-height: 1.25 !important;
    overflow: visible !important;
  }
}
