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

body {
  background: #eaf4e7;
  background-image: radial-gradient(
    circle at 10% 30%,
    rgba(210, 180, 140, 0.08) 0%,
    transparent 35%
  );
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 1.5rem;
  flex-direction: column;
}

section {
  margin-top: 25px;
  margin-bottom: 25px;
}

.lesson-header {
  justify-content: center;
  align-items: center;
  text-align: center;
  line-height: 30px;
  color: #4e3c28;
}

h1 {
  font-family: serif;
  font-size: 3rem;
  margin-bottom: 30px;
}

.lesson-header p {
  font-style: italic;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.lesson-header img {
  width: 200px;
  border-radius: 20px;
  cursor: pointer;
}

.author-detail p {
  font-size: 1.5rem;
  font-weight: 500;
}

.lesson {
  max-width: 720px;
  width: 100%;
  border-radius: 2.5rem;
  transition: all 0.2s ease;
  backdrop-filter: blur(2px);
}

.lesson-card {
  margin-bottom: 20px;
  background: #ffffff;
  border-radius: 2.5rem;
  box-shadow:
    0 25px 45px -12px rgba(0, 0, 0, 0.15),
    0 8px 18px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: all 0.2s ease;
  border: 1px solid rgba(180, 140, 100, 0.2);
  backdrop-filter: blur(2px);
}

/* screenshot area – elegant frame */
.screenshot-section {
  background: #f3f8f6;
  padding: 1.8rem 1.8rem 0.8rem 1.8rem;
  position: relative;
}

.book-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.book-icon {
  color: #ffffff;
  text-align: center;
  font-size: 0.51rem;
  font-weight: 600;
  width: 50px;
  height: 45px;
  padding: 0.27rem;
  border-radius: 50%;
  background: #356b11;
  box-shadow: 0 4px 8px rgba(179, 146, 100, 0.3);
  display: inline-block;
}

.lesson-tag {
  color: #4e3c28;
  font-weight: 500;
  font-size: 0.9rem;
  background: #dfefd0;
  padding: 0.5rem;
  border-radius: 20px;
  width: 100%;
  text-align: center;
}

.screenshot-img {
  width: 100%;
  aspect-ratio: 25 / 25;
  overflow: hidden;
}

.screenshot-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.screenshot-thumb:hover .screenshot-img img {
  transform: scale(1.03);
}

.screenshots-gallery {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  padding: 0.5rem 0.2rem 0.8rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #4c702a #f1e8d9;
}

.screenshots-gallery::-webkit-scrollbar {
  height: 6px;
}

.screenshots-gallery::-webkit-scrollbar-track {
  background: #32881d;
  border-radius: 10px;
}

.screenshots-gallery::-webkit-scrollbar-thumb {
  background: #4c702a;
  border-radius: 10px;
}

.screenshot-thumb {
  flex: 0 0 68%;
  min-width: 200px;
  max-width: 280px;
  border-radius: 1.4rem;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(100, 70, 30, 0.18);
  position: relative;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
  justify-content: center;
  margin: auto;
}

.screenshot-thumb:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 24px rgba(100, 70, 30, 0.25);
}

.screenshot-thumb:active {
  transform: scale(0.97);
}

.page-label {
  position: absolute;
  bottom: 5px;
  right: 10px;
  background: rgba(0, 0, 1, 0.4);
  color: #ffffff;
  font-size: 0.65rem;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  z-index: 2;
  pointer-events: none;
}

.gallery-hint {
  font-size: 0.7rem;
  text-align: right;
  margin-top: 0.2rem;
  color: #74a873;
  letter-spacing: 0.3px;
}

/* Audio player section */
.audio-section {
  background: #ffffff;
  padding: 1.8rem 2rem 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.duration {
  border: 1px solid #74a873;
  padding: 0.3rem 0.9rem;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4e3c28;
  gap: 0.5rem;
  text-align: center;
}

.lesson-audio {
  flex: 1;
}

.audio-player-wrapper {
  background: #fdfdfd;
  border-radius: 2.5rem;
  padding: 0.7rem 1.5rem 0.7rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid #74a873;
  box-shadow: 0 6px 16px rgba(140, 110, 70, 0.08);
  transition: border 0.2s;
}

.audio-player-wrapper:focus-within {
  border-color: #4c702a;
  box-shadow: 0 0 0 3px rgba(200, 160, 110, 0.2);
}

audio {
  width: 100%;
  height: 40px;
  border-radius: 30px;
  background: transparent;
}

.download-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid #74a873;
  color: #4b3a28;
  padding: 0.4rem;
  border-radius: 50%;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  transition: 0.2s;
  margin-left: 0.3rem;
}

