
/* =========================================
   ENCABEZADO — EL AMBIENTALISTA POST
   ========================================= */

.site-header {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 17px 4vw;
  transition: background .45s, color .45s, transform .4s, box-shadow .4s;
  transform: translateY(0);
}

.site-header.header-light {
  background: #fff;
  color: #080808;
  box-shadow: 0 1px 0 #0001;
}

.site-header.header-dark {
  background: rgba(0, 0, 0, .08);
  color: #fff;
  box-shadow: none;
}

.site-header.header-dark.scrolled {
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(12px);
}

.site-header.header-hidden {
  transform: translateY(-110%);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 180px;
  max-width: 240px;
}

.logo {
  width: 100%;
  height: auto;
  max-height: 42px;
  object-fit: contain;
  object-position: left center;
}

.logo-white {
  display: none;
}

.header-dark .logo-dark {
  display: none;
}

.header-dark .logo-white {
  display: block;
}

.brand-fallback {
  font: 700 20px/1 var(--serif);
  letter-spacing: -.07em;
  display: none;
}

.brand-fallback b {
  font-weight: 400;
}

.logo[src$="logo.svg"],
.logo[src$="logo2.svg"] {
  min-height: 25px;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(14px, 1.8vw, 28px);
}

.nav-item {
  position: relative;
}

.nav-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  padding: 12px 0;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
  transition: opacity .25s;
}

.nav-trigger span {
  font-size: 13px;
  transition: transform .25s;
}

.nav-item.open .nav-trigger span {
  transform: rotate(180deg);
}

.dropdown {
  position: absolute;
  top: 100%;
  left: -18px;
  min-width: 220px;
  padding: 9px 0;
  background: #fff;
  color: #080808;
  box-shadow: 0 14px 35px #0002;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s, visibility .25s;
}

.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown,
.nav-item.open .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: block;
  padding: 12px 18px;
  font-size: 11px;
  transition: background .2s, color .2s;
}

.dropdown a:hover {
  background: #080808;
  color: #fff;
}

.header-dark .dropdown {
  background: #080808;
  color: #fff;
  border: 1px solid #444;
}

.header-dark .dropdown a:hover {
  background: #fff;
  color: #000;
}

.mobile-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 10px;
  cursor: pointer;
}

.mobile-toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background: currentColor;
  margin: 6px;
}

/* Tablet */

@media (max-width: 1000px) {
  .site-header {
    padding: 14px 4vw;
  }

  .brand {
    min-width: 140px;
    max-width: 180px;
  }

  .main-nav {
    gap: 12px;
  }

  .nav-trigger {
    font-size: 10px;
  }
}

/* Móvil */

@media (max-width: 760px) {
  .site-header {
    padding: 13px 18px;
  }

  .brand {
    max-width: 185px;
  }

  .logo {
    max-height: 33px;
  }

  .mobile-toggle {
    display: block;
    margin-left: auto;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 10px 20px 20px;
    background: #fff;
    color: #080808;
    box-shadow: 0 15px 24px #0002;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    max-height: 75vh;
    overflow: auto;
  }

  .header-dark .main-nav {
    background: #050505;
    color: #fff;
    border-top: 1px solid #444;
  }

  .main-nav.is-open {
    display: flex;
  }

  .nav-item {
    border-bottom: 1px solid #ddd;
  }

  .header-dark .nav-item {
    border-color: #333;
  }

  .nav-trigger {
    width: 100%;
    justify-content: space-between;
    font-size: 12px;
    padding: 16px 0;
  }

  .dropdown {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    min-width: 0;
    padding: 0 0 8px;
    background: transparent;
    color: inherit;
    border: 0;
  }

  .nav-item.open .dropdown {
    display: block;
  }

  .dropdown a {
    padding: 11px 12px;
  }
}

