/* =============================================
   EFECTES.CSS — Rotaract Igualada
   Animacions suaus, efectes 3D i transicions entre pàgines.
   No canvia cap contingut. Tot el moviment es desactiva si el
   sistema té activat «reduir moviment».
   (La lògica és a efectes.js.)
   ============================================= */

/* Transició suau entre pàgines i en canviar d'idioma (navegadors amb
   View Transitions; la resta, simplement canvien de pàgina). */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  ::view-transition-old(root) { animation: fx-page-out .28s cubic-bezier(.4, 0, 1, 1) both; }
  ::view-transition-new(root) { animation: fx-page-in .42s cubic-bezier(0, 0, .2, 1) both; }

  /* Sense View Transitions: entrada suau de la pàgina */
  @supports not (view-transition-name: none) {
    body { animation: fx-page-in .42s cubic-bezier(0, 0, .2, 1) both; }
  }

  /* ── Botons: elevació, premut i onada al clicar ── */
  .btn, .btn-submit, .contact-card__btn, .signup-process__cta-btn,
  .instagram-section__cta, .header__cta, .mobile-nav__cta, .act-filter-btn,
  .act-hero__tab-btn, .lang-menu__btn, .lang-menu__opt, .qc-card {
    transition-property: transform, box-shadow, background-color, border-color, color, opacity;
    transition-duration: .25s;
    transition-timing-function: cubic-bezier(.2, .8, .2, 1);
  }
  .btn:active, .btn-submit:active, .contact-card__btn:active, .signup-process__cta-btn:active,
  .instagram-section__cta:active, .header__cta:active, .mobile-nav__cta:active, .act-filter-btn:active,
  .act-hero__tab-btn:active, .lang-menu__btn:active, .lang-menu__opt:active, .qc-card:active {
    transform: scale(.97);
    transition-duration: .08s;
  }

  .fx-ripple {
    position: absolute;
    border-radius: 50%;
    background: currentColor;
    opacity: .22;
    transform: scale(0);
    pointer-events: none;
    animation: fx-ripple .6s cubic-bezier(.2, .8, .2, 1) forwards;
  }

  /* ── Menú d'idioma: les opcions apareixen una rere l'altra ── */
  .lang-menu.is-open .lang-menu__opt { animation: fx-pop .28s cubic-bezier(.2, .8, .2, 1) both; }
  .lang-menu.is-open li:nth-child(2) .lang-menu__opt { animation-delay: .04s; }
  .lang-menu.is-open li:nth-child(3) .lang-menu__opt { animation-delay: .08s; }

  /* ── Preguntes freqüents: la resposta s'obre suaument ── */
  .faq-item[open] .faq-item__a { animation: fx-reveal .32s cubic-bezier(.2, .8, .2, 1) both; }

  /* ── Targetes en 3D: s'inclinen seguint el ratolí (efectes.js) ── */
  .fx-tilt {
    transform-style: preserve-3d;
    transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s cubic-bezier(.2, .8, .2, 1);
  }
  .fx-tilt.fx-tilting {
    transform: perspective(900px) rotateX(var(--fx-rx, 0deg)) rotateY(var(--fx-ry, 0deg)) translateY(-4px);
    box-shadow: 0 18px 40px rgba(47, 47, 150, .16);
    transition-duration: .12s;
  }
  .fx-glare {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--fx-mx, 50%) var(--fx-my, 50%), rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 55%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease;
    z-index: 2;
  }
  .fx-tilting > .fx-glare { opacity: 1; }
}

/* Contenidors de l'onada i de la brillantor (els posa efectes.js) */
.fx-host { overflow: hidden; }
.fx-host-pos { position: relative; }

/* ── Barra de progrés de lectura (a dalt de tot) ── */
.fx-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 3000;
  background: linear-gradient(90deg, #2f2f96, #da1a5d);
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
}

