/* ============================================================================
   HAVENLY DESIGN SYSTEM — NAVIGATION & FOOTER
   Drop after havenly-ds.css (and havenly-ds-dark.css for dark mode support).
   ============================================================================ */

/* ────────────────────────────────────────────────────────────────────────
   .hv-nav — Top navigation bar
   ────────────────────────────────────────────────────────────────────────
   Sticky, with backdrop blur. Three regions: brand · primary links · actions.
   Below 940px, primary links collapse into a drawer triggered by the menu btn.
*/

.hv-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: color-mix(in srgb, var(--hv-color-surface-default) 80%, transparent);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid var(--hv-color-border-subtle);
  transition: transform var(--hv-duration-base) var(--hv-ease-nav),
              background-color var(--hv-duration-base) var(--hv-ease-nav);
}
.hv-nav--hidden { transform: translateY(-100%); }
.hv-nav--solid {
  background: var(--hv-color-surface-default);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.hv-nav__inner {
  max-width: var(--hv-content-max);
  margin-inline: auto;
  padding: var(--hv-space-3) var(--hv-page-margin);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hv-space-4);
  height: 64px;
}

/* Brand */
.hv-nav__brand {
  display: flex;
  align-items: center;
  gap: var(--hv-space-2-5, 10px);
  font-weight: var(--hv-weight-bold);
  font-size: var(--hv-text-md);
  color: var(--hv-color-text-default);
  text-decoration: none;
  letter-spacing: var(--hv-tracking-tight);
  flex-shrink: 0;
}
.hv-nav__brand-mark {
  width: 32px; height: 32px;
  border-radius: var(--hv-radius-sm);
  background: var(--hv-gradient-brand);
  display: grid;
  place-items: center;
  color: white;
  font-family: var(--hv-font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 18px;
  line-height: 1;
}

/* Primary nav links (desktop) */
.hv-nav__links {
  display: none;
  align-items: center;
  gap: var(--hv-space-1);
  flex: 1;
  margin-left: var(--hv-space-8);
}
@media (min-width: 940px) {
  .hv-nav__links { display: flex; }
}
.hv-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--hv-space-1);
  padding: var(--hv-space-2) var(--hv-space-3);
  font-size: var(--hv-text-sm);
  font-weight: var(--hv-weight-bold);
  color: var(--hv-color-text-default-subdued);
  border-radius: var(--hv-radius-sm);
  text-decoration: none;
  transition: color var(--hv-duration-mid) var(--hv-ease-hover),
              background-color var(--hv-duration-mid) var(--hv-ease-hover);
}
.hv-nav__link:hover {
  color: var(--hv-color-text-default);
  background: var(--hv-color-surface-muted);
}
.hv-nav__link--active {
  color: var(--hv-color-text-default);
}
.hv-nav__link--active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: var(--hv-space-3);
  right: var(--hv-space-3);
  height: 2px;
  background: var(--hv-color-action-primary);
  border-radius: 2px 2px 0 0;
}
.hv-nav__link svg {
  width: 12px; height: 12px;
  opacity: 0.6;
  transition: transform var(--hv-duration-mid) var(--hv-ease-hover);
}
.hv-nav__link[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* Right-side actions */
.hv-nav__actions {
  display: flex;
  align-items: center;
  gap: var(--hv-space-2);
  flex-shrink: 0;
}
.hv-nav__action-text {
  display: none;
}
@media (min-width: 740px) {
  .hv-nav__action-text { display: inline; }
}

/* Search in nav */
.hv-nav__search {
  display: none;
  position: relative;
  width: 240px;
}
@media (min-width: 1100px) {
  .hv-nav__search { display: block; }
}
.hv-nav__search-input {
  width: 100%;
  height: 36px;
  padding-left: 36px;
  padding-right: var(--hv-space-3);
  font-family: inherit;
  font-size: var(--hv-text-sm);
  color: var(--hv-color-text-default);
  background: var(--hv-color-surface-muted);
  border: 1px solid transparent;
  border-radius: var(--hv-radius-sm);
  transition: background-color var(--hv-duration-mid) var(--hv-ease-hover),
              border-color var(--hv-duration-fast) ease;
}
.hv-nav__search-input::placeholder { color: var(--hv-color-text-quiet); }
.hv-nav__search-input:hover { background: var(--hv-color-surface-subdued); }
.hv-nav__search-input:focus {
  outline: none;
  background: var(--hv-color-surface-default);
  border-color: var(--hv-color-border-focus);
}
.hv-nav__search-icon {
  position: absolute;
  left: var(--hv-space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--hv-color-text-quiet);
  pointer-events: none;
}

/* Mobile menu trigger */
.hv-nav__menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--hv-radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--hv-color-text-default);
  transition: background-color var(--hv-duration-mid) var(--hv-ease-hover);
}
.hv-nav__menu-trigger:hover { background: var(--hv-color-surface-muted); }
@media (min-width: 940px) {
  .hv-nav__menu-trigger { display: none; }
}
.hv-nav__menu-trigger svg { width: 20px; height: 20px; }

