/* PORTAL WEB AC LOCAL v0.3.6 — ajustos fins d'impacte visual */
:root {
  --fixup-shadow-3d: 0 24px 54px rgba(5, 42, 76, 0.22);
  --fixup-shadow-3d-strong: 0 32px 72px rgba(5, 42, 76, 0.28);
}

/* HERO: cobreix millor el vídeo i evita franges visibles */
.hero {
  min-height: min(820px, 100svh);
}

.hero-media {
  inset: -9% -2%;
  overflow: hidden;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.16);
  will-change: transform;
}

.hero-inner {
  min-height: calc(min(820px, 100svh) - var(--header-h));
}

.hero-copy {
  width: min(960px, 88%);
}

.hero h1 {
  max-width: 980px;
  line-height: 1.01;
  padding-bottom: 0.1em;
  overflow: visible;
}

.hero-line,
.hero-word {
  overflow: visible;
}

.hero-word {
  color: #ffffff !important;
  background: none !important;
  -webkit-text-fill-color: currentColor;
  text-shadow:
    0 1px 0 rgba(255,255,255,0.12),
    0 2px 0 rgba(4, 27, 48, 0.16),
    0 6px 18px rgba(4, 27, 48, 0.24);
}

.hero-scroll-cue {
  min-height: 58px;
  gap: 12px;
  padding: 12px 18px 12px 22px;
}

.hero-scroll-cue span {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.hero-scroll-cue b {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  font-size: 1.08rem;
  line-height: 1;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
}

/* CARRUSEL: vores difuminades i previews amb sensació 3D */
.media-carousel {
  position: relative;
}

.media-carousel::before,
.media-carousel::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(44px, 6vw, 92px);
  z-index: 8;
  pointer-events: none;
}

