/* ==== HEADER start ==== */
/* ============================================================================
   RA · SITE-WIDE HEADER (ONLY) · delta
   Theme Settings > Custom CSS. Append AFTER the shared .rapdp stylesheet.
   Cut from "RA - Header (Only).dc.html" · 2026-08-17
   ----------------------------------------------------------------------------
   Keep the two ==== HEADER ==== markers. They are how this block is found and
   replaced later without disturbing the PDP, HOME, NEWSLETTER and CHROME blocks
   in the same box. Replace between the markers, never the whole box.

   THIS SUPERSEDES THE HEADER HALF OF THE CHROME BLOCK. If the CHROME block is
   installed, either delete its header rules (README section 3 lists them by
   number) or leave them: this block is appended after it and wins on order.
   The footer half of CHROME is untouched and must stay.

   PAGE-NEUTRAL BY CONSTRUCTION. Every selector is scoped
   .rapdp[data-chrome="header"]. No rule here may depend on which page it is
   rendering on. ONE UNSCOPED RULE EXISTS, in section 2, and it is flagged.
   ============================================================================ */

/* ---------------------------------------------------------------------------
   1 · UNDOING THE SHARED SHEET'S PAGE ASSUMPTIONS  ·  READ THIS FIRST
   The shared .rapdp rule was written when exactly one .rapdp root existed per
   page. A PDP now carries three, and two of its declarations are wrong for a
   chrome partial.
   --------------------------------------------------------------------------- */

/* a) padding-bottom:40px. Harmless once per page, absurd three times: it puts
      40px of dead sand under the header, above the page's first section. */
.rapdp[data-chrome="header"] { padding-bottom: 0; }

/* b) overflow-x:hidden. THE ONE THAT SHIPS BROKEN IF THIS RULE IS MISSING.
      overflow-x:hidden computes overflow-y to auto, which makes the element a
      scroll container, and position:sticky only sticks within its nearest
      scroll container. On Home that container was the whole page, so the sticky
      header worked by accident. Here the root is only as tall as the header, so
      sticky has nowhere to stick and the header simply scrolls away.

      overflow-x:clip suppresses the horizontal scrollbar from the shared
      sheet's 100vw breakout WITHOUT creating a scroll container. A browser too
      old for `clip` drops the declaration and falls back to `visible`, which is
      correct but can expose a horizontal scrollbar; the fix then is
      html{overflow-x:hidden} at the theme level, not reinstating it here. */
.rapdp[data-chrome="header"] { overflow: visible; overflow-x: clip; }

/* ---------------------------------------------------------------------------
   2 · STICKY HEADER AND ANCHOR LANDINGS
   The header sticks. An in-page anchor such as /store/#courses would otherwise
   land underneath it. scroll-padding-top belongs on the scrolling element, and
   that element is <html>, which cannot be scoped under .rapdp. This is the ONLY
   unscoped rule in the file. Value = topbar (about 43px) + header (14 + 76 + 14)
   + air. Reduce it if the utility bar is ever removed.
   IF THE CHROME BLOCK IS STILL INSTALLED, this rule is already in it. Two
   identical declarations are harmless; do not "fix" one to a different number.
   --------------------------------------------------------------------------- */
html { scroll-padding-top: 160px; }

/* ---------------------------------------------------------------------------
   3 · SKIP LINK
   Targets #ra-main, which JKM adds to the role="main" element. First focusable
   element on every page. Until that ID lands it focuses nothing, which is a
   pending task, not a defect in this package.
   --------------------------------------------------------------------------- */
.rapdp[data-chrome="header"] [data-skip] { position: absolute; left: -9999px; top: 0; z-index: 200; }
.rapdp[data-chrome="header"] [data-skip]:focus,
.rapdp[data-chrome="header"] [data-skip]:focus-visible { left: 0; }

/* ---------------------------------------------------------------------------
   4 · FOCUS RINGS (WCAG 2.2 AA · 2.4.13)
   Oxblood on sand (about 8.6:1); cream on the dark utility bar (about 16:1).
   No single colour clears 3:1 against both grounds, so the dark band swaps it.
   --------------------------------------------------------------------------- */
