/* The homepage's own CSS. Lifted verbatim out of page 2453's content (#56); each block
   below is the <style> that used to sit inside its section, in page order, unedited.
   Enqueued from functions.php on the front page only. */

/* ---------- hero ---------- */
/* ===============================
   HERO BASE
================================ */

.quran-hero {
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  direction: rtl;
  font-family: inherit;
  padding: 60px 20px;
  overflow: visible;
}

.quran-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
}

/* ===============================
   IMAGE
================================ */

.quran-hero-image {
  flex: 1;
  display: flex;

  justify-content: center;
}


.quran-hero-image-frame {
  width: 360px;
  height: 360px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  border: 3px solid rgba(113, 152, 129, 0.3);
  transition: border-color 1s ease, box-shadow 1s ease;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.quran-hero-image-frame::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #719881,
    #8fb89f,
    #b8d4c6,
    #5a7a67,
    #719881,
    #8fb89f,
    #719881
  );
  z-index: -1;
  opacity: 0;
  transition: opacity 1s ease;
  animation: rotateGlow 4s linear infinite;
  animation-play-state: paused;
  filter: blur(15px);
}

@keyframes rotateGlow {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.quran-hero-image-frame:hover::before {
  opacity: 1;
  animation-play-state: running;
}

.quran-hero-image-frame:hover {
  border-color: rgba(113, 152, 129, 0.8);
  box-shadow:
    inset 0 0 40px rgba(255, 255, 255, 0.2),
    inset 15px 0 60px rgba(113, 152, 129, 0.3),
    inset -15px 0 60px rgba(143, 184, 159, 0.3),
    inset 15px 0 200px rgba(113, 152, 129, 0.15),
    inset -15px 0 200px rgba(143, 184, 159, 0.15),
    0 0 30px rgba(113, 152, 129, 0.2),
    -8px 0 50px rgba(113, 152, 129, 0.3),
    8px 0 50px rgba(143, 184, 159, 0.3);
}

.quran-hero-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

/* ===============================
   CONTENT
================================ */

.quran-hero-content {
  flex: 1;
  text-align: start;   /* the section is rtl, so this is the same edge — and stays right if it ever is not (#56) */
}


.quran-hero-title {
  font-size: 3rem;
  line-height: 1.4;
  margin-bottom: 1.5rem;
  font-weight: 700;
  color: rgb(51, 51, 51);
}

.quran-hero-title span {
  display: block;
  font-size: 1.6rem;
  font-weight: 400;
  margin-top: 0.5rem;
  color: #5a7a67;
}

.quran-hero-description {
  font-size: 1.15rem;
  line-height: 2;
  max-width: 520px;
  color: rgb(51, 51, 51);
}


.quran-hero-description strong {
  color: #5a7a67;
  font-weight: 700;
}

/* ===============================
   SOCIALS
================================ */

.quran-hero-socials {
  margin-top: 2rem;
}

/* Social links enhancement */
.quran-hero-content [class*="powerkit"] a {
  transition: transform 0.3s ease, opacity 0.3s ease;
  display: inline-block;
}

.quran-hero-content [class*="powerkit"] a:hover {
  transform: translateY(-3px);
  opacity: 0.8;
}

/* ===============================
   RESPONSIVE
================================ */

@media (max-width: 900px) {
  .quran-hero {
    padding: 40px 20px;
  }

  .quran-hero-inner {
    flex-direction: column;
    text-align: center;
    gap: 3rem;
  }

  .quran-hero-content {
    text-align: center;
  }

  .quran-hero-description {
    margin: 0 auto;
  }

  .quran-hero-title {
    font-size: 2.2rem;
  }

  .quran-hero-title span {
    font-size: 1.3rem;
  }

  .quran-hero-image-frame {
    width: 280px;
    height: 280px;
  }
}

@media (max-width: 600px) {
  .quran-hero-title {
    font-size: 1.8rem;
  }

  .quran-hero-title span {
    font-size: 1.1rem;
  }

  .quran-hero-description {
    font-size: 1rem;
    line-height: 1.8;
  }

  .quran-hero-image-frame {
    width: 240px;
    height: 240px;
  }
}

/* ===============================
   OPTIONAL: Disable animations on reduced motion
================================ */

@media (prefers-reduced-motion: reduce) {
  /* The hero's entry animations are gone (#56), so there is nothing here to switch off any
     more. What is left is motion a person asks for — the glow that runs on hover.
     The skeletons below the fold do run on their own, though: shimmer loops until the fetch
     lands, which is the one thing on this page that moves without being asked. It holds still
     and stays visible as a plain grey block. */
  [class*="placeholder"],
  [class*="shimmer"] {
    animation: none !important;
  }

  .quran-hero-image-frame::before {
    display: none;
  }

  .quran-hero-image-frame:hover {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  }
}

 /* ===============================
     CV SUBTLE LINK
  ================================ */

  .quran-hero-more-link {
    display: inline-block;
    margin-top: 1.2rem;
    font-size: 0.95rem;
    color: #5a7a67;
    text-decoration: none;
    opacity: 0.75;   /* fadeInSoft used to land here; it is the resting state now (#56) */
    transition: letter-spacing 0.3s ease, opacity 0.3s ease;
  }


  .quran-hero-more-link:hover {
    opacity: 1;
    letter-spacing: 0.03em;
  }


  /* ===============================
     SOCIAL LABEL
  ================================ */

  .quran-hero-social-label {
    font-size: 0.82rem;
    color: rgb(51, 51, 51);
    opacity: 0.45;
    margin-bottom: 0.4rem;
  }

/* ---------- articles ---------- */
#category-posts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 20px 0;
  direction: rtl;
}

