/*
 * Developments: homepage strip, list page and detail page.
 * Layout and motion follow the Balfin Real Estate portfolio pages. The accent colour is the theme's primary colour.
 */
:root {
    --mre-navy: #1e2758;
    --mre-muted: #666666;
    --mre-line: #e8e4da;
    --mre-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Banner (list and detail pages) ---------- */
.mre-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: clamp(420px, 41.7vw, 794px);
    background: #a0a8b1 center / cover no-repeat;
    color: #fff;
    text-align: center;
}
.mre-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(30, 39, 88, 0.42);
}
.mre-hero-inner {
    position: relative;
    max-width: 1100px;
    padding: 0 24px;
}
.mre-hero-title {
    margin: 0;
    color: #fff;
    font-family: Poppins, sans-serif;
    font-size: clamp(32px, 3.6vw, 68px);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.mre-hero--light .mre-hero-title {
    font-size: clamp(34px, 3.62vw, 69px);
    font-weight: 200;
    letter-spacing: normal;
}
.mre-hero--light .mre-hero-down {
    width: 85px;
}
.mre-hero--light .mre-hero-down svg {
    width: 85px;
    height: 28px;
}
.mre-hero-subtitle {
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 17px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.mre-hero-down {
    display: block;
    width: 70px;
    margin: 48px auto 0;
    color: #fff;
    animation: mreBounce 2.4s ease-in-out infinite;
}
.mre-hero-down svg {
    display: block;
    width: 70px;
    height: 20px;
}
@keyframes mreBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ---------- Scroll reveal (only when JS is running) ---------- */
.mre-js .mre-reveal-left,
.mre-js .mre-reveal-right,
.mre-js .mre-reveal-up {
    opacity: 0;
    transition: opacity 0.9s, transform 0.9s;
}
.mre-js .mre-reveal-left { transform: translateX(-40px); }
.mre-js .mre-reveal-right { transform: translateX(40px); }
.mre-js .mre-reveal-up { transform: translateY(40px); }
.mre-js .mre-reveal-left.visible,
.mre-js .mre-reveal-right.visible,
.mre-js .mre-reveal-up.visible {
    opacity: 1;
    transform: none;
}

/* ---------- List page ---------- */
.mre-portfolio,
.mre-portfolio *,
.mre-detail,
.mre-detail * {
    box-sizing: border-box;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.mre-portfolio {
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 48px;
    color: var(--mre-navy);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
.mre-project-section {
    margin-bottom: 140px;
    scroll-margin-top: 40px;
}
.mre-project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}
.mre-project-grid.reverse {
    direction: rtl;
}
.mre-project-grid.reverse > * {
    direction: ltr;
}
.mre-project-image-card {
    position: relative;
    display: block;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    box-shadow: rgba(30, 39, 88, 0.12) 0 24px 64px;
    transition: transform 0.6s var(--mre-ease), box-shadow 0.6s var(--mre-ease), opacity 0.9s;
}
.mre-project-image-card:hover {
    transform: translateY(-8px);
    box-shadow: rgba(30, 39, 88, 0.2) 0 40px 80px;
}
.mre-project-image-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s var(--mre-ease);
}
.mre-project-image-card:hover img {
    transform: scale(1.06);
}
.mre-project-image-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(30, 39, 88, 0.3) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}
.mre-project-image-card:hover::after {
    opacity: 1;
}
.mre-project-content-block {
    padding: 20px 0;
}
.mre-project-number {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
}
.mre-project-number::before {
    content: "";
    display: inline-block;
    width: 32px;
    height: 1px;
    background: var(--primary-color);
}
.mre-project-title {
    margin: 0 0 24px;
    color: var(--mre-navy);
    font-size: clamp(32px, 4vw, 52px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.mre-project-title a {
    color: var(--mre-navy);
    text-decoration: none;
    transition: color 0.3s;
}
.mre-project-title a:hover {
    color: var(--primary-color);
}
.mre-project-location {
    margin: -8px 0 20px;
    color: var(--mre-navy);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.6;
}
.mre-project-short-desc {
    margin: 0 0 24px;
    color: var(--mre-muted);
    font-size: 16px;
    font-style: italic;
    line-height: 1.8;
}
.mre-project-toggle {
    display: inline-flex;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid rgba(191, 172, 109, 0.3);
    border: 1px solid color-mix(in srgb, var(--primary-color) 30%, transparent);
    border-radius: 999px;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.4s;
}
.mre-project-toggle:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
.mre-project-toggle-icon {
    display: inline-block;
    font-size: 14px;
    transition: transform 0.4s var(--mre-ease);
}
.mre-project-toggle:hover .mre-project-toggle-icon {
    transform: translateX(4px);
}
.mre-project-content-block .mre-project-toggle {
    margin-bottom: 24px;
    line-height: normal;
}
button.mre-project-toggle.open .mre-project-toggle-icon {
    transform: rotate(180deg);
}
.mre-project-full-desc {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.8s var(--mre-ease), opacity 0.5s, margin-top 0.5s;
}
.mre-project-full-desc.open {
    margin-top: 24px;
    opacity: 1;
}
.mre-project-full-desc p {
    margin: 0 0 16px;
    color: var(--mre-muted);
    font-size: 15px;
    line-height: 1.85;
}
.mre-project-full-desc p:last-child {
    margin-bottom: 0;
}
.mre-project-divider {
    width: 60px;
    height: 1px;
    margin: 0 auto 140px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}
.mre-portfolio .mre-pagination {
    margin-top: 20px;
}

@media (max-width: 1024px) {
    .mre-project-grid,
    .mre-project-grid.reverse {
        grid-template-columns: 1fr;
        direction: ltr;
        gap: 40px;
    }
    .mre-portfolio { padding: 80px 32px; }
    .mre-project-section { margin-bottom: 100px; }
    .mre-project-divider { margin-bottom: 100px; }
}
@media (max-width: 768px) {
    .mre-portfolio { padding: 64px 24px; }
    .mre-project-section { margin-bottom: 80px; }
    .mre-project-divider { margin-bottom: 80px; }
}
@media (max-width: 480px) {
    .mre-portfolio { padding: 56px 20px; }
    .mre-project-title { font-size: 28px; }
    .mre-project-image-card { aspect-ratio: 1 / 1; }
}

/* ---------- Homepage: full-width project strip ---------- */
.flat-projects-strip {
    padding-top: var(--mre-section-space, 52px);
    padding-bottom: 0;
    overflow: hidden;
}
.flat-projects-strip .heading-section {
    margin-bottom: 28px;
}
.mre-strip {
    overflow: hidden;
}
.mre-strip-tile {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #e9ecef;
}
.mre-strip-tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s var(--mre-ease);
}
.mre-strip-tile:hover img {
    transform: scale(1.08);
}
.mre-strip-caption {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 32px;
    background: linear-gradient(to top, rgba(30, 39, 88, 0.9) 0%, rgba(30, 39, 88, 0.5) 55%, transparent 100%);
    color: #fff;
    opacity: 0;
    transition: opacity 0.5s;
}
.mre-strip-tile:hover .mre-strip-caption,
.mre-strip-tile:focus-visible .mre-strip-caption {
    opacity: 1;
}
.mre-strip-place {
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    transform: translateY(14px);
    transition: transform 0.5s var(--mre-ease);
}
.mre-strip-name {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    transform: translateY(14px);
    transition: transform 0.5s var(--mre-ease);
}
.mre-strip-info {
    display: block;
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.6s var(--mre-ease), margin 0.6s var(--mre-ease), opacity 0.5s;
}
.mre-strip-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 14px;
}
.mre-strip-row span:first-child {
    color: rgba(255, 255, 255, 0.65);
}
.mre-strip-row span:last-child {
    font-weight: 600;
    text-align: right;
}
.mre-strip-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: max-height 0.6s var(--mre-ease), margin 0.6s var(--mre-ease), opacity 0.5s;
}
.mre-strip-tile:hover .mre-strip-place,
.mre-strip-tile:hover .mre-strip-name {
    transform: none;
}
.mre-strip-tile:hover .mre-strip-info {
    max-height: 200px;
    margin-top: 18px;
    opacity: 1;
}
.mre-strip-tile:hover .mre-strip-more {
    max-height: 40px;
    margin-top: 20px;
    opacity: 1;
}
@media (hover: none) {
    .mre-strip-caption { opacity: 1; background: linear-gradient(to top, rgba(30, 39, 88, 0.85) 0%, transparent 60%); }
    .mre-strip-place, .mre-strip-name { transform: none; }
}
.mre-strip-cta {
    padding: 40px 0 var(--mre-section-space, 52px);
    text-align: center;
}
.mre-strip-cta .mre-project-toggle {
    margin: 0;
}

