/* ============================================================================
   Project details page (/{lang}/projects/{slug}) — built to the Figma design.
   Direction-agnostic: works for both ar (rtl) and en (ltr) via logical
   properties and `dir` on .mah-pd. Prefix: mah-pd-*.
   ========================================================================== */

.mah-pd {
  --mah-pd-pad: clamp(20px, 6.66vw, 96px);   /* 96px at the 1440 design width */
  --mah-pd-max: 1440px;
  --mah-pd-ink: #354956;        /* body text            */
  --mah-pd-ink-strong: #282828; /* info value           */
  --mah-pd-ink-title: #1e3a37;  /* project name         */
  --mah-pd-teal: #2b5450;       /* subtitle / primary   */
  --mah-pd-label: #606060;      /* info label           */
  --mah-pd-line: #eaeaea;       /* row divider          */
  --mah-pd-line-2: #d4e1e9;
  --mah-pd-card: #f1f5f9;       /* sidebar card bg      */
  --mah-pd-gold: #7f6f33;       /* section-title gold   */
  --mah-pd-on-primary: #cbe4e2;
  background: #ffffff;
  font-family: 'Work Sans', '29LT Zarid', sans-serif;
  color: var(--mah-pd-ink);
}

.mah-pd *,
.mah-pd *::before,
.mah-pd *::after { box-sizing: border-box; }

