/* Shared site header nav (main + bitácora) */

.main-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.15% 3.2% 0;
  pointer-events: none;
}

.main-header--overlay {
  position: fixed;
  padding: max(10px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 0
    max(20px, env(safe-area-inset-left, 0px));
}

.main-menu {
  pointer-events: auto;
  width: 36px;
  height: 16px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 3px 4px;
}

.main-menu span {
  width: 6px;
  height: 4px;
  border-radius: 999px;
  background: #f2ebe0;
  justify-self: center;
  align-self: center;
}

.main-nav {
  pointer-events: auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.4rem 2.4rem;
  max-width: 58%;
  padding-top: 0.15%;
}

.main-header--overlay .main-nav {
  max-width: min(78%, 28rem);
  padding-top: 0;
  gap: 0.35rem 1.35rem;
}

.main-nav > a {
  color: #f2ebe0;
  text-decoration: none;
  font-size: clamp(0.48rem, 0.62vw, 0.72rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.92;
  transition: opacity 0.2s ease;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.main-header--overlay .main-nav > a,
.main-header--overlay .main-nav-dropdown__trigger,
.main-header--overlay .main-nav-dropdown__menu a {
  font-size: clamp(0.52rem, 2.5vw, 0.68rem);
  letter-spacing: 0.2em;
}

.main-nav > a:hover {
  opacity: 1;
}

.main-nav-dropdown {
  position: relative;
  display: flex;
  align-items: baseline;
  flex-shrink: 0;
}

.main-nav-dropdown__trigger {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  line-height: 1;
  color: #f2ebe0;
  text-decoration: none;
  font-size: clamp(0.48rem, 0.62vw, 0.72rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.92;
  cursor: pointer;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.main-nav-dropdown__trigger:hover,
.main-nav-dropdown__trigger[aria-expanded="true"] {
  opacity: 1;
}

.main-nav-dropdown__menu {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  margin: 0;
  padding: 0.55rem 0;
  list-style: none;
  min-width: 9rem;
  background: rgba(12, 10, 8, 0.92);
  border: 1px solid rgba(242, 235, 224, 0.18);
  z-index: 40;
}

.main-nav-dropdown__menu a {
  display: block;
  padding: 0.55rem 1.15rem;
  white-space: nowrap;
  color: #f2ebe0;
  text-decoration: none;
  font-size: clamp(0.48rem, 0.62vw, 0.72rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.92;
  line-height: 1.2;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.main-nav-dropdown__menu a[aria-current="page"] {
  opacity: 1;
  background: rgba(242, 235, 224, 0.06);
}

.main-nav-dropdown__menu a:hover,
.main-nav-dropdown__menu a:focus-visible {
  opacity: 1;
  background: rgba(242, 235, 224, 0.08);
  outline: none;
}

.main-nav-dropdown__menu a:visited {
  color: #f2ebe0;
}

.main-contact-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
}

.main-contact-modal.is-open {
  display: flex;
}

.main-contact-modal__panel {
  position: relative;
  width: min(22rem, 100%);
  padding: 2rem 1.75rem 1.85rem;
  background: rgba(12, 10, 8, 0.96);
  border: 1px solid rgba(242, 235, 224, 0.2);
  color: #f2ebe0;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.main-contact-modal__close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  margin: 0;
  padding: 0.15rem 0.45rem;
  border: 0;
  background: transparent;
  color: #f2ebe0;
  font-size: 1.35rem;
  line-height: 1;
  opacity: 0.75;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.main-contact-modal__close:hover {
  opacity: 1;
}

.main-contact-modal__panel h2 {
  margin: 0 0 0.85rem;
  font-size: clamp(0.62rem, 0.82vw, 0.78rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 500;
}

.main-contact-modal__lead {
  margin: 0 0 1.35rem;
  font-size: clamp(0.72rem, 0.95vw, 0.88rem);
  line-height: 1.55;
  opacity: 0.88;
}

.main-contact-modal__channels {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.main-contact-modal__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: clamp(0.48rem, 0.62vw, 0.62rem);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.65;
}

.main-contact-modal__channels a {
  color: #f2ebe0;
  text-decoration: none;
  font-size: clamp(0.72rem, 0.95vw, 0.9rem);
  letter-spacing: 0.06em;
  opacity: 0.95;
  transition: opacity 0.2s ease;
}

.main-contact-modal__channels a:hover,
.main-contact-modal__channels a:focus-visible {
  opacity: 1;
  outline: none;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.main-contact-modal__channels a:visited {
  color: #f2ebe0;
}

@media (max-width: 768px) {
  .main-nav {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.85rem;
    max-width: 68%;
  }

  .main-header--overlay .main-nav {
    max-width: 72%;
  }

  .main-nav > a,
  .main-nav-dropdown__trigger,
  .main-nav-dropdown__menu a {
    letter-spacing: 0.12em;
    font-size: 0.48rem;
  }
}

@media (min-width: 520px) {
  .main-header--overlay .main-nav {
    gap: 0.4rem 1.75rem;
  }

  .main-header--overlay .main-nav > a,
  .main-header--overlay .main-nav-dropdown__trigger,
  .main-header--overlay .main-nav-dropdown__menu a {
    font-size: 0.62rem;
    letter-spacing: 0.22em;
  }
}
