/* =============================================================
   Spartan Agency — Single property page (2026 "fact sheet" layout)

   Rendered by the child theme's single-traxx_property.php (on-market)
   and template-parts/property-unavailable.php (off-market). The
   plugin's own templates/single-property*.php share the same class
   names so this file also styles the plugin fallbacks.

   Structure:
     .tx-property__head        bone band: back link, eyebrow, H1 address,
                               rent + availability badge, key-fact chips
     .tx-property__inner       two columns
       .tx-property__gallery-col   hero photo, thumbnail grid, notes
       .tx-property__aside         sticky fact-sheet card + CTAs

   Colour rules: charcoal type, gold for the price accent and status,
   bone panels. Plum is reserved for hyperlinks (inherits --link).
   ============================================================= */

.tx-property {
  background: var(--surface-content);
  padding-block: 0 var(--section-y);
}

/* ---------- Header band ---------- */
.tx-property__head {
  background: var(--bone);
  border-bottom: 1px solid var(--rule-light);
  padding-block: var(--s-5) var(--s-6);
}

.tx-property__head-inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.tx-property__back {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-bottom: var(--s-4);
}

.tx-property__eyebrow {
  display: block;
  margin: 0 0 var(--s-2);
  color: var(--charcoal-2);
}

.tx-property__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-3) var(--s-6);
}

.tx-property__address {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.15;
  color: var(--text);
  max-width: 24ch;
}

.tx-property__price-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
}

.tx-property__price {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-display);
  color: var(--text);
}

.tx-property__price-amount {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1;
  font-weight: 700;
}

.tx-property__price-unit {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.tx-property__badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--charcoal-2);
  background: transparent;
  color: var(--charcoal-2);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tx-property__badge--now {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-primary-ink);
}

.tx-property__badge--off {
  background: var(--charcoal-2);
  border-color: var(--charcoal-2);
  color: var(--text-on-dark);
}

.tx-property__facts {
  list-style: none;
  margin: var(--s-4) 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.tx-property__facts li {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--surface-content);
  border: 1px solid var(--rule-light);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text);
}

.tx-property__facts strong {
  font-weight: 700;
}

/* ---------- Two-column body ---------- */
.tx-property__inner {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-top: var(--s-6);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: clamp(var(--s-5), 4vw, var(--s-8));
  align-items: start;
}

.tx-property__gallery-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

/* ---------- Hero photo ---------- */
.tx-property__hero {
  margin: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bone);
  aspect-ratio: 3 / 2;
}

.tx-property__hero a {
  display: block;
  width: 100%;
  height: 100%;
}

.tx-property__hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tx-property__hero--empty {
  background:
    linear-gradient(135deg, var(--bone) 0 60%, var(--rule-light) 60% 61%, var(--bone) 61%);
}

.tx-property__hero--muted .tx-property__hero-img {
  filter: grayscale(0.6);
  opacity: 0.85;
}

/* ---------- Thumbnail grid ---------- */
.tx-property__gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-2);
}

.tx-property__gallery li {
  margin: 0;
}

.tx-property__gallery a,
.tx-property__gallery figure {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--bone);
  margin: 0;
}

.tx-property__gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-base) var(--ease-out);
}

.tx-property__gallery a:hover img,
.tx-property__gallery a:focus-visible img {
  transform: scale(1.04);
}

.tx-property__gallery a:focus-visible,
.tx-property__hero a:focus-visible {
  outline: 3px solid var(--charcoal-2);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .tx-property__gallery img { transition: none; }
  .tx-property__gallery a:hover img,
  .tx-property__gallery a:focus-visible img { transform: none; }
}

/* ---------- Notes / description ---------- */
.tx-property__notes {
  margin-top: var(--s-4);
  color: var(--text);
  line-height: var(--lh-body);
  max-width: 68ch;
}

.tx-property__notes h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  color: var(--text);
  margin: 0 0 var(--s-3);
}

/* ---------- Features & amenities / location bullets ---------- */
.tx-property__amenities {
  margin-top: var(--s-4);
  color: var(--text);
  line-height: var(--lh-body);
}

