/* =====================================================================
   JMS MEDIA • 05 — SITE CHROME  (v4 — custom nav, no block-nav selectors)
   ===================================================================== */

/* =============================================================
   HEADER STRUCTURE
   ============================================================= */

.jms-site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  display: block;
}

.jms-header-logo-bar {
  background: #ffffff;
  padding: 16px clamp(20px, 5vw, 48px);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 88px;
}

.jms-header-nav-bar {
  background: #0b0c0f;
  width: 100%;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
}

/* =============================================================
   PRIMARY NAV — desktop: horizontal, uppercase, pipe separators
   ============================================================= */

.jms-primary-nav {
  width: 100%;
}

.jms-nav-menu {
  display: flex;
  flex-direction: row;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  justify-content: center;
}

/* Each top-level item */
.jms-nav-menu > .jms-nav-item {
  display: flex;
  align-items: center;
  position: relative;
  height: 44px;
}

/* Top-level link */
.jms-nav-menu > .jms-nav-item > a {
  color: #ffffff;
  text-transform: uppercase;
  font-family: "Work Sans", -apple-system, Segoe UI, sans-serif;
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  padding: 0 16px;
  height: 44px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.12s ease;
}

/* Hover */
.jms-nav-menu > .jms-nav-item > a:hover {
  color: #ffd400;
}

/* Active / current page — yellow block */
.jms-nav-menu > .jms-nav-item.jms-current > a {
  background: #ffd400;
  color: #0b0c0f;
}
.jms-nav-menu > .jms-nav-item.jms-current > a:hover {
  color: #0b0c0f;
}

/* Pipe separators */
.jms-nav-menu > .jms-nav-item + .jms-nav-item::before {
  content: '';
  display: block;
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,0.25);
  flex-shrink: 0;
}

/* Chevron toggle button (sits next to the top-level link) */
.jms-dropdown-toggle {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 0 10px 0 2px;
  height: 44px;
  display: flex;
  align-items: center;
  line-height: 1;
  flex-shrink: 0;
}
.jms-dropdown-toggle svg {
  transition: transform 0.18s ease;
}
.jms-has-dropdown.is-open > .jms-dropdown-toggle svg {
  transform: rotate(180deg);
}

/* =============================================================
   DROPDOWN SUBMENU — absolutely positioned, dark charcoal
   Does NOT affect nav bar height — completely off-flow.
   ============================================================= */

.jms-submenu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 9999;
  background: #2e2f24;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  min-width: 220px;
  list-style: none;
  margin: 0;
  padding: 6px 0;
  /* Hidden until .is-open is toggled by nav.js */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.jms-has-dropdown.is-open > .jms-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.jms-submenu > li {
  display: block;
}

.jms-submenu > li + li {
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* No pipe pseudo-elements inside submenu */
.jms-submenu > li::before {
  display: none !important;
}

.jms-submenu > li > a {
  display: block;
  color: rgba(255,255,255,0.85);
  font-family: "Work Sans", -apple-system, Segoe UI, sans-serif;
  font-size: 0.87rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  text-decoration: none;
  padding: 11px 22px;
  white-space: nowrap;
  transition: color 0.12s ease, background 0.12s ease;
}

.jms-submenu > li > a:hover,
.jms-submenu > li.jms-current > a {
  color: #ffd400;
  background: rgba(255,255,255,0.05);
}

/* =============================================================
   HAMBURGER — hidden on desktop
   ============================================================= */

.jms-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 2px solid rgba(255,255,255,0.55);
  border-radius: 4px;
  padding: 7px 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.jms-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.jms-hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.jms-hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.jms-hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =============================================================
   MOBILE OVERLAY BACKDROP
   ============================================================= */

.jms-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
}

.jms-nav-overlay[aria-hidden="false"] {
  display: block;
}

/* Prevent body scroll when mobile nav is open */
body.jms-nav-open {
  overflow: hidden;
}

/* =============================================================
   MOBILE HEADER — single black bar at 782px
   ============================================================= */

