/* =========================================================
   BMC Header & Footer — plain CSS, no build step required.
   Mirrors the design from components/Layout/Header.vue and
   components/Layout/Footer.vue in bmc-ui-v2.

   Breakpoints follow the bmc-ui-v2 Tailwind config which uses
   MAX-WIDTH conventions (opposite of vanilla Tailwind):
     mobile  : max-width 768px   (md: in the source)
     x-small : max-width 480px   (xs: in the source)
   ========================================================= */

/* ---------------------------------------------------------
   WordPress layout overrides
   --------------------------------------------------------- */

/* Twenty Twenty-Three applies padding-bottom (≈30px) to .wp-site-blocks
   from theme.json styles.spacing.padding. That creates a white gap below
   our full-bleed yellow footer. Zero it out globally — content blocks own
   their own spacing; the site-level bottom pad isn't needed. */
body > .wp-site-blocks {
  padding-bottom: 0 !important;
}

/* ---------------------------------------------------------
   CSS custom properties
   --------------------------------------------------------- */
:root {
  --bmc-yellow:      #FFDD00;
  --bmc-dark:        #222222;
  --bmc-grey:        #717171;
  --bmc-hover-bg:    rgba(34, 34, 34, 0.05);
  --bmc-shadow-nav:  0px 2.655px 95px rgba(0, 0, 0, 0.1);
  --bmc-nav-height:  58px;
  --bmc-font:        'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bmc-radius-pill: 40px;
  --bmc-radius-card: 12px;
}

/* ---------------------------------------------------------
   Base resets scoped to our elements
   Prevents WordPress theme styles from leaking in.
   --------------------------------------------------------- */
.bmc-nav *,
.bmc-mobile-drawer *,
.bmc-footer * {
  box-sizing: border-box;
}

.bmc-nav a,
.bmc-nav button,
.bmc-mobile-drawer a,
.bmc-mobile-drawer button,
.bmc-footer a,
.bmc-footer button {
  font-family: var(--bmc-font);
  text-decoration: none;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  outline-offset: 3px;
  /* padding and margin intentionally NOT reset here — this selector has
     higher specificity (0,1,1) than our class-only rules (0,1,0) and
     would override padding/margin on .bmc-nav-link, .bmc-footer-link, etc. */
}

/* ---------------------------------------------------------
   NAVIGATION BAR
   --------------------------------------------------------- */
.bmc-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 14px 24px;
  height: var(--bmc-nav-height);
  user-select: none;
  transition: box-shadow 0.075s ease-in-out;
}

/* Shadow added by JS on scroll */
.bmc-nav.bmc-nav--scrolled {
  box-shadow: var(--bmc-shadow-nav);
  animation: bmc-fadein 0.075s ease-in-out;
}

@keyframes bmc-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Admin bar: push nav down when WordPress admin bar is visible */
.admin-bar .bmc-nav {
  top: 32px;
}
@media screen and (max-width: 782px) {
  .admin-bar .bmc-nav {
    top: 46px;
  }
}

/* In-flow spacer that reserves the nav's height in the document.
   This sits inside <header> and prevents content from sliding
   under the fixed nav. */
.bmc-nav-spacer {
  height: var(--bmc-nav-height);
  display: block;
}

/* ---------------------------------------------------------
   Left group: desktop nav links + mobile hamburger
   --------------------------------------------------------- */
.bmc-nav-left {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

/* Desktop nav links — shown on ≥769px, hidden on ≤768px */
.bmc-nav-desktop-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
@media (max-width: 768px) {
  .bmc-nav-desktop-links {
    display: none;
  }
}

/* Mobile hamburger button — hidden on ≥769px, shown on ≤768px */
.bmc-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 8px;
  margin-right: 4px;
  border-radius: 8px;
  transition: background 0.1s ease;
}
.bmc-hamburger:hover {
  background: var(--bmc-hover-bg);
}
@media (max-width: 768px) {
  .bmc-hamburger {
    display: flex;
  }
}

/* ---------------------------------------------------------
   Nav links (FAQ, Wall of ♥, Log in)
   Replicates .btn-hover-bg from the Vue source:
   a semi-transparent pill bg appears on hover/active.
   --------------------------------------------------------- */
.bmc-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 16px;
  font-weight: 500;
  color: var(--bmc-dark);
  padding: 8px 16px;
  border-radius: var(--bmc-radius-pill);
  white-space: nowrap;
  transition: color 0.1s ease;
}

/* Hover pill background via ::before (same technique as Vue .btn-hover-bg) */
.bmc-nav-link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--bmc-radius-pill);
  background: var(--bmc-hover-bg);
  opacity: 0;
  transition: opacity 0.1s ease;
}
.bmc-nav-link:hover::before,
.bmc-nav-link.active::before {
  opacity: 1;
}

/* Heart icon inside "Wall of ♥" link */
.bmc-nav-wall-icon {
  margin-left: 4px;
  flex-shrink: 0;
}

/* ---------------------------------------------------------
   Resources dropdown (header)
   --------------------------------------------------------- */
.bmc-nav-dd-wrap {
  position: relative;
}

