@import url("https://fonts.googleapis.com/css2?family=Reem+Kufi:wght@500;700&family=El+Messiri:wght@400;500;600;700&display=swap");

/* =====================
   BASE
   ===================== */
html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "El Messiri", sans-serif;
  background: #efe9db;
  color: #621313;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

main { flex: 1; }

/* =====================
   TYPOGRAPHY
   ===================== */
h1, h2, h3 { font-family: "Reem Kufi", sans-serif; }

h1 { font-size: clamp(22px, 6vw, 36px); }
h2 { font-size: clamp(18px, 5vw, 28px); }

p,
.cardDesc,
.about-text {
  font-size: clamp(14px, 4vw, 18px);
  line-height: 1.8;
}

/* =====================
   LAYOUT
   ===================== */
.spacer { flex: 1; }

.container {
  padding: 24px 16px;
  max-width: 100%;
  width: 100%;
  margin: auto;
  box-sizing: border-box;
}

.pageHeader {
  margin: 10px;
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-sizing: border-box;
  box-shadow: 0 10px 30px rgba(60,50,40,0.12);
}

.pageHeader h1 {
  margin: 0;
  font-size: 20px;
  color: #2f2f2f;
  text-shadow: 0 1px 2px rgba(255,255,255,0.6);
}

/* =====================
   BACKGROUND
   ===================== */
.book-bg.page-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: .95;
}

.book-bg.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Cream wash over the photo so every page reads light, like the home page.
     Kept a touch lighter so the geometric pattern shows through more. */
  background:
    linear-gradient(rgba(244,240,229,.74), rgba(244,240,229,.66)),
    rgba(0,0,0,.04);
}

/* =====================
   NAVIGATION
   ===================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  margin: 10px;
  border-radius: 16px;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(60,50,40,0.14);
}

.nav a {
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: #2f2f2f;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: none;
  transition: transform .25s ease, background .25s ease, border-color .25s ease;
}

.nav a::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(101,96,77,0.55),
    transparent 70%
  );
  transform: translateX(-120%);
  transition: transform .6s ease;
}

.nav a:hover {
  background: rgba(175,148,91,0.32);
  border-color: rgba(177,137,80,0.5);
  transform: translateY(-1px);
}

.nav a:hover::before { transform: translateX(120%); }

.nav a.active {
  background: rgba(255,255,255,0.72);
  border-color: rgba(255,255,255,0.8);
}

/* =====================
   NAV SETTINGS (gear icon that reveals login + language)
   ===================== */
.nav-settings {
  position: relative;
}

.nav-settings-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #2f2f2f;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 16px;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}

.nav-settings-btn:hover { background: rgba(175,148,91,0.32); transform: translateY(-1px); }
.nav-settings-btn[aria-expanded="true"] { background: rgba(255,255,255,0.78); }

.nav-settings-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 160px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(60,50,40,0.22);
}

.nav-settings-menu[hidden] { display: none; }

.nav-settings-menu .login-link {
  width: 100%;
  text-align: center;
}

.langMenu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 150px;
}

.langOption {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #2f2f2f;
  font: inherit;
  font-size: 13px;
  text-align: start;
  cursor: pointer;
}

.langOption:hover { background: rgba(175,148,91,0.2); }

.langOption.is-active {
  background: rgba(255,255,255,0.72);
  border-color: rgba(177,137,80,0.5);
  font-weight: 700;
}

.langFlag { font-size: 16px; line-height: 1; }

/* =====================
   LANGUAGE BUTTON
   ===================== */
#langBtn.btn {
  position: relative;
  overflow: hidden;
  padding: 8px 18px;
  min-width: 58px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: .6px;
  color: #2f2f2f;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: none;
  transition: transform .25s ease;
}

#langBtn.btn::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255,255,255,0.55),
    transparent 70%
  );
  transform: translateX(-120%);
  transition: transform .6s ease;
}

#langBtn.btn:hover         { transform: translateY(-1px); }
#langBtn.btn:hover::before { transform: translateX(120%); }
#langBtn.btn:active        { transform: translateY(0); }

html[dir="ltr"] #langBtn.btn { text-transform: uppercase; }

/* =====================
   BUTTONS
   ===================== */
.btn {
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.95);
  padding: 8px 12px;
  border-radius: 14px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  white-space: nowrap;
  font-size: clamp(14px, 4vw, 16px);
}

.btn:hover   { background: rgba(255,255,255,0.16); }
.btn.primary { background: rgba(0,180,100,0.35); border-color: rgba(0,180,100,0.55); }
.btn.small   { padding: 6px 10px; font-size: 14px; display: inline-block; margin-top: 10px; }

/* =====================
   INPUTS
   ===================== */
.input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  margin-bottom: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.22);
  color: #2f2f2f;
  outline: none;
}

.input::placeholder { color: #555; }
.input:focus { border-color: rgba(255,255,255,0.35); background: rgba(0,0,0,0.28); }

/* =====================
   GLASS CARD  (مشترك: about + places)
   ===================== */
.glassCard {
  margin-top: 12px;
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.62);
  background: rgba(255,255,255,0.46);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: block;
  height: auto;
  max-height: none;
  overflow: visible;
}

.glassCard h3 {
  color: #36342e;
  text-shadow: 0 1px 2px rgba(255,255,255,0.55);
}

.glassCard p,
.glassCard li {
  color: #36342e;
  text-shadow: 0 2px 2px rgba(255,255,255,0.45);
  white-space: normal;
  line-height: 1.8;
  overflow: visible;
  max-height: none;
  height: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* =====================
   FOOTER
   ===================== */
.site-footer {
  width: 100%;
  padding: 26px 20px;
  text-align: center;
  background: rgba(160,160,160,0.32);
  border-radius: 22px 22px 0 0;
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 -10px 30px rgba(0,0,0,0.25);
  margin-top: auto;
}

.footer-content {
  max-width: 1100px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.footer-text {
  color: #36342e;
  font-size: 14px;
  opacity: .9;
  margin: 0;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.footer-social .social-icon {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.95);
  font-size: 18px;
  text-decoration: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.footer-social .social-icon:hover {
  transform: translateY(-3px);
  background: rgba(255,255,255,0.16);
  box-shadow: 0 16px 34px rgba(0,0,0,0.35);
}

/* =====================
   RESPONSIVE ≤ 768px
   ===================== */
@media (max-width: 768px) {
  .site-footer { padding: 26px 16px; margin-top: 50px; }
  .footer-social .social-icon { width: 42px; height: 42px; font-size: 17px; }

  .nav {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
  }

  .nav a {
    flex: 1 1 auto;
    text-align: center;
    font-size: clamp(13px, 4vw, 16px);
    padding: 8px 10px;
  }

  .spacer {
    flex-basis: 100%;
    height: 0;
  }

  /* The nav wraps here, so the gear can land at either edge; anchor the menu
     to the nav's full width instead of to the button so it never overflows. */
  .nav-settings { position: static; }

  .nav-settings-menu {
    inset-inline: 10px;
    min-width: 0;
  }

  #langBtn.btn {
    width: 100%;
    padding: 7px 16px;
    min-width: 52px;
    font-size: clamp(14px, 4vw, 16px);
  }
}
