/* ==========================================================================
   Chhimwal.com — Shared Site Header & Footer
   Self-contained, scoped styles (cw- prefix) so this renders identically
   whether or not a page also loads Tailwind or its own custom CSS.
   ========================================================================== */

.cw-header {
  position: relative;
  z-index: 1000;
  overflow: visible;
  background: linear-gradient(135deg, #0b1220 0%, #111827 55%, #1f2937 100%);
  color: #f3f4f6;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

/* Particle layer */
.cw-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.cw-particle {
  position: absolute;
  bottom: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.95) 0%, rgba(251, 191, 36, 0.15) 55%, rgba(251, 191, 36, 0) 75%);
  box-shadow: 0 0 6px 1px rgba(251, 191, 36, 0.6);
  animation-name: cw-rise;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform, opacity;
}

@keyframes cw-rise {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 0.75; }
  100% { transform: translateY(-150px) scale(1.1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cw-particle { animation: none; opacity: 0; }
}

/* Header inner layout */
.cw-header-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1280px;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cw-nav {
  position: relative;
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
}

.cw-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fbbf24;
  text-decoration: none;
  white-space: nowrap;
}
.cw-logo:hover { color: #fcd34d; }
.cw-logo-icon { font-size: 1.5rem; }
.cw-logo-dot { color: #f3f4f6; font-weight: 700; }

.cw-nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #f3f4f6;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.4rem 0.65rem;
  border-radius: 0.4rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.cw-nav-toggle:focus-visible,
.cw-nav-list a:focus-visible,
.cw-auth-logout:focus-visible {
  outline: 2px solid #fbbf24;
  outline-offset: 3px;
}

.cw-nav-list {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.75rem, 1.55vw, 1.5rem);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.cw-nav-list a {
  color: #e5e7eb;
  text-decoration: none;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.cw-nav-list a:hover,
.cw-nav-list a.cw-active {
  color: #fbbf24;
  border-bottom-color: #fbbf24;
}

/* Authentication links */
.cw-auth-nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: 0.15rem;
  padding-left: 0.15rem;
  flex: 0 0 auto;
}

.cw-auth-nav-item > a {
  flex: 0 0 auto;
}

.cw-auth-greeting {
  white-space: nowrap;
  font-size: 0.92rem;
  opacity: 0.85;
  flex: 0 0 auto;
}

.cw-auth-nav-item > a {
  white-space: nowrap;
  display: inline-block;
}

/* Hard spacing fallback: prevents Login and Sign Up from touching even if a
   page-specific stylesheet changes flex/gap behavior. */
.cw-auth-nav-item > a + a {
  margin-left: 0.75rem;
}
.cw-auth-nav-item .cw-auth-signup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cw-auth-signup {
  background: #fbbf24 !important;
  color: #111827 !important;
  border: 0 !important;
  border-radius: 0.5rem;
  padding: 0.5rem 0.85rem !important;
  font-weight: 800;
}

.cw-auth-signup:hover {
  background: #fcd34d !important;
  color: #111827 !important;
}

.cw-logout-form {
  margin: 0;
  padding: 0;
}

.cw-auth-logout {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #e5e7eb;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0 0 0.3rem;
}

.cw-auth-logout:hover {
  color: #fbbf24;
  border-bottom-color: #fbbf24;
}


/* Authenticated user controls */
.cw-auth-profile {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  white-space: nowrap;
  color: #f3f4f6;
}
.cw-auth-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fbbf24;
  color: #111827;
  font-size: .78rem;
  font-weight: 800;
  flex: 0 0 28px;
}
.cw-auth-profile-link { white-space: nowrap; }
@media (max-width: 1250px) {
  .cw-auth-profile {
    width: 100%;
    padding: .75rem 1.5rem;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255,255,255,.06);
  }
  .cw-auth-profile-link { width: 100%; }
}

