@import url('../news.css');

/* ============================================================
   AL-HABIB REAL ESTATE — PROJECTS LISTING PAGE CSS (Arabic / RTL)
   Sections: Breadcrumbs · Featured Label · Featured Project ·
             Filter Bar · Project Cards Grid
   All sections use .mah-pg-projects-* BEM prefix.
   ============================================================ */

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  --proj-dark-blue:     #0c3144;
  --proj-nav-blue:      #103c55;
  --proj-mid-blue:      #16506e;
  --proj-gold:          #7f6f33;
  --proj-gold-text:     #fdf6ec;
  --proj-tag-bg:        #f1f5f9;
  --proj-tag-text:      #606060;
  --proj-border:        #b4d2e1;
  --proj-bg:            #f8fafc;
  --proj-body-text:     #282828;
  --proj-muted:         #9a9a9a;
  --proj-white:         #ffffff;
  --proj-px:            96px;
  --proj-radius:        16px;
  --proj-radius-sm:     8px;
  --proj-transition:    0.3s ease;
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.mah-pg-projects-breadcrumbs {
  background-color: var(--proj-nav-blue);
  padding: 0 var(--proj-px);
}

.mah-pg-projects-breadcrumbs__inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 12px 0;
  direction: rtl;
}

.mah-pg-projects-breadcrumbs__current {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #86b8d1;
  line-height: 1.5;
  white-space: nowrap;
}

.mah-pg-projects-breadcrumbs__sep {
  color: #86b8d1;
  opacity: 0.7;
  flex-shrink: 0;
}

.mah-pg-projects-breadcrumbs__link {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #b4d2e1;
  text-decoration: none;
  line-height: 1.5;
  opacity: 0.8;
  transition: opacity var(--proj-transition);
  white-space: nowrap;
}

.mah-pg-projects-breadcrumbs__link:hover {
  opacity: 1;
  color: #b4d2e1;
}

/* ============================================================
   FEATURED SECTION LABEL
   ============================================================ */
.mah-pg-projects-featured-label {
  background: var(--proj-bg);
  padding: 48px var(--proj-px) 24px;
  text-align: right;
  direction: rtl;
}

.mah-pg-projects-section-label {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--proj-gold);
  letter-spacing: 0.02em;
}

/* ============================================================
   FEATURED PROJECT
   ============================================================ */
.mah-pg-projects-featured {
  background: var(--proj-bg);
  padding: 0 var(--proj-px) 32px;
}

.mah-pg-projects-featured__inner {
  display: flex;
  flex-direction: row;
  gap: 17px;
  align-items: flex-start;
  direction: rtl;
}

/* Details panel → RIGHT in RTL (first DOM child) */
.mah-pg-projects-featured__details {
  width: 376px;
  flex-shrink: 0;
  padding: 24px;
  border-radius: var(--proj-radius);
  display: flex;
  flex-direction: column;
  gap: 0;
  direction: rtl;
}

.mah-pg-projects-featured__header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.mah-pg-projects-featured__title {
  font-family: '29LT Zarid', system-ui, sans-serif;
  font-weight: 700;
  font-size: 32px;
  color: var(--proj-dark-blue);
  text-align: right;
  letter-spacing: -1px;
  line-height: 1.25;
  margin: 0;
}

.mah-pg-projects-featured__tags {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}

/* Shared tag pill */
.mah-pg-projects-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 9999px;
  background: var(--proj-tag-bg);
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--proj-tag-text);
  white-space: nowrap;
  line-height: 1;
}

.mah-pg-projects-featured__desc {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--proj-mid-blue);
  text-align: right;
  line-height: 1.5;
  margin: 0 0 0 0;
  /* Clamp to 3 lines with a trailing ellipsis */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* Info rows */
.mah-pg-projects-featured__info {
  display: flex;
  flex-direction: column;
  margin: 16px 0 0;
}

.mah-pg-projects-featured__info-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--proj-border);
  direction: rtl;
}

.mah-pg-projects-featured__info-row--last {
  border-bottom: none;
}

.mah-pg-projects-featured__info-label {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--proj-mid-blue);
  width: 128px;
  flex-shrink: 0;
  text-align: right;
}

.mah-pg-projects-featured__info-value {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--proj-dark-blue);
  text-align: left;
}

/* Action buttons */
.mah-pg-projects-featured__actions {
  display: flex;
  flex-direction: row;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 24px;
}

.mah-pg-projects-featured__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--proj-radius-sm);
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--proj-transition), box-shadow var(--proj-transition);
  white-space: nowrap;
  border: none;
  outline: none;
}

.mah-pg-projects-featured__btn--primary {
  background: var(--proj-gold);
  color: var(--proj-gold-text);
  box-shadow: 0 4px 16px rgba(127, 111, 51, 0.3);
}

.mah-pg-projects-featured__btn--primary:hover {
  opacity: 0.9;
}

