/* Peter Rodrigues 1.1 — layout, images, forms.
   High specificity so WordPress / classic / global styles cannot revert controls
   to native browser defaults or stretch images. */

html body {
  font-size: 1.125rem;
  line-height: 1.65;
  color: #0B1B3A;
}
html body p,
html body li,
html body .lede,
html body .muted,
html body .prose,
html body .post-content {
  max-width: 70ch;
}
html body .post-grid p,
html body .post-card p,
html body .area-card p,
html body .listing-card p,
html body .quote p,
html body .footer p,
html body .results p,
html body .imap p {
  max-width: none;
}

/* Images: never stretch. Width/height HTML attrs must keep their ratio. */
html body img {
  max-width: 100%;
  height: auto;
}
html body .hero-photo {
  position: relative;
  overflow: hidden;
  background: #E8EDF6;
}
html body .hero-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
}
@media (max-width: 979px) {
  html body .hero-photo {
    aspect-ratio: 16 / 10;
    min-height: 0;
    max-height: none;
  }
}
html body .area-card img,
html body .post-card img,
html body .listing-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: 50% 50%;
}
html body .gallery img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
html body .quote img,
html body .quote-photo img,
html body .quote.quote-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
html body .about-grid img,
html body .portrait-frame img,
html body .photo,
html body .cta-photo {
  width: 100%;
  height: auto;
  object-fit: cover;
}
html body .cta-photo {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 20%;
}
html body .article-hero img,
html body .area-detail img,
html body .photo-band,
html body .page-hero-image {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
html body .logo-strip img,
html body .marquee img {
  height: 28px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}
html body .wp-block-image img,
html body .post-content img,
html body .prose img {
  max-width: 100%;
  height: auto;
}

/* Sticky header clears the WP admin bar when logged in */
.admin-bar .header { top: var(--wp-admin--admin-bar--height, 32px); }
@media screen and (max-width: 782px) {
  .admin-bar .header { top: var(--wp-admin--admin-bar--height, 46px); }
}

/* -------- Forms: tools, contact, popup, map filters -------- */
html body .field,
html body .form .field,
html body .tool-form .field,
html body .lead .field,
html body .imap-filters > div {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 16px;
  width: 100%;
}
html body .field > label,
html body .form label,
html body .tool-form label,
html body .lead label,
html body .imap-filters label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: #5A6578;
  margin: 0;
  line-height: 1.3;
}
html body .field label:has(input[type="checkbox"]) {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
  font-weight: 500;
  color: #0B1B3A;
  text-transform: none;
}

html body .form input[type="text"],
html body .form input[type="email"],
html body .form input[type="tel"],
html body .form input[type="number"],
html body .form input[type="search"],
html body .form input[type="url"],
html body .form select,
html body .form textarea,
html body .tool-form input[type="text"],
html body .tool-form input[type="email"],
html body .tool-form input[type="tel"],
html body .tool-form input[type="number"],
html body .tool-form input[type="search"],
html body .tool-form select,
html body .tool-form textarea,
html body .lead input[type="text"],
html body .lead input[type="email"],
html body .lead input[type="tel"],
html body .lead input[type="number"],
html body .lead select,
html body .lead textarea,
html body .imap-filters select,
html body .imap-filters input[type="text"],
html body .imap-search input,
html body input.map-q,
html body .imap-q {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  height: 48px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #D6DCE8;
  border-radius: 10px;
  background-color: #F7F9FC;
  color: #0B1B3A;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  box-shadow: none;
}
html body .form textarea,
html body .tool-form textarea,
html body .lead textarea {
  height: auto;
  min-height: 112px;
  padding: 12px 14px;
  resize: vertical;
}
html body .form input:focus,
html body .form select:focus,
html body .form textarea:focus,
html body .tool-form input:focus,
html body .tool-form select:focus,
html body .tool-form textarea:focus,
html body .lead input:focus,
html body .lead select:focus,
html body .lead textarea:focus,
html body .imap-filters select:focus,
html body .imap-search input:focus,
html body input.map-q:focus {
  outline: 2px solid #0F2C66;
  outline-offset: 1px;
  border-color: #0F2C66;
  background-color: #fff;
}

