/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  background-color: #000;
  color: #fff;
  font-family: "Roboto Flex", sans-serif;
  font-weight: 300;
}

/* Page transitions */
body {
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

body.fade-in {
  opacity: 1;
}

main {
  opacity: 1;
  transition: opacity 0.4s ease-in-out;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  z-index: 100;
}

.nav-left {
  font-size: 1.4rem;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  margin-left: -10px;
}

.nav-left .first-name {
  font-weight: 300;
  color: #bbb;
}

.nav-left .last-name {
  font-weight: 600;
  color: #fff;
}

.nav-left a.andrea-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  transition: color 0.3s ease;
}

.nav-left a.andrea-link:hover .last-name {
  color: #f5c518;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 100%;
}

.nav-links .nav-item {
  font-size: 1rem;
  font-weight: 300;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

.nav-links .nav-item:hover {
  color: #f5c518;
}

/* Project container */
.project-container {
  display: flex;
  height: calc(100vh - 60px);
  margin-top: 60px;
}

.project-carousel {
  width: 66.6666%;
  position: relative;
  overflow: hidden;
}

.project-text {
  width: 33.3333%;
  padding: 50px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}

.slides-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: pointer;
}

.carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.carousel__btn:hover {
  opacity: 0.9;
}

.carousel__btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  border-top: 2px solid #ddd;
  border-right: 2px solid #ddd;
  transform-origin: center;
}

.carousel__btn--prev::before {
  transform: translate(-50%, -50%) rotate(-135deg);
}

.carousel__btn--next::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.carousel__btn--prev { left: 20px; }
.carousel__btn--next { right: 20px; }

.carousel__indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.carousel__indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.carousel__indicator.active {
  background: #f5c518;
  transform: scale(1.4);
}

.project-metadata-line {
  font-size: 0.9rem;
  font-weight: 300;
  font-family: "Roboto Flex", sans-serif;
  color: #999;
  margin-bottom: 0.5rem;
  letter-spacing: 0.3px;
}

.project-title {
  font-size: 5rem;
  font-weight: 300;
  line-height: 1;
  flex-shrink: 0;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

.project-short-desc {
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1.3;
  margin-bottom: 2.5em;
  color: #ccc;
}

.project-description,
.tinymce-content {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.7;
  color: #ddd;
  text-align: left;
  word-spacing: normal;
}

.project-description p,
.tinymce-content p {
  margin-bottom: 1.2em;
  text-align: left !important;
  word-spacing: normal !important;
}

.project-description h1,
.project-description h2,
.project-description h3,
.project-description h4,
.tinymce-content h1,
.tinymce-content h2,
.tinymce-content h3,
.tinymce-content h4 {
  color: #fff;
  margin-top: 1.5em;
  margin-bottom: 0.8em;
  font-weight: 400;
}

.project-description h1,
.tinymce-content h1 { font-size: 1.8rem; }
.project-description h2,
.tinymce-content h2 { font-size: 1.5rem; }
.project-description h3,
.tinymce-content h3 { font-size: 1.2rem; }
.project-description h4,
.tinymce-content h4 { font-size: 1.1rem; }

.project-description ul,
.project-description ol,
.tinymce-content ul,
.tinymce-content ol {
  margin-left: 1.5em;
  margin-bottom: 1.2em;
}

.project-description li,
.tinymce-content li {
  margin-bottom: 0.5em;
}

.project-description strong,
.project-description b,
.tinymce-content strong,
.tinymce-content b {
  font-weight: 500;
  color: #fff;
}

.project-description em,
.project-description i,
.tinymce-content em,
.tinymce-content i {
  font-style: italic;
  color: #e0e0e0;
}

.project-description u,
.tinymce-content u {
  text-decoration: underline;
}

.project-description a,
.tinymce-content a {
  color: #f5c518;
  text-decoration: none;
  transition: color 0.3s ease;
}

.project-description a:hover,
.tinymce-content a:hover {
  color: #fff;
}

.project-description blockquote,
.tinymce-content blockquote {
  border-left: 3px solid #f5c518;
  padding-left: 1.5em;
  margin: 1.5em 0;
  color: #bbb;
  font-style: italic;
}

.project-description table,
.tinymce-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}

.project-description table th,
.project-description table td,
.tinymce-content table th,
.tinymce-content table td {
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.8em;
  text-align: left;
}

.project-description table th,
.tinymce-content table th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 500;
  color: #fff;
}

.project-description img,
.tinymce-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5em 0;
  border-radius: 4px;
}

.project-text::-webkit-scrollbar {
  width: 8px;
}

.project-text::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.project-text::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.project-text::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
}

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2001;
}

.lightbox-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2002;
}

.lightbox-slides {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  position: absolute;
  top: 0;
  left: 0;
}

.lightbox-slide {
  min-width: 100%;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  flex-shrink: 0;
}

.lightbox-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 30px;
  font-size: 3rem;
  font-weight: 300;
  color: #fff;
  cursor: pointer;
  user-select: none;
  z-index: 9999;
  transition: color 0.3s ease;
  line-height: 1;
  background: rgba(0, 0, 0, 0.5);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.lightbox-close:hover {
  color: #f5c518;
  background: rgba(0, 0, 0, 0.7);
}

.lightbox-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2050;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.lightbox-btn:hover {
  opacity: 1;
}

.lightbox-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  border-top: 3px solid #fff;
  border-right: 3px solid #fff;
  transform-origin: center;
}

.lightbox-prev::before {
  transform: translate(-50%, -50%) rotate(-135deg);
}

