/* ANOPEDIA 1.7.8 · Brand scale & navigation coherence.
   Keep logo artwork, color variants, and accessible hit targets intact. */

:root { --anopedia-header-logo: 282px; }
.site-header .header-inner {
  min-height: 70px;
}
.site-header .anopedia-brand {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  margin-right: auto;
}
.site-header .anopedia-brand .anopedia-brand-image {
  width: min(var(--anopedia-header-logo), 30vw);
  max-width: 100%;
  max-height: 56px;
  height: auto;
  object-fit: contain;
  object-position: left center;
  filter: none !important;
}

/* Make the footer logo recognizable but subordinate to the content. */
.ed-footer .anopedia-footer-logo {
  width: min(292px,100%);
  max-width: 100%;
}
.ed-footer .anopedia-footer-logo .anopedia-footer-image {
  display: none;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: none !important;
}
html:not([data-theme="dark"]) .ed-footer .anopedia-footer-logo .anopedia-footer-light,
html[data-theme="dark"] .ed-footer .anopedia-footer-logo .anopedia-footer-dark {
  display: block;
}

/* Drawer shares the compact logo with the mobile header. */
.ed-drawer .drawer-heading {
  min-height: 74px;
  padding: 13px 17px 13px 21px;
  gap: 8px;
}
.ed-drawer a.drawer-brand.anopedia-drawer-brand {
  display: flex;
  min-width: 0;
  max-width: calc(100% - 52px);
  flex: 1 1 auto;
  align-items: center;
  overflow: hidden;
}
.ed-drawer .anopedia-drawer-image,
.ed-drawer a.drawer-brand.anopedia-drawer-brand .anopedia-drawer-image {
  display: none;
  width: min(194px,100%);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: left center;
  filter: none !important;
  flex: 0 1 auto;
}
html:not([data-theme="dark"]) .ed-drawer .anopedia-drawer-light,
html[data-theme="dark"] .ed-drawer .anopedia-drawer-dark,
html:not([data-theme="dark"]) .ed-drawer a.drawer-brand.anopedia-drawer-brand .anopedia-drawer-light,
html[data-theme="dark"] .ed-drawer a.drawer-brand.anopedia-drawer-brand .anopedia-drawer-dark {
  display: block;
}
.ed-drawer .drawer-heading .drawer-close {
  flex: 0 0 44px;
}
.anopedia-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media(max-width: 980px) {
  .site-header .header-inner { min-height: 64px; }
}
@media(max-width: 700px) {
  .site-header .header-inner {
    min-height: 60px;
    gap: 6px;
  }
  .site-header .anopedia-brand {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    padding: 0;
    margin-right: 0;
  }
  .site-header .anopedia-brand .anopedia-brand-image {
    width: min(164px,100%);
    max-width: 100%;
    max-height: 36px;
    height: auto;
  }
  /* Touch targets stay at 44px even though the wordmark is visually smaller. */
  .site-header #menu-button,
  .site-header #search-button,
  .site-header #theme-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    flex: 0 0 44px;
  }
  .site-header .header-actions { gap: 2px; }
  .ed-footer .anopedia-footer-logo { width: min(246px,100%); }
}
@media(max-width: 370px) {
  .site-header .header-inner {gap: 4px;}
  .site-header .header-actions {gap: 0;}
  .site-header .anopedia-brand .anopedia-brand-image {width: min(152px,100%);}
  .ed-drawer .drawer-heading {padding-left: 16px;padding-right: 12px;}
}
