header.cover {
  min-height: 200px !important;
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
}

header.cover .pv4,
header.cover .pv6-l {
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

/* Styles for audios page */
.audios-page .audio-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
  gap: 2rem !important;
  margin-bottom: 3rem !important;
}

.audios-page .audio-card {
  background: white !important;
  border-radius: 10px !important;
  padding: 1.5rem !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
  transition: transform 0.3s ease !important;
  text-align: center !important;
}

.audios-page .audio-card:hover {
  transform: translateY(-5px) !important;
}

.audios-page .audio-card h3 {
  margin-top: 0 !important;
  margin-bottom: 1rem !important;
  font-size: 1.25rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 3em !important;
}

.audios-page .card-content {
  margin-top: 1rem !important;
}

.audios-page .audio-link {
  display: inline-block !important;
  color: #3498db !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  padding: 0.5rem 1rem !important;
  border-radius: 5px !important;
  transition: background-color 0.3s ease !important;
}

.audios-page .audio-link:hover {
  background-color: #f8f9fa !important;
  color: #2980b9 !important;
}

@media (max-width: 900px) {
  .audios-page .audio-grid {
    display: block !important;
  }
  
  .audio-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 1rem !important;
    margin-bottom: 1rem !important;
  }

  .audio-card {
    min-width: unset !important;
    flex: 1 1 0 !important;
  }

  .audios-page .audio-card h3 {
    font-size: 0.9rem !important;
  }
}

@media (max-width: 480px) {
  .audio-row {
    flex-direction: column !important;
  }
}

/* Audio card specific fixes */
.audio-grid, .audio-card, .card-content, .audio-link {
  white-space: normal !important;
  word-break: normal !important;
  overflow: visible !important;
}

.audio-card h3, .audio-link {
  unicode-bidi: plaintext !important;
  direction: rtl !important;
}

.audio-card * {
  max-width: 100% !important;
}

.audio-card {
  display: block !important;
  text-decoration: none !important;
  color: inherit !important;
}

/* Responsive header font size for long titles */
header.cover h1.arabic-text {
  font-size: 2.25rem !important; /* Default size */
  line-height: 1.3 !important;
  overflow-wrap: break-word !important;
  hyphens: auto !important;
  padding: 0 1rem !important;
}

/* Add more padding to h1 headings in section pages */
h1.arabic-text.f2.f-subheadline-l.fw2.white-90.mb0.lh-title {
  padding-left: 3rem !important;
  padding-right: 3rem !important;
}

/* Gradually reduce font size depending on title length */
header.cover h1.arabic-text[data-length="long"] {
  font-size: 2rem !important;
}

header.cover h1.arabic-text[data-length="very-long"] {
  font-size: 1.75rem !important;
}

/* Media queries for better responsive behavior */
@media (max-width: 768px) {
  header.cover h1.arabic-text {
    font-size: 1.85rem !important;
    padding: 0 0.5rem !important;
  }
  
  h1.arabic-text.f2.f-subheadline-l.fw2.white-90.mb0.lh-title {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
  
  header.cover h1.arabic-text[data-length="long"] {
    font-size: 1.5rem !important;
  }
  
  header.cover h1.arabic-text[data-length="very-long"] {
    font-size: 1.25rem !important;
  }
}

@media (max-width: 480px) {
  header.cover h1.arabic-text {
    font-size: 1.5rem !important;
  }
  
  h1.arabic-text.f2.f-subheadline-l.fw2.white-90.mb0.lh-title {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  header.cover h1.arabic-text[data-length="long"] {
    font-size: 1.25rem !important;
  }
  
  header.cover h1.arabic-text[data-length="very-long"] {
    font-size: 1rem !important;
  }
}

/* Search input styling */
input#search {
  border: 1px solid #ccc !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  color: #333333 !important;
  transition: background-color 0.25s ease, color 0.25s ease !important;
}

input#search::placeholder {
  color: #888888 !important;
}

@media (prefers-color-scheme: dark) {
  input#search {
    background: #2f2f2f !important;
    color: #e0e0e0 !important;
    border: 1px solid #555555 !important;
  }
  input#search::placeholder {
    color: #bbbbbb !important;
  }
}

/* --- Hijri Date in Header --- */
.hijri-date-container {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
}

.hijri-date {
  color: rgba(255,255,255,0.75);
  font-size: 0.82rem;
  font-family: 'Noto Naskh Arabic', serif;
}

.hijri-date:empty {
  display: none;
}

@media (max-width: 480px) {
  .hijri-date {
    font-size: 0.78rem;
  }
}

/* --- Horizontal Navigation Bar --- */
.nav-bar-container {
  background: #fff;
  border-top: 3px solid #C5A059;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* Nav bar sits between header and main, no margin needed */

.nav-bar {
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0;
  direction: rtl;
}

.nav-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #4a6a7a;
  padding: 0.9rem 1.5rem;
  transition: all 0.2s ease;
  border-left: 1px solid #f0f0f0;
  min-width: 90px;
  position: relative;
}

.nav-bar-item:first-child {
  border-right: 1px solid #f0f0f0;
}

.nav-bar-item.nav-bar-active {
  border-bottom: 3px solid #C5A059;
  color: #C5A059;
  background: #fdf8f0;
}

.nav-bar-item:hover {
  background: #fdf8f0;
  color: #C5A059;
}

.nav-bar-item:hover .nav-bar-icon {
  transform: scale(1.12);
  color: #C5A059;
}

.nav-bar-icon {
  font-size: 1.6rem;
  margin-bottom: 0.35rem;
  transition: all 0.2s ease;
  color: #C5A059;
}

