/* ============================================================
   AL-HABIB REAL ESTATE — NEWS LISTING PAGE CSS (Arabic / RTL)
   Sections: Breadcrumbs · Feature card · Filters · Articles grid
             Load more · Related projects
   All page-level sections use the .mah-nl-* BEM prefix.
   News cards reuse the shared .mah-news-card component (news.css).
   ============================================================ */

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  --nl-bg:          #f8fafc;
  --nl-nav-blue:    #103c55;
  --nl-gold:        #7f6f33;
  --nl-title-blue:  #16506e;
  --nl-body-text:   #282828;
  --nl-meta:        #9a9a9a;
  --nl-muted:       #606060;
  --nl-tag-bg:      #e2e8f0;
  --nl-project-tag: #f1f5f9;
  --nl-input-bg:    #f1f5f9;
  --nl-border:      #dcdcdc;
  --nl-light-blue:  #b4d2e1;
  --nl-accent-blue: #86b8d1;
  --nl-px:          96px;
  --nl-radius:      8px;
  --nl-transition:  0.3s ease;
}

/* Page background spans the whole content area */
body.news-page main,
.mah-nl {
  background: var(--nl-bg);
}

/* ============================================================
   BREADCRUMBS — .mah-nl-breadcrumbs
   ============================================================ */
.mah-nl-breadcrumbs {
  background-color: var(--nl-nav-blue);
  padding: 12px var(--nl-px);
}

.mah-nl-breadcrumbs__inner {
  display: flex;
  align-items: center;
}

.mah-nl-breadcrumbs__link {
  font-family: '29LT Zarid', 'Work Sans', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--nl-accent-blue);
  text-decoration: none;
  padding: 16px 8px;
  line-height: 1.5;
  white-space: nowrap;
  transition: opacity var(--nl-transition);
}

.mah-nl-breadcrumbs__link:hover {
  opacity: 0.8;
  color: var(--nl-accent-blue);
}

.mah-nl-breadcrumbs__sep {
  color: var(--nl-accent-blue);
  opacity: 0.6;
  flex-shrink: 0;
}

[dir="rtl"] .mah-nl-breadcrumbs__sep,
[dir="rtl"] .mah-nl-feature__link svg,
[dir="rtl"] .mah-nl-related__link svg {
  transform: scaleX(-1);
}

.mah-nl-breadcrumbs__current {
  font-family: '29LT Zarid', 'Work Sans', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--nl-light-blue);
  padding: 16px 8px;
  line-height: 1.5;
  white-space: nowrap;
}

/* ============================================================
   SECTION LABEL / HEADING — .mah-nl__label / .mah-nl__heading
   ("أبرز العناوين" · "قائمة المقالات")
   ============================================================ */
.mah-nl__label,
.mah-nl__heading {
  font-family: '29LT Zarid', 'Work Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--nl-gold);
  text-align: right;
  margin: 0;
  line-height: 1.25;
}

.mah-nl__label {
  padding: 48px var(--nl-px) 24px;
}

.mah-nl__heading {
  padding: 0;
  white-space: nowrap;
}

/* Filter bar: list heading + filter dropdowns share one row */
.mah-nl-filterbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px var(--nl-px);
  flex-wrap: wrap;
}

/* ============================================================
   FEATURE CARD — .mah-nl-feature
   (Used for the hero feature and the in-grid feature card)
   ============================================================ */
.mah-nl-feature {
  display: flex;
  flex-direction: row-reverse;
  gap: 48px;
  align-items: stretch;
  padding: 24px var(--nl-px);
}

/* Alternate feature card: image on the opposite side (right in RTL) */
.mah-nl-feature--alt {
  flex-direction: row;
}

.mah-nl-feature__img {
  flex: 1 1 0;
  min-width: 0;
  height: 412px;
  border-radius: var(--nl-radius);
  overflow: hidden;
}

.mah-nl-feature__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.mah-nl-feature:hover .mah-nl-feature__img img {
  transform: scale(1.03);
}

.mah-nl-feature__copy {
  width: 384px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 32px;
}

