/*
  Darwesh Group -- Projects (projects.html + project.html) styles.
  =================================================================
  Scoped to these two new pages only (linked from nowhere else), so
  nothing here can alter Home or any unrelated page. Uses the site's
  real design tokens (css/profile-tokens.css's --ps-color-*, already
  loaded on every page that loads this file) rather than a parallel
  token set.
*/

/* Theme tokens for the listing chrome. Moon is the default. Sun replaces
   the same variables, so a theme toggle repaints without a reload and
   without touching the selected city or category. */
.cine-scope {
  --theme-text: #F1F3F5;
  --theme-text-muted: #A5ABB3;
  --theme-gold: #B49A6A;
  --proj-panel: #181C21;
  --proj-panel-border: rgba(215,219,224,.10);
  --proj-panel-shadow: 0 12px 28px rgba(0,0,0,.24);
  --proj-pill: #1C2128;
  --proj-pill-border: rgba(215,219,224,.12);
  --proj-active-bg: rgba(180,154,106,.16);
  --proj-active-border: rgba(180,154,106,.55);
  --proj-active-shadow: 0 6px 18px rgba(0,0,0,.18);
  --proj-city-bg: #252B33;
  --proj-city-border: rgba(180,154,106,.55);
  --proj-city-shadow: 0 6px 16px rgba(0,0,0,.18);
  --proj-divider: rgba(215,219,224,.12);
  --proj-thumb-a: #252B33;
  --proj-thumb-b: #1C2128;
}
html[data-dg-theme="light"] .cine-scope {
  --theme-text: #2F2A26;
  --theme-text-muted: #6E6258;
  --theme-gold: #C6A46A;
  --proj-panel: rgba(255,255,255,.52);
  --proj-panel-border: rgba(190,170,135,.22);
  --proj-panel-shadow: 0 12px 32px rgba(70,55,35,.08);
  --proj-pill: rgba(255,255,255,.76);
  --proj-pill-border: #E3D8C8;
  --proj-active-bg: rgba(198,164,106,.16);
  --proj-active-border: rgba(198,164,106,.70);
  --proj-active-shadow: 0 6px 18px rgba(70,55,35,.08);
  --proj-city-bg: rgba(255,248,236,.96);
  --proj-city-border: rgba(198,164,106,.65);
  --proj-city-shadow: 0 6px 16px rgba(70,55,35,.08);
  --proj-divider: rgba(190,170,135,.28);
  --proj-thumb-a: #E3D8C8;
  --proj-thumb-b: #F6F1E8;
}

/* ---- Title + filter bar (projects.html) ---------------------------- */
.proj-heading { margin: 0 0 16px; }
.proj-title {
  margin: 0;
  font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15;
  color: var(--theme-text);
}
.proj-title-city { color: var(--theme-gold); }
@media (min-width: 768px) {
  .proj-title { font-size: 30px; }
}
.proj-filter-bar {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  width: 100%; max-width: 100%; box-sizing: border-box;
  margin: 0 0 22px; padding: 12px;
  border-radius: 18px;
  background: var(--proj-panel);
  border: 1px solid var(--proj-panel-border);
  color: var(--theme-text);
  box-shadow: var(--proj-panel-shadow);
}