.nav-bar-label {
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Noto Naskh Arabic', serif;
  white-space: nowrap;
}

/* Dark Mode support for nav bar */
@media (prefers-color-scheme: dark) {
  .nav-bar-container {
    background: #1e1e1e;
    border-top-color: #C5A059;
    border-bottom-color: #333;
  }
  .nav-bar-item {
    color: #c0d0d8;
    border-left-color: #333;
  }
  .nav-bar-item:first-child {
    border-right-color: #333;
  }
  .nav-bar-item.nav-bar-active {
    border-bottom-color: #C5A059;
    color: #d4b06a;
    background: #2e2a1e;
  }
  .nav-bar-item:hover {
    background: #2e2a1e;
    color: #d4b06a;
  }
  .nav-bar-icon {
    color: #C5A059;
  }
  .nav-bar-item:hover .nav-bar-icon {
    color: #d4b06a;
  }
}

/* Responsive: tighter spacing on tablets */
@media (max-width: 900px) {
  .nav-bar-item {
    padding: 0.7rem 1rem;
    min-width: 80px;
  }
  .nav-bar-icon {
    font-size: 1.4rem;
  }
  .nav-bar-label {
    font-size: 0.8rem;
  }
}

/* Responsive: wrap last items to centered second row on small screens */
@media (max-width: 620px) {
  .nav-bar {
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav-bar-item {
    padding: 0.5rem 0.7rem;
    min-width: 65px;
    border-left: none;
  }
  .nav-bar-item:first-child {
    border-right: none;
  }
  .nav-bar-icon {
    font-size: 1.2rem;
  }
  .nav-bar-label {
    font-size: 0.72rem;
  }
}

/* --- Header Improvements --- */
/* Add a modern gradient overlay instead of flat black */
.bg-black-60 {
  background-color: transparent !important;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.8) 100%);
  position: relative;
}

/* Increase header text readability */
header.cover h1.arabic-text {
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  font-weight: 700 !important;
}

/* --- Breadcrumb Navigation --- */
nav.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.6rem 1.5rem;
  background-color: #f7f7f7;
  border-bottom: 1px solid #e8e8e8;
  font-size: 0.9rem;
  color: #888;
  direction: rtl;
}

.breadcrumb-item,
.breadcrumb-current {
  display: inline;
}

.breadcrumb-link {
  color: #888;
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-link:hover {
  color: #C5A059;
}

.breadcrumb-home {
  color: #C5A059;
  display: inline-flex;
  align-items: center;
}

.breadcrumb-home svg {
  vertical-align: middle;
}

.breadcrumb-sep {
  margin: 0 0.5rem;
  color: #bbb;
  font-weight: 300;
}

.breadcrumb-current {
  color: #555;
}

/* Dark Mode support for breadcrumbs */
@media (prefers-color-scheme: dark) {
  nav.breadcrumbs {
    background-color: #2a2a2a;
    border-bottom-color: #444;
    color: #aaa;
  }
  .breadcrumb-link {
    color: #aaa;
  }
  .breadcrumb-link:hover {
    color: #d4b06a;
  }
  .breadcrumb-home {
    color: #C5A059;
  }
  .breadcrumb-sep {
    color: #666;
  }
  .breadcrumb-current {
    color: #ddd;
  }
}

/* --- Latest Fatawa Section (Homepage) --- */
.latest-fatawa-section {
  direction: rtl;
}

.latest-fatawa-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #eee;
  padding-bottom: 0;
}

.latest-fatawa-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #C5A059;
  color: white;
  padding: 0.6rem 1.25rem;
  border-radius: 8px 8px 0 0;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: -2px;
}

.latest-fatawa-badge i {
  font-size: 1.3rem;
}

.latest-fatawa-more {
  color: #555;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
  padding-bottom: 0.6rem;
}

.latest-fatawa-more:hover {
  color: #C5A059;
}

.latest-fatawa-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.latest-fatawa-card {
  display: block;
  text-decoration: none !important;
  color: inherit !important;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  border-right: 4px solid #C5A059;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.latest-fatawa-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.latest-fatawa-card-inner {
  padding: 1.25rem 1.5rem;
}

.latest-fatawa-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.15rem;
  color: #2c3e50;
  line-height: 1.6;
}

.latest-fatawa-excerpt {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  color: #666;
  line-height: 1.7;
}

.latest-fatawa-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #999;
}

.latest-fatawa-cat {
  background: linear-gradient(135deg, #f0f4f8 0%, #e8edf2 100%);
  border: 1px solid #dce3ea;
  border-radius: 15px;
  padding: 0.15rem 0.6rem;
  font-size: 0.78rem;
  color: #3a4a5c;
}

/* Dark mode for latest fatawa */
@media (prefers-color-scheme: dark) {
  .latest-fatawa-more {
    color: #ccc;
  }

  .latest-fatawa-more:hover {
    color: #C5A059;
  }

  .latest-fatawa-card {
    background: #1e1e1e;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  }

  .latest-fatawa-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  }

  .latest-fatawa-card h3 {
    color: #e0e0e0;
  }

  .latest-fatawa-excerpt {
    color: #aaa;
  }

  .latest-fatawa-meta {
    color: #777;
  }

  .latest-fatawa-cat {
    background: #2a2a2a;
    border-color: #444;
    color: #bbb;
  }
}

@media (max-width: 480px) {
  .latest-fatawa-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .latest-fatawa-card-inner {
    padding: 1rem;
  }

  .latest-fatawa-card h3 {
    font-size: 1.05rem;
  }
} 