.rapdp[data-chrome="header"] :focus-visible {
  outline: 2px solid #7A2A24;
  outline-offset: 2px;
  border-radius: 2px;
}
.rapdp[data-chrome="header"] [data-topbar-band] :focus-visible { outline-color: #F5F1EA; }

/* ---------------------------------------------------------------------------
   5 · DROPDOWNS
   Hover, :focus-within and [data-open] are ORed, so the menus still open on
   pointer AND keyboard with no JavaScript at all. Only the hamburger and the
   click-to-pin behaviour need the script.

   TWO ADDITIONS, 2026-08-17.
   a) A 500ms CLOSE DELAY, ON SIGN IN ONLY (scope narrowed the same day, JKM).
      Instant on the way in, half a second on the way out, so the 8px gap between
      pill and panel can be crossed without the menu dumping. LEARN AND SHOP ARE
      DELIBERATELY EXCLUDED and close instantly: they sit side by side, so a delay
      there left the first panel on screen while the second opened, and the two
      overlapped as the cursor crossed the row. Sign In sits alone at the end of
      the row with nothing to collide with, which is why it keeps the delay. The
      delay lives on the RESTING rule and is zeroed on the open rule, which is
      what makes it close-only.
   b) [data-open="false"] IS AN EXPLICIT DISMISSAL and has to outrank :hover and
      :focus-within, because it is set while the pointer is still on the trigger
      (click to close) or focus is still on it (Escape). Without it the menu
      would reopen from under the cursor the instant it closed. header-nav.js
      removes the attribute again on mouseleave and when focus leaves the group,
      so plain hover-to-open returns. It has EQUAL specificity to the hover
      rule, so it wins on ORDER: keep it last in this section.
   --------------------------------------------------------------------------- */
.rapdp[data-chrome="header"] [data-nav-menu] {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease), visibility 180ms;
}
.rapdp[data-chrome="header"] [data-nav-login] [data-nav-menu] { transition-delay: 500ms; }
.rapdp[data-chrome="header"] [data-nav-group]:hover [data-nav-menu],
.rapdp[data-chrome="header"] [data-nav-group]:focus-within [data-nav-menu],
.rapdp[data-chrome="header"] [data-nav-menu][data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0ms;
}
.rapdp[data-chrome="header"] [data-nav-group] [data-nav-menu][data-open="false"] {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition-delay: 0ms;
}

/* THE SIGN IN TRIGGER IS A <button>, NOT A LINK (2026-08-17). It opens the
   dropdown and navigates nowhere, so it cannot be an <a>. Basel styles bare
   buttons, so the reset is inline in the markup AND repeated here. No
   !important, so the pill's own inline uppercase and shadow still win. */