/* Mobile nav */
@media (max-width: 1250px) {
  .cw-nav-toggle { display: inline-block; }

  .cw-nav { justify-content: flex-end; }

  .cw-nav-list {
    position: absolute;
    z-index: 1000;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: #111827;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
    transition: max-height 0.25s ease;
  }

  .cw-nav-list.cw-open {
    max-height: min(80vh, 620px);
    visibility: visible;
    pointer-events: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 12px 24px rgba(0,0,0,.3);
  }

  .cw-nav-list li { width: 100%; }

  .cw-nav-list a {
    display: block;
    width: 100%;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid transparent;
  }

  .cw-nav-list a:hover,
  .cw-nav-list a.cw-active {
    border-bottom-color: rgba(255, 255, 255, 0.06);
    border-left-color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
  }


  .cw-auth-nav-item {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
  }

  .cw-auth-nav-item > a + a {
    margin-left: 0;
  }

  .cw-auth-nav-item > a,
  .cw-auth-nav-item .cw-logout-form,
  .cw-auth-logout {
    width: 100%;
  }

  .cw-auth-signup {
    border-radius: 0 !important;
    padding: 0.9rem 1.5rem !important;
  }

  .cw-auth-logout {
    display: block;
    text-align: left;
    padding: 0.9rem 1.5rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid transparent;
  }

  .cw-auth-logout:hover {
    border-bottom-color: rgba(255, 255, 255, 0.06);
    border-left-color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.cw-footer {
  background: #0b1220;
  color: #d1d5db;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  margin-top: 2rem;
}

.cw-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2rem;
}

@media (max-width: 900px) {
  .cw-footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 520px) {
  .cw-footer-inner {
    grid-template-columns: 1fr;
    padding: 2.5rem 1.25rem 1.5rem;
  }
}

.cw-footer-col h4 {
  color: #fbbf24;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cw-footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cw-footer-col a {
  color: #d1d5db;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}
.cw-footer-col a:hover { color: #fbbf24; }

.cw-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  padding: 1.25rem 1.5rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

.cw-footer-bottom a { color: #fbbf24; text-decoration: none; }
.cw-footer-bottom a:hover { text-decoration: underline; }

/* ==========================================================================
   PWA Install button + iOS "Add to Home Screen" modal
   ========================================================================== */
#cw-install-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0b1220;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border: none;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45), 0 2px 6px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
#cw-install-btn.cw-show { display: inline-flex; animation: cw-install-pop 0.35s ease; }
#cw-install-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(245, 158, 11, 0.55), 0 3px 8px rgba(0,0,0,0.3); }
#cw-install-btn:active { transform: translateY(0); }
.cw-install-ico { font-size: 1.05rem; line-height: 1; }

@keyframes cw-install-pop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@media (max-width: 520px) {
  #cw-install-btn { right: 12px; bottom: 12px; padding: 0.65rem 1rem; font-size: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  #cw-install-btn.cw-show { animation: none; }
  #cw-install-btn:hover { transform: none; }
}

#cw-ios-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(11, 18, 32, 0.6);
  backdrop-filter: blur(3px);
}
#cw-ios-modal.cw-open { display: flex; }
.cw-ios-card {
  position: relative;
  max-width: 400px;
  width: 100%;
  background: #ffffff;
  color: #111827;
  border-radius: 1rem;
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}
.cw-ios-card h3 { margin: 0 0 0.6rem; font-size: 1.25rem; color: #0b1220; }
.cw-ios-card p { margin: 0 0 0.9rem; font-size: 0.95rem; line-height: 1.5; color: #374151; }
.cw-ios-card ol { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.55rem; font-size: 0.92rem; line-height: 1.45; color: #374151; }
.cw-ios-card strong { color: #0b1220; }
.cw-ios-close {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
}
.cw-ios-close:hover { color: #111827; }


/* ===== 2026 SEO / UX upgrade ===== */
:root{--cw-ink:#0f172a;--cw-muted:#475569;--cw-brand:#0f766e;--cw-brand2:#14b8a6;--cw-soft:#f0fdfa;--cw-line:#e2e8f0}
.cw-seo-hero{max-width:1180px;margin:0 auto;padding:42px 20px 18px}
.cw-breadcrumb{font-size:.86rem;color:#64748b;margin-bottom:16px}.cw-breadcrumb a{color:#0f766e;text-decoration:none}.cw-seo-hero h1{font-size:clamp(2rem,4vw,3.5rem);line-height:1.05;margin:.2rem 0 .9rem;color:var(--cw-ink);letter-spacing:-.03em}.cw-seo-hero .lede{font-size:1.1rem;line-height:1.7;color:var(--cw-muted);max-width:780px;margin:0}.cw-actions{display:flex;gap:12px;flex-wrap:wrap;margin:24px 0}.cw-actions a{display:inline-flex;align-items:center;justify-content:center;padding:12px 18px;border-radius:10px;text-decoration:none;font-weight:700}.cw-actions .primary{background:#0f766e;color:#fff}.cw-actions .secondary{background:#fff;color:#0f766e;border:1px solid #99f6e4}
.cw-intent-grid{max-width:1180px;margin:10px auto 38px;padding:0 20px;display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.cw-intent-card{border:1px solid var(--cw-line);border-radius:16px;padding:20px;background:#fff;box-shadow:0 8px 28px rgba(15,23,42,.05)}.cw-intent-card h3{margin:.1rem 0 .45rem;color:var(--cw-ink)}.cw-intent-card p{margin:0;color:var(--cw-muted);line-height:1.65}.cw-intent-card a{display:inline-block;margin-top:12px;color:#0f766e;font-weight:700;text-decoration:none}
.cw-topic{max-width:920px;margin:0 auto;padding:8px 20px 50px}.cw-topic h2{font-size:1.7rem;margin:30px 0 12px;color:var(--cw-ink)}.cw-topic h3{font-size:1.2rem;margin:24px 0 8px}.cw-topic p,.cw-topic li{color:#334155;line-height:1.75}.cw-topic ul,.cw-topic ol{padding-left:1.3rem}.cw-note{background:#f8fafc;border-left:4px solid #14b8a6;padding:16px 18px;border-radius:8px;margin:20px 0}.cw-faq-seo details{border:1px solid var(--cw-line);border-radius:10px;margin:10px 0;padding:14px 16px;background:#fff}.cw-faq-seo summary{cursor:pointer;font-weight:700;color:var(--cw-ink)}.cw-related{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:20px}.cw-related a{border:1px solid var(--cw-line);padding:14px;border-radius:10px;text-decoration:none;color:#0f766e;font-weight:700;background:#fff}
.cw-plan-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin:22px 0}.cw-plan-card{border:1px solid var(--cw-line);border-radius:16px;overflow:hidden;background:#fff}.cw-plan-card .plan-visual{height:180px;background:#f8fafc;display:flex;align-items:center;justify-content:center}.cw-plan-card svg{width:92%;height:88%}.cw-plan-card .plan-copy{padding:16px}.cw-plan-card h3{margin:0 0 6px}.cw-plan-card p{font-size:.94rem;margin:0}.cw-plan-card a{display:inline-block;margin-top:12px;color:#0f766e;font-weight:700;text-decoration:none}
@media(max-width:800px){.cw-intent-grid,.cw-plan-grid,.cw-related{grid-template-columns:1fr}.cw-seo-hero{padding-top:28px}.cw-topic{padding-bottom:35px}}
