:root {
  --dr-gap: 1.5rem;
  --dr-radius: 10px;
  --dr-card-bg: #fff;
  --dr-card-border: #e8e8ef;
  --dr-text: #1f2937;
  --dr-muted: #6b7280;
  --dr-accent: #2563eb;
  --dr-accent-2: #1d4ed8;
  --dr-badge: #f3f4f6;
  --dr-shadow: 0 8px 24px rgba(0,0,0,0.07);
  /* Button-specific variables */
  --dr-button-bg: #2563eb;
  --dr-button-bg-hover: #1d4ed8;
  --dr-button-text: #fff;
  --dr-button-radius: 8px; /* matches card rounding */
}

/* Wrapper: center and constrain */
.dr-wrap {
  width: 100%;
  max-width: 1400px; /* site-wide max */
  margin: 0 auto;
  padding: 1rem;
  box-sizing: border-box;
}

/* Grid base */
.dr-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  justify-content: center;
  max-width: 1200px; /* keeps grid from stretching too wide */
  margin-left: auto;
  margin-right: auto;
}

/* Prevent single cards from stretching too wide */
.dr-card {
  /* remove max-width */
  margin: 0;              /* remove auto-centering */
  width: 100%;            /* make card fill its grid column */
  max-width: none;        /* ensure no cap */
}


.dr-wrap[data-dr-columns="1"] .dr-grid {
  grid-template-columns: 1fr;
  max-width: 600px;   /* optional – keep single card centered */
  margin: 0 auto;
}

.dr-wrap[data-dr-columns="2"] .dr-grid {
  grid-template-columns: repeat(2, 1fr);
  max-width: 100%;    /* let it span full width */
  margin: 0 auto;
}

.dr-wrap[data-dr-columns="3"] .dr-grid {
  grid-template-columns: repeat(3, 1fr);
  max-width: 100%;    /* full container width */
  margin: 0 auto;
}

.dr-wrap[data-dr-columns="4"] .dr-grid {
  grid-template-columns: repeat(4, 1fr);
  max-width: 100%;    /* full container width */
  margin: 0 auto;
}


/* Toolbar */
.dr-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.dr-search {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--dr-card-border);
  border-radius: 8px;
  font-size: 16px;
}
.dr-count { color: var(--dr-muted); font-size: 14px; }

/* Card */
.dr-card {
  background: var(--dr-card-bg);
  border: 1px solid var(--dr-card-border);
  border-radius: var(--dr-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--dr-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dr-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.dr-card__image {
  aspect-ratio: 16 / 10;
  background: #f8fafc;
  overflow: hidden;
}
.dr-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dr-card__body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dr-card .dr-card__title, .dr-card .dr-card__title h3{
  font-size: 24px;
  line-height: 30px;
  font-weight: 600;
  margin: 0;
}

.dr-card__title a {
  text-decoration: none;
  color: #123678 !important;
}
.dr-card__price {
  font-size: 1rem;
  font-weight: bold;
  color: #2c7a2c;
}
.dr-card__meta {
  color: var(--dr-muted);
  font-size: 0.9rem;
}

/* Card button – make it full width so it aligns consistently */
.dr-button {
  margin-top: auto;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.6rem 1.2rem;
  background: var(--dr-button-bg);
  color: var(--dr-button-text);
  border-radius: var(--dr-button-radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  align-self: center;
  transition: background 0.2s ease, transform 0.15s ease;
}

.dr-button:hover {
  background: var(--dr-button-bg-hover);
}

.dr-card .dr-card__listing-highlights {
  font-size: 17px;
  margin-top: 0px;
  margin-bottom: 5px;
  color: #333;
  line-height: 1.4;
}

/* Pagination buttons – align horizontally and center */
.dr-pagination {
  margin-top: 24px;
  display: flex;
  justify-content: center; /* center horizontally */
  gap: 10px;
  flex-wrap: wrap;
}
.dr-pagination a {
  display: flex;          /* makes button text centered vertically */
  align-items: center;
  justify-content: center;
  min-width: 38px;        /* consistent size */
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--dr-card-border);
  border-radius: 6px;
  color: #374151;
  background: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}
.dr-pagination a:hover {
  background: var(--dr-badge);
}
.dr-pagination a.is-active {
  background: var(--dr-accent);
  color: #fff;
  border-color: var(--dr-accent);
}

/* Make all grid items (cards) the same height per row */
.dr-grid{
  align-items: stretch;              /* ensure grid items fill row height */
}

/* Card fills the grid cell height */
.dr-card{
  display: flex;
  flex-direction: column;
  height: 100%;                      /* <-- key for equal bottoms */
}

/* Body grows to take remaining space */
.dr-card__body{
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex: 1 1 auto;                    /* fill vertical space inside the card */
}

/* Keep image fixed ratio above */
.dr-card__image{
  aspect-ratio: 16 / 10;
  background:#f8fafc;
  overflow:hidden;
}
.dr-card__image img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* Button sits at the bottom and looks consistent */
.dr-button {
  margin-top: auto;
  display: block;                  /* full width */
  width: 100%;                     /* fill card */
  text-align: center;
  padding: 0.75rem 1rem;
  background: var(--dr-button-bg);
  color: var(--dr-button-text);
  border-radius: var(--dr-button-radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  transition: background 0.2s ease;
}

.dr-button:hover {
  background: var(--dr-button-bg-hover);
  transform: translateY(-2px);       /* subtle lift on hover */
}




/* (optional) prettier, centered pagination buttons */
.dr-pagination{
  margin-top: 24px;
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}
.dr-pagination a{
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:38px;
  height:38px;
  padding:0 12px;
  border:1px solid var(--dr-card-border);
  border-radius:6px;
  background:#fff;
  color:#374151;
  text-decoration:none;
  font-weight:500;
  transition:all .2s ease;
}
.dr-pagination a:hover{ background:var(--dr-badge); }
.dr-pagination a.is-active{
  background:var(--dr-accent);
  color:#fff;
  border-color:var(--dr-accent);
}

/* ======================
   DETAIL PAGE STYLES
   ====================== */

.dr-detail {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1.5rem;            /* side padding so text doesn't hug edges */
  color: var(--dr-text);
  font-family: system-ui, sans-serif;
  box-sizing: border-box;
}

/* Back link */
.dr-back {
  margin-bottom: 1rem;
}
.dr-back a {
  color: var(--dr-accent);
  text-decoration: none;
  font-size: 0.9rem;
}
.dr-back a:hover { text-decoration: underline; }

/* Title + meta */
.dr-detail__title {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 1rem;
}

.dr-detail__title a {
  text-decoration: none;
}
.dr-detail__meta {
  font-size: 0.95rem;
  color: var(--dr-muted);
  margin-bottom: 1.5rem;
}
.dr-detail__meta span + span { margin-left: 1rem; }

/* Gallery */
.dr-gallery-main {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--dr-radius);
  box-shadow: var(--dr-shadow);
  margin-bottom: 1rem;
}
.dr-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px,1fr));
  gap: 10px;
  margin-bottom: 1.5rem;
}
.dr-gallery-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: calc(var(--dr-radius) - 2px);
}

