/**
 * Haleluya Psalms Books Unified Filter & Tabs
 * Google Stitch Design Style (Heritage & Horizon)
 * Hebrew RTL Support
 */

:root {
  --hal-primary: #004c6d;
  --hal-primary-hover: #003750;
  --hal-primary-container: #e6f3f8;
  --hal-surface: #ffffff;
  --hal-surface-alt: #f8fafc;
  --hal-gold: #c59b27;
  --hal-gold-soft: #fbf5e6;
  --hal-border: #e2e8f0;
  --hal-text-main: #1e293b;
  --hal-text-muted: #64748b;
  --hal-radius: 14px;
  --hal-radius-sm: 8px;
  --hal-shadow: 0 4px 16px rgba(0, 30, 60, 0.06);
  --hal-shadow-hover: 0 8px 24px rgba(0, 48, 80, 0.12);
  --hal-shadow-active: 0 8px 24px rgba(0, 76, 109, 0.25);
}

/* Hide the old Elementor buttons row when our unified tabs component is active */
.hal-old-buttons-hidden {
  display: none !important;
}

/* Main Container */
.hal-psalms-filter-wrapper {
  direction: rtl;
  text-align: right;
  font-family: 'Assistant', 'Work Sans', system-ui, -apple-system, sans-serif;
  margin: 15px auto 35px auto;
  max-width: 1200px;
  padding: 0 15px;
  box-sizing: border-box;
}

/* Bento Tabs Grid */
.hal-psalms-tabs-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .hal-psalms-tabs-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .hal-psalms-tabs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .hal-psalms-tabs-grid .hal-tab-card:last-child {
    grid-column: span 2;
  }
}

/* Tab Card */
.hal-tab-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  background: var(--hal-surface);
  border: 1.5px solid var(--hal-border);
  border-radius: var(--hal-radius);
  box-shadow: var(--hal-shadow);
  text-decoration: none !important;
  color: var(--hal-text-main) !important;
  cursor: pointer;
  user-select: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  text-align: center;
}

.hal-tab-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--hal-shadow-hover);
  border-color: #cbd5e1;
  color: var(--hal-primary) !important;
}

.hal-tab-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
  color: inherit;
}

.hal-tab-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--hal-surface-alt);
  color: var(--hal-text-muted);
  border: 1px solid #edf2f7;
  transition: all 0.25s ease;
}

/* Active Tab Card */
.hal-tab-card.is-active {
  background: linear-gradient(135deg, #004c6d 0%, #00344d 100%);
  border-color: var(--hal-primary);
  color: #ffffff !important;
  box-shadow: var(--hal-shadow-active);
  transform: translateY(-2px);
}

.hal-tab-card.is-active .hal-tab-title {
  color: #ffffff !important;
}

.hal-tab-card.is-active .hal-tab-badge {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Indicator accent */
.hal-tab-card.is-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--hal-gold);
  border-radius: 3px 3px 0 0;
}

/* Search Bar Container */
.hal-search-box-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--hal-surface);
  border: 1.5px solid var(--hal-border);
  border-radius: var(--hal-radius);
  padding: 8px 16px;
  box-shadow: var(--hal-shadow);
  transition: all 0.25s ease;
  margin-bottom: 16px;
}

.hal-search-box-wrap:focus-within {
  border-color: var(--hal-primary);
  box-shadow: 0 0 0 3px rgba(0, 76, 109, 0.15);
}

.hal-search-icon {
  width: 20px;
  height: 20px;
  fill: var(--hal-text-muted);
  margin-left: 10px;
  flex-shrink: 0;
}

.hal-search-input {
  flex: 1;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  font-size: 15px;
  color: var(--hal-text-main);
  font-family: inherit;
  direction: rtl;
  padding: 6px 0;
}

.hal-search-input::placeholder {
  color: #94a3b8;
}

.hal-search-clear {
  display: none;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  line-height: 22px;
  font-size: 13px;
  color: var(--hal-text-muted);
  cursor: pointer;
  text-align: center;
  padding: 0;
  transition: all 0.2s ease;
}

.hal-search-clear:hover {
  background: #e2e8f0;
  color: var(--hal-text-main);
}

/* Search Status / Cross-book Helper */
.hal-search-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--hal-text-muted);
  padding: 0 4px;
  margin-bottom: 10px;
  min-height: 22px;
}

.hal-cross-book-hint {
  display: none;
  background: var(--hal-gold-soft);
  color: #855d00;
  border: 1px solid #fae2a6;
  border-radius: var(--hal-radius-sm);
  padding: 8px 14px;
  margin-bottom: 15px;
  font-size: 14px;
  line-height: 1.5;
}

