/* Hippocampus Verlag — sticky header + mega menu */

:root {
  --hippo-teal: #4d99a1;
  --hippo-teal-dark: #2f6f76;
  --hippo-ink: #1a2b2e;
  --hippo-muted: #5a7276;
  --hippo-line: #d7e3e5;
  --hippo-white: #ffffff;
  --hippo-header-h: 72px;
  --hippo-max: 1200px;
  --hippo-gutter: 24px;
  --hippo-font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hippo-font-serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

/* Site-wide typography */
body {
  font-family: var(--hippo-font-sans);
  color: var(--hippo-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.entry-title,
.elementor-heading-title {
  font-family: var(--hippo-font-serif);
  font-optical-sizing: auto;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--hippo-ink);
}

.admin-bar .hippo-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  .admin-bar .hippo-header {
    top: 46px;
  }
}

.hippo-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--hippo-line);
  font-family: var(--hippo-font-sans);
  color: var(--hippo-ink);
  transition: box-shadow 0.2s ease, background 0.2s ease;
  /* containing block for full-width mega panels */
  overflow: visible;
}

.hippo-header__nav,
.hippo-nav {
  overflow: visible;
}

.hippo-header.is-scrolled {
  --hippo-header-h: 64px;
  box-shadow: 0 8px 24px rgba(26, 43, 46, 0.08);
  background: rgba(255, 255, 255, 0.98);
}

.hippo-header__inner {
  max-width: var(--hippo-max);
  margin: 0 auto;
  padding: 0 var(--hippo-gutter);
  width: 100%;
  box-sizing: border-box;
  min-height: var(--hippo-header-h);
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto minmax(140px, 1fr);
  align-items: center;
  column-gap: 20px;
  transition: min-height 0.2s ease;
}

.hippo-header__logo {
  justify-self: start;
  display: flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}

.hippo-header__logo img {
  display: block;
  height: 48px;
  width: auto;
  max-width: 240px;
  transition: height 0.2s ease;
}

.hippo-header.is-scrolled .hippo-header__logo img {
  height: 40px;
}

.hippo-header__nav {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 100%;
}

.hippo-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0 6px;
  height: 100%;
}

.hippo-nav > .menu-item {
  position: static;
  margin: 0;
  display: flex;
  align-items: center;
  height: 100%;
}

.hippo-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  height: var(--hippo-header-h);
  color: var(--hippo-ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  transition: color 0.18s ease;
}

.hippo-nav__link:hover,
.hippo-nav__link:focus-visible,
.hippo-nav > .current-menu-item > .hippo-nav__link,
.hippo-nav > .current-menu-ancestor > .hippo-nav__link,
.hippo-nav > .menu-item-has-mega.is-mega-open > .hippo-nav__link {
  color: var(--hippo-muted);
}

.hippo-nav__chevron {
  display: inline-flex;
  opacity: 0.7;
  transform: translateY(1px);
  transition: transform 0.18s ease;
}

.hippo-nav > .menu-item-has-mega.is-mega-open > .hippo-nav__link .hippo-nav__chevron {
  transform: translateY(1px) rotate(180deg);
}

.hippo-nav__submenu-toggle {
  display: none !important;
}

/* -------- Mega menu (desktop) -------- */
.hippo-mega {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--hippo-white);
  border-top: 1px solid var(--hippo-line);
  border-bottom: 1px solid var(--hippo-line);
  box-shadow: 0 18px 40px rgba(26, 43, 46, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 30;
}

.hippo-nav > .menu-item-has-mega:hover > .hippo-mega,
.hippo-nav > .menu-item-has-mega:focus-within > .hippo-mega,
.hippo-nav > .menu-item-has-mega.is-mega-open > .hippo-mega {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.hippo-mega__inner {
  /* Match header__inner: same width, gutters, logo→utils edges */
  max-width: var(--hippo-max);
  margin: 0 auto;
  padding: 28px var(--hippo-gutter) 32px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px 48px;
}

.hippo-mega__cols {
  display: flex;
  flex: 1 1 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px 48px;
  min-width: 0;
}

.hippo-mega__col {
  flex: 1 1 0;
  min-width: 0;
  max-width: 280px;
}

.hippo-mega__col-title,
.hippo-mega__heading {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hippo-teal-dark);
}

.hippo-mega__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.hippo-mega__links a,
.hippo-mega__link {
  color: var(--hippo-ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  transition: color 0.15s ease;
}

.hippo-mega__links a:hover,
.hippo-mega__links a:focus-visible,
.hippo-mega__link:hover {
  color: var(--hippo-teal-dark);
}

.hippo-mega__feature {
  flex: 0 0 280px;
  max-width: 320px;
  background: #f3f8f9;
  border: 1px solid var(--hippo-line);
  border-radius: 12px;
  padding: 20px 22px;
  box-sizing: border-box;
}

.hippo-mega__feature-eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hippo-teal);
}

.hippo-mega__feature-title {
  margin: 0 0 8px;
  font-family: var(--hippo-font-serif);
  font-optical-sizing: auto;
  font-size: 18px;
  font-weight: 600;
  color: var(--hippo-ink);
  line-height: 1.25;
}