/* ---- City selector (projects.html) ---------------------------------- */
.proj-cities {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  width: 100%; max-width: 100%;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.proj-cities::-webkit-scrollbar { display: none; }
.proj-city-indicator {
  position: absolute; top: 0; left: 0; z-index: 0;
  box-sizing: border-box;
  border-radius: 12px;
  background: var(--proj-city-bg);
  border: 1px solid var(--proj-city-border);
  box-shadow: var(--proj-city-shadow);
  pointer-events: none;
  opacity: 0;
}
.proj-city-indicator.is-ready {
  transition: transform 200ms cubic-bezier(.2,.8,.2,1), width 200ms cubic-bezier(.2,.8,.2,1), height 200ms cubic-bezier(.2,.8,.2,1);
}
.proj-cities .proj-city {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 8px;
  flex: 0 0 auto; scroll-snap-align: start;
  height: 46px; padding: 4px 12px 4px 4px;
  border-radius: 12px;
  border: 1px solid var(--proj-pill-border);
  background: transparent;
  color: var(--theme-text-muted);
  cursor: pointer; white-space: nowrap;
  transition: border-color 180ms cubic-bezier(.2,.8,.2,1), color 180ms cubic-bezier(.2,.8,.2,1), transform 180ms cubic-bezier(.2,.8,.2,1);
}
.proj-cities .proj-city-thumb {
  width: 32px; height: 32px; border-radius: 8px; object-fit: cover; flex: none;
  opacity: 0.82;
  filter: saturate(0.9) brightness(0.94);
  transition: filter 180ms cubic-bezier(.2,.8,.2,1), opacity 180ms cubic-bezier(.2,.8,.2,1);
}
.proj-city-thumb--empty {
  display: block;
  background:
    radial-gradient(70% 70% at 70% 20%, rgba(198, 164, 106, 0.28), transparent 70%),
    linear-gradient(180deg, var(--proj-thumb-a), var(--proj-thumb-b));
}
.proj-cities .proj-city-name {
  font-size: 13px; font-weight: 600; line-height: 1; letter-spacing: 0.01em;
}
.proj-cities .proj-city:hover:not(.is-active):not(:active) {
  color: var(--theme-text);
  transform: translateY(-1px);
}
.proj-cities .proj-city:active { transform: scale(0.98); }
.proj-cities .proj-city.is-active,
.proj-cities .proj-city.is-active:hover {
  border-color: transparent;
  background: transparent;
  color: var(--theme-text);
  transform: scale(1.015);
}
.proj-cities .proj-city.is-active:active { transform: scale(0.98); }
.proj-cities .proj-city.is-active .proj-city-thumb {
  opacity: 1;
  filter: saturate(1) brightness(1.06);
}
.proj-cities .proj-city:focus-visible {
  outline: 2px solid var(--theme-gold);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .proj-cities .proj-city,
  .proj-cities .proj-city-thumb,
  .proj-city-indicator,
  .proj-city-indicator.is-ready { transition: none; }
  .proj-cities .proj-city:hover:not(.is-active):not(:active),
  .proj-cities .proj-city:active { transform: none; }
  .proj-cities .proj-city.is-active,
  .proj-cities .proj-city.is-active:hover,
  .proj-cities .proj-city.is-active:active { transform: none; }
}

/* Compact empty state under the filters. */
#projEmpty .ps-empty { padding-block: 28px 12px; }
.proj-empty-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 14px; }
.proj-empty-action {
  background: transparent; border: 0; padding: 0; cursor: pointer;
  color: var(--ps-color-secondary); font-weight: 600; font-size: 13px;
  transition: color 160ms ease, opacity 160ms ease;
}
.proj-empty-action:hover { color: var(--ps-color-secondary-container); }
.proj-empty-action:focus-visible { outline: none; box-shadow: var(--ps-focus-ring); border-radius: 6px; }
.proj-empty-or { color: var(--ps-color-on-surface-variant); font-size: 13px; align-self: center; }

