/* ============================================================
   HEADER LAYER — page loader, ink stat ribbon, ad marquee
   Loads after style.css and refines the base header.
============================================================ */

/* ============================================================
   PAGE LOADER
============================================================ */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg, #fbf8f3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-spinner {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(25, 28, 26, 0.14);
  border-top-color: var(--accent, #e2653a);
  border-radius: 0;
  animation: loader-spin 0.9s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes loader-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   TRUST STAT RIBBON — dark ink band under the nav
============================================================ */
.navbar-stats {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 var(--gutter);
  background: var(--ink);
  border-top: none;
  border-bottom: 1px solid rgba(25, 28, 26, 0.6);
}

/* clay hairline riding the very top of the ribbon */
.navbar-stats::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(226, 101, 58, 0.55) 30%,
    var(--accent) 50%,
    rgba(226, 101, 58, 0.55) 70%,
    transparent 100%);
}

.stat-pill {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 11px 26px;
  font-size: 12px;
  z-index: 80;
  color: var(--ink-muted);
  white-space: nowrap;
  letter-spacing: 0.04em;
  transition: color 0.22s ease;
}

.stat-pill:hover {
  color: var(--ink-text);
  transform: none;
}

.stat-pill i {
  color: var(--accent);
  font-size: 11px;
  opacity: 0.9;
}

.stat-pill strong {
  font-family: var(--font-display);
  color: var(--ink-text);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.02em;
}

.stat-divider {
  width: 1px;
  height: 15px;
  align-self: center;
  background: var(--ink-line);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .navbar-stats {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .navbar-stats::-webkit-scrollbar { display: none; }
  .stat-pill { flex-shrink: 0; padding: 10px 16px; font-size: 11.5px; }
  .stat-pill strong { font-size: 13px; }
  .stat-divider { flex-shrink: 0; }
}

/* ============================================================
   ADVERTISE-WITH-US MARQUEE (fixed to the viewport bottom)
============================================================ */
body { padding-bottom: 42px !important; }

.header-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  display: flex;
  align-items: stretch;
  height: 42px;
  background: var(--ink-2, #1e2723);
  border-top: 1px solid rgba(226, 101, 58, 0.35);
  box-shadow: 0 -10px 30px -12px rgba(16, 20, 18, 0.55);
}

.header-footer.is-hidden { display: none; }

.ad-badge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  background: var(--accent-strong);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ad-badge i { font-size: 11px; }

.ad-marquee {
  flex: 1;
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.ad-track {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  height: 100%;
  gap: 72px;
  padding-left: 72px;
  white-space: nowrap;
  animation: ad-scroll 34s linear infinite;
  will-change: transform;
}

.header-footer:hover .ad-track,
.header-footer:focus-within .ad-track {
  animation-play-state: paused;
}

@keyframes ad-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.ad-item {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: var(--ink-muted, #a5a396);
  letter-spacing: 0.02em;
}

.ad-item a {
  color: var(--accent-light, #f2b193);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(242, 177, 147, 0.4);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.ad-item a:hover {
  color: #fff;
  border-color: #fff;
}

.ad-close {
  flex-shrink: 0;
  width: 42px;
  background: none;
  border: none;
  border-left: 1px solid var(--ink-line);
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.ad-close:hover {
  color: #fff;
  background: rgba(226, 101, 58, 0.22);
}

@media (max-width: 768px) {
  body { padding-bottom: 36px !important; }
  .header-footer { height: 36px; }
  .ad-badge { display: none; }
  .ad-track { gap: 44px; padding-left: 44px; animation-duration: 22s; }
  .ad-item { font-size: 11.5px; gap: 10px; }
  .ad-close { width: 36px; font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .ad-track { animation: none; }
  .loader-spinner { animation-duration: 2s; }
}