@keyframes fx-page-out { to { opacity: 0; transform: translateY(-6px) scale(.995); } }
@keyframes fx-page-in { from { opacity: 0; transform: translateY(8px) scale(.995); } }
@keyframes fx-ripple { to { transform: scale(1); opacity: 0; } }
@keyframes fx-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes fx-reveal { from { opacity: 0; transform: translateY(-6px); } }

/* =============================================
   PEU DE PÀGINA: línia de colors, llums suaus, entrada en 3D,
   icones socials en 3D i enllaços amb subratllat animat.
   ============================================= */
.footer { position: relative; overflow: hidden; isolation: isolate; }

/* Línia de colors del club i de Rotary a dalt de tot */
.footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2f2f96, #da1a5d, #f7a81b, #da1a5d, #2f2f96);
  background-size: 200% 100%;
  z-index: 1;
}

/* Llums de fons (blau i rosa) */
.footer::after {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(closest-side at 18% 28%, rgba(47, 47, 150, .5), transparent),
    radial-gradient(closest-side at 82% 72%, rgba(218, 26, 93, .28), transparent);
  opacity: .5;
}

/* Llum que segueix el ratolí (efectes.js posa --fx-fx i --fx-fy) */
.footer {
  background-image: radial-gradient(380px circle at var(--fx-fx, -999px) var(--fx-fy, -999px), rgba(255, 255, 255, .07), transparent 70%);
}

