/* ========================================
   RBM Brokerage LLC - Main Stylesheet
   Brooklyn Commercial & Residential Real Estate
   ======================================== */

/* CSS Variables */
:root {
  --navy: #003D77;
  --navy-dark: #002b56;
  --white: #FFFFFF;
  --black: #0A0000;
  --gray: #B1B6BA;
  --gray-light: #f7f8fb;
  --teal: #7EBEC5;
  --teal-dark: #5aa8b0;
  --shadow: 0 6px 20px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 30px rgba(0, 61, 119, 0.18);
  --radius: 4px;
  --radius-lg: 12px;
  --container: 1100px;
  --font-serif: 'Noto Serif', Georgia, 'Times New Roman', serif;
  --font-sans: 'Raleway', Helvetica, Arial, sans-serif;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-serif);
  background: var(--gray-light);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  line-height: 1.2;
  margin: 0;
}

p {
  margin: 0 0 1rem;
}

a {
  color: inherit;
  text-decoration: none;
}

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

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Container */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================
   Top Bar
   ======================================== */
.top-bar {
  background: var(--navy);
  color: var(--white);
  padding: 12px 0;
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar .logo {
  display: flex;
  align-items: center;
}

.top-bar .nav-logo {
  height: 45px;
  width: auto;
  object-fit: contain;
}

.top-bar-contacts {
  display: flex;
  align-items: center;
  gap: 24px;
}

.top-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  transition: opacity 0.3s ease;
}

.top-contact:hover {
  opacity: 0.8;
}

.top-contact .icon {
  font-size: 0.85rem;
}

.top-contact .contact-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 4px;
  fill: currentColor;
}

/* ========================================
   Navigation
   ======================================== */
.topnav {
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
}

.main-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.main-nav a {
  color: var(--gray);
  padding: 10px 16px;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: color 0.3s ease, background 0.3s ease;
}

.main-nav a:hover {
  color: var(--black);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  font-size: 24px;
  color: var(--navy);
  cursor: pointer;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
  position: relative;
  min-height: 600px;
  padding: 100px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('images/heroimage.jpg');
  background-size: cover;
  background-position: center;
  filter: brightness(0.5);
  z-index: 0;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 61, 119, 0.3), rgba(0, 0, 0, 0.4));
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content {
  max-width: 800px;
  text-align: center;
  color: var(--white);
}

.hero-content h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.15;
}

.hero-content .sub {
  font-size: 1.4rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 32px;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-block;
  padding: 14px 32px;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.btn-primary:hover {
  background: var(--white);
  color: var(--navy);
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn-secondary:hover {
  background: var(--white);
  color: var(--navy);
}

.btn-white {
  background: var(--white);
  color: var(--navy);
  border-color: var(--white);
}

.btn-white:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--white);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}

.btn-outline:hover {
  background: var(--navy);
  color: var(--white);
}

/* ========================================
   Featured Listings Section
   ======================================== */
.featured {
  padding: 60px 0;
  background: var(--navy);
}

.featured .section-head {
  text-align: center;
  margin-bottom: 40px;
}

.featured .section-head h2 {
  color: var(--white);
  font-size: 2rem;
  margin-bottom: 10px;
}

.featured .section-head .muted {
  color: rgba(255, 255, 255, 0.8);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.section-head h2 {
  margin: 0;
  font-size: 2rem;
}

.muted {
  color: rgba(10, 0, 0, 0.68);
}

.listings-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.listing-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.listing-photo {
  height: 180px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 12px;
  position: relative;
}

.listing-tag {
  background: rgba(0, 0, 0, 0.7);
  color: var(--white);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.listing-tag.sold-tag {
  background: #c0392b;
}

.listing-tag.in-contract-tag {
  background: #e67e22;
}

.listing-body {
  padding: 20px;
}

.listing-body h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--black);
}

.listing-body .neighborhood {
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.listing-body .price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.listing-type {
  display: inline-block;
  background: var(--gray-light);
  color: var(--gray);
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ========================================
   Recently Sold Carousel Section
   ======================================== */
.sold-carousel-section {
  padding: 60px 0;
  background: #f8f9fa;
}

.sold-carousel-section .section-head {
  text-align: center;
  margin-bottom: 40px;
}

.sold-carousel-section .section-head h2 {
  color: var(--navy);
  font-size: 2rem;
  margin-bottom: 10px;
}

.carousel-wrapper {
  display: flex;
  align-items: center;
  gap: 15px;
  position: relative;
}

.carousel-track-container {
  overflow: hidden;
  flex: 1;
}

.carousel-track {
  display: flex;
  gap: 24px;
  transition: transform 0.4s ease;
}

.carousel-slide {
  flex: 0 0 calc(25% - 18px);
  min-width: calc(25% - 18px);
}

.carousel-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  line-height: 1;
}

.carousel-btn:hover {
  background: var(--navy-dark);
  transform: scale(1.1);
}

.carousel-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ========================================
   CTA Split Sections
   ======================================== */
.cta-split {
  padding: 80px 0;
  background: var(--white);
}

.cta-split-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.cta-reverse {
  direction: rtl;
}

.cta-reverse > * {
  direction: ltr;
}

.cta-text h2 {
  font-size: 2.2rem;
  margin-bottom: 20px;
  color: var(--black);
}

.cta-split-navy .cta-text h2 {
  color: var(--white);
}

.cta-text p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--black);
}

.cta-split-navy .cta-text p {
  color: rgba(255, 255, 255, 0.9);
}

.cta-text .btn {
  margin-top: 16px;
}

.cta-split-navy {
  background: var(--navy);
  color: var(--white);
}

