/* MAAL HOME | V28 | 27 October 2026
 * Poster-safe project images + responsive "All Projects" navigation.
 * Loaded after existing V27 styles. All selectors are scoped; services, model
 * cards, article pages, administrative pages and existing animations stay intact.
 */

/* 1. Project catalog: NO letterboxing or forced height. Every uploaded poster
   fills its card at its native aspect ratio; text, logos and property details
   remain visible without stretching or clipping. Applies to home and catalog. */
body .project.project-parallax-jeddah.project-fixed-bg-section .project-card .photo.project-card-photo,
body .project.project-parallax-jeddah.project-fixed-bg-section .project-card-photo {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  background: #f4f8fd !important;
  border: 0 !important;
  border-radius: 0 !important;
}
body .project.project-parallax-jeddah.project-fixed-bg-section .project-card .photo.project-card-photo > a,
body .project.project-parallax-jeddah.project-fixed-bg-section .project-card-photo > a {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
}
body .project.project-parallax-jeddah.project-fixed-bg-section .project-item .photo.project-card-photo img,
body .project.project-parallax-jeddah.project-fixed-bg-section .project-card-photo img,
body .project.project-parallax-jeddah.project-fixed-bg-section .project-card-photo.mh-project-preserve-image img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center center !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  transform: none !important;
}
body .project.project-parallax-jeddah.project-fixed-bg-section .project-card:hover .project-card-photo img,
body .project.project-parallax-jeddah.project-fixed-bg-section .project-card:focus-within .project-card-photo img {
  transform: none !important; /* do not shave branding off the poster edges */
}

/* 2. Project detail: poster touches the card's inner edges (no blue/white bars).
   The actual image determines the height, even when it is a portrait upload. */
body .project-detail-page .single-project.official-detail-card {
  padding: 0 !important;
  overflow: hidden !important;
}
body .project-detail-page .project-featured-media {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 19px 19px 0 0 !important;
  overflow: hidden !important;
  background: transparent !important;
  box-shadow: none !important;
}
body .project-detail-page .project-featured-media > img.featured-photo {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
  aspect-ratio: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body .project-detail-page .single-project.official-detail-card > .project-rich-content,
body .project-detail-page .single-project.official-detail-card > .project-gallery-section,
body .project-detail-page .single-project.official-detail-card > .project-video-section {
  margin-inline: clamp(12px, 1.6vw, 20px) !important;
}
body .project-detail-page .single-project.official-detail-card > :last-child {
  margin-bottom: clamp(14px, 1.5vw, 20px) !important;
}

/* 3. Desktop "All Projects" appears immediately BELOW the project info card,
   sharing the established blue service-sidebar language. */
body .project-detail-page .official-detail-sidebar .mh-other-projects-widget {
  margin-top: 17px !important;
}
.project-detail-page .mh-other-projects-links {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
}
.project-detail-page .mh-other-project-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid rgba(171, 212, 247, .2);
  border-radius: 11px;
  background: rgba(255,255,255,.075);
  color: #fff !important;
  text-align: right;
  text-decoration: none !important;
  line-height: 1.65;
  font-size: 13px;
  font-weight: 750;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}
