/* Faint pencil-sketch lighthouse, locked to the left side of the site.
   Does not scroll with the page.
   Media ID 2669 (staging, v4): /wp-content/uploads/2026/11/cwp-lighthouse-sketch-v4.png
   Source: a clean hand-drawn graphite sketch (not a photo filter). White
   paper mapped to fully transparent; the tower is left-aligned in the PNG
   so it still shows in the left margin at 1280px. Dune and sea-oat grass
   at the base are kept. Original photos were not changed.
   Media 2661 (v1), 2663 (v2) and 2666 (v3) were kept and are unused.
   Faintness is baked into the PNG (about 22% peak ink on transparent).
   Do not also lower opacity on desktop, or it will disappear.
   Use a position:fixed pseudo-element — not background-attachment:fixed,
   which is buggy on iOS.

   Loaded sitewide by Cesar's mu-plugin (cwp-sitewide-css.php →
   wp-content/cwp-sitewide.css). The homepage-only body.home::before copy
   was removed from page 78 so the sketch is not styled twice.

   The sketch starts below the header (measured height + 12px gap) so the
   lantern is visible when the page is scrolled all the way up. The Astra
   header is not sticky, so that same offset remains at mid-scroll.
   z-index stays 0: #page/.site are z-index 1 so content stays clickable.
   The header and hero have opaque backgrounds and would hide the sketch;
   the left margin of the page is transparent, so the tower shows there.

   Header heights measured on staging (America/New_York, 2026-11-20):
     922px and up: 231px (58 above-bar + 173 primary)
     768–921px: 248px
     767px and below: 265px
   Header heights were not changed (the larger logo is kept).

   Primary menu: Astra auto-sets top-level item line-height to the primary
   header height minus padding (152px), so submenus (top: 100%) open at the
   bottom of the logo row, far below the label. The rules below keep the
   tall logo row, vertically center the shorter items, and open each
   submenu directly under its parent. This must be sitewide — please sync.

   Single posts paint #content / .site-content opaque white full-width,
   which hides the sketch; those backgrounds are made transparent below
   (the body is already white). Please sync this too.
*/
body {
  --cwp-sketch-top: 243px; /* header 231px + 12px gap, 922px and up */
}
@media (max-width: 921px) {
  body { --cwp-sketch-top: 260px; } /* header 248px + 12px */
}
@media (max-width: 767px) {
  body { --cwp-sketch-top: 277px; } /* header 265px + 12px */
}

body::before {
  content: "";
  position: fixed;
  left: 0;
  top: var(--cwp-sketch-top);
  width: 35vw;
  max-width: 520px;
  height: calc(100vh - var(--cwp-sketch-top));
  pointer-events: none;
  z-index: 0;
  background-image: url("/wp-content/uploads/2026/11/cwp-lighthouse-sketch-v4.png");
  background-repeat: no-repeat;
  background-position: left top;
  background-size: auto 100%;
}

/* Keep the site content above the sketch so it never intercepts clicks. */
body #page,
body .site {
  position: relative;
  z-index: 1;
}

/* Single posts (e.g. a devotion) give #content / .site-content an opaque
   white background that covers the full width and hides the sketch. The
   body is already white, so making these transparent lets the sketch show
   in the left margin the same way it does on the homepage and About. */
body #content,
body .site-content {
  background-color: transparent;
}

@media (max-width: 767px) {
  body::before {
    width: 42vw;
    opacity: 0.4; /* already-faint PNG; even quieter on small screens */
  }
}

/* Desktop primary menu: keep the tall logo row; don't stretch items to it. */
@media (min-width: 922px) {
  .ast-desktop:not(:has(.ast-header-sticked)) .ast-primary-header-bar .main-header-menu > .menu-item {
    line-height: normal;
    height: auto;
  }
  .ast-desktop .ast-primary-header-bar .main-header-menu > .menu-item > .menu-link {
    height: auto;
    line-height: 1.4;
    display: flex;
    align-items: center;
  }
  .ast-desktop .ast-primary-header-bar .ast-builder-menu-1,
  .ast-desktop .ast-primary-header-bar .main-header-menu {
    align-items: center;
    height: 100%;
  }
  .ast-desktop .ast-primary-header-bar .main-header-menu > .menu-item > .sub-menu {
    top: 100%;
    margin-top: 0;
  }
  /* Bridge a sub-pixel gap so hover isn't lost on the way into the submenu. */
  .ast-desktop .ast-primary-header-bar .main-header-menu > .menu-item > .sub-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 8px;
  }
}


/* Today's Devotion top-bar link: Header HTML strips style tags and
   onmouseover, so hover/focus underline lives here. Color matches the bar text.
   Default text-decoration is none in CSS (not inline) so :hover can override it. */
.ast-header-html-1 a {
  color: #e8f2f7;
  text-decoration: none;
}
.ast-header-html-1 a:hover,
.ast-header-html-1 a:focus {
  color: #e8f2f7;
  text-decoration: underline;
}

@media (max-width: 921px) {
  /* Stack the Today's Devotion link above the utility menu on small screens
     so it is not squeezed into a narrow column. */
  .ast-header-break-point .ast-above-header-bar .site-header-above-section-center {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .ast-header-break-point .ast-above-header-bar .site-header-above-section-center .ast-header-html-1 {
    justify-content: center;
    width: 100%;
    padding: 8px 16px 4px;
  }
  .ast-header-break-point .ast-above-header-bar .site-header-above-section-center .ast-header-html-1 a {
    white-space: nowrap;
  }
}
