/* /realestate/assets/css/re-project-detail.css
   Scoped to the project detail page (projects/project.php) only.
   Reuses existing --re-* variables/fallbacks already used on this page
   for colors and fonts — does not redefine or touch global stylesheets. */

/* ---------- Gallery ---------- */
.pd-gallery {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 8px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 26px;
}
.pd-gallery__main { position: relative; cursor: pointer; }
.pd-gallery__main img, .pd-gallery__side img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-gallery__status {
    position: absolute; top: 12px; left: 12px;
    font-family: var(--re-font-ui); font-size: 0.72rem; font-weight: 700;
    padding: 5px 12px; border-radius: 6px;
}
.pd-gallery__side { display: grid; grid-template-rows: repeat(3, 1fr); gap: 8px; }
.pd-gallery__thumb, .pd-gallery__more, .pd-gallery__video { position: relative; cursor: pointer; overflow: hidden; }
.pd-gallery__more-label, .pd-gallery__play {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: rgba(26,58,66,0.6); color: #fff; font-family: var(--re-font-ui); font-size: 0.86rem; font-weight: 600;
}
.pd-gallery__play { background: rgba(26,58,66,0.45); gap: 6px; }
.pd-gallery__play-btn {
    width: 40px; height: 40px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center;
}
@media (max-width: 760px) {
    .pd-gallery { grid-template-columns: 1fr; grid-template-rows: 220px auto; }
    .pd-gallery__side { grid-auto-flow: column; grid-template-rows: 1fr; grid-template-columns: repeat(3, 1fr); height: 80px; }
}

