#intro{
  padding-top: 45vh;
  position: relative;
  overflow: clip;
}

#intro .bg-svg{
  position: absolute;
  top: -25px;
  left: -50px;
  z-index: 0;
  pointer-events: none;
}


#intro .bg-svg svg{
  width: clamp(350px, 302px + 15vw, 590px);
  height: auto;
  transform: rotate(36deg); /* verso destra */
  transform-origin: 50% 50%;
  color: rgba(0,0,0,.18);
  filter: grayscale(1);
  opacity: .35;
}

#intro .contenitore{
  position: relative;
  z-index: 1;
  padding-bottom: 0;
  margin-bottom: 0;
}

#intro .contenitore header h1{
  font-size: clamp(22px, 7.2px + 4.625vw, 96px);
}

@media (max-width: 768px){
  #intro .bg-svg{
    opacity: .18;
    top: -60px;
    left: -60px;
  }

  #intro .bg-svg svg{
    width: 360px;
  }
}

@media only screen and (min-width: 768px){
  #intro .contenitore .contenuto{
    padding-left: 30%;
  }
}

/* =========================
   HERO
   ========================= */

#portfolio-hero{
  padding: var(--space-m, 1.5rem) 0;
}

#portfolio-hero .contenitore img{
  display: block;
  width: 100%;
  height: auto;
}

#portfolio-hero2{
  padding: var(--space-m, 1.5rem) 0;
}

#portfolio-hero2 .contenitore img{
  display: block;
  width: 100%;
  height: auto;
}


/* =========================
   PORTFOLIO BLOCKS
   Mobile: 1 colonna
   Desktop: 2 colonne + alternanza
   ========================= */

.portfolio-block{
  padding: var(--space-l, 3rem) 0;
}



.portfolio-block .contenitore{
  display: flex;
  flex-direction: column;
  gap: var(--space-m, 1.5rem);
}

/* elementi base */
.portfolio-block .copy,
.portfolio-block .media{
  width: 100%;
  min-width: 0;
}

.portfolio-block .media img{
  display: block;
  width: 100%;
  height: auto;
}

/* desktop layout */
@media (min-width: 900px){
  .portfolio-block .contenitore{
    flex-direction: row;
    align-items: center;                 /* allineamento verticale tra copy e media */
    gap: var(--space-l, 3rem);
  }

  .portfolio-block .copy{  flex: 1.25 1 0; }
  .portfolio-block .media{ flex: 1 1 0; }

  /* alternanza: LEFT = media a sinistra (row-reverse), RIGHT = default */
  .portfolio-block.left  .contenitore{ flex-direction: row-reverse; }
}


/* =========================
   TYPO / LISTE (se presenti)
   ========================= */

.portfolio-block .copy h2{
  padding-bottom: var(--space-s, .75rem);
}

.portfolio-block .copy ul{
  list-style: none;
  margin: var(--space-s, .75rem) 0 0 0;
  padding: 0;
  padding-left: var(--space-s);
}

.portfolio-block .copy li{
  margin: 0 0 var(--space-s, .75rem) 0;
  padding-left: .75rem;
  border-left: 2px solid var(--arancione, #ff7514);
  font-size: var(--font-size-sml, .95rem);
  line-height: 1.5;
}

.portfolio-block .copy li span{
  color: var(--arancione, #ff7514);
  font-weight: 700;
}


/* =========================
   Approfondimenti progetto
   ========================= */

#progetto-approfondimenti {
  padding: 0;
  margin: 0;
}

#progetto-approfondimenti .contenitore{
  padding: 0;
  margin: 0 auto;
}

#progetto-approfondimenti .section-header {
  padding: 0;
  margin: 0;
}

#progetto-approfondimenti .section-header h2{
  margin: 0 0 .35rem 0;

}

#progetto-approfondimenti .section-header p{
  margin: 0;
  max-width: 60ch;
  opacity: .85;
}

/* Lista link */
#progetto-approfondimenti .link-esterni{
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-s, .75rem);
}

/* Link “a tutta riga” */
#progetto-approfondimenti .link-esterni a{
  display: flex;
  align-items: center;
  gap: var(--space-s, .9rem);

  padding: 0 0;
  text-decoration: none;
  color: inherit;

  border-bottom: 1px solid var(--border, rgba(0,0,0,.12));

  transition:
    transform .18s ease,
    color .18s ease,
    background-color .18s ease,
    border-color .18s ease;

}

#progetto-approfondimenti .link-esterni li:last-child a{
  border-bottom: none;
}

/* Icona */
#progetto-approfondimenti .link-esterni .icon{
  width: clamp(22px, 16px + 1.4vw, 34px);
  height: auto;
  flex: 0 0 auto;

  opacity: .9;
  color: currentColor; /* prende il colore del link */
}

/* Testo */
#progetto-approfondimenti .link-esterni a > span{
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0; /* evita overflow su testi lunghi */
}

#progetto-approfondimenti .link-esterni strong{
  font-weight: 800;
  line-height: 1.05;
  font-size: clamp(16px, 12px + 1vw, 22px);
}

#progetto-approfondimenti .link-esterni em{
  font-style: normal;
  opacity: .78;
  line-height: 1.35;
  font-size: clamp(13px, 11px + .45vw, 16px);
}

