/* ==========================================================
   FUNDACIÓN LEGIS · Estilo corporativo moderno y elegante
   ========================================================== */
:root {
  --granate: #7B1E27;
  --granate-osc: #5E121A;
  --dorado: #C6A34F;
  --dorado-suave: #E0C97C;
  --gris-claro: #FAFAFA;
  --gris-texto: #333333;
  --blanco: #fff;
  --fuente: 'Open Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --max: 1200px;
}

/* ===== Reset y base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--gris-claro);
  color: var(--gris-texto);
  font-family: var(--fuente);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }

/* ===== Layout general ===== */
.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
h1, h2, h3 {
  color: var(--granate);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 8px;
}
a { color: var(--granate); text-decoration: none; }
a:hover { color: var(--dorado); }
h2::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  background: var(--dorado);
  margin: 8px auto;
  border-radius: 2px;
}

/* ===== Header ===== */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--granate);
  border-bottom: 2px solid var(--dorado-suave);
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo img {
  height: 52px;
  width: auto;
  object-fit: contain;
}
nav { margin-left: auto; }
#main-menu {
  list-style: none;
  display: flex;
  gap: 26px;
}
#main-menu a {
  color: var(--blanco);
  font-weight: 600;
  position: relative;
  transition: color .2s;
}
#main-menu a:hover { color: var(--dorado); }
#main-menu .active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 2px;
  background: var(--dorado);
}

/* ===== Botón Colabora ===== */
.btn-colabora {
  background: transparent;
  color: var(--dorado);
  padding: 8px 14px;
  border: 2px solid var(--dorado);
  border-radius: 10px;
  font-weight: 700;
  transition: all .25s ease-in-out;
}
.btn-colabora:hover {
  background: var(--dorado);
  color: var(--granate);
}

/* ===== Idiomas ===== */
.lang-switch {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: 12px;
}
.lang-switch a {
  background: rgba(255, 255, 255, .15);
  color: var(--blanco);
  padding: 6px 8px;
  border-radius: 8px;
  font-weight: 700;
}
.lang-switch a.active {
  background: var(--blanco);
  color: var(--granate);
}

/* ===== Hero portada ===== */
.hero { position: relative; }
.hero picture img {
  width: 100%;
  height: 68vh;
  object-fit: cover;
  object-position: center;
}
.hero-slogan {
  position: absolute;
  left: 8%;
  bottom: 10%;
  max-width: 560px;
  color: #fff;
}
.hero-slogan h1 {
  font-size: 2.6rem;
  margin-bottom: 14px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .45);
}
.hero-actions { display: flex; gap: 18px; align-items: center; }

/* ===== Botones ===== */
.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
}
.btn-primary {
  background: var(--granate);
  color: #fff;
}
.btn-primary:hover {
  background: var(--dorado);
  color: var(--granate);
}
.btn-link {
  color: #fff;
  border-bottom: 2px solid rgba(255, 255, 255, .35);
  padding: 6px 2px;
}
.btn-link:hover {
  color: #fff;
  border-color: var(--dorado);
}

/* ===== Secciones ===== */
.section { padding: 40px 0; }
.lead { font-size: 1.1rem; }

/* ===== Cards ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px;
}
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
}
.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.card h3 { margin: 0 0 2px; }
.card p { flex: 1; }
.card .card-actions { padding: 0 16px 18px; }
.card .btn { width: max-content; }

/* ===== Partners & Colaboradores ===== */
.partners, .collaborators {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
}
.partners img, .collaborators img {
  height: 70px;
  width: auto;
  transition: transform .2s, opacity .2s;
}
.partners img:hover, .collaborators img:hover {
  transform: scale(1.05);
  opacity: .95;
}
.collaborators.empty-state {
  min-height: 120px;
  min-width: 60%;
  border: 2px dashed var(--dorado);
  border-radius: 10px;
  background: rgba(198, 163, 79, .06);
  color: var(--granate);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
}

/* ===== Footer ===== */
footer {
  background: var(--granate);
  color: #fff;
  text-align: center;
  padding: 22px 16px;
  margin-top: 50px;
  border-top: 2px solid var(--dorado-suave);
}
footer a { color: #fff; opacity: .9; }
footer a:hover { color: var(--dorado); }

/* ===== Menú hamburguesa ===== */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  z-index: 2001;
  position: relative;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--blanco);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.nav-toggle.is-open span:nth-child(1) {
  transform: rotate(45deg) translateY(8px);
}
.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-open span:nth-child(3) {
  transform: rotate(-45deg) translateY(-8px);
}
.backdrop { display: none !important; pointer-events: none !important; z-index: 0 !important; }

@media (max-width:900px) {
  .nav-toggle { display: flex; }
  nav {
    position: fixed;
    top: 0;
    right: -280px;
    height: 100vh;
    width: 260px;
    background: var(--granate);
    padding: 80px 20px 20px;
    box-shadow: -4px 0 16px rgba(0, 0, 0, .15);
    z-index: 3000;
    transition: right .28s ease;
  }
  nav.open { right: 0; }
  #main-menu { flex-direction: column; gap: 18px; }
}

/* ===== Popup Gala Benéfica ===== */
.popup-gala {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 4000;
}
.popup-gala.active { display: flex; }
.popup-content {
  position: relative;
  background: transparent;
  max-width: 600px;
  width: 90%;
  border-radius: 12px;
  overflow: hidden;
  animation: fadeIn 0.4s ease;
}
.popup-content img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}
#close-popup {
  position: absolute;
  top: 8px;
  right: 12px;
  background: var(--granate);
  color: var(--blanco);
  border: none;
  font-size: 1.6rem;
  font-weight: bold;
  line-height: 1;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: background .2s;
}
#close-popup:hover { background: var(--dorado); color: var(--granate); }
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== Responsive ===== */
@media (max-width:980px) {
  .cards { grid-template-columns: 1fr; }
}
@media (max-width:700px) {
  .hero picture img { height: 54vh; }
  .hero-slogan { left: 6%; right: 6%; }
}

