.project-page {
  --project-ink: #16233b;
  --project-muted: #788195;
  --project-border: #e5e3dd;
  color: var(--project-ink);
  background: #f7f6f3;
}
.project-page.gallery-open { overflow: hidden; }
.project-layout a:focus-visible,
.project-layout button:focus-visible,
.project-mobile-quote a:focus-visible { outline: 3px solid #779bd3; outline-offset: 5px; }

/* Place the shared header above the project content; inherit its navbar styles. */
.project-page .site-header { position: relative; background: var(--blue); }

.project-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  align-items: start;
  gap: 40px;
  max-width: 1440px;
  margin-inline: auto;
  padding: 48px 48px 80px;
}
.project-cover { grid-column: 2; grid-row: 1; min-width: 0; margin: 0; }
.project-cover img { width: 100%; height: auto; aspect-ratio: 5 / 3; object-fit: cover; border-radius: 14px; }
.project-facts {
  position: sticky;
  top: 24px;
  grid-column: 1;
  grid-row: 1 / span 2;
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--project-border);
  border-radius: 14px;
  background: #fff;
}
.project-facts-heading { display: flex; align-items: center; justify-content: flex-start; }
.project-client { display: none; }
.project-mobile-location,
.project-mobile-contractor { display: none; }
.project-detail-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}
.project-detail-status::before { content: ""; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
/* Optically center Tajawal's Arabic glyphs within their line box. */
.project-detail-status-label { transform: translateY(0.15em); }
.project-facts h1 { margin: 18px 0 20px; font-size: 26px; font-weight: 800; line-height: 1.35; }
.project-facts-list { margin: 0; border-top: 1px solid var(--project-border); }
.project-fact { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 48px; padding-block: 12px; border-bottom: 1px solid var(--project-border); }
.project-fact dt { color: var(--project-muted); font-size: 13px; font-weight: 400; }
.project-fact dd { max-width: 65%; margin: 0; text-align: left; font-size: 13px; font-weight: 700; line-height: 1.6; }
.project-mobile-text { display: none; }
.project-scope { margin-top: 18px; }
.project-scope h2 { margin: 0 0 10px; color: var(--project-muted); font-size: 13px; font-weight: 700; line-height: 1.5; }
.project-scope ul { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.project-scope li { padding: 6px 12px; border-radius: 8px; color: var(--blue); background: #eef3fb; font-size: 12px; font-weight: 700; line-height: 1.5; }
.project-quote-button { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 14px; border-radius: 10px; color: #fff; background: var(--blue); text-align: center; font-size: 16px; font-weight: 700; line-height: 1.5; transition: background-color 180ms ease; }
.project-quote-button:hover { background: #244d8b; }
.project-desktop-quote { margin-top: 24px; }
.project-mobile-quote { display: none; }
.project-content { grid-column: 2; grid-row: 2; min-width: 0; }
.project-content h2 { margin: 0 0 12px; font-size: 22px; font-weight: 800; line-height: 1.4; }
.project-story p { margin: 0; color: #4d586b; font-size: 16px; line-height: 1.9; }
.project-story + .project-gallery { margin-top: 44px; }
.project-work,
.project-work + .project-gallery { margin-top: 36px; }
.project-work ul { margin: 0; padding-inline-start: 22px; color: #4d586b; font-size: 16px; line-height: 1.9; }
.project-work li + li { margin-top: 8px; }
.project-work li::marker { color: var(--blue); }
.project-gallery-group + .project-gallery-group { margin-top: 28px; }
.project-gallery-group h3 { margin: 18px 0 0; color: #4d586b; font-size: 16px; font-weight: 700; }
.project-gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0; margin: 18px 0 0; list-style: none; }
.project-gallery-grid li { min-width: 0; }
.project-gallery-link { display: block; border-radius: 10px; overflow: hidden; }
.project-gallery-link img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 200ms ease; }
.project-gallery-link:hover img { transform: scale(1.025); }

.project-lightbox { position: fixed; width: min(1100px, 96vw); max-width: 96vw; max-height: 94svh; padding: 52px 20px 16px; border: 0; border-radius: 14px; color: #fff; background: #16233b; }
.project-lightbox::backdrop { background: rgb(8 15 28 / 88%); }
.project-lightbox figure { margin: 0; }
.project-lightbox-image { width: 100%; height: min(70svh, 850px); object-fit: contain; }
.project-lightbox figcaption { margin-top: 12px; text-align: center; font-size: 15px; }
.project-lightbox button { cursor: pointer; border: 0; border-radius: 8px; color: inherit; background: rgb(255 255 255 / 12%); }
.project-lightbox-close { position: absolute; top: 8px; inset-inline-end: 12px; width: 40px; height: 40px; font-size: 30px; line-height: 1; }
.project-lightbox-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 10px; }
.project-lightbox-controls button { width: 44px; height: 40px; font-size: 24px; }
.project-lightbox-controls button[hidden] { display: none; }
.project-lightbox-count { font-size: 13px; }

@media (min-width: 901px) and (max-width: 1100px) {
  .project-layout { grid-template-columns: 300px minmax(0, 1fr); gap: 28px; padding-inline: 32px; }
  .project-facts { padding: 22px; }
  .project-facts h1 { font-size: 25px; }
}

@media (max-width: 900px) {
  .project-page { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .project-layout { display: flex; flex-direction: column; gap: 0; padding: 0 0 48px; }
  .project-cover { width: 100%; }
  .project-cover img { height: clamp(240px, 52vw, 420px); aspect-ratio: auto; border-radius: 0; }
  .project-facts { position: relative; top: auto; width: calc(100% - 32px); margin: -28px 16px 0; padding: 18px; border-radius: 14px; box-shadow: 0 8px 20px rgb(22 35 59 / 7%); }
  .project-facts-heading { justify-content: space-between; gap: 18px; min-height: 32px; }
  .project-client { display: block; max-width: 65%; margin: 0; color: #6f788c; font-size: 14px; line-height: 1.5; }
  .project-detail-status { padding: 3px 10px; font-size: 13px; }
  .project-facts h1 { margin: 12px 0 18px; font-size: 24px; line-height: 1.4; }
  .project-facts-list { display: none; }
  .project-mobile-location,
  .project-mobile-contractor { display: block; margin: 0 0 16px; color: var(--project-muted); font-size: 13px; line-height: 1.7; }
  .project-facts-list.has-metrics { display: grid; grid-template-columns: repeat(var(--project-metric-count), minmax(0, 1fr)); margin: 0; padding-top: 14px; }
  .project-facts-list .project-fact-client,
  .project-facts-list .project-fact-contractor,
  .project-facts-list .project-fact-location { display: none; }
  .project-metric { flex-direction: column; justify-content: flex-start; gap: 5px; min-height: 0; padding: 0 6px; border: 0; border-inline-end: 1px solid var(--project-border); text-align: center; }
  .project-metric:last-child { border-inline-end: 0; }
  .project-metric dt { order: 2; font-size: 12px; line-height: 1.5; }
  .project-metric dd { max-width: none; text-align: center; font-size: 18px; font-weight: 800; line-height: 1.5; }
  .project-desktop-text { display: none; }
  .project-mobile-text { display: inline; }
  .project-scope { margin-top: 16px; }
  .project-scope h2 { display: none; }
  .project-scope ul { gap: 6px; }
  .project-scope li { max-width: calc(50% - 3px); padding: 6px 10px; font-size: 13px; }
  .project-desktop-quote { display: none; }
  .project-mobile-quote { position: fixed; inset: auto 0 0; z-index: 15; display: block; padding: 12px 16px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--project-border); background: #fff; }
  .project-mobile-quote .project-quote-button { min-height: 48px; border-radius: 12px; font-size: 18px; }
  .project-page.menu-open .project-mobile-quote { visibility: hidden; }
  .project-content { width: 100%; padding: 28px 16px 0; }
  .project-story h2 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .project-story p { font-size: 16px; line-height: 1.9; }
  .project-content h2 { font-size: 21px; }
  .project-story + .project-gallery { margin-top: 36px; }
  .project-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
}

@media (max-width: 600px) {
  .project-client { font-size: 12px; }
  .project-facts h1 { margin: 4px 0 16px; font-size: clamp(18px, 5.4vw, 22px); }
  .project-facts-list.has-metrics { padding-top: 12px; }
  .project-metric { gap: 4px; }
  .project-metric dd { font-size: 16px; }
  .project-metric dt { font-size: 11px; }
  .project-scope { margin-top: 14px; }
  .project-scope li { padding-block: 4px; font-size: 12px; }
  .project-story p,
  .project-work ul { font-size: 14px; }
  .project-content h2 { font-size: 20px; }
  .project-lightbox { padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .project-layout *, .project-layout *::before, .project-layout *::after,
  .project-mobile-quote * { transition-duration: 0.01ms !important; }
}
