/* Sitewide header standard v3:
   - Header is not fixed or sticky; it scrolls away normally.
   - Desktop/tablet places the logo in the upper-left brand area and the larger title to its right.
   - Small screens collapse to a compact Home + Menu row.
   - Stream colours can later be controlled by CSS variables. */
:root {
  --standard-header-bg: #f7f1e6;
  --standard-header-bg-soft: #fbf7ef;
  --standard-header-border: #e7d8bd;
  --standard-header-text: #2e251d;
  --standard-header-muted: #776b5f;
  --standard-header-hover: #f1d9aa;
}

html {
  scroll-behavior: smooth;
}

.sitewide-header-standard {
  position: static;
  top: auto;
  z-index: auto;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.72), transparent 18%),
    radial-gradient(circle at 58% 45%, rgba(232, 201, 140, 0.18), transparent 34%),
    linear-gradient(180deg, var(--standard-header-bg-soft), var(--standard-header-bg));
  border-bottom: 1px solid var(--standard-header-border);
  box-shadow: 0 8px 28px rgba(74, 55, 28, 0.06);
}

.sitewide-header-standard .desktop-header-row {
  display: grid;
  grid-template-columns: minmax(520px, 0.82fr) minmax(720px, 1.18fr);
  align-items: start;
  gap: clamp(1.5rem, 2.5vw, 3rem);
  padding: clamp(1.1rem, 2.2vw, 2.15rem) 0 clamp(1.3rem, 2.3vw, 2.35rem);
}

.sitewide-header-standard .brand-copy {
  display: flex;
  align-items: flex-start;
  gap: clamp(1.35rem, 2.2vw, 2.45rem);
  min-width: 0;
}

.sitewide-header-standard .header-logo-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 0;
}

.sitewide-header-standard .header-logo {
  width: clamp(132px, 12.6vw, 210px);
  height: clamp(132px, 12.6vw, 210px);
  object-fit: contain;
  border-radius: clamp(20px, 2vw, 34px);
  box-shadow: 0 16px 34px rgba(19, 35, 56, 0.16);
}

.sitewide-header-standard .brand-text {
  min-width: 0;
  padding-top: clamp(0.8rem, 2.05vw, 2.35rem);
}

.sitewide-header-standard .brand-title {
  margin: 0;
  line-height: 1.02;
  font-size: clamp(2.35rem, 3.25vw, 4.35rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.sitewide-header-standard .brand-sub {
  max-width: 640px;
  margin-top: clamp(0.72rem, 1.3vw, 1.2rem);
  color: var(--standard-header-muted);
  font-size: clamp(1.13rem, 1.45vw, 1.82rem);
  line-height: 1.42;
}

.sitewide-header-standard .site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: stretch;
  gap: 0.48rem;
  width: 100%;
  max-width: 1260px;
  margin-left: auto;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.sitewide-header-standard .site-nav > a,
.sitewide-header-standard .site-nav > details > summary {
  display: flex;
  align-items: center;
  min-height: 3.28rem;
  padding: 0.62rem 1.15rem;
  color: var(--standard-header-text);
  text-decoration: none;
  border: 1px solid rgba(231, 216, 189, 0.86);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.82);
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255,255,255,0.72) inset;
}

.sitewide-header-standard .site-nav > a:hover,
.sitewide-header-standard .site-nav > details > summary:hover,
.sitewide-header-standard .site-nav > details[open] > summary {
  background: var(--standard-header-hover);
}

.sitewide-header-standard .site-nav > details {
  position: relative;
}

.sitewide-header-standard .site-nav > details > summary {
  cursor: pointer;
  list-style: none;
}

.sitewide-header-standard .site-nav > details > summary::-webkit-details-marker {
  display: none;
}

.sitewide-header-standard .site-nav > details > summary::after {
  content: "⌄";
  margin-left: 0.55rem;
  font-size: 0.8em;
  opacity: 0.72;
}

.sitewide-header-standard .site-nav > details > div {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  min-width: 250px;
  padding: 0.35rem;
  border: 1px solid var(--standard-header-border);
  border-radius: 16px;
  background: #fffaf1;
  box-shadow: 0 18px 42px rgba(47, 34, 18, 0.16);
}

.sitewide-header-standard .site-nav > details > div a {
  display: block;
  padding: 0.7rem 0.85rem;
  color: var(--standard-header-text);
  text-decoration: none;
  border-radius: 11px;
}

.sitewide-header-standard .site-nav > details > div a:hover {
  background: var(--standard-header-hover);
}

.sitewide-header-standard .mobile-header-row {
  display: none;
}

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.2rem;
  min-height: 3.2rem;
  padding: 0.72rem 0.95rem;
  border: 1px solid #d8c39d;
  border-radius: 999px;
  background: #fffaf0;
  color: #2e251d;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 14px 34px rgba(47, 34, 18, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease, background 180ms ease;
}

