
/* ==========================================
   BECKINGHAM — SHARED HEADER
   Navigation and page-heading layout
   ========================================== */

/* 1. NAVIGATION */

#site-header {
  font-family: var(--font-ui, Arial, Helvetica, sans-serif);
}

#site-header .site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 22px;

  margin: 0;
  padding: 16px 0 14px;

  border: 0;
  border-bottom: 1px solid var(--line, #e2e2da);
  border-radius: 0;

  background: transparent;
  box-shadow: none;
}

/* Site name */

#site-header .site-name {
  color: var(--ink, #293731);
  font: 400 20px/1.4 var(--font-reading, Georgia, serif);
  text-decoration: none;
}

/* Navigation links */

#site-header .site-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

#site-header .site-links a {
  padding: 0 0 5px;
  border-bottom: 2px solid transparent;

  color: var(--accent, #557669);
  font: 400 14px/1.5 var(--font-ui, Arial, sans-serif);
  text-decoration: none;
}

#site-header .site-links a:hover,
#site-header .site-links a:focus-visible {
  color: var(--ink, #293731);
}

/* Active page */

#site-header .site-links a[aria-current="page"] {
  color: var(--ink, #293731);
  border-bottom-color: var(--accent, #557669);
}

/* 2. SHARED PAGE-HEADING SPACING */

/*
   Reserves a consistent artwork area above page headings.

   Works with:
   .header-art
   .header-sprig
   .music-art

   Pages without artwork retain the same spacing.
*/

body > header:has(> .header-eyebrow) {
  --heading-top-gap: clamp(18px, 3.5vh, 30px);
  --heading-art-height: clamp(36px, 5.5vh, 50px);
  --heading-art-gap: clamp(10px, 1.7vh, 16px);

  position: relative;
  margin-top: 0;

  padding-top: calc(
    var(--heading-top-gap) +
    var(--heading-art-height) +
    var(--heading-art-gap)
  );
}

/* Decorative artwork */

body > header:has(> .header-eyebrow)
  > :is(.header-art, .header-sprig, .music-art, .collection-art) {
  position: absolute;
  top: var(--heading-top-gap);
  left: 0;

  display: block;
  width: 132px;
  height: var(--heading-art-height);
  margin: 0;

  object-fit: contain;
  object-position: left center;
}

/* Eyebrow alignment */

body > header:has(> .header-eyebrow)
  > .header-eyebrow {
  margin-top: 0;
}

/* 3. RESPONSIVE NAVIGATION */

@media (max-width: 650px) {

  #site-header .site-nav {
    padding: 13px 0 12px;
    gap: 10px 14px;
  }

  #site-header .site-name {
    font-size: 19px;
  }

  #site-header .site-links {
    gap: 14px;
  }

  #site-header .site-links a {
    font-size: 13px;
  }

  /* Smaller artwork and heading spacing */

  body > header:has(> .header-eyebrow) {
    --heading-top-gap: 18px;
    --heading-art-height: 38px;
    --heading-art-gap: 10px;
  }

  body > header:has(> .header-eyebrow)
    > :is(.header-art, .header-sprig, .music-art, .collection-art) {
    width: 108px;
  }
}

/* Very narrow screens */

@media (max-width: 390px) {

  #site-header .site-nav {
    align-items: flex-start;
  }

  #site-header .site-links {
    gap: 11px;
  }

  #site-header .site-links a {
    font-size: 12px;
  }
}

/* 4. PRINT */

@media print {

  #site-header {
    display: none;
  }

  body > header:has(> .header-eyebrow) {
    padding-top: 0;
  }

  body > header:has(> .header-eyebrow)
    > :is(.header-art, .header-sprig, .music-art, .collection-art) {
    display: none;
  }
}

/* Glimpses's smaller camera uses the same heading baseline as the other sections. */
body.glimpses-page > header.collection-header > .collection-art {
  width: 80px;
}
@media (max-width: 650px) {
  body.glimpses-page > header.collection-header > .collection-art {
    width: 72px;
  }
}


/* SHARED COPYRIGHT FOOTER --------------------------------------------
   Static on all pages so credits do not depend on /header.js?v=20261126glimpses1 uploading.
   All typography and spacing are still controlled in this single file.
   ------------------------------------------------------------------- */