/* ---- Category tabs (projects.html) ------------------------------- */
.proj-tabs {
  position: relative;
  display: inline-flex; align-items: center; gap: 0;
  max-width: 100%;
  padding: 4px;
  border-radius: 14px;
  background: var(--proj-pill);
  border: 1px solid var(--proj-pill-border);
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.proj-tabs::-webkit-scrollbar { display: none; }
.proj-tab-indicator {
  position: absolute; top: 0; left: 0; z-index: 0;
  box-sizing: border-box;
  border-radius: 10px;
  background: var(--proj-active-bg);
  border: 1px solid var(--proj-active-border);
  box-shadow: 0 0 0 1px var(--proj-active-border);
  pointer-events: none;
}
.proj-tab-indicator.is-ready {
  transition: transform 200ms cubic-bezier(.2,.8,.2,1), width 200ms cubic-bezier(.2,.8,.2,1), height 200ms cubic-bezier(.2,.8,.2,1);
}
.proj-tabs .proj-tab {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; min-height: 36px; border-radius: 10px;
  border: 0; background: transparent;
  color: var(--theme-text-muted);
  font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: color 160ms cubic-bezier(.2,.8,.2,1), transform 140ms cubic-bezier(.2,.8,.2,1);
}
.proj-tabs .proj-tab + .proj-tab::before {
  content: '';
  position: absolute; inset-inline-start: 0; top: 9px; bottom: 9px; width: 1px;
  background: var(--proj-divider);
  transition: opacity 160ms ease;
}
.proj-tabs .proj-tab.is-active::before,
.proj-tabs .proj-tab.is-active + .proj-tab::before { opacity: 0; }
.proj-tab-icon { width: 15px; height: 15px; flex: none; opacity: 0.7; }
.proj-tabs .proj-tab:hover { color: var(--theme-text); }
.proj-tabs .proj-tab.is-active,
.proj-tabs .proj-tab.is-active:hover,
.proj-tabs .proj-tab.is-active:focus { color: var(--theme-text); }
.proj-tabs .proj-tab.is-active .proj-tab-icon { opacity: 1; }
.proj-tabs .proj-tab:active { transform: scale(0.98); }
.proj-tabs .proj-tab:focus-visible {
  outline: 2px solid var(--theme-gold);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .proj-tabs .proj-tab,
  .proj-tab-indicator,
  .proj-tab-indicator.is-ready { transition: none; }
  .proj-tabs .proj-tab:active { transform: none; }
}

.proj-settle { animation: proj-settle 140ms cubic-bezier(.2,.8,.2,1); }
@keyframes proj-settle {
  from { opacity: 0.82; transform: translateY(2px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .proj-settle { animation: none; }
}

/* ---- Project cards -------------------------------------------------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.proj-card {
  display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  background: var(--ps-color-surface-container-lowest); border: 1px solid var(--ps-color-outline-variant);
  text-decoration: none; color: inherit; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.proj-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -18px rgba(0,0,0,.5); border-color: var(--ps-color-secondary); }
.proj-card:focus-visible { outline: none; box-shadow: var(--ps-focus-ring); }
.proj-card-cover { position: relative; aspect-ratio: 4 / 3; background: var(--ps-color-surface-container); overflow: hidden; }
.proj-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.proj-card-cover-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.proj-card-cover-fallback .material-symbols-outlined { font-size: 46px; color: var(--ps-color-on-surface-variant); opacity: .6; }
.proj-card-badges { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 8px; }
.proj-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; backdrop-filter: blur(6px);
}
.proj-badge-category { background: rgba(11,14,18,.72); color: #F4EFE7; }
.proj-badge-status { background: rgba(198,154,75,.92); color: #17150F; }
.proj-badge-verified { background: rgba(127,184,154,.92); color: #0B0E12; }
.proj-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.proj-card-name { font-weight: 700; font-size: 15.5px; color: var(--ps-color-on-surface, #F4EFE7); line-height: 1.3; }
.proj-card-place { font-size: 12.5px; color: var(--ps-color-on-surface-variant); display: flex; align-items: center; gap: 4px; }
.proj-card-price { font-weight: 700; font-size: 14.5px; color: var(--ps-color-secondary); margin-top: 2px; }
.proj-card-dev { font-size: 12px; color: var(--ps-color-on-surface-variant); margin-top: auto; padding-top: 6px; }

/* ---- Breadcrumb ------------------------------------------------------ */
.proj-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ps-color-on-surface-variant); flex-wrap: wrap; }
.proj-breadcrumb a { color: inherit; text-decoration: none; }
.proj-breadcrumb a:hover { color: var(--ps-color-secondary); }
.proj-breadcrumb span[aria-current] { color: var(--ps-color-on-surface, #F4EFE7); font-weight: 600; }

/* ---- Gallery (project.html) ------------------------------------------ */
.proj-gallery-main { position: relative; border-radius: 16px; overflow: hidden; background: var(--ps-color-surface-container); aspect-ratio: 16 / 10; cursor: zoom-in; }
.proj-gallery-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proj-gallery-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
  background: rgba(11,14,18,.72); color: #F4EFE7; border: none; display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 2;
}
.proj-gallery-arrow:hover { background: rgba(11,14,18,.9); }
.proj-gallery-arrow-prev { left: 12px; }
.proj-gallery-arrow-next { right: 12px; }
[dir="rtl"] .proj-gallery-arrow-prev { left: auto; right: 12px; }
[dir="rtl"] .proj-gallery-arrow-next { right: auto; left: 12px; }
.proj-gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; padding-bottom: 2px; scrollbar-width: thin; }
.proj-gallery-thumb { flex: none; width: 76px; height: 56px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: var(--ps-color-surface-container); padding: 0; }
.proj-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proj-gallery-thumb.is-active { border-color: var(--ps-color-secondary); }
.proj-gallery-thumb:focus-visible { outline: none; box-shadow: var(--ps-focus-ring); }

/* Lightbox -- display:flex lives on the :not(.hidden) compound selector,
   not the bare class: both this rule and Tailwind's `.hidden{display:none}`
   have equal (single-class) specificity, and this stylesheet loads AFTER
   tailwind.css, so an unconditional `display:flex` here would win the
   cascade and keep the lightbox visually covering (and intercepting
   clicks on) the page even while the `hidden` class is present. Confirmed
   via Playwright: earlier clicks on real page controls were silently
   swallowed by this element until the guard was added. */
.proj-lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(4,5,6,.94); padding: 24px; }
.proj-lightbox:not(.hidden) { display: flex; align-items: center; justify-content: center; }
.proj-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.proj-lightbox-close { position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.08); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
[dir="rtl"] .proj-lightbox-close { right: auto; left: 18px; }

