/*
Theme Name: Bible's Hidden Codes
Theme URI: https://bibleshiddencodes.com
Author: Bible's Hidden Codes
Description: Custom theme for bibleshiddencodes.com
Version: 1.0
*/

/* ── RESET & BASE ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:   #0a0f1a;
  --navy:    #0d1b35;
  --blue:    #1A5CB5;
  --ltblue:  #e8f0fc;
  --grey:    #888;
  --ltgrey:  #f5f5f3;
  --text:    #1a1a1a;
  --rule:    #ddd;
  --font:    Georgia, 'Times New Roman', serif;
  --sans:    'Arial', Helvetica, sans-serif;
  --max:     820px;
}

html { font-size: 17px; scroll-behavior: smooth; overflow-x: hidden; }
body { font-family: var(--font); color: var(--text); background: #fff; line-height: 1.75; overflow-x: hidden; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
p { margin-bottom: 1.1em; }
h1,h2,h3,h4 { font-family: var(--sans); line-height: 1.2; }

/* ── HEADER ───────────────────────────────────────────────────── */
#site-header {
  background: var(--navy);
  position: sticky; top: 0; z-index: 100;
  border-bottom: 2px solid var(--blue);
  width: 100%;
  left: 0;
  right: 0;
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 64px;
}
.site-logo {
  font-family: var(--sans); font-size: 1em; font-weight: 900;
  color: #fff; letter-spacing: 1px; line-height: 1.1;
}
.site-logo span { color: var(--blue); font-size: 1.3em; }
.site-logo small { display: block; font-size: 0.65em; font-weight: 400; color: #aab8cc; letter-spacing: 2px; }

/* ── NAV ──────────────────────────────────────────────────────── */
#primary-nav ul { list-style: none; display: flex; gap: 4px; }
#primary-nav > ul > li { position: relative; }
#primary-nav > ul > li > a {
  display: block; padding: 8px 14px;
  color: #ccd6f6; font-family: var(--sans); font-size: 0.82em;
  font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  border-radius: 4px; transition: background 0.15s, color 0.15s;
}
#primary-nav > ul > li > a:hover,
#primary-nav > ul > li.current-menu-item > a {
  background: var(--blue); color: #fff; text-decoration: none;
}
/* Dropdown */
#primary-nav ul ul {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--navy); border: 1px solid var(--blue);
  min-width: 280px; border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  max-height: 75vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
#primary-nav ul ul::-webkit-scrollbar { width: 4px; }
#primary-nav ul ul::-webkit-scrollbar-track { background: #0d1b35; }
#primary-nav ul ul::-webkit-scrollbar-thumb { background: #1A5CB5; border-radius: 2px; }
/* hover handled by JS */
#primary-nav ul ul li a {
  display: block; padding: 9px 16px;
  color: #ccd6f6; font-family: var(--sans); font-size: 0.78em;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.12s;
}
#primary-nav ul ul li a:hover { background: rgba(26,92,181,0.3); color: #fff; text-decoration: none; }
#primary-nav ul ul li:last-child a { border-bottom: none; }

/* Third level — chapters submenu opens to the right */
#primary-nav ul ul li { position: relative; }
#primary-nav ul ul ul {
  display: none; position: absolute; top: 0; left: 100%;
  background: var(--navy); border: 1px solid var(--blue);
  min-width: 280px; border-radius: 0 6px 6px 0;
  box-shadow: 8px 8px 24px rgba(0,0,0,0.4);
  max-height: 75vh; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
#primary-nav ul ul ul li a {
  display: block; padding: 9px 16px;
  color: #ccd6f6; font-family: var(--sans); font-size: 0.78em;
  border-bottom: 1px solid rgba(255,255,255,0.06); transition: background 0.12s;
}
#primary-nav ul ul ul li a:hover { background: rgba(26,92,181,0.3); color: #fff; text-decoration: none; }
/* Arrow indicator on items that have children */
#primary-nav ul ul li:has(ul) > a::after { content: ' ›'; color: var(--blue); float: right; }

/* Mobile nav toggle */
#nav-toggle {
  display: none; background: none; border: none;
  color: #fff; font-size: 1.5em; cursor: pointer; padding: 8px;
}

