/* ── HRE — Hayati Real Estate portfolio showcase (gold/real-asset palette) ── */

/* UAE dirham sign U+20C3 (Unicode 18.0). No system font ships it yet — Segoe UI
   and Arial both render a tofu box — so a 1 KB subset is self-hosted. The
   unicode-range confines it to that one codepoint: digits keep the site font.
   Glyph from the `dirham` npm package (MIT), sans variant. */
@font-face {
  font-family: "Dirham-Sans";
  src: url("../assets/fonts/dirham-sans.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
  unicode-range: U+20C3;
}
/* Must precede the generic families, otherwise sans-serif claims the codepoint
   and the webfont is never reached. role="img" + aria-label keeps screen
   readers announcing "AED" instead of an unnamed glyph.
   Optical sizing: the dirham sign is a wide two-bar D whose ink is ~2.1x the
   width of "$" at the same cap height (advance 1.15em vs 0.65em), so at 1em it
   reads as a headline letter rather than a currency mark. Scaling to .8em
   brings it to a weight that sits next to "$" without dropping below legibility.
   No padding here - fmtAED() already emits a real space after the span, and an
   em-based pad would shrink along with the glyph and close the gap too far. */
.hre-aed {
  font-family: "Dirham-Sans", 'Inter', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: .8em;
}

.page-hre { max-width: 1200px; }

/* Dummy badge (mirror .hhodl-dummy — green OKX accent) */
.hre-dummy {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(0, 176, 124, 0.07);
  border: 1px solid rgba(0, 176, 124, 0.4);
  border-radius: 6px;
  padding: 10px 18px;
  margin-bottom: 18px;
  box-shadow: 0 0 18px rgba(0, 176, 124, 0.15), inset 0 0 12px rgba(0, 176, 124, 0.08);
  letter-spacing: .14em; text-transform: uppercase;
}
.hre-dummy-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--okx-green);
  animation: hre-pulse 2s ease-in-out infinite;
  flex: none;
}
.hre-dummy-text {
  font-size: 13px; font-weight: 600; color: var(--okx-green);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", monospace;
}
@keyframes hre-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,176,124,.5); }
  50% { opacity: .6; box-shadow: 0 0 0 4px rgba(0,176,124,0); }
}