.bmc-nav-dd-trigger {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 16px;
  font-weight: 500;
  color: var(--bmc-dark);
  padding: 8px 16px;
  border-radius: var(--bmc-radius-pill);
  white-space: nowrap;
  position: relative;
}
.bmc-nav-dd-trigger::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--bmc-radius-pill);
  background: var(--bmc-hover-bg);
  opacity: 0;
  transition: opacity 0.1s ease;
}
.bmc-nav-dd-trigger:hover::before,
.bmc-nav-dd-wrap.bmc-dd-open .bmc-nav-dd-trigger::before {
  opacity: 1;
}

.bmc-nav-dd-chevron {
  transition: transform 0.15s ease;
  flex-shrink: 0;
  position: relative; /* above ::before */
}
.bmc-nav-dd-wrap.bmc-dd-open .bmc-nav-dd-chevron {
  transform: rotate(180deg);
}

/* Dropdown panel */
.bmc-nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 10000;
  min-width: 200px;
  background: #ffffff;
  border-radius: var(--bmc-radius-card);
  box-shadow: var(--bmc-shadow-nav);
  padding: 12px;
}
.bmc-nav-dd-wrap.bmc-dd-open .bmc-nav-dropdown {
  display: block;
}

.bmc-nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 400;
  color: var(--bmc-dark);
  transition: background 0.1s ease;
}
.bmc-nav-dropdown a:hover {
  background: var(--bmc-hover-bg);
}

/* ---------------------------------------------------------
   Center wordmark logo — absolutely centered on desktop
   --------------------------------------------------------- */
.bmc-nav-logo-link {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .bmc-nav-logo-link {
    display: none;
  }
}

/* ---------------------------------------------------------
   Right group: Log in + Sign up / Start my page
   --------------------------------------------------------- */
.bmc-nav-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 4px;
}

/* "Sign up" pill — yellow on desktop, hidden on mobile */
.bmc-nav-signup-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 16px;
  font-weight: 500;
  color: var(--bmc-dark);
  padding: 8px 16px;
  border-radius: var(--bmc-radius-pill);
  overflow: hidden;
  white-space: nowrap;
  z-index: 0;
}
.bmc-nav-signup-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--bmc-radius-pill);
  background: var(--bmc-yellow);
  z-index: -1;
  transition: opacity 0.1s ease;
}
.bmc-nav-signup-btn:hover::before {
  opacity: 0.8;
}
.bmc-nav-signup-btn span {
  position: relative;
  z-index: 1;
}
@media (max-width: 768px) {
  .bmc-nav-signup-btn {
    display: none;
  }
}

/* "Start my page" pill — yellow on mobile only */
.bmc-nav-start-btn {
  position: relative;
  display: none;
  align-items: center;
  font-size: 16px;
  font-weight: 500;
  color: var(--bmc-dark);
  padding: 8px 16px;
  border-radius: var(--bmc-radius-pill);
  overflow: hidden;
  white-space: nowrap;
  z-index: 0;
}
.bmc-nav-start-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--bmc-radius-pill);
  background: var(--bmc-yellow);
  z-index: -1;
  transition: opacity 0.1s ease;
}
.bmc-nav-start-btn:hover::before {
  opacity: 0.8;
}
.bmc-nav-start-btn span {
  position: relative;
  z-index: 1;
}
@media (max-width: 768px) {
  .bmc-nav-start-btn {
    display: flex;
  }
}
@media (max-width: 480px) {
  .bmc-nav-start-btn {
    padding: 8px 10px;
    font-size: 14px;
  }
  .bmc-nav-link {
    padding: 8px 10px;
    font-size: 14px;
  }
}

/* ---------------------------------------------------------
   MOBILE SLIDE-OUT DRAWER
   --------------------------------------------------------- */
.bmc-mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  z-index: 10000;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  overflow-y: auto;
  /* Only rendered on mobile, but positioned fixed so it's always available */
  display: block;
}
.bmc-mobile-drawer.bmc-drawer-open {
  transform: translateX(0);
}

.bmc-mobile-drawer-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px 12px 72px;
}

.bmc-mobile-drawer-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.bmc-mobile-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 50%;
  color: var(--bmc-dark);
  transition: background 0.1s ease;
}
.bmc-mobile-close:hover {
  background: var(--bmc-hover-bg);
}

.bmc-mobile-links {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}

.bmc-mobile-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 20px;
  padding: 8px;
  border-radius: var(--bmc-radius-pill);
  font-size: 20px;
  font-weight: 500;
  color: var(--bmc-dark);
  transition: background 0.1s ease;
}
.bmc-mobile-link:hover {
  background: var(--bmc-hover-bg);
}

.bmc-mobile-cta {
  margin-top: auto;
  padding: 0 8px;
}

/* "Start my page" CTA inside the drawer */
.bmc-mobile-start-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border-radius: var(--bmc-radius-pill);
  font-size: 16px;
  font-weight: 700;
  color: var(--bmc-dark);
  overflow: hidden;
  z-index: 0;
}
.bmc-mobile-start-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bmc-yellow);
  z-index: -1;
  transition: opacity 0.1s ease;
}
.bmc-mobile-start-btn:hover::before {
  opacity: 0.8;
}
.bmc-mobile-start-btn span {
  position: relative;
  z-index: 1;
}