.hal-cross-book-hint a {
  color: var(--hal-primary);
  font-weight: 700;
  text-decoration: underline;
  margin-right: 6px;
  cursor: pointer;
}

/* Transition container for Posts Widget */
.hal-posts-transitioning {
  opacity: 0 !important;
  transform: translateY(8px) !important;
  transition: opacity 0.18s ease, transform 0.18s ease !important;
}

.hal-posts-ready {
  opacity: 1 !important;
  transform: translateY(0) !important;
  transition: opacity 0.22s ease, transform 0.22s ease !important;
}

/* Highlight matching search card */
.hal-card-matched {
  outline: 2px solid var(--hal-primary) !important;
  outline-offset: 3px;
  border-radius: 8px;
}

/* No results state */
.hal-no-results {
  text-align: center;
  padding: 40px 20px;
  background: var(--hal-surface);
  border-radius: var(--hal-radius);
  border: 1px dashed #cbd5e1;
  margin: 20px 0;
  color: var(--hal-text-muted);
}
.hal-no-results h4 {
  font-size: 18px;
  margin: 0 0 8px 0;
  color: var(--hal-text-main);
}


/* =========================================================================
   Single Psalm Chapter Navigation & Sidebar
   ========================================================================= */

.hal-chapter-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 10px 0 20px 0;
  box-sizing: border-box;
}

.hal-chapter-nav-bar.hal-nav-pos-bottom {
  margin: 30px 0 10px 0;
  padding-top: 15px;
  border-top: 1px dashed var(--hal-border);
}

.hal-nav-item {
  display: flex;
  align-items: center;
}

.hal-nav-prev {
  justify-content: flex-start;
}

.hal-nav-center {
  justify-content: center;
}

.hal-nav-next {
  justify-content: flex-end;
}

.hal-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: var(--hal-surface);
  border: 1.5px solid var(--hal-border);
  border-radius: var(--hal-radius);
  box-shadow: var(--hal-shadow);
  color: var(--hal-primary) !important;
  text-decoration: none !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  box-sizing: border-box;
  min-height: 48px;
}

.hal-nav-btn:hover {
  background: var(--hal-primary-container);
  border-color: var(--hal-primary);
  color: var(--hal-primary) !important;
  transform: translateY(-2px);
  box-shadow: var(--hal-shadow-hover);
}

.hal-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 76, 109, 0.08);
  color: var(--hal-primary);
  font-size: 13px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.hal-nav-btn:hover .hal-nav-icon {
  background: var(--hal-primary);
  color: #ffffff;
}

.hal-nav-btn-prev:hover .hal-nav-icon {
  transform: translateX(3px);
}

.hal-nav-btn-next:hover .hal-nav-icon {
  transform: translateX(-3px);
}

.hal-nav-text-group {
  display: flex;
  flex-direction: column;
  text-align: right;
  line-height: 1.25;
}

.hal-nav-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--hal-text-muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.hal-nav-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--hal-primary);
}

.hal-nav-book-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--hal-primary-container);
  border: 1.5px solid rgba(0, 76, 109, 0.18);
  border-radius: 30px;
  color: var(--hal-primary) !important;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.25s ease;
}

.hal-nav-book-badge:hover {
  background: var(--hal-primary);
  color: #ffffff !important;
  border-color: var(--hal-primary);
  transform: scale(1.03);
}

.hal-nav-book-icon {
  font-size: 13px;
  opacity: 0.85;
}

.hal-nav-book-range {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.85;
}

@media (max-width: 768px) {
  .hal-chapter-nav-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .hal-nav-center {
    order: -1;
    width: 100%;
    margin-bottom: 6px;
    justify-content: center;
  }
  .hal-nav-prev, .hal-nav-next {
    flex: 1 1 45%;
  }
  .hal-nav-btn {
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
  }
  .hal-nav-title {
    font-size: 13.5px;
  }
}

.hal-single-sidebar-widget {
  direction: rtl;
  text-align: right;
  font-family: 'Assistant', 'Work Sans', system-ui, -apple-system, sans-serif;
  box-sizing: border-box;
}

.hal-sb-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--hal-primary);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--hal-primary-container);
  margin-bottom: 16px;
}

.hal-sb-title-icon {
  color: var(--hal-primary);
  font-size: 16px;
}

.hal-sb-dropdown-wrap {
  margin-bottom: 14px;
}

.hal-sb-select {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--hal-text-main);
  background: var(--hal-surface-alt);
  border: 1.5px solid var(--hal-border);
  border-radius: var(--hal-radius-sm);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.hal-sb-select:focus {
  border-color: var(--hal-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 76, 109, 0.12);
}

