/*
 * Property detail sections.
 *
 * Loaded only on property pages. Each section is a card, but the *inside* of
 * each is shaped to its data -- amenities as an icon grid, pricing as a table,
 * FAQs as an accordion -- because a column of identical boxes is harder to
 * scan than one where the shape tells you what you are looking at.
 *
 * Colours come from the theme: #004274 headings, #00aeff accents, #28a745 for
 * the primary action.
 */

.ps-section {
  background: #fff;
  border: 1px solid #e6eaee;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .04);
  padding: 24px 26px;
  margin-bottom: 20px;
  scroll-margin-top: 90px;   /* clears the sticky section nav */
  /* A card never lets its contents widen the page; anything too wide for the
     screen scrolls inside its own box instead. */
  overflow: hidden;
}

.ps-section .block-title-wrap { margin-bottom: 18px; }
.ps-section .block-title-wrap h2 {
  font-size: 21px;
  color: #004274;
  margin: 0;
  line-height: 1.3;
}

.ps-group-title {
  font-size: 15px;
  font-weight: 700;
  color: #004274;
  margin: 20px 0 10px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.ps-section .ps-group-title:first-child { margin-top: 0; }

.ps-intro { color: #8a9099; font-size: 14px; margin: -6px 0 16px; }

.ps-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #eef6fb;
  color: #00688f;
  border-radius: 3px;
  padding: 2px 7px;
  margin-left: 6px;
  vertical-align: middle;
}
.ps-chip-muted { background: #f1f3f5; color: #78818b; }

/* ---------------------------------------------------------------- grid */
.ps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px 20px;
  margin: 0;
}
.ps-grid-cell { min-width: 0; }
.ps-grid dt {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #8a9099;
  margin-bottom: 2px;
}
.ps-grid dd {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: #26292e;
  word-break: break-word;
}

/* ------------------------------------------------------------ richtext */
.ps-richtext { color: #4a5260; line-height: 1.75; }
.ps-richtext h2, .ps-richtext h3, .ps-richtext h4 { color: #004274; }
.ps-richtext table { width: 100%; }

/* Long copy is capped with a fade and a "Read more" the script adds. */
.js-collapsible.is-clamped {
  position: relative;
  max-height: 320px;
  overflow: hidden;
}
.js-collapsible.is-clamped::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 90px;
  background: linear-gradient(rgba(255, 255, 255, 0), #fff);
}
.ps-readmore {
  display: inline-block;
  margin-top: 12px;
  background: none;
  border: 0;
  padding: 0;
  color: #00aeff;
  font-weight: 700;
  cursor: pointer;
}

/* --------------------------------------------------------------- cards */
.ps-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.ps-card {
  border: 1px solid #eef1f4;
  border-radius: 6px;
  padding: 16px 18px;
  background: #fbfcfd;
}
.ps-card-icon { font-size: 22px; color: #00aeff; display: block; margin-bottom: 8px; }
.ps-card-title { font-size: 15px; color: #004274; margin: 0 0 6px; }
.ps-card-text { margin: 0; font-size: 14px; color: #66707a; line-height: 1.6; }

/* --------------------------------------------------------------- table */
/* Wide tables scroll inside their own box rather than the page.
   The min-width:0 matters: a flex item defaults to min-width:auto, so without
   it the table's own min-width pushes the whole column wider than the screen
   instead of the wrapper scrolling. */
.property-detail-v4 .bt-content-wrap,
.ps-section,
.ps-section .block-content-wrap { min-width: 0; }

.ps-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin-bottom: 8px;
}

/* site.css turns any table inside .block-content-wrap into a scrolling block,
   which is right for pasted article markup but wrong here -- it stops the
   table laying out as a table and makes it push the section wide instead of
   scrolling inside the wrapper. These tables are already in a scroll box, so
   they go back to being tables. */
.ps-table-wrap > .ps-table {
  display: table;
  max-width: none;
  overflow: visible;
}

.ps-table { width: 100%; border-collapse: collapse; font-size: 14px; }

/* A floor of 480px keeps columns readable on a desktop, but on a phone it is
   the table's own content that should decide the width -- forcing a minimum
   there just pushes the card wider than the screen. */
@media (min-width: 768px) {
  .ps-table { min-width: 480px; }
}
.ps-table th, .ps-table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid #eef1f4;
  white-space: nowrap;
}
.ps-table th {
  background: #f7f9fb;
  color: #004274;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.ps-table tbody tr:last-child td { border-bottom: 0; }

.ps-cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ------------------------------------------------------ specifications */
.ps-spec-list { margin: 0; }
.ps-spec-row {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #f2f4f7;
  font-size: 14px;
}
.ps-spec-row:last-child { border-bottom: 0; }
.ps-spec-row dt { flex: 0 0 40%; color: #8a9099; margin: 0; font-weight: 500; }
.ps-spec-row dd { flex: 1 1 auto; margin: 0; color: #26292e; }

/* ---------------------------------------------------------------- tags */
.ps-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.ps-tag {
  border: 1px solid #d8e6ef;
  background: #f5fbfe;
  color: #00688f;
  border-radius: 30px;
  padding: 6px 15px;
  font-size: 14px;
}

/* ----------------------------------------------------------- amenities */
.ps-amenities {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px 18px;
  margin: 0 0 6px;
}
.ps-amenity { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #35404a; }
.ps-amenity .houzez-icon {
  font-size: 17px;
  color: #00aeff;
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #eef8fd;
  border-radius: 50%;
  flex: 0 0 30px;
}

/* ------------------------------------------------------------- gallery */
.ps-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.ps-gallery-item { display: block; border-radius: 6px; overflow: hidden; }
.ps-gallery-item img {
  width: 100%; height: 140px; object-fit: cover; display: block;
  transition: transform .3s ease;
}
.ps-gallery-item:hover img { transform: scale(1.04); }

/* --------------------------------------------------- floor / site plans */
.ps-plans {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.ps-plan { margin: 0; border: 1px solid #eef1f4; border-radius: 6px; overflow: hidden; }
.ps-plan img { width: 100%; height: 190px; object-fit: contain; background: #f7f9fb; display: block; }
.ps-plan figcaption { padding: 10px 14px; font-size: 14px; }
.ps-plan-note { display: block; color: #8a9099; font-size: 13px; margin-top: 3px; }

/* -------------------------------------------------------------- videos */
.ps-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ps-video-frame { position: relative; padding-top: 56.25%; border-radius: 6px; overflow: hidden; background: #000; }
.ps-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ps-video-title { margin: 8px 0 0; font-size: 14px; font-weight: 500; }

/* ----------------------------------------------------------- documents */
.ps-documents { margin: 0; }
.ps-document {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f2f4f7;
}
.ps-document:last-child { border-bottom: 0; }
.ps-document > .houzez-icon { font-size: 20px; color: #00aeff; }
.ps-document-name { flex: 1 1 auto; font-size: 14px; font-weight: 500; }
.ps-document-note { display: block; font-weight: 400; color: #8a9099; font-size: 13px; }

/* ----------------------------------------------------------------- map */
.ps-map { height: 380px; border-radius: 6px; overflow: hidden; }
.ps-map-address { margin: 12px 0 0; font-size: 14px; color: #4a5260; }
.ps-map-link { margin: 6px 0 0; font-size: 14px; }

/* ----------------------------------------------------------- locations */
.ps-locations { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.ps-location-group { min-width: 0; }
.ps-location-list { margin: 0; }
.ps-location {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 9px 0;
  border-bottom: 1px solid #f2f4f7;
  font-size: 14px;
}
.ps-location:last-child { border-bottom: 0; }
.ps-location-name { color: #26292e; font-weight: 500; }
.ps-location-meta { color: #00688f; white-space: nowrap; }
.ps-location-note { flex: 1 1 100%; color: #8a9099; font-size: 13px; }

/* ------------------------------------------------------------ progress */
.ps-progress {
  position: relative;
  height: 26px;
  background: #eef1f4;
  border-radius: 30px;
  overflow: hidden;
  margin-bottom: 18px;
}
.ps-progress-bar { height: 100%; background: linear-gradient(90deg, #00aeff, #0086c6); }
.ps-progress-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #16303f;
}

/* ----------------------------------------------------------- accordion */
.ps-accordion { border: 1px solid #eef1f4; border-radius: 6px; overflow: hidden; }
.ps-faq { border-bottom: 1px solid #eef1f4; }
.ps-faq:last-child { border-bottom: 0; }
.ps-faq summary {
  padding: 14px 44px 14px 18px;
  cursor: pointer;
  font-weight: 500;
  color: #004274;
  position: relative;
  list-style: none;
}
.ps-faq summary::-webkit-details-marker { display: none; }
.ps-faq summary::after {
  content: "+";
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  font-size: 19px;
  color: #00aeff;
}
.ps-faq[open] summary::after { content: "\2212"; }
.ps-faq[open] summary { background: #f7fbfd; }
.ps-faq-body { padding: 0 18px 16px; color: #4a5260; line-height: 1.7; font-size: 14px; }

/* ------------------------------------------------------------ timeline */
.ps-timeline { margin: 0; padding-left: 18px; border-left: 2px solid #e6eaee; }
.ps-timeline-item { position: relative; padding: 0 0 20px 14px; }
.ps-timeline-item::before {
  content: "";
  position: absolute;
  left: -25px; top: 5px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #00aeff;
  box-shadow: 0 0 0 3px #eef8fd;
}
.ps-timeline-date { display: block; font-size: 12px; color: #8a9099; text-transform: uppercase; letter-spacing: .04em; }
.ps-timeline-title { font-size: 15px; color: #004274; margin: 3px 0 4px; }
.ps-timeline-body p { margin: 0; font-size: 14px; color: #66707a; }

/* -------------------------------------------------------------- offers */
.ps-offer { border-color: #d9ecdd; background: #f6fcf8; }
.ps-offer.is-expired { background: #fafbfc; border-color: #eef1f4; opacity: .75; }
.ps-offer-dates { font-size: 13px; color: #8a9099; margin: 6px 0 0; }
.ps-offer-terms { margin-top: 8px; font-size: 13px; }
.ps-offer-terms summary { cursor: pointer; color: #00688f; }

/* ----------------------------------------------------------- developer */
.ps-developer { display: flex; gap: 22px; flex-wrap: wrap; }
.ps-developer-logo { flex: 0 0 150px; }
.ps-developer-logo img { width: 150px; border: 1px solid #eef1f4; border-radius: 6px; }
.ps-developer-body { flex: 1 1 300px; min-width: 0; }
.ps-developer-name { font-size: 18px; margin: 0 0 10px; }
.ps-developer-stats { display: flex; flex-wrap: wrap; gap: 22px; margin: 0 0 14px; }
.ps-developer-stats li { display: flex; flex-direction: column; }
.ps-developer-stats strong { font-size: 20px; color: #004274; line-height: 1.2; }
.ps-developer-stats span { font-size: 12px; color: #8a9099; text-transform: uppercase; letter-spacing: .04em; }
.ps-developer-about { font-size: 14px; color: #4a5260; line-height: 1.7; }

/* ------------------------------------------ sticky section nav on mobile */
@media (max-width: 991.98px) {
  .property-navigation { justify-content: flex-start !important; overflow-x: auto; }
}

@media (max-width: 767.98px) {
  .ps-section { padding: 18px 16px; border-radius: 6px; }
  .ps-section .block-title-wrap h2 { font-size: 18px; }
  .ps-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px 14px; }
  .ps-gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .ps-gallery-item img { height: 110px; }
  .ps-developer { gap: 16px; }
  .ps-developer-logo { flex: 0 0 100px; }
  .ps-developer-logo img { width: 100px; }
  .ps-spec-row { flex-direction: column; gap: 2px; }
  .ps-spec-row dt { flex: none; }
  .ps-map { height: 280px; }
}

/* ----------------------------------------------------- image lightbox */
.ps-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(8, 12, 18, .9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.ps-lightbox[hidden] { display: none; }
.ps-lightbox img { max-width: 100%; max-height: 86vh; border-radius: 6px; }
.ps-lightbox-caption {
  position: absolute;
  left: 0; right: 0; bottom: 18px;
  text-align: center;
  color: #fff;
  font-size: 14px;
}
.ps-lightbox-close,
.ps-lightbox-prev,
.ps-lightbox-next {
  position: absolute;
  background: rgba(255, 255, 255, .12);
  border: 0;
  color: #fff;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.ps-lightbox-close { top: 18px; right: 18px; }
.ps-lightbox-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.ps-lightbox-next { right: 18px; top: 50%; transform: translateY(-50%); }
.ps-lightbox-close:hover,
.ps-lightbox-prev:hover,
.ps-lightbox-next:hover { background: rgba(255, 255, 255, .25); }
