/* ═══════════════════════════════════════════════════════════
   POPUP.CSS — Rolls-Royce Luxury Project Gateway
   Triggered by the Hero center PLUS button
   Full-screen · Cinematic Curtain · Editorial · Silent Luxury
═══════════════════════════════════════════════════════════ */

/* ── Curtain Backdrop ─────────────────────────────────────── */
.popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 8000;
    opacity: 0;
    pointer-events: none;
    /* Deep cinematic vignette — not just a simple dim */
    background:
        radial-gradient(ellipse at 50% 0%, rgba(30, 20, 15, 0.0) 0%, rgba(8, 6, 5, 0.96) 100%);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.popup-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

/* ── Main Popup Container ─────────────────────────────────── */
.popup-container {
    position: fixed;
    inset: 0;
    z-index: 8100;
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Ivory off-white — Rolls-Royce ghost white */
    background: #f7f5f0;
}

.popup-container.active {
    pointer-events: all;
}

/* ── Luxury Top Bar ───────────────────────────────────────── */
.popup-header {
    background: #0d0c0a;
    padding: 18px 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    transform: translateY(-100%);
    opacity: 1;
    will-change: transform;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.popup-header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.popup-system-tag {
    display: flex;
    align-items: center;
    gap: 10px;
}

.popup-system-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #b89a6a;
    animation: rr-pulse 3s ease-in-out infinite;
}

@keyframes rr-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

.popup-system-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: #5a5248;
}

.popup-title-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.04em;
    color: #e8e0d0;
}

.popup-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.popup-counter {
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    color: #3a3530;
    text-transform: uppercase;
}

/* ── Close Button — Minimal Luxury ───────────────────────── */
.popup-close-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(232, 224, 208, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.4s ease, background 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.popup-close-btn:hover {
    border-color: #e8e0d0;
    background: rgba(232, 224, 208, 0.08);
    transform: rotate(90deg);
}

.popup-close-btn svg {
    width: 16px;
    height: 16px;
    stroke: #7a7268;
    transition: stroke 0.3s;
}

.popup-close-btn:hover svg { stroke: #e8e0d0; }

/* ── Horizontal Divider Line ──────────────────────────────── */
.popup-luxury-rule {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #c8b99a 30%, #c8b99a 70%, transparent 100%);
    flex-shrink: 0;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform, opacity;
}

/* ── Grid Body ────────────────────────────────────────────── */
.popup-grid-body {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    /* Inner padding and margin (gap) between cards */
    padding: 24px 52px;
    gap: 24px;
    background: transparent;
}

/* ── Individual Project Card ──────────────────────────────── */
.popup-project-card {
    position: relative;
    background: #f7f5f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    will-change: transform, opacity;
    cursor: pointer;
    border-radius: 12px;
    border: 1px solid rgba(200, 185, 154, 0.25);
    /* No initial transform — we clip instead via JS */
}

.popup-project-card:hover {
    z-index: 10;
}

/* ── Card Visual Area ─────────────────────────────────────── */
.card-visual {
    position: relative;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.card-visual img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.8s ease;
    filter: saturate(0.75) brightness(0.88);
    transform: scale(1.06);
}

.popup-project-card:hover .card-visual img {
    transform: scale(1.0);
    filter: saturate(0.95) brightness(0.95);
}

/* Luxury gradient — heavier at bottom */
.card-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 45%,
        rgba(8, 7, 5, 0.7) 100%
    );
    z-index: 1;
    transition: opacity 0.6s ease;
}

.popup-project-card:hover .card-visual::after { opacity: 0.5; }

/* ── Card Number Tag ──────────────────────────────────────── */
.card-num-tag {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 3;
    font-family: 'Inter', sans-serif;
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(232, 224, 208, 0.7);
    /* No box — just elegant text */
    padding: 0;
}

/* ── Card Info Footer ─────────────────────────────────────── */
.card-info {
    flex-shrink: 0;
    padding: 28px 32px 32px;
    background: #f7f5f0;
    border-top: 1px solid #ddd9d0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

/* Thin gold accent line above card info */
.card-info::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 32px;
    right: 32px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #c8b99a 40%, #c8b99a 60%, transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.popup-project-card:hover .card-info::before { opacity: 1; }

.card-project-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #0d0c0a;
    line-height: 1;
}

.card-project-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 400;
    color: #8a8278;
    letter-spacing: 0.04em;
    line-height: 1.55;
}

.card-visit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.card-visit-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.58rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #b0a898;
}

.card-visit-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #0d0c0a;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.card-visit-btn:hover {
    background: #b89a6a;
    transform: translateX(4px);
}

.card-visit-btn svg {
    width: 14px;
    height: 14px;
    stroke: #f7f5f0;
    transition: stroke 0.3s;
}

/* ── Popup Footer Strip ───────────────────────────────────── */
.popup-footer {
    background: #0d0c0a;
    border-top: 1px solid rgba(200, 185, 154, 0.18);
    padding: 16px 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    transform: translateY(100%);
    opacity: 1;
    will-change: transform;
}

.popup-footer-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.58rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: #3a3530;
}

.popup-all-work-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    color: #c8b99a;
    border: 1px solid rgba(200, 185, 154, 0.35);
    border-radius: 2px;
    padding: 10px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.4s ease, color 0.4s ease, background 0.4s ease,
                letter-spacing 0.4s ease;
}

.popup-all-work-btn:hover {
    border-color: #c8b99a;
    color: #0d0c0a;
    background: #c8b99a;
    letter-spacing: 0.22em;
}

.popup-all-work-btn svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.popup-all-work-btn:hover svg { transform: translateX(5px); }

/* ── Scroll lock helper ───────────────────────────────────── */
body.popup-open { overflow: hidden; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
    .popup-grid-body {
        grid-template-columns: 1fr 1fr;
        overflow-y: auto;
    }
    .popup-project-card:last-child {
        grid-column: span 2;
    }
    .popup-header, .popup-footer {
        padding: 16px 28px;
    }
}

@media (max-width: 720px) {
    .popup-grid-body {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }
    .popup-project-card,
    .popup-project-card:last-child {
        grid-column: span 1;
        min-height: 380px;
    }
    .popup-header, .popup-footer {
        padding: 14px 20px;
    }
    .popup-title-text {
        display: none;
    }
}
