/* Richer cards and direct actions for the public library. */
.material-card {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(11, 60, 50, .06);
  transition: transform .22s ease, box-shadow .22s ease;
}
.material-card:hover { transform: translateY(-5px); box-shadow: 0 16px 32px rgba(11, 60, 50, .14); }
.material-card h3 { min-height: 50px; }
.card-actions, .audio-actions { display: flex; align-items: center; gap: 7px; margin-top: 13px; }
.card-actions a, .audio-actions a, .card-view {
  display: inline-flex; align-items: center; justify-content: center; border: 1px solid #dce4dd;
  color: #0d4d40; border-radius: 4px; padding: 7px 9px; font: 700 10px Cairo, sans-serif;
}
.card-view { margin-top: 13px; }
.play-button.text-play, .audio-action-play {
  width: auto; height: auto; border-radius: 4px; padding: 7px 9px; font: 700 10px Cairo, sans-serif;
}
.audio-row { align-items: flex-start; }
.audio-row > div { flex: 1; }
.audio-actions { margin-top: 9px; }
.audio-action-play { background: #0d4d40; color: #fff; }
.icon-button {
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  display: inline-grid !important;
  place-items: center !important;
  font: 700 15px Arial, sans-serif !important;
}
.download-icon { background: #fff; color: #0d4d40 !important; }

/* A calmer, card-oriented treatment for the latest audio list. */
.audio-list { border: 0; display: grid; gap: 12px; }
.audio-row {
  position: relative;
  padding: 18px 18px 18px 15px;
  border: 1px solid #e5ebe5;
  border-right: 4px solid transparent;
  border-radius: 10px;
  background: linear-gradient(115deg, #fff, #fafcf9);
  box-shadow: 0 4px 14px rgba(12, 65, 53, .045);
  transition: .2s ease;
}
.audio-row:hover { border-right-color: #c9a35e; box-shadow: 0 10px 24px rgba(12, 65, 53, .1); transform: translateX(-3px); }
.audio-row > .play-button {
  width: 46px; height: 46px; flex: none;
  background: linear-gradient(135deg, #0d5c4d, #073d34);
  box-shadow: 0 5px 12px rgba(7, 61, 52, .22);
}
.audio-row h3 { font-size: 17px; line-height: 1.75; padding-left: 4px; }
.audio-row p { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 11px; margin-top: 5px; }
.audio-row p span { color: #0d4d40; font-weight: 700; }
.audio-row p i { color: #c9a35e; font-style: normal; }
.material-download {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  color: #0d4d40; border: 1px solid #d9e4dc; border-radius: 50%;
  background: #fff; transition: .2s ease;
}
.material-download svg { width: 19px; height: 19px; fill: currentColor; }
.material-download:hover { color: #fff; background: #c9a35e; border-color: #c9a35e; transform: translateY(-2px); }
.audio-row .more { margin-right: 0; color: #b4873d; width: 24px; text-align: center; }
@media (max-width: 500px) {
  .audio-row { padding: 14px 12px; gap: 9px; }
  .audio-row > .play-button { width: 42px; height: 42px; }
  .audio-row h3 { font-size: 15px; }
  .audio-row .more { display: none; }
}
.slider-controls button { border-radius: 50%; transition: .2s; }
.slider-controls button:hover { color: #fff; background: #0d4d40; border-color: #0d4d40; }
.cards-slider { scroll-snap-type: x mandatory; padding: 4px 2px 16px; }
.material-card { scroll-snap-align: start; }
@media (max-width: 500px) {
  .material-card { flex-basis: 255px; }
  .audio-row { gap: 10px; }
}

/* Home carousel: generous cards, a subtle gold media treatment, and clear direct actions. */
.latest-section { overflow: hidden; }
#latest-slider { gap: 22px; padding: 12px 6px 26px; scroll-padding-inline: 6px; }
#latest-slider .material-card {
  flex: 0 0 248px; border: 1px solid #e8e2d4; border-radius: 15px; background: #fff;
  box-shadow: 0 12px 28px rgba(8, 58, 47, .07);
}
#latest-slider .material-card:hover { transform: translateY(-7px); box-shadow: 0 20px 36px rgba(8, 58, 47, .14); }
#latest-slider .card-image {
  height: 164px; position: relative; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, #eee3c9, #c4a766);
}
#latest-slider .card-image::before {
  content: ''; position: absolute; inset: 10px; border: 1px solid rgba(255,255,255,.45); border-radius: 10px;
}
#latest-slider .card-image::after {
  content: ''; position: absolute; inset: 0; opacity: .28;
  background: radial-gradient(circle at 80% 20%, #fff 0 2px, transparent 3px) 0 0/26px 26px;
}
#latest-slider .card-image img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
#latest-slider .card-image span { position: relative; z-index: 1; color: #0b584a; font: 46px/1 Amiri, serif; }
#latest-slider .material-card > div { padding: 15px 16px 16px; }
#latest-slider .material-card h3 { min-height: 54px; margin: 8px 0 5px; line-height: 1.75; font-size: 14px; }
#latest-slider .material-card p { min-height: 20px; color: #87928c; font-size: 11px; }
#latest-slider .pill { background: #eff5f0; color: #0d5c4d; }
#latest-slider .card-actions { justify-content: flex-end; margin-top: 11px; }
#latest-slider .slider-download { padding: 0; border-radius: 50%; }
.slider-controls { display: flex; gap: 7px; direction: ltr; }
.slider-controls button { width: 38px; height: 38px; border-color: #d9d7cd; background: #fff; }

/* Latest fatwas are deliberately distinct, while preserving the audio controls when a recording exists. */
.fatwa-section { background: linear-gradient(120deg, #fbfaf5, #f3f7f2); border-block: 1px solid #ebe5d6; }
.fatwa-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; }
.fatwa-card {
  min-width: 0; display: flex; align-items: center; gap: 10px; padding: 15px 12px; border-radius: 12px;
  border: 1px solid #e5e9e1; border-top: 3px solid #c6a15c; background: #fff; box-shadow: 0 5px 16px rgba(9, 59, 48, .05);
}
.fatwa-symbol { color: #b98c3f; font-size: 24px; line-height: 1; }
.fatwa-copy { flex: 1; min-width: 0; }
.fatwa-card h3 { margin: 6px 0 4px; font-size: 13px; line-height: 1.7; }
.fatwa-card p { color: #829089; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fatwa-card p i { color: #c29c57; font-style: normal; }
.fatwa-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fatwa-actions .icon-button { background: #0d5c4d; color: #fff; }
.fatwa-actions .material-download { width: 30px; height: 30px; }
.fatwa-actions .material-download svg { width: 16px; height: 16px; }

/* A recognisable lower reading strip for books and letters. */
.bottom-books-strip { border-top: 5px solid rgba(201,163,94,.65); }
.bottom-books-strip .book-slider { padding-bottom: 8px; }
.book-header-actions { display: flex; align-items: center; gap: 16px; }
.book-header-actions > a { color: #fff; font-size: 13px; font-weight: 700; }
.book-slider { scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 4px 4px 12px; }
.book-card { scroll-snap-align: start; }
.book-controls button { width: 34px; height: 34px; color: #0d4d40; }

@media (max-width: 1000px) { .fatwa-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) {
  #latest-slider { gap: 14px; padding-bottom: 20px; }
  #latest-slider .material-card { flex-basis: 255px; }
  .fatwa-grid { grid-template-columns: 1fr; }
  .fatwa-card { padding: 14px; }
  .fatwa-actions { flex-direction: row; }
}
