/* ================================================================
   WoningSync – Woningen Archief / Aanbodpagina
   Zelfde designsysteem als single-woning.css
   ================================================================ */

:root {
  --ws-primary:        #1856a4;
  --ws-primary-dark:   #0e417f;
  --ws-primary-light:  #e8f0fc;
  --ws-bg:             #f5f3ee;
  --ws-surface:        #ffffff;
  --ws-surface-soft:   #faf9f6;
  --ws-text:           #1a1c2e;
  --ws-text-soft:      #5a6272;
  --ws-text-muted:     #919aaa;
  --ws-border:         rgba(0, 0, 0, 0.08);
  --ws-divider:        #e8e5de;
  --ws-radius-xl:      5px;
  --ws-radius-lg:      3px;
  --ws-radius-md:      1px;
  --ws-radius-pill:    999px;
  --ws-shadow-card:    0 0 0 1px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.05);
  --ws-shadow-hover:   0 0 0 1px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.10);
  --ws-gap:            clamp(16px, 2.2vw, 24px);
  --ws-page-x:         clamp(16px, 4vw, 52px);
  --ws-max:            1440px;
  --ws-ease:           cubic-bezier(.2, .6, 0, 1);
}

/* ----------------------------------------------------------------
   Heading overrides — zelfde als single pagina
   ---------------------------------------------------------------- */
.ws-archive-page h1,
.ws-archive-page h2,
.ws-archive-page h3,
.ws-archive-page h4,
.ws-archive-page h5,
.ws-archive-page h6 {
  margin-top: 0;
  font-family: inherit;
  text-wrap: balance;
}

.ws-archive-page h1 {
  font-size: clamp(1.375rem, 2vw, 1.5rem) !important;   /* 22–24px */
  line-height: 1.2 !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  margin-bottom: 0.9rem !important;
}

.ws-archive-page h2 {
  font-size: clamp(1.25rem, 1.7vw, 1.375rem) !important; /* 20–22px */
  line-height: 1.25 !important;
  font-weight: 700 !important;
  letter-spacing: -0.015em !important;
  margin-bottom: 0.8rem !important;
  margin-top: 1.75rem !important;
}

.ws-archive-page h3 {
  font-size: clamp(1.125rem, 1.5vw, 1.25rem) !important; /* 18–20px */
  line-height: 1.3 !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  margin-bottom: 0.7rem !important;
  margin-top: 1.5rem !important;
}

.ws-archive-page h4 {
  font-size: clamp(1rem, 1.3vw, 1.125rem) !important;    /* 16–18px */
  line-height: 1.35 !important;
  font-weight: 600 !important;
  letter-spacing: -0.005em !important;
  margin-bottom: 0.65rem !important;
  margin-top: 1.25rem !important;
}

.ws-archive-page h5 {
  font-size: clamp(0.9375rem, 1.1vw, 1rem) !important;   /* 15–16px */
  line-height: 1.4 !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  margin-bottom: 0.55rem !important;
  margin-top: 1rem !important;
}

.ws-archive-page h6 {
  font-size: 0.9375rem !important;                       /* 15px */
  line-height: 1.4 !important;
  font-weight: 500 !important;
  letter-spacing: 0.01em !important;
  margin-bottom: 0.5rem !important;
  margin-top: 0.9rem !important;
}
/* ----------------------------------------------------------------
   Pagina shell
   ---------------------------------------------------------------- */
.ws-archive-page {
  max-width: var(--ws-max);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 36px) var(--ws-page-x) clamp(48px, 7vw, 96px);
  color: var(--ws-text);
  font-size: clamp(0.875rem, 0.85rem + 0.13vw, 1rem);
  line-height: 1.7;
}

/* ----------------------------------------------------------------
   Header: titel + telling
   ---------------------------------------------------------------- */
.ws-archive-header {
  margin-bottom: clamp(20px, 3vw, 32px);
}

