/*
 * PrimoCRM header — global bundle (every page), hand-ported 1:1 from the
 * website project's style.scss header/nav/logo/btn rules, scoped under
 * .pc-home--header so nothing leaks into page content. Values are the design
 * tokens: canvas #FAF9F6, ink #0E1A18, body #485653, teal #0E9488,
 * teal-deep #0A7567, radius-sm 8px, Inter.
 *
 * The nav renders via wp_nav_menu (Appearance → Menus → Primary), so link
 * rules target `.nav-list a` (WP doesn't add .nav-link). Two-level menus are
 * supported: children render as a hover dropdown, parents get a CSS chevron.
 */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/InterVariable.woff2") format("woff2");
}

/* The WRAPPER is the sticky element, not .header: sticky can't escape its
   parent, and in WP this div wraps the header exactly (unlike the raw HTML
   where <header> sits directly in <body>). */
.pc-home--header {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: sticky;
  top: var(--wp-admin--admin-bar--height, 0px); /* clear the fixed admin bar when logged in */
  z-index: 50;
  transition: transform .28s ease;
}

/* Smart sticky: slides away while scrolling down, returns instantly on any
   scroll up (class toggled by the scroll handler in inc/header.php). */
.pc-home--header.is-hidden {
  /* -100% leaves a 1px sliver (border + subpixel rounding); overshoot 2px. */
  transform: translateY(calc(-100% - 2px));
}
.pc-home--header ul { margin: 0 !important; padding: 0 !important; list-style: none !important; }
.pc-home--header li { margin: 0 !important; padding: 0 !important; }
.pc-home--header a { text-decoration: none; }

.pc-home--header .container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.pc-home--header .header {
  background: #FAF9F6;
  position: relative;
  border-bottom: 1px solid rgba(14, 26, 24, .06);
  backdrop-filter: blur(8px);
}

.pc-home--header .header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}

.pc-home--header .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Logo ---------- */
.pc-home--header .logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.pc-home--header .logo .logo-img {
  height: 34px;
  width: auto;
  display: block;
}

.pc-home--header .logo-text {
  font-weight: 700;
  color: #0E1A18;
  font-size: 19px;
  letter-spacing: -0.02em;
}

/* ---------- Nav (wp_nav_menu markup) ---------- */
.pc-home--header .nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pc-home--header .nav-list > li {
  position: relative;
}

.pc-home--header .nav-list a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  font-size: 14.5px;
  color: #485653;
  border-radius: 8px;
  white-space: nowrap;
}
.pc-home--header .nav-list a:hover {
  color: #0E1A18;
  background: rgba(14, 26, 24, .04);
}

/* Chevron on items that have a dropdown (same shape as the design's svg). */
.pc-home--header .nav-list > .menu-item-has-children > a::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s ease;
  flex-shrink: 0;
}
.pc-home--header .nav-list > .menu-item-has-children:hover > a::after {
  transform: rotate(225deg) translateY(-1px);
}

/* ---------- Dropdown (level 2) ---------- */
.pc-home--header .nav-list .sub-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 8px;
  min-width: 220px;
  background: #FFFFFF;
  border: 1px solid #E7E4DD;
  border-radius: 12px;
  box-shadow: 0 30px 60px -30px rgba(14, 26, 24, .25), 0 10px 30px -15px rgba(14, 26, 24, .1);
  padding: 8px !important;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 60;
}
.pc-home--header .nav-list > li:hover > .sub-menu,
.pc-home--header .nav-list > li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Hover bridge so the dropdown doesn't close crossing the 6px gap. */
.pc-home--header .nav-list .sub-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}

.pc-home--header .nav-list .sub-menu a {
  display: flex;
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
}

/* ---------- Buttons ---------- */
.pc-home--header .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14.5px;
  transition: transform .15s ease, background .2s ease, color .2s ease, box-shadow .2s ease, border-color .2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pc-home--header .btn--primary {
  background: #0E9488;
  color: #fff;
  box-shadow: 0 6px 18px -8px rgba(14, 148, 136, .55);
}
.pc-home--header .btn--primary:hover {
  background: #0A7567;
  transform: translateY(-1px);
}

/* ---------- Hamburger toggle (mobile only) ---------- */
.pc-home--header .menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(14, 26, 24, .1);
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.pc-home--header .menu-toggle:hover {
  background: rgba(14, 26, 24, .04);
}
.pc-home--header .menu-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: #0E1A18;
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.pc-home--header .menu-toggle.is-open .menu-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.pc-home--header .menu-toggle.is-open .menu-toggle-bar:nth-child(2) {
  opacity: 0;
}
.pc-home--header .menu-toggle.is-open .menu-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Mobile nav panel (full-height sheet below the header) ----------
   NOTE: the header's backdrop-filter makes it the containing block for
   position:fixed descendants (top/bottom would resolve against the 74px-tall
   header -> zero-height sheet). So the sheet is absolute, anchored to the
   sticky header's bottom edge, with an explicit viewport-based height. */
