@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;1,400;1,600&display=swap');

/* CSS Variables */
:root {
  --color-background: #F3F3F3;
  --color-foreground: #131414;
  --color-accent: #ff00ff;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  --font-serif: 'Crimson Text', serif;
  --font-size-main: 125px;
  --line-height-main: 100px;
  --padding-main: 15px;
  --breakpoint-mobile: 930px;
}

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

html {
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-foreground);
  background-color: var(--color-background);
  overflow-x: hidden;
}

/* Cursor normal para móvil */
@media (hover: none), (pointer: coarse), (max-width: 930px) {
  * {
    cursor: auto !important;
  }
}

/* Landing Page */
.landing-page {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  background-color: #EEFFF5;
  padding-top: var(--padding-main);
  padding-left: var(--padding-main);
}

.landing-content {
  width: 100%;
}

#main-title {
  font-size: var(--font-size-main);
  font-weight: 400;
  line-height: var(--line-height-main);
  letter-spacing: -0.01em;
  color: var(--color-foreground);
  margin-bottom: 0;
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  transition: all 0.2s ease;
  padding: 0;
}

#about-btn {
  font-size: var(--font-size-main);
  font-weight: 400;
  line-height: var(--line-height-main);
  color: var(--color-foreground);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  margin-bottom: 2px;
}

#main-nav {
  margin-top: 0;
}

#main-nav ul {
  list-style: none;
}

#main-nav li {
  margin-bottom: 2px;
}

.nav-link {
  font-size: var(--font-size-main);
  font-weight: 400;
  line-height: var(--line-height-main);
  color: var(--color-foreground);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

/* Modales */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
}

/* Project Modal */
.project-modal .project-panel {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--color-background);
  z-index: 50;
}

.modal-buttons {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 10;
}

.btn-circle {
  width: 20px;
  height: 20px;
  background-color: var(--color-foreground);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-square {
  width: 18px;
  height: 18px;
  background-color: var(--color-foreground);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-square-mobile {
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-square-mobile::after {
  content: '';
  width: 18px;
  height: 18px;
  background-color: var(--color-foreground);
  transition: all 0.2s ease;
}

.btn-square-mobile:active::after {
  background-color: var(--color-accent);
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  background: none;
  border: none;
  cursor: pointer;
}

/* Project Content */
.project-content {
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Desktop: Preview Section */
.desktop-preview-section {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px;
  position: relative;
}

/* Mobile: Layout con scroll fluido */
.mobile-preview-section {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  flex-shrink: 0;
}

.mobile-project-section {
  min-height: 100vh;
  padding: 24px;
  flex-shrink: 0;
}

.carousel {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 75%;
  max-height: 75%;
}

.mobile-carousel {
  max-width: 85%;
  max-height: 85%;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: none;
}

.carousel-slide.active {
  opacity: 1;
}

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

@media (max-width: 930px) {
  .carousel-slide {
    cursor: default !important;
  }
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-family: var(--font-main);
  font-size: 18px;
  color: var(--color-foreground);
  cursor: pointer;
  padding: 8px;
  transition: all 0.2s ease;
  z-index: 10;
}

.nav-btn-left {
  left: 32px;
}

.nav-btn-right {
  right: 32px;
}

/* Project Info */
.project-info {
  margin-bottom: 24px;
}

.category {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-foreground);
  text-decoration: underline;
  margin-bottom: 8px;
}

.description {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-foreground);
  white-space: pre-line;
  margin-bottom: 16px;
}

.read-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 50px;
  background-color: var(--color-foreground);
  color: var(--color-background);
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 400;
  border: none;
  min-width: 60px;
  height: 32px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(19, 20, 20, 0.1);
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.gallery-item {
  position: relative;
  cursor: pointer;
  aspect-ratio: 2/3;
}

.gallery-item.horizontal {
  grid-column: span 2;
  aspect-ratio: 3/2;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Desktop Project View */
.project-view .view-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 50%;
  height: 100vh;
  background-color: var(--color-background);
  display: flex;
  flex-direction: column;
  z-index: 50;
}

.view-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* About View */
.about-view .about-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--color-background);
  display: flex;
  flex-direction: column;
  z-index: 50;
}