/* ────────────────────────────────────────────────────────────────────────
   .hv-drawer — Mobile menu drawer (right-side slide-in)
   ───────────────────────────────────────────────────────────────────────── */

.hv-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--hv-duration-base) var(--hv-ease-nav);
}
.hv-drawer[data-open="true"] {
  pointer-events: auto;
  opacity: 1;
}
.hv-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 27, 49, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.hv-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 100vw);
  background: var(--hv-color-surface-default);
  border-left: 1px solid var(--hv-color-border-subtle);
  box-shadow: var(--hv-shadow-2xl);
  transform: translateX(100%);
  transition: transform var(--hv-duration-base) var(--hv-ease-nav);
  display: flex;
  flex-direction: column;
}
.hv-drawer[data-open="true"] .hv-drawer__panel {
  transform: translateX(0);
}
.hv-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--hv-space-4) var(--hv-space-5);
  border-bottom: 1px solid var(--hv-color-border-subtle);
  flex-shrink: 0;
}
.hv-drawer__close {
  width: 36px; height: 36px;
  border-radius: var(--hv-radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--hv-color-text-default);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--hv-duration-mid) var(--hv-ease-hover);
}
.hv-drawer__close:hover { background: var(--hv-color-surface-muted); }
.hv-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--hv-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--hv-space-1);
}
.hv-drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--hv-space-3) var(--hv-space-4);
  font-size: var(--hv-text-md);
  font-weight: var(--hv-weight-bold);
  color: var(--hv-color-text-default);
  text-decoration: none;
  border-radius: var(--hv-radius-sm);
  transition: background-color var(--hv-duration-mid) var(--hv-ease-hover);
}
.hv-drawer__link:hover { background: var(--hv-color-surface-muted); }
.hv-drawer__link svg { width: 16px; height: 16px; color: var(--hv-color-text-quiet); }
.hv-drawer__divider {
  height: 1px;
  background: var(--hv-color-border-subtle);
  margin: var(--hv-space-3) var(--hv-space-4);
}
.hv-drawer__footer {
  padding: var(--hv-space-4) var(--hv-space-5);
  border-top: 1px solid var(--hv-color-border-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--hv-space-3);
  flex-shrink: 0;
}

/* ────────────────────────────────────────────────────────────────────────
   .hv-theme-toggle — Sun/moon toggle button
   ───────────────────────────────────────────────────────────────────────── */

.hv-theme-toggle {
  position: relative;
  width: 40px; height: 40px;
  border-radius: var(--hv-radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--hv-color-text-default);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--hv-duration-mid) var(--hv-ease-hover);
  overflow: hidden;
}
.hv-theme-toggle:hover { background: var(--hv-color-surface-muted); }
.hv-theme-toggle:focus-visible {
  outline: 2px solid var(--hv-color-border-focus);
  outline-offset: 2px;
}
.hv-theme-toggle svg {
  position: absolute;
  width: 18px; height: 18px;
  transition: transform var(--hv-duration-base) var(--hv-ease-nav),
              opacity var(--hv-duration-base) var(--hv-ease-nav);
}
.hv-theme-toggle__sun {
  transform: rotate(0deg) scale(1);
  opacity: 1;
}
.hv-theme-toggle__moon {
  transform: rotate(-90deg) scale(0.5);
  opacity: 0;
}
[data-theme="dark"] .hv-theme-toggle__sun {
  transform: rotate(90deg) scale(0.5);
  opacity: 0;
}
[data-theme="dark"] .hv-theme-toggle__moon {
  transform: rotate(0deg) scale(1);
  opacity: 1;
}

/* ────────────────────────────────────────────────────────────────────────
   .hv-footer — Multi-column footer
   ───────────────────────────────────────────────────────────────────────── */

.hv-footer {
  background: var(--hv-color-surface-deep);
  color: rgba(255, 255, 255, 0.7);
  padding-block: var(--hv-space-16) var(--hv-space-8);
  padding-inline: var(--hv-page-margin);
  border-top: 1px solid var(--hv-color-border-subtle);
}
[data-theme="dark"] .hv-footer {
  background: var(--hv-color-surface-subdued);
  color: var(--hv-color-text-default-subdued);
}

.hv-footer__inner {
  max-width: var(--hv-content-max);
  margin-inline: auto;
}