@media (max-width: 782px) {
  .jms-site-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    background: #0b0c0f !important;
    padding: 0 20px !important;
    min-height: 72px !important;
    gap: 0 !important;
  }

  .jms-header-logo-bar {
    background: transparent !important;
    padding: 0 !important;
    min-height: unset !important;
    justify-content: flex-start !important;
    align-items: center !important;
    flex: 1 !important;
    display: flex !important;
  }

  .jms-header-logo-bar .wp-block-site-logo img {
    max-width: clamp(180px, 45vw, 240px) !important;
    height: auto !important;
    display: block !important;
  }

  .jms-header-nav-bar {
    background: transparent !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    width: auto !important;
    min-height: unset !important;
    display: flex !important;
    align-items: center !important;
    align-self: center !important;
  }

  /* Hamburger: vertically centred, same optical weight as the logo row */
  .jms-hamburger {
    align-self: center !important;
    margin: 0 !important;
  }

  /* Show hamburger on mobile */
  .jms-hamburger {
    display: flex;
  }

  /* Nav becomes a fixed right-side slide-in panel */
  .jms-primary-nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: #4a4a38;
    z-index: 999;
    overflow-y: auto;
    transition: right 0.25s ease;
    padding: 24px 0 40px;
  }

  .jms-primary-nav.is-open {
    right: 0;
  }

  /* Mobile nav list — vertical stack */
  .jms-nav-menu {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0 24px;
  }

  .jms-nav-menu > .jms-nav-item {
    height: auto;
    flex-wrap: wrap;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    position: static;
  }

  /* No pipes on mobile */
  .jms-nav-menu > .jms-nav-item::before {
    display: none !important;
  }

  .jms-nav-menu > .jms-nav-item > a {
    color: #ffd400;
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.01em;
    padding: 14px 0;
    flex: 1;
    height: auto;
    background: transparent !important;
  }

  /* Services parent (has-dropdown) — white so it reads as a category */
  .jms-nav-menu > .jms-has-dropdown > a {
    color: #ffffff !important;
  }

  .jms-dropdown-toggle {
    color: #ffffff;
    height: auto;
    padding: 14px 4px;
  }

  /* Mobile submenu — static, indented, shown via display:block */
  .jms-submenu {
    position: static;
    width: 100%;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    min-width: unset;
    padding: 0 0 8px 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    display: none;
    transition: none;
  }

  .jms-has-dropdown.is-open > .jms-submenu {
    display: block;
  }

  .jms-submenu > li > a {
    color: #ffd400;
    font-size: 0.95rem;
    padding: 10px 0 10px 16px;
  }

  .jms-submenu > li + li {
    border-top: 1px solid rgba(255,255,255,0.07);
  }
}

/* =============================================================
   TYPOGRAPHY REFINEMENT

   We only load Lora 500 + 600 (Google Fonts enqueue).
   Any weight above 600 is browser-synthesised — the browser
   fakes it by thickening strokes, producing the "chunky/stomped"
   look. Capping everything at real loaded weights fixes it.

   !important required: inline <style> tags in page content sit
   later in the cascade than our stylesheet and override same-
   specificity rules. These are deliberate design overrides.
   ============================================================= */

/* ─────────────────────────────────────────────────────────────────
   GLOBAL WEIGHT CAP — applies to every page, beats every jpp-*
   inline <style> block (which declare 900/800 without !important).
   Lora loads 500 + 600 only. Work Sans loads 400/500/600/700.
   Anything above 600 for Lora = browser-synthesised = chunky.
   ───────────────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-weight: 500 !important;
  letter-spacing: -0.02em !important;
}

strong, b {
  font-weight: 600 !important;
}

/* summary is not covered by h1-h6 or strong — cap it here */
summary {
  font-weight: 500 !important;
}

/* ── Per-context refinements (higher specificity overrides above) ── */

/* WP block headings */
.wp-block-heading {
  line-height: 1.15 !important;
}

/* Yellow H1 — one real notch up for impact */
h1.tight-heading {
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  line-height: 1.1 !important;
}

/* Homecopy headings + space below before the card */
.jms-homecopy h1,
.jms-homecopy h2 {
  line-height: 1.18 !important;
}