/* Marca: el nom del club amb una brillantor que hi passa per sobre */
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .footer__brand-name {
    background: linear-gradient(100deg, #fff 0%, #fff 42%, #ff9ec0 50%, #fff 58%, #fff 100%);
    background-size: 250% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

/* Títols de columna amb una barreta de color */
.footer__heading { position: relative; padding-bottom: .55rem; }
.footer__heading::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 26px; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #da1a5d, #f7a81b);
}

/* Enllaços: subratllat de color que creix */
.footer__links a,
.footer__contact-item a {
  background-image: linear-gradient(90deg, #da1a5d, #ff9ec0);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1.5px;
  padding-bottom: 2px;
  transition: color .25s ease, transform .25s ease, background-size .35s cubic-bezier(.2, .8, .2, 1);
}
.footer__links a:hover, .footer__links a:focus-visible,
.footer__contact-item a:hover, .footer__contact-item a:focus-visible {
  color: #fff;
  background-size: 100% 1.5px;
}
.footer__links a[aria-current="page"] { color: #fff; background-size: 100% 1.5px; }

/* Icones socials en 3D */
.footer__social { perspective: 500px; }
.footer__social a { transform-style: preserve-3d; }
.footer__social a svg { transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.footer__social a:hover,
.footer__social a:focus-visible {
  background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af);
  box-shadow: 0 12px 24px rgba(221, 42, 123, .4);
}

.footer__contact-item > span[aria-hidden] { display: inline-block; }

@media (prefers-reduced-motion: no-preference) {
  .footer::before { animation: fx-flow 8s linear infinite; }
  .footer::after { animation: fx-aurora 18s ease-in-out infinite alternate; }
  .footer__brand-name { animation: fx-shimmer 7s ease-in-out infinite; }

  .footer__social a {
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), background .35s ease, box-shadow .35s ease;
  }
  .footer__social a:hover,
  .footer__social a:focus-visible {
    transform: translateY(-4px) rotateX(16deg) rotateY(-16deg);
  }
  .footer__social a:hover svg,
  .footer__social a:focus-visible svg { transform: translateZ(12px) scale(1.12); }

  .footer__contact-item:hover > span[aria-hidden] { animation: fx-wiggle .5s ease; }

  /* Entrada de les columnes en 3D quan el peu apareix (efectes.js) */
  .fx-footer-ready .footer__grid > div,
  .fx-footer-ready .footer__bottom {
    opacity: 0;
    transform: perspective(900px) rotateX(16deg) translateY(28px);
    transform-origin: 50% 0;
  }
  .fx-footer-in .footer__grid > div,
  .fx-footer-in .footer__bottom { animation: fx-footer-col .8s cubic-bezier(.2, .8, .2, 1) both; }
  .fx-footer-in .footer__grid > div:nth-child(2) { animation-delay: .08s; }
  .fx-footer-in .footer__grid > div:nth-child(3) { animation-delay: .16s; }
  .fx-footer-in .footer__grid > div:nth-child(4) { animation-delay: .24s; }
  .fx-footer-in .footer__bottom { animation-delay: .36s; }
  .fx-footer-in .footer__heading::after { animation: fx-grow .6s .35s cubic-bezier(.2, .8, .2, 1) both; }
}

@keyframes fx-flow { to { background-position: 200% 0; } }
@keyframes fx-aurora {
  from { transform: translate(-4%, 3%) rotate(0deg); }
  to   { transform: translate(5%, -4%) rotate(10deg); }
}
@keyframes fx-shimmer {
  0%, 55% { background-position: 100% 0; }
  85%, 100% { background-position: -50% 0; }
}
@keyframes fx-wiggle {
  25% { transform: rotate(-12deg) scale(1.15); }
  60% { transform: rotate(8deg) scale(1.1); }
}
@keyframes fx-footer-col {
  from { opacity: 0; transform: perspective(900px) rotateX(16deg) translateY(28px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fx-grow { from { width: 0; } }

/* =============================================
   FONS CONTINU (estil Apple): un sol fons per a tota la pàgina amb
   llums suaus roses i blaves; les seccions són transparents i les
   targetes de vidre deixen veure el color de darrere.
   ============================================= */
html { background: #f7f7fb; }
body { background: transparent; }
body::before {
  content: "";
  position: fixed;
  inset: -12vmax;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38vmax 38vmax at 10% 14%, rgba(218, 26, 93, .14), transparent 70%),
    radial-gradient(44vmax 44vmax at 92% 30%, rgba(47, 47, 150, .13), transparent 70%),
    radial-gradient(36vmax 36vmax at 28% 82%, rgba(218, 26, 93, .10), transparent 70%),
    radial-gradient(40vmax 40vmax at 86% 92%, rgba(247, 168, 27, .07), transparent 70%);
}

/* Seccions sense blocs de color: es veu el fons continu */
.aboutus-section, .galeria-section, .instagram-section, .contact, .join-cta,
.nosaltres-bloc, .nosaltres-bloc--alt,
.act-section--light,
.directiu-section, .directiu-section--alt,
.quick-channels, .contact-main, .signup-process {
  background: transparent;
}

/* Capçaleres de color: targetes flotants sobre el fons continu (sense
   difuminats: el fons es veu al voltant, com al peu de pàgina) */
.hero-section, .nosaltres-hero, .act-hero, .directiu-hero, .contact-hero {
  width: auto;
  margin: 14px clamp(10px, 1.6vw, 18px) 0;
  border-radius: 32px;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 26px 60px rgba(47, 47, 150, .18);
}
@media (max-width: 600px) {
  .hero-section, .nosaltres-hero, .act-hero, .directiu-hero, .contact-hero {
    margin: 10px 10px 0;
    border-radius: 24px;
  }
}

/* Capçalera de vidre */
.header {
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  box-shadow: 0 1px 0 rgba(47, 47, 150, .07), 0 8px 24px rgba(47, 47, 150, .05);
}

/* Targetes de vidre (blanc transparent) */
.aboutus__pillar, .aboutus__stat, .ig-post, .act-card, .junta-card, .soci-card,
.contact-form, .contact-card__item, .faq-item, .signup-process__cta-col {
  background: rgba(255, 255, 255, .66);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border-color: rgba(255, 255, 255, .8);
}

/* Targetes de vidre rosat */
.contact-faq, .contact-card__join, .qc-card--pink {
  background: linear-gradient(135deg, rgba(255, 255, 255, .7), rgba(255, 222, 234, .58));
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border-color: rgba(255, 255, 255, .85);
}
.qc-card--blue {
  background: linear-gradient(135deg, rgba(255, 255, 255, .72), rgba(226, 228, 255, .58));
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border-color: rgba(255, 255, 255, .85);
}

/* El menú mòbil tancat no ha de deixar ombra a la vora dreta */
.mobile-nav:not(.is-open) { box-shadow: none; }
.mobile-nav { transition: transform .35s cubic-bezier(.77, 0, .175, 1), box-shadow .35s ease; }

/* Pestanyes de Directiu: vidre en lloc d'una franja blanca */
.directiu-tabs {
  background: rgba(255, 255, 255, .6);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-color: rgba(255, 255, 255, .8);
}

/* Peu de pàgina flotant: cantonades rodones que deixen veure el fons */
.footer {
  border-radius: 32px 32px 0 0;
  box-shadow: 0 -20px 50px rgba(47, 47, 150, .10);
}
@media (max-width: 600px) {
  .footer { border-radius: 24px 24px 0 0; }
}

/* Marca d'aigua del peu (la posa efectes.js; és decorativa) */
.fx-footer-mark {
  position: absolute;
  left: 50%;
  bottom: -0.18em;
  transform: translateX(-50%);
  z-index: -1;
  font-family: 'Playfair Display', serif;
  font-size: clamp(4rem, 16vw, 13rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .07);
  pointer-events: none;
  user-select: none;
}

@media (prefers-reduced-motion: no-preference) {
  body::before { animation: fx-ambient 30s ease-in-out infinite alternate; }
  .fx-footer-in .fx-footer-mark { animation: fx-mark-in 1.4s .2s cubic-bezier(.2, .8, .2, 1) both; }
}
@keyframes fx-ambient {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-3vmax, 2vmax, 0) scale(1.06); }
}
@keyframes fx-mark-in {
  from { opacity: 0; transform: translateX(-50%) translateY(30%); letter-spacing: .1em; }
}

/* =============================================
   MENÚ MÒBIL: fons de colors del club, «ROTARACT» en diagonal
   (la posa efectes.js), entrada dels enllaços en 3D i botó brillant.
   ============================================= */
.mobile-overlay {
  background: rgba(16, 12, 48, .38);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.mobile-nav {
  width: min(360px, 88vw);
  overflow-x: hidden;
  isolation: isolate;
  border-radius: 28px 0 0 28px;
  color: #fff;
  background: linear-gradient(160deg, #2f2f96 0%, #1e1e6e 50%, #5a1550 100%);
}
.mobile-nav.is-open { box-shadow: -24px 0 70px rgba(20, 10, 60, .45); }

/* Llums de colors dins del menú (fixes respecte al menú) */
.mobile-nav::before,
.mobile-nav::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}
.mobile-nav::before {
  width: 320px; height: 320px;
  top: -110px; right: -120px;
  background: radial-gradient(closest-side, rgba(218, 26, 93, .55), transparent);
}
.mobile-nav::after {
  width: 300px; height: 300px;
  bottom: -120px; left: -110px;
  background: radial-gradient(closest-side, rgba(110, 110, 255, .4), transparent);
}

/* «ROTARACT» en diagonal */
.fx-nav-mark {
  position: fixed;
  inset: -40% -80%;
  z-index: -1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: .15em;
  transform: rotate(-28deg);
  pointer-events: none;
  user-select: none;
}
.fx-nav-mark span {
  display: block;
  width: max-content;
  white-space: nowrap;
  font-family: 'Montserrat', sans-serif;
  font-size: 4.4rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .03em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .13);
}
.fx-nav-mark span:nth-child(2n) { color: rgba(255, 255, 255, .05); -webkit-text-stroke-width: 0; }
.fx-nav-mark span:nth-child(3n) { -webkit-text-stroke-color: rgba(255, 140, 185, .28); }

.mobile-nav__close {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .22);
  width: 42px; height: 42px;
}
.mobile-nav__close:hover,
.mobile-nav__close:focus-visible { background: #da1a5d; color: #fff; border-color: #da1a5d; }

.mobile-nav__link,
.mobile-nav__group-label {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.01em;
}
.mobile-nav__link,
.mobile-nav__group { border-color: rgba(255, 255, 255, .12); }
.mobile-nav__link:hover, .mobile-nav__link:focus-visible,
.mobile-nav__group-label:hover, .mobile-nav__group-label:focus-visible { color: #ff9ec0; }
.mobile-nav__link--active,
.mobile-nav a[aria-current="page"] { color: #ff9ec0; }

.mobile-nav__sublink {
  position: relative;
  color: rgba(255, 255, 255, .72);
  padding-left: .9rem;
}
.mobile-nav__sublink::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 5px; height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: #ff9ec0;
  opacity: .55;
  transition: transform .25s ease, opacity .25s ease;
}
.mobile-nav__sublink:hover, .mobile-nav__sublink:focus-visible { color: #fff; padding-left: 1.2rem; }
.mobile-nav__sublink:hover::before, .mobile-nav__sublink:focus-visible::before { transform: scale(1.6); opacity: 1; }

.mobile-nav a:focus-visible,
.mobile-nav button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.mobile-nav .lang-menu__btn {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-color: rgba(255, 255, 255, .28);
}

.mobile-nav__cta {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #da1a5d, #ff5e8e);
  box-shadow: 0 10px 28px rgba(218, 26, 93, .45);
}
.mobile-nav__cta::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  /* Els enllaços entren un rere l'altre, amb un gir en 3D */
  .mobile-nav__list { perspective: 900px; }
  .mobile-nav.is-open .mobile-nav__list > li { animation: fx-nav-item .55s cubic-bezier(.2, .8, .2, 1) both; }
  .mobile-nav.is-open .mobile-nav__list > li:nth-child(1) { animation-delay: .08s; }
  .mobile-nav.is-open .mobile-nav__list > li:nth-child(2) { animation-delay: .13s; }
  .mobile-nav.is-open .mobile-nav__list > li:nth-child(3) { animation-delay: .18s; }
  .mobile-nav.is-open .mobile-nav__list > li:nth-child(4) { animation-delay: .23s; }
  .mobile-nav.is-open .mobile-nav__list > li:nth-child(5) { animation-delay: .28s; }
  .mobile-nav.is-open .mobile-nav__list > li:nth-child(6) { animation-delay: .33s; }
  .mobile-nav.is-open .mobile-nav__list > li:nth-child(7) { animation-delay: .38s; }
  .mobile-nav.is-open .mobile-nav__close { animation: fx-nav-close .5s cubic-bezier(.2, .8, .2, 1) both; }

  /* «ROTARACT» es desplaça en diagonal mentre el menú és obert */
  .mobile-nav.is-open .fx-nav-mark span { animation: fx-marquee 22s linear infinite; }
  .mobile-nav.is-open .fx-nav-mark span:nth-child(2n) { animation-direction: reverse; animation-duration: 28s; }
  .mobile-nav.is-open::before { animation: fx-nav-glow 6s ease-in-out infinite alternate; }
  .mobile-nav.is-open::after { animation: fx-nav-glow 7s ease-in-out infinite alternate-reverse; }
  .mobile-nav.is-open .mobile-nav__cta::after { animation: fx-shine 3.2s 1s ease-in-out infinite; }
}

@keyframes fx-nav-item {
  from { opacity: 0; transform: translateX(36px) rotateY(-24deg); }
}
@keyframes fx-nav-close {
  from { opacity: 0; transform: rotate(-90deg) scale(.6); }
}
@keyframes fx-marquee { to { transform: translateX(-50%); } }
@keyframes fx-nav-glow {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-30px, 40px) scale(1.15); }
}
@keyframes fx-shine {
  0%, 60% { left: -60%; }
  100% { left: 130%; }
}

@media print {
  .fx-progress, .fx-ripple, .fx-glare, .fx-footer-mark, .fx-nav-mark { display: none; }
  body::before { display: none; }
}
