:root {
  --primary-color: #e42f2c;
  --secondary-color: #2c3e5f;
  --dark-blue: #1a1f3a;
  --light-gray: #d8d7d7;
  --white: #ffffff;
  --text-color: #333333;
}

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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-color);
  line-height: 1.6;
}

.header-e {
  background-color: var(--light-gray);
}

/* Espaciado para header fijo */
.content-wrapper {
  padding-top: 80px;
}

.hero {
  background-color: #f5f4f2;
  min-height: 200px;
}

/* Hero Section - franja gris pequeña */
.hero-project {
  background: var(--light-gray);
  padding: 60px 0 40px;
  position: relative;
}

.hero-title {
  color: var(--text-color);
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

/* Imagen grande sobrepuesta */
.hero-image-container {
  max-width: 1200px;
  margin: auto auto;
  padding: 0 20px;
  position: relative;
  z-index: 10;
}

.hero-image-wrapper {
  width: 100%;
  height: 400px;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  filter: brightness(0.7);
}

.hero-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-image-wrapper-move-bottom {
  object-position: center -100px;
}

.img-fit {
  object-position: center -150px;
}

/* Overlay del título */
.hero-title-overlay {
  position: absolute;
  bottom: 5%;
  left: 5%;
  text-align: center;
  padding: 20px 20px;
  border-radius: 6px;
}

.hero-title-overlay h1 {
  margin: 0;
  color: #fff;
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.8),
    0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Breadcrumb */
.breadcrumb-section {
  background: white;
  padding: 20px 0;
  margin-top: 40px;
}

.breadcrumb {
  margin: 0;
  background: transparent;
  padding: 0;
}

.breadcrumb-item {
  font-size: 0.9rem;
}

.breadcrumb-item a {
  color: #666;
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
  color: var(--primary-color);
}

.breadcrumb-item.active {
  color: var(--text-color);
  font-weight: 600;
}

/* Container principal */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  margin-bottom: 120px; /* Mayor espacio después de la sección historia */
}

/* Sección La Historia */
.historia-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.historia-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.historia-content h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 30px;
  margin-top: 80px;
  color: var(--text-color);
}

.historia-content p {
  margin-bottom: 20px;
  line-height: 1.8;
  color: #555;
  text-align: justify;
}

.historia-image {
  position: static;
  margin-top: 80px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.historia-image img {
  width: 70%;
  height: auto;
  border-radius: 8px;
}

/* Sección El Resultado */
.resultado-section {
  background: var(--light-gray);
  margin: 0 -100vw 0; /* Sin margen inferior */
  padding: 80px 0;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.resultado-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.resultado-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 60px;
  align-items: start;
}

.resultado-content h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 30px;
  color: var(--text-color);
}

.resultado-list {
  list-style: none;
  padding: 0;
  margin-bottom: 30px;
}

.resultado-list li {
  padding: 12px 0;
  padding-left: 30px;
  position: relative;
  color: #555;
  line-height: 1.6;
}

.resultado-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20px;
  width: 8px;
  height: 8px;
  background: var(--primary-color);
  border-radius: 50%;
}

.resultado-text {
  margin-top: 20px;
  padding: 20px;
  background: white;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
  font-style: italic;
  color: #666;
  text-align: justify;
}

/* Galería de imágenes - diseño personalizado */
.resultado-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 180px);
  gap: 15px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

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

.gallery-item-move-bottom {
  object-position: top !important;
}

/* Layout específico para cada imagen */
.gallery-item:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.gallery-item:nth-child(2) {
  grid-column: 2;
  grid-row: 1 / 3;
}

.gallery-item:nth-child(3) {
  grid-column: 3;
  grid-row: 1;
}

.gallery-item:nth-child(4) {
  grid-column: 1;
  grid-row: 2;
}

.gallery-item:nth-child(5) {
  grid-column: 3;
  grid-row: 2;
}

.gallery-item:nth-child(6) {
  grid-column: 1 / 3;
  grid-row: 3;
}

.gallery-item:nth-child(7) {
  grid-column: 3;
  grid-row: 3;
}

/* Modal para galería */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  max-width: 90%;
  max-height: 90vh;
  position: relative;
}

.modal-content img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 10px;
}

/* Animaciones de scroll */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 992px) {
  .hero-title {
    font-size: 1.8rem;
  }

  .hero-image-wrapper {
    height: 350px;
  }

  .main-container {
    margin-bottom: 80px;
  }

  .resultado-section {
    padding-bottom: 80px;
  }

  .historia-section,
  .resultado-wrapper {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .historia-image {
    position: static;
    margin-top: 40px;
  }

  .historia-image img {
    width: 60%;
  }

  .historia-content h2 {
    margin-top: 40px;
  }

  .resultado-gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 160px);
  }

  .gallery-item:nth-child(2) {
    grid-row: 1 / 3;
  }

  .gallery-item:nth-child(6) {
    grid-column: 1 / 3;
  }
}

@media (max-width: 768px) {
  .hero-project {
    padding: 40px 0 30px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-image-wrapper {
    height: 300px;
  }

  .hero-image-wrapper img {
    object-position: center 0px;
  }

  .hero-image-caption {
    bottom: 10px;
    right: 20px;
    font-size: 0.8rem;
    padding: 8px 15px;
  }

  .hero-title-overlay h1 {
    font-size: 1.8rem;
  }

  .hero-title-overlay {
    padding: 14px 24px;
  }

  .breadcrumb-section {
    padding: 15px 0;
  }

  .breadcrumb-item {
    font-size: 0.8rem;
  }

  .main-container {
    margin-bottom: 60px;
  }

  .resultado-section {
    padding: 60px 20px;
    padding-bottom: 60px;
  }

  .resultado-wrapper {
    gap: 50px;
  }

  .resultado-gallery {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 12px;
  }

  .gallery-item {
    height: 220px;
  }

  .gallery-item:nth-child(2),
  .gallery-item:nth-child(6) {
    grid-column: span 1;
    grid-row: auto;
  }
}

@media (max-width: 576px) {
  .hero-image-wrapper {
    height: 250px;
  }

  .hero-title-overlay h1 {
    font-size: 1.5rem;
  }

  .historia-content h2,
  .resultado-content h2 {
    font-size: 1.5rem;
    margin-top: 30px;
  }

  .historia-image {
    margin-top: 30px;
  }

  .historia-image img {
    width: 85%;
  }

  .historia-content p {
    font-size: 0.95rem;
  }

  .main-container {
    margin-bottom: 50px;
  }

  .resultado-section {
    margin-bottom: 50px;
    padding-bottom: 50px;
  }

  .resultado-list li {
    font-size: 0.95rem;
    padding: 10px 0;
    padding-left: 25px;
  }

  .resultado-text {
    font-size: 0.9rem;
    padding: 15px;
  }

  .gallery-item {
    height: 200px;
  }
}

.gallery-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
}

.reposition-video {
  object-position: center 42%;
  transform: rotate(-4deg) translate(-4px, -5px) scale(1.3);
  width: 100%;
}