@media (max-width: 768px) {
  #category-posts-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

/* Shimmer Animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  animation: shimmer 2s infinite linear;
  background: linear-gradient(to right, #f5f5f5 4%, #e0e0e0 25%, #f5f5f5 36%);
  background-size: 1000px 100%;
}

.placeholder-card {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 30px 25px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.placeholder-title {
  height: 28px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 15px;
  width: 85%;
}

.placeholder-excerpt {
  height: 16px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 10px;
  width: 100%;
}

.placeholder-excerpt.short {
  width: 70%;
  margin-bottom: 20px;
}

.placeholder-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 15px;
}

.placeholder-category {
  height: 14px;
  background: #e0e0e0;
  border-radius: 4px;
  width: 60px;
}

.placeholder-date {
  height: 14px;
  background: #e0e0e0;
  border-radius: 4px;
  width: 100px;
}

/* Real Post Cards */
/* These three cards navigate, so home.js builds them as <a> now (#56) — they were divs with
   an onclick, which no keyboard could reach and no screen reader announced as controls.
   Being an anchor must not change how they look.
   Their `transition: all` is named out to the properties that actually change, too: with `all`
   it also animated `outline`, so the focus ring faded in over 300ms and a keyboard user tabbing
   through the cards was always looking at a ring still arriving. */
.post-card,
.category-card,
.video-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.post-card {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 30px 25px;
  transition: transform 0.3s ease, background 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .post-card {
    grid-column: span 1;
  }
}

.post-card:hover {
  background: #ebebeb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.post-card h3 {
  margin: 0 0 15px 0;
  font-size: 1.3em;
  line-height: 1.4;
  color: rgb(51, 51, 51);
  font-weight: 700;
}

.post-card h3 a {
  text-decoration: none;
  color: rgb(51, 51, 51);
}

.post-card h3 a:hover {
  color: var(--text-brand);   /* was #719881 — 3.23:1 as text (#56) */
}

.post-excerpt {
  color: var(--muted);   /* was #888 — 3.54:1 (#56) */
  font-size: 0.95em;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

/* The class collides with the parent theme's blog meta, which sets .post-meta to 0.625rem
   Montserrat uppercase. The card's own 0.85em compounded on that and landed the category and
   the date at 8.5px — below any floor, in a Latin face with no Arabic glyphs (#56). DESIGN.md
   §2.2 names --fs-sm as the floor for exactly this: labels, chips, captions, dates. */
.post-card .post-meta {
  font-size: var(--fs-sm);
  font-family: inherit;
  text-transform: none;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 15px;
}

.category-name {
  color: var(--muted);   /* was #888 — 3.54:1 (#56) */
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-date {
  color: var(--faint);   /* was #aaa — 2.32:1, the worst on the page (#56) */
}

/* CTA Cards */
.post-card.cta-card {
  padding: 0;
  min-height: 200px;
  overflow: hidden;
}

/* View All Card - Bordered with transparent background */
.view-all-card {
  background: transparent;
  border: 2px solid rgb(51, 51, 51);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  padding: 30px 20px;
}

.view-all-card:hover {
  border-color: #719881;
  background: rgba(113, 152, 129, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(89, 121, 101, 0.2);
}

.view-all-card h3 {
  color: rgb(51, 51, 51);
  margin: 0;
  font-size: 1.1em;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Stays the character, not a Material Symbol: an arrow set in the heading's own font takes the
   heading's 700 weight, where the icon font is pinned at 400 and reads hairline beside it (#89). */
.arrow-icon {
  font-size: 1.2em;
  transition: transform 0.3s ease;
}

.view-all-card:hover .arrow-icon {
  transform: translateX(-5px);
}

/* YouTube Card - Movie poster style */
.youtube-card {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.youtube-card-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.3s ease;
}

.youtube-card.no-image .youtube-card-bg {
  background: #FF0000;
}

.youtube-card:hover .youtube-card-bg {
  transform: scale(1.05);
}

.youtube-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.youtube-card.no-image::before {
  background: transparent;
}

.youtube-icon {
  position: relative;
  z-index: 2;
  width: 70px;
  height: 50px;
  transition: all 0.3s ease;
}

.youtube-card:hover .youtube-icon svg {
  fill: #FF0000;
}

.youtube-card.no-image:hover .youtube-icon svg {
  fill: white;
}

/* ---------- channel ---------- */
/* Videos Wrapper */
#videos-section-wrapper {
  max-width: 1400px;
  margin: 20px auto;
  direction: rtl;
}

/* Videos Grid */
#videos-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin-bottom: 40px;
}

@media (max-width: 1024px) {
  #videos-section {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  #videos-section {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 15px;
  }
}

/* Shimmer for videos */
.shimmer-video {
  background: transparent;
}

.shimmer-video-thumbnail {
  width: 100%;
  height: 220px;
  background: linear-gradient(to right, #e0e0e0 4%, #d0d0d0 25%, #e0e0e0 36%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: 12px;
}

.shimmer-video-content {
  padding: 15px 0;
}

.shimmer-video-title {
  width: 90%;
  height: 18px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 10px;
  animation: shimmer 2s infinite linear;
  background: linear-gradient(to right, #e0e0e0 4%, #d0d0d0 25%, #e0e0e0 36%);
  background-size: 1000px 100%;
}

.shimmer-video-title.short {
  width: 60%;
}

.shimmer-video-meta {
  width: 40%;
  height: 14px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-top: 12px;
  animation: shimmer 2s infinite linear;
  background: linear-gradient(to right, #e0e0e0 4%, #d0d0d0 25%, #e0e0e0 36%);
  background-size: 1000px 100%;
}

.shimmer-youtube-button {
  width: 250px;
  height: 56px;
  background: #e0e0e0;
  border-radius: 12px;
  margin: 0 auto;
  animation: shimmer 2s infinite linear;
  background: linear-gradient(to right, #e0e0e0 4%, #d0d0d0 25%, #e0e0e0 36%);
  background-size: 1000px 100%;
}


/* Video Cards - YouTube Style */
.video-card {
  background: transparent;
  transition: transform 0.3s ease, background 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
  border-radius: 12px;
  padding: 8px;
}

.video-card:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

/* Video Thumbnail */
.video-thumbnail {
  width: 100%;
  height: 220px;
  position: relative;
  overflow: hidden;
  background: #000;
  border-radius: 12px;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Hover Overlay - Shows on hover only */
.video-thumbnail-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  opacity: 0;
}

.video-card:hover .video-thumbnail-overlay {
  background: rgba(0, 0, 0, 0.6);
  opacity: 1;
}

/* YouTube Icon - Shows on hover only */
.youtube-icon-overlay {
  width: 70px;
  height: 70px;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

.video-card:hover .youtube-icon-overlay {
  opacity: 1;
  transform: scale(1);
}

.youtube-icon-overlay path {
  fill: #FF0000 !important;
}

/* Video Content */
.video-content {
  padding: 15px 8px 8px 8px;
}

.video-card h3 {
  margin: 0 0 10px 0;
  font-size: 1.05em;
  color: rgb(51, 51, 51);
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.video-card:hover h3 {
  color: var(--text-brand);   /* was #719881 — 3.23:1 as text (#56) */
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 0.85em;
  color: #666;
}

.video-views,
.video-date {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* No colour of its own: a glyph inherits `color`, where the SVG it replaced needed its own
   `fill` and drifted to a second neutral. It now matches the text beside it (#89). */
.video-meta .material-symbols-rounded {
  font-size: 16px;
}

/* Videos CTA Section */
.videos-cta-section {
  text-align: center;
  padding: 20px 0;
}

.youtube-channel-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #FF0000;
  color: white;
  padding: 16px 40px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1em;
  transition: transform 0.3s ease, background 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.youtube-channel-button:hover {
  background: #CC0000;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
}

.youtube-icon-button {
  width: 24px;
  height: 24px;
  fill: white;
}

.error-message {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  grid-column: 1 / -1;
}

/* ---------- categories ---------- */
/* Categories Grid - Using Flexbox for proper centering */
#other-categories-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin: 20px auto;
  max-width: 1200px;
  direction: rtl;
}

@media (max-width: 768px) {
  #other-categories-grid {
    gap: 12px;
    padding: 0 15px;
  }
}

/* Shimmer for categories */
.shimmer-category {
  background: linear-gradient(to right, #f5f5f5 4%, #e0e0e0 25%, #f5f5f5 36%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
}

.shimmer-icon {
  width: 45px;
  height: 45px;
  background: #e0e0e0;
  border-radius: 50%;
  margin-bottom: 12px;
}

.shimmer-title {
  width: 90px;
  height: 16px;
  background: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 8px;
}

.shimmer-count {
  width: 55px;
  height: 13px;
  background: #e0e0e0;
  border-radius: 4px;
}

/* Category Cards - Smaller to fit 6 in one row */
.category-card {
  background: #f5f5f5;
  border-radius: 16px;
  padding: 25px 15px;
  transition: transform 0.3s ease, background 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
  text-align: center;
  width: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

@media (max-width: 1100px) {
  .category-card {
    width: 180px;
  }
}

@media (max-width: 768px) {
  .category-card {
    width: 150px;
    padding: 20px 12px;
  }
}

.category-card:hover {
  background: var(--brand-600);   /* the h3 on it turns white — was 3.23:1, now 5.12 (#56) */
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(113, 152, 129, 0.3);
}

.category-icon {
  width: 45px;
  height: 45px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  transition: transform 0.3s ease;
  padding: 11px;
}

.category-card:hover .category-icon {
  transform: scale(1.1);
}

.category-icon .material-symbols-rounded {
  font-size: 23px;   /* the 45px disc less its 11px padding */
  color: rgb(51, 51, 51);
  transition: color 0.3s ease;
}

.category-card:hover .category-icon .material-symbols-rounded {
  color: var(--icon-brand);   /* a graphic, so 3:1 — the rung the system picks for exactly this (#56) */
}

.category-card h3 {
  margin: 0 0 6px 0;
  font-size: 0.9em;
  color: rgb(51, 51, 51);
  font-weight: 700;
  transition: color 0.3s ease;
  line-height: 1.3;
}

.category-card:hover h3 {
  color: white;
}

.category-count {
  font-size: 0.75em;
  color: var(--muted);   /* was #888 — 3.54:1 (#56) */
  transition: color 0.3s ease;
}

.category-card:hover .category-count {
  color: rgba(255, 255, 255, 0.9);
}

.category-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-brand);   /* was #719881 — 3.23:1 as text (#56) */
  width: 100%;
}

/* ---------- books ---------- */
/* Books Wrapper */
#books-wrapper {
  max-width: 1400px;
  margin: 20px auto;
  direction: rtl;
  padding: 0 20px;
  overflow: visible;
}

/* Books flow, they are not placed (#56).
   A grid hands every row the same track count, so five books in a four-track row left the fifth
   alone against the edge and a sixth would have moved the problem rather than solved it. A
   centred wrap has no track count to disagree with: a short last row sits in the middle, which
   reads as the end of a shelf instead of a gap. Any number of books lays out, and adding one
   changes nothing here. The basis carries the breakpoints the columns used to. */
#books-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 30px;
  margin-bottom: 50px;
  padding-top: 20px;
  overflow: visible;
  --book-w: 250px;
}

@media (max-width: 1200px) {
  #books-section {
    gap: 25px;
    --book-w: 220px;
  }
}

@media (max-width: 768px) {
  #books-section {
    gap: 20px;
    padding: 0;
    --book-w: 180px;
  }
}

@media (max-width: 480px) {
  #books-section {
    gap: 15px;
    --book-w: 140px;
  }
}

/* Shimmer Animation */

/* Shimmer for poster books */
.shimmer-book-poster {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 2/3;
  background: linear-gradient(to right, #e0e0e0 4%, #d0d0d0 25%, #e0e0e0 36%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: 8px;
  position: relative;
}

.shimmer-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
  border-radius: 0 0 8px 8px;
}

.shimmer-text-line {
  height: 18px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  margin-bottom: 10px;
}

.shimmer-text-line.short {
  width: 65%;
  height: 14px;
}

.shimmer-button-cta {
  width: 200px;
  height: 56px;
  background: linear-gradient(to right, #e0e0e0 4%, #d0d0d0 25%, #e0e0e0 36%);
  background-size: 1000px 100%;
  border-radius: 12px;
  animation: shimmer 2s infinite linear;
}

/* Poster Book Cards - Book-like proportions */
.book-card-poster {
  flex: 0 1 var(--book-w, 250px);
  max-width: 280px;
  aspect-ratio: 2/3;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  /* no cursor: pointer — the cover is not clickable, and saying it is was a lie (#56) */
  background-color: #f8f8f8;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.book-card-poster::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15) 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.1) 100%
  );
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.book-card-poster:hover {
  transform: scale(1.05);
  border-color: rgba(113, 152, 129, 0.5);
}

.book-card-poster:hover::before {
  opacity: 0.3;
}

.book-card-poster:hover .book-overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.75) 50%,
    rgba(0, 0, 0, 0.3) 80%,
    transparent 100%
  );
  padding: 24px 18px;
}

/* Book Overlay - Improved readability */
.book-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 16px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.7) 45%,
    rgba(0, 0, 0, 0.35) 75%,
    transparent 100%
  );
  transition: all 0.4s ease;
  border-radius: 0 0 8px 8px;
  backdrop-filter: blur(2px);
}