/* ---------- Stat cards row ---------- */
.pd-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 28px;
}
.pd-stat {
    display: flex; align-items: center; gap: 10px;
    padding: 14px; border: 1px solid var(--re-rule,#e8e0d0); border-radius: 10px; background: var(--re-surface,#fdfaf7);
}
.pd-stat strong { display: block; font-family: var(--re-font-heading); font-size: 1rem; font-weight: 700; color: var(--re-ink,#1a3a42); }
.pd-stat span { display: block; font-family: var(--re-font-ui); font-size: 0.68rem; color: var(--re-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Highlights (icon grid) ---------- */
.pd-highlights { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; }
@media (max-width: 560px) { .pd-highlights { grid-template-columns: 1fr; } }
.pd-highlight { display: flex; align-items: flex-start; gap: 10px; font-family: var(--re-font-ui); font-size: 0.86rem; color: var(--re-ink-soft); }
.pd-highlight svg { flex-shrink: 0; margin-top: 1px; }

/* ---------- Amenities (icon pills) ---------- */
.pd-amenities { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-amenity {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--re-font-ui); font-size: 0.8rem; color: var(--re-ink-soft);
    padding: 6px 13px; border-radius: 20px; border: 1px solid var(--re-rule,#e8e0d0); background: var(--re-surface,#fdfaf7);
}

/* ---------- Downloads / actions row ---------- */
.pd-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pd-action-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 18px; border-radius: 8px; font-family: var(--re-font-ui); font-size: 0.84rem; font-weight: 600;
    text-decoration: none; cursor: pointer; border: none;
}
.pd-action-btn--dark { background: var(--re-ink,#1a3a42); color: #fff; }
.pd-action-btn--outline { background: #fff; border: 1px solid var(--re-rule,#e8e0d0); color: var(--re-ink-soft); }

/* ---------- FAQ ---------- */
.pd-faq { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
@media (max-width: 760px) { .pd-faq { grid-template-columns: 1fr; } }
.pd-faq details {
    border: 1px solid var(--re-rule,#e8e0d0); border-radius: 8px; background: #fff; padding: 0;
}
.pd-faq summary {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 13px 16px; cursor: pointer; list-style: none;
    font-family: var(--re-font-ui); font-size: 0.86rem; font-weight: 500; color: var(--re-ink,#1a3a42);
}
.pd-faq summary::-webkit-details-marker { display: none; }
.pd-faq summary::after {
    content: ''; width: 9px; height: 9px; flex-shrink: 0;
    border-right: 1.6px solid var(--re-muted); border-bottom: 1.6px solid var(--re-muted);
    transform: rotate(45deg); transition: transform 0.15s;
}
.pd-faq details[open] summary::after { transform: rotate(-135deg); }
.pd-faq__body {
    padding: 0 16px 15px; font-family: var(--re-font-ui); font-size: 0.82rem; color: var(--re-muted); line-height: 1.6;
}

/* ---------- Share bar ---------- */
.pd-share { display: flex; flex-wrap: wrap; gap: 10px; }
.pd-share-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: 8px; font-family: var(--re-font-ui); font-size: 0.82rem; font-weight: 600;
    text-decoration: none; cursor: pointer; border: 1px solid transparent;
}

/* ---------- Enquire / Contact card ---------- */
.pd-enquire {
    border: 1px solid var(--re-rule,#e8e0d0);
    border-radius: 12px;
    padding: 22px 20px;
    background: #fff;
    box-shadow: 0 3px 14px rgba(26,58,66,0.06);
    margin-bottom: 20px;
}
.pd-enquire__eyebrow {
    font-family: var(--re-font-ui); font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.09em; text-transform: uppercase; color: #c17f3a;
    margin-bottom: 10px;
}
.pd-enquire__title {
    font-family: var(--re-font-heading); font-weight: 700; font-size: 1.05rem; color: var(--re-ink,#1a3a42);
    line-height: 1.3; margin: 0 0 6px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pd-enquire__sub { font-family: var(--re-font-ui); font-size: 0.78rem; color: var(--re-muted); margin: 0 0 18px; line-height: 1.5; }
.pd-enquire__btn {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    width: 100%; padding: 13px; border-radius: 8px;
    font-family: var(--re-font-ui); font-size: 0.87rem; font-weight: 600;
    text-decoration: none; margin-bottom: 10px; box-sizing: border-box;
    transition: transform 0.1s, box-shadow 0.15s;
}
.pd-enquire__btn:active { transform: scale(0.98); }
.pd-enquire__btn--wa { background: #25d366; color: #fff; box-shadow: 0 2px 8px rgba(37,211,102,0.25); }
.pd-enquire__btn--wa:hover { box-shadow: 0 4px 12px rgba(37,211,102,0.35); }
.pd-enquire__btn--call { background: #fff; border: 1.5px solid var(--re-dusk,#2c5f6e); color: var(--re-dusk,#2c5f6e); }
.pd-enquire__btn--call:hover { background: #f0f6f7; }
.pd-enquire__divider {
    display: flex; align-items: center; gap: 10px; margin: 16px 0 14px;
    font-family: var(--re-font-ui); font-size: 0.7rem; color: var(--re-muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.pd-enquire__divider::before, .pd-enquire__divider::after { content: ''; flex: 1; height: 1px; background: var(--re-rule,#e8e0d0); }
.pd-enquire__form { display: flex; flex-direction: column; gap: 12px; }
.pd-enquire__field { display: flex; flex-direction: column; gap: 5px; }
.pd-enquire__field span {
    font-family: var(--re-font-ui); font-size: 0.7rem; font-weight: 600;
    letter-spacing: 0.03em; text-transform: uppercase; color: var(--re-muted);
}
.pd-enquire__field span em { font-style: normal; font-weight: 400; text-transform: none; letter-spacing: 0; color: #b5aa98; }
.pd-enquire__field input, .pd-enquire__field textarea {
    font-family: var(--re-font-ui); font-size: 0.88rem; color: var(--re-ink,#1a3a42);
    padding: 11px 13px; border: 1px solid var(--re-rule,#e8e0d0); border-radius: 8px;
    width: 100%; box-sizing: border-box; background: #fdfcfa; resize: none;
    transition: border-color 0.15s, background 0.15s;
}
.pd-enquire__field input::placeholder, .pd-enquire__field textarea::placeholder { color: #b5aa98; }
.pd-enquire__field input:focus, .pd-enquire__field textarea:focus {
    outline: none; border-color: var(--re-dusk,#2c5f6e); background: #fff;
}
.pd-enquire__submit {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px; border: none; border-radius: 8px;
    background: var(--re-ink,#1a3a42); color: #fff;
    font-family: var(--re-font-ui); font-size: 0.88rem; font-weight: 600; cursor: pointer;
    margin-top: 2px; transition: background 0.15s;
}
.pd-enquire__submit:hover { background: var(--re-dusk,#2c5f6e); }
.pd-enquire__legal {
    font-family: var(--re-font-ui); font-size: 0.72rem; color: var(--re-muted);
    text-align: center; margin: 14px 0 0; line-height: 1.5;
}
.pd-enquire__legal a { color: var(--re-dusk,#2c5f6e); }

/* ---------- Sidebar cards ---------- */
.pd-side-card {
    border: 1px solid var(--re-rule,#e8e0d0); border-radius: 10px; padding: 18px; background: var(--re-surface,#fdfaf7);
    margin-bottom: 20px;
}
.pd-side-card__label {
    font-family: var(--re-font-ui); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--re-muted); margin-bottom: 12px;
}
.pd-overview-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--re-rule,#e8e0d0); font-family: var(--re-font-ui); font-size: 0.82rem; }
.pd-overview-row:last-child { border-bottom: none; }
.pd-overview-row span:first-child { color: var(--re-muted); }
.pd-overview-row span:last-child { font-weight: 600; color: var(--re-ink,#1a3a42); text-align: right; }

/* ---------- General responsive pass for the whole layout ---------- */
@media (max-width: 860px) {
    .proj-detail-layout { grid-template-columns: 1fr !important; }
    /* Move the sidebar (Enquire/Contact + Project Overview + Developer)
       above the long content on mobile, so contact actions are visible
       right after the stats row instead of requiring a scroll through
       the entire page. Plain in-flow reorder — nothing fixed/sticky, so
       this can't conflict with the site's existing mobile bottom nav. */
    .proj-detail-layout > div:first-child { order: 2; }
    .proj-detail-layout > div:last-child  { order: 1; margin-bottom: 24px; }
    .pd-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .pd-stats { grid-template-columns: 1fr 1fr; }
    .pd-actions, .pd-share { flex-direction: column; }
    .pd-actions .pd-action-btn, .pd-share .pd-share-btn { justify-content: center; width: 100%; }
}

/* ---------- Mobile floating enquire toggle ----------
   Only applies to .pd-enquire--floating (added by project.php only when
   the project actually has WhatsApp/phone contact info). Fixed just above
   the site's bottom nav (re-mobile-nav.php, 60px tall + its own safe-area
   padding) — matching the pattern used on the property detail page's
   .re-inquiry-box. Loads last in project.php's <head>, after re-mobile.css
   and re-responsive.css, so this is the effective rule at this breakpoint. */
@media (max-width: 900px) {
    .pd-enquire--floating {
        position: fixed;
        left: 0; right: 0;
        bottom: calc(60px + env(safe-area-inset-bottom, 0px));
        top: auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden; /* only overflow-y should ever scroll this box */
        margin-bottom: 0;
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -4px 24px rgba(0,0,0,.2);
        z-index: 500;
        transform: translateY(calc(100% - 64px));
        transition: transform .3s ease;
        max-height: 80vh;
        overflow-y: auto;
        padding: 0;
    }
    .pd-enquire--floating.is-open {
        transform: translateY(0);
    }
    .pd-enquire__toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 12px;
        background: #1a3a42;
        border-radius: 14px 14px 0 0;
        min-height: 64px;
        box-sizing: border-box;
    }
    .pd-enquire__toggle .pd-float-wa,
    .pd-enquire__toggle .pd-float-call {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 12px 8px;
        border-radius: 8px;
        font-family: var(--re-font-ui);
        font-size: .84rem;
        font-weight: 600;
        text-decoration: none;
        color: #fff;
        white-space: nowrap;
    }
    .pd-enquire__toggle .pd-float-wa { background: #25d366; }
    .pd-enquire__toggle .pd-float-call { background: #8b6f47; }
    .pd-enquire__handle {
        flex: 0 0 auto;
        width: 40px; height: 40px;
        display: flex; align-items: center; justify-content: center;
        background: rgba(255,255,255,.12);
        border: none;
        border-radius: 8px;
        cursor: pointer;
        padding: 0;
        margin-left: auto;
    }
    .pd-enquire__handle svg {
        width: 16px; height: 16px;
        stroke: rgba(255,255,255,.85);
        transition: transform .28s;
    }
    .pd-enquire--floating.is-open .pd-enquire__handle svg {
        transform: rotate(180deg);
    }
    /* The card's other content (eyebrow, title, buttons, form, legal) needs
       its own side padding now that the card itself has padding:0 */
    .pd-enquire--floating .pd-enquire__eyebrow,
    .pd-enquire--floating .pd-enquire__title,
    .pd-enquire--floating .pd-enquire__sub,
    .pd-enquire--floating .pd-enquire__btn,
    .pd-enquire--floating .pd-enquire__divider,
    .pd-enquire--floating .pd-enquire__form,
    .pd-enquire--floating .pd-enquire__legal {
        margin-left: 20px;
        margin-right: 20px;
    }
    .pd-enquire--floating .pd-enquire__eyebrow { margin-top: 18px; }
    .pd-enquire--floating .pd-enquire__legal { margin-bottom: 18px; }

    /* iOS Safari auto-zooms the page when a focused input's font-size is
       under 16px — that's what let the page pan left/right once the form
       was reachable. The base rule sets 0.88rem (~14px); override to 16px
       here so focusing a field never triggers that zoom. */
    .pd-enquire--floating .pd-enquire__field input,
    .pd-enquire--floating .pd-enquire__field textarea {
        font-size: 16px;
    }

    /* Non-floating case (no contact info on this project): keep the card
       in normal flow, reordered to the top like before — no fixed
       positioning, nothing to override. */

    /* Reserve space so page content never sits under the toggle bar */
    .proj-detail-layout {
        padding-bottom: 90px;
    }
}