.back-to-top:hover {
  background: #f1d9aa;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 1360px) {
  .sitewide-header-standard .desktop-header-row {
    grid-template-columns: minmax(455px, 0.8fr) minmax(590px, 1.2fr);
    gap: 1.35rem;
  }

  .sitewide-header-standard .site-nav {
    gap: 0.38rem;
  }

  .sitewide-header-standard .site-nav > a,
  .sitewide-header-standard .site-nav > details > summary {
    padding-left: 0.88rem;
    padding-right: 0.88rem;
  }
}

@media (max-width: 1120px) {
  .sitewide-header-standard .desktop-header-row {
    grid-template-columns: 1fr;
  }

  .sitewide-header-standard .brand-copy {
    justify-content: center;
  }

  .sitewide-header-standard .site-nav {
    justify-content: center;
    margin-right: auto;
  }
}

@media (max-width: 860px) {
  .sitewide-header-standard .desktop-header-row {
    display: none;
  }

  .sitewide-header-standard .mobile-header-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 3.2rem;
    padding: 0.48rem 0;
  }

  .sitewide-header-standard .mobile-home-link,
  .sitewide-header-standard .mobile-menu > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.3rem;
    padding: 0.42rem 0.8rem;
    border: 1px solid var(--standard-header-border);
    border-radius: 999px;
    background: rgba(255, 253, 247, 0.86);
    color: var(--standard-header-text);
    text-decoration: none;
    font-weight: 700;
    line-height: 1;
  }

  .sitewide-header-standard .mobile-menu > summary {
    cursor: pointer;
    list-style: none;
  }

  .sitewide-header-standard .mobile-menu > summary::-webkit-details-marker {
    display: none;
  }

  .sitewide-header-standard .mobile-menu-panel {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 80;
    display: grid;
    width: min(88vw, 360px);
    max-height: 72vh;
    overflow: auto;
    padding: 0.55rem;
    border: 1px solid var(--standard-header-border);
    border-radius: 18px;
    background: #fffaf1;
    box-shadow: 0 20px 46px rgba(47, 34, 18, 0.22);
  }

  .sitewide-header-standard .mobile-menu-panel a {
    display: block;
    padding: 0.74rem 0.8rem;
    border-radius: 12px;
    color: var(--standard-header-text);
    text-decoration: none;
    font-weight: 650;
  }

  .sitewide-header-standard .mobile-menu-panel a:hover {
    background: var(--standard-header-hover);
  }

  .back-to-top {
    right: 0.85rem;
    bottom: 0.85rem;
    min-width: 2.85rem;
    min-height: 2.85rem;
    padding: 0.62rem 0.78rem;
  }
}

@media print {
  .back-to-top {
    display: none;
  }
}

/* Optional approved stream colour variables. The structure remains identical everywhere. */
body.stream-ot-commentary {
  --standard-header-bg: #f7f1e6;
  --standard-header-bg-soft: #fbf7ef;
  --standard-header-border: #e7d8bd;
  --standard-header-hover: #f1d9aa;
}

body.stream-nt-commentary {
  --standard-header-bg: #eef4f7;
  --standard-header-bg-soft: #f7fbfd;
  --standard-header-border: #bfd3df;
  --standard-header-hover: #dcebf2;
}

body.stream-ot-lite,
body.stream-nt-lite {
  --standard-header-bg: #f4efe7;
  --standard-header-bg-soft: #fbf8f1;
  --standard-header-border: #dccab0;
  --standard-header-hover: #ead9bd;
}

body.stream-kingdom-perspective {
  --standard-header-bg: #f0f4e9;
  --standard-header-bg-soft: #f8fbf2;
  --standard-header-border: #c8d4b4;
  --standard-header-hover: #dfe8cf;
}

body.stream-dictionary,
body.stream-lexicon {
  --standard-header-bg: #f3efe8;
  --standard-header-bg-soft: #fbf8f1;
  --standard-header-border: #d9c8aa;
  --standard-header-hover: #ead9bd;
}

body.stream-doctrines {
  --standard-header-bg: #f2eee8;
  --standard-header-bg-soft: #fbf8f2;
  --standard-header-border: #d9c8b2;
  --standard-header-hover: #ead9c6;
}

body.stream-blog,
body.stream-reviews,
body.stream-charts,
body.stream-tools,
body.stream-prompts,
body.stream-pages,
body.stream-bible-text,
body.stream-default {
  --standard-header-bg: #f7f1e6;
  --standard-header-bg-soft: #fbf7ef;
  --standard-header-border: #e7d8bd;
  --standard-header-hover: #f1d9aa;
}