.hal-sb-search-box {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.hal-sb-search-icon {
  position: absolute;
  right: 14px;
  color: #94a3b8;
  font-size: 14px;
  pointer-events: none;
}

.hal-sb-search-input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 36px;
  font-size: 13.5px;
  background: #ffffff;
  border: 1.5px solid var(--hal-border);
  border-radius: var(--hal-radius-sm);
  outline: none;
  color: var(--hal-text-main);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.hal-sb-search-input:focus {
  border-color: var(--hal-primary);
  box-shadow: 0 0 0 3px rgba(0, 76, 109, 0.1);
}

.hal-sb-search-clear {
  position: absolute;
  left: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #cbd5e1;
  color: #475569;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.hal-sb-books-tabs {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.hal-sb-book-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  background: var(--hal-surface-alt);
  border: 1px solid var(--hal-border);
  border-radius: var(--hal-radius-sm);
  color: var(--hal-text-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: right;
  box-sizing: border-box;
}

.hal-sb-book-pill:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--hal-primary);
}

.hal-sb-book-pill.is-active {
  background: var(--hal-primary);
  color: #ffffff;
  border-color: var(--hal-primary);
  box-shadow: 0 4px 10px rgba(0, 76, 109, 0.2);
}

.hal-sb-book-pill.is-active .hal-sb-book-pill-range {
  color: rgba(255, 255, 255, 0.85);
}

.hal-sb-book-pill-range {
  font-size: 11.5px;
  color: var(--hal-text-muted);
  font-weight: 500;
}

.hal-sb-grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--hal-text-muted);
  margin-bottom: 8px;
  padding: 0 2px;
}

.hal-sb-toggle-all {
  background: none;
  border: none;
  color: var(--hal-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.hal-sb-chapters-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--hal-border);
  border-radius: var(--hal-radius-sm);
  background: var(--hal-surface-alt);
  box-sizing: border-box;
}

.hal-sb-chap-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hal-text-main);
  text-decoration: none !important;
  transition: all 0.18s ease;
  user-select: none;
}

.hal-sb-chap-badge:hover {
  background: var(--hal-primary-container);
  border-color: var(--hal-primary);
  color: var(--hal-primary);
  transform: translateY(-1px);
}

.hal-sb-chap-badge.is-current {
  background: var(--hal-primary);
  color: #ffffff !important;
  border-color: var(--hal-primary);
  font-weight: 800;
  box-shadow: 0 3px 8px rgba(0, 76, 109, 0.3);
}

.hal-sb-chap-badge.is-book-hidden {
  display: none !important;
}

.hal-sb-chap-badge.is-search-hidden {
  display: none !important;
}

.hal-sb-chap-badge.is-search-match {
  outline: 2px solid var(--hal-primary);
  outline-offset: 1px;
}

.hal-sb-footer-link {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--hal-border);
}

.hal-sb-book-page-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 14px;
  background: var(--hal-surface);
  border: 1.5px solid var(--hal-primary);
  border-radius: var(--hal-radius-sm);
  color: var(--hal-primary) !important;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.hal-sb-book-page-btn:hover {
  background: var(--hal-primary);
  color: #ffffff !important;
}

/* =========================================================================
   Psalm Content: Original "Times New Roman" Serif Font Enriched & Enlarged
   ========================================================================= */

#hal_psalm_bento_card .elementor-widget-text-editor,
.elementor-element-hal_psalm_bento_card .elementor-widget-text-editor {
  color: #1e293b;
}

/* Verses text: strictly preserve original "Times New Roman" font and enlarge */
.elementor-element-hal_psalm_bento_card .elementor-widget-text-editor:has(.hal-verse-marker),
.elementor-element-hal_psalm_bento_card .elementor-widget-text-editor:has(.hal-verse-marker) p,
.elementor-element-hal_psalm_bento_card .elementor-widget-text-editor p:has(.hal-verse-marker),
.elementor-element-hal_psalm_bento_card p.hal-verses-text,
p.hal-verses-text,
.hal-verses-text {
  font-family: "Times New Roman", Times, "David", serif !important;
  font-size: 32px !important;
  font-weight: 700 !important;
  line-height: 2.15 !important;
  text-align: justify;
  letter-spacing: 0.2px;
}

#hal_psalm_bento_card .elementor-widget-heading .elementor-heading-title,
.elementor-element-hal_psalm_bento_card .elementor-widget-heading .elementor-heading-title {
  color: #004c6d;
  font-family: 'Assistant', 'Heebo', sans-serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.35;
}