/* ── Breadcrumbs (dark bar) ─────────────────────────────────────────────── */
.mah-pd-breadcrumbs {
  background: #103c55;
  padding: 12px var(--mah-pd-pad);
}
.mah-pd-breadcrumbs__inner {
  max-width: var(--mah-pd-max);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 16px;
}
.mah-pd-breadcrumbs__link {
  color: #b4d2e1;
  text-decoration: none;
  transition: color .2s ease;
}
.mah-pd-breadcrumbs__link:hover { color: #eaf0f3; }
.mah-pd-breadcrumbs__sep { color: #5b8298; flex-shrink: 0; }
.mah-pd-breadcrumbs__current { color: #eaf0f3; }

/* ── Hero image gallery ─────────────────────────────────────────────────── */
.mah-pd-hero {
  position: relative;
  width: 100%;
  height: 640px;
  overflow: hidden;
  background: #d4e1e9;
}
.mah-pd-hero__track { position: absolute; inset: 0; }
.mah-pd-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .5s ease;
}
.mah-pd-hero__img.is-active { opacity: 1; }

.mah-pd-hero__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  background: #ffffff;
  border: 0;
  border-radius: 9999px;
  cursor: pointer;
  color: #103c55;
  box-shadow: 0 6px 24px rgba(16, 60, 85, .18);
  transition: transform .2s ease, background .2s ease;
}
.mah-pd-hero__nav:hover { background: #eaf0f3; }
.mah-pd-hero__nav:active { transform: translateY(-50%) scale(.96); }
.mah-pd-hero__nav svg { width: 32px; height: 32px; }
.mah-pd-hero__nav--prev { inset-inline-start: 32px; }
.mah-pd-hero__nav--next { inset-inline-end: 32px; }
/* arrows are drawn ltr; flip them for rtl so prev/next point correctly */
.mah-pd[dir="rtl"] .mah-pd-hero__nav svg { transform: scaleX(-1); }

.mah-pd-hero__dots {
  position: absolute;
  inset-block-end: 24px;
  inset-inline: 0;
  display: flex;
  gap: 8px;
  justify-content: center;
}
.mah-pd-hero__dot {
  width: 8px; height: 8px;
  border: 0; padding: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .55);
  cursor: pointer;
  transition: background .2s ease, width .2s ease;
}
.mah-pd-hero__dot.is-active { background: #ffffff; width: 24px; }

/* ── Body shell ─────────────────────────────────────────────────────────── */
.mah-pd-body {
  max-width: var(--mah-pd-max);
  margin-inline: auto;
  padding-block: 48px;
}
.mah-pd-body > section { padding-inline: var(--mah-pd-pad); padding-block: 24px; }

/* ── Project info: sidebar + description ────────────────────────────────── */
.mah-pd-info {
  display: flex;
  gap: 48px;
  align-items: flex-start;
}
/* description first, info card second */
.mah-pd-info .mah-pd-desc { order: 1; }
.mah-pd-info .mah-pd-card { order: 2; }

.mah-pd-card {
  flex: 0 0 376px;
  width: 376px;
  background: var(--mah-pd-card);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.mah-pd-card__actions { display: flex; gap: 8px; }

.mah-pd-btn {
  flex: 1 0 0;
  min-width: 0;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-inline: 24px;
  border: 0;
  border-radius: 8px;
  font-family: 'Work Sans', '29LT Zarid', sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
  cursor: pointer;
  transition: filter .2s ease, background .2s ease;
}
.mah-pd-btn--primary {
  background: var(--mah-pd-accent, var(--mah-pd-teal));
  color: var(--mah-pd-on-primary);
  box-shadow: 0 1px 2px rgba(35, 47, 55, .05);
}
.mah-pd-btn--primary:hover { filter: brightness(1.08); }
.mah-pd-btn--ghost {
  background: transparent;
  color: var(--mah-pd-ink-strong);
}
.mah-pd-btn--ghost:hover { background: rgba(43, 84, 80, .08); }

.mah-pd-rows { margin: 0; display: flex; flex-direction: column; }
.mah-pd-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-block: 16px;
  border-block-end: 1px solid var(--mah-pd-line);
}
.mah-pd-row:last-child { border-block-end: 0; }
.mah-pd-row dt {
  order: 2;
  flex: 0 0 128px;
  width: 128px;
  color: var(--mah-pd-label);
  font-weight: 400;
  font-size: 16px;
  text-align: start;
}
.mah-pd-row dd {
  order: 1;
  margin: 0;
  flex: 1 0 0;
  min-width: 0;
  color: var(--mah-pd-ink-strong);
  font-weight: 600;
  font-size: 16px;
  text-align: end;
  word-break: break-word;
}
/* link rows (brochure / website): text + icon grouped together on the reading-start side */
.mah-pd-row--link {
  justify-content: flex-start;
  text-decoration: none;
  color: var(--mah-pd-ink-strong);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
}
.mah-pd-row__link-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.mah-pd-row__link-group .mah-pd-row__icon { order: -1; }   /* icon before the text */
.mah-pd-row--link:hover { color: var(--mah-pd-teal); }
.mah-pd-row__icon { width: 18px; height: 18px; flex-shrink: 0; }

.mah-pd-desc { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 24px; padding-block: 12px; }
.mah-pd-desc__title {
  margin: 0;
  font-family: 'Neco', '29LT Zarid', sans-serif;
  font-weight: 700;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -1.12px;
  color: var(--mah-pd-ink-title);
}
.mah-pd-desc__subtitle {
  margin: 0;
  font-family: '29LT Zarid', 'Work Sans', sans-serif;
  font-weight: 500;
  font-size: 32px;
  line-height: 1.5;
  color: var(--mah-pd-teal);
}
.mah-pd-desc__body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--mah-pd-ink);
}
.mah-pd-desc__body p { margin: 0 0 12px; }
.mah-pd-desc__body p:last-child { margin-bottom: 0; }

/* ── Titled divider (amenities heading) ─────────────────────────────────── */
.mah-pd-divider-title {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
}
.mah-pd-divider-title__line { flex: 1 0 0; height: 1px; background: var(--mah-pd-line-2); }
.mah-pd-divider-title__text {
  margin: 0;
  font-family: 'Work Sans', '29LT Zarid', sans-serif;
  font-weight: 600;
  font-size: 20px;
  color: var(--mah-pd-ink);
  white-space: nowrap;
}

