/* Base Styles */
body {
  margin: 1rem;
  font-family: Arial, sans-serif;
  background-color: #222;
  color: #fff;
  font-size: 1rem;
  line-height: 1.6;
}

a { 
  color: #D870FF; /* Adjusted for better contrast ratio against #222 */
}

.main-content {
  width: 80%;
  max-width: 1200px;
  margin: 0 auto;
  background-color: #222;
  padding: 20px;
  box-sizing: border-box;
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid var(--accent-color, #CA5FF5);
}

.sr-only {
  position: absolute; 
  width: 1px; 
  height: 1px; 
  padding: 0; 
  margin: -1px;
  overflow: hidden; 
  clip: rect(0, 0, 0, 0); 
  white-space: nowrap; 
  border: 0;
}

/* Header Component */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: #000000;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px; /* Increased for hit targets */
  border-bottom: 1px solid #444;
}

.header-left { 
  display: flex; 
  align-items: center; 
  gap: 0.5rem; 
  padding: 5px; 
}

#menuToggle { 
  cursor: pointer; 
  height: 60px; 
  display: flex; 
  justify-content: flex-start; 
  align-items: center; 
}

/* Form Elements */
input { 
  background-color: #333; 
  color: #fff; 
  border: 1px solid #ccc; 
  padding: 6px 10px; 
}

input::placeholder { 
  color: #eee; 
  opacity: 1; 
}

.bible-dropdown { 
  display: flex; 
  gap: 3px; 
}

select { 
  display: block; 
  padding: 6px; 
  background: #333; 
  color: #fff; 
}

#globalAudioPlayer {
  background-color: #121212;
  border-radius: 30px;
  height: 32px;
  width: 175px;
}

.header-center { 
  display: flex; 
  align-items: center; 
  gap: 0.5rem; 
  padding: 5px; 
}

.header-right { 
  display: flex; 
  align-items: center; 
  gap: 0.5rem; 
  padding: 5px; 
}

.bible-search-form { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  width: 200px; 
}

/* Buttons & Hero */
.hero-content { 
  max-width: 800px; 
  animation: fadeIn 0.8s ease; 
}

.hero-buttons { 
  margin-top: 20px; 
  display: flex; 
  gap: 15px; 
  justify-content: center; 
  flex-wrap: wrap; 
}

.btn { 
  border-radius: 6px; 
  padding: 14px 22px; 
  text-decoration: none; 
  font-weight: bold; 
  font-size: 1.1rem; 
  display: inline-block; 
  transition: background-color 0.2s ease; 
  outline: none; 
}

.cta-button + .cta-button { 
  margin-left: 20px; 
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Navigation Drawer */
.side-menu { 
  position: fixed; 
  top: 80px; 
  left: -280px; 
  width: 200px; 
  height: 100%; 
  background: #000; 
  padding: 20px; 
  transition: left 0.3s ease; 
  z-index: 9998; 
}

.side-menu.open { 
  left: 0; 
}

.side-menu a { 
  display: block; 
  padding: 12px 0; 
  text-decoration: none; 
  color: #fff; 
  font-size: 1em; 
}

/* Hero Overlay */
.bg-home {
  position: relative;
  min-height: 50vh;
  padding: 40px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.bg-home .bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
  filter: brightness(40%);
}

/* Footer Styles */
.site-footer {
  padding: 20px;
  background: #111;
  color: #fff;
  text-align: center;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.footer-nav a {
  color: #fff;
  text-decoration: none;
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.footer-left,
.footer-center,
.footer-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 5px;
}

footer img {
  display: block;
}

/* Rolodex Navigation Component */
.rolodex-nav {
  position: relative;
  display: inline-block;
  font-family: system-ui, sans-serif;
}

.rolodex-current {
  background: #222;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid #333;
  font-size: 14px;
  width: 180px;
  text-align: center;
}

.deck-container {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #111;
  padding: 10px;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  z-index: 1000;
  width: 200px;
}

.rolodex-nav:hover .deck-container,
.rolodex-nav:focus-within .deck-container {
  display: flex;
}

.book-dial {
  width: 100px;
  height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.book-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 75px;
  height: 50px;
  background: #222;
  color: #ccc;
  border: 1px solid #333;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
}

.book-trigger:hover,
.book-row:focus-within .book-trigger {
  background: #0066cc;
  color: #fff;
}

.chapter-dial {
  display: none;
  position: absolute;
  top: 10px;
  left: 100px;
  width: 70px;
  height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.chapter-link, 
.chapter-dial a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 50px;
  min-height: 50px;
  background: #2a2a2a;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid #3a3a3a;
  font-size: 13px;
}

.chapter-dial a:hover {
  background: #ff9900;
  color: #000;
}

.book-row:hover .chapter-dial,
.book-row:focus-within .chapter-dial {
  display: block;
}

/* Logo Slider */
.logo-slider {
  overflow: hidden;
  background: #ddd;
}

.logo-viewport {
  overflow: hidden;
  width: 100%;
}

.logo-track {
  display: flex;
  width: max-content;
  animation: scroll-logos 30s linear infinite;
}

.logo-item {
  flex-shrink: 0;
  padding: 0 2rem;
  display: flex;
  align-items: center;
}

.logo-item img {
  height: 40px;
  width: auto;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.logo-item a:hover img,
.logo-item a:focus-visible img {
  filter: grayscale(0%);
  opacity: 1;
}

.logo-slider:hover .logo-track,
.logo-slider:focus-within .logo-track {
  animation-play-state: paused;
}

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

/* Media Queries */
@media (min-width: 769px) {
  .mission-content, 
  .contact-grid, 
  .footer-content { 
    flex-direction: row; 
    align-items: flex-start; 
  }
  
  .footer-nav ul {
    flex-direction: row;
  }
}

@media (max-width: 768px) {
  .sticky-header { 
    flex-direction: column; 
    align-items: center; 
    padding: 1rem 0.5rem; 
    gap: 1rem; 
  }
  
  .header-left, 
  .header-center, 
  .header-right { 
    width: 100%; 
    justify-content: center; 
    padding: 0; 
  }
}

@media (max-width: 600px) {
  .side-menu { 
    width: 75vw; 
    left: -75vw; 
    padding: 16px; 
  }
  
  .side-menu a { 
    font-size: 1rem; 
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-track {
    animation: none;
  }
  
  .logo-item img {
    filter: none;
    opacity: 1;
  }
  
  .hero-content {
    animation: none;
  }
}

  .custom-audio-player {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #121212;
  border: 1px solid #ffffff;
  border-radius: 0;
  height: 25px;
  width: 175px;
  padding: 0 10px;
  box-sizing: border-box;
}

  .custom-audio-player button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
  }

  .custom-audio-player input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
  }

  .custom-audio-player input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
  }

  .custom-audio-player input[type="range"]::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
  }