.hippo-mega__feature-text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--hippo-muted);
}

.hippo-mega__feature-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--hippo-teal-dark);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.hippo-mega__feature-cta:hover {
  color: var(--hippo-ink);
}

.hippo-header__utils {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hippo-header__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hippo-ink);
  text-decoration: none;
  padding: 6px;
  border-radius: 6px;
  transition: color 0.18s ease, background 0.18s ease;
}

.hippo-header__icon-btn:hover,
.hippo-header__icon-btn:focus-visible {
  color: var(--hippo-teal-dark);
  background: #f3f8f9;
}

.hippo-header__divider {
  width: 1px;
  height: 20px;
  background: var(--hippo-line);
}

.hippo-header__account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--hippo-ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  padding: 6px 4px;
  border-radius: 6px;
  transition: color 0.18s ease;
}

/* Same size + weight (icon fonts thicken if parent uses font-weight: 500). */
.hippo-header__icon-btn .ri-search-2-line,
.hippo-header__util--search .ri-search-2-line,
.hippo-header__account .ri-account-circle-line,
.hippo-header__util--account .ri-account-circle-line {
  font-size: 22px;
  font-weight: 400 !important;
  line-height: 1;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hippo-header__account:hover,
.hippo-header__account:focus-visible {
  color: var(--hippo-teal-dark);
}

/* Beat Hello Elementor button reset */
.hippo-header button,
.hippo-header [type="button"] {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--hippo-ink) !important;
  font: inherit !important;
  padding: 0 !important;
  margin: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.hippo-header__burger {
  display: none !important;
  margin-left: auto;
  border: 0 !important;
  background: transparent !important;
  padding: 6px !important;
  cursor: pointer;
  color: var(--hippo-teal) !important;
  line-height: 0;
}

.hippo-header button.hippo-header__burger,
.hippo-header button.hippo-header__burger .ri-menu-3-line,
.hippo-header button.hippo-header__burger .ri-close-line {
  color: var(--hippo-teal) !important;
}

.hippo-header__burger .ri-menu-3-line,
.hippo-header__burger .ri-close-line {
  font-size: 28px;
  font-weight: 400 !important;
  line-height: 1;
  color: var(--hippo-teal) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.hippo-header__nav-utils {
  display: none;
}

.hippo-header__backdrop {
  display: none !important;
  position: fixed;
  width: 0;
  height: 0;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: hidden;
  pointer-events: none;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body:has(.hippo-header) .site-header,
body:has(.hippo-header) header.site-header,
body:has(.hippo-header) .ehf-header {
  display: none !important;
}

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  :root {
    --hippo-gutter: 16px;
  }

  .hippo-header__inner {
    column-gap: 12px;
  }

  .hippo-nav__link {
    font-size: 13px;
    padding: 0 7px;
  }

  .hippo-header__account span {
    display: none;
  }

  .hippo-header__logo img {
    height: 42px;
    max-width: 210px;
  }

  .hippo-header.is-scrolled .hippo-header__logo img {
    height: 36px;
  }

  .hippo-mega__inner {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    padding: 22px var(--hippo-gutter) 26px;
  }

  .hippo-mega__cols {
    flex: 1 1 auto;
    width: 100%;
  }

  .hippo-mega__col {
    max-width: none;
  }

  .hippo-mega__feature {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  :root {
    --hippo-header-h: 70px;
  }

  .hippo-header.is-scrolled {
    --hippo-header-h: 64px;
  }

  .hippo-header__inner {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .hippo-header__burger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    order: 3;
  }

  .hippo-header__logo {
    order: 1;
  }

  .hippo-header__logo img {
    height: 48px;
    max-width: 230px;
  }

  .hippo-header.is-scrolled .hippo-header__logo img {
    height: 42px;
  }

  .hippo-header__utils {
    order: 2;
    margin-left: auto;
    margin-right: 2px;
    gap: 4px;
  }

  /* Keep search + account avatar (icon only, no label) */
  .hippo-header__divider {
    display: none;
  }

  .hippo-header__account {
    display: inline-flex;
    padding: 6px;
  }

  .hippo-header__account span {
    display: none;
  }

  .hippo-header__icon-btn .ri-search-2-line,
  .hippo-header__account .ri-account-circle-line {
    font-size: 26px;
    width: 26px;
    height: 26px;
  }

  /* Full-width white drawer */
  .hippo-header__nav {
    position: fixed;
    top: var(--hippo-header-h);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    height: calc(100vh - var(--hippo-header-h));
    height: calc(100dvh - var(--hippo-header-h));
    background: var(--hippo-white) !important;
    border: 0;
    border-left: 0;
    box-shadow: none;
    padding: 8px 0 32px;
    display: block;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    z-index: 1001;
    justify-self: auto;
  }

  .admin-bar .hippo-header__nav {
    top: calc(var(--hippo-header-h) + 46px);
    height: calc(100dvh - var(--hippo-header-h) - 46px);
  }

  @media screen and (min-width: 783px) {
    .admin-bar .hippo-header__nav {
      top: calc(var(--hippo-header-h) + 32px);
      height: calc(100dvh - var(--hippo-header-h) - 32px);
    }
  }

  .hippo-header.is-open .hippo-header__nav {
    transform: translateX(0);
  }

  .hippo-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    height: auto;
  }

  .hippo-nav > .menu-item {
    display: block;
    border-bottom: 1px solid var(--hippo-line);
    height: auto;
  }

  .hippo-nav > .menu-item-has-mega,
  .hippo-nav > .menu-item-has-children {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .hippo-nav > .menu-item-has-mega > .hippo-nav__link,
  .hippo-nav > .menu-item-has-children > .hippo-nav__link {
    grid-column: 1;
    height: auto;
    padding: 14px 16px;
    font-size: 16px;
  }

  .hippo-nav > .menu-item-has-mega > .hippo-nav__submenu-toggle,
  .hippo-nav > .menu-item-has-children > .hippo-nav__submenu-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 0;
    background: transparent;
    color: var(--hippo-ink);
    cursor: pointer;
    grid-column: 2;
    grid-row: 1;
  }

  .hippo-nav > .menu-item-has-mega > .hippo-nav__link .hippo-nav__chevron {
    display: none;
  }

  .hippo-nav > .menu-item-has-mega > .hippo-nav__submenu-toggle .hippo-nav__chevron {
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .hippo-nav > .menu-item-has-mega.is-open > .hippo-nav__submenu-toggle .hippo-nav__chevron {
    transform: rotate(180deg);
  }

  .hippo-nav > .menu-item:not(.menu-item-has-mega) > .hippo-nav__link {
    padding: 14px 16px;
    font-size: 16px;
    height: auto;
    width: 100%;
  }

  /* Mega accordion: white bg + smooth height open/close */
  .hippo-mega {
    position: static;
    left: auto;
    right: auto;
    top: auto;
    display: grid !important;
    grid-template-rows: 0fr;
    opacity: 1;
    visibility: visible;
    pointer-events: none;
    transform: none;
    box-shadow: none;
    border: 0;
    border-top: 0;
    grid-column: 1 / -1;
    background: #ffffff;
    overflow: hidden;
    transition: grid-template-rows 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .hippo-mega > .hippo-mega__inner {
    min-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition:
      opacity 0.28s ease,
      transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .hippo-nav > .menu-item-has-mega.is-open > .hippo-mega {
    grid-template-rows: 1fr;
    pointer-events: auto;
    border-top: 1px solid var(--hippo-line);
  }

  .hippo-nav > .menu-item-has-mega.is-open > .hippo-mega > .hippo-mega__inner {
    opacity: 1;
    transform: translateY(0);
  }

  /* Don't open on hover/focus on touch devices */
  .hippo-nav > .menu-item-has-mega:hover > .hippo-mega,
  .hippo-nav > .menu-item-has-mega:focus-within > .hippo-mega {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .hippo-nav > .menu-item-has-mega:not(.is-open):hover > .hippo-mega,
  .hippo-nav > .menu-item-has-mega:not(.is-open):focus-within > .hippo-mega {
    grid-template-rows: 0fr;
    pointer-events: none;
  }

  /* Stacked single-column mobile mega (pro layout) */
  .hippo-header .hippo-mega__inner {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 22px !important;
    padding: 16px 20px 24px !important;
    max-width: none !important;
    width: 100% !important;
    box-sizing: border-box;
    background: #ffffff;
  }

  .hippo-header .hippo-mega__cols {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 20px !important;
    width: 100% !important;
    min-width: 0;
  }

  .hippo-header .hippo-mega__col {
    flex: 0 0 auto !important;
    max-width: none !important;
    width: 100% !important;
  }

  .hippo-header .hippo-mega__col-title {
    margin: 0 0 10px;
    font-size: 11px;
  }

  .hippo-header .hippo-mega__links {
    gap: 0;
  }

  .hippo-header .hippo-mega__links a {
    display: block;
    padding: 10px 0;
    font-size: 15px;
    line-height: 1.35;
    border-bottom: 1px solid var(--hippo-line);
  }

  .hippo-header .hippo-mega__links li:last-child a {
    border-bottom: 0;
    padding-bottom: 2px;
  }

  .hippo-header .hippo-mega__feature {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
    padding: 16px 18px;
    background: #f3f8f9;
    border-radius: 12px;
    margin-top: 4px;
  }

  .hippo-header .hippo-mega__feature-title {
    font-size: 17px;
  }

  .hippo-header .hippo-mega__feature-text {
    font-size: 14px;
    margin-bottom: 12px;
  }

  /* Search / login live in the header bar — not inside the drawer */
  .hippo-header__nav-utils {
    display: none !important;
  }

  /* Full-width panel covers the page; no dimmed backdrop needed */
  .hippo-header__backdrop {
    display: none !important;
  }

  body.hippo-nav-open {
    overflow: hidden;
  }
}

@media (max-width: 420px) {
  .hippo-header__logo img {
    height: 42px;
    max-width: 200px;
  }
}
