/*
 * Realworks Wonen – Frontend stijlen
 *
 * Methodologie: BEM (Block__Element--Modifier)
 * Theming:      CSS custom properties – overschrijfbaar vanuit het thema
 * Breakpoints:  Mobile-first, --bp-md: 768px, --bp-lg: 1024px
 *
 * Theming vanuit je thema (voeg toe aan style.css of theme.json):
 *   :root {
 *     --rw-accent:       #0a5c8c;
 *     --rw-accent-dark:  #07405f;
 *     --rw-radius:       8px;
 *     --rw-font:         inherit;
 *   }
 */

/* ── Custom properties ─────────────────────────────────────────────────────── */
:root {
   --rw-accent: #809eb5;  /*#1a6fa8;*/
    --rw-accent-dark:    #104e78;
    --rw-accent-light:   #e8f3fa;
    --rw-text:           #1a1a1a;
    --rw-text-muted:     #666;
    --rw-border:         #e0e0e0;
    --rw-bg:             #f7f7f7;
    --rw-white:          #ffffff;
    --rw-radius:         8px;
    --rw-radius-lg:      12px;
    --rw-shadow:         0 2px 8px rgba(0,0,0,.08);
    --rw-shadow-hover:   0 4px 20px rgba(0,0,0,.14);
    --rw-font:           inherit;
    --rw-card-gap:       20px;
    --rw-transition:     .2s ease;

  
    --rw-status-beschikbaar: #809eb5;
    --rw-status-onder-bod: #809eb5;
    --rw-status-verkocht: #df0b0b;
    --rw-status-verhuurd: #df0b0b;
    --rw-status-gerealiseerd: #6b7280;
}




/* ═══════════════════════════════════════════════════════════════════════════
   ARCHIEF BLOK
═══════════════════════════════════════════════════════════════════════════ */

.rw-archive {
    font-family: var(--rw-font);
    color: var(--rw-text);
    position: relative;
}

/* ── Filterbalk ─────────────────────────────────────────────────────────────── */

.rw-archive__filters {
    background: var(--rw-white);
    border: 1px solid var(--rw-border);
    border-radius: var(--rw-radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: var(--rw-shadow);
}

.rw-archive__filters-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.rw-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 140px;
}

.rw-filter-group--sort {
    min-width: 180px;
}

.rw-filter-group__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--rw-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.rw-filter-select {
    padding: 8px 12px;
    border: 1px solid var(--rw-border);
    border-radius: var(--rw-radius);
    font-size: 14px;
    color: var(--rw-text);
    background: var(--rw-white);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    transition: border-color var(--rw-transition);
    width: 100%;
}

.rw-filter-select:focus {
    outline: none;
    border-color: var(--rw-accent);
    box-shadow: 0 0 0 3px rgba(26,111,168,.15);
}

.rw-archive__filters-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--rw-border);
}

.rw-archive__count {
    font-size: 14px;
    color: var(--rw-text-muted);
}

.rw-archive__count #rw-result-count {
    font-weight: 700;
    color: var(--rw-accent);
}

.rw-filter-reset {
    background: none;
    border: none;
    color: var(--rw-accent);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background var(--rw-transition);
}

.rw-filter-reset:hover {
    background: var(--rw-accent-light);
}

/* ── Laad-indicator ──────────────────────────────────────────────────────────── */

.rw-archive__loading {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.7);
    z-index: 10;
    align-items: center;
    justify-content: center;
    border-radius: var(--rw-radius);
}

.rw-archive__loading.is-visible {
    display: flex;
}

.rw-archive__loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--rw-border);
    border-top-color: var(--rw-accent);
    border-radius: 50%;
    animation: rw-spin .7s linear infinite;
}

@keyframes rw-spin {
    to { transform: rotate(360deg); }
}

/* ── Objectenraster ──────────────────────────────────────────────────────────── */

.rw-archive__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--rw-card-gap);
}

.rw-archive__empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--rw-text-muted);
    font-size: 16px;
    background: var(--rw-bg);
    border-radius: var(--rw-radius);
}

/* ── Objectkaart ─────────────────────────────────────────────────────────────── */