/* Hide native number spinners */
html body input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
html body input[type="number"]::-webkit-outer-spin-button,
html body input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Custom select chevron */
html body .form select,
html body .tool-form select,
html body .lead select,
html body .imap-filters select {
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%230F2C66' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  cursor: pointer;
}

/* Prefix / suffix adornments (AED, %) */
html body .input-affix {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 48px;
  border: 1px solid #D6DCE8;
  border-radius: 10px;
  background: #F7F9FC;
  overflow: hidden;
}
html body .input-affix .affix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #E8EDF6;
  color: #0F2C66;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
html body .input-affix input[type="text"],
html body .input-affix input[type="number"] {
  border: 0;
  border-radius: 0;
  background: transparent;
  min-width: 0;
  flex: 1;
  box-shadow: none;
  height: 48px;
}
html body .input-affix:focus-within {
  border-color: #0F2C66;
  outline: 2px solid #0F2C66;
  outline-offset: 1px;
  background: #fff;
}
html body .input-affix:focus-within input:focus {
  outline: none;
}

html body .field .helper,
html body .field .fine,
html body .form-note,
html body .imap-filter-note {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #5A6578;
}

/* 2-col field grids */
html body .two-col,
html body .tool-form .two-col {
  display: grid;
  gap: 16px;
}
@media (min-width: 640px) {
  html body .two-col,
  html body .tool-form .two-col {
    grid-template-columns: 1fr 1fr;
  }
}

/* Result panels as cards */
html body .results,
html body .tool-result,
html body .eligible,
html body .not-eligible {
  margin-top: 8px;
  padding: 22px 22px 20px;
  border: 1px solid #D6DCE8;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(11, 27, 58, 0.06);
}
html body .eligible { background: #E8EDF6; border-color: #C5D3EA; }
html body .not-eligible { background: #F6E8E4; border-color: #E8C9C0; }

/* Navy range sliders (map filters) */
html body input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 99px;
  background: #E8EDF6;
  padding: 0;
  min-height: 0;
  accent-color: #0F2C66;
}
html body input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0F2C66;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #0F2C66;
  cursor: pointer;
}
html body input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0F2C66;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #0F2C66;
  cursor: pointer;
}

html body .btn {
  min-height: 48px;
  border-radius: 10px;
}
html body .tool-tab {
  min-height: 44px;
  border-radius: 10px;
}

/* No accidental horizontal scroll */
html, body { overflow-x: hidden; }

/* v1.1.1 — people and event photos: never crop heads/faces */
html body .gallery {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
  align-items: stretch;
}
@media (min-width: 640px) {
  html body .gallery { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  html body .gallery { grid-template-columns: repeat(5, 1fr); }
}
/* All five event photos are 900×1200 (3:4). Use that box so the full frame shows.
   A mixed landscape (e.g. handover on About) letterboxes on a soft ground — never cropped. */
html body .gallery img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  object-position: center top;
  background: #F3F6FB;
  display: block;
}

/* Peter portrait is 1000×1150 — keep that ratio, no 4:3 landscape crop */
html body .about-grid img,
html body .portrait-frame img,
html body img[src*="peter-portrait"] {
  width: 100%;
  height: auto;
  aspect-ratio: 1000 / 1150;
  object-fit: contain;
  object-position: center top;
  background: #F3F6FB;
}

/* CTA band is a wide box: pin to the top so the head stays in frame */
html body .cta-photo,
html body img.cta-photo {
  aspect-ratio: auto;
  width: 38%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Testimonial handover is 1200×900 (4:3) — match it; keep faces at the top */
html body .quote img,
html body .quote-photo img,
html body .quote.quote-photo img,
html body img[src*="handover-carol"] {
  aspect-ratio: 4 / 3;
  object-fit: contain;
  object-position: center top;
  background: #F3F6FB;
  height: auto;
}

/* Portrait listing/area/journal cards (Marina 2:3, Burj 2:3) */
html body .area-card img.is-portrait,
html body .post-card img.is-portrait,
html body .listing-card img.is-portrait,
html body .area-detail img.is-portrait {
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: center top;
}
/* Other card photos: if they include people, prefer the top of the frame */
html body .area-card img,
html body .post-card img,
html body .listing-card img {
  object-position: center 20%;
}