.mah-pg-projects-featured__btn--secondary {
  background: transparent;
  color: var(--proj-body-text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.mah-pg-projects-featured__btn--secondary:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* Featured image → LEFT in RTL (second DOM child) */
.mah-pg-projects-featured__img-wrap {
  flex: 1 0 0;
  align-self: stretch;
  min-height: 480px;
  border-radius: var(--proj-radius-sm);
  overflow: hidden;
  position: relative;
}

.mah-pg-projects-featured__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   PROJECTS BODY
   ============================================================ */
.mah-pg-projects-body {
  background: var(--proj-bg);
  padding-bottom: 48px;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.mah-pg-projects-filters {
  padding: 0 var(--proj-px);
}

.mah-pg-projects-filters__inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  direction: rtl;
}

/* Filters group → RIGHT in RTL */
.mah-pg-projects-filters__group {
  display: flex;
  flex-direction: row;
  gap: 24px;
  align-items: flex-end;
}

/* "قائمة المشاريع" label → LEFT in RTL */
.mah-pg-projects-filters__label {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--proj-gold);
  white-space: nowrap;
}

/* Individual filter */
.mah-pg-projects-filter {
  display: flex;
  gap: 4px;
  direction: rtl;
}

.mah-pg-projects-filter__label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--proj-muted);
  text-align: right;
}

.mah-pg-projects-filter__select-wrap {
  position: relative;
  width: 240px;
}

.mah-pg-projects-filter__select {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  padding-left: 44px;
  border-radius: var(--proj-radius-sm);
  background: var(--proj-tag-bg);
  border: none;
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--proj-dark-blue);
  text-align: right;
  direction: rtl;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: background var(--proj-transition);
}

.mah-pg-projects-filter__select:hover {
  background: #e8edf3;
}

.mah-pg-projects-filter__caret {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--proj-dark-blue);
  pointer-events: none;
}

/* ============================================================
   PROJECT CARDS GRID
   ============================================================ */
.mah-pg-projects-grid {
  padding: 0 var(--proj-px) 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 24px;
  row-gap: 48px;
  direction: rtl;
}

.mah-pg-projects-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px 0;
  font-family: '29LT Zarid', system-ui, sans-serif;
  font-size: 18px;
  color: var(--proj-dark-blue, #0c3144);
}

/* Load more (AJAX paging) */
.mah-pg-projects-more {
  display: flex;
  justify-content: center;
  padding: 0 var(--proj-px) 40px;
}
/* the wrapper is display:flex, so the bare [hidden] attribute needs an explicit override */
.mah-pg-projects-more[hidden] {
  display: none;
}
.mah-pg-projects-more__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 32px;
  background: transparent;
  color: var(--proj-body-text);
  border: none;
  border-radius: var(--proj-radius-sm);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow var(--proj-transition);
}
.mah-pg-projects-more__btn:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.mah-pg-projects-more__btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* legacy row wrapper (no longer emitted; kept for safety) */
.mah-pg-projects-row {
  display: flex;
  flex-direction: row;
  gap: 24px;
  justify-content: flex-end;
}

/* ============================================================
   PROJECT CARD (reusable)
   ============================================================ */
.mah-pg-project-card {
  flex: 1 0 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  direction: rtl;
}

.mah-pg-project-card__img-wrap {
  display: block;
  height: 256px;
  width: 100%;
  border-radius: var(--proj-radius-sm);
  overflow: hidden;
  position: relative;
}

.mah-pg-project-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  transition: transform var(--proj-transition);
}

.mah-pg-project-card__img-wrap:hover .mah-pg-project-card__img {
  transform: scale(1.03);
}

.mah-pg-project-card__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-end;
  padding: 0 16px;
}

.mah-pg-project-card__title-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.mah-pg-project-card__tags {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
}

.mah-pg-project-card__tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 9999px;
  background: var(--proj-tag-bg);
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--proj-tag-text);
  white-space: nowrap;
  line-height: 1;
}

.mah-pg-project-card__title {
  flex: 1 0 0;
  font-family: '29LT Zarid', system-ui, sans-serif;
  font-weight: 700;
  font-size: 32px;
  color: var(--proj-dark-blue);
  text-align: right;
  letter-spacing: -1px;
  line-height: 1.25;
  margin: 0;
}

.mah-pg-project-card__title-link {
  color: inherit;
  text-decoration: none;
}

.mah-pg-project-card__title-link:hover {
  text-decoration: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Laptop / small desktop — tighten the page gutter */
@media (max-width: 1200px) {
  :root { --proj-px: 48px; }
}

/* Tablet — featured stacks, grid drops to 2 cols, filters wrap */
@media (max-width: 992px) {
  .mah-pg-projects-featured__inner {
    flex-direction: column;
  }
  .mah-pg-projects-featured__details {
    width: 100%;
  }
  .mah-pg-projects-featured__img-wrap {
    width: 100%;
    min-height: 360px;
  }

  .mah-pg-projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .mah-pg-projects-filters__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .mah-pg-projects-filters__group {
    flex-wrap: wrap;
    gap: 16px;
  }
}

/* Mobile — single column, full-width filters & buttons */
@media (max-width: 768px) {
  :root { --proj-px: 20px; }

  .mah-pg-projects-featured-label {
    padding-top: 32px;
  }
  .mah-pg-projects-featured__title {
    font-size: 26px;
  }
  .mah-pg-projects-featured__img-wrap {
    min-height: 240px;
  }
  .mah-pg-projects-featured__actions {
    flex-direction: column;
  }
  .mah-pg-projects-featured__btn {
    width: 100%;
  }

  .mah-pg-projects-grid {
    grid-template-columns: 1fr;
    row-gap: 32px;
  }

  .mah-pg-projects-filter {
    flex: 1 1 100%;
  }
  .mah-pg-projects-filter__select-wrap {
    width: 100%;
  }

  .mah-pg-project-card__title {
    font-size: 26px;
  }
}