.media-carousel::before {
  left: 44px;
  background: linear-gradient(90deg, #f7fafc 0%, rgba(247, 250, 252, 0.88) 28%, rgba(247, 250, 252, 0) 100%);
}

.media-carousel::after {
  right: 44px;
  background: linear-gradient(270deg, #f7fafc 0%, rgba(247, 250, 252, 0.88) 28%, rgba(247, 250, 252, 0) 100%);
}

.media-viewport {
  overflow: hidden;
}

.media-card,
.media-card.is-current {
  transform: translateY(6px) scale(0.95) rotateX(3deg);
  opacity: 0.84;
  box-shadow:
    0 22px 42px rgba(5, 42, 76, 0.18),
    0 8px 16px rgba(5, 42, 76, 0.10);
}

.media-card:hover,
.media-card:focus-visible,
.media-card:focus-within {
  transform: translateY(-4px) scale(1.09) rotateX(0deg);
  box-shadow: var(--fixup-shadow-3d-strong);
}

.media-card .media-preview,
.media-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: saturate(0.96) contrast(1.04);
  transition: transform 0.6s ease, filter 0.35s ease;
}

.media-card .media-preview {
  background: #0a2035;
}

.media-card:hover .media-preview,
.media-card:hover img,
.media-card:focus-within .media-preview,
.media-card:focus-within img {
  transform: scale(1.05);
}

.media-card::before {
  content: "";
  position: absolute;
  inset: auto 12% -10px 12%;
  height: 22px;
  background: radial-gradient(ellipse at center, rgba(5,42,76,0.35) 0%, rgba(5,42,76,0.12) 48%, rgba(5,42,76,0) 76%);
  filter: blur(10px);
  z-index: -1;
  pointer-events: none;
}

/* PROGRAMA: evita solapament i reforça CTA */
.program-grid {
  margin-bottom: 18px;
  align-items: stretch;
}

.program-card {
  min-height: 306px;
}

.program-card p {
  max-width: 360px;
}

.program-card .program-card-content {
  padding-bottom: 34px;
}

.center-action {
  margin-top: 36px;
  position: relative;
  z-index: 8;
}

.program-full-button {
  min-width: 262px;
  min-height: 56px;
  padding: 14px 28px;
  font-size: calc(0.9rem + var(--ac-font-increase));
  font-weight: 800;
  letter-spacing: 0.05em;
  border-radius: 12px;
  box-shadow: 0 16px 34px rgba(5, 42, 76, 0.18);
}

/* CARNET: recupera flotació i elimina el rectangle estrany del contenidor */
.member-card-stage {
  box-shadow: none !important;
  background: transparent !important;
  transform: none !important;
  overflow: visible;
}

.member-card-stage:hover {
  transform: none !important;
  box-shadow: none !important;
}

.member-card-face {
  box-shadow: none;
}

.member-card-photo {
  background: transparent;
}


/* v0.4.1 — correcció del flip del carnet 3D */
.member-card-stage {
  filter: drop-shadow(0 30px 34px rgba(5, 42, 76, 0.18)) drop-shadow(0 10px 18px rgba(5, 42, 76, 0.14));
}

.member-card {
  filter: none !important;
  isolation: isolate;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.member-card-face {
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.member-card-front {
  transform: rotateY(0deg) translateZ(1px);
}

.member-card-back {
  transform: rotateY(180deg) translateZ(1px);
}


/* DONACIONS: botó a sota i fons reactiu */
.donation-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.donation-switch {
  display: flex;
  margin: 24px 0 12px;
}

#donationButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
}

.donation-media {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), filter 0.35s ease;
  transform: translate3d(var(--donation-shift-x, 0px), var(--donation-shift-y, 0px), 0) scale(var(--donation-scale, 1));
  filter: saturate(1.02) contrast(1.02);
}

.donation:hover .donation-media {
  --donation-scale: 1.08;
}

@media (max-width: 1024px) {
  .hero { min-height: min(780px, 100svh); }
  .hero-inner { min-height: calc(min(780px, 100svh) - var(--header-h)); }
  .hero h1 { line-height: 1.02; }
  .media-carousel::before { left: 18px; }
  .media-carousel::after { right: 18px; }
}

@media (max-width: 768px) {
  .hero { min-height: min(760px, 100svh); }
  .hero-media { inset: -6% -4%; }
  .hero-video { transform: scale(1.22); }
  .hero-inner { min-height: calc(min(760px, 100svh) - var(--header-h)); padding-bottom: 94px; }
  .hero h1 { line-height: 1.03; padding-bottom: 0.12em; }
  .hero-scroll-cue {
    min-height: 52px;
    padding: 10px 16px 10px 18px;
    gap: 10px;
  }
  .hero-scroll-cue b {
    width: 24px;
    height: 24px;
    font-size: 0.98rem;
  }
  .media-carousel::before,
  .media-carousel::after {
    width: 34px;
  }
  .media-carousel::before { left: 8px; }
  .media-carousel::after { right: 8px; }
  .program-card {
    min-height: 288px;
  }
  .program-full-button {
    min-width: 238px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .donation-media,
  .hero-video,
  .media-card,
  .media-card .media-preview {
    transition: none !important;
  }
}


/* v0.4.2 — flip del carnet resolt girant les cares individualment */
.member-card {
  --card-flip-y: 0deg !important;
  --card-flip-z: 0deg !important;
  transform:
    rotateX(var(--card-tilt-x))
    rotateY(var(--card-tilt-y))
    rotateZ(var(--card-tilt-z)) !important;
}

.member-card-face {
  transition: transform 0.8s cubic-bezier(0.22, 0.75, 0.25, 1), opacity 0.45s ease;
}

.member-card-front {
  transform: rotateY(0deg) translateZ(1px) !important;
  opacity: 1;
}

.member-card-back {
  transform: rotateY(180deg) translateZ(1px) !important;
  opacity: 1;
}

.member-card.is-flipped .member-card-front {
  transform: rotateY(-180deg) translateZ(1px) !important;
}

.member-card.is-flipped .member-card-back {
  transform: rotateY(0deg) translateZ(1px) !important;
}

/* Desactivem la capa de parallax a les imatges del carnet per no interferir amb el flip. */
.member-card-photo.ac-parallax-target {
  --ac-parallax-scale: 1 !important;
  --ac-parallax-y: 0% !important;
  translate: 0 0 !important;
  scale: 1 !important;
  will-change: auto !important;
}



/* v0.4.3 — reencaix i retall de les imatges del carnet dins dels marges */
.member-card-face {
  background: #f7f6f1;
}

.member-card-photo {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 112%;
  height: 112%;
  max-width: none;
  object-fit: cover;
  object-position: center center;
  transform: translate(-50%, -50%);
}

.member-card-photo-front {
  width: 114%;
  height: 114%;
  object-position: 49% 51%;
}

.member-card-photo-back {
  width: 109%;
  height: 109%;
  object-position: 50% 49%;
}

@media (max-width: 768px) {
  .member-card-photo-front {
    width: 116%;
    height: 116%;
  }

  .member-card-photo-back {
    width: 111%;
    height: 111%;
  }
}



/* v0.4.4 — separació correcta entre la senyera del drawer i el logo */
.drawer-head {
  padding-left: 82px;
}

@media (max-width: 1024px) {
  .drawer-head {
    padding-left: 74px;
  }
}

@media (max-width: 768px) {
  .drawer-head {
    padding-left: 20px;
  }
}



/* v0.4.5 — reserva estructural real per a la senyera del drawer */
.drawer-head {
  display: grid !important;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 16px;
  padding: 20px 28px 18px 0 !important;
}

.drawer-head::before {
  content: "";
  grid-column: 1;
  width: 52px;
  height: 1px;
}

.drawer-head img {
  grid-column: 2;
  justify-self: start;
  width: min(190px, 100%);
  max-width: 100%;
}

.drawer-close {
  grid-column: 3;
  justify-self: end;
}

@media (max-width: 1024px) {
  .drawer-head {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    column-gap: 14px;
    padding: 16px 20px 16px 0 !important;
  }

  .drawer-head::before {
    width: 46px;
  }
}

@media (max-width: 768px) {
  .drawer-head {
    display: flex !important;
    padding: 15px 20px !important;
  }

  .drawer-head::before {
    content: none;
  }
}



/* v0.4.6 — correcció definitiva també en pantalles petites */
@media (max-width: 768px) {
  .drawer-head {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    padding: 14px 14px 14px 0 !important;
  }

  .drawer-head::before {
    content: "";
    grid-column: 1;
    width: 42px;
    height: 1px;
  }

  .drawer-head img {
    grid-column: 2;
    justify-self: start;
    width: min(176px, 100%);
    max-width: 100%;
  }

  .drawer-close {
    grid-column: 3;
    justify-self: end;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }
}



/* v0.4.7 — alineació definitiva: panell i senyera comparteixen exactament 36 px */
@media (min-width: 769px) {
  .drawer-panel {
    padding-left: 36px !important;
  }

  .drawer-senyera {
    left: 0 !important;
    width: 36px !important;
  }

  .drawer-head {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 28px 18px 30px !important;
  }

  .drawer-head::before {
    content: none !important;
  }

  .drawer-head img {
    width: min(190px, 65%) !important;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .drawer-panel {
    padding-left: 0 !important;
  }

  .drawer-head {
    display: flex !important;
    padding: 15px 20px !important;
  }

  .drawer-head::before {
    content: none !important;
  }
}



/* v0.4.8 — menú lateral amb Montserrat Medium */
.drawer-nav a,
.drawer-pages a,
.drawer-nav .drawer-contact-link,
.drawer-pages .drawer-contact-link {
  font-family: "Montserrat", sans-serif;
  font-weight: 500 !important;
}

/* v0.9.3 — auditoria responsive: entre 701 i 768 px la senyera encara és vertical.
   Es conserva la reserva lateral fins que el menú canvia realment al mode mòbil. */
@media (min-width: 701px) and (max-width: 768px) {
  .drawer-panel {
    padding-left: 36px !important;
  }
  .drawer-senyera {
    left: 0 !important;
    width: 36px !important;
  }
}