.rw-card {
    background: var(--rw-white);
    border: 1px solid var(--rw-border);
    border-radius: var(--rw-radius-lg);
    overflow: hidden;
    box-shadow: var(--rw-shadow);
    transition: box-shadow var(--rw-transition), transform var(--rw-transition);
}

.rw-card:hover {
    box-shadow: var(--rw-shadow-hover);
    /* transform: translateY(-2px); */
}

.rw-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Foto */
.rw-card__image-wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--rw-bg);
}

.rw-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.rw-card:hover .rw-card__image {
    
      
        transform: scale(1.025);
}

.rw-card__image--placeholder {
    background: linear-gradient(135deg, #e8ecef 0%, #d1d9e0 100%);
}

/* Status badge */
.rw-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #fff;
    background: var(--rw-accent);

    &.rw-card__badge--verkocht-onder-voorbehoud,
    .rw-card__badge--verkocht{
        background: red;
    }
}



.rw-card__badge--rentsale {
    left: auto;
    right: 10px;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(4px);
    display:none;
}

.rw-card__badge--onder-bod,
.rw-card__badge--onder-optie    { background: var(--rw-status-onder-bod); }
.rw-card__badge--verkocht       { background: var(--rw-status-verkocht); }
.rw-card__badge--verhuurd       { background: var(--rw-status-verhuurd); }
.rw-card__badge--gerealiseerd   { background: var(--rw-status-gerealiseerd); }

/* Body */
.rw-card__body {
    padding: 16px;
}

.rw-card__address {
    margin-bottom: 10px;
}

.rw-card__title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--rw-text);
    line-height: 1.3;
    margin-bottom: 3px;
}

.rw-card__location {
    font-size: 13px;
    color: var(--rw-text-muted);
}

.rw-card__price {
    font-size: 18px;
    font-weight: 700;
    color: var(--rw-accent);
    margin-bottom: 12px;
}

/* Specs */
.rw-card__specs {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    list-style: none;
    margin: 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--rw-border);
    flex-wrap: wrap;
}

.rw-card__spec {
    font-size: 13px;
    color: var(--rw-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.rw-card__spec-icon {
    font-size: 14px;
}

/* ── Paginering ──────────────────────────────────────────────────────────────── */

.rw-archive__pagination {
    margin-top: 32px;
}

.rw-pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    align-items: center;
}

.rw-pagination__btn {
    padding: 8px 14px;
    border: 1px solid var(--rw-border);
    border-radius: var(--rw-radius);
    background: var(--rw-white);
    color: var(--rw-text);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--rw-transition);
    min-width: 38px;
}

.rw-pagination__btn:hover {
    border-color: var(--rw-accent);
    color: var(--rw-accent);
}

.rw-pagination__btn--active {
    background: var(--rw-accent);
    border-color: var(--rw-accent);
    color: #fff;
    font-weight: 600;
}

.rw-pagination__ellipsis {
    padding: 8px 4px;
    color: var(--rw-text-muted);
}


/* ═══════════════════════════════════════════════════════════════════════════
   SINGLE BLOK
═══════════════════════════════════════════════════════════════════════════ */

.rw-single {
    font-family: var(--rw-font);
    color: var(--rw-text);
    max-width: 960px;
    margin: 0 auto;
}

/* ── Galerij ─────────────────────────────────────────────────────────────────── */

.rw-single__gallery {
    margin-bottom: 32px;
    border-radius: var(--rw-radius-lg);
    overflow: hidden;
}

.rw-single__gallery-main {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--rw-bg);
    overflow: hidden;
    cursor: pointer;
}

.rw-single__gallery-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.rw-single__gallery-main:hover .rw-single__gallery-main-img {
    transform: scale(1.02);
}

.rw-single__status-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 14px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #fff;
    background: var(--rw-accent);
}

.rw-gallery__open-all {
    position: absolute;
    bottom: 16px;
    right: 16px;
    padding: 8px 16px;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(6px);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--rw-transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.rw-gallery__open-all:hover {
    background: rgba(0,0,0,.8);
}

/* Thumbnail rij */
.rw-single__gallery-thumbs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 0 4px;
    scrollbar-width: thin;
}

.rw-single__gallery-thumb {
    flex: 0 0 80px;
    height: 56px;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    background: var(--rw-bg);
    transition: border-color var(--rw-transition);
}