.project-detail-page .mh-other-project-link:hover,
.project-detail-page .mh-other-project-link:focus-visible {
  color: #fff !important;
  background: rgba(255,255,255,.14);
  border-color: rgba(171,212,247,.48);
  transform: translateX(-2px);
}
.project-detail-page .mh-other-project-link:focus-visible,
.mh-other-projects-section a:focus-visible {
  outline: 3px solid #4aadef;
  outline-offset: 3px;
}
.project-detail-page .mh-other-project-link-icon {
  display: grid;
  flex: 0 0 33px;
  width: 33px;
  height: 33px;
  place-items: center;
  border-radius: 9px;
  background: rgba(255,255,255,.12);
  color: #caeaff;
  font-size: 15px;
}
.project-detail-page .mh-other-project-link > span:nth-child(2) {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.project-detail-page .mh-other-project-link-arrow {
  flex: 0 0 auto;
  color: #b6defb;
  font-size: 18px;
}

/* 4. On mobile, move project navigation to AFTER apartment models. This is
   a visible card section rather than the former project filter/dropdown. */
.mh-other-projects-section {
  background: linear-gradient(180deg, #f6faff 0%, #eaf3fc 100%);
  padding: 38px 0 48px;
  direction: rtl;
}
.mh-other-projects-section > .container {
  width: min(1180px, calc(100% - 28px));
  max-width: 1180px;
  padding: 0;
  margin-inline: auto;
}
.mh-other-projects-heading { text-align: right; margin: 0 0 22px; }
.mh-other-projects-eyebrow {
  display: block;
  color: #1770b6;
  font-weight: 750;
  font-size: 12px;
  margin-bottom: 4px;
}
.mh-other-projects-heading h2 {
  font-size: clamp(22px, 2.5vw, 29px);
  font-weight: 850;
  line-height: 1.5;
  color: #0b356b;
  margin: 0 0 5px;
}
.mh-other-projects-heading p {
  font-size: 13px;
  line-height: 1.75;
  color: #536c85;
  margin: 0;
}
.mh-other-projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.7vw, 19px);
  /* Mixed square and portrait posters must not leave giant empty white areas. */
  align-items: start;
}
.mh-other-project-card {
  display: flex;
  flex-direction: column;
  align-self: start;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #d2e2f1;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(5,49,95,.07);
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}
.mh-other-project-card:hover,
.mh-other-project-card:focus-within {
  transform: translateY(-3px);
  border-color: #a6caea;
  box-shadow: 0 12px 28px rgba(5,49,95,.11);
}
.mh-other-project-media {
  display: block;
  width: 100%;
  height: auto;
  overflow: hidden;
  background: #edf4fb;
}
.mh-other-project-media img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  margin: 0;
}
.mh-other-project-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  gap: 6px;
  padding: 13px 14px 15px;
}
.mh-other-project-body h3 {
  font-size: 16px;
  line-height: 1.55;
  font-weight: 850;
  color: #123967;
  margin: 0;
}
.mh-other-project-body h3 a { color: inherit !important; text-decoration: none !important; }
.mh-other-project-body p {
  font-size: 12px;
  line-height: 1.7;
  margin: 0 0 5px;
  color: #576e83;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.mh-other-project-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 35px;
  padding: 7px 12px;
  border: 1px solid #bfd9ef;
  border-radius: 9px;
  background: #eef6fe;
  color: #0d508d !important;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none !important;
  margin-top: auto;
}
.mh-other-project-action:hover { background: #0b3f7a; color: #fff !important; }

@media (min-width: 992px) {
  /* Only one visible project chooser: matching the service-details sidebar. */
  .mh-other-projects-section { display: none !important; }
}
@media (max-width: 991.98px) {
  body .project-detail-page .official-detail-sidebar .mh-other-projects-widget { display: none !important; }
  body .project-detail-page .project-featured-media {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 15px !important;
  }
  body .project-detail-page .project-featured-media > img.featured-photo {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
  }
  body .project-detail-page .project-rich-content.text {
    padding: 15px 16px !important;
    margin: 0 !important;
  }
  body .project-detail-page .project-gallery-section,
  body .project-detail-page .project-video-section { margin: 0 !important; }
  /* Two logical columns preserve the order from the projects database. */
  .mh-other-projects-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 575.98px) {
  .project-detail-page.official-detail-page > .container {
    width: calc(100% - 20px) !important;
  }
  body .project-detail-page .project-featured-media {
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
  }
  .mh-other-projects-section { padding: 30px 0 36px; }
  .mh-other-projects-section > .container { width: calc(100% - 20px); }
  .mh-other-projects-grid { gap: 10px; }
  .mh-other-project-body { padding: 10px 10px 12px; gap: 7px; }
  .mh-other-project-body h3 { font-size: 13.5px; }
  .mh-other-project-body p { font-size: 11px; }
  .mh-other-project-action { min-height: 32px; padding: 6px 10px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .mh-other-project-card,
  .mh-other-project-link,
  .mh-other-project-action { transition: none !important; transform: none !important; }
}