/* ── Feature grid (amenities + travel times) ────────────────────────────── */
.mah-pd-feature-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 48px 24px;
  justify-content: flex-end;
  padding-block: 48px;
}
.mah-pd-feature-grid--center { justify-content: center; }
.mah-pd-feature {
  flex: 0 0 294px;
  width: 294px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 24px;
  text-align: end;
}
.mah-pd-feature__icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  color: var(--mah-pd-accent, var(--mah-pd-teal));
  font-size: 28px;
}
.mah-pd-feature__title {
  margin: 0;
  font-family: 'Work Sans', '29LT Zarid', sans-serif;
  font-weight: 600;
  font-size: 24px;
  line-height: 1.2;
  color: var(--mah-pd-ink);
}
.mah-pd-feature__desc {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--mah-pd-ink);
}

/* ── Map ────────────────────────────────────────────────────────────────── */
.mah-pd-map {
  position: relative;
  display: block;
  width: 100%;
  height: 480px;
  border-radius: 16px;
  overflow: hidden;
  background: #d4e1e9;
}
.mah-pd-map__img { width: 100%; height: 100%; object-fit: cover; }
.mah-pd-map__frame { width: 100%; height: 100%; border: 0; display: block; }
/* embed variant: static styled map matching the design (no Google UI interaction) */
.mah-pd-map--embed .mah-pd-map__frame { pointer-events: none; }
/* teal brand tint over the map */
.mah-pd-map__tint {
  position: absolute;
  inset: 0;
  background: var(--mah-pd-accent, var(--mah-pd-teal));
  opacity: .22;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.mah-pd-map__pin {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -100%);   /* tip of the pin sits on the centre point */
  width: 40px; height: 55px;
  color: var(--mah-pd-teal);
  pointer-events: none;
}
.mah-pd-map__pin svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 8px rgba(16,60,85,.35)); }

/* ── Interactive Leaflet map ────────────────────────────────────────────── */
.mah-pd-map--leaflet { z-index: 0; }            /* keep Leaflet panes under the page chrome */
.mah-pd-map--leaflet .leaflet-tile-pane {
  /* desaturate the tiles so the project-colour pane (in JS) colourises them */
  filter: grayscale(1) brightness(1.08) contrast(.92);
}
.mah-pd-leaflet-pin { cursor: pointer; color: var(--mah-pd-accent, var(--mah-pd-teal)); }
.mah-pd-leaflet-pin svg { width: 40px; height: 55px; display: block; filter: drop-shadow(0 4px 8px rgba(16,60,85,.4)); transition: transform .15s ease; }
.mah-pd-leaflet-pin:hover svg { transform: translateY(-2px) scale(1.05); }
.mah-pd-map--leaflet .leaflet-control-attribution { font-size: 10px; }

/* ── Related projects / news (full-width section after the news block) ───── */
/* grid header (heading + view-all) on row 1, cards on row 2 — like the homepage */
.mah-pd-related {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 8px;
  max-width: var(--mah-pd-max);
  margin-inline: auto;
  padding-inline: var(--mah-pd-pad);
  padding-block: 24px;
}

.mah-pd-section-title {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  padding-block: 12px;
}
.mah-pd-section-title__heading {
  margin: 0;
  font-family: 'Work Sans', '29LT Zarid', sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
  color: var(--mah-pd-gold);
}
.mah-pd-section-title__link {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  color: var(--mah-pd-gold);
  text-decoration: none;
  white-space: nowrap;
}
.mah-pd-section-title__link:hover { text-decoration: none; }
.mah-pd-section-title__arrow { flex-shrink: 0; order: 1; }   /* arrow after the text */
.mah-pd[dir="rtl"] .mah-pd-section-title__arrow { transform: scaleX(-1); }