.lightbox-next::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.lightbox-prev { left: 30px; }
.lightbox-next { right: 30px; }

/* Responsive */
@media (max-width: 1440px) {
  .project-title {
    font-size: 4rem;
  }
  .project-short-desc {
    font-size: 1.3rem;
  }
}

@media (max-width: 1280px) {
  .project-title {
    font-size: 3.2rem;
  }
  .project-short-desc {
    font-size: 1.2rem;
  }
}

/* Tablette portrait */
@media (min-width: 769px) and (max-width: 1366px) and (orientation: portrait) {
  .navbar { height: 60px; padding: 0 25px; }
  .nav-left { font-size: 1.2rem; margin-left: -10px; }

  html, body {
    overflow-y: auto;
    height: auto;
  }

  .project-container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    margin-top: 60px;
  }

  .project-carousel {
    width: 100%;
    height: 65vh;
    flex-shrink: 0;
    margin-top: -60px;
    padding-top: 60px;
  }

  .carousel__btn {
    opacity: 0.6;
  }

  .project-text {
    width: 100%;
    min-height: auto;
    padding: 30px 40px;
    overflow-y: visible;
  }

  .project-title {
    font-size: 3rem;
  }

  .project-short-desc {
    font-size: 1.2rem;
    margin-bottom: 2em;
  }

  .project-description {
    font-size: 1rem;
  }

  .project-text::after {
    content: '';
    display: block;
    height: 60px;
    flex-shrink: 0;
  }
}

/* Tablette landscape */
@media (min-width: 769px) and (max-width: 1366px) and (orientation: landscape) {
  .navbar { height: 60px; padding: 0 25px; }
  .nav-left { font-size: 1.2rem; margin-left: -10px; }

  html, body {
    overflow: hidden;
    height: 100%;
  }

  .project-container {
    flex-direction: row;
    height: calc(100vh - 60px);
    margin-top: 60px;
  }

  .project-carousel {
    width: 66.6666%;
    height: 100%;
    flex-shrink: 0;
  }

  .carousel-slide img {
    object-fit: contain;
  }

  .carousel__btn {
    opacity: 0.6;
  }

  .project-text {
    width: 33.3333%;
    height: 100%;
    padding: 30px 25px 0 25px;
    margin-top: 2rem;
    overflow-y: auto;
  }

  .project-title {
    font-size: 3rem;
  }

  .project-short-desc {
    font-size: 1.4rem;
    margin-bottom: 1.5em;
  }

  .project-description {
    font-size: 0.85rem;
  }

  .project-text::after {
    content: '';
    display: block;
    height: 200px;
    flex-shrink: 0;
  }
}

/* Mobile landscape */
@media (max-width: 768px) and (orientation: landscape) {
  .navbar { height: 60px; padding: 0 25px; }
  .nav-left { font-size: 1.2rem; margin-left: -10px; }

  html, body {
    overflow-y: auto;
    height: auto;
  }

  .project-container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    margin-top: 60px;
  }

  .project-carousel {
    width: 100%;
    height: 60vh;
    flex-shrink: 0;
    margin-top: -60px;
    padding-top: 60px;
  }

  .carousel__btn {
    display: none;
  }

  .project-text {
    width: 100%;
    min-height: auto;
    padding: 20px 15px;
    overflow-y: visible;
  }

  .project-title {
    font-size: 1.5rem;
    font-weight: 500 !important;
    margin-bottom: 0.6em;
  }

  .project-short-desc {
    font-size: 1rem;
    margin-bottom: 1.5em;
  }

  .metadata-label {
    font-size: 0.85rem;
    min-width: 90px;
  }

  .metadata-value {
    font-size: 0.9rem;
  }

  .project-description {
    font-size: 0.9rem;
  }

  .carousel__indicator {
    width: 5px;
    height: 5px;
  }

  .project-text::after {
    content: '';
    display: block;
    height: 60px;
    flex-shrink: 0;
  }
}

/* Mobile portrait */
@media (max-width: 768px) and (orientation: portrait) {
  .navbar { height: 60px; padding: 0 25px; }
  .nav-left { font-size: 1.2rem; margin-left: -10px; }

  html, body {
    overflow-y: auto;
    height: auto;
  }

  .project-container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    margin-top: 60px;
  }

  .project-carousel {
    width: 100%;
    height: 50vh;
    flex-shrink: 0;
    margin-top: -60px;
    padding-top: 60px;
  }

  .carousel__btn {
    display: none;
  }

  .carousel-slide img {
    object-fit: contain;
    background: #000;
  }

  .project-text {
    width: 100%;
    min-height: auto;
    padding: 12px 15px;
    overflow-y: visible;
  }

  .project-metadata-line {
    margin-top: 0.8rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
  }

  .project-title {
    font-size: 2.5rem;
    font-weight: 500 !important;
    margin-bottom: 0.5rem;
  }

  .project-short-desc {
    font-size: 1rem;
    margin-bottom: 2em;
  }

  .project-description {
    font-size: 0.95rem;
  }

  .project-text::after {
    content: '';
    display: block;
    height: 80px;
    flex-shrink: 0;
  }

  .carousel__indicator {
    width: 5px;
    height: 5px;
  }

  .carousel__indicator.active {
    transform: scale(1.5);
  }
  .lightbox-slide {
    padding: 5px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    font-size: 2rem;
    width: 40px;
    height: 40px;
  }
  
  .lightbox-btn {
    width: 50px;
    height: 50px;
  }
  
  .lightbox-btn::before {
    width: 20px;
    height: 20px;
    border-width: 2px;
  }
  
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
}