.jms-homecopy h2 {
  margin-bottom: clamp(20px, 2.5vw, 32px) !important;
}

/* Homecopy body text */
.jms-homecopy p,
.jms-homecopy .sub,
.jms-homecopy .body {
  font-weight: 400 !important;
  line-height: 1.72 !important;
}

/* Homecopy bold labels — subtler than global strong */
.jms-homecopy .strong,
.jms-homecopy strong,
.jms-homecopy b {
  font-weight: 500 !important;
  color: rgba(11, 12, 15, 0.88) !important;
}

/* CTA kicker ("Pick your starting point.") — was 900, should be a refined mid-weight */
.jpp-cta__kicker {
  font-weight: 500 !important;
  letter-spacing: -0.01em !important;
}

/* Home note paragraph ("If you need a clearer path…") — was 800, reads as a pull-quote */
.jms-home-note p {
  font-weight: 400 !important;
  line-height: 1.75 !important;
  font-size: 1.05rem !important;
}

/* CTA / block buttons — Work Sans 500 instead of default 700 */
.wp-block-button__link,
.jpp-cta__btn,
.jms-btn {
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
}

/* ── LINK STYLES — global fix ───────────────────────────────────
   Previous: black text, weight 800 (synthesised), gold underline.
   Result: links looked like bold body copy, not links.
   Fix: brand gold color (#c49a49), real weight 500, subtle underline.
   Applies to inline-link class and any content-area <a> not styled
   as a button.
   ─────────────────────────────────────────────────────────────── */
a.inline-link {
  color: var(--jms-gold) !important;
  font-weight: 500 !important;
  text-decoration: underline !important;
  text-decoration-color: rgba(196, 154, 73, 0.35) !important;
  text-decoration-thickness: 1.5px !important;
  text-underline-offset: 3px !important;
  transition: color 0.15s ease, text-decoration-color 0.15s ease !important;
}
a.inline-link:hover,
a.inline-link:focus-visible {
  color: var(--jms-gold-2) !important;
  text-decoration-color: var(--jms-gold-2) !important;
}

/* Broader: any unclassed <a> inside homecopy sections */
.jms-homecopy a:not([class]),
.jms-homecopy a.inline-link,
.wp-block-post-content a:not(.wp-block-button__link):not([class*="btn"]):not([class*="cta"]):not(.wp-block-site-logo) {
  color: var(--jms-gold) !important;
  font-weight: 500 !important;
  text-decoration: underline !important;
  text-decoration-color: rgba(196, 154, 73, 0.35) !important;
  text-decoration-thickness: 1.5px !important;
  text-underline-offset: 3px !important;
  transition: color 0.15s ease, text-decoration-color 0.15s ease !important;
}
.jms-homecopy a:not([class]):hover,
.jms-homecopy a.inline-link:hover,
.wp-block-post-content a:not(.wp-block-button__link):not([class*="btn"]):not([class*="cta"]):not(.wp-block-site-logo):hover {
  color: var(--jms-gold-2) !important;
  text-decoration-color: var(--jms-gold-2) !important;
}

/* =============================================================
   FAQ GRID — uniform, top-aligned, responsive
   .faq-grid is set in the page inline <style> as a fixed
   466px + 466px grid with no align-items, causing shorter items
   in the same row to drift down relative to taller neighbours.
   ============================================================= */

.faq-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)) !important;
  gap: 14px !important;
  align-items: start !important;   /* top-align so rows don't stagger */
}

/* Each accordion item — reset WP is-layout-flow block-start margins that offset grid items */
.faq-grid details {
  margin: 0 !important;           /* WP adds margin-block-start to non-first flow children */
  align-self: start !important;   /* belt-and-braces: top-align within grid cell */
  border: 1.5px solid rgba(11, 12, 15, 0.13) !important;
  border-radius: 10px !important;
  padding: 0 !important;
  background: #ffffff !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
  overflow: hidden !important;
}

.faq-grid details[open] {
  border-color: rgba(11, 12, 15, 0.22) !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07) !important;
}