.ws-archive-title {
  margin: 0 0 6px;
  color: var(--ws-text);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.ws-archive-count {
  font-size: clamp(0.82rem, 0.8rem + 0.1vw, 0.91rem);
  color: var(--ws-text-muted);
  margin: 0;
}

/* ----------------------------------------------------------------
   Filterbar
   ---------------------------------------------------------------- */
.ws-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(10px, 1.2vw, 14px);
  align-items: flex-end;
  padding: clamp(14px, 1.8vw, 20px) clamp(16px, 2vw, 24px);
  background: var(--ws-surface);
  border: 1px solid var(--ws-divider);
  border-radius: var(--ws-radius-xl);
  box-shadow: var(--ws-shadow-card);
  margin-bottom: clamp(18px, 2.5vw, 28px);
}

.ws-filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 160px;
  min-width: 0;
}

.ws-filter-label {
  font-size: clamp(0.62rem, 0.6rem + 0.1vw, 0.70rem);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ws-text-muted);
}

.ws-filter-select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  border: 1px solid var(--ws-divider);
  border-radius: var(--ws-radius-md);
  padding: 9px 34px 9px 12px;
  font: inherit;
  font-size: clamp(0.82rem, 0.8rem + 0.1vw, 0.9rem);
  color: var(--ws-text);
  background: var(--ws-surface-soft)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23919aaa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
  no-repeat right 12px center;
  cursor: pointer;
  transition: border-color .15s;
}

.ws-filter-select:focus {
  outline: none;
  border-color: var(--ws-primary);
  box-shadow: 0 0 0 3px rgba(24, 86, 164, 0.10);
}

/* Transactie type toggle-knoppen */
.ws-filter-toggle {
  display: flex;
  border: 1px solid var(--ws-divider);
  border-radius: var(--ws-radius-md);
  overflow: hidden;
  background: var(--ws-surface-soft);
}

.ws-filter-toggle input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}

.ws-filter-toggle label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  font-size: clamp(0.82rem, 0.8rem + 0.1vw, 0.9rem);
  font-weight: 600;
  color: var(--ws-text-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
  border-right: 1px solid var(--ws-divider);
  user-select: none;
}

.ws-filter-toggle label:last-of-type { border-right: none; }

.ws-filter-toggle input[type="radio"]:checked + label {
  background: var(--ws-primary);
  color: #fff;
}

.ws-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 clamp(14px, 1.8vw, 20px);
  border-radius: var(--ws-radius-md);
  font-weight: 700;
  font-size: clamp(0.81rem, 0.79rem + 0.12vw, 0.9rem);
  border: none;
  background: var(--ws-primary);
  color: #fff;
  cursor: pointer;
  align-self: flex-end;
  transition: background .15s, box-shadow .15s;
  white-space: nowrap;
}

.ws-filter-btn:hover {
  background: var(--ws-primary-dark);
  box-shadow: 0 4px 14px rgba(24, 86, 164, 0.28);
}

.ws-filter-reset {
  display: inline-flex;
  align-items: center;
  font-size: clamp(0.78rem, 0.76rem + 0.1vw, 0.86rem);
  color: var(--ws-text-muted);
  text-decoration: none;
  align-self: flex-end;
  padding: 9px 0;
  transition: color .15s;
  white-space: nowrap;
}

.ws-filter-reset:hover { color: var(--ws-primary); }

/* ----------------------------------------------------------------
   Woningenkaartjes grid
   ---------------------------------------------------------------- */
.ws-listings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ws-gap);
}

/* Woning card */
.ws-listing-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--ws-surface);
  border: 1px solid var(--ws-divider);
  border-radius: var(--ws-radius-xl);
  overflow: hidden;
  box-shadow: var(--ws-shadow-card);
  transition: border-color .2s var(--ws-ease), box-shadow .2s var(--ws-ease), transform .2s var(--ws-ease);
}

.ws-listing-card:hover,
.ws-listing-card:focus {
  border-color: rgba(24, 86, 164, 0.22);
  box-shadow: var(--ws-shadow-hover);
  transform: translateY(-3px);
  outline: none;
}

/* Foto — vaste verhouding 4:3 */
.ws-listing-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #ede9e1;
  flex-shrink: 0;
}

.ws-listing-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s var(--ws-ease);
}

.ws-listing-card:hover .ws-listing-photo img {
  transform: scale(1.03);
}