.tx-property__amenities h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  color: var(--text);
  margin: 0 0 var(--s-3);
}

.tx-property__amenity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-1) var(--s-4);
  font-family: var(--font-body);
  font-size: 0.9875rem;
}

.tx-property__amenity-list li {
  position: relative;
  padding-left: 1.25em;
  overflow-wrap: anywhere;
}

.tx-property__amenity-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--brand-primary);
}

@media (max-width: 640px) {
  .tx-property__amenity-list {
    grid-template-columns: 1fr;
  }
}

/* ---------- Sticky aside ---------- */
.tx-property__aside {
  position: sticky;
  top: var(--s-5); /* header is not sticky, so only a small breathing offset */
  font-family: var(--font-prose);
  color: var(--text);
}

.tx-property__card {
  background: var(--bone);
  border-top: 4px solid var(--brand-primary);
  border-radius: var(--r-md);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.tx-property__card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text);
}

.tx-property__specs {
  margin: 0;
  display: flex;
  flex-direction: column;
  font-size: var(--fs-body);
  color: var(--text);
}

.tx-property__specs .tx-spec-row {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 8px 0;
  border-bottom: 1px solid var(--rule-light);
}

.tx-property__specs .tx-spec-row:last-child {
  border-bottom: 0;
}

.tx-property__specs dt {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--text-muted);
  margin: 0;
}

.tx-property__specs dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* Long list values (providers, included utilities) stack under the label. */
.tx-property__specs .tx-spec-row--stack {
  flex-direction: column;
  gap: 2px;
}

.tx-property__specs .tx-spec-row--stack dd {
  text-align: left;
  font-weight: 500;
}

.tx-property__specs-subtitle {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* The card's flex gap already separates blocks; pull the list up under its heading. */
.tx-property__specs-subtitle + .tx-property__specs {
  margin-top: calc(-1 * var(--s-3));
}

.tx-property__location {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.tx-property__location a,
.tx-property__map-link {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tx-property__ctas {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--s-3);
}

.tx-property__ctas .tx-btn,
.tx-property__ctas .btn {
  width: 100%;
  text-align: center;
}

.tx-property__fineprint {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Public PDF flyer download (dashicon, served by the properties plugin) */
.tx-property__flyer {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  align-self: flex-start;
  margin-top: var(--s-2);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.tx-property__flyer .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
  line-height: 1;
}

.tx-property__flyer:hover,
.tx-property__flyer:focus-visible {
  border-bottom-color: currentColor;
}

/* ---------- Off-market state (no photos) ---------- */
.tx-property--off-market .tx-property__head {
  background: var(--surface-content);
}

.tx-property__inner--off-market {
  padding-top: var(--s-5);
}

.tx-property--off-market .tx-property__notes {
  max-width: 62ch;
}

.tx-property__similar {
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--rule-light);
}

.tx-property__similar h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  color: var(--text);
  margin: 0 0 var(--s-4);
}

.tx-property__similar .tx-properties-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.tx-property__similar-more {
  margin: var(--s-4) 0 0;
}

.tx-property__browse {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.tx-property__browse li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--rule-light);
  font-family: var(--font-body);
}

.tx-property__browse li:last-child {
  border-bottom: 0;
}

.tx-property__browse a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.tx-property__browse-count {
  min-width: 2rem;
  text-align: center;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-content);
  border: 1px solid var(--rule-light);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Plugin fallback template (templates/single-property-unavailable.php)
   still uses the centred message + .btn stack. */
.tx-property--off-market__message {
  margin: 0 auto;
  max-width: 52ch;
  font-family: var(--font-prose);
  font-size: 1.125rem;
  color: var(--text);
  line-height: var(--lh-body);
}

/* ---------- Responsive ---------- */
@media (max-width: 899px) {
  .tx-property__inner {
    grid-template-columns: 1fr;
    gap: var(--s-6);
  }
  .tx-property__aside {
    position: static;
  }
  .tx-property__gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tx-property__title-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