/* Stats badges */
.dr-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;   /* ✅ center align stats */
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}
.dr-stats li {
  background: var(--dr-badge);
  padding: 0.5rem 1rem;
  border-radius: var(--dr-radius);
  font-weight: 500;
  font-size: 0.95rem;
}
.dr-stats li strong {
  font-weight: 700;
  margin-right: 0.4rem;
  color: var(--dr-text);
}

/* Description */
.dr-description {
  line-height: 1.7;
  margin-top: 1.5rem;
  font-size: 1rem;
}
.dr-description ul {
  margin: 1rem 0 1rem 1.2rem;
  list-style: disc;
}
.dr-description li {
  margin-bottom: 0.4rem;
}

/* Theme-specific fix for TwentyTwentyFive */
body.wp-theme-twentytwentyfive .dr-detail {
  max-width: 960px !important;
  margin: 2rem auto !important;
  padding: 0 1.5rem !important;
}
body.wp-theme-twentytwentyfive .dr-detail > * {
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
}

.dr-button--cta {
  display: inline-block;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--dr-accent);
  color: #fff;
  border-radius: var(--dr-radius);
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  transition: background 0.2s ease, transform 0.15s ease;
}

.dr-button--cta:hover {
  background: var(--dr-accent-2);
  transform: translateY(-2px);
}

/* view status */
.dr-card__toprow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.dr-card__price {
  font-weight: bold;
  color: #059669; /* green */
}

.dr-card__status {
  font-size: 0.8em;
  color: #6b7280; /* gray tone */
}

/* Listing Highlights */

.dr-card__listing-highlights {
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--dr-muted);
}

.dr-card__listing-highlights p {
  margin-top: 5px;
}

/* If the highlights are empty, remove spacing */
.dr-card__listing-highlights:empty {
  display: none;
}


/* --- Responsive Tweaks --- */
@media (max-width: 600px) {
  .dr-card h3 {
    font-size: 1.1rem;
  }
  .dr-card .dr-price {
    font-size: 1.15rem;
  }
}

/* 📱 Responsive layout fixes for mobile */
@media (max-width: 600px) {
  .dr-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
    padding: 0 1rem;
  }

  .dr-card {
    border-radius: 8px;
    font-size: 0.95rem;
  }

  .dr-card .dr-card__title, 
  .dr-card .dr-card__title h3 {
    font-size: 1.25rem;
    line-height: 1.4;
  }

  .dr-card__listing-highlights {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .dr-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .dr-search {
    font-size: 1rem;
    padding: 10px;
    width: 100%;
  }

  .dr-count {
    text-align: right;
    margin-top: 0.5rem;
  }
}

/* Tablet view (iPads and similar) */
@media (min-width: 640px) and (max-width: 1024px) {
  .dr-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    max-width: 100%;
    padding: 0 1rem;
  }
}

/* Desktop view – 3 columns */
@media (min-width: 1025px) and (max-width: 1400px) {
  .dr-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 767px) {
  .dr-grid {
    grid-template-columns: 1fr !important;
    padding: 0 1rem;
    gap: 1rem;
  }
}