.mah-nl-feature__text {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mah-nl-feature__title-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mah-nl-feature__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  color: var(--nl-meta);
  font-family: '29LT Zarid', 'Work Sans', sans-serif;
  font-size: 12px;
  line-height: 1.5;
}

.mah-nl-feature__readtime {
  order: 2;
}

.mah-nl-feature__readtime strong {
  font-weight: 700;
}

.mah-nl-feature__source-group {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  order: 1;
}

.mah-nl-feature__source strong {
  font-weight: 700;
}

.mah-nl-feature__title {
  font-family: '29LT Zarid', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--nl-title-blue);
  line-height: 1.25;
  letter-spacing: -1px;
  text-align: right;
  margin: 0;
}

.mah-nl-feature__excerpt {
  font-family: '29LT Zarid', 'Work Sans', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--nl-body-text);
  line-height: 1.5;
  text-align: right;
  margin: 0;
}

.mah-nl-feature__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mah-nl-feature__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: '29LT Zarid', 'Work Sans', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--nl-gold);
  text-decoration: none;
  margin-top: 24px;
  transition: opacity var(--nl-transition);
}

.mah-nl-feature__link:hover {
  opacity: 0.75;
  color: var(--nl-gold);
}

.mah-nl-feature__link svg {
  flex-shrink: 0;
}

/* ============================================================
   TAG — .mah-nl-tag  (shared chip used by feature + cards)
   ============================================================ */
.mah-nl-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--nl-tag-bg);
  font-family: '29LT Zarid', 'Work Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--nl-muted);
  white-space: nowrap;
}

/* ============================================================
   FILTER BAR — .mah-nl-filters
   ============================================================ */
.mah-nl-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  flex: 0 1 auto;
}

.mah-nl-filter {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mah-nl-filter__select {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 240px;
  min-width: 180px;
  height: 56px;
  padding: 16px;
  background: var(--nl-input-bg);
  border: 0;
  border-radius: var(--nl-radius);
  cursor: pointer;
}

.mah-nl-filter__value {
  flex: 1 0 0;
  min-width: 0;
  text-align: right;
  font-family: '29LT Zarid', 'Work Sans', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--nl-muted);
}

.mah-nl-filter__select svg {
  order: 1;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--nl-muted);
}

.mah-nl-filter__label {
  order: -1;
  font-family: '29LT Zarid', 'Work Sans', sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--nl-meta);
  white-space: nowrap;
}

/* ── Dropdown menu (functional filters) ── */
.mah-nl-filter__control {
  position: relative;
}

.mah-nl-filter__select svg {
  transition: transform var(--nl-transition);
}

.mah-nl-filter__select[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.mah-nl-filter__menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-start: 0;
  z-index: 20;
  min-width: 100%;
  max-height: 320px;
  overflow-y: auto;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: #ffffff;
  border: 1px solid var(--nl-border);
  border-radius: var(--nl-radius);
  box-shadow: 0 8px 24px rgba(16, 60, 85, 0.12);
  display: none;
}

.mah-nl-filter__menu.is-open {
  display: block;
}

.mah-nl-filter__option {
  padding: 10px 12px;
  border-radius: 6px;
  font-family: '29LT Zarid', 'Work Sans', sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: var(--nl-body-text);
  cursor: pointer;
  text-align: start;
  transition: background var(--nl-transition);
}

.mah-nl-filter__option:hover {
  background: var(--nl-input-bg);
}

.mah-nl-filter__option.is-active {
  background: var(--nl-nav-blue);
  color: #ffffff;
}

/* ── Filter state: hidden cards + empty message ── */
.mah-news-card.is-hidden,
.mah-nl-grid .mah-nl-feature.is-hidden {
  display: none;
}

.mah-nl-noresults {
  grid-column: 1 / -1;
  padding: 32px 0;
  font-family: '29LT Zarid', 'Work Sans', sans-serif;
  font-size: 18px;
  color: var(--nl-muted);
  text-align: center;
}

.mah-nl-noresults[hidden] {
  display: none;
}

/* ============================================================
   ARTICLES GRID — .mah-nl-grid
   (3-up grid of reused .mah-news-card components)
   ============================================================ */