.pc-home--header .mobile-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: calc(100vh - 74px);
  height: calc(100dvh - 74px);
  background: #FAF9F6;
  border-top: 1px solid rgba(14, 26, 24, .06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 49;
}
.pc-home--header .mobile-nav.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
/* Lock page scroll while the sheet is open (class set on <body> by JS). */
body.pc-nav-open {
  overflow: hidden;
}

.pc-home--header .mobile-nav-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 12px 20px 24px;
}

/* Top-level rows: big touch targets, hairline dividers. */
.pc-home--header .mobile-nav-list > li {
  border-bottom: 1px solid rgba(14, 26, 24, .06);
}
.pc-home--header .mobile-nav-list > li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 4px;
  font-size: 16px;
  font-weight: 600;
  color: #0E1A18;
}
.pc-home--header .mobile-nav-list > li > a:active {
  color: #0E9488;
}

/* Chevron on accordion parents; rotates when the section is open. */
.pc-home--header .mobile-nav-list > .menu-item-has-children > a::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid #6B7A77;
  border-bottom: 2px solid #6B7A77;
  transform: rotate(45deg);
  transition: transform .2s ease;
  flex-shrink: 0;
  margin-right: 4px;
}
.pc-home--header .mobile-nav-list > .menu-item-has-children.is-sub-open > a::after {
  transform: rotate(225deg);
  border-color: #0E9488;
}
.pc-home--header .mobile-nav-list > .menu-item-has-children.is-sub-open > a {
  color: #0E9488;
}

/* Accordion body: animated max-height collapse — works with any item count. */
.pc-home--header .mobile-nav-list .sub-menu {
  display: block;
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s ease;
}
.pc-home--header .mobile-nav-list .menu-item-has-children.is-sub-open > .sub-menu {
  max-height: 60vh;
  overflow-y: auto;
}
.pc-home--header .mobile-nav-list .sub-menu a {
  display: block;
  padding: 12px 4px 12px 16px;
  font-size: 15px;
  font-weight: 400;
  color: #485653;
  border-left: 2px solid #E7E4DD;
  margin-left: 4px;
}
.pc-home--header .mobile-nav-list .sub-menu a:active {
  color: #0E9488;
  border-left-color: #0E9488;
}
.pc-home--header .mobile-nav-list .sub-menu > li:last-child {
  padding-bottom: 8px !important;
}

/* CTA pinned to the natural end of the list, full width. */
.pc-home--header .mobile-nav-cta {
  margin-top: 20px;
}
.pc-home--header .mobile-nav-cta .btn {
  width: 100%;
  padding: 14px 22px;
  font-size: 15.5px;
}

/* ---------- Responsive (design hides desktop nav at 720px) ---------- */
@media (max-width: 720px) {
  .pc-home--header .nav {
    display: none;
  }
  .pc-home--header .menu-toggle {
    display: inline-flex;
  }
  .pc-home--header .btn--primary {
    padding: 10px 16px;
    font-size: 14px;
  }
}
/* Desktop: never show the mobile panel even if left open before resize. */
@media (min-width: 721px) {
  .pc-home--header .mobile-nav {
    display: none !important;
  }
}

/* ---------- Footer newsletter (PrimoCRM form #19 on the dark footer) ----------
   Layout (joined input+button row) comes from the plugin's own
   "Inline" form layout (Form Settings -> Styling); this skin only recolors
   it for the dark footer. The builder adds css_class "pc-footer-subscribe".
   Direct color values, not just the --primo-form-* vars: Kadence styles bare
   input[type=email] (0-1-1) which outranks .primo-form-field (0-1-0). */
.primo-form-wrapper.pc-footer-subscribe {
  max-width: 100%;
  margin: 0 0 20px;
  --primo-form-radius: 10px;
}
.pc-footer-subscribe .primo-form-label {
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 600;
}
.pc-footer-subscribe .primo-form-required { display: none; }
.pc-footer-subscribe .primo-form-field {
  min-height: 52px;
  color: #FFFFFF;
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .16);
  border-right: 0;
}
.pc-footer-subscribe .primo-form-field::placeholder { color: rgba(230, 235, 234, .55); }
.pc-footer-subscribe .primo-form-field:focus {
  box-shadow: none;
  border-color: rgba(255, 255, 255, .35);
}
.pc-footer-subscribe .primo-form-error { color: #FFB4A8; }
.pc-footer-subscribe .primo-form-btn { min-height: 52px; }
.pc-footer-subscribe .primo-form-success { padding: 12px 0; text-align: left; }
.pc-footer-subscribe .primo-form-success-text { color: #E6EBEA; font-size: 14px; }
.pc-footer-subscribe .primo-form-success-icon { color: #4ED0B8; margin-bottom: 4px; }
.pc-footer-subscribe .primo-form-success-icon svg { width: 28px; height: 28px; }
