/* ==========================================================================
   realestate-egy.com - site layer
   Loaded AFTER assets/css/theme.css. This file adds structure only. It defines
   no colour, size, radius, shadow or timing value of its own: every declaration
   below resolves through a var(--...) that theme.css owns.

   Layout and typographic feel inherited from palmhills-theme (the measured
   winner): letter-spaced light display capitals, near-square controls, a single
   accent colour, full-bleed photography.
   Tap-target discipline inherited from agerli-theme instead: every interactive
   element is at least var(--target-min) in BOTH axes.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Skip link
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--space-2);
  top: var(--space-2);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-media);
  color: var(--color-text-on-media);
  font-size: var(--text-sm);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }

/* --------------------------------------------------------------------------
   Broker disclosure band.
   In normal document flow at the very top of <body>, so it is inside the
   initial viewport on load and then scrolls away. Never sticky, never an
   overlay, never dismissible: it is a legal statement, not a notification.
   Opaque background + opaque text by construction. A prior audit measured a
   disclosure at 1.01:1 because its colour carried alpha, so no alpha is used
   here and no photograph is ever placed behind it.
   -------------------------------------------------------------------------- */
.disclosure {
  display: block;
}
/* WCAG 2.5.8 exempts a link that sits inline in a sentence, but a target only
   as tall as its own text is still miserable on a phone, so it is padded up to
   the minimum target token. */
.disclosure a {
  display: inline-block;
  min-height: var(--space-6);
  padding-inline: var(--space-1);
}
.disclosure__inner {
  max-width: var(--container-max);
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  background: var(--color-surface-page);
  border-bottom: var(--border-hairline) solid var(--color-border-default);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--space-16);
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--target-min);
  color: var(--color-text-primary);
  text-decoration: none;
}
.brand__mark { flex: none; }
.brand__word {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  white-space: nowrap;
}
.brand__word b {
  font-weight: var(--weight-medium);
  color: var(--color-action-primary);
}

/* Navigation. No JavaScript is required to open it: the control is a native
   <details> disclosure on small screens and the list is always visible from
   the medium breakpoint up. */
.nav__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--target-min);
  min-width: var(--target-min);
  padding-inline: var(--space-4);
  background: var(--color-action-secondary);
  color: var(--color-text-primary);
  border: var(--border-control) solid var(--color-border-strong);
  border-radius: var(--radius-control);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}
.nav__toggle[aria-expanded="true"] { background: var(--color-surface-subtle); }

/* Collapsed by default on small screens. A <noscript> block in header.php
   forces it open when there is no JavaScript to operate the toggle, so the
   navigation is never unreachable. */
.nav__list {
  list-style: none;
  margin: 0;
  padding: 0 0 var(--space-4);
  display: none;
  flex-direction: column;
  gap: var(--space-1);
  flex-basis: 100%;
}
.site-nav[data-open="true"] .nav__list { display: flex; }
.nav__link {
  display: flex;
  align-items: center;
  min-height: var(--target-min);
  padding-inline: var(--space-2);
  color: var(--color-text-primary);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  text-decoration: none;
}
.nav__link:hover { color: var(--color-text-link); }
.nav__link[aria-current="page"] {
  color: var(--color-text-link);
  box-shadow: inset 0 -2px 0 0 var(--color-action-primary);
}

/* The nav sits beside the brand, and wraps rather than pushing past the
   container edge. An unwrapped row here pushed the header call to action
   outside a desktop viewport entirely, while the document overflow metric
   still read zero. */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  min-width: 0;
}

@media (min-width: 60em) {
  .nav__toggle { display: none; }
  .nav__list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2) var(--space-6);
    padding-bottom: 0;
    flex-basis: auto;
  }
}

/* --------------------------------------------------------------------------
   Hero. The project name is the largest thing on the page and the developer
   attribution sits immediately beneath it, per the owner's instruction.
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  background: var(--color-surface-media);
  color: var(--color-text-on-media);
  display: grid;
  align-items: end;
  /* Sized so the slab still reads as a hero without a photograph behind it.
     With a photo in place this is the crop height. */
  min-height: 52vh;
  padding-block: var(--space-16) var(--space-12);
  overflow: hidden;
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Opaque scrim. Hero text is measured against this composite, never against a
   raw photograph. */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--color-surface-scrim);
}
.hero__inner {
  position: relative;
  z-index: 2;
}
.hero__eyebrow {
  color: var(--color-text-on-media);
  margin: 0 0 var(--space-4);
}
.hero__title {
  color: var(--color-text-on-media);
  font-size: var(--text-5xl);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
  line-height: var(--leading-tight);
  margin: 0;
  /* A very long project name must wrap, never widen the page. */
  overflow-wrap: break-word;
}
.hero__by {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-eyebrow);
  color: var(--color-text-on-media);
  margin: var(--space-4) 0 0;
  max-width: none;
}
.hero__by span {
  text-transform: uppercase;
}
/* The alternate published names. Smaller and untracked so it reads as a
   footnote to the attribution rather than competing with it. */
