/* === TOTS FUNDACIÓ — Sistema visual común === */

:root {
  --gorgina: #273a56;
  --frondac: #635726;
  --basalta: #37323b;
  --terrenc: #4e2c35;
  --bellfosc: #1E1E1E;
  --boirac: #ebebe1;
  --terblanc: #FFFFFF;
  --aquis: #5d5fff;

  --serif: 'Lora', Georgia, serif;
  --sans: 'Poppins', Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--terblanc);
  color: var(--bellfosc);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* === NAV === */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(39, 58, 86, 0.95);
  backdrop-filter: blur(12px);
  color: var(--terblanc);
  font-family: var(--sans);
}

/* Variant: dark on light pages */
.nav--light {
  background: rgba(255, 255, 255, 0.92);
  color: var(--bellfosc);
}
.nav--light .nav__logo .bar { background: var(--bellfosc); }

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav__logo-img {
  height: 26px;
  width: auto;
  display: block;
}
.nav__logo .bar {
  display: inline-block;
  width: 1px;
  height: 1.4rem;
  background: var(--terblanc);
}
.nav__logo .name {
  font-family: var(--sans);
  font-style: normal;
  font-weight: 600;
  font-size: 1.1rem;
}

.nav__links {
  display: flex;
  gap: 2.2rem;
  list-style: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.nav__links a {
  position: relative;
  padding-bottom: 4px;
  transition: opacity 0.2s;
}
.nav__links a:hover { opacity: 0.7; }
.nav__links a.active {
  border-bottom: 1.5px solid currentColor;
}

.nav__lang {
  display: flex;
  gap: 0.7rem;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.nav__lang span {
  opacity: 0.4;
  cursor: pointer;
  transition: opacity 0.2s;
}
.nav__lang span.active { opacity: 1; }
.nav__lang span:hover { opacity: 1; }

/* === HAMBURGER (mobile only) === */
.nav__hamburger {
  display: none;
  background: transparent;
  border: 0;
  padding: 0.5rem;
  margin-left: 0.5rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  position: relative;
  z-index: 110;
  color: inherit;
}
.nav__hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  margin: 5px auto;
  transition: transform 0.25s, opacity 0.25s;
}
.nav--open .nav__hamburger {
  color: var(--terblanc); /* En menú abierto, siempre blanca */
}
.nav--open .nav__hamburger span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav--open .nav__hamburger span:nth-child(2) {
  opacity: 0;
}
.nav--open .nav__hamburger span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* === BAR MOTIF (vertical bar from logo) === */
.bar-motif {
  display: inline-block;
  background: currentColor;
  width: 2px;
}
.bar-motif--inline {
  width: 2px;
  height: 0.7em;
  margin: 0 0.15em -0.05em;
  vertical-align: baseline;
}
.bar-motif--label {
  width: 1px; height: 14px;
  opacity: 0.6;
}

/* === EYEBROW LABEL === */
.eyebrow {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  opacity: 0.7;
}
.eyebrow::before {
  content: "";
  width: 1px; height: 14px;
  background: currentColor;
  opacity: 0.7;
}

/* === CTA LINK === */
.cta-link {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding-bottom: 6px;
  border-bottom: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  transition: gap 0.3s;
}
.cta-link:hover { gap: 1.2rem; }
.cta-link::after {
  content: "→";
  font-size: 1.1rem;
}

.cta-button {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 1.2rem 2.5rem;
  background: var(--terblanc);
  color: var(--aquis);
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  transition: transform 0.2s, gap 0.3s;
  cursor: pointer;
  border: none;
}
.cta-button:hover { gap: 1.3rem; transform: translateY(-2px); }
.cta-button::after { content: "→"; font-size: 1.2rem; }

/* === FOOTER === */
.footer {
  background: var(--gorgina);
  color: var(--terblanc);
  padding: 5rem 3rem 2rem;
}

.footer__top {
  max-width: 1400px;
  margin: 0 auto 4rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 3rem;
}

.footer__brand {
  display: inline-flex;
  align-items: center;
  margin-bottom: 1.5rem;
}
.footer__brand-img {
  height: 36px;
  width: auto;
  display: block;
}

.footer__legal {
  font-family: var(--sans);
  font-size: 0.85rem;
  line-height: 1.7;
  opacity: 0.7;
}

.footer__col h4 {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  opacity: 0.6;
  font-weight: 500;
}

.footer__col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.footer__col a {
  font-family: var(--sans);
  font-size: 0.95rem;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.footer__col a:hover { opacity: 1; }

.footer__bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 0.78rem;
  opacity: 0.5;
  letter-spacing: 0.05em;
}

/* === PAGE HEADER (interior pages) === */
.page-hero {
  padding: 10rem 3rem 5rem;
  position: relative;
}
.page-hero__eyebrow {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  opacity: 0.7;
}
.page-hero__eyebrow::before {
  content: "";
  width: 1px; height: 14px;
  background: currentColor;
  opacity: 0.7;
}
.page-hero__title {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  max-width: 18ch;
  margin-bottom: 2rem;
}
.page-hero__title em {
  font-style: italic;
  color: var(--aquis);
}
.page-hero__lead {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.55;
  max-width: 45ch;
  opacity: 0.9;
  font-weight: 400;
}

/* === GENERIC SECTION === */
.section {
  padding: 6rem 3rem;
}
.section__container {
  max-width: 1100px;
  margin: 0 auto;
}
.section__container--wide { max-width: 1400px; }

.section h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
}
.section h2 em { font-style: italic; color: var(--aquis); }

.section h3 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section p {
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.65;
  margin-bottom: 1.2rem;
  max-width: 60ch;
}

/* === RESPONSIVE === */
@media (max-width: 980px) {
  .nav { padding: 1.2rem 1.5rem; }

  /* Mostrar hamburguesa */
  .nav__hamburger { display: block; }

  /* Convertir lista en panel desplegable */
  .nav__links {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 360px;
    height: 100vh;
    height: 100dvh;
    background: var(--gorgina);
    color: var(--terblanc);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 1.8rem;
    padding: 5rem 2.5rem 2.5rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 105;
    box-shadow: -8px 0 30px rgba(0,0,0,0.25);
    display: flex;
  }
  .nav--open .nav__links {
    transform: translateX(0);
  }
  .nav__links a {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-style: italic;
    font-weight: 500;
    letter-spacing: -0.01em;
    border-bottom: 0;
    padding-bottom: 0;
  }
  .nav__links a.active {
    color: var(--aquis);
    border-bottom: 0;
  }

  /* Backdrop oscuro cuando el menú está abierto */
  .nav__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 99;
  }
  .nav--open .nav__backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* Light variant of nav (for pages with light bg) — keep menu panel dark for contrast */
  .nav--light .nav__hamburger { color: var(--bellfosc); }

  .page-hero { padding-left: 1.5rem; padding-right: 1.5rem; }
  .section, .footer { padding-left: 1.5rem; padding-right: 1.5rem; }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__bottom { flex-direction: column; gap: 0.5rem; }
}
