/* --- Modern Header Styles (hgj = Hajj Guide JS) --- */
/* ————————————————
   Royal-Islamic Header Override
   ———————————————— */
:root {
  /* deep → mid blue page bg for header */
  --hgj-bg:             var(--bg-start);
  /* white text on dark bg */
  --hgj-fg:             var(--text-light);
  /* gold border under header */
  --hgj-border:         var(--primary-gold);
  /* gold for active links */
  --hgj-active:         var(--primary-gold);
  /* subtle gold tint on hover */
  --hgj-hover-bg:       rgba(212,175,55,0.2);
  /* very light gold bg for the “current” link */
  --hgj-item-active-bg: rgba(212,175,55,0.1);
  /* use your standard card shadow */
  --hgj-shadow:         var(--shadow-md);
  /* muted grey text for taglines */
  --hgj-fg-muted:       var(--text-muted);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* on dark mode, use your mid-tone blue bg */
    --hgj-bg:             var(--bg-mid);
    --hgj-fg:             var(--text-light);
    --hgj-border:         var(--primary-gold);
    --hgj-active:         var(--primary-gold);
    --hgj-hover-bg:       rgba(212,175,55,0.2);
    --hgj-item-active-bg: rgba(212,175,55,0.1);
    --hgj-shadow:         var(--shadow-lg);
    --hgj-fg-muted:       var(--text-muted);
  }
}

body.hgj-nav-open { overflow: hidden; }

.hgj-header {
  background: var(--hgj-bg); color: var(--hgj-fg);
  border-bottom: 1px solid var(--hgj-border); box-shadow: var(--hgj-shadow);
  position: sticky; top: 0; z-index: 1000;
}
.hgj-header-container {
  max-width: 1200px; /* Aligned with your main theme */
  margin: 0 auto; padding: 1rem;
  display: flex; justify-content: space-between; align-items: center;
}
.hgj-header-brand a { text-decoration: none; color: inherit; }
.hgj-header-brand h1 { margin: 0; font-size: 1.25rem; font-family: 'Inter', sans-serif; }
.hgj-toggle { display: none; font-size: 2rem; background: none; border: none; color: inherit; cursor: pointer; }
.hgj-nav { display: flex; align-items: center; gap: 1rem; }
.hgj-nav a {
  color: inherit; text-decoration: none; padding: 0.5rem 0.9rem;
  border-radius: 0.5rem; transition: all 0.15s ease; font-weight: 500;
}
.hgj-nav a:hover { background: var(--hgj-hover-bg); color: var(--hgj-active); }
.hgj-nav a.active { background: var(--hgj-item-active-bg); color: var(--hgj-active); font-weight: 700; }
.hgj-lang { position: relative; }
.hgj-lang-btn {
  display: flex; align-items: center; gap: 0.5rem; background: transparent;
  border: 1px solid var(--hgj-border); padding: 0.4rem 0.8rem;
  color: inherit; font-weight: 500; cursor: pointer; border-radius: 0.5rem;
}
.hgj-lang-btn:hover { border-color: var(--hgj-active); background: var(--hgj-hover-bg); }
.hgj-lang-icon { font-size: 1.2rem; }
.hgj-lang-arrow { font-size: 0.7rem; margin-left: 0.2rem; }
.hgj-lang-dropdown {
  display: none; position: absolute; top: 110%; left: 0; min-width: 140px;
  background: var(--hgj-bg); border: 1px solid var(--hgj-border);
  box-shadow: var(--hgj-shadow); z-index: 1100; border-radius: 0.5rem; padding: 0.25rem;
}
.hgj-lang-dropdown.show { display: block; }
.hgj-lang-dropdown a { display: block; padding: 0.5rem 0.9rem; color: inherit; text-decoration: none; border-radius: 0.3rem; }
.hgj-lang-dropdown a.active { background: var(--hgj-item-active-bg); color: var(--hgj-active); }

@media (max-width: 768px) {
  .hgj-toggle { display: block; }
  .hgj-nav {
    position: fixed; top: 0; bottom: 0; width: 80vw; max-width: 300px;
    background: var(--hgj-bg); flex-direction: column; align-items: flex-start;
    padding: 5rem 1.5rem; transform: translateX(-110%);
    transition: transform 0.3s ease-in-out; z-index: 1001; left: 0; overflow-y: auto;
  }
  html[dir="rtl"] .hgj-nav { left: auto; right: 0; transform: translateX(110%); }
  .hgj-nav.show { transform: translateX(0); }
  .hgj-lang-dropdown { position: static; margin-top: 0.4rem; box-shadow: none; border: none; padding: 0; }
}

/* --- Add this to /css/header.css --- */

.hgj-header-brand a {
  text-decoration: none;
  color: inherit;
}

.hgj-header-brand .brand-title {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}

.hgj-header-brand .brand-tagline {
  display: block;
  font-size: 0.85rem;
  color: var(--hgj-fg-muted, #666); /* Assumes a muted color variable */
  opacity: 0.8;
}

/* Ensure nav links don't wrap on desktop */
@media (min-width: 769px) {
  .hgj-nav {
    flex-wrap: nowrap;
  }
}

/* --- PWA Install Instruction Modal --- */
.hgj-install-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.hgj-install-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}
.hgj-install-modal {
  background: var(--hgj-bg);
  color: var(--hgj-fg);
  padding: 2rem;
  border-radius: 1rem;
  max-width: 90vw;
  width: 400px;
  box-shadow: var(--hgj-shadow);
  text-align: left;
}
.hgj-install-modal h3 {
  margin-top: 0;
  font-family: 'Inter', sans-serif;
}
.hgj-install-modal ol {
  padding-left: 1.5rem;
  line-height: 1.6;
}
.hgj-install-modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none; border: none;
  font-size: 1.5rem; color: inherit;
  cursor: pointer; opacity: 0.7;
}

/* ==========================================================================
   Fix: PWA Install Modal Readability on Desktop
   ========================================================================== */

/*
 * This ensures that all text elements inside the modal use the correct
 * foreground color from the header's theme (--hgj-fg), which is light
 * in dark mode. The !important flag is used to guarantee this override
 * against any conflicting global styles from theme.css.
*/
.hgj-install-modal h3,
.hgj-install-modal p,
.hgj-install-modal li {
  color: var(--hgj-fg) !important;
}

/* A small layout improvement for the list inside the modal */
.hgj-install-modal ol {
  margin-top: 1rem;
  margin-bottom: 0;
}