.site-copyright {
  margin: 56px 0 0;
  padding: 23px 0 0;
  border-top: 1px solid var(--line, #e2e2da);
  color: var(--muted, #65766c);
  font: 12px/1.65 var(--font-ui, Arial, Helvetica, sans-serif);
  text-align: left;
}
.site-copyright p {
  margin: 0;
}
.site-copyright .site-copyright-rights {
  margin-top: 5px;
  font-size: 11px;
  opacity: .85;
}
@media (max-width: 650px) {
  .site-copyright { margin-top: 42px; padding-top: 20px; }
}
@media print {
  .site-copyright { margin-top: 28px; padding-top: 12px; }
}


/* Section-specific ownership / acknowledgements appear before the copyright line. */
.site-copyright .site-section-credit { margin:0 0 12px; max-width:var(--reading-width,690px); font-size:13px; line-height:1.65; }
.site-copyright .site-section-credit strong { color:var(--ink); }
.site-copyright .site-section-credit a { color:var(--accent-dark); }

/* Consolidated collection credits: open by default, collapsible by visitor */
.collection-credits { max-width:760px; margin:0 0 30px; padding:0 0 20px; border:0; border-bottom:1px solid var(--line); color:var(--muted); }
.collection-credits summary { width:fit-content; cursor:pointer; color:var(--accent-dark); font:600 14px/1.5 var(--font-ui); letter-spacing:.015em; }
.collection-credits summary:hover { text-decoration:underline; text-underline-offset:4px; }
.collection-credits__body { padding-top:8px; }
.collection-credits__body p { margin:10px 0; font:14px/1.7 var(--font-ui); }
.collection-credits__body strong { color:var(--ink); }
.site-copyright .site-copyright-attribution { font:13px/1.6 var(--font-ui); color:var(--muted); text-align:center; }
/* Small, restrained navigation response */
.site-links a { transition:color .2s ease,text-decoration-color .2s ease; text-decoration-color:transparent; text-underline-offset:5px; }
.site-links a:hover { text-decoration:underline; text-decoration-color:var(--accent); }
@media(prefers-reduced-motion:reduce) { .site-links a { transition:none; } }

/* Bring content into view sooner, especially on shorter laptop displays.
   A collection without header artwork must not reserve an empty artwork box. */
body > header.collection-header:has(> .header-eyebrow):not(:has(> :is(.header-art, .header-sprig, .music-art, .collection-art))) {
  padding-top: clamp(22px, 4vh, 38px);
}
body > header.collection-header {
  padding-bottom: clamp(15px, 2.8vh, 27px);
}
body > header.collection-header .header-eyebrow { margin-bottom: 13px; font-size: 12px; }
body > header.collection-header h1 { margin-bottom: 12px; }
body > header.collection-header p:not(.header-eyebrow):not(.archive-meta) { line-height: 1.58; font-size: clamp(16px, 1.75vw, 19px); }
body > header.collection-header .collection-description { max-width: 65ch; }
@media (max-height:720px) and (min-width:651px) {
  body > header.collection-header:has(> .header-eyebrow) {
    --heading-top-gap: 18px;
    --heading-art-height: 34px;
    --heading-art-gap: 8px;
  }
  body > header.collection-header { padding-bottom: 15px; }
  body > header.collection-header h1 { font-size: clamp(34px, 4.4vw, 47px); }
}
@media (max-width:650px) {
  body > header.collection-header .header-eyebrow { font-size: 11px; margin-bottom: 10px; }
  body > header.collection-header h1 { margin-bottom: 10px; }
  body > header.collection-header:has(> .header-eyebrow):not(:has(> :is(.header-art, .header-sprig, .music-art, .collection-art))) {
    padding-top: 23px;
  }
}

/* Single iconography system on the five collection landing pages.
   One accent, one visual weight; the site-wide colours stay unchanged. */
body > header.collection-header .collection-mark {
  display:grid; place-items:center; width:58px; height:58px; margin:0 0 14px;
  border-radius:14px; background:var(--accent-light,#edf3ec); color:var(--accent-dark,#365e52);
}
body > header.collection-header .collection-mark svg { width:40px; height:40px; display:block; overflow:visible; }
body > header.collection-header:has(.collection-mark) { padding-top:clamp(23px,4vh,36px); }
@media(max-height:720px) and (min-width:651px) {
 body > header.collection-header .collection-mark { width:50px; height:50px; margin-bottom:9px; border-radius:12px; }
 body > header.collection-header .collection-mark svg { width:36px; height:36px; }
}
@media(max-width:650px) {
 body > header.collection-header .collection-mark { width:52px; height:52px; margin-bottom:11px; }
 body > header.collection-header .collection-mark svg { width:37px; height:37px; }
}

/* Interior-page reading navigation — same solid paper as the homepage.
   No blur or floating drop shadow; the nav's fine divider remains visible. */
body:not(.home-page) #site-header {
  position: sticky;
  top: 0;
  z-index: 105;
  background: var(--paper, #f8f7f3);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
body:not(.home-page) #site-header.is-scrolled {
  background: var(--paper, #f8f7f3);
  box-shadow: none;
}
body:not(.home-page) #site-header.is-scrolled .site-nav {
  border-bottom-color: rgba(85, 118, 105, .2);
}
/* Separate transitions avoid font-size reflow feeling abrupt, especially on phones.
   Specificity also protects the easing from shared site-polish rules loaded later. */
body:not(.home-page) #site-header .site-nav {
  transition: padding 410ms cubic-bezier(.22, 1, .36, 1),
              gap 410ms cubic-bezier(.22, 1, .36, 1),
              border-color 300ms ease;
}
body:not(.home-page) #site-header .site-name {
  transition: font-size 410ms cubic-bezier(.22, 1, .36, 1),
              color 410ms cubic-bezier(.22, 1, .36, 1);
}
body:not(.home-page) #site-header .site-links a {
  transition: font-size 410ms cubic-bezier(.22, 1, .36, 1),
              color 410ms cubic-bezier(.22, 1, .36, 1),
              border-color 270ms ease;
}
body:not(.home-page) #site-header.is-scrolled .site-nav {
  padding-block: 9px;
  gap: 9px 18px;
}
body:not(.home-page) #site-header.is-scrolled .site-name {
  font-size: 18px;
  color: #56695f;
}
body:not(.home-page) #site-header.is-scrolled .site-links a {
  font-size: 13px;
  color: #78897f;
}
body:not(.home-page) #site-header .site-links a[aria-current="page"] {
  color: var(--accent-dark, #365e52);
  border-bottom-color: var(--accent, #557669);
  opacity: 1;
}
body:not(.home-page) #site-header.is-scrolled .site-links a:hover,
body:not(.home-page) #site-header.is-scrolled .site-links a:focus-visible {
  color: var(--ink, #293731);
}
/* Anchor targets, including sections within the long Scripture study, remain visible. */
html { scroll-padding-top: calc(var(--sticky-header-height, 72px) + 18px); }
body:not(.home-page) [id] { scroll-margin-top: calc(var(--sticky-header-height, 72px) + 14px); }
@media (max-width: 650px) {
  body:not(.home-page) #site-header .site-nav { gap: 7px; }
  body:not(.home-page) #site-header .site-name { flex-shrink: 0; }
  body:not(.home-page) #site-header .site-links {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  body:not(.home-page) #site-header .site-links::-webkit-scrollbar { display: none; }
  body:not(.home-page) #site-header .site-links a { flex-shrink: 0; white-space: nowrap; }
  body:not(.home-page) #site-header.is-scrolled .site-nav { padding-block: 8px; }
  body:not(.home-page) #site-header.is-scrolled .site-links a { font-size: 12px; }
  /* The site name is useful at the top, but on scroll the navigation alone
     remains. Keep the name available again when returning to the top. */
  body:not(.home-page) #site-header .site-name {
    display: block;
    max-height: 36px;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    transition: max-height 310ms cubic-bezier(.22,1,.36,1),
                opacity 180ms ease, visibility 0s;
  }
  body:not(.home-page) #site-header.is-scrolled .site-name {
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: max-height 310ms cubic-bezier(.22,1,.36,1),
                opacity 145ms ease, visibility 0s 310ms;
  }
  body:not(.home-page) #site-header.is-scrolled .site-nav {
    gap: 0;
    padding-block: 5px;
  }
  /* Preserve comfortable tap targets even in the reduced-height bar. */
  body:not(.home-page) #site-header.is-scrolled .site-links a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding-block: 0;
  }
  /* Same compact single-row mobile navigation as the homepage. */
  body:not(.home-page) #site-header .site-links {
    justify-content: space-between;
    gap: clamp(2px, 1vw, 8px);
    overflow-x: visible;
  }
  body:not(.home-page) #site-header .site-links a,
  body:not(.home-page) #site-header.is-scrolled .site-links a {
    font-size: clamp(11px, 3.15vw, 13px);
    line-height: 1.3;
    letter-spacing: -.012em;
  }
}
@media (prefers-reduced-motion: reduce) {
  body:not(.home-page) #site-header,
  body:not(.home-page) #site-header .site-nav,
  body:not(.home-page) #site-header .site-name,
  body:not(.home-page) #site-header.is-scrolled .site-name,
  body:not(.home-page) #site-header .site-links a { transition: none; }
}
@media print {
  body:not(.home-page) #site-header {
    position: static;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Unified, discreet footer navigation. Section-specific credits stay above it. */
.site-copyright .site-footer-links {
  display: flex; flex-wrap: wrap; align-items: center; justify-content:center;
  gap: 7px 21px; margin: 0 0 13px; text-align:center;
  font: 600 12px/1.7 var(--font-ui, Arial, Helvetica, sans-serif);
}
.site-copyright .site-footer-links a {
  display: inline-block; padding: 3px 0; color: var(--accent-dark, #365e52);
  text-decoration: none; text-underline-offset: 4px;
}
.site-copyright .site-footer-links a:hover,
.site-copyright .site-footer-links a[aria-current="page"] {
  text-decoration: underline;
}
.site-copyright .site-footer-links a:focus-visible {
  outline: 2px solid var(--accent-dark, #365e52); outline-offset: 4px; border-radius: 2px;
}
.site-copyright .collection-credits[id] { scroll-margin-top: calc(var(--sticky-header-height, 72px) + 18px); }
@media(max-width: 650px) { .site-copyright .site-footer-links { gap: 5px 17px; } }
@media print { .site-copyright .site-footer-links { display: none; } }