@media (max-width: 1024px) {
  .elementor-element-hal_psalm_bento_card .elementor-widget-text-editor:has(.hal-verse-marker),
  .elementor-element-hal_psalm_bento_card .elementor-widget-text-editor:has(.hal-verse-marker) p,
  .elementor-element-hal_psalm_bento_card .elementor-widget-text-editor p:has(.hal-verse-marker),
  .elementor-element-hal_psalm_bento_card p.hal-verses-text,
  p.hal-verses-text,
  .hal-verses-text {
    font-size: 27px !important;
    line-height: 2.05 !important;
  }
}

@media (max-width: 767px) {
  .elementor-element-hal_psalm_bento_card .elementor-widget-text-editor:has(.hal-verse-marker),
  .elementor-element-hal_psalm_bento_card .elementor-widget-text-editor:has(.hal-verse-marker) p,
  .elementor-element-hal_psalm_bento_card .elementor-widget-text-editor p:has(.hal-verse-marker),
  .elementor-element-hal_psalm_bento_card p.hal-verses-text,
  p.hal-verses-text,
  .hal-verses-text {
    font-size: 23px !important;
    line-height: 1.95 !important;
  }
  #hal_psalm_bento_card .elementor-widget-heading .elementor-heading-title,
  .elementor-element-hal_psalm_bento_card .elementor-widget-heading .elementor-heading-title {
    font-size: 28px;
  }
}


/* =========================================================================
   Single Psalm Layout: 75% Chapter (Right) + 25% Filter (Left)
   ========================================================================= */

@media (min-width: 1025px) {
  .elementor-304911 .elementor-element.elementor-element-hal_root_container > .e-con-inner {
    display: flex;
    flex-direction: row;
    gap: 24px;
    align-items: flex-start;
  }

  /* Chapter Column (Right in RTL): 75% */
  .elementor-304911 .elementor-element.elementor-element-hal_main_content_col {
    --width: 75%;
    width: calc(75% - 12px);
    max-width: calc(75% - 12px);
    flex: 0 0 calc(75% - 12px);
    box-sizing: border-box;
  }

  /* Sidebar Filter Column (Left in RTL): 25% */
  .elementor-304911 .elementor-element.elementor-element-hal_sidebar_col {
    --width: 25%;
    width: calc(25% - 12px);
    max-width: calc(25% - 12px);
    flex: 0 0 calc(25% - 12px);
    box-sizing: border-box;
    position: sticky;
    top: 90px;
  }
}

@media (max-width: 1024px) {
  .elementor-304911 .elementor-element.elementor-element-hal_root_container > .e-con-inner {
    flex-direction: column;
  }
  .elementor-304911 .elementor-element.elementor-element-hal_main_content_col,
  .elementor-304911 .elementor-element.elementor-element-hal_sidebar_col {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }
}

/* Neutralize global button outline/border colors on sidebar components */
.hal-single-sidebar-widget button.hal-sb-book-pill {
  border: 1.5px solid #e2e8f0;
  background: var(--hal-surface-alt, #f8fafc);
  color: var(--hal-text-main, #1e293b);
  outline: none;
  box-shadow: none;
}

.hal-single-sidebar-widget button.hal-sb-book-pill:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--hal-primary, #004c6d);
}

.hal-single-sidebar-widget button.hal-sb-book-pill.is-active {
  background: var(--hal-primary, #004c6d);
  color: #ffffff;
  border-color: var(--hal-primary, #004c6d);
  box-shadow: 0 4px 10px rgba(0, 76, 109, 0.2);
}

.hal-single-sidebar-widget button.hal-sb-toggle-all {
  background: var(--hal-primary-container, #e6f3f8);
  border: 1px solid rgba(0, 76, 109, 0.25);
  border-radius: 6px;
  color: var(--hal-primary, #004c6d);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 10px;
  text-decoration: none;
  outline: none;
  box-shadow: none;
  transition: all 0.2s ease;
}

.hal-single-sidebar-widget button.hal-sb-toggle-all:hover {
  background: var(--hal-primary, #004c6d);
  color: #ffffff;
  border-color: var(--hal-primary, #004c6d);
}

/* =========================================================================
   Psalm Verse Markers: Smaller font size & unbolded
   ========================================================================= */

.hal-verse-marker {
  font-size: 0.74em !important;
  font-weight: 400 !important;
  color: #64748b !important;
  display: inline-block;
  margin-inline-start: 4px;
  margin-inline-end: 2px;
  line-height: 1;
  vertical-align: baseline;
  letter-spacing: 0;
  user-select: none;
}
