@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* CSS Reset y Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--font-family-base);
  background-color: var(--color-bg-page);
  color: var(--color-text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, picture, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font: inherit;
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.section {
  padding-top: 5.5rem;
  padding-bottom: 5.5rem;
  position: relative;
}

/* Sistema de Rejilla Global */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
}

/* --- LOS 3 ÚNICOS FONDOS OFICIALES --- */
.bg-white {
  background-color: var(--color-bg-white) !important;
}

.bg-slate, .bg-blue, .bg-alt, .bg-slate-light, .bg-sand {
  background-color: var(--color-bg-slate) !important;
}

.bg-terracotta, .bg-red, .bg-terracotta-soft {
  background-color: var(--color-bg-terracotta) !important;
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  color: var(--color-text-main);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.2rem, 4vw + 0.5rem, 3.5rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 800;
}

h3 {
  font-size: 1.35rem;
  font-weight: 700;
}

h4 {
  font-size: 1.15rem;
  font-weight: 600;
}

p, li, a, span, button, input, select, textarea, .lead, .footer-text, .directory-bio, .hero-left-content p {
  font-family: var(--font-family-base);
}

p {
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

.lead {
  font-size: 1.2rem;
  line-height: 1.7;
}

.text-center {
  text-align: center;
}

.section-title-wrapper {
  margin-bottom: 3.5rem;
}

.section-subtitle {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

/* ==========================================================================
   HEADER Y NAVEGACIÓN
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  transition: all 0.2s ease;
}

.header-nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 90px;
}

.site-header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.site-header-logo img {
  height: 46px;
  width: auto;
  object-fit: contain;
}

.nav-main-menu {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}

.nav-link {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--color-text-main);
  transition: color 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
}

/* Dropdown Navigation */
.nav-item-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--color-text-main);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.nav-dropdown-trigger:hover,
.nav-dropdown-trigger.active,
.nav-item-dropdown:hover .nav-dropdown-trigger {
  color: var(--color-primary);
}

.nav-dropdown-arrow {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.nav-item-dropdown:hover .nav-dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #FFFFFF;
  min-width: 260px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: 0 14px 36px rgba(31, 36, 48, 0.12);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1100;
}

.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -10px;
  right: -10px;
  height: 20px;
}

.nav-item-dropdown:hover .nav-dropdown-menu,
.nav-item-dropdown:focus-within .nav-dropdown-menu,
.nav-item-dropdown.is-open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-main);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-dropdown-item:hover {
  background: var(--color-sand);
  color: var(--color-primary);
}

.nav-dropdown-item.active {
  color: var(--color-primary);
  font-weight: 600;
  background: var(--color-primary-subtle);
}

/* Área de socios - Separado visualmente */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.btn-area-socios {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-slate-300);
  background: #FFFFFF;
  color: var(--color-slate-800);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-area-socios:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-subtle);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(231, 89, 78, 0.12);
}

.btn-area-socios svg {
  width: 15px;
  height: 15px;
}



/* Badge Novedad / Desarrollo */
.badge-novedad {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background-color: var(--color-terracotta-soft);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  margin-left: 0.5rem;
  line-height: 1;
}

/* Mobile Nav Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--color-text-main);
}

.mobile-toggle svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

/* ==========================================================================
   MOBILE NAV DRAWER (ESTILO CPB)
   ========================================================================== */
.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(31, 36, 48, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.mobile-drawer.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 85%;
  max-width: 340px;
  height: 100%;
  background: #FFFFFF;
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.mobile-drawer.open .mobile-drawer-content {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.mobile-close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 1;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.mobile-nav-heading,
.mobile-nav-link {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.22rem;
  font-weight: 800;
  color: var(--color-text-main);
  text-decoration: none;
  text-transform: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.3;
  padding: 0;
  margin: 0;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--color-primary);
}

.mobile-subnav-list {
  list-style: none;
  padding: 0.4rem 0 0.4rem 1rem;
  margin: 0.6rem 0 0 0.25rem;
  border-left: 2px solid var(--color-slate-200);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.mobile-subnav-link {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--color-slate-600);
  display: block;
  padding: 0.2rem 0;
  text-decoration: none;
  transition: all 0.15s ease;
}

.mobile-subnav-link:hover,
.mobile-subnav-link.active {
  color: var(--color-primary);
  font-weight: 600;
  transform: translateX(2px);
}

/* ==========================================================================
   FOOTER (ESTILO CPB)
   ========================================================================== */
.site-footer {
  background-color: #FFFFFF;
  padding-top: 5rem;
  border-top: 1px solid var(--color-border);
}

.footer-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 4.5rem;
}

.footer-logo {
  height: 64px;
  width: auto;
  margin-bottom: 1.5rem;
}

.footer-text {
  max-width: 520px;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.footer-social-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.footer-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-slate-100);
  color: var(--color-slate-700);
  transition: all 0.2s ease;
  text-decoration: none;
}

.footer-social-icon:hover {
  background: var(--color-primary);
  color: #ffffff;
  transform: translateY(-2px);
}

.footer-social-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.footer-bottom-bar {
  background-color: var(--color-bg-footer-bar);
  padding: 1.5rem 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
}

.footer-bottom-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.footer-bottom-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-self: start;
}

.footer-bottom-links a {
  color: var(--color-text-muted);
  transition: color 0.15s ease;
}

.footer-bottom-links a:hover {
  color: var(--color-primary);
}

.footer-bottom-copy {
  text-align: center;
  justify-self: center;
}

.footer-bottom-cookies {
  justify-self: end;
}

.cookies-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  cursor: pointer;
}

/* Media Queries Responsive */
@media (max-width: 1140px) {
  .nav-main-menu,
  .header-actions {
    display: none;
  }

  .header-nav-container {
    justify-content: space-between;
    height: 75px;
  }

  .mobile-toggle {
    display: block;
  }

  .footer-bottom-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }

  .footer-bottom-links {
    justify-self: center;
    gap: 1.25rem;
  }
}

/* ==========================================================================
   TIPOGRAFÍA OFICIAL PLUS JAKARTA SANS & TÍTULOS EN FONDOS AZULES
   ========================================================================== */
h1, h2, h3, h4, h5, h6,
.section-header h1, .section-header h2, .section-header h3,
.section-title-wrapper h1, .section-title-wrapper h2, .section-title-wrapper h3,
.article-hero-title, .hero-left-content h1, .card-main-title,
.online-course-title, .why-cpb-card h3, .directory-header-info h3,
.team-card-body h3, .participa-action-card h3 {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Todos los títulos sobre fondo azulito (bg-slate / bg-sand / bg-alt) en color azul corporativo #485F78 */
.bg-slate h1, .bg-slate h2,
.bg-blue h1, .bg-blue h2,
.bg-alt h1, .bg-alt h2,
.bg-sand h1, .bg-sand h2,
.bg-slate-50 h1, .bg-slate-50 h2,
.bg-slate .section-header h2, .bg-slate .section-header h1,
.bg-sand .section-header h2, .bg-sand .section-header h1,
.bg-slate .section-title-wrapper h2, .bg-slate .section-title-wrapper h1,
.bg-sand .section-title-wrapper h2, .bg-sand .section-title-wrapper h1,
section.bg-slate h2, section.bg-slate h1,
section.bg-sand h2, section.bg-sand h1,
section.bg-alt h2, section.bg-alt h1 {
  color: #485F78 !important;
}