.download-link:hover {
  background: #74a873;
  color: #fff;
}

/* custom audio styling (limited but clean) */
audio::-webkit-media-controls-panel {
  background-color: #faf8f4;
  border-radius: 28px;
}

audio::-webkit-media-controls-play-button,
audio::-webkit-media-controls-mute-button {
  filter: sepia(0.4) hue-rotate(340deg);
}

.fa-circle-down {
  font-size: 20px;
}

.fa-circle-down:hover {
  color: #ffffff;
}

ul {
  list-style-type: square;
  margin-left: 25px;
}

/* ── Lesson Description with clamp & read more ── */
.lesson-description-wrapper {
  position: relative;
}

.lesson-description {
  color: #4e4336;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-top: 0.2rem;
  padding-right: 0.2rem;
  border-left: 3px solid #4c702a;
  padding-left: 1rem;
  font-weight: 400;
  background:  #dfefd0,;
  overflow: hidden;
  transition: max-height 0.5s ease;
  display: flex;
  flex-direction: column;
}

.lesson-description.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: calc(1.6em * 5);
  /* approximate 5 lines */
  position: relative;
}

.lesson-description.clamped::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2.5em;
  background: linear-gradient(to bottom, transparent, #fcf9f4);
  pointer-events: none;
}

.lesson-description.expanded {
  -webkit-line-clamp: unset;
  max-height: 2000px;
  display: flex;
  flex-direction: column;
  /* large enough to show all */
}

.lesson-description.expanded::after {
  display: none;
}

.read-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  border: none;
  color: #5a9c45;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0;
  margin-top: 0.3rem;
  transition: color 0.2s;
  font-family: "Inter", sans-serif;
  letter-spacing: 0.2px;
}

.read-more-btn:hover {
  color: #d4b185;
}

.read-more-btn .arrow {
  display: inline-block;
  transition: transform 0.3s ease;
  font-size: 0.7rem;
}

.read-more-btn.expanded .arrow {
  transform: rotate(180deg);
}

br {
  margin-bottom: 15px;
}

.footer-note {
  font-size: 0.75rem;
  color: #4b3a28;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 0.4rem;
  letter-spacing: 0.2px;
}

.shukr {
  font-family: "Amiri", serif;
  font-size: 1rem;
  color: #4b3a28;
}

/* Lightbox / Zoom Popup Styles */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: -10px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #ffffff;
  font-size: 1.8rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  z-index: 10;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: rotate(90deg);
  border-color: #ffffff;
}

.lightbox-image-container {
  border-radius: 1.5rem;
  overflow: hidden;
  max-width: 85vw;
  max-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lightbox-image-container img {
  max-width: 85vw;
  max-height: 75vh;
  object-fit: contain;
  display: block;
  border-radius: 1.5rem;
}

.lightbox-caption {
  color: #ffffff;
  margin-top: 0.8rem;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* Slider navigation buttons */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-10%);
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #ffffff;
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.25s;
  z-index: 10;
  backdrop-filter: blur(4px);
  line-height: 1;
  user-select: none;
}
.slider-btn:hover {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.7);
  color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(0.6px);
  transform: translateY(-10%) scale(1);
  transition: 0.3s ease;
}
.slider-btn:active {
  transform: translateY(-10%) scale(0.95);
}
.slider-btn.prev {
  left: 10px;
}
.slider-btn.next {
  right: 10px;
}
.slider-btn.hidden {
  display: none;
}

.lightbox-counter {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

.footer {
  border-top: 2px solid #32881d;
  padding-top: 10px;
  padding-left: 50px;
  padding-right: 50px;
  color: #4b3a28;
}