/* ---- Detail section cards -------------------------------------------- */
.proj-section { background: var(--ps-color-surface-container-lowest); border: 1px solid var(--ps-color-outline-variant); border-radius: 16px; padding: 20px; }
.proj-section-label { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ps-color-secondary); margin-bottom: 10px; display: block; }
.proj-fact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.proj-fact dt { font-size: 11.5px; color: var(--ps-color-on-surface-variant); margin-bottom: 2px; }
.proj-fact dd { font-size: 14px; font-weight: 600; color: var(--ps-color-on-surface, #F4EFE7); }

/* Amenities */
.proj-amenity-chip { background: rgba(198,154,75,.1); color: var(--ps-color-on-surface, #F4EFE7); font-size: 12.5px; font-weight: 500; padding: 6px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; }

/* Unit type chips */
.proj-unittype-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.proj-unittype-chip { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--ps-color-outline-variant); background: var(--ps-color-surface-container); color: var(--ps-color-on-surface-variant); font-size: 13px; font-weight: 600; cursor: pointer; text-align: start; }
.proj-unittype-chip.is-active { border-color: var(--ps-color-secondary); background: rgba(198,154,75,.12); color: var(--ps-color-on-surface, #F4EFE7); }
.proj-unittype-chip:focus-visible { outline: none; box-shadow: var(--ps-focus-ring); }
.proj-floorplan-img { max-width: 220px; border-radius: 10px; cursor: zoom-in; border: 1px solid var(--ps-color-outline-variant); }

/* Payment table */
.proj-terms { display: flex; flex-direction: column; }
.proj-term { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ps-color-outline-variant); font-size: 13.5px; }
.proj-term:last-child { border-bottom: none; }
.proj-term dt { color: var(--ps-color-on-surface-variant); }
.proj-term dd { font-weight: 700; color: var(--ps-color-on-surface, #F4EFE7); font-variant-numeric: tabular-nums; }

/* Map */
#projMap { background: #101111; border-radius: 12px; overflow: hidden; }

/* Contact card */
.proj-contact-logo { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: var(--ps-color-surface-container); flex: none; }
.proj-contact-btn-row { display: flex; gap: 10px; margin-top: 14px; }
.proj-contact-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 14px; border-radius: 10px; font-weight: 700; font-size: 13px; text-decoration: none; cursor: pointer; border: none;
}
.proj-contact-btn-call { background: var(--ps-color-primary); color: var(--ps-color-on-primary); }
.proj-contact-btn-whatsapp { background: #25D366; color: #06210F; }
.proj-contact-btn:focus-visible { outline: none; box-shadow: var(--ps-focus-ring); }

/* Available units list */
.proj-unit-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--ps-color-outline-variant); border-radius: 10px; background: var(--ps-color-surface-container); }
.proj-unit-card + .proj-unit-card { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .proj-card { transition: none; }
}

@media (max-width: 640px) {
  .proj-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .proj-gallery-main { aspect-ratio: 4 / 3; }
}