/* Geen foto placeholder */
.ws-listing-photo--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ws-text-muted);
  font-size: 2rem;
}

/* Badges op foto */
.ws-listing-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  z-index: 1;
}

.ws-listing-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--ws-radius-pill);
  font-size: clamp(0.62rem, 0.6rem + 0.12vw, 0.70rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  backdrop-filter: blur(10px) saturate(1.3);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

.ws-listing-badge--status {
  color: #fff;
  background: rgba(24, 86, 164, 0.88);
}

.ws-listing-badge--label {
  color: var(--ws-text);
  background: rgba(255, 255, 255, 0.88);
}

/* Kaartinhoud */
.ws-listing-body {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.2vw, 14px);
  padding: clamp(14px, 1.8vw, 20px);
  flex: 1;
}

.ws-listing-price {
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ws-text);
  line-height: 1;
}

.ws-listing-price-type {
  font-size: clamp(0.72rem, 0.7rem + 0.1vw, 0.80rem);
  color: var(--ws-text-muted);
  font-weight: 500;
  margin-left: 4px;
}

.ws-listing-title {
  font-size: clamp(0.9rem, 0.87rem + 0.18vw, 1.05rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ws-text);
  margin: 0;
}

.ws-listing-address {
  font-size: clamp(0.78rem, 0.76rem + 0.1vw, 0.86rem);
  color: var(--ws-text-muted);
  line-height: 1.4;
  margin: 0;
}

/* Quick stats strip (m², kamers, energielabel) */
.ws-listing-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--ws-divider);
  border-radius: var(--ws-radius-md);
  overflow: hidden;
  margin-top: auto; /* duwt stats naar de onderkant van de card */
}

.ws-listing-stat {
  flex: 1 1 0;
  min-width: 0;
  padding: clamp(7px, 0.9vw, 10px) clamp(8px, 1vw, 12px);
  border-right: 1px solid var(--ws-divider);
  background: var(--ws-surface-soft);
}

.ws-listing-stat:last-child { border-right: none; }

.ws-listing-stat-label {
  display: block;
  font-size: clamp(0.58rem, 0.56rem + 0.1vw, 0.64rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ws-text-muted);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-listing-stat-value {
  display: block;
  font-size: clamp(0.82rem, 0.8rem + 0.12vw, 0.92rem);
  font-weight: 700;
  color: var(--ws-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ----------------------------------------------------------------
   Geen resultaten
   ---------------------------------------------------------------- */
.ws-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: clamp(40px, 6vw, 80px) var(--ws-page-x);
  color: var(--ws-text-muted);
}

.ws-no-results p {
  font-size: clamp(0.9rem, 0.87rem + 0.18vw, 1.05rem);
  margin: 0 0 16px;
}

/* ----------------------------------------------------------------
   Paginering
   ---------------------------------------------------------------- */
.ws-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: clamp(28px, 4vw, 48px);
}

.ws-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(36px, 4vw, 44px);
  height: clamp(36px, 4vw, 44px);
  padding: 0 clamp(10px, 1.2vw, 14px);
  border-radius: var(--ws-radius-md);
  font-size: clamp(0.82rem, 0.8rem + 0.1vw, 0.91rem);
  font-weight: 600;
  text-decoration: none;
  color: var(--ws-text-soft);
  background: var(--ws-surface);
  border: 1px solid var(--ws-divider);
  transition: border-color .15s, background .15s, color .15s;
}

.ws-pagination .page-numbers:hover {
  border-color: var(--ws-primary);
  color: var(--ws-primary);
}

.ws-pagination .page-numbers.current {
  background: var(--ws-primary);
  color: #fff;
  border-color: var(--ws-primary);
}

.ws-pagination .page-numbers.dots {
  border-color: transparent;
  background: transparent;
  color: var(--ws-text-muted);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1100px) {
  .ws-listings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .ws-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .ws-filter-group { flex: 1 1 100%; }

  .ws-filter-btn,
  .ws-filter-reset { width: 100%; justify-content: center; }
}

@media (max-width: 560px) {
  .ws-listings-grid {
    grid-template-columns: 1fr;
  }
}