.rw-single__gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rw-single__gallery-thumb--active,
.rw-single__gallery-thumb:hover {
    border-color: var(--rw-accent);
}

/* ── Lightbox ─────────────────────────────────────────────────────────────────── */

.rw-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.93);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rw-lightbox[hidden] {
    display: none;
}

.rw-lightbox__inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rw-lightbox__img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
}

.rw-lightbox__counter {
    color: rgba(255,255,255,.7);
    font-size: 13px;
    margin-top: 10px;
}

.rw-lightbox__close,
.rw-lightbox__prev,
.rw-lightbox__next {
    position: fixed;
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--rw-transition);
    backdrop-filter: blur(4px);
}

.rw-lightbox__close:hover,
.rw-lightbox__prev:hover,
.rw-lightbox__next:hover {
    background: rgba(255,255,255,.25);
}

.rw-lightbox__close { top: 20px; right: 20px; font-size: 26px; }
.rw-lightbox__prev  { left: 20px;  top: 50%; transform: translateY(-50%); }
.rw-lightbox__next  { right: 20px; top: 50%; transform: translateY(-50%); }

/* ── Header: adres + prijs ───────────────────────────────────────────────────── */

.rw-single__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.rw-single__title {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.2;
}

.rw-single__cityline {
    font-size: 16px;
    color: var(--rw-text-muted);
    margin: 0;
}

.rw-single__price {
    font-size: clamp(20px, 2.5vw, 26px);
    font-weight: 700;
    color: var(--rw-accent);
    white-space: nowrap;
}

.rw-single__price--sold {
    color: var(--rw-status-verkocht);
}

.rw-single__energy {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: #0e7239;
}