/* ── HERO ─────────────────────────────────────────────────────── */
.hero {
  background: var(--navy);
  background-image: 
    radial-gradient(ellipse at 70% 30%, rgba(255, 120, 20, 0.25) 0%, transparent 60%),
    radial-gradient(ellipse at 30% 70%, rgba(180, 30, 10, 0.2) 0%, transparent 55%),
    linear-gradient(135deg, #050a14 0%, #0d1b35 40%, #1a0a05 100%);
  color: #fff; text-align: center;
  padding: 70px 24px 60px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: 
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 10%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 60%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 10% 80%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 50%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(2px 2px at 60% 20%, rgba(255,160,50,0.3) 0%, transparent 100%),
    radial-gradient(3px 3px at 75% 40%, rgba(255,100,20,0.2) 0%, transparent 100%);
}
.hero-inner { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.hero-codes { font-family: var(--sans); font-size: clamp(1.4em, 4vw, 2.2em); font-weight: 900; letter-spacing: 2px; color: #fff; }
.hero-that { font-family: var(--sans); font-size: 1em; color: #8899bb; letter-spacing: 4px; text-transform: uppercase; margin: 6px 0; }
.hero-ai {
  font-family: var(--sans); font-size: clamp(4em, 14vw, 7em);
  font-weight: 900; color: #fff; line-height: 0.9;
  display: block; letter-spacing: -2px;
}
.hero-revealed { font-family: var(--sans); font-size: 1em; color: #8899bb; letter-spacing: 4px; text-transform: uppercase; margin: 6px 0 28px; }
.hero-tagline { font-style: italic; color: #aab8cc; font-size: 1em; margin-bottom: 8px; }
.hero-stamp {
  display: inline-block; border: 1px solid rgba(26,92,181,0.5);
  background: rgba(26,92,181,0.15); color: #8ab4f8;
  font-family: var(--sans); font-size: 0.72em; font-weight: 700;
  letter-spacing: 1px; padding: 6px 16px; border-radius: 20px;
  margin-top: 16px; text-transform: uppercase;
}
.hero-cta {
  display: inline-block; margin-top: 32px;
  background: var(--blue); color: #fff;
  font-family: var(--sans); font-weight: 700; font-size: 0.9em;
  padding: 12px 32px; border-radius: 4px;
  transition: background 0.2s; letter-spacing: 0.5px;
}
.hero-cta:hover { background: #1448a0; text-decoration: none; color: #fff; }

/* ── BOOK CARDS ───────────────────────────────────────────────── */
.book-cards {
  max-width: 1060px; margin: 60px auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px; padding: 0 24px;
}
.book-card {
  border: 1px solid var(--rule);
  border-top: 3px solid var(--blue);
  padding: 0; border-radius: 4px; overflow: hidden;
  transition: box-shadow 0.2s;
}
.book-card:hover { box-shadow: 0 6px 24px rgba(26,92,181,0.12); }
.book-card-img {
  width: 100%; height: 180px; object-fit: cover;
  display: block;
}
.book-card-img-placeholder {
  width: 100%; height: 180px;
  background: linear-gradient(135deg, var(--navy), #1a3060);
  display: flex; align-items: center; justify-content: center;
  color: #4a7ad5; font-family: var(--sans); font-size: 2.5em; font-weight: 900;
}
.book-card-body { padding: 20px 24px 24px; }
.book-card-num { font-family: var(--sans); font-size: 0.72em; color: var(--blue); font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px; }
.book-card h3 { font-size: 1.15em; color: var(--black); margin-bottom: 10px; }
.book-card p { font-size: 0.9em; color: #555; margin-bottom: 16px; }
.book-card a.card-link {
  font-family: var(--sans); font-size: 0.82em; font-weight: 700;
  color: var(--blue); letter-spacing: 0.5px;
}
.book-card a.card-link:hover { text-decoration: underline; }

/* ── INTRO SECTION ────────────────────────────────────────────── */
.intro-section {
  max-width: var(--max); margin: 0 auto 60px;
  padding: 0 24px;
}
.intro-section h2 { font-size: 1.4em; margin-bottom: 16px; color: var(--black); }
.intro-lead { font-size: 1.05em; color: #333; }

/* ── PAGE CONTENT ─────────────────────────────────────────────── */
.page-wrap {
  max-width: 1060px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 300px;
  gap: 40px; padding: 48px 24px 80px;
  overflow-x: hidden;
}
.page-wrap.no-sidebar { grid-template-columns: 1fr; max-width: var(--max); }
.page-content { min-width: 0; max-width: 100%; overflow-x: hidden; word-wrap: break-word; overflow-wrap: break-word; }

/* ── CHAPTER DROPDOWN ─────────────────────────────────────────── */
.ch-dropdown-wrap {
  margin: 0 0 32px;
  padding: 16px 20px;
  background: #f5f7fa;
  border: 1px solid #dde3ec;
  border-radius: 4px;
}
.ch-dropdown-label {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 0.8em;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: bold;
  margin-bottom: 10px;
}
.ch-dropdown {
  width: 100%;
  padding: 10px 14px;
  font-family: Georgia, serif;
  font-size: 0.95em;
  color: #222;
  background: #fff;
  border: 1px solid #c8d0dc;
  border-radius: 3px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231A5CB5' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.ch-dropdown:focus { outline: 2px solid var(--blue); outline-offset: 2px; }
.page-content h1 { font-size: 1.9em; margin-bottom: 8px; color: var(--black); }
.page-subtitle { font-style: italic; color: var(--grey); margin-bottom: 28px; font-size: 1em; }
.page-rule { border: none; border-top: 1px solid var(--rule); margin: 28px 0; }

/* ── DIVE DEEPER BLOCK ────────────────────────────────────────── */
.dive-block {
  border-top: 1px solid #ccc; border-bottom: 1px solid #ccc;
  padding: 18px 0; margin: 32px 0;
}
.dive-block h4 {
  font-family: var(--sans); font-size: 0.72em; color: var(--blue);
  letter-spacing: 3px; text-transform: uppercase; margin-bottom: 12px;
}
.dive-block a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; color: var(--text); font-size: 0.92em;
  border-bottom: 1px solid #f0f0f0; transition: color 0.15s;
}
.dive-block a:last-child { border-bottom: none; }
.dive-block a:hover { color: var(--blue); text-decoration: none; }
.dive-block a span { color: var(--blue); font-weight: 700; font-size: 0.85em; white-space: nowrap; margin-left: 12px; }

/* ── AI / JAYDEN BLOCKS ───────────────────────────────────────── */
.ai-label { color: var(--blue); font-weight: 900; font-size: 0.8em; font-family: var(--sans); }
.ai-response {
  background: #f8fafd; border-left: 3px solid var(--blue);
  padding: 14px 18px; margin: 16px 0; border-radius: 0 4px 4px 0;
}
.typed-q {
  background: #f5f5f0; font-family: 'Courier New', monospace;
  padding: 12px 16px; margin: 16px 0; font-size: 0.88em;
  border-left: 3px solid #aaa; color: #333;
}
.jayden { padding: 10px 0; font-style: italic; color: #333; }
.jayden .j-label { color: var(--blue); font-weight: 900; font-size: 0.8em; font-family: var(--sans); }
.gloss { font-style: italic; color: #666; font-size: 0.88em; padding-left: 20px; margin-bottom: 8px; }
.divider { text-align: center; color: #bbb; letter-spacing: 8px; margin: 28px 0; }
.back-link { font-family: var(--sans); font-size: 0.82em; margin-bottom: 24px; }
.back-link a { color: var(--blue); }

/* ── SIDEBAR ──────────────────────────────────────────────────── */
.page-sidebar { padding-top: 8px; }
.sidebar-widget {
  background: var(--ltgrey); border: 1px solid var(--rule);
  border-top: 3px solid var(--blue);
  padding: 20px; margin-bottom: 24px; border-radius: 4px;
}
.sidebar-widget h3 {
  font-family: var(--sans); font-size: 0.78em; color: var(--blue);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 14px;
}
.sidebar-widget ul { list-style: none; }
.sidebar-widget ul li { border-bottom: 1px solid #e8e8e8; }
.sidebar-widget ul li:last-child { border-bottom: none; }
.sidebar-widget ul li a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; font-size: 0.85em; color: var(--text);
  transition: color 0.15s;
}
.sidebar-widget ul li a:hover { color: var(--blue); text-decoration: none; }
.sidebar-widget ul li a::after { content: '›'; color: var(--blue); font-size: 1.2em; }
.sidebar-img { width: 100%; border-radius: 4px; margin-bottom: 24px; }

/* ── FOOTER ───────────────────────────────────────────────────── */
#site-footer {
  background: var(--navy); color: #8899bb;
  padding: 48px 24px 32px;
  font-family: var(--sans); font-size: 0.82em;
  width: 100%;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}
.footer-about p { line-height: 1.6; }
.footer-logo { font-size: 1.1em; font-weight: 900; color: #fff; margin-bottom: 12px; }
.footer-logo span { color: var(--blue); }
.footer-links h4 { color: #ccd6f6; font-size: 0.85em; letter-spacing: 1px; margin-bottom: 12px; text-transform: uppercase; }
.footer-links ul { list-style: none; }
.footer-links ul li { margin-bottom: 6px; }
.footer-links ul li a { color: #8899bb; }
.footer-links ul li a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  max-width: 1100px; margin: 32px auto 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px; text-align: center; color: #556;
}
.footer-verse { font-style: italic; color: #4a6fa5; margin-bottom: 6px; }

/* ── CHAPTER NAVIGATION ───────────────────────────────────────── */
.ch-nav {
  display: flex !important; flex-direction: row !important; flex-wrap: wrap !important;
  justify-content: space-between;
  margin: 48px 0 20px; padding: 20px 0;
  border-top: 1px solid var(--rule);
  gap: 12px !important;
}
.ch-nav a {
  font-family: var(--sans); font-size: 0.85em; font-weight: 700;
  color: var(--blue); padding: 10px 16px;
  border: 1px solid var(--blue); border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  display: inline-block !important; white-space: normal; word-break: break-word;
}
.ch-nav a:hover { background: var(--blue); color: #fff; text-decoration: none; }
.ch-nav-top { border-bottom: 1px solid var(--rule); margin-bottom: 24px; }
.bhc-ch-num { font-family: var(--sans); font-size: 0.78em; color: var(--grey); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 4px; }
.bhc-ch-title { font-size: 1.9em; color: var(--black); margin-bottom: 20px; }

/* ── CHAPTER LIST ON BOOK OVERVIEW ───────────────────────────── */
.chapter-list { list-style: none; margin: 24px 0; }
.chapter-list li { border-bottom: 1px solid var(--rule); }
.chapter-list li a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; color: var(--text); font-size: 0.95em;
  transition: color 0.15s;
}
.chapter-list li a:hover { color: var(--blue); text-decoration: none; }
.chapter-list li a span { color: var(--grey); font-size: 0.8em; font-family: var(--sans); }
.chapter-list li a::after { content: '›'; color: var(--blue); font-size: 1.3em; margin-left: 8px; }

/* ── WORDPRESS WRAPPER OVERRIDES ──────────────────────────────── */
.wp-site-blocks { padding: 0 !important; max-width: none !important; }
body > div { max-width: none !important; }

/* ── GRID CHILD FIX (prevents overflow on all screen sizes) ───── */
.page-content, .page-sidebar { min-width: 0; }

@media (max-width: 768px) {
  #primary-nav { display: none; }
  #nav-toggle { display: block; }
  #primary-nav.open { display: block; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy); border-top: 1px solid var(--blue); padding: 12px 0; z-index: 9999; max-height: calc(100vh - 64px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
  #primary-nav.open > ul { flex-direction: column; }
  /* Hide all submenus on mobile by default */
  #primary-nav.open ul ul { display: none !important; position: static; border: none; box-shadow: none; background: rgba(0,0,0,0.2); max-height: none; overflow: visible; }
  /* Show when toggled */
  #primary-nav.open ul ul.mobile-open { display: block !important; }
  /* Arrow indicator on items with children */
  #primary-nav.open > ul > li.has-children > a::after { content: ' ▾'; color: var(--blue); font-size: 0.8em; }
  .page-wrap { grid-template-columns: 1fr; padding: 24px 16px 60px; }
  .page-sidebar { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .hero-ai { font-size: 4em; }
  .entry-content { overflow-wrap: break-word; word-wrap: break-word; max-width: 100%; overflow-x: hidden; }
  .entry-content table { display: block; overflow-x: auto; }
  .entry-content blockquote { margin-left: 0; }
}
