/* =====================
   ABOUT PAGE
   ===================== */
:root {
  --page-color: #f8f5e6;
  --text-color: #333;
  --gap-extra: 1cm;
}

/* خلفية about: الديف بدون .page-bg */
.book-bg {
  position: fixed;
  inset: 0;
  background-image: url("images/about-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(3px);
  transform: scale(1.08);
  z-index: -2;
  opacity: 1;
}

.book-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Same cream wash as the rest of the site. */
  background:
    linear-gradient(rgba(244,240,229,.74), rgba(244,240,229,.66)),
    rgba(0,0,0,.04);
}

#aboutTitle {
  color: #36342e;
  text-shadow: 0 2px 3px rgba(255,255,255,0.6);
}

.about3d {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: flex-start;
}

main.container.about3d { padding-top: 28px; }

.aboutGrid {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: calc(32px + var(--gap-extra));
  width: 100%;
  padding: 10px 0;
  flex-wrap: wrap;
  height: auto;
  max-height: none;
  overflow: visible;
  box-sizing: border-box;
}

.aboutContent {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 780px;
}

main.container.about3d,
.aboutGrid,
.aboutContent {
  height: auto;
  max-height: none;
  overflow: visible;
}

/* RTL / LTR ordering */
html[dir="rtl"] .textFrameStage { order: 2; }
html[dir="rtl"] .aboutContent   { order: 1; }
html[dir="ltr"] .textFrameStage { order: 1; }
html[dir="ltr"] .aboutContent   { order: 2; }

.textFrameStage {
  width: clamp(280px, 28vw, 420px);
  perspective: 1000px;
  position: relative;
  margin: 0;
  flex: 0 0 auto;
}

/* كرت الكتاب 3D */
.textFrameHolder {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  transform-style: preserve-3d;
  transition: transform 0.65s ease;
  cursor: pointer;
  max-height: calc(100vh - 190px);
}

.textFrameHolder.flipped { transform: rotateY(180deg); }

.textFrame {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  backface-visibility: hidden;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(0,0,0,.25);
}

.textFrame--front {
  background-image: url("images/book-front.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: rgba(0,0,0,0.22);
  transform: translateZ(10px);
}

.textFrame--back {
  background-image: url("images/book-back.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: rgba(0,0,0,0.22);
  transform: rotateY(180deg) translateZ(10px);
}

.textFrame--pages {
  background: var(--page-color);
  transform: translateZ(5px);
}

.page-content {
  padding: 24px;
  height: 100%;
  overflow: auto;
  color: var(--text-color);
  line-height: 1.6;
}

#goalTitle,
#teamTitle,
#sourcesTitle {
  font-family: "El Messiri", sans-serif;
}

.page-content h3 {
  color: #5d4a1f;
  margin-top: 0;
  border-bottom: 1px solid #ddd;
  padding-bottom: 8px;
  font-size: 1.15rem;
}

.page-content p  { margin-bottom: 14px; }
.page-content ul { padding-right: 20px; margin-bottom: 14px; }
.page-content li { margin-bottom: 8px; }

.hint {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 13px;
  opacity: .95;
  text-align: center;
  color: #fff;
  user-select: none;
}

.textFrame--side {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 16px;
  background: linear-gradient(to right, rgba(0,0,0,.28), rgba(255,255,255,.10));
  transform: rotateY(90deg) translateZ(6px);
  border-radius: 0 14px 14px 0;
  opacity: .95;
}

@media (max-width: 980px) {
  .aboutGrid {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 22px;
  }

  .aboutContent {
    order: 1;
    width: 100%;
    max-width: 900px;
    min-width: 0;
  }

  .textFrameStage {
    order: 2;
    width: min(420px, 92vw);
  }
}

@media (max-width: 768px) {
  .textFrameStage { width: min(380px, 92vw); }
  .page-content   { padding: 18px; }
}
