/* ==========================================================================
  galeria.css
  Estils per a la pàgina de galeria
  ========================================================================== */

/* --- Variables i estils globals (Reutilització) --- */
:root {
  --color-gold: #b79a54;
  --color-black: #111;
  --color-white: #fff;
  --nav-h: 76px;
}

section {
  min-height: calc(100svh - var(--nav-h));
  display: grid;
  align-items: center;
}

/* --- Títols personalitzats --- */
.text-gold {
  color: var(--color-gold) !important;
}


/* --- Títols amb línia daurada (reutilització de styles) --- */
.gradient-title,
.gradient-title-alt {
  position: relative;
  display: inline-block;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.gradient-title::after,
.gradient-title-alt::after {
  content: "";
  display: block;
  width: clamp(50%, 32%, 200px);
  height: 4px;
  margin-top: 0.45rem;
  border-radius: 9999px;
  background: linear-gradient(
    90deg,
    var(--color-gold) 0%,
    rgba(183, 154, 84, 0.15) 80%,
    transparent 100%
  );
  box-shadow: 0 6px 20px rgba(183, 154, 84, 0.28);
  margin-right: auto;
}

/* Modificador d'alineació per al títol */
.gradient-title--center::after,
.gradient-title-alt--center::after {
  margin-left: auto;
  margin-right: auto;
}

.gradient-title-alt--end::after {
  margin-left: auto;
  margin-right: 0;
}


/* --- Animacions Fade-in amb Scroll (Reutilització) --- */
.fade-section {
  opacity: 0;
  transform: translateY(12px);
  will-change: opacity, transform;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* ==========================================================================
  Seccions específiques de la galeria
  ========================================================================== */
  /* --- Estil de Text de Títol Compartit --- */
.galeria-section h2,
.galeria-section-2 h2,
.galeria-section-3 h2,
.galeria-section-4 h2,
.galeria-section-5 h2,
.galeria-section-6 h2,
.galeria-section-7 h2,
.galeria-section-8 h2,
.sec-cta h2 {
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: clamp(1.5rem, 5vw, 4rem);
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(183, 154, 84, 0.45);
}


/* ==========================================================================
  Hero reutilitzable per a totes les pàgines
  ========================================================================== */

.hero {
  min-height: calc(100vh );
  display: grid;
  align-items: center;
  position: relative;
  overflow: hidden;
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.75) 100%
  );
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 2;
}

/* Desactiva l'efecte parallax en dispositius mòbils per millorar el rendiment */
@media (max-width: 991.98px) {
  .hero {
    background-attachment: scroll !important;
  }
}

/* Estil del glass-box ja definit a quisom.css, el reutilitzem */
.glass-box {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
  border-radius: 12px;
}

/* Títol */
.hero h1 {
  background-image: linear-gradient(to right, var(--color-gold), #fff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
}

/* --- Seccions de galeria --- */
.galeria-section {
  position: relative;
  overflow: hidden;
  background-color: transparent !important; /* Aquest canvi és crucial! */
  z-index: 1; /* Assegura que el contingut de la secció (imatges) es vegi per damunt */
}


.galeria-section-2 .display-3,
.galeria-section-3 .display-3,
.galeria-section-4 .display-3,
.galeria-section-5 .display-3,
.galeria-section-6 .display-3,
.galeria-section-7 .display-3,
.galeria-section-8 .display-3 {
  letter-spacing: 0.08em;
  text-shadow: 0 0 10px rgba(183, 154, 84, 0.4);
}

/* --- Estil del quadre d'imatge i efectes --- */
.galeria-img-box {
  position: relative;
  overflow: hidden;
  padding-bottom: 66.66%; /* Proporció 3:2 per a les imatges */
  cursor: pointer;
  transform: scale(1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.galeria-img-box:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15) !important;
}

.galeria-img-box img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s ease;
}

.galeria-img-box:hover img {
  filter: brightness(1.1) contrast(1.1);
}

/* --- Modal/Lightbox personalitzat --- */
#lightboxModal .modal-content {
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.lightbox-img-box {
  max-width: 90vw;
  max-height: 80vh;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  cursor: pointer;
}


/* --- SEC-CTA: crida a l'acció (reutilització) --- */
/* ==========================================================================
  Secció de contacte (CTA)
  ========================================================================== */
.sec-cta {
  align-items: center;
  position: relative;
  overflow: hidden;
  text-align: center;
  padding-block: 2.5rem;
  background-image: var(--cta-img);
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

.sec-cta .overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.sec-cta .container {
  position: relative;
  z-index: 2;
}

.sec-cta h2 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  text-transform: uppercase;
}

.sec-cta p {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  max-width: 650px;
  margin-inline: auto;
}


/* Ajusta el botó de tancar per a mòbils */
@media (max-width: 576px) {
  .lightbox-close {
    top: 5px;
    right: 5px;
    font-size: 1.2rem;
  }
}

/* ==========================================================================
  Reducció de moviment per a usuaris amb preferències
  ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .fade-section,
  .galeria-img-box {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
  }
}

