/* ============================================
   PANELS (TEXT BOXES)
   ============================================ */
.text-box, .personal-works-box {
  position: fixed;
  left: 22vw;
  bottom: 28.5%;
  top: auto;
  right: auto;
  width: 42vw;
  max-height: 60vh;
  background: transparent;
  padding: 0;
  box-sizing: border-box;
  overflow-y: hidden;
  overflow-x: hidden;
  z-index: 100;
  display: none;
  opacity: 0;
  transform: none !important;
  transition: none !important;
}

.text-box.active, .personal-works-box.active {
  display: block;
  opacity: 1;
}

.text-box-content, .personal-works-content {
  height: auto;
  max-height: 60vh;
  padding-right: 1.5vw;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.text-box-content::-webkit-scrollbar,
.personal-works-content::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

.text-box h2, .personal-works-box h2 {
  margin-top: 0;
  font-size: 3vh;
  font-weight: 400;
  text-transform: lowercase;
  color: var(--accent-lime);
}

.text-box p, .personal-works-box p {
  line-height: 1.5em;
  margin-bottom: 1.2em;
  max-width: 100%;
  font-size: 1.7vh;
  font-weight: 300;
  color: var(--text-main);
}

/* ============================================
   WORK ITEMS
   ============================================ */
.personal-work-item {
  margin-bottom: 1.2em;
}

.personal-work-item .work-link {
  font-size: 2vh;
  display: inline-block;
  margin-bottom: -0.3em;
  font-weight: 300;
  color: var(--text-main);
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: none;
  padding: 0.02em 0.2vw;
  line-height: 1.15;
  transition: color 0.3s ease,
              background-size 0.35s cubic-bezier(0.23, 1, 0.32, 1);
  /* Sottolineatura animata via background */
  background-image: linear-gradient(var(--accent-lime), var(--accent-lime));
  background-repeat: no-repeat;
  background-position: left 100%;
  background-size: 0% 1px;
}

/* Hover: anticipa l'effetto selezionato */
.personal-work-item .work-link:hover {
  color: var(--accent-lime);
  font-style: italic;
  background-size: 100% 1px;
}

/* Stato selezionato: identico all'hover */
.personal-work-item .work-link.active-project {
  color: var(--accent-lime) !important;
  font-style: italic !important;
  background-size: 100% 1px !important;
  font-weight: 300 !important;
}

.personal-work-item p {
  font-size: 1.8vh;
  font-weight: 300;
  line-height: 1.4;
  color: var(--text-dim);
  margin-top: 0;
  margin-bottom: 0.4em;
  margin-left: 0.7vw !important;
  font-style: italic !important;
}

/* ============================================
   DOWNLOAD LINK
   ============================================ */
.cv-download-link {
  display: inline-block;
  color: var(--accent-lime) !important;
  font-size: 1.7vh;
  font-weight: 500;
  margin-top: 1.5vh;
  margin-left: 0 !important;
  text-decoration: none !important;
}

.cv-download-link::before {
  content: none !important;
}

.cv-download-link:hover {
  opacity: 0.6;
}

/* ============================================
   PROJECT GALLERY (OVERLAY ATTIVO)
   ============================================ */
body.project-gallery-active .gallery-container {
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 99999 !important;
}

.project-gallery-close-btn {
  position: fixed !important;
  top: calc(env(safe-area-inset-top) + 2vh) !important;
  left: 5vw !important;
  font-size: 2vh !important;
  font-weight: 300 !important;
  color: var(--text-main) !important;
  text-decoration: none !important;
  z-index: 100000 !important;
  cursor: pointer !important;
  display: none;
  transition: color 0.3s ease;
}

.project-gallery-close-btn:hover {
  color: var(--accent-lime) !important;
}

body.project-gallery-active .project-gallery-close-btn {
  display: block;
}

/* ============================================
   PROJECT SLIDE DESCRIPTION
   ============================================ */
.project-slide-desc {
  width: 100%;
  text-align: left;
  font-size: 1.6vh !important;
  font-weight: 300;
  margin-top: 0.5vh !important;
  margin-left: 1vw;
  color: var(--text-main) !important;
  line-height: 1.4;
}