/* HSN Realty - Responsive app overrides. Mobile-first, no horizontal scroll. */
:root {
  --primary: #156f80;
  --secondary: #ab2d17;
  --header-height: 60px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body.site-body {
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* Header */
.top-bar .btn-group .btn {
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .top-bar .btn-group {
    flex-wrap: wrap;
    justify-content: center;
  }
  .top-bar .btn-group .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
  }
}

.main-header .navbar-brand .logo-img {
  max-height: 70px;
  width: auto;
}

@media (min-width: 992px) {
  .main-header .logo-img {
    max-height: 90px;
  }
}

.navbar-nav .nav-link {
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.navbar-nav .nav-link .nav-link-caret {
  display: block;
  font-size: 0.5rem;
  opacity: 0;
  margin-bottom: 0.15rem;
  line-height: 1;
}

.navbar-nav .nav-link:hover .nav-link-caret,
.navbar-nav .nav-link.active .nav-link-caret {
  opacity: 1;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  border-bottom-color: var(--secondary);
}

.navbar-nav .nav-link.active {
  font-weight: 600;
  color: var(--primary) !important;
}

a,
a:hover,
a:focus,
a:active {
  text-decoration: none !important;
}
/* Hero */
.hero-section .card {
  max-width: 100%;
}

/* Banner sections: use .banner-bg and set only background-image inline when URL is dynamic */
.skinny-banner {
  min-height: 100px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.banner-bg-hero {
  min-height: 50vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

@media (min-width: 768px) {
  .skinny-banner {
    min-height: 120px;
  }
}

/* Property cards - horizontal scroll on index */
.props-scroll-wrapper {
  margin-left: -0.75rem;
  margin-right: -0.75rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.props-scroll-wrapper::-webkit-scrollbar {
  height: 6px;
}
.props-scroll-wrapper::-webkit-scrollbar-thumb {
  background: #dee2e6;
  border-radius: 3px;
}
.props-scroll-item {
  width: 280px;
  max-width: 85vw;
}
@media (min-width: 576px) {
  .props-scroll-wrapper { margin-left: -1rem; margin-right: -1rem; padding-left: 1rem; padding-right: 1rem; }
}
@media (min-width: 768px) {
  .props-scroll-item { width: 300px; }
}

/* Property cards */
.property-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.property-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.12) !important;
}

.property-card-img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  width: 100%;
}

.property-detail-img {
  max-height: 70vh;
  object-fit: contain;
  background: #f8f9fa;
}

/* Footer */
.footer-logo {
  max-width: 180px;
}

.footer-legal {
  flex-wrap: wrap;
}

.legal-links a {
  color: inherit;
}

@media (max-width: 575.98px) {
  .footer-legal .legal-links {
    margin-left: 0 !important;
  }
}

/* Forms */
.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(21, 111, 128, 0.25);
}

/* Page content from CMS */
.page-content {
  word-wrap: break-word;
}

.page-content img {
  max-width: 100%;
  height: auto;
}

/* Agent photos */
.agent-photo {
  object-fit: cover;
}

/* Prevent layout shift for images */
.property-card-img,
.property-detail-img,
.agent-photo {
  background: #f0f0f0;
}

/* Container - avoid overflow on small screens */
.container {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

@media (min-width: 576px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Pagination */
.pagination {
  flex-wrap: wrap;
}

/* Newsletter form in footer */
.newsletter-form .input-group {
  max-width: 100%;
}

/* Search filters on mobile */
@media (max-width: 991.98px) {
  .search-filters .card-body {
    padding: 1rem;
  }
}

/* ========== Property detail page layout (accessible, touch-friendly) ========== */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  z-index: 100;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
}
.skip-link:focus {
  top: 0;
}

/* Stat boxes (sqft, lot, beds, baths) */
.stat-box {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1rem 0.5rem;
  text-align: center;
  transition: all 0.2s;
}
.stat-box i {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.25rem;
  color: var(--primary);
}
.stat-box span {
  font-size: 1.25rem;
  font-weight: 600;
  display: block;
}
.stat-box small {
  font-size: 0.875rem;
  color: #6c757d;
}

/* Schedule tour date pills */
.date-pill {
  min-width: 85px;
  padding: 0.5rem 0.25rem;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-check:checked + .date-pill {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-check:focus + .date-pill {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Carousel controls */
.carousel-control-prev, .carousel-control-next {
  width: 10%;
  background: rgba(0,0,0,0.2);
}
.carousel-control-prev-icon, .carousel-control-next-icon {
  width: 2rem;
  height: 2rem;
}

/* Social share buttons - touch-friendly */
.social-share a {
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--primary);
  color: var(--primary);
  transition: all 0.2s;
}
.social-share a:hover, .social-share a:focus {
  background: var(--primary);
  color: white;
  text-decoration: none;
}

/* Horizontal scroll for date pills */
.date-scroll {
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.date-scroll::-webkit-scrollbar {
  height: 6px;
}
.date-scroll::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* Section headings - border accent (Bootstrap-compatible) */
.property-section-heading,
.section-heading {
  border-left: 4px solid var(--secondary);
  padding-left: 0.75rem;
  margin-bottom: 1rem;
  line-height: 2;
}

/* Image aspect/cover utilities - avoid inline object-fit/max-height */
.img-cover-160 { height: 160px; object-fit: cover; }
.img-cover-220 { height: 220px; object-fit: cover; }
.img-cover-280 { max-height: 280px; object-fit: cover; }
.img-cover-320 { max-height: 320px; object-fit: cover; }
.img-cover-450 { max-height: 450px; object-fit: cover; }
.img-contain-450 { max-height: 450px; object-fit: contain; }
.img-cover-480 { max-height: 480px; object-fit: contain; }

/* Print summary container */
.property-print-summary { max-width: 800px; }

/* Iframe no border (embed) */
.embed-border-0 { border: 0; }

/* Form control width constraints (admin/public) */
.w-max-240 { max-width: 240px; }
.w-max-6rem { max-width: 6rem; }
.w-max-12rem { max-width: 12rem; }
.w-max-320 { max-width: 320px; }
.form-switch-custom { max-width: 175px; height: 50px; }

/* About page image block - only background-image set inline when URL is dynamic */
.about-img-bg {
  background-size: contain;
  background-position: top;
  background-repeat: no-repeat;
}
