/* ==================================================
   RESET
================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


/* ==================================================
   BASE
================================================== */

html {
  scroll-behavior: smooth;
}

body {
  background: #1b1c1e;
  color: #fff;
  line-height: 1.6;
  font-family: 'Merriweather Sans', sans-serif;
}

.container {
  max-width: 1100px;
  margin: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Merriweather Sans', sans-serif;
  font-weight: 600;
}

::selection {
  background: #e63946;
  color: #fff;
}


/* ==================================================
   LINK
================================================== */

a {
  position: relative;
  color: #fff;
  text-decoration: none;
  transition:
    color 0.3s ease,
    opacity 0.3s ease;
}

a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1px;
  background: #e63946;
  transition: width 0.3s ease;
}

a:hover {
  color: #e63946;
}

a:hover::after {
  width: 100%;
}


/* ==================================================
   HEADER
================================================== */

.header {
  background: #000;
  text-align: center;
  padding: 28px 0 14px;
  border-bottom: 1px solid #222;
}

.header-top {
  display: flex;
  justify-content: center;
  align-content: center;
  margin-bottom: 15px;
}


/* ==================================================
   LOGO
================================================== */

.logo {
  display: flex;
  justify-content: center;
  align-content: center;
}

.logo img {
  display: block;
  width: 170px;
  height: auto;
  margin: 0 auto 12px;
}


/* ==================================================
   MENU DESKTOP
================================================== */

.nav {
  position: relative;
}

.menu {
  display: flex;
  justify-content: center;
  gap: 30px;
  padding: 10px 0;
  list-style: none;
  border-top: 1px solid #222;
}

.menu > li {
  position: relative;
}

.menu a,
.submenu-toggle {
  font-family: 'Merriweather Sans', sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.8;
}

.menu a:hover,
.submenu-toggle:hover {
  opacity: 1;
}

/* Hamburger nascosto su desktop */
.menu-toggle {
  display: none;
}

/* POESIAS / POETAS */
.submenu-toggle {
  position: relative;
  padding: 0;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: 0.3s;
}

.submenu-toggle:hover {
  color: #e63946;
}

/* Sottolineatura hover dei pulsanti POESIAS / POETAS */
.submenu-toggle::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1px;
  background: #e63946;
  transition: width 0.3s ease;
}

.submenu-toggle:hover::before {
  width: 100%;
}


/* ==================================================
   SOTTOMENU DESKTOP
================================================== */

.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  min-width: 130px;
  padding: 10px;
  background: #000;
  text-align: left;
  list-style: none;
  border-top: 2px solid #e63946;
}

.menu > li:hover > .submenu {
  display: block;
}

.submenu li {
  padding: 5px 0;
}

.submenu a {
  display: block;
  font-size: 11px;
}


/* ==================================================
   MENU ATTIVO
================================================== */

.menu > li.active > a,
.menu > li.active > .submenu-toggle {
  color: #fff;
  opacity: 1;
}

.menu > li.active > a::after {
  width: 100%;
}

.menu > li.active > .submenu-toggle::before {
  width: 100%;
}


/* ==================================================
   BREADCRUMB
================================================== */

.breadcrumb {
  max-width: 1050px;
  margin: 35px auto 20px;
  padding: 0 20px;
  color: #c7c0b5;
  font-size: 0.9rem;
}

.breadcrumb a,
.breadcrumb span {
  margin-right: 8px;
}


/* ==================================================
   HERO POESIA
================================================== */

.poesia-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  align-items: center;
  gap: 45px;
  max-width: 1050px;
  margin: 30px auto 45px;
  padding: 38px 44px;
  background: #232426;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.28);
}

.categoria {
  margin-bottom: 14px;
  color: #e63946;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.poesia-hero-text h1 {
  margin-bottom: 12px;
  color: #fff;
  font-size: clamp(2.3rem, 5vw, 3.7rem);
  line-height: 1.1;
}

.sottotitolo {
  margin-bottom: 22px;
  color: #c7c0b5;
  font-size: 1rem;
}