/* ---------------------------------------------------------
   FOOTER
   --------------------------------------------------------- */
.bmc-footer {
  background: var(--bmc-yellow);
  padding: 48px 0 70px;
  font-family: var(--bmc-font);
}

.bmc-footer-inner {
  display: flex;
  align-items: center;
  max-width: 1272px;
  margin: 0 auto;
  padding: 0 24px;
  flex-wrap: nowrap;
}

/* Copyright — left side, desktop only */
.bmc-footer-copyright-desktop {
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 400;
  color: var(--bmc-grey);
  margin-right: 50px;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .bmc-footer-copyright-desktop {
    display: none;
  }
}

/* Center nav links */
.bmc-footer-nav {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
  user-select: none;
  gap: 0 24px;
}

.bmc-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 500;
  color: var(--bmc-dark);
  white-space: nowrap;
  transition: color 0.1s ease;
}
.bmc-footer-link:hover {
  color: var(--bmc-grey);
}
@media (max-width: 480px) {
  .bmc-footer-link {
    font-size: 14px;
  }
}

/* Legal links (Privacy, Terms) — desktop only */
.bmc-footer-legal-desktop {
  display: none;
}
/* Shown above 640px */
@media (min-width: 641px) {
  .bmc-footer-legal-desktop {
    display: inline-flex;
  }
}

/* ---------------------------------------------------------
   Footer dropdown menus (Apps, Resources)
   These float UP from the trigger link.
   --------------------------------------------------------- */
.bmc-footer-dd-wrap {
  position: relative;
}

.bmc-footer-dd-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 500;
  color: var(--bmc-dark);
  cursor: pointer;
  transition: color 0.1s ease;
  margin-top: 2px;
}
.bmc-footer-dd-trigger:hover {
  color: var(--bmc-grey);
}
@media (max-width: 480px) {
  .bmc-footer-dd-trigger {
    font-size: 14px;
  }
}

.bmc-footer-dd-chevron {
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.bmc-footer-dd-wrap.bmc-dd-open .bmc-footer-dd-chevron {
  transform: rotate(180deg);
}

/* Dropdown panel — floats above the trigger */
.bmc-footer-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 10000;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: var(--bmc-shadow-nav);
  padding: 12px;
}
.bmc-footer-dropdown.bmc-footer-dd-wide {
  min-width: 240px;
}
.bmc-footer-dropdown.bmc-footer-dd-narrow {
  min-width: 150px;
}
.bmc-footer-dd-wrap.bmc-dd-open .bmc-footer-dropdown {
  display: block;
}

.bmc-footer-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--bmc-dark);
  transition: background 0.1s ease;
}
.bmc-footer-dropdown a:hover {
  background: var(--bmc-hover-bg);
}

/* ---------------------------------------------------------
   Footer social icons
   --------------------------------------------------------- */
.bmc-footer-socials-wrap {
  display: flex;
  flex-shrink: 0;
  margin-left: auto;
}

.bmc-footer-socials {
  display: flex;
  align-items: center;
}

.bmc-social-link {
  display: inline-block;
  transition: transform 0.1s ease-in-out;
}
.bmc-social-link:hover {
  transform: scale(1.1);
}
.bmc-social-link + .bmc-social-link {
  margin-left: 24px;
}
@media (max-width: 480px) {
  .bmc-footer-socials svg {
    width: 22px;
    height: 22px;
  }
}

/* ---------------------------------------------------------
   Footer mobile bottom row (copyright + Privacy + Terms)
   Hidden on desktop, shown on ≤640px
   --------------------------------------------------------- */
.bmc-footer-mobile-bottom {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 640px) {
  .bmc-footer-mobile-bottom {
    display: flex;
  }
  .bmc-footer-inner {
    flex-wrap: wrap;
    justify-content: center;
  }
  .bmc-footer-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
  }
  .bmc-footer-socials-wrap {
    width: 100%;
    justify-content: center;
    margin-left: 0;
    margin-top: 24px;
    margin-bottom: 0;
  }
  .bmc-footer {
    padding: 32px 0 48px;
  }
}

.bmc-footer-mobile-bottom .bmc-footer-copyright {
  font-size: 16px;
  font-weight: 400;
  color: var(--bmc-grey);
  margin-right: 24px;
  flex-shrink: 0;
}

/* ---------------------------------------------------------
   WordPress content overrides
   --------------------------------------------------------- */

/* Post title links — no underline; fade to grey on hover */
.wp-block-post-title a {
  text-decoration: none;
  transition: color 0.15s ease;
}
.wp-block-post-title a:hover,
.wp-block-post-title a:focus {
  text-decoration: none;
  color: var(--bmc-grey);
}

/* Comment submit button — override the TT3 theme's lime-green accent */
#respond input#submit,
.wp-block-post-comments-form input[type="submit"] {
  background-color: var(--bmc-yellow);
  color: var(--bmc-dark);
  border-color: var(--bmc-yellow);
}