/* Question row */
.faq-grid details summary {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 15px 18px !important;
  font-family: "Work Sans", -apple-system, Segoe UI, sans-serif !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  color: rgba(11, 12, 15, 0.88) !important;
  letter-spacing: 0 !important;
  cursor: pointer !important;
  list-style: none !important;
  line-height: 1.4 !important;
}

/* Remove browser default disclosure triangle */
.faq-grid details summary::-webkit-details-marker { display: none !important; }

/* Replace with a clean brand-gold chevron */
.faq-grid details summary::before {
  content: '' !important;
  display: inline-block !important;
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23c49a49' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  transition: transform 0.2s ease !important;
}

.faq-grid details[open] summary::before {
  transform: rotate(180deg) !important;
}

/* Answer text */
.faq-grid details > p,
.faq-grid details > div:not(summary) {
  padding: 0 18px 16px 44px !important;
  font-size: 0.92rem !important;
  font-weight: 400 !important;
  line-height: 1.65 !important;
  color: rgba(11, 12, 15, 0.65) !important;
  margin: 0 !important;
}

/* Divider between question and answer */
.faq-grid details[open] summary {
  border-bottom: 1px solid rgba(11, 12, 15, 0.08) !important;
}

@media (max-width: 782px) {
  .faq-grid {
    grid-template-columns: 1fr !important;
  }
}

/* =============================================================
   PAGE CONTENT — spacing and alignment
   ============================================================= */

/* Top breathing room: non-home pages get more (no hero to buffer) */
body:not(.home) .jms-main {
  padding-top: clamp(32px, 5vw, 60px);
}

/* Home page: prevent margin-collapse on the first child (tight-heading) */
.home .jms-main {
  padding-top: clamp(20px, 3vw, 36px);
}

/* Headings that are direct children of the content lane default to centered.
   Per-page jms-homecopy / jpp-* wrappers can override this locally. */
.wp-block-post-content > .wp-block-heading {
  text-align: center;
}

/* FIX: 03-components.css has a blanket .jms-homecopy .wp-block-group { margin:0; max-width:none }
   reset that fires AFTER .jms-homecopy .body { margin:0 auto; max-width:860px } (same specificity,
   later in file). WP adds wp-block-group to the card at render time, so the centering gets zeroed.
   This rule in 05-chrome.css (loaded last) wins the cascade and restores it. */
.jms-homecopy .body {
  margin-left: auto;
  margin-right: auto;
  max-width: 860px;
}

/* =============================================================
   FOOTER — white sitemap + gray social bar
   ============================================================= */

.jms-site-footer {
  display: block !important;
  background: #ffffff !important;
}