.mah-pd-related__grid {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-block: 24px;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .mah-pd-hero { height: 460px; }
  .mah-pd-info { flex-direction: column; }
  .mah-pd-card { flex-basis: auto; width: 100%; }
  .mah-pd-desc__title { font-size: 44px; }
  .mah-pd-desc__subtitle { font-size: 26px; }
  .mah-pd-feature-grid { justify-content: center; }
  .mah-pd-related__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .mah-pd-hero { height: 320px; }
  .mah-pd-hero__nav { width: 56px; height: 56px; }
  .mah-pd-hero__nav svg { width: 22px; height: 22px; }
  .mah-pd-hero__nav--prev { inset-inline-start: 12px; }
  .mah-pd-hero__nav--next { inset-inline-end: 12px; }
  .mah-pd-body { padding-block: 28px; }
  .mah-pd-body > section { padding-block: 16px; }
  .mah-pd-card__actions { flex-direction: column; }
  .mah-pd-card__actions .mah-pd-btn { flex: 0 0 auto; width: 100%; }
  .mah-pd-desc__title { font-size: 34px; }
  .mah-pd-desc__subtitle { font-size: 22px; }
  .mah-pd-feature { flex-basis: 100%; width: 100%; align-items: flex-end; }
  .mah-pd-feature-grid { gap: 32px; padding-block: 32px; }
  .mah-pd-map { height: 300px; }
  .mah-pd-divider-title__text { font-size: 17px; white-space: normal; }
  /* stack: heading, then cards, then a full-width "view all" at the end (like the homepage) */
  .mah-pd-related { grid-template-columns: 1fr; }
  .mah-pd-section-title { grid-column: 1; grid-row: auto; order: 1; }
  .mah-pd-related__grid { grid-column: 1; grid-row: auto; order: 2; grid-template-columns: 1fr; }
  .mah-pd-section-title__link {
    grid-column: 1; grid-row: auto; order: 3;
    justify-self: stretch; justify-content: center;
    width: 100%; margin-top: 8px;
  }
}

/* ── LTR tweaks (English) ───────────────────────────────────────────────── */
.mah-pd[dir="ltr"] .mah-pd-desc__title,
.mah-pd[dir="ltr"] .mah-pd-desc__subtitle,
.mah-pd[dir="ltr"] .mah-pd-desc__body,
.mah-pd[dir="ltr"] .mah-pd-feature,
.mah-pd[dir="ltr"] .mah-pd-section-title__heading { text-align: start; }
.mah-pd[dir="ltr"] .mah-pd-feature { align-items: flex-start; }
.mah-pd[dir="ltr"] .mah-pd-feature-grid { justify-content: flex-start; }
.mah-pd[dir="ltr"] .mah-pd-row dd,
.mah-pd[dir="ltr"] .mah-pd-row--link span { text-align: start; }
.mah-pd[dir="ltr"] .mah-pd-row { justify-content: flex-start; }
.mah-pd[dir="ltr"] .mah-pd-row dt { order: 1; }
.mah-pd[dir="ltr"] .mah-pd-row dd { order: 2; }

/* ── RTL tweaks (Arabic) ────────────────────────────────────────────────── */
/* label reads first on the right, value follows on the left */
.mah-pd[dir="rtl"] .mah-pd-row dt { order: 0; text-align: right; }   /* label: right, first */
.mah-pd[dir="rtl"] .mah-pd-row dd { order: 1; text-align: right; }   /* value: left, second */
.mah-pd[dir="rtl"] .mah-pd-row--link span { text-align: right; }
.mah-pd[dir="rtl"] .mah-pd-card__actions .mah-pd-btn--ghost { order: 0; }    /* شارك المشروع first */
.mah-pd[dir="rtl"] .mah-pd-card__actions .mah-pd-btn--primary { order: 1; }  /* سجل اهتمامك second */
/* feature grid: in RTL flex-end resolves to the left — keep cards & content on the right (start) */
.mah-pd[dir="rtl"] .mah-pd-feature-grid { justify-content: flex-start; }
.mah-pd[dir="rtl"] .mah-pd-feature-grid--center { justify-content: center; }
.mah-pd[dir="rtl"] .mah-pd-feature { align-items: flex-start; text-align: right; }