.book-card-poster h3 {
  margin: 0 0 10px 0;
  font-size: 1.05em;
  color: #ffffff;
  font-weight: 700;
  line-height: 1.5;
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.5),
    0 1px 3px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.01em;
}

.book-series-badge {
  display: inline-block;
  font-size: 0.7em;
  color: #ffffff;
  background: var(--brand-600);   /* white on #719881 was 3.23:1; nearest rung that clears 4.5 — 5.12:1 (#56) */
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 600;
  margin-top: 8px;
  letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
}

.book-card-poster:hover .book-series-badge {
  background: var(--brand-700);   /* one rung down on hover — 6.87:1 */
  transform: translateY(-2px);
}

.book-subtitle-overlay {
  /* The title above it is right-aligned and this was not: a block in an RTL card still takes
     text-align from the LTR document unless it says otherwise (#56). */
  text-align: start;
  font-size: 0.8em;
  color: rgba(255, 255, 255, 0.95);
  margin: 8px 0;
  line-height: 1.5;
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.6),
    0 1px 3px rgba(0, 0, 0, 0.8);
  font-weight: 500;
}

/* Contact Section */
.books-contact-section {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 25px;
  padding: 30px;
  margin-top: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  flex-wrap: wrap;
}

.contact-header-text {
  font-size: 1.2em;
  font-weight: 700;
  color: #2c3e50;
  white-space: nowrap;
}

