/* === Property Page Styles === */

/* Status Colors */
.status-paid { border-left: 4px solid var(--success); background: linear-gradient(135deg, #f0fdf4 0%, white 100%); }
.status-unpaid { border-left: 4px solid var(--danger); background: linear-gradient(135deg, #fef2f2 0%, white 100%); }
.status-deed { border-left: 4px solid var(--gold); background: linear-gradient(135deg, var(--gold-pale) 0%, white 100%); }

/* === Buildings Section === */
.building-group {
  margin-bottom: 20px;
  border: 2px solid var(--gray-lighter);
  border-radius: var(--radius);
  overflow: hidden;
}

.building-group:last-child { margin-bottom: 0; }

.building-header {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--navy-dark);
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--gray-bg) 0%, white 100%);
  border-bottom: 2px solid var(--gray-lighter);
}

.building-num {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 8px;
}

.building-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.building-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--gray-pale);
  font-size: 14px;
}

.building-detail-row:nth-child(odd) { background: var(--gray-bg); }

.detail-label {
  font-weight: 600;
  color: var(--navy);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  color: var(--text);
  font-weight: 500;
  text-align: right;
}

.building-accordion {
  margin-top: 0;
  margin-bottom: 12px;
  border: 2px solid var(--gray-lighter);
  border-radius: var(--radius);
  padding: 0;
  background: var(--gray-bg);
}

.building-accordion[open] { background: white; }
.building-accordion summary { padding: 12px 20px; }
.building-accordion .building-group { border: none; margin-bottom: 0; }
.building-accordion .building-header { display: none; }

/* === Map Link === */
.map-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  margin-left: 6px;
  transition: opacity 0.2s;
}

.map-link:hover { opacity: 0.75; }

/* === Street View === */
.streetview-section { text-align: center; }