/* Hover / focus (stesso effetto) */
#progetto-approfondimenti .link-esterni a:hover,
#progetto-approfondimenti .link-esterni a:focus-visible{
  transform: translateX(6px);
  color: var(--accent, var(--colore-accento, #ff7514));
  outline: none;
}

/* “Hit area” più comoda su touch */
@media (pointer: coarse){
  #progetto-approfondimenti .link-esterni a{
    padding: 1.05rem 0;
  }
}

/* Desktop: affianca i due link (ma resta flex, niente grid) */
@media (min-width: 900px){
  #progetto-approfondimenti .link-esterni{
    flex-direction: row;
    gap: var(--space-s);
  }

  #progetto-approfondimenti .link-esterni li{
    flex: 1 1 0;
  }

  #progetto-approfondimenti .link-esterni a{
    padding: 0;
    border-bottom: none;
  }

  #progetto-approfondimenti .link-esterni a:hover,
  #progetto-approfondimenti .link-esterni a:focus-visible{
    transform: translateY(-2px); /* su desktop è più elegante */
  }
}

/* Rispetto per chi riduce le animazioni */
@media (prefers-reduced-motion: reduce){
  #progetto-approfondimenti .link-esterni a{
    transition: none;
  }
  #progetto-approfondimenti .link-esterni a:hover,
  #progetto-approfondimenti .link-esterni a:focus-visible{
    transform: none;
  }
}


/*---------------------------*/
/* =========================
   Next / Prev (stile come progetto-approfondimenti)
   ========================= */


#next-prev{
    border-bottom: 1px solid var(--border, rgba(0,0,0,.12));
}

#next-prev .contenitore{
  display: flex;
  flex-direction: column;
  /*
  gap: var(--space-s, .75rem);
  */
  width: 99%;
  max-width: 99%;
  margin: 0 auto;
  padding: 0;
}

/* blocchi prev/next */
#next-prev .prev,
#next-prev .next{
  min-width: 0;

}

/* link “a tutta riga” */
#next-prev a{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s, .9rem);

  text-decoration: none;
  color: inherit;


  transition:
    transform .18s ease,
    color .18s ease,
    background-color .18s ease,
}

#next-prev .next a{
  border-bottom: none;
}

/* Icone */
#next-prev .icon{
  width: clamp(22px, 16px + 1.4vw, 34px);
  height: auto;
  flex: 0 0 auto;

  opacity: .9;
  color: currentColor;
}

/* testo */
#next-prev a > span{
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}

#next-prev em{
  font-style: normal;
  opacity: .78;
  line-height: 1.35;
  font-size: clamp(13px, 11px + .45vw, 16px);
}

#next-prev strong{
  font-weight: 800;
  line-height: 1.05;
  font-size: clamp(16px, 12px + 1vw, 22px);
}

/* prev: icona a sinistra, testo dopo (già ok) */
#next-prev .prev a{
  justify-content: flex-start;
}

/* next: testo prima, icona a destra (invertiamo) */
#next-prev .next a{
  flex-direction: row-reverse;
  justify-content: flex-start;
  text-align: right;
}

/* Hover / Focus */
#next-prev a:hover,
#next-prev a:focus-visible{
  color: var(--accent, var(--colore-accento, #ff7514));
  outline: none;
}

/* movimento coerente col blocco approfondimenti */
#next-prev .prev a:hover,
#next-prev .prev a:focus-visible{
  transform: translateX(6px);
}

#next-prev .next a:hover,
#next-prev .next a:focus-visible{
  transform: translateX(-6px);
}

/* Touch: hit area più comoda */
@media (pointer: coarse){
  #next-prev a{
    padding: 1.05rem 0;
  }
}

/* Desktop: affiancati, divider come sopra (niente grid) */
@media (min-width: 900px){
  #next-prev .contenitore{
    flex-direction: row;
    gap: var(--space-m, 1.5rem);
  }

  #next-prev .prev,
  #next-prev .next{
    flex: 1 1 0;
  }

  #next-prev a{
    border-bottom: none;
  }

  #next-prev .prev a:hover,
  #next-prev .prev a:focus-visible{
    transform: translateY(-2px);
  }

  #next-prev .next a:hover,
  #next-prev .next a:focus-visible{
    transform: translateY(-2px);
  }
}

/* Riduzione motion */
@media (prefers-reduced-motion: reduce){
  #next-prev a{
    transition: none;
  }
  #next-prev a:hover,
  #next-prev a:focus-visible{
    transform: none;
  }
}


#next-prev .icon{
  transition: transform .18s ease;
}

/* PREV → freccia verso sinistra */
#next-prev .prev a:hover .icon,
#next-prev .prev a:focus-visible .icon{
  transform: translateX(-3px);
}

/* NEXT → freccia verso destra */
#next-prev .next a:hover .icon,
#next-prev .next a:focus-visible .icon{
  transform: translateX(3px);
}

/* Rispetto prefers-reduced-motion */
@media (prefers-reduced-motion: reduce){
  #next-prev .icon{
    transition: none;
  }
}

.portfolio-block--tight{
  padding: var(--space-m, 1.75rem) 0;
}

.portfolio-block--tight .contenitore{
  gap: var(--space-s, 1rem);
}

@media (min-width: 900px){
  .portfolio-block--tight .contenitore{
    gap: var(--space-m, 1.5rem);
  }
}

/* testo più compatto */
.portfolio-block--tight .copy h2{
  padding-bottom: .35rem;
}

.portfolio-block--tight .copy p{
  margin-top: .35rem;
}

#portfolio-hero .contenitore .img-border{
  border-radius: 14px;
}