/* --- GLOBAL STYLES & VARIABLE TOKENS --- */
:root {
  --bg-dark: #faf8f5;
  --bg-card: rgba(255, 255, 255, 0.65);
  --border-glow: rgba(133, 77, 14, 0.15);
  --border-light: rgba(133, 77, 14, 0.12);
  --gold: #854d0e;
  --gold-hover: #a16207;
  --gold-glow: rgba(133, 77, 14, 0.1);
  --white: #1e293b;
  --text-primary: #2d2922;
  --text-secondary: #57534e;
  --text-muted: #78716c;
  --font-title: 'Cinzel', serif;
  --font-body: 'Outfit', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  font-family: var(--font-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Starfield canvas overlay */
#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- PREMIUM NAVIGATION BAR --- */
.nav-header {
  background: rgba(250, 248, 245, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.logo {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.logo span {
  color: var(--gold);
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 30px;
}

nav a {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 6px;
}

nav a:hover, nav li.active > a {
  color: var(--gold);
  background: rgba(133, 77, 14, 0.06);
}

/* Dropdown styling */
nav li {
  position: relative;
}

nav li ul.submenu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 8px 0;
  flex-direction: column;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  gap: 0;
}

nav li:hover ul.submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(5px);
}

nav ul.submenu li {
  width: 100%;
}

nav ul.submenu li a {
  display: block;
  padding: 10px 20px;
  font-size: 0.9rem;
  text-transform: none;
  border-radius: 0;
  text-align: left;
}

nav ul.submenu li a:hover {
  background: rgba(133, 77, 14, 0.08);
  color: var(--gold);
}

/* Hamburger menu button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* --- HERO SECTION --- */
.hero {
  padding: 80px 0 40px;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-title);
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: 4px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--white) 30%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
  text-shadow: 0 2px 10px rgba(133, 77, 14, 0.05);
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-style: italic;
  letter-spacing: 1px;
}

/* --- HOMEPAGE DIRECTORY MODULE CARDS --- */
.modules {
  padding: 40px 0 80px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--transition);
  box-shadow: 0 8px 25px rgba(133, 77, 14, 0.06);
  cursor: pointer;
}

.module-card:hover {
  transform: translateY(-8px);
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 15px 40px var(--gold-glow);
}

.module-card h3 {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 20px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.module-card:hover h3 {
  color: var(--gold);
}

.module-card ul {
  list-style: none;
  width: 100%;
  border-top: 1px solid rgba(133, 77, 14, 0.15);
  margin-top: 15px;
  padding-top: 20px;
  text-align: left;
}

.module-card ul li {
  margin-bottom: 12px;
  font-size: 0.95rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
}

.module-card ul li i {
  color: var(--gold);
  margin-right: 12px;
  margin-top: 4px;
  font-size: 0.8rem;
}

/* --- ARTICLE LAYOUT (SIDEBAR & MAIN GLASS PANEL) --- */
.content-wrapper {
  padding: 40px 0 80px;
}

.article-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
}

/* Sidebar navigation */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 4px 15px rgba(133, 77, 14, 0.05);
  transition: var(--transition);
}

.sidebar-btn:hover, .sidebar-btn.active {
  transform: translateX(6px);
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 25px rgba(133, 77, 14, 0.15), inset 0 0 10px rgba(245, 158, 11, 0.05);
}

.sidebar-btn .icon {
  width: 36px;
  height: 36px;
  background: rgba(133, 77, 14, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--gold);
  margin-right: 15px;
  flex-shrink: 0;
  transition: var(--transition);
}

.sidebar-btn:hover .icon, .sidebar-btn.active .icon {
  background: var(--gold);
  color: var(--bg-dark);
  transform: rotate(10deg);
}

.sidebar-btn span {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}

.sidebar-btn:hover span, .sidebar-btn.active span {
  color: var(--white);
}

/* Main glass panel */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(133, 77, 14, 0.08);
  position: relative;
  min-height: 500px;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), transparent);
  border-radius: 16px 16px 0 0;
}

/* --- TYPOGRAPHY INSIDE ARTICLES --- */
.post-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  color: var(--gold);
  margin-bottom: 25px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.post-body p {
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 20px;
  text-align: justify;
  text-justify: inter-word;
}

.post-body p strong {
  color: var(--white);
}

.post-body h3 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: var(--gold);
  margin: 35px 0 15px;
  text-transform: uppercase;
}

.post-body ul, .post-body ol {
  margin-bottom: 20px;
  padding-left: 20px;
}

.post-body li {
  margin-bottom: 10px;
  font-size: 1.02rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--bg-card);
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  margin-bottom: 25px;
}

.back-btn:hover {
  background: rgba(133, 77, 14, 0.08);
  color: var(--gold);
  border-color: var(--gold);
  transform: translateX(-4px);
}

/* --- FOOTER --- */
footer {
  background: rgba(250, 248, 245, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-light);
  padding: 60px 0 40px;
  color: var(--text-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  border-bottom: 1px solid rgba(133, 77, 14, 0.15);
  padding-bottom: 40px;
  margin-bottom: 30px;
}

.footer-col h4 {
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 1.3rem;
  margin-bottom: 25px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-col p {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.98rem;
}

.footer-col p i {
  color: var(--gold);
  width: 20px;
  text-align: center;
}

.social-menu {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.social-menu a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.social-menu a:hover {
  background: rgba(133, 77, 14, 0.08);
  color: var(--gold);
  border-color: var(--gold);
  transform: translateY(-4px);
}

.copyright {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --- MOBILE RESPONSIVE STYLES --- */
@media (max-width: 992px) {
  .menu-toggle {
    display: block;
  }

  nav ul {
    position: fixed;
    top: 73px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 73px);
    background: var(--bg-dark);
    flex-direction: column;
    padding: 40px 0;
    transition: var(--transition);
    border-top: 1px solid var(--border-light);
    z-index: 999;
  }

  nav.active ul {
    left: 0;
  }

  nav li ul.submenu {
    position: static;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    padding: 0;
    max-height: 0;
    overflow: hidden;
  }

  nav li.active-submenu ul.submenu {
    max-height: 200px;
  }

  nav ul.submenu li a {
    text-align: center;
    padding: 10px 0;
  }

  .article-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-btn {
    flex: 1 1 calc(50% - 6px);
    justify-content: center;
    padding: 12px;
  }

  .sidebar-btn span {
    font-size: 0.9rem;
  }

  .sidebar-btn .icon {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
    margin-right: 10px;
  }

  .hero h1 {
    font-size: 2.2rem;
    letter-spacing: 2px;
  }
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }

  .footer-col p {
    justify-content: center;
  }

  .social-menu {
    justify-content: center;
  }

  .sidebar-btn {
    flex: 1 1 100%;
  }

  .glass-panel {
    padding: 25px 20px;
  }

  .post-title {
    font-size: 1.8rem;
  }
}

/* Bazi Calculator custom logo rebranding */
.bazi-force-container .logo-text-bazi {
  position: absolute !important;
  top: 15px !important;
  right: 240px !important;
  font-family: var(--font-title) !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  letter-spacing: 1px !important;
  color: var(--text-primary) !important;
  z-index: 10 !important;
  text-transform: uppercase !important;
  pointer-events: none !important;
}
.bazi-force-container .logo-text-bazi span {
  color: var(--gold) !important;
}
@media (max-width: 600px) {
  .bazi-force-container .logo-text-bazi {
    font-size: 10px !important;
    top: 5px !important;
    right: 50px !important;
  }
}