.about-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.about-layout {
  display: flex;
  gap: 24px;
  height: 100%;
}

.contact-column {
  width: 20%;
  flex-shrink: 0;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-links a {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  color: var(--color-foreground);
  line-height: 1.2;
}

.text-column {
  flex: 1;
  min-width: 0;
}

.text-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.spanish-text p,
.english-text p {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-foreground);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-background);
  display: none;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
}

.lightbox-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close::after {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  background-color: var(--color-foreground);
}

.lightbox-nav {
  font-size: 24px;
}

.lightbox-nav.nav-btn-left {
  left: 32px;
}

.lightbox-nav.nav-btn-right {
  right: 32px;
}

#slideshow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent; /* ✅ Cambiado a transparente */
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* Permite clicks a través del slideshow */
}

#slideshow .slideshow-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#slideshow-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    pointer-events: auto; /* La imagen sí puede recibir clicks */
}

/* Opcional: añadir un efecto sutil a la imagen */
#slideshow-image {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 930px) {
  :root {
    --font-size-main: 32px;
    --line-height-main: 28px;
  }
  
  .project-modal .project-panel,
  .project-view .view-panel,
  .about-view .about-panel {
    width: 100%;
  }
  
  .desktop-preview-section {
    padding: 16px;
  }
  
  .carousel {
    max-width: 85%;
    max-height: 85%;
  }
  
  .nav-btn-left {
    left: 16px;
  }
  
  .nav-btn-right {
    right: 16px;
  }
  
  .lightbox-content {
    padding: 16px;
  }
  
  .lightbox-nav.nav-btn-left {
    left: 16px;
  }
  
  .lightbox-nav.nav-btn-right {
    right: 16px;
  }

  .lightbox-close {
    width: 30px !important;
    height: 30px !important;
  }

  .lightbox-close::after {
    width: 18px;
    height: 18px;
    background-color: var(--color-foreground);
    transition: all 0.2s ease;
  }

  .lightbox-close:active::after {
    background-color: var(--color-accent);
  }
  
  .about-layout {
    flex-direction: column;
  }
  
  .contact-column {
    width: 100%;
  }

  #slideshow-image {
    max-height: 75vh;
    max-width: 85vw;
  }
  
  /* Efectos táctiles para móvil */
  .btn-circle:active,
  .btn-square:active {
    background-color: var(--color-accent) !important;
    opacity: 0.8;
  }
  
  .nav-btn:active {
    color: var (--color-accent) !important;
  }
  
  .read-button:active {
    background-color: var(--color-accent) !important;
  }
}

@media (max-width: 768px) and (min-width: 481px) {
  :root {
    --font-size-main: 48px;
    --line-height-main: 42px;
  }
}

@media (min-width: 931px) {
  .project-modal .project-panel {
    width: 50%;
  }
  
  .project-view .view-panel,
  .about-view .about-panel {
    width: 50%;
  }
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f8f8f8;
}

::-webkit-scrollbar-thumb {
  background: #e0e0e0;
  border-radius: 4px;
}

/* Estados de carga */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Animaciones suaves */
.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* Triángulo indicador de scroll para móvil */
.scroll-indicator {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    pointer-events: none;
}

.scroll-indicator .triangle {
    width: 24px;
    height: 24px;
    background-color: var(--color-foreground); /* Negro */
    clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
}

/* Ocultar en desktop */
@media (min-width: 931px) {
    .scroll-indicator {
        display: none !important;
    }
}

/* Ocultar cuando se hace scroll */
.scroll-indicator.hidden {
    display: none;
}