.contact-buttons-wrapper {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .books-contact-section {
    flex-direction: column;
    padding: 25px 20px;
    margin-top: 15px;
    gap: 20px;
  }

  .contact-header-text {
    font-size: 1.15em;
    text-align: center;
  }

  .contact-buttons-wrapper {
    gap: 12px;
    justify-content: center;
  }
}

/* Contact Buttons */
.contact-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05em;
  transition: transform 0.3s ease, background 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  border: none;
  cursor: pointer;
  position: relative;
}

.contact-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.contact-button:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

.whatsapp-button-contact {
  background: linear-gradient(135deg, #25D366 0%, #1ea952 100%);
  color: white;
}

.whatsapp-button-contact:hover {
  background: linear-gradient(135deg, #1ea952 0%, #128C7E 100%);
}

.phone-button-contact {
  background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-700) 100%);   /* white label was 3.23:1 at the light end (#56) */
  color: white;
}

.phone-button-contact:hover {
  background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-800) 100%);
}

.contact-icon {
  width: 22px;
  height: 22px;
  fill: white;
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.contact-button:hover .contact-icon {
  transform: scale(1.1);
}

/* Responsive text sizing */
@media (max-width: 768px) {
  .book-card-poster h3 {
    font-size: 0.95em;
  }

  .book-subtitle-overlay {
    font-size: 0.75em;
  }

  .book-series-badge {
    font-size: 0.65em;
    padding: 4px 10px;
  }

  .contact-button {
    padding: 14px 28px;
    font-size: 1em;
  }
}

@media (max-width: 480px) {
  .book-card-poster h3 {
    font-size: 0.9em;
  }

  .book-overlay {
    padding: 16px 12px;
  }

  .contact-button {
    padding: 14px 28px;
    font-size: 0.95em;
    width: 100%;
    justify-content: center;
  }

  .contact-buttons-wrapper {
    width: 100%;
    flex-direction: column;
  }

  .contact-header-text {
    font-size: 1.05em;
  }
}