.rapdp[data-chrome="header"] button[data-nav-trigger] {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  cursor: pointer;
  line-height: 1;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------------------
   6 · MOBILE PANEL
   The panel ships hidden AND inline display:none, so it is closed with no CSS
   and no JS (Rule 15). !important is what lets the open rule beat that inline
   display:none. Do not remove it.
   --------------------------------------------------------------------------- */
.rapdp[data-chrome="header"] [data-nav-toggle] { display: none !important; }
.rapdp[data-chrome="header"] [data-nav-panel][hidden] { display: none !important; }
.rapdp[data-chrome="header"] [data-nav-panel][data-open="true"] { display: flex !important; }

/* ---------------------------------------------------------------------------
   7 · ACTIVE STATE
   aria-current is applied by header-nav.js from body classes and the URL, never
   baked into the markup. Nothing is marked on a 404 or an unrecognised URL.

   FLAT AT REST, RECESSED ONLY ON HOVER (JKM, 2026-08-17). The current item used
   to carry the inset shadow permanently, which read as a stuck pressed button
   and left the row with two competing recesses whenever another item was hovered.
   It now differs by INK ALONE: full --ink against the row's --body-2. The recess
   belongs to hover and to hover only, and it comes from section 8. Do not put
   box-shadow back in this rule.

   !important IS LOAD-BEARING HERE. See the guard note at the top of section 8:
   the pill carries its resting colour as an INLINE style, so a plain declaration
   in this file loses to it and the active item renders identical to its
   neighbours.
   --------------------------------------------------------------------------- */
.rapdp[data-chrome="header"] [data-nav-key][aria-current="page"] {
  color: var(--ink) !important;
}

/* ---------------------------------------------------------------------------
   8 · HOVER AND PRESS
   The design source expressed these as per-element hover attributes. A WP
   fragment carries no style block, so they live here. Hover swaps the shadow,
   never the colour fill (house rule).

   INLINE-STYLE OVERRIDE GUARD, and it is why this whole section needs !important
   (found 2026-08-17: the utility bar was reported as not brightening on hover,
   and it genuinely was not). EVERY ELEMENT IN THE FRAGMENT CARRIES ITS RESTING
   COLOUR, AND SOME THEIR RESTING SHADOW, AS AN INLINE STYLE. That is deliberate
   and required, Layer B RESTING STATE: the header has to look right with zero CSS
   loaded. But an inline declaration outranks every selector in this file, so a
   plain `color:` inside a :hover rule here silently loses and the state change
   never renders. The transform-based bounce DID work, which is what made the bug
   look like a colour choice rather than a specificity one: nothing sets transform
   inline.
   SO: any property in this section that a resting inline style also sets MUST
   carry !important. Colours everywhere, plus box-shadow on the Sign In pill and
   the burger, which are the two that ship an inline shadow. transform never
   needs it. The same trap is why section 7 is !important.

   THE UTILITY BAR BRIGHTENS BY 30% AND BOUNCES ON HOVER (JKM, 2026-08-17). The
   text links rest at cream 0.72 alpha and lift to 0.94, which is that +30% on the
   composited colour and the most it can gain before it is simply full cream.
   THE TWO SOCIAL GLYPHS DO NOT CHANGE COLOUR AT ALL (JKM, same day). They hold
   terracotta straight through the hover and only bounce, so the accent reads as
   one constant colour on the bar. They briefly mixed 30% toward cream; that is
   out by request. Separators are untouched, they are not items.

   THE BOUNCE IS A 2px LIFT ON AN OVERSHOOTING CURVE, not a keyframe animation:
   cubic-bezier(.34,1.56,.64,1) passes 1 and settles back, which is where the
   spring comes from. The curve and the duration live in the SIX ITEMS' INLINE
   transition lists, because an inline transition outranks anything declared here;
   this file only supplies the transform. transform never affects layout, so the
   Instagram glyph's -4.75px optical nudge is unaffected. Reduced motion drops the
   lift entirely in section 11: the shared sheet's kill switch only zeroes the
   duration, which would leave the 2px jumping instantly rather than not moving.
   --------------------------------------------------------------------------- */
.rapdp[data-chrome="header"] [data-topbar-links] a:hover { color: rgba(245,241,234,0.94) !important; transform: translateY(-2px); }
.rapdp[data-chrome="header"] [data-topbar-social] a:hover { transform: translateY(-2px); }

.rapdp[data-chrome="header"] [data-nav-desktop] a:hover,
.rapdp[data-chrome="header"] [data-nav-menu] a:hover,
.rapdp[data-chrome="header"] [data-nav-panel] a:hover {
  box-shadow: var(--nu-inset-sm);
  color: var(--ink) !important;
}
/* The Sign In pill ships an inline raised shadow, so its press needs the shadow
   locked as well as the ink. */
.rapdp[data-chrome="header"] [data-nav-login] [data-nav-trigger]:hover {
  box-shadow: var(--nu-inset-sm) !important;
  color: var(--ink) !important;
}
.rapdp[data-chrome="header"] [data-nav-toggle]:hover { box-shadow: none !important; }
.rapdp[data-chrome="header"] [data-nav-toggle]:active { box-shadow: var(--nu-inset-sm) !important; }

/* NO OPTICAL PULL ON THE TRIGGERS ANY MORE (JKM, 2026-08-17). Learn and Shop
   used to take 5px of left padding and give back 5px of left margin on hover,
   so the pill grew leftward while the label held still. It is gone by request:
   EVERY DESKTOP NAV LABEL NOW SITS ABSOLUTELY STILL ON HOVER, and hover changes
   nothing but the shadow and the ink, exactly as Sign In always did. The two
   triggers' inline transition lists lost padding-left and margin-left with it,
   since there is nothing left to ease. Do not reinstate either half on its own:
   the padding without the margin is what visibly shoves the label sideways. */

/* ---------------------------------------------------------------------------
   9 · SEARCH FIELD
   A real GET form to /?s=, working with no JS. The field renders only at
   1280px and up (section 10), so its 10px type is never exposed to an iOS
   phone. iPad Pro in landscape DOES reach 1366px, and Safari zooms any field
   under 16px on focus, so touch pointers get 16px and drop the uppercase
   tracking to fit the 200px pill. Delete this one block if you would rather
   keep the 10px mono look on iPad and accept the zoom.
   --------------------------------------------------------------------------- */
.rapdp[data-chrome="header"] [data-nav-search] input { -webkit-appearance: none; appearance: none; }
.rapdp[data-chrome="header"] [data-nav-search] input::-webkit-search-cancel-button { display: none; }
.rapdp[data-chrome="header"] [data-nav-search] input::placeholder { color: var(--muted); opacity: 1; }
@media (pointer: coarse) {
  .rapdp[data-chrome="header"] [data-nav-search] input {
    font-size: 16px;
    letter-spacing: 0.02em;
    text-transform: none;
  }
}

/* ---------------------------------------------------------------------------
   10 · BREAKPOINTS
   Three swaps, each an either/or. Nothing is ever visible in both places.

   a) 1024 and below : hamburger replaces the desktop row, search and Sign In.
   b) 1025 to 1279   : the row cannot hold logo + nav + search + Sign In, and
                       search is the expendable one, so it drops and Sign In
                       stays on the bar.
   c) 767 and below  : the three utility links leave the dark topbar, which
                       keeps only Customer Login, and reappear inside the
                       hamburger panel as peers of Blog. Each set is hidden
                       where the other shows, so neither duplicates.
   --------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .rapdp[data-chrome="header"] [data-nav-toggle] { display: inline-flex !important; }
  .rapdp[data-chrome="header"] [data-nav-desktop],
  .rapdp[data-chrome="header"] [data-nav-search],
  .rapdp[data-chrome="header"] [data-nav-login] { display: none !important; }
}
@media (min-width: 1025px) {
  .rapdp[data-chrome="header"] [data-nav-panel] { display: none !important; }
}
@media (min-width: 1025px) and (max-width: 1279px) {
  .rapdp[data-chrome="header"] [data-nav-search] { display: none !important; }
}
@media (min-width: 768px) {
  .rapdp[data-chrome="header"] [data-tb-alt-panel] { display: none !important; }
}
@media (max-width: 767px) {
  .rapdp[data-chrome="header"] [data-tb-alt] { display: none !important; }
  /* The bar keeps its desktop behaviour: social pinned left, Customer Login
     pinned right, so the icons never drift as the link set shrinks. The inline
     padding moves from the wrapper to [data-topbar] so both ends line up with
     the logo and the navbar edges. The optical nudge on the Instagram glyph is
     therefore KEPT here, unlike the earlier centred version of this bar. */
  .rapdp[data-chrome="header"] [data-topbar-wrap] { padding-left: 0 !important; padding-right: 0 !important; }
  .rapdp[data-chrome="header"] [data-topbar] {
    justify-content: space-between !important;
    padding-left: clamp(20px, 5vw, 56px) !important;
    padding-right: clamp(20px, 5vw, 56px) !important;
  }
  .rapdp[data-chrome="header"] header { padding-left: 0 !important; padding-right: 0 !important; }
  .rapdp[data-chrome="header"] header > nav {
    flex-wrap: nowrap !important;
    padding-left: clamp(20px, 5vw, 56px) !important;
    padding-right: clamp(20px, 5vw, 56px) !important;
  }
  .rapdp[data-chrome="header"] header nav > div:first-child img { height: 32.2px !important; }
}