/* ---------- Detail page (same layout as Balfin's project page) ---------- */
.mre-detail {
    --mre-detail-ink: #001427;
    --mre-detail-card: rgba(255, 233, 138, 0.81);
    --mre-detail-bar: #ffd315;
    overflow-x: hidden;
    color: var(--mre-detail-ink);
    -webkit-font-smoothing: antialiased;
}
.mre-detail-head {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 24px 0;
    text-align: center;
}
.mre-detail-title {
    margin: 0 0 15px;
    color: var(--mre-detail-ink);
    font-size: clamp(34px, 2.835vw, 54px);
    font-weight: 600;
    line-height: 1.16;
}
.mre-detail-rule {
    display: block;
    width: 360px;
    max-width: 80%;
    height: 2px;
    margin: 0 auto;
    background: var(--mre-detail-bar);
}
.mre-feature {
    position: relative;
    max-width: 1200px;
    margin: 22px auto 0;
    padding: 24px 0 70px;
}
.mre-feature-card {
    position: relative;
    z-index: 2;
    width: calc(100% - 14px);
    min-height: 595px;
    margin-left: 6px;
    padding: 49px 139px 70px 154px;
    background: var(--mre-detail-card);
}
.mre-feature-card::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 660px;
    max-width: 60%;
    height: 17px;
    background: var(--mre-detail-bar);
}
.mre-feature-text {
    margin: 0;
    font-family: Poppins, sans-serif;
    color: #000;
    font-size: 16px;
    font-weight: 200;
    line-height: 25px;
}
.mre-feature-cta {
    position: absolute;
    z-index: 3;
    right: 20px;
    bottom: 30px;
    padding: 12px 16px;
    background: var(--mre-detail-bar);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
}
.mre-feature-cta:hover {
    background: var(--mre-detail-ink);
    color: #fff;
}
.mre-feature-image {
    position: absolute;
    z-index: 1;
    top: 50px;
    bottom: 15px;
    left: 441px;
    right: calc(-1 * (50vw - 600px));
    background: #cfd6dd center / cover no-repeat;
}
.mre-detail-body {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 100px;
}
.mre-block-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 28px;
    color: var(--mre-detail-ink);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
}
.mre-block-title::before {
    content: "";
    width: 32px;
    height: 1px;
    background: var(--primary-color);
}
.mre-detail-properties {
    margin-bottom: 90px;
}
.mre-units {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 56px 44px;
}
.mre-unit-image {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    margin-bottom: 12px;
}
.mre-unit-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mre-detail-properties .mre-unit-title {
    margin: 0 0 30px;
    font-family: Poppins, sans-serif;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
}
.mre-unit-title a {
    font-family: inherit;
    color: var(--mre-detail-ink);
    text-decoration: none;
}
.mre-unit-list {
    margin: 0;
    color: #7d8597;
    font-size: 14px;
    line-height: 1.5;
}
.mre-unit-list li + li {
    margin-top: 4px;
}
.mre-unit-list strong {
    color: inherit;
    font-weight: 700;
}
.mre-detail-properties .ps-projects__pagination {
    margin-top: 56px;
}
.mre-detail-properties .ps-pagination {
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (max-width: 1240px) {
    .mre-feature { padding-left: 20px; padding-right: 20px; }
    .mre-feature-card { width: 100%; margin-left: 0; padding: 49px 60px 70px; }
    .mre-feature-image { left: 40%; right: -20px; }
}
@media (max-width: 1024px) {
    .mre-units { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .mre-units { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mre-feature { padding: 24px 0 0; }
    .mre-feature-card { min-height: 0; padding: 40px 24px 56px; }
    .mre-feature-image { position: relative; top: auto; bottom: auto; left: auto; right: auto; height: 320px; margin: -17px 0 0; }
    .mre-detail-body { padding: 40px 20px 70px; }
    .mre-hero-down { margin-top: 32px; }
}
@media (max-width: 520px) {
    .mre-units { grid-template-columns: 1fr; }
}