.hero__aka {
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-normal);
  margin-top: var(--space-2);
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  margin: var(--space-8) 0 0;
  padding: 0;
  list-style: none;
  color: var(--color-text-on-media);
  font-size: var(--text-sm);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

/* A secondary control standing on the media surface. Still never a coloured
   fill: it flips the label and the border to the on-media pair rather than
   gaining a background. Hover and active are spelled out rather than left to
   inherit, because a state that quietly picks up the light-surface rule is
   exactly the specificity trap the state gate exists to catch. */
.hero .btn--secondary {
  color: var(--color-text-on-media);
  border-color: var(--color-text-on-media);
  background: var(--color-action-secondary);
}
.hero .btn--secondary:hover,
.hero .btn--secondary:active {
  background: var(--color-text-on-media);
  color: var(--color-surface-media);
}

@media (min-width: 48em) {
  .hero__title { font-size: var(--text-7xl); }
  .hero__by { font-size: var(--text-xl); }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section--subtle { background: var(--color-surface-subtle); }

.section__head { margin-bottom: var(--space-10); }
.section__head p { color: var(--color-text-secondary); }

/* --------------------------------------------------------------------------
   Fact list. Every row carries its own source attribution, because a fact
   without a source does not get published on this site.
   -------------------------------------------------------------------------- */
.facts {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fill, minmax(min(var(--track-lg), 100%), 1fr));
  margin: 0;
  padding: 0;
}
.fact {
  border-top: var(--border-hairline) solid var(--color-border-strong);
  padding-top: var(--space-4);
}
.fact dd { margin: 0; }
.fact__label {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}
.fact__value {
  display: block;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-normal);
  color: var(--color-text-primary);
  max-width: none;
}
.fact__value--sm {
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
}

/* --------------------------------------------------------------------------
   Amenity list
   -------------------------------------------------------------------------- */
.amenities {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(min(var(--track-md), 100%), 1fr));
}
.amenity {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-surface-card);
  border: var(--border-hairline) solid var(--color-border-default);
  border-radius: var(--radius-card);
}
.amenity svg {
  flex: none;
  margin-top: var(--space-1);
  color: var(--color-action-primary);
}

/* --------------------------------------------------------------------------
   Unit type list
   -------------------------------------------------------------------------- */
.units {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(min(var(--track-sm), 100%), 1fr));
}
.unit {
  padding: var(--space-6) var(--space-4);
  background: var(--color-surface-card);
  border: var(--border-hairline) solid var(--color-border-default);
  border-radius: var(--radius-card);
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-normal);
}

/* --------------------------------------------------------------------------
   Price policy notice. This site does not publish a price it cannot source to
   a single non-contradicted figure, so the price slot is a call to action.
   -------------------------------------------------------------------------- */
.pricebox {
  display: grid;
  gap: var(--space-6);
  align-items: center;
  padding: var(--space-8);
  background: var(--color-surface-card);
  border: var(--border-control) solid var(--color-border-strong);
  border-radius: var(--radius-card);
}
.pricebox h2 { margin-bottom: var(--space-2); }
.pricebox p { color: var(--color-text-secondary); margin-bottom: 0; }

@media (min-width: 48em) {
  .pricebox { grid-template-columns: 1fr auto; }
}

/* --------------------------------------------------------------------------
   Project cards (home page)
   -------------------------------------------------------------------------- */
.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fill, minmax(min(var(--track-xl), 100%), 1fr));
}
.project-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--color-surface-card);
  border: var(--border-hairline) solid var(--color-border-default);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  height: 100%;
}
.project-card__region {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
.project-card__name {
  font-size: var(--text-2xl);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-normal);
  margin: 0;
}
.project-card__by {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  max-width: none;
}
.project-card__foot {
  margin-top: auto;
  padding-top: var(--space-4);
}
/* A stubbed project is stated in words, never by colour alone. */
.project-card__status {
  display: inline-flex;
  align-items: center;
  min-height: var(--space-6);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   Lead gate. A dialog the user opens deliberately. It never opens itself:
   there is no scroll trigger, no idle timer, no exit-intent listener, no
   history manipulation and no body scroll lock anywhere in this theme.
   -------------------------------------------------------------------------- */
.gate {
  width: min(34rem, 100%);
  padding: 0;
  border: var(--border-control) solid var(--color-border-strong);
  border-radius: var(--radius-card);
  background: var(--color-surface-card);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-modal);
}
.gate::backdrop { background: var(--color-surface-scrim); }
.gate__inner { padding: var(--space-6); }

