* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: linear-gradient(to bottom, #0a0e1a 0%, #1a1f2e 100%);
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(to bottom, #0a0e1a 0%, #1a1f2e 100%) !important;
  color: #fff;
  overflow-x: hidden;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* Text size (settings.js): cycle via AAA icon, persisted in localStorage */
body.text-normal {
  font-size: 100%;
}
body.text-large {
  font-size: 115%;
}
body.text-huge {
  font-size: 130%;
}

.app {
  min-height: 100vh;
  background: linear-gradient(to bottom, #0a0e1a 0%, #1a1f2e 100%);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 80px;
}
.app > .category-list-container {
  margin-bottom: 20px;
}
.app > .main-content {
  margin-top: 0;
}

/* Top Navigation */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  margin-bottom: 20px;
  background: linear-gradient(to bottom, #0a0e1a 0%, #1a1f2e 100%);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-icon {
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.nav-icon-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: calc(25% - 12px);
  transform: translateX(-50%);
}

.nav-icon-logo img {
  height: 24px;
  width: auto;
}

.nav-title {
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  margin: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.pwa-install-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid #374151;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pwa-install-btn:hover { background: rgba(255, 255, 255, 0.12); }
.pwa-install-btn svg { width: 18px; height: 18px; }

/* Category List – minimal space below so verse button sits close */
.category-list-container {
  padding: 0;
  margin-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.category-list {
  display: flex;
  gap: 12px;
  padding: 10px 20px;
  min-width: max-content;
}

.category-btn {
  padding: 8px 20px;
  border-radius: 20px;
  border: none;
  background-color: #1a1a1a;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.category-btn.active {
  background-color: #fff;
  color: #000;
}

.category-btn:hover:not(.active) {
  background-color: #2a2a2a;
}

/* Main Content – no top padding so verse section is flush */
.main-content {
  flex: 1;
  padding: 0 20px 24px;
  margin-top: 0;
}
.main-content > *:first-child {
  margin-top: 0;
}
/* Vertical spacing between each section on the landing page */
.main-content > * + * {
  margin-top: 24px;
}

.content-section {
  margin-bottom: 0; /* spacing handled by * + * above */
}

.section-title {
  font-size: 20px;
  font-weight: 400;
  color: #fff;
  margin-top: 0;
  margin-bottom: 6px;
}

/* Verse of the Day – section is only a wrapper; no background, no extra space */
.content-section.verse-of-the-day-section,
.verse-of-the-day-section {
  margin: 0;
  padding: 0;
  gap: 0;
  background: transparent !important;
  min-height: 0;
}
.verse-of-the-day-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.main-content > #featured-directions-section .section-title,
.main-content > .section-featured .section-title {
  margin-top: 0;
  margin-bottom: 10px;
}

.verse-of-the-day-toggle {
  /* Button is exactly the image – no aspect-ratio box, no letterboxing */
  display: block;
  width: 100%;
  max-width: min(100%, 480px);
  padding: 0;
  margin: 0;

  border: none;
  border-radius: 0;
  background: none !important;
  box-shadow: none;
  outline: none;
  color: inherit;

  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}
.verse-of-the-day-toggle:focus {
  outline: none;
}
.verse-of-the-day-toggle:focus-visible {
  outline: none;
}

/* Image in flow – button wraps it, no letterboxing */
.verse-of-the-day-bg-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  vertical-align: top;
  pointer-events: none;
  background: none !important;
}

.verse-of-the-day-toggle::before,
.verse-of-the-day-toggle::after {
  display: none !important;
}

.verse-of-the-day-toggle:hover {
  opacity: 0.95;
}

.verse-of-the-day-toggle:active {
  opacity: 0.9;
}

/* Hide text overlay completely – out of flow so no gap above/below button */
.verse-of-the-day-toggle-text {
  position: absolute !important;
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  clip-path: inset(100%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: -1 !important;
}
.verse-of-the-day-toggle-text .section-title,
.verse-of-the-day-section .section-title,
.verse-of-the-day-toggle-text .verse-of-the-day-hint {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
}

.verse-of-the-day-hint {
  font-size: 14px;
  opacity: 0.9;
  margin-top: 4px;
  font-weight: 400;
}

.verse-of-the-day-chevron {
  display: none;
}

.verse-of-the-day-body {
  display: none;
  margin-top: 12px;
  width: 100%;
  max-width: 560px;
}

.verse-of-the-day-section.is-expanded .verse-of-the-day-body {
  display: block;
}

.verse-of-the-day-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 20px;
}

.verse-of-the-day-text {
  font-size: 17px;
  line-height: 1.55;
  color: #e2e8f0;
  margin: 0 0 12px 0;
  font-style: italic;
}

.verse-of-the-day-ref {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 14px 0;
  font-weight: 600;
}

.verse-of-the-day-share {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  background-color: #e3af4a;
  color: #000;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s;
}

.verse-of-the-day-share:hover {
  background-color: #f0bc5f;
}

.verse-of-the-day-share:active {
  background-color: #cc9d3f;
}

.horizontal-list-wrapper {
  position: relative;
}

.horizontal-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.horizontal-list::-webkit-scrollbar {
  display: none;
}

/* Desktop: scroll arrows for horizontal lists */
.horizontal-list-arrow {
  display: none;
}
@media (min-width: 769px) {
  .horizontal-list-arrow {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
  }
  .horizontal-list-arrow:hover {
    background: rgba(0, 0, 0, 0.85);
  }
  .horizontal-list-arrow-left {
    left: 8px;
  }
  .horizontal-list-arrow-right {
    right: 8px;
  }
}

.list-placeholder {
  min-width: 200px;
  height: 150px;
  background-color: #1a1a1a;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 14px;
  padding: 20px;
  text-align: center;
}

.list-card {
  width: 280px;
  min-width: 280px;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
a.list-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Featured Directions - narrow portrait cards with white outline */
.section-featured .list-card {
  border: 1px solid rgba(255, 255, 255, 0.35);
  width: 150px;
  min-width: 150px;
  height: 220px;
}

/* Recommended Books - same white outline as Featured Directions */
.section-books .list-card {
  border: 1px solid rgba(255, 255, 255, 0.35);
  width: 310px;
  min-width: 310px;
  height: 220px;
}

.section-books {
  margin-bottom: 2px;
}

/* Videos - landscape cards */
.section-videos .list-card {
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 320px;
  min-width: 320px;
  height: 180px;
}

/* Listen Now: 2x2 grid of biblical book covers with play icon; links ready for audio */
.listen-now-section {
  margin-bottom: 16px;
}
.listen-now-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 560px;
}
.listen-now-card {
  display: block;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-decoration: none;
  color: inherit;
  aspect-ratio: 1;
}
.listen-now-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.listen-now-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.listen-now-play-icon svg {
  width: 48px;
  height: 48px;
}
.listen-now-card:hover {
  border-color: rgba(255, 215, 0, 0.5);
}
.listen-now-card:focus-visible {
  outline: 2px solid rgba(255, 215, 0, 0.8);
  outline-offset: 2px;
}

.list-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.list-card-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  width: 32px;
  height: 32px;
}

.list-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.list-card-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: #fff;
  padding: 16px 12px 12px;
  font-size: 32px;
  font-weight: 600;
}

@media (max-width: 768px) {
  /* Stretch verse button edge-to-edge on mobile (break out of main-content padding) */
  .verse-of-the-day-section {
    display: flex !important;
    width: calc(100% + 40px) !important;
    max-width: 100vw;
    margin-left: -20px !important;
    margin-right: -20px !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 0 !important;
    box-sizing: border-box;
  }

  .verse-of-the-day-toggle {
    width: 100%;
    max-width: none; /* Stretch full width on mobile */
    min-width: 0;
    padding: 0;
    flex-shrink: 0;
    visibility: visible !important;
    opacity: 1 !important;
  }
  .verse-of-the-day-bg-img {
    width: 100%;
    height: auto;
  }

  .verse-of-the-day-section .section-title {
    font-size: 12px;
    line-height: 1.2;
  }

  .verse-of-the-day-section .verse-of-the-day-hint {
    font-size: 9px;
    margin-top: 1px;
    line-height: 1.2;
  }

  .list-card {
    width: 200px;
    min-width: 200px;
    height: 140px;
  }

  /* Featured Directions - narrow portrait cards */
  .section-featured .list-card {
    border: 1px solid rgba(255, 255, 255, 0.35);
    width: 120px !important;
    min-width: 120px !important;
    height: 190px !important;
  }

  /* Recommended Books - same white outline */
  .section-books .list-card {
    border: 1px solid rgba(255, 255, 255, 0.35);
    width: 220px;
    min-width: 220px;
    height: 154px;
  }

  /* Videos - landscape, larger */
  .section-videos .list-card {
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 260px;
    min-width: 260px;
    height: 146px;
  }

  .list-card img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    max-width: 100% !important;
    max-height: 100% !important;
  }

  .list-card-title {
    font-size: 22px;
    padding: 10px 8px 8px;
  }

  .list-card-icon {
    width: 24px;
    height: 24px;
    top: 6px;
    right: 6px;
  }

  /* Detail modal tablet styles - allow shrink to fit */
  .detail-modal {
    padding: 15px;
  }
  /* Header image: smaller max on tablet */
  .detail-modal.active .detail-image {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    max-height: 320px !important;
  }
  .detail-modal.active .detail-image img {
    min-height: 200px !important;
    max-height: 320px !important;
  }

  .detail-modal .detail-title,
  .detail-modal .detail-description {
    font-size: 26px !important;
    -webkit-text-size-adjust: 100%;
  }
  .detail-modal.recommended-book .detail-title,
  .detail-modal.recommended-book .detail-description {
    font-size: 18px !important;
  }

  /* Block layout on mobile so content overflows and modal scrolls (exclude video-only so video keeps flex and displays) */
  .detail-modal.active:not(.video-only):not(.card-list-only) {
    display: block !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
  }
  /* Video-only: keep flex on mobile so video/iframe has height */
  .detail-modal.active.video-only {
    display: flex !important;
    flex-direction: column;
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .detail-modal.active.video-only .detail-video {
    flex: 1 1 0;
    min-height: 0;
    position: relative;
  }
  .detail-modal.active.video-only .detail-video video,
  .detail-modal.active.video-only .detail-youtube-wrap {
    height: 100%;
  }
}

/* Listen Now: audio overlays (design from uploaded Over images) */
.audio-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.2s, opacity 0.2s;
}
.audio-overlay.is-open {
  visibility: visible;
  opacity: 1;
}
.audio-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}
.audio-overlay-panel {
  position: relative;
  width: 100%;
  max-width: 380px;
  border-radius: 16px;
  padding: 20px 16px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.audio-overlay-panel.song-gradient {
  background: linear-gradient(180deg, #5b7c99 0%, #3d5270 50%, #2a3650 100%);
}
.audio-overlay-panel.job-gradient {
  background: linear-gradient(180deg, #8b7355 0%, #5c4a3a 50%, #3d3328 100%);
}
.audio-overlay-panel.esther-gradient {
  background: linear-gradient(180deg, #7d6b8a 0%, #5a4a68 50%, #3d3149 100%);
}
.audio-overlay-panel.hosea-gradient {
  background: linear-gradient(180deg, #7d8f6e 0%, #4a5c3d 50%, #2d3d24 100%);
}
.audio-overlay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.audio-overlay-close:hover {
  color: #fff;
}
.audio-overlay-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px;
  text-align: center;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.audio-overlay-cover-wrap {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 12px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.audio-overlay-cover-wrap img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}
.audio-overlay-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 16px;
  text-align: center;
}
.audio-overlay-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}
.audio-overlay-back-next {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  padding: 8px 4px;
  -webkit-tap-highlight-color: transparent;
}
.audio-overlay-back-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.audio-overlay-chevron {
  font-size: 22px;
  line-height: 1;
}
.audio-overlay-slider-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.audio-overlay-time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
  min-width: 32px;
}
.audio-overlay-slider-wrap .audio-overlay-time:last-child {
  text-align: right;
}
.audio-overlay-slider {
  flex: 1;
  min-width: 0;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}
.audio-overlay-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.audio-overlay-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.audio-overlay-panel audio {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

