/* Gallery Specific Styles */

.gallery-section {
  padding: 5rem 5%;
}

.section-intro {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 2rem;
  font-size: 1.1rem;
  color: #666;
}

/* Filter buttons */
.filter-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.filter-button {
  padding: 0.8rem 1.5rem;
  background-color: #fff;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.filter-button:hover {
  background-color: #f0f0f0;
  transform: translateY(-2px);
}

.filter-button.active {
  background-color: var(--primary-color);
  color: white;
}

/* Gallery layout */
.gallery-grid {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.gallery-group {
  background-color: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
}

@keyframes fade-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-header {
  padding: 2rem 2rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
}

.gallery-header h3 {
  color: var(--primary-dark);
  font-size: 1.8rem;
  margin-bottom: 0;
}

.gallery-date-g {
  background-color: var(--primary-light);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary-dark);
}

.gallery-description {
  padding: 1.5rem 2rem;
  line-height: 1.7;
}

.gallery-images {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
  padding: 0 2rem 2rem;
}

@media (min-width: 768px) {
  .gallery-images {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .gallery-images {
    grid-template-columns: repeat(3, 1fr);
  }
}

.gallery-item {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  height: 250px;
  cursor: pointer;
  transition: var(--transition);
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  padding: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.gallery-item:hover .overlay {
  transform: translateY(0);
}

.overlay-content h4 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.overlay-content p {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Call to action */
/* Responsive adjustments */
@media (max-width: 768px) {
  .gallery-hero .hero-content h2 {
    font-size: 2.5rem;
  }

  .gallery-hero .hero-content p {
    font-size: 1.2rem;
  }

  .gallery-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .gallery-header h3 {
    font-size: 1.5rem;
  }
}

/* Active menu item */
nav ul li a.active {
  color: var(--primary-color);
  background-color: rgba(165, 214, 167, 0.2);
}

.back-btn {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Estilo para el enlace "Volver a la galería" */
.section-header a[href="../galeria.html"] {
  margin-top: 2rem !important;
  display: inline-block;
}

.photo-gallery {
  padding: 7rem 5% 5rem;
  background-color: var(--background-light);
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.photo-item {
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  height: 0;
  padding-bottom: 66.67%; /* 3:2 aspect ratio */
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.photo-item:hover {
  transform: scale(1.02);
}

.photo-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.photo-item:hover img {
  transform: scale(1.1);
}

.photo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photo-item:hover .photo-overlay {
  opacity: 1;
}

.photo-overlay i {
  color: white;
  font-size: 2rem;
  background-color: rgba(0, 0, 0, 0.5);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Lightbox styles */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1010;
  justify-content: center;
  align-items: center;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.close-lightbox {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

#lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  display: block;
  margin: 0 auto;
}

.lightbox-controls {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
}

.lightbox-nav {
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  transition: background-color 0.3s ease;
}

.lightbox-nav:hover {
  background-color: rgba(76, 175, 80, 0.7);
}

.prev {
  margin-left: -25px;
}

.next {
  margin-right: -25px;
}

@media (max-width: 768px) {
  .route-gallery-hero {
    height: auto;
    padding-top: 100px;
  }

  .route-gallery-info {
    margin-bottom: -2rem;
  }

  .route-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
  }
}

/* ULTIMOS ESTILOS DE LA GALERIA */
.gallery-hero {
  height: 60vh;
  background:
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url("images/principal.jpg");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-light);
}

/* ========== GALERÍA MENÚ – diseño moderno ========== */
.gallery-section {
  padding: 5rem 5%;
  margin-top: 3rem;
  background: transparent;
}

.gal-header-wrap {
  max-width: 900px;
  margin: 0 auto 3rem;
}

.gallery-section .section-header {
  margin-bottom: 1.5rem;
}

.gal-tagline {
  font-size: 1.1rem;
  color: #5a6b5c;
  margin-top: -0.5rem;
  margin-bottom: 2rem;
}

.search-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box input {
  width: 100%;
  padding: 14px 48px 14px 20px;
  border: 3px solid rgba(76, 175, 80, 0.5);
  border-radius: 50px;
  font-size: 1rem;
  font-family: "Montserrat", sans-serif;
  background: white;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.search-box input::placeholder {
  color: #999;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-color);
  border-width: 3px;
  box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.2);
}

.search-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-color);
  font-size: 1.1rem;
}

.gallery-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 1280px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .gallery-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .gallery-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

.gallery-card {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 6px 22px rgba(0, 0, 0, 0.14),
    0 -4px 16px rgba(0, 0, 0, 0.1),
    6px 0 22px rgba(0, 0, 0, 0.11),
    -6px 0 22px rgba(0, 0, 0, 0.11);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

.gallery-card:hover {
  transform: translateY(-8px);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.18),
    0 -8px 24px rgba(0, 0, 0, 0.12),
    12px 0 32px rgba(0, 0, 0, 0.14),
    -12px 0 32px rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(76, 175, 80, 0.25);
}

.gallery-img {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.gallery-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-img img {
  transform: scale(1.06);
}

.gallery-date {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  color: white;
  padding: 0.5rem 0.85rem;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.gallery-date .date {
  font-size: 1.5rem;
}

.gallery-date .month {
  font-size: 0.85rem;
}

.gallery-date span:nth-child(3) {
  font-size: 0.8rem;
  opacity: 0.95;
}

.gallery-info {
  flex: 1;
  padding: 1.5rem 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
}

.gallery-info h3 {
  font-family: "Montserrat", sans-serif;
  color: #2e7d32;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.gallery-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
  color: #666;
  font-size: 0.9rem;
}

.gallery-meta span {
  display: flex;
  align-items: center;
}

.gallery-meta i {
  color: var(--primary-color);
  margin-right: 0.35rem;
}

.gallery-info p {
  margin-bottom: 1.25rem;
  line-height: 1.55;
  flex-grow: 1;
  font-size: 0.95rem;
  color: #555;
}

.btn-gallery {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
  color: white;
  padding: 12px 22px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.35);
  position: relative;
  overflow: hidden;
}

.btn-gallery::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.25),
    transparent
  );
  transition: left 0.5s ease;
}

.btn-gallery:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(76, 175, 80, 0.45);
}