.hv-footer__top {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--hv-space-10);
  padding-bottom: var(--hv-space-12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
@media (min-width: 740px) {
  .hv-footer__top {
    grid-template-columns: 1.4fr 2fr;
    gap: var(--hv-space-16);
  }
}

.hv-footer__brand-block {
  display: flex;
  flex-direction: column;
  gap: var(--hv-space-4);
  max-width: 360px;
}
.hv-footer__brand {
  display: flex;
  align-items: center;
  gap: var(--hv-space-3);
  font-weight: var(--hv-weight-bold);
  font-size: var(--hv-text-md);
  color: white;
  letter-spacing: var(--hv-tracking-tight);
}
.hv-footer__brand-mark {
  width: 36px; height: 36px;
  border-radius: var(--hv-radius-sm);
  background: var(--hv-gradient-brand);
  display: grid;
  place-items: center;
  color: white;
  font-family: var(--hv-font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 20px;
  line-height: 1;
}
.hv-footer__tagline {
  font-size: var(--hv-text-sm);
  color: rgba(255, 255, 255, 0.6);
  line-height: var(--hv-lh-relaxed);
  text-wrap: pretty;
}

/* Newsletter */
.hv-footer__newsletter-label {
  font-size: var(--hv-text-xs);
  font-weight: var(--hv-weight-bold);
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: var(--hv-tracking-widest);
  margin-bottom: var(--hv-space-2);
}
.hv-footer__newsletter {
  display: flex;
  gap: var(--hv-space-2);
}
.hv-footer__newsletter-input {
  flex: 1;
  height: 40px;
  padding-inline: var(--hv-space-3);
  font-family: inherit;
  font-size: var(--hv-text-sm);
  color: white;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--hv-radius-sm);
  transition: border-color var(--hv-duration-fast) ease,
              background-color var(--hv-duration-mid) var(--hv-ease-hover);
}
.hv-footer__newsletter-input::placeholder { color: rgba(255, 255, 255, 0.4); }
.hv-footer__newsletter-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--hv-color-border-focus);
}
.hv-footer__newsletter-submit {
  height: 40px;
  padding-inline: var(--hv-space-4);
  font-family: inherit;
  font-size: var(--hv-text-sm);
  font-weight: var(--hv-weight-bold);
  color: white;
  background: var(--hv-color-action-primary);
  border: none;
  border-radius: var(--hv-radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--hv-duration-mid) var(--hv-ease-hover);
}
.hv-footer__newsletter-submit:hover { background: var(--hv-color-action-primary-hover); }

/* Link columns */
.hv-footer__columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--hv-space-8);
}
@media (min-width: 540px) {
  .hv-footer__columns { grid-template-columns: repeat(4, 1fr); }
}

.hv-footer__col-title {
  font-size: var(--hv-text-xs);
  font-weight: var(--hv-weight-bold);
  color: white;
  text-transform: uppercase;
  letter-spacing: var(--hv-tracking-widest);
  margin-bottom: var(--hv-space-4);
}
.hv-footer__col ul {
  display: flex;
  flex-direction: column;
  gap: var(--hv-space-3);
}
.hv-footer__col-link {
  display: inline-block;
  font-size: var(--hv-text-sm);
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color var(--hv-duration-mid) var(--hv-ease-hover);
}
.hv-footer__col-link:hover { color: white; }

/* Bottom bar */
.hv-footer__bottom {
  padding-top: var(--hv-space-6);
  display: flex;
  flex-direction: column;
  gap: var(--hv-space-4);
  align-items: flex-start;
}
@media (min-width: 740px) {
  .hv-footer__bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.hv-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hv-space-4) var(--hv-space-6);
  font-size: var(--hv-text-xs);
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--hv-font-mono);
  letter-spacing: var(--hv-tracking-wide);
}
.hv-footer__legal a {
  color: inherit;
  text-decoration: none;
  transition: color var(--hv-duration-mid) var(--hv-ease-hover);
}
.hv-footer__legal a:hover { color: rgba(255, 255, 255, 0.8); }

.hv-footer__meta {
  display: flex;
  align-items: center;
  gap: var(--hv-space-4);
}
.hv-footer__region {
  display: inline-flex;
  align-items: center;
  gap: var(--hv-space-2);
  font-size: var(--hv-text-xs);
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.04);
  padding: var(--hv-space-1) var(--hv-space-3);
  border-radius: var(--hv-radius-full);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.hv-footer__socials {
  display: flex;
  gap: var(--hv-space-1);
}
.hv-footer__social {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  border-radius: var(--hv-radius-sm);
  transition: background-color var(--hv-duration-mid) var(--hv-ease-hover),
              color var(--hv-duration-mid) var(--hv-ease-hover);
}
.hv-footer__social:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}
.hv-footer__social svg { width: 16px; height: 16px; }