.cta-image {
  height: 100%;
}

.image-placeholder {
  width: 100%;
  height: 400px;
  border-radius: var(--radius-lg);
  box-shadow: 10px 6px 20px rgba(0, 0, 0, 0.2);
}

.sales-image {
  background: url('../siteimages/findyourbrooklyndream.webp') center/cover no-repeat;
}

.rentals-image {
  background: url('../siteimages/explorebrooklynrentals.jpg') center/cover no-repeat;
}

/* ========================================
   Services Section
   ======================================== */
.services-section {
  padding: 80px 0;
  background: var(--gray-light);
  text-align: center;
}

.services-section h2 {
  font-size: 2.2rem;
  margin-bottom: 16px;
}

.section-intro {
  max-width: 700px;
  margin: 0 auto 50px;
  color: var(--gray);
  font-size: 1.1rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 40px;
}

.service-card {
  background: var(--white);
  padding: 40px 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}

.service-card:hover {
  transform: translateY(-4px);
}

.service-icon {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.service-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--black);
}

.service-card p {
  color: var(--gray);
  font-size: 1rem;
  margin: 0;
}

.services-cta {
  margin-top: 20px;
}

/* ========================================
   Contact Section
   ======================================== */
.contact-section {
  padding: 80px 0;
  background: var(--navy);
  color: var(--white);
}

.contact-wrap {
  max-width: 1000px;
}

.contact-title {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.contact-sub {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 40px;
  font-size: 1.1rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  align-items: start;
}

.contact-info-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-card.small {
  background: transparent;
}

.contact-card.small h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--white);
}

.contact-card.small p {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
}

.contact-card.small a {
  color: var(--white);
  text-decoration: underline;
}

.contact-card.small a:hover {
  opacity: 0.8;
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: background 0.3s ease;
}

.social-link svg {
  width: 18px;
  height: 18px;
  display: block;
}

.social-link:hover {
  background: rgba(255, 255, 255, 0.2);
}

.contact-form-box {
  background: var(--white);
  padding: 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  color: var(--black);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.contact-form-box label {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.contact-form-box input,
.contact-form-box textarea,
.contact-form-box select {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e0e5eb;
  font-family: var(--font-serif);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.contact-form-box input:focus,
.contact-form-box textarea:focus,
.contact-form-box select:focus {
  outline: none;
  border-color: var(--navy);
}

.contact-form-box textarea {
  resize: vertical;
}

.form-actions {
  margin-top: 10px;
  text-align: right;
}

.submit-btn {
  background: var(--navy);
  color: var(--white);
  padding: 14px 32px;
  border-radius: var(--radius);
  border: none;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--navy-dark);
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
  background: var(--navy);
  color: var(--white);
  padding: 60px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 60px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo {
  height: 60px;
  width: auto;
  margin-bottom: 16px;
}

.footer-about {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  margin-bottom: 20px;
  max-width: 350px;
}

.footer-col h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--white);
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.3s ease;
}

.footer-col ul li a:hover {
  color: var(--white);
}

.footer-bottom {
  padding: 20px 0;
  text-align: center;
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin: 0;
}

/* ========================================
   Sales & Lease Pages
   ======================================== */
.page-header {
  padding: 40px 0 20px;
}

.page-header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.sales-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 24px 0;
  flex-wrap: wrap;
}

.type-switch {
  display: flex;
  gap: 8px;
}

.type-btn {
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid #e0e5eb;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.type-btn:hover {
  border-color: var(--navy);
}

.type-btn.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.sort-controls {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

.sort-controls label {
  font-weight: 600;
}

#sort {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #e0e5eb;
  font-family: var(--font-serif);
  font-size: 1rem;
}

/* ========================================
   Page-specific Listings Grid (white bg)
   ======================================== */
.listings-page {
  padding: 40px 0 60px;
  background: var(--gray-light);
}

.listings-page .listings-grid {
  margin-top: 20px;
}

.listings-page .listing-photo {
  background: linear-gradient(135deg, #e6f0ff, #eef7fb);
  color: var(--gray);
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 980px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-content .sub {
    font-size: 1.2rem;
  }

  .listings-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cta-split-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .cta-reverse {
    direction: ltr;
  }

  .cta-text {
    text-align: center;
  }

  .image-placeholder {
    height: 300px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-info-col {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 30px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .footer-about {
    margin: 0 auto 20px;
  }

  .social-links {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .top-bar-inner {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .top-bar .logo {
    order: -1;
  }

  .top-bar-contacts {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    font-size: 0.85rem;
  }

  .nav-inner {
    padding: 10px 20px;
    justify-content: space-between;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 20px;
    box-shadow: var(--shadow);
  }

  .main-nav.open {
    display: flex;
  }

  .main-nav a {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid var(--gray-light);
  }

  .main-nav a:last-child {
    border-bottom: none;
  }

  .nav-toggle {
    display: block;
  }

  .hero {
    min-height: 500px;
    padding: 60px 0;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content .sub {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }

  .listings-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .contact-info-col {
    flex-direction: column;
    text-align: center;
  }

  .social-links {
    justify-content: center;
  }

  .contact-form-box {
    padding: 20px;
  }

  .sales-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .type-switch {
    flex-wrap: wrap;
    justify-content: center;
  }

  .sort-controls {
    margin-left: 0;
    justify-content: center;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .hero-content h1 {
    font-size: 1.75rem;
  }

  .cta-text h2,
  .services-section h2,
  .contact-title {
    font-size: 1.75rem;
  }

  .service-card {
    padding: 30px 20px;
  }

  .carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
  }

  .carousel-wrapper {
    gap: 10px;
  }
}