.mah-nl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  padding: 0 var(--nl-px) 32px;
}

.mah-nl-grid .mah-nl-feature {
  grid-column: 1 / -1;
  padding: 0;
}

/* ============================================================
   LOAD MORE — .mah-nl-more
   ============================================================ */
.mah-nl-more {
  display: flex;
  justify-content: center;
  padding: 0 var(--nl-px) 24px;
}
/* display:flex overrides the bare [hidden] attribute, so hide it explicitly */
.mah-nl-more[hidden] {
  display: none;
}

.mah-nl-more__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  background: transparent;
  border: 2px solid var(--nl-border);
  border-radius: var(--nl-radius);
  box-shadow: 0 1px 2px 0 rgba(35, 47, 55, 0.05);
  font-family: '29LT Zarid', 'Work Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--nl-muted);
  cursor: pointer;
  transition: all var(--nl-transition);
}

.mah-nl-more__btn:hover {
  background: #ffffff;
  border-color: #c7c7c7;
}

/* ============================================================
   RELATED PROJECTS — .mah-nl-related
   ============================================================ */
.mah-nl-related {
  background: var(--nl-bg);
  padding: 24px var(--nl-px) 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 24px;
  row-gap: 24px;
  align-items: center;
}

.mah-nl-related__head {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
}

.mah-nl-related__title {
  flex: 1 0 0;
  min-width: 0;
  font-family: '29LT Zarid', 'Work Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--nl-gold);
  text-align: right;
  line-height: 1.25;
  margin: 0;
}

.mah-nl-related__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: '29LT Zarid', 'Work Sans', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--nl-gold);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity var(--nl-transition);
}

.mah-nl-related__link:hover {
  opacity: 0.75;
  color: var(--nl-gold);
}

.mah-nl-related__link svg {
  flex-shrink: 0;
}

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

.mah-nl-related__footer {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  display: flex;
}

/* ── Project card ── */
.mah-nl-project {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-decoration: none;
  color: inherit;
}

.mah-nl-project__img {
  width: 100%;
  height: 256px;
  overflow: hidden;
  border-radius: var(--nl-radius);
  flex-shrink: 0;
}

.mah-nl-project__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.mah-nl-project:hover .mah-nl-project__img img {
  transform: scale(1.04);
}

.mah-nl-project__body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 16px;
  align-items: flex-start;
  text-align: start;
}

.mah-nl-project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 0;
}

.mah-nl-project__tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--nl-project-tag);
  font-family: '29LT Zarid', 'Work Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--nl-muted);
  white-space: nowrap;
}

.mah-nl-project__title {
  font-family: '29LT Zarid', sans-serif;
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 700;
  color: var(--nl-title-blue);
  line-height: 1.25;
  letter-spacing: -1px;
  margin: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  :root {
    --nl-px: 48px;
  }
}

@media (max-width: 992px) {
  .mah-nl-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .mah-nl-feature,
  .mah-nl-feature--alt {
    flex-direction: column;
  }

  .mah-nl-feature__copy {
    width: 100%;
    padding-bottom: 0;
  }

  .mah-nl-feature__img {
    flex: 0 0 auto;
    width: 100%;
    height: 320px;
  }

  .mah-nl-grid .mah-nl-feature__img {
    flex: 0 0 auto;
    width: 100%;
    height: 320px;
  }
}

@media (max-width: 768px) {
  :root {
    --nl-px: 20px;
  }

  .mah-nl-grid,
  .mah-nl-related__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .mah-nl-filterbar {
    flex-direction: column;
    align-items: stretch;
  }

  .mah-nl-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .mah-nl-filter {
    justify-content: space-between;
  }

  .mah-nl-filter__select {
    flex: 1 0 0;
    width: auto;
  }

  .mah-nl-related {
    display: flex;
    flex-direction: column;
  }

  .mah-nl-related__footer {
    justify-self: auto;
    margin-top: 8px;
  }

  .mah-nl-related__link {
    justify-content: center;
    width: 100%;
  }

  .mah-nl-feature__title {
    font-size: clamp(24px, 6vw, 32px);
  }
}