/* Energieklasse kleuren (A+++ t/m G) */
.rw-single__energy--aplusplus,
.rw-single__energy--aplusplusplus { background: #046a38; }
.rw-single__energy--aplus         { background: #0e7239; }
.rw-single__energy--a             { background: #107c3d; }
.rw-single__energy--b             { background: var(--wp--preset--color--accent-2); }
.rw-single__energy--c             { background: #eab308; color: #000; }
.rw-single__energy--d             { background: #f97316; }
.rw-single__energy--e,
.rw-single__energy--f,
.rw-single__energy--g             { background: #ef4444; }

/* ── Kernspecificaties (icoonbalk) ───────────────────────────────────────────── */

.rw-single__key-specs {
    display: flex;
    gap: 0;
    background: var(--rw-white);
    border: 1px solid var(--rw-border);
    border-radius: var(--rw-radius);
    overflow: hidden;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.rw-single__key-spec {
    flex: 1;
    min-width: 100px;
    padding: 16px 12px;
    text-align: center;
    border-right: 1px solid var(--rw-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.rw-single__key-spec:last-child {
    border-right: none;
}

.rw-single__key-spec-icon {
    font-size: 22px;
    line-height: 1;
}

.rw-single__key-spec-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--rw-text);
}

.rw-single__key-spec-label {
    font-size: 11px;
    color: var(--rw-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ── Secties ─────────────────────────────────────────────────────────────────── */

.rw-single__section {
    margin-bottom: 40px;
}

.rw-single__section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--rw-accent-light);
    color: var(--rw-text);
}

/* Omschrijving */
.rw-single__description {
    font-size: 16px;
    line-height: 1.75;
    color: var(--rw-text);
}

/* ── Specificatietabel ───────────────────────────────────────────────────────── */

.rw-single__specs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.rw-single__spec-group-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--rw-accent);
    margin: 0 0 10px;
}

.rw-single__spec-list {
    margin: 0;
    padding: 0;
}

.rw-single__spec-row {
    display: flex;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--rw-border);
    font-size: 14px;
}

.rw-single__spec-row:last-child {
    border-bottom: none;
}

.rw-single__spec-term {
    flex: 0 0 140px;
    color: var(--rw-text-muted);
    font-weight: normal;
}

.rw-single__spec-def {
    flex: 1;
    font-weight: 600;
    color: var(--rw-text);
    margin: 0;
}

/* ── Plattegronden ───────────────────────────────────────────────────────────── */

.rw-single__plans {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.rw-single__plan {
    margin: 0;
    background: var(--rw-bg);
    border: 1px solid var(--rw-border);
    border-radius: var(--rw-radius);
    overflow: hidden;
}

.rw-single__plan-link {
    display: block;
    position: relative;
    overflow: hidden;
}

.rw-single__plan-img {
    width: 100%;
    display: block;
    transition: transform .3s ease;
}

.rw-single__plan-link:hover .rw-single__plan-img {
    transform: scale(1.03);
}

.rw-single__plan-zoom {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,.5);
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

.rw-single__plan-caption {
    padding: 10px 12px;
    font-size: 13px;
    color: var(--rw-text-muted);
}

/* ── Editor placeholder ─────────────────────────────────────────────────────── */

.rw-single__editor-note {
    background: #f0f6fc;
    border: 2px dashed #1a6fa8;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    color: #1a6fa8;
    font-size: 15px;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .rw-archive__filters-row {
        flex-direction: column;
    }

    .rw-filter-group {
        min-width: 100%;
    }

    .rw-archive__grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .rw-single__header {
        flex-direction: column;
        gap: 8px;
    }

    .rw-single__key-specs {
        flex-wrap: wrap;
    }

    .rw-single__key-spec {
        flex: 0 0 calc(50% - 1px);
    }

    .rw-single__specs {
        grid-template-columns: 1fr;
    }

    .rw-lightbox__prev { left: 8px; }
    .rw-lightbox__next { right: 8px; }
}

@media (max-width: 480px) {
    .rw-archive__grid {
        grid-template-columns: 1fr;
    }

    .rw-single__gallery-thumb {
        flex: 0 0 64px;
        height: 46px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ALIGNMENT (wide / full breedte)
   WordPress voegt .alignwide en .alignfull toe aan de wrapper.
   Het thema is verantwoordelijk voor de daadwerkelijke uitbreiding buiten
   de contentkolom – deze regels zorgen dat de blokken 100% breedte pakken.
═══════════════════════════════════════════════════════════════════════════ */

.rw-archive.alignwide,
.rw-single.alignwide {
    width: 100%;
    max-width: 100%;
}

.rw-archive.alignfull,
.rw-single.alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: clamp(16px, 4vw, 48px);
    padding-right: clamp(16px, 4vw, 48px);
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GALERIJ MODAL (dialog element)
═══════════════════════════════════════════════════════════════════════════ */

.rw-gallery-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, .92);
    border: none;
    z-index: 99998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Browsers tonen ::backdrop automatisch voor <dialog> */
.rw-gallery-modal::backdrop {
    background: rgba(0,0,0,.85);
}

.rw-gallery-modal[open] {
    display: flex;
}

.rw-gallery-modal:not([open]) {
    display: none;
}

.rw-gallery-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    color: #fff;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.rw-gallery-modal__title {
    font-size: 15px;
    font-weight: 600;
}

.rw-gallery-modal__close {
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    line-height: 1;
}

.rw-gallery-modal__close:hover {
    background: rgba(255,255,255,.25);
}

.rw-gallery-modal__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.rw-gallery-modal__item {
    margin: 0;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 4px;
    background: #222;
}

.rw-gallery-modal__link {
    display: block;
    width: 100%;
    height: 100%;
}

.rw-gallery-modal__link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.rw-gallery-modal__item:hover .rw-gallery-modal__link img {
    transform: scale(1.04);
}

/* ═══════════════════════════════════════════════════════════════════════════
   OPENSTREETMAP KAART
═══════════════════════════════════════════════════════════════════════════ */

.rw-single__map-frame {
    width: 100%;
    height: 360px;
    border: none;
    border-radius: var(--rw-radius);
    display: block;
    background: var(--rw-bg);
}

.rw-single__map-caption {
    font-size: 12px;
    color: var(--rw-text-muted);
    margin-top: 8px;
}

.rw-single__map-caption a {
    color: var(--rw-accent);
    text-decoration: none;
}

.rw-single__map-caption a:hover {
    text-decoration: underline;
}

.rw-single__map-unavailable {
    font-size: 14px;
    color: var(--rw-text-muted);
    padding: 24px;
    background: var(--rw-bg);
    border-radius: var(--rw-radius);
    text-align: center;
}

@media (max-width: 768px) {
    .rw-single__map-frame {
        height: 260px;
    }

    .rw-gallery-modal__grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 6px;
        padding: 10px;
    }
}