.btn-gallery:hover::before {
  left: 100%;
}

.btn-gallery i {
  font-size: 1rem;
}

@media (max-width: 639px) {
  .gallery-info h3 {
    font-size: 1.15rem;
  }
}

/* CTA galería */
.gallery-cta {
  margin-top: 3rem !important;
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(
    135deg,
    rgba(76, 175, 80, 0.08) 0%,
    rgba(46, 125, 50, 0.12) 100%
  );
  border-radius: 24px;
  max-width: calc(640px + 6em);
  margin-left: auto;
  margin-right: auto;
}

.gal-cta-title {
  font-family: "Montserrat", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #2e7d32;
  margin-bottom: 1.25rem;
}

/* Aplicar fuente Montserrat a todos los h3 dentro de gallery-cta */
.gallery-cta h3 {
  font-family: "Montserrat", sans-serif !important;
}

.gallery-cta .gal-cta-btn,
.gal-cta-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  ) !important;
  font-size: 0.95rem !important;
  color: white !important;
  font-weight: 600;
  padding: 14px 28px !important;
  text-decoration: none;
  border-radius: 50px !important;
  width: fit-content;
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.35) !important;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  position: relative;
  overflow: hidden;
  border: none !important;
}

.gallery-cta .gal-cta-btn::before,
.gal-cta-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.6s ease;
}

.gallery-cta .gal-cta-btn:hover,
.gal-cta-btn:hover {
  transform: translateY(-4px) scale(1.05) !important;
  box-shadow: 0 10px 30px rgba(76, 175, 80, 0.45) !important;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  ) !important;
}

.gallery-cta .gal-cta-btn:hover::before,
.gal-cta-btn:hover::before {
  left: 100%;
}

.gallery-cta .gal-cta-btn i,
.gal-cta-btn i {
  transition: transform 0.4s ease;
  font-size: 0.9rem;
}

.gallery-cta .gal-cta-btn:hover i,
.gal-cta-btn:hover i {
  transform: translateX(5px);
}
