/* ========================================
   WEBGL GALLERY STYLES
   ======================================== */

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

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

body {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: #f5f5f5;
  color: #242424;
  line-height: 1.6;
}

/* Canvas WebGL */
#webgl {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* App Container */
#app {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100vh;
}

#smooth-content {
  position: relative;
  z-index: 2;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header */
header {
  padding: 2rem 0;
  margin-bottom: 3rem;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
}

/* Grid Container */
.grid-container {
  width: 100%;
  margin-bottom: 4rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-auto-rows: 200px;
  gap: 1.5rem;
  position: relative;
}

/* Grid Items */
.grid__item {
  grid-row: var(--r, 1);
  grid-column: var(--c, 1) / span var(--s, 3);
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease;
  background-color: #242424;
}

.grid__item:hover {
  transform: scale(1.02);
  z-index: 10;
}

/* Grid Item Images */
.grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

/* Grid Item Text */
.grid__item p {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin: 0;
  z-index: 2;
}

/* Título Principal en Grid */
.grid__item h1 {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
  padding: 2rem;
  background-color: transparent;
  color: #242424;
  display: flex;
  align-items: center;
}

/* Párrafos de texto en Grid */
.grid__item.grid__item[style*="font-size"] {
  background-color: white;
  padding: 2rem;
  font-size: 1rem;
  line-height: 1.6;
  color: #666;
  display: flex;
  align-items: center;
  border: 1px solid #e0e0e0;
}

/* Text Animation Wrapper */
.line-wrapper {
  overflow: hidden;
  display: block;
}

/* Details Page */
.details {
  min-height: 100vh;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.details-data {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 1rem;
  color: #666;
}

.details-data a {
  color: #242424;
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.3s ease;
}

.details-data a:hover {
  opacity: 0.6;
}

.details-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.details-container img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* Related Section */
.related {
  padding: 4rem 2rem;
  background-color: white;
  border-top: 1px solid #e0e0e0;
}

.related > p {
  font-size: 0.9rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
}

.relgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.relgrid__item {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.3s ease;
}

.relgrid__item:hover {
  transform: translateY(-5px);
}

.relgrid__item-img {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.relgrid__item-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: #242424;
}

/* Responsive */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
  }

  .grid__item h1 {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 150px;
    gap: 0.75rem;
  }

  .grid__item h1 {
    font-size: 1.5rem;
    padding: 1rem;
  }

  .grid__item[style*="font-size"] {
    padding: 1rem;
    font-size: 0.9rem;
  }

  .container {
    padding: 1rem;
  }

  .details {
    padding: 1rem;
  }

  .relgrid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 120px;
  }

  .grid__item h1 {
    font-size: 1.2rem;
  }
}

/* Loading State */
body.loading {
  overflow: hidden;
}

body.loading #smooth-content {
  opacity: 0;
}