/* =========================================
   PSPCG TOOLS - SHARED HEADER & FOOTER
   Responsive Desktop, Tablet & Mobile
========================================= */

.pspcg-header,
.pspcg-footer { font-family: Arial, sans-serif; }
.pspcg-header {
  position: sticky; top: 0; z-index: 10000; background: rgba(255,255,255,.98);
  backdrop-filter: blur(12px); border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(15,23,42,.08);
}
.pspcg-header *, .pspcg-footer * { box-sizing: border-box; }
.pspcg-header-inner {
  width: min(1440px, calc(100% - 36px)); min-height: 86px; margin: auto;
  display: flex; align-items: center; gap: 22px;
}
.pspcg-brand, .pspcg-footer-brand {
  display:flex; align-items:center; gap:12px; text-decoration:none; flex-shrink:0;
}
.pspcg-brand img {
  width:54px; height:54px; border-radius:50%; object-fit:contain;
  border:2px solid #e2e8f0;
}
.pspcg-brand-copy, .pspcg-footer-brand span { display:flex; flex-direction:column; line-height:1.15; }
.pspcg-brand-copy strong, .pspcg-footer-brand strong {
  font-size:25px; color:#172554; letter-spacing:-.7px;
}
.pspcg-brand-copy strong b, .pspcg-footer-brand strong b { color:#2563eb; }
.pspcg-brand-copy small, .pspcg-footer-brand small { font-size:12px; color:#475569; margin-top:5px; }

.pspcg-nav { display:flex; align-items:center; justify-content:center; gap:4px; flex:1; }
.pspcg-nav-item { position:relative; }
.pspcg-nav-trigger, .pspcg-nav-link {
  border:0; background:transparent; color:#1e293b; font-size:14px; font-weight:700;
  padding:12px 10px; border-radius:10px; text-decoration:none; white-space:nowrap; cursor:pointer;
}
.pspcg-nav-trigger span { margin-left:4px; }
.pspcg-nav-trigger:hover, .pspcg-nav-trigger[aria-expanded="true"], .pspcg-nav-link:hover {
  background:#fee2e2; color:#b91c1c;
}
.pspcg-dropdown {
  display:none; position:absolute; top:calc(100% + 5px); left:0; min-width:190px; padding:7px;
  background:#fff; border:1px solid #fecaca; border-radius:12px;
  box-shadow:0 14px 32px rgba(15,23,42,.16);
}
.pspcg-nav-item.is-open .pspcg-dropdown { display:block; }
.pspcg-dropdown a {
  display:block; padding:10px 12px; border-radius:8px; color:#334155;
  text-decoration:none; font-size:13px; font-weight:600;
}
.pspcg-dropdown a:hover { background:#fee2e2; color:#b91c1c; }

.pspcg-auth { display:flex; gap:9px; align-items:center; flex-shrink:0; }
.pspcg-auth a {
  padding:11px 17px; border-radius:10px; text-decoration:none; font-size:14px;
  font-weight:700; white-space:nowrap;
}
.pspcg-login { border:1px solid #dc2626; color:#b91c1c; background:white; }
.pspcg-login:hover { background:#fef2f2; }
.pspcg-signup {
  background:linear-gradient(120deg,#dc2626,#991b1b); color:white;
  box-shadow:0 4px 10px rgba(220,38,38,.18);
}
.pspcg-signup:hover { filter:brightness(.94); }

.pspcg-mobile-toggle {
  display:none; border:1px solid #fecaca; background:#fff; color:#b91c1c;
  border-radius:9px; padding:8px 12px; font-size:20px; cursor:pointer;
}
.pspcg-search-toggle {
  display:none; align-items:center; justify-content:center; width:42px; height:42px;
  border:1px solid #16a34a; border-radius:50%; color:#047857; background:#f0fdf4;
  font-size:17px; cursor:pointer; flex:0 0 42px;
}
.pspcg-search-toggle:hover { background:#dcfce7; }

.pspcg-footer {
  margin-top:auto; background:#fff; border-top:1px solid #e2e8f0; color:#475569;
}
.pspcg-footer-inner { width:min(1440px, calc(100% - 40px)); margin:auto; padding:22px 0 18px; }
.pspcg-footer-top {
  display:flex; align-items:center; justify-content:space-between; gap:18px; padding-bottom:16px;
}
.pspcg-footer-brand img { width:42px; height:42px; object-fit:contain; border-radius:50%; }
.pspcg-footer-brand strong { font-size:20px; }
.pspcg-footer-brand small { font-size:11px; }
.pspcg-footer-top p { font-size:13px; margin:0; }
.pspcg-footer-links {
  border-top:1px solid #e2e8f0; padding-top:15px; display:flex;
  justify-content:center; flex-wrap:wrap; gap:10px 28px;
}
.pspcg-footer-links a { color:#334155; text-decoration:none; font-size:13px; font-weight:600; }
.pspcg-footer-links a:hover { color:#dc2626; }

@media (max-width:1100px) and (min-width:769px) {
  .pspcg-header-inner { flex-wrap:wrap; padding:12px 0; gap:12px; }
  .pspcg-nav { order:4; flex-basis:100%; justify-content:flex-start; flex-wrap:wrap; }
  .pspcg-brand { margin-right:auto; }
}
@media (max-width:768px) {
  .pspcg-header-inner {
    width:calc(100% - 24px); min-height:70px; display:flex; flex-wrap:wrap;
    align-items:center; gap:8px; padding:10px 0;
  }
  .pspcg-brand { order:1; flex:1 1 auto; min-width:0; margin:0; gap:9px; }
  .pspcg-brand img { width:43px; height:43px; }
  .pspcg-brand-copy strong { font-size:19px; white-space:nowrap; }
  .pspcg-brand-copy small { font-size:10px; }
  .pspcg-search-toggle { display:inline-flex; order:2; }
  .pspcg-mobile-toggle {
    display:inline-flex; order:3; align-items:center; justify-content:center;
    width:44px; height:42px; flex:0 0 44px; padding:0; font-size:24px; line-height:1;
  }
  .pspcg-nav {
    display:none !important; order:4; flex:1 0 100%; width:100%; min-width:0;
    flex-direction:column; align-items:stretch; justify-content:flex-start; gap:3px;
    margin:3px 0 0; padding:8px; border:1px solid #e5e7eb; border-radius:13px;
    background:#fff; box-shadow:0 10px 24px rgba(15,23,42,.08);
  }
  .pspcg-header-inner.mobile-menu-open .pspcg-nav { display:flex !important; }
  .pspcg-nav-item { display:block; width:100%; position:relative; }
  .pspcg-nav-trigger, .pspcg-nav-link {
    display:flex; width:100%; min-height:44px; align-items:center; justify-content:space-between;
    text-align:left; padding:11px 12px; font-size:15px; white-space:normal;
  }
  .pspcg-dropdown {
    display:none !important; position:static; width:100%; min-width:0; max-width:100%;
    max-height:40vh; overflow-y:auto; margin:2px 0 6px; padding:5px; box-shadow:none;
    border:1px solid #fee2e2; border-radius:10px; background:#fffafa;
  }
  .pspcg-nav-item.is-open > .pspcg-dropdown { display:block !important; }
  .pspcg-dropdown a { padding:11px 12px; font-size:14px; }
  .pspcg-auth {
    display:none !important; order:5; flex:1 0 100%; width:100%; margin:0; gap:9px;
  }
  .pspcg-header-inner.mobile-menu-open .pspcg-auth { display:flex !important; }
  .pspcg-auth a { flex:1 1 50%; text-align:center; padding:12px 8px; font-size:14px; }
  .pspcg-footer-top { align-items:flex-start; flex-direction:column; }
  .pspcg-footer-links { justify-content:flex-start; gap:12px 18px; }
}
@media (max-width:380px) {
  .pspcg-header-inner { width:calc(100% - 16px); gap:6px; }
  .pspcg-brand-copy strong { font-size:17px; }
  .pspcg-search-toggle { width:38px; height:38px; flex-basis:38px; }
  .pspcg-mobile-toggle { width:40px; height:40px; flex-basis:40px; }
}


/* Search-only panel and transparent mobile search icon */
.pspcg-search-panel { padding:14px; }
.pspcg-search-panel .pspcg-search-heading { margin-bottom:14px; }
.pspcg-search-panel .pspcg-search-results { margin:0 2px; }
.pspcg-search-panel .pspcg-search-form { margin:0 2px 8px; }
.pspcg-search-toggle {
  background:transparent !important;
  border-color:rgba(22,163,74,.35) !important;
  box-shadow:none !important;
}
.pspcg-search-toggle:hover,
.pspcg-search-toggle:focus-visible {
  background:rgba(22,163,74,.08) !important;
  outline:2px solid rgba(22,163,74,.2);
  outline-offset:2px;
}
@media (max-width:768px) {
  .pspcg-search-panel { padding:12px; }
  .pspcg-search-toggle { color:#16a34a !important; }
}

/* Search is now launched beside the Welcome heading, not from the header. */
.pspcg-search-toggle { display:none !important; }


/* Header visibility and stacking safety */
#shared-site-header { display:block !important; position:relative; z-index:10000; }
#shared-site-header .pspcg-header { display:block !important; visibility:visible !important; opacity:1 !important; }
#shared-site-header .pspcg-header-inner { position:relative; }
@media (min-width:769px) {
  #shared-site-header .pspcg-nav { display:flex !important; visibility:visible !important; opacity:1 !important; }
}