/* Form controls do NOT inherit colour in Chrome: they fall back to the UA
   fieldtext black, which is invisible on the dark card. That default reached
   even the hidden inputs and the honeypot, so it is set for the whole field
   subtree at once.

   Buttons are deliberately NOT in this list. Including them made `.gate button`
   (0,1,1) out-specify `.btn--primary` (0,1,0), which repainted the send button's
   label with the body text colour and dropped it to 2.69:1 on the accent fill.
   Every button inside the gate already carries its own colour through .btn or
   .gate__close, so it needs nothing here.

   The three controls that need it are the two hidden inputs and the honeypot,
   none of which carry a class, so the rule is scoped with :not([class]). That
   keeps it away from .input and .select, which already set both halves of the
   pair; overriding those would be the same specificity trap in the other
   direction. Both colour and background are set, because the UA supplies both
   halves (fieldtext on field) and fixing only the text leaves white on white. */
.gate input:not([class]),
.gate select:not([class]),
.gate textarea:not([class]) {
  color: var(--color-text-primary);
  background-color: var(--color-surface-card);
}

.gate a { color: var(--color-text-link); }
.gate__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
}
.gate__title { margin: 0; font-size: var(--text-2xl); }
.gate__close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--target-min);
  min-height: var(--target-min);
  padding: 0;
  background: var(--color-action-secondary);
  color: var(--color-text-primary);
  border: var(--border-control) solid var(--color-border-strong);
  border-radius: var(--radius-control);
  cursor: pointer;
}
.gate__intro {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
}

.field { margin-bottom: var(--space-5); }
.field__label {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}
.field__hint {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: var(--space-2);
}
.field__error {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-feedback-error);
  margin-top: var(--space-2);
}
.field__error:empty { display: none; }
.input[aria-invalid="true"] { border-color: var(--color-feedback-error); }

/* Phone row: the country selector and the number sit on one line but wrap at
   the narrowest tested viewport rather than overflowing it. */
.phone-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.phone-row .select {
  flex: 0 1 10rem;
  min-height: var(--target-min);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-page);
  color: var(--color-text-primary);
  border: var(--border-control) solid var(--color-border-strong);
  border-radius: var(--radius-control);
  font-family: var(--font-body);
  font-size: var(--text-base);
}
.phone-row .input { flex: 1 1 10rem; width: auto; }

/* The honeypot must be reachable by nothing: not the pointer, not the tab
   order, not a screen reader. display:none is the only treatment that is not
   also a trap for assistive technology. */
.hp { display: none; }

.gate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.gate__consent {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin: var(--space-4) 0 0;
  max-width: none;
}

.gate__status {
  margin: var(--space-4) 0 0;
  font-size: var(--text-sm);
  max-width: none;
}
.gate__status:empty { display: none; }
.gate__status[data-state="error"] { color: var(--color-feedback-error); }
.gate__status[data-state="ok"] { color: var(--color-feedback-success); }

/* --------------------------------------------------------------------------
   Contact strip
   -------------------------------------------------------------------------- */
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--color-surface-media);
  color: var(--color-text-on-media);
  padding-block: var(--space-16) var(--space-8);
}
.site-footer h2,
.site-footer h3 { color: var(--color-text-on-media); }
.site-footer a { color: var(--color-text-on-media); }
/* auto-fit, not auto-fill: this grid always holds exactly three columns and
   they should share the full width. auto-fill would leave a phantom fourth
   track and squeeze the copy into two thirds of the footer. */
.footer-grid {
  display: grid;
  gap: var(--space-10);
  grid-template-columns: repeat(auto-fit, minmax(min(var(--track-lg), 100%), 1fr));
}
.footer-col h3 {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}
.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-list a {
  display: flex;
  align-items: center;
  min-height: var(--target-min);
  font-size: var(--text-sm);
}
/* The legal identity block. Not a link list, so it is not a target-size case. */
.legal {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}
.legal div { margin-bottom: var(--space-2); }
.legal dt {
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-text-on-media);
}
.legal dd {
  margin: 0;
  color: var(--color-text-on-media);
}
.footer-bottom {
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: var(--border-hairline) solid var(--color-border-strong);
  font-size: var(--text-sm);
}

/* --------------------------------------------------------------------------
   Prose pages (privacy policy)
   -------------------------------------------------------------------------- */
.prose h2 { margin-top: var(--space-12); }
.prose h3 { margin-top: var(--space-8); }
.prose ul { max-width: var(--measure-prose); padding-inline-start: var(--space-6); }
.prose li { margin-bottom: var(--space-2); }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.stack > * + * { margin-top: var(--space-4); }
.lead {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}
.source-note {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
  max-width: var(--measure-prose);
}
.source-note a { color: var(--color-text-link); }

/* Project photography. The scrim below the text is the measured surface -
   text contrast is never measured against a raw photograph. */
.hero--photo { background-size: cover; background-position: center; }
.project-card__img {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	border-radius: var(--radius-md, var(--radius, 0));
	margin-block-end: var(--space-3, 0.75rem);
	display: block;
}