.streetview-img {
  max-width: 100%;
  max-height: 400px;
  border: 2px solid var(--gray-lighter);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* === Sketch Image === */
.sketch-section { text-align: center; }

.sketch-img {
  max-width: 100%;
  max-height: 400px;
  border: 2px solid var(--gray-lighter);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* === Flood Zone === */
.flood-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-left: 8px;
  vertical-align: middle;
}

.flood-minimal { background: #d1fae5; color: #065f46; }
.flood-moderate { background: #fef3c7; color: #92400e; }
.flood-high { background: #fee2e2; color: #991b1b; }

a .flood-badge {
  text-decoration: none;
  box-shadow: 0 0 0 2px transparent;
  transition: box-shadow 0.15s, filter 0.15s;
}
a:hover .flood-badge {
  filter: brightness(0.92);
  box-shadow: 0 0 0 2px currentColor;
}

/* === Assessment Chart === */
.assessment-chart {
  width: 100%;
  max-height: 280px;
}

.assessment-chart text { font-family: var(--font-sans); }

/* === CDD Section === */
.cdd-total {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy-dark);
  margin-bottom: 12px;
}

/* === Permit Highlights === */
.permit-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.badge.permit-highlight {
  background: var(--color-surface-alt, #f0f4ff);
  color: var(--color-text, #1a1a2e);
  border: 1px solid var(--color-border, #dde3f0);
  font-weight: 500;
}

/* === SOH Warning === */
.soh-section .buyer-alert {
  background: #fff8e1;
  border: 1px solid #f9a825;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #5d4037;
}

/* === MLS Listing Section === */
.mls-header {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.mls-photo-wrap {
  width: 100%;
}

/* Arrow gallery container */
.mls-gallery {
  position: relative;
  width: 100%;
  line-height: 0;
}

.mls-photo {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--gray-lighter);
  display: block;
}

/* Prev/next arrows */
.mls-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 2;
  padding: 0;
}
.mls-gallery-arrow:hover { background: rgba(0,0,0,0.7); }
.mls-gallery-prev { left: 10px; }
.mls-gallery-next { right: 10px; }

.mls-gallery-counter {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 20px;
  line-height: 1.6;
}

.mls-summary {
  flex: 1;
  min-width: 0;
}

.mls-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.mls-dom {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.mls-price {
  font-size: 1.6rem;
  font-weight: 700;
  font-family: var(--font-serif);
  color: var(--navy-dark);
  line-height: 1.1;
  margin-bottom: 0.3rem;
}

.mls-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.mls-office {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.mls-link {
  font-size: 0.85rem;
  font-weight: 500;
}

.badge.mls-active  { background: #d1fae5; color: #065f46; }
.badge.mls-pending { background: #fef9c3; color: #713f12; }
.badge.mls-sold    { background: #fee2e2; color: #7f1d1d; }
.badge.mls-unknown { background: #f3f4f6; color: #374151; }

.mls-description {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-body);
  white-space: pre-wrap;
}

/* Quick facts bar — top-line phone-call answers */
.mls-quick-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  background: #f0f4ff;
  border: 1px solid #c7d4f0;
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.qf-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.qf-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--navy);
  opacity: 0.7;
}

.qf-val {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--navy-dark);
}

/* Categorized details — 2-column grid of groups */
.mls-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.mls-group {
  background: var(--gray-bg);
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.mls-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--navy);
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--gray-lighter);
}

.mls-details-table {
  width: 100%;
  border-collapse: collapse;
}

.mls-details-table th {
  text-align: left;
  font-weight: 600;
  padding: 0.2rem 0.6rem 0.2rem 0;
  vertical-align: top;
  white-space: nowrap;
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 100px;
  width: 40%;
}

.mls-details-table td {
  padding: 0.2rem 0;
  font-size: 0.82rem;
  vertical-align: top;
}

.mls-details-table tr + tr th,
.mls-details-table tr + tr td {
  border-top: 1px solid var(--gray-lighter);
}

/* === Two-Column Layout === */
.property-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  align-items: start;
}

.property-main {
  min-width: 0;
}

/* === Agent Sidebar === */
.agent-sidebar {
  position: sticky;
  top: 1rem;
}

.agent-card {
  background: white;
  border: 1px solid var(--gray-lighter);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.agent-card-top {
  background: linear-gradient(160deg, var(--navy-dark) 0%, #1a3a5c 100%);
  padding: 1.5rem 1rem 1.25rem;
  text-align: center;
}

.agent-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 3px solid rgba(255,255,255,0.3);
  display: block;
  margin: 0 auto 0.75rem;
}

.agent-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.2rem;
}

.agent-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 0.15rem;
}

.agent-brokerage {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 0.4rem;
}

.agent-tagline {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
  font-style: italic;
  line-height: 1.4;
}

.agent-cta-btn {
  display: block;
  margin: 0.75rem 1rem;
  padding: 0.65rem 1rem;
  background: var(--gold);
  color: var(--navy-dark);
  text-align: center;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}

.agent-cta-btn:hover {
  background: #c8a84b;
  transform: translateY(-1px);
}

.agent-contacts {
  padding: 0 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.agent-contact-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.82rem;
  transition: background 0.15s;
}

.agent-contact-row:hover {
  background: var(--gray-bg);
}

.agent-contact-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 14px;
  text-decoration: none;
}

.agent-zillow-icon {
  background: #006aff;
  color: white;
  font-weight: 900;
  font-size: 13px;
  font-family: var(--font-sans);
}

.agent-realtor-icon {
  background: #d92228;
  color: white;
  font-weight: 900;
  font-size: 13px;
  font-family: var(--font-sans);
}

.agent-instagram-icon {
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  color: white;
  font-size: 13px;
}

.agent-facebook-icon {
  background: #1877f2;
  color: white;
  font-weight: 900;
  font-size: 14px;
  font-family: var(--font-sans);
}

.agent-office {
  margin: 0 0.75rem 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--gray-bg);
  border-radius: 6px;
  border: 1px solid var(--gray-lighter);
}

.agent-office-name {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--navy);
  margin-bottom: 0.2rem;
}

.agent-office-address {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.agent-disclaimer {
  margin: 0 0.75rem 0.75rem;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* === Header Agent Mini === */
.header-agent-mini {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-agent-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.3);
}

.header-agent-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: white;
}

.header-agent-phone {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
}

.header-agent-phone:hover {
  color: white;
}

/* === Property Footer === */
.property-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.7);
  padding: 1.25rem 1rem;
  margin-top: 2rem;
  font-size: 0.78rem;
}

.property-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  color: rgba(255,255,255,0.85);
}

.footer-brand a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
}

.footer-brand a:hover {
  color: white;
}

.footer-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.88rem;
}

.footer-sep {
  opacity: 0.4;
}

.footer-legal {
  color: rgba(255,255,255,0.45);
  font-size: 0.72rem;
}

/* === Responsive === */
@media (max-width: 900px) {
  .property-layout {
    grid-template-columns: 1fr;
  }
  .agent-sidebar {
    position: static;
    order: -1;
  }
  .agent-card-top { padding: 1rem; }
  .agent-photo { width: 80px; height: 80px; }
}

@media (max-width: 768px) {
  .building-details { grid-template-columns: 1fr; }
  .mls-photo { max-height: 280px; }
  .mls-details-grid { grid-template-columns: 1fr; }
  .mls-quick-facts { grid-template-columns: repeat(2, 1fr); }
  .header-agent-mini { display: none; }
  .property-layout { padding: 0 0.5rem 1.5rem; }
}

/* === Print === */
@media print {
  .agent-sidebar { display: none; }
  .property-layout { grid-template-columns: 1fr; }
  .property-footer { display: none; }
  .streetview-section, .sketch-section { page-break-inside: avoid; }
  .streetview-img, .sketch-img { max-height: 300px; }
}