.jms-footer-sitemap {
  background: #ffffff;
  padding: clamp(36px, 5vw, 60px) clamp(20px, 5vw, 60px) clamp(24px, 4vw, 44px);
  text-align: center;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

.jms-footer-sitemap .wp-block-site-logo {
  display: flex !important;
  justify-content: center !important;
  margin-bottom: clamp(20px, 3vw, 30px) !important;
}

.jms-footer-nav-main ul.wp-block-navigation__container,
.jms-footer-nav-sub ul.wp-block-navigation__container {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0 !important;
  justify-content: center !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  align-items: center !important;
}

.jms-footer-nav-main ul.wp-block-navigation__container > li,
.jms-footer-nav-sub ul.wp-block-navigation__container > li {
  display: flex !important;
  align-items: center !important;
}

.jms-footer-nav-main ul.wp-block-navigation__container > li > a,
.jms-footer-nav-sub ul.wp-block-navigation__container > li > a {
  color: #0b0c0f !important;
  text-transform: uppercase !important;
  font-family: "Work Sans", -apple-system, Segoe UI, sans-serif !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  padding: 6px 12px !important;
  display: inline-block !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  transition: background 0.12s ease, color 0.12s ease !important;
}

/* Pipe separators */
.jms-footer-nav-main ul.wp-block-navigation__container > li + li::before,
.jms-footer-nav-sub ul.wp-block-navigation__container > li + li::before {
  content: '' !important;
  display: block !important;
  width: 1px !important;
  height: 12px !important;
  background: rgba(0,0,0,0.2) !important;
  flex-shrink: 0 !important;
}

/* Yellow block hover */
.jms-footer-nav-main ul.wp-block-navigation__container > li > a:hover,
.jms-footer-nav-sub ul.wp-block-navigation__container > li > a:hover {
  background: #ffd400 !important;
  color: #0b0c0f !important;
}

/* Active/current page */
.jms-footer-nav-main ul.wp-block-navigation__container > li.current-menu-item > a,
.jms-footer-nav-main ul.wp-block-navigation__container > li.current_page_item > a,
.jms-footer-nav-main ul.wp-block-navigation__container > li > a[aria-current="page"] {
  background: #ffd400 !important;
  color: #0b0c0f !important;
}

/* Desktop: collapse the gap between the two nav rows so they read as one compact block */
.jms-footer-nav-main {
  margin-bottom: 0 !important;
}

/* Kill WP's is-layout-flow block-start margins inside the sitemap — they create the airspace */
.jms-footer-sitemap .wp-block-site-logo,
.jms-footer-sitemap .jms-footer-nav-main,
.jms-footer-sitemap .jms-footer-nav-sub {
  margin-block-start: 0 !important;
}

/* Logo bottom gap — controlled, not WP default */
.jms-footer-sitemap .wp-block-site-logo {
  margin-bottom: clamp(14px, 2vw, 22px) !important;
}

/* Tighter sitemap padding */
.jms-footer-sitemap {
  padding-top: clamp(24px, 3.5vw, 40px) !important;
  padding-bottom: clamp(16px, 2.5vw, 28px) !important;
}

/* Gray social/copyright bar */
.jms-footer-social-bar {
  background: #e5e5e0;
  padding: clamp(20px, 3vw, 36px) clamp(20px, 5vw, 60px);
  text-align: center;
}

.jms-footer-social-bar .jms-socials {
  justify-content: center !important;
  gap: 10px !important;
  margin-bottom: 14px !important;
}

.jms-footer-social-bar .wp-block-social-link {
  background: #0b0c0f !important;
  border-radius: 5px !important;
  width: 40px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

.jms-footer-social-bar .wp-block-social-link a {
  padding: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
}

.jms-footer-social-bar .wp-block-social-link svg {
  fill: #ffffff !important;
  width: 20px !important;
  height: 20px !important;
}

.jms-footer-copy {
  font-size: 0.88rem !important;
  color: #0b0c0f !important;
  margin-bottom: 5px !important;
}

.jms-footer-tagline {
  font-size: 0.81rem !important;
  color: #555 !important;
  font-style: italic !important;
  margin-bottom: 0 !important;
}

/* =============================================================
   MOBILE FOOTER — ≤600px

   Two bugs in v1:
   1. Pipe selector was li::before — pipes live on li+li::before,
      so they weren't hidden, just offset to the left of each item.
   2. WP's block gap + li margins were creating the 40-50px
      inter-item spacing. Need to zero li margin/padding explicitly.
   ============================================================= */

@media (max-width: 600px) {
  /* Logo — bigger on mobile */
  .jms-footer-sitemap .wp-block-site-logo img {
    width: clamp(200px, 68vw, 280px) !important;
    max-width: clamp(200px, 68vw, 280px) !important;
    height: auto !important;
  }

  .jms-footer-sitemap {
    padding: 24px 12px 16px !important;
  }

  /* Keep HORIZONTAL wrap — same compact block layout as desktop,
     just smaller text so items wrap neatly across 2-3 rows.
     Pipes stay — in horizontal mode they sit between items on
     the same line and the 1px-wide pseudo is invisible at wrap
     points. Column mode was the bug — it put the pipe to the
     left of every stacked item. */
  .jms-footer-nav-main ul.wp-block-navigation__container,
  .jms-footer-nav-sub ul.wp-block-navigation__container {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0 !important;
  }

  /* Links — sized for readability; wraps to more rows, stays centered */
  .jms-footer-nav-main ul.wp-block-navigation__container > li > a,
  .jms-footer-nav-sub ul.wp-block-navigation__container > li > a {
    font-size: 0.78rem !important;
    padding: 5px 9px !important;
    letter-spacing: 0.06em !important;
  }
}
