/* =========================================================
   HHIMR MLS Frontend Styles - Clean & System Integrated
   ========================================================= */

/* ===== GRID LAYOUT ===== */
#listings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin: 40px auto;
  max-width: 1300px;
}
@media (max-width: 1024px) {
  #listings { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  #listings { grid-template-columns: 1fr; }
}

/* ===== ELEMENTOR VISIBILITY FIX (no forced display change) ===== */
.elementor-widget-html .elementor-widget-container #listings {
  visibility: visible !important;
  opacity: 1 !important;
}

/* ===== CARD BASE ===== */
.card {
  background: #ffffff;
  border: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: none;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* ===== IMAGE / SLIDER ===== */
.slider-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  flex-shrink: 0;
}
.slider {
  display: flex;
  transition: transform 0.5s ease-in-out;
}
.slide {
  min-width: 100%;
  box-sizing: border-box;
}
.slide img {
  width: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  height: 20vh !important; /* desktop default */
}

/* slider controls */
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 1.6rem;
  border-radius: 50%;
  transition: background 0.2s ease;
}
.slider-arrow:hover {
  background: rgba(0, 0, 0, 0.45);
}
.slider-arrow.left { left: 10px; }
.slider-arrow.right { right: 10px; }
.dot-container {
  position: absolute;
  bottom: 10px;
  width: 100%;
  text-align: center;
}
.dot {
  height: 9px;
  width: 9px;
  margin: 0 3px;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 50%;
  display: inline-block;
  background-color: rgba(255,255,255,0.2);
}
.dot.active {
  background-color: rgba(255,255,255,0.9);
}

/* ===== CARD CONTENT ===== */
.card-content {
  flex-grow: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: var(--wp--preset--font-family--body, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);
}
.card-content h2.lot {
  font-size: 2.4rem;
  font-weight: 100;
  color: #11313F;
  margin-bottom: 6px;
}
span.price {
  font-size: 1.4em !important;
  font-weight: bold;
  margin: 10px 0;
  color: #629EA6 !important;
}
.card-content p {
  color: var(--Navy, #11313F);
  font-size: 19px;
  font-style: normal;
  font-weight: 400;
  line-height: 140%;
}
.card-content strong {
  font-weight: 600;
  color: #111;
}

/* ===== DETAILS BUTTON (aligned bottom, full width) ===== */
.details-btn {
  display: inline-block;
  margin-top: auto;
  align-self: stretch;
  width: 100%;
  background: transparent;
  color: #11313F;
  border: 1px solid #11313F;
  padding: 10px 0 !important;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
}
.details-btn:hover {
  background: #629EA6;
  color: #fff;
  border: 1px solid #629EA6;
}

/* ===== NEW BADGE ===== */
.announcement-banner {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #007ea3;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 106, 162, 0.15);
  backdrop-filter: blur(5px);
}
.modal-content {
  background: #fff;
  margin: 4% auto;
  padding: 28px 40px;
  border-radius: 10px;
  max-width: 900px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  animation: fadeInUp 0.35s ease both;
}
#modal-body h2 { color: #11313F !important; }
.accordion-menu ul li h2 { color: #629EA6 !important; }
.modal-close {
  color: #666;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}
.modal-close:hover { color: #000; }

/* ===== MODAL BODY TEXT ===== */
.modal-content h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  color: #004c73;
  margin-bottom: 18px;
}
.modal-content p {
  color: #333;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ===== ACCORDION (single-open managed by JS) ===== */
.accordion-menu {
  margin-top: 16px;
  border-top: 1px solid #e5e5e5;
}
.accordion-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.accordion-menu ul li {
  border-bottom: 1px solid #e5e5e5;
}
.accordion-menu ul li h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #004c70;
  margin: 0;
  padding: 14px 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.accordion-menu ul li h2::after {
  content: "▾";
  font-size: 1.2rem;
  color: #004c70;
  transition: transform 0.2s ease;
}
.accordion-menu ul li.open h2::after {
  transform: rotate(180deg);
}
.accordion-menu ul li p {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.25s ease;
  color: #333;
  line-height: 1.5;
  padding: 0 0 10px;
}
.accordion-menu ul li.open p {
  max-height: 600px;
  opacity: 1;
  padding-top: 6px;
}

/* ===== LIGHTBOX ===== */
#lightbox-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85); /* darker background for clarity */
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
}

#lightbox-modal .lightbox-content {
  position: relative;
  margin: auto;
  top: auto;
  transform: none;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#lightbox-modal .lightbox-content img {
  width: 100%;
  height: 90vh !important;
  max-height: 85vh;
  object-fit: contain;
  object-position: center;
}

#lightbox-modal .lightbox-close {
  position: absolute;
  top: 15px;
  right: 20px;
  color: #fff;
  font-size: 2.5rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 1000;
  text-shadow: 0px 4px 3px rgba(0, 0, 0, 0.6);
}

#lightbox-dots {
  position: absolute;
  bottom: 15px;
  width: 100%;
  text-align: center;
  z-index: 300;
}

#lightbox-dots .dot {
  height: 10px;
  width: 10px;
  margin: 0 5px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  display: inline-block;
  transition: all 0.3s;
}

#lightbox-dots .dot.active {
  background: rgba(255,255,255,1);
}

.slider-arrow {
  z-index: 1; /* ensure arrows always clickable */
}


/* ===== ANIMATION ===== */
@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ===== CONSISTENT BUTTON ALIGNMENT ===== */
.card-content .details-btn {
  margin-top: auto;
  align-self: stretch;
  width: 100%;
  background: transparent;
  color: #11313F;
  border: 1px solid #11313F;
  padding: 10px 0 !important;
  font-size: 1rem;
}

/* =========================================================
   RESPONSIVE IMAGE HEIGHTS PER DEVICE
   ========================================================= */

/* Tablet: unify slider image height to 35vh */
@media (max-width: 1024px) {
  .slide img {
    height: 35vh !important;
  }
}

/* Mobile: unify slider image height to 30vh */
@media (max-width: 640px) {
  .slide img {
    height: 30vh !important;
  }
  .card-content {
    padding: 15px;
  }
  .card-content h2.lot {
    font-size: 2.4rem;
    font-weight: 100;
    color: #11313F;
    margin-bottom: 6px;
  }
  span.price {
    font-size: 1.4em !important;
    font-weight: bold;
    margin: 10px 0;
    color: #629EA6 !important;
  }
  .card-content .details-btn {
    margin-top: auto;
    align-self: stretch;
    width: 100%;
    background: transparent;
    color: #11313F;
    border: 1px solid #11313F;
    padding: 10px 0 !important;
    font-size: 1rem;
  }
}

/* =========================================================
   PHASE A FIXES — MODAL INTERACTION + BODY LOCK
   ========================================================= */

/* Lock background scroll when any modal is active */
body.hhimr-modal-open {
  overflow: hidden !important;
  height: 100vh;
}

/* Ensure modal close button always clickable above content */
#lightbox-modal .lightbox-close,
#modal .modal-close {
  z-index: 3000 !important;
  position: absolute;
  top: 15px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  border: none;
}

#lightbox-modal .lightbox-close:hover,
#modal .modal-close:hover {
  background: rgba(0,0,0,0.8);
}
.card-content a[href^="tel:"] {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}
.card-content a[href^="tel:"]:hover {
  text-decoration: underline;
  color: #629EA6;
}