.link-profilo {
  display: inline-block;
  padding-bottom: 3px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.link-profilo::before {
  content: "→";
  margin-right: 8px;
  color: #e63946;
}

.poesia-hero-image {
  display: flex;
  justify-content: center;
}

.poesia-hero-image a::after {
  display: none;
}

.poesia-hero-image img {
  display: block;
  width: 215px;
  height: 215px;
  object-fit: cover;
  object-position: center;
  border: 4px solid #e63946;
  border-radius: 50%;
}


/* ==================================================
   RIQUADRO POESIA
================================================== */

.poesia {
  max-width: 1050px;
  margin: 40px auto;
  padding: 55px 45px;
  background: #f4f1ea;
  color: #1b1c1e;
  line-height: 1.9;
  border-radius: 12px;
}

.intestazione-poesia {
  margin-bottom: 38px;
}

.tipo-contenuto {
  margin-bottom: 8px;
  color: #777;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.8px;
}

.titolo-poesia {
  color: #1b1c1e;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.titolo-poesia::after {
  content: "";
  display: block;
  width: 50px;
  height: 2px;
  margin-top: 8px;
  background: #e63946;
}


/* ==================================================
   POESIA SENZA TRADUZIONE
================================================== */

.poesia-singola {
  max-width: 760px;
}

.versi {
  padding-left: 18px;
  font-style: italic;
  border-left: 2px solid #e63946;
}

.strofe {
  margin-bottom: 25px;
}

.strofe:last-child {
  margin-bottom: 0;
}

.versi p {
  margin: 0;
  color: #1b1c1e;
  font-size: 15px;
  line-height: 1.65;
}

.strofa-finale p {
  font-weight: 600;
}


/* ==================================================
   POESIA BILINGUE
================================================== */

.intestazioni-bilingue {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 46px;
  margin-bottom: 22px;
}

.intestazione-lingua {
  color: #666;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.intestazione-lingua.traduzione {
  padding-left: 42px;
}

.titolo-traduzione {
  display: block;
  margin-top: 5px;
  color: #1b1c1e;
  font-size: 15px;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 1px;
}

.griglia-bilingue {
  display: flex;
  flex-direction: column;
}

.coppia-strofe {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 46px;
  padding: 25px 0;
  border-top: 1px solid #d8d2c9;
}

.coppia-strofe:first-child {
  padding-top: 0;
  border-top: none;
}

.strofa-originale,
.strofa-traduzione {
  min-width: 0;
  padding-left: 17px;
  font-style: italic;
}

.strofa-originale {
  border-left: 2px solid #e63946;
}

.strofa-traduzione {
  padding-left: 42px;
  border-left: 1px solid #c7c0b5;
}


.strofa-originale p,
.strofa-traduzione p {
  margin: 0;
  color: #1b1c1e;
  font-size: 14px;
  line-height: 1.65;
}

.coppia-finale p {
  font-weight: 600;
}


/* ==================================================
   IMMAGINE INTERNA ALLA POESIA
================================================== */

.immagine-poesia {
  margin: 0 auto 38px;
  text-align: center;
}

.immagine-poesia img {
  display: block;
  width: 100%;
  max-width: 250px;
  height: auto;
  margin: 0 auto;
}



/* ==================================================
   NOTE E RICONOSCIMENTI
================================================== */

.note {
  margin-top: 48px;
  padding-top: 24px;
  color: #555;
  font-size: 0.92rem;
  border-top: 1px solid #d4cec4;
}

.note h3,
.note h4 {
  margin-bottom: 12px;
  color: #444;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.7px;
}

.note p {
  margin: 2px 0;
  line-height: 1.7;
}

.note strong {
  color: #333;
}

.autore-poesia {
  color: #1b1c1e;
  font-weight: 700;
}


/* ==================================================
   SEPARATORE EVENTUALE
================================================== */

.separatore-poesia {
  margin: 38px 0;
  border: none;
  border-top: 1px solid #d8d8d8;
}


/* ==================================================
   ARCHIVIO ALFABETICO
================================================== */

.indice-alfabetico {
  max-width: 900px;
  margin: 45px auto;
}

.titolo-alfabeto {
  margin-bottom: 18px;
  color: #999;
  font-size: 12px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.alfabeto {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding-top: 25px;
  border-top: 1px solid #333;
}

.alfabeto a {
  color: #d5d5d5;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 1px;
}

.alfabeto a:hover {
  color: #e63946;
}

.alfabeto a.attiva {
  color: #e63946;
  font-weight: 700;
}

.alfabeto a.attiva::after {
  width: 100%;
}


/* ==================================================
   CONTENUTI EVENTUALI
================================================== */

.contenuti {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding: 40px 20px;
  border-top: 2px solid #e63946;
}

.colonna {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.colonna h3 {
  margin-bottom: 10px;
  color: #e63946;
  font-size: 14px;
  letter-spacing: 2px;
}

.colonna a {
  color: #fff;
  font-size: 14px;
}

.colonna a:hover {
  color: #e63946;
}

.social .icone {
  display: flex;
  align-items: center;
  gap: 15px;
}

.social img {
  width: 22px;
  transition: transform 0.2s;
}

.social img:hover {
  transform: scale(1.2);
}


/* ==================================================
   FOOTER
================================================== */

.footer {
  padding: 40px 20px;
  color: #fff;
  font-size: 14px;
  text-align: center;
}

.footer p {
  margin-bottom: 8px;
}

.copyright {
  color: #aaa;
  font-size: 13px;
}


/* ==================================================
   RESPONSIVE - TABLET E SMARTPHONE
   Contenuti della poesia
================================================== */

@media (max-width: 820px) {

  .container {
    padding: 0 18px;
  }

  .logo img {
    width: 140px;
  }

  .breadcrumb {
    padding: 0;
  }


  /* ------------------------------
     HERO
  ------------------------------ */

  .poesia-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 30px 24px;
    text-align: center;
  }

  .poesia-hero-text h1 {
    font-size: 2.5rem;
  }

  .poesia-hero-image {
    grid-row: 1;
  }

  .poesia-hero-image img {
    width: 190px;
    height: 190px;
  }


  /* ------------------------------
     RIQUADRO POESIA
  ------------------------------ */

  .poesia {
    margin: 30px auto;
    padding: 42px 26px;
  }

  .poesia-singola {
    max-width: none;
  }


  /* ------------------------------
     POESIA BILINGUE
  ------------------------------ */

  .intestazioni-bilingue {
    display: none;
  }

  .coppia-strofe {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 32px 0;
  }

  .strofa-originale,
  .strofa-traduzione {
    position: relative;
    padding-top: 27px;
    padding-left: 14px;
  }

  .strofa-originale::before,
  .strofa-traduzione::before {
    position: absolute;
    top: 0;
    left: 14px;
    color: #777;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
  }

  .strofa-originale::before {
    content: "Testo originale";
  }

  .strofa-traduzione::before {
    content: "Traduzione italiana";
  }

  .strofa-originale {
    border-left: 2px solid #e63946;
  }

  .strofa-traduzione {
    padding-left: 14px;
    border-left: 2px solid #777;
  }

  .strofa-originale p,
  .strofa-traduzione p {
    font-size: 15px;
  }


  /* ------------------------------
     NOTE
  ------------------------------ */

  .note {
    margin-top: 38px;
    padding: 18px 18px 18px 20px;
    border-top: none;
    border-left: 3px solid #e63946;
  }


  /* ------------------------------
     CONTENUTI EVENTUALI
  ------------------------------ */

  .contenuti {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .social .icone {
    justify-content: center;
  }
}


/* ==================================================
   RESPONSIVE - MENU MOBILE
================================================== */

@media (max-width: 768px) {

  /* ------------------------------
     MENU HAMBURGER
  ------------------------------ */

  .menu-toggle {
    display: flex;
    width: 40px;
    height: 36px;
    margin: 0 18px 10px auto;
    padding: 9px 8px;
    flex-direction: column;
    justify-content: space-between;
    background: transparent;
    border: none;
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    margin-left: auto;
    background: #fff;
    transition: 0.3s;
  }

  .menu {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding: 0;
    border-top: 1px solid #222;
    background: #000;
  }

  .menu.menu-open {
    display: flex;
  }

  .menu > li {
    width: 100%;
    border-bottom: 1px solid #222;
  }

  .menu > li > a,
  .submenu-toggle {
    display: block;
    width: 100%;
    padding: 14px 20px;
    color: #fff;
    text-align: left;
    font-size: 12px;
    letter-spacing: 1.5px;
    opacity: 0.9;
  }


  /* ------------------------------
     VOCE ATTIVA MOBILE
  ------------------------------ */

  .menu > li.active > a,
  .menu > li.active > .submenu-toggle {
    color: #e63946;
    font-weight: 600;
    opacity: 1;
  }


  /* ------------------------------
     SOTTOMENU MOBILE
  ------------------------------ */

  .submenu-toggle {
    position: relative;
  }

  .submenu-toggle::before {
    display: none;
  }

  .submenu-toggle::after {
    content: "+";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 18px;
    line-height: 1;
  }

  .has-submenu.submenu-open > .submenu-toggle::after {
    content: "−";
  }

  .submenu {
    display: none;
    position: static;
    width: 100%;
    min-width: 0;
    padding: 0;
    background: #111;
    border-top: none;
    text-align: left;
  }

  .has-submenu.submenu-open > .submenu {
    display: block;
  }

  /* Neutralizza il comportamento hover desktop */
  .menu li:hover .submenu {
    display: none;
  }

  .menu li.submenu-open:hover .submenu,
  .menu li.submenu-open .submenu {
    display: block;
  }

  .submenu li {
    padding: 0;
    border-top: 1px solid #222;
  }

  .submenu a {
    display: block;
    padding: 12px 20px 12px 35px;
    color: #bbb;
    font-size: 11px;
  }


  /* ------------------------------
     ANIMAZIONE HAMBURGER → X
  ------------------------------ */

  .menu-toggle.is-open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}


/* ==================================================
   RESPONSIVE - SMARTPHONE PICCOLI
================================================== */

@media (max-width: 480px) {

  .header {
    padding-top: 24px;
  }

  .poesia-hero {
    margin-top: 25px;
    padding: 26px 18px;
    border-radius: 14px;
  }

  .poesia-hero-text h1 {
    font-size: 2.1rem;
  }

  .sottotitolo {
    font-size: 0.92rem;
  }

  .poesia-hero-image img {
    width: 165px;
    height: 165px;
  }

  .poesia {
    padding: 36px 19px;
    border-radius: 8px;
  }

  .titolo-poesia {
    font-size: 19px;
    letter-spacing: 1.5px;
  }

  .versi p,
  .strofa-originale p,
  .strofa-traduzione p {
    font-size: 14px;
  }

  .alfabeto {
    gap: 10px;
  }

  .alfabeto a {
    font-size: 16px;
  }
}