/* Glass panel (same recipe as hhodl-story-card / hre-story-card) */
.hre-glass {
  border: 0.5px solid rgba(201,168,106,.24);
  border-radius: 12px;
  background: rgba(10,10,15,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(0,0,0,.35), inset 0 0 46px rgba(201,168,106,.04);
  padding: 24px 22px;
}

/* Header: title + tagline */
.hre-head { margin-bottom: 14px; }
.hre-title-row { margin-bottom: 6px; }
.page-hre .page-title { margin-bottom: 0; }
.hre-tagline { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* Summary stat strip */
.hre-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.hre-stat {
  display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--border); border-radius: 6px;
  background: rgba(10,10,15,.45);
  padding: 12px 14px;
}
.hre-stat-label {
  font-size: 10px; color: var(--muted2); text-transform: uppercase; letter-spacing: .06em;
}
.hre-stat b {
  font-size: 16px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.hre-pnl-total { font-size: 14px !important; }
.hre-pnl-total.up { color: var(--okx-green); }
.hre-pnl-total.down { color: var(--okx-red); }
.hre-stat b.hre-stat-green { color: var(--okx-green); }

/* Lifestyle coverage block */
.hre-cov {
  margin-bottom: 14px;
  border: 1px solid rgba(201,168,106,.3);
  border-radius: 16px;
  background: rgba(10,10,15,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(0,0,0,.35), inset 0 1px 0 rgba(201,168,106,.14), inset 0 0 46px rgba(201,168,106,.04);
  padding: 16px 18px;
}

/* Header strip: single line, marquee on narrow screens */
.hre-cov-strip {
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  background: linear-gradient(90deg, rgba(201,168,106,.08), rgba(201,168,106,.03) 50%, rgba(201,168,106,.08));
  border: 1px solid rgba(201,168,106,.22);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}
.hre-cov-strip-track { display: flex; width: max-content; }
.hre-cov-strip-text {
  font-size: 13px; font-weight: 500; color: #f0dfb6;
  letter-spacing: .02em; white-space: nowrap; padding-right: 48px;
}
.hre-cov-strip-echo { display: none; }
.hre-cov-strip.is-rolling .hre-cov-strip-echo { display: flex; }
.hre-cov-strip.is-rolling .hre-cov-strip-track { animation: hre-marquee 18s linear infinite; }
@keyframes hre-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Level buttons: 3-tier, scrollable, centered focus */
.hre-cov-tabs {
  display: flex; gap: 8px;
  overflow-x: auto; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px; margin-bottom: 12px;
}
.hre-cov-tabs::-webkit-scrollbar { display: none; }
.hre-cov-tab {
  flex: 1 0 160px; min-width: 155px;
  display: flex; flex-direction: column; gap: 3px; text-align: left;
  padding: 10px 12px; font-family: inherit; cursor: pointer;
  background: rgba(255,255,255,.02); color: var(--muted);
  border: 1px solid var(--border); border-radius: 10px;
  transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.hre-cov-tab:hover { color: var(--text); background: rgba(255,255,255,.06); border-color: rgba(201,168,106,.3); }
.hre-cov-tab.is-active {
  color: #f0dfb6;
  border-color: rgba(201,168,106,.55);
  background: linear-gradient(180deg, rgba(201,168,106,.24), rgba(201,168,106,.05));
  box-shadow: inset 0 1px 4px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.04);
}
.hre-cov-tab-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.2; }
.hre-cov-tab.is-active .hre-cov-tab-title { color: var(--accent); }
.hre-cov-tab-life { font-size: 11px; color: var(--muted2); font-variant-numeric: tabular-nums; line-height: 1.2; }
.hre-cov-tab-car {
  font-size: 11px; color: var(--muted); font-weight: 500; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hre-cov-tab.is-active .hre-cov-tab-car { color: #f0dfb6; }
.hre-cov-tab-drives {
  display: block; font-style: normal; font-size: 9px; font-weight: 400;
  color: #7d7566; letter-spacing: .08em; line-height: 1.3;
}

/* Indicators: 3 cards in a row */
.hre-cov-cards {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-top: 10px;
}
.hre-cov-card {
  display: flex; flex-direction: column; gap: 4px; justify-content: center;
  border: 1px solid var(--border); border-radius: 10px;
  background: rgba(255,255,255,.03);
  padding: 10px 14px; min-height: 58px;
}
.hre-cov-card-label { font-size: 11px; color: var(--muted2); font-weight: 500; }
.hre-cov-card-val { font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.3; }
.hre-cov-card-pct { background: rgba(201,168,106,.06); border-color: rgba(201,168,106,.28); }
.hre-cov-card-pctrow { display: flex; align-items: baseline; gap: 8px; }
.hre-cov-pct {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 22px; font-weight: 700;
  font-variant-numeric: tabular-nums; line-height: 1.1;
  background: linear-gradient(180deg, #eedcb0 8%, var(--accent) 55%, #9d7f3c);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(201,168,106,.22));
}
.hre-cov-pct.is-done {
  background: linear-gradient(180deg, #8cecc4 8%, var(--okx-green) 60%, #00a07c);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(0,176,124,.22));
}
.hre-cov-pct-note { font-size: 11px; color: var(--muted2); }
.hre-cov-pct-note.is-done { color: var(--okx-green); font-weight: 500; }

/* Progress bar */
.hre-cov-track {
  height: 16px; border: 1px solid rgba(201,168,106,.28); border-radius: 9px;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 6px, rgba(10,10,15,.5) 6px 12px);
  margin-top: 12px; overflow: hidden;
}
.hre-cov-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, rgba(201,168,106,.5), #ecd9a8 90%);
  box-shadow: 0 0 16px rgba(201,168,106,.45);
  transition: width .35s ease;
}
.hre-cov-fill.is-done {
  background: linear-gradient(90deg, rgba(0,176,124,.55), #7de8c0 90%);
  box-shadow: 0 0 16px rgba(0,176,124,.45);
}

/* Positions table (OKX dark panel, like .hhodl-tbl) */
.hre-tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--okx-border); border-radius: 4px;
  background: var(--okx-bg-panel); margin-bottom: 14px;
}
.hre-tbl { width: 100%; border-collapse: collapse; min-width: 1080px; }
.hre-tbl th {
  text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: #e8e0cc; padding: 11px 10px; border-bottom: 1px solid rgba(201, 165, 95, .35);
  white-space: nowrap; background: rgba(201, 165, 95, .08);
}
.hre-tbl td {
  font-size: 11px; padding: 8px 10px; border-bottom: 1px solid var(--okx-border);
  color: var(--okx-text-main); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.hre-tbl tbody tr:hover { background: var(--okx-bg-card); }

/* ── Secondary-market listings panel (real Dubai secondary market) ── */
.hre-sec {
  margin: 26px 0 20px;
  padding: 24px 22px;
  border: 0.5px solid rgba(201,168,106,.24);
  border-radius: 12px;
  background: rgba(10,10,15,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(0,0,0,.35), inset 0 0 46px rgba(201,168,106,.04);
}
.hre-sec-head { margin-bottom: 14px; }
.hre-sec-fresh { font-size: 12px; color: var(--muted); line-height: 1.6; margin: 0 0 4px; }
.hre-sec-note { font-size: 11px; color: var(--muted2); line-height: 1.55; margin: 0; }

/* Community filter chips (pill look, smaller scale than .hre-cov-tab) */
.hre-chips {
  display: flex; flex-wrap: wrap; gap: 7px;
  margin-bottom: 14px;
}
.hre-chip {
  font-family: inherit;
  font-size: 11px; font-weight: 500; line-height: 1;
  color: var(--okx-text-main);
  background: var(--okx-bg-card);
  border: 1px solid var(--okx-border);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.hre-chip em {
  font-style: normal; font-size: 10px; font-weight: 600;
  color: var(--muted2);
  background: rgba(201,165,95,.12);
  border-radius: 999px;
  padding: 2px 6px;
  font-variant-numeric: tabular-nums;
}
.hre-chip:hover { border-color: rgba(201,165,95,.45); }
.hre-chip.is-active {
  color: #fff;
  background: rgba(0,176,124,.16);
  border-color: rgba(0,176,124,.55);
}
.hre-chip.is-active em { color: var(--okx-green); background: rgba(0,176,124,.16); }

/* Building/project search — sits inline, right of the sort chips.
   First search control on the site. */
.hre-search {
  display: flex; align-items: center; gap: 7px;
  margin-left: 14px;          /* sits right after the sort chips, not pinned to the panel edge */
  flex: 0 1 250px;            /* never starves the sort chips; may shrink */
  min-width: 0;
}
.hre-search-input {
  flex: 1 1 auto; min-width: 0;
  font-family: inherit; font-size: 12px; line-height: 1.3;
  color: var(--okx-text-main);
  background: var(--okx-bg-card);
  border: 1px solid var(--okx-border);
  border-radius: 999px;
  padding: 8px 13px;
  transition: border-color .15s ease;
}
.hre-search-input::placeholder { color: var(--okx-text-subtle); }
.hre-search-input:focus {
  outline: none;
  border-color: rgba(201,165,95,.55);
}
.hre-search-input::-webkit-search-cancel-button { display: none; }
.hre-search-clear {
  font-family: inherit; font-size: 11px; font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--okx-border);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
  transition: border-color .15s ease, color .15s ease;
}
.hre-search-clear:hover { color: var(--okx-text-main); border-color: rgba(201,165,95,.45); }
.hre-search-clear[hidden] { display: none; }
/* Icon is always there; the word appears only when there is room for it. */
.hre-search-clear > span:first-child {
  display: inline-block; font-size: 14px; line-height: 1;
  transform: translateY(1px);
}
.hre-search-clear-text {
  display: inline;
  font-size: 11px; font-weight: 500;
}

/* Empty state when search + community filter match nothing */
.hre-sec-empty td { text-align: center; padding: 26px 14px; }
.hre-sec-empty-title { margin: 0 0 4px; font-size: 12.5px; color: var(--okx-text-main); }
.hre-sec-empty-hint  { margin: 0 0 12px; font-size: 11.5px; color: var(--muted); }
.hre-sec-empty-btn {
  font-family: inherit; font-size: 11px; font-weight: 500;
  color: #fff;
  background: rgba(201,165,95,.14);
  border: 1px solid rgba(201,165,95,.55);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background .15s ease;
}
.hre-sec-empty-btn:hover { background: rgba(201,165,95,.24); }

/* Sort control — visually separated from the community filter chips above so
   filtering and ordering are never confused. Muted until picked. */
.hre-chips-sort {
  align-items: center;
  margin-top: -2px;
  margin-bottom: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--okx-border);
}
.hre-chips-sort-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted2); margin-right: 3px; white-space: nowrap;
}
.hre-chip-sort { background: transparent; color: var(--muted); }
.hre-chip-sort:hover { color: var(--okx-text-main); }
.hre-chip-sort.is-active {
  color: #fff;
  background: rgba(201,165,95,.14);
  border-color: rgba(201,165,95,.55);
}

/* Vertically scrollable listings table, sticky header */
.hre-tbl-wrap-scroll {
  max-height: 460px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.hre-tbl-sec { min-width: 720px; }
.hre-tbl-sec thead th {
  position: sticky; top: 0; z-index: 1;
  background: #191614;
  box-shadow: inset 0 -1px 0 rgba(201,165,95,.35);
}
.hre-tbl-sec td { font-size: 11.5px; white-space: normal; }
.hre-tbl-sec td:first-child { color: var(--muted); }
.hre-sec-cta { margin-top: 16px; }
.hre-sec-cta .hre-cta { white-space: nowrap; }

@media (max-width: 640px) {
  .hre-sec { padding: 18px 14px; }
  .hre-tbl-wrap-scroll { max-height: 380px; }
  .hre-sec-cta .hre-cta { width: 100%; text-align: center; }
}

/* Sort row: let it wrap, and drop the search to its own full-width line so
   the chips keep a tappable size on phones. */
@media (max-width: 700px) {
  .hre-chips-sort { flex-wrap: wrap; row-gap: 9px; }
  .hre-chips-sort-label { flex: 1 0 100%; }
  .hre-search {
    flex: 1 0 100%;
    margin-left: 0;
  }
  .hre-search-input { padding: 10px 13px; }   /* comfortable touch target */
  .hre-search-clear { padding: 9px 12px; }
  .hre-search-clear-text { display: none; }   /* icon-only on narrow screens */
}
.hre-cell-dim { color: var(--okx-text-muted) !important; }
.hre-cell-prop { font-weight: 600; font-size: 12px !important; color: var(--okx-text-bright); }
.hre-prop-name { color: var(--okx-text-bright); }
.hre-prop-emirate { font-weight: 400; font-size: 11px; }
.hre-cell-num { color: var(--okx-text-bright); }
.hre-cell-yield { color: var(--okx-green); font-weight: 600; }
.hre-cell-pnl { font-weight: 600; }
.hre-cell-pnl.up { color: var(--okx-green); }
.hre-cell-pnl.down { color: var(--okx-red); }

/* Totals row */
.hre-total-row {
  position: sticky; bottom: 0;
}
.hre-total-row td {
  font-weight: 600; color: var(--okx-text-bright);
  background: var(--okx-bg-card); border-top: 1px solid var(--okx-border-focus);
}
.hre-total-label { text-transform: uppercase; letter-spacing: .08em; font-size: 10px !important; color: var(--okx-text-muted) !important; }

/* Story & CTA */
.hre-story { display: flex; flex-direction: column; gap: 14px; }
.hre-story h2 { margin-bottom: 14px; }
.hre-story-card {
  border: 0.5px solid rgba(201,168,106,.24);
  border-radius: 12px;
  background: rgba(10,10,15,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(0,0,0,.35), inset 0 0 46px rgba(201,168,106,.04);
  padding: 28px 24px;
}
.hre-lead { font-size: 13px; line-height: 1.75; color: var(--muted); margin-bottom: 22px; }

/* Cross-reference to a sibling project page, embedded in body copy. The underline
   keeps it readable as a link without breaking the paragraph rhythm. */
.hre-xref {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(201, 168, 106, .4);
  transition: color .2s, text-decoration-color .2s;
  white-space: nowrap;
}
.hre-xref:hover,
.hre-xref:focus-visible { color: #E4C88C; text-decoration-color: currentColor; }
.hre-xref:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.hre-principles { display: flex; flex-direction: column; gap: 16px; }
.hre-principle { display: flex; gap: 14px; }
.hre-principle-n {
  flex: 0 0 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--okx-green);
  background: var(--okx-green-bg); border: 1px solid rgba(0,176,124,.3);
  font-variant-numeric: tabular-nums;
}
.hre-principle h3 { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.hre-principle p { font-size: 12px; line-height: 1.7; color: var(--muted); }

.hre-invest {
  border: 0.5px solid rgba(102,217,255,.14);
  border-radius: 12px;
  background: rgba(10,10,15,.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(0,0,0,.35), inset 0 0 46px rgba(102,217,255,.03);
  padding: 28px 24px;
}
.hre-invest-text { font-size: 13px; line-height: 1.8; color: var(--muted); }
.hre-cta-row { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.hre-cta {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; border-radius: 6px; cursor: pointer;
  padding: 10px 18px; font-size: 13px; font-weight: 500; font-family: inherit;
}
.hre-cta-tg { background: var(--okx-green); color: #fff; border: 1px solid transparent; }
.hre-cta-tg:hover { background: var(--okx-green-hover); }
.hre-cta-invest {
  background: linear-gradient(135deg, #d9ba7e, var(--accent));
  color: #080808; border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 0 22px rgba(201,168,106,.28);
}
.hre-cta-invest:hover { filter: brightness(1.12); box-shadow: 0 0 30px rgba(201,168,106,.4); }
.hre-cta-ghost { background: transparent; color: var(--accent); border: 1px solid rgba(201,168,106,.4); }
.hre-cta-ghost:hover { border-color: var(--accent); background: rgba(201,168,106,.08); }
.hre-disclaimer { margin-top: 18px; font-size: 11px; line-height: 1.7; color: var(--muted2); opacity: .8; }

/* Responsive */
@media (max-width: 767px) {
  .page-hre { padding-left: 12px; padding-right: 12px; }
  .hre-story-card, .hre-invest { padding: 22px 16px; }
  .hre-cov { padding: 14px 12px; }
  .hre-cov-tab { flex: 0 0 150px; padding: 9px 10px; }
  .hre-cov-cards { grid-template-columns: 1fr; }
  .hre-cov-pct { font-size: 20px; }
}