/* ---------------------------------------------------------------------------
   11 · REDUCED MOTION
   The shared .rapdp sheet already carries a kill switch matching .rapdp *, which
   zeroes every transition DURATION in this partial, including the dropdown fade.
   ONE THING NEEDS MORE THAN THAT: the utility bar's hover bounce is a transform,
   and a zeroed duration makes it snap 2px instantly instead of not moving. So the
   lift itself is dropped here. Nothing else in this file needs a second copy of
   the kill switch.
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .rapdp[data-chrome="header"] [data-topbar-links] a:hover,
  .rapdp[data-chrome="header"] [data-topbar-social] a:hover { transform: none; }
}

/* ---------------------------------------------------------------------------
   12 · WINDOWS HIGH CONTRAST
   Every surface here is drawn by neumorphic shadow with no border, and
   forced-colors drops box-shadow. Without this the dropdowns, the mobile panel
   and the recessed search field flatten into one undifferentiated sheet.
   --------------------------------------------------------------------------- */
@media (forced-colors: active) {
  .rapdp[data-chrome="header"] [data-nav-menu],
  .rapdp[data-chrome="header"] [data-nav-panel],
  .rapdp[data-chrome="header"] [data-nav-toggle],
  .rapdp[data-chrome="header"] [data-nav-search] { border: 1px solid CanvasText; }
}
/* ==== HEADER end ==== */
