/**
 * Project Card Component — Premium v2.0
 * Cinematic overlay design inspired by DAMAC / Aldar
 * Shared across homepage, archive, and related sections
 */

/* ── Design Tokens (fallback) ── */
:root {
    /* Colors are dynamically injected via color-system.php (mapped to Customizer settings) */
    --hp-radius:       20px;
    --hp-radius-sm:    14px;
    --hp-radius-full:  100px;
    --hp-transition:   0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════
   PROJECT CARD — Premium Cinematic Design v2.0
   ═══════════════════════════════════════════════ */
.pc {
    background: var(--hp-white);
    border-radius: var(--hp-radius);
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    transition: transform var(--hp-transition), box-shadow var(--hp-transition), border-color var(--hp-transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.pc:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12), 0 0 0 1.5px rgba(193, 122, 74, 0.3);
}

/* ═══ IMAGE ZONE ═══ */
.pc__img {
    display: block;
    position: relative;
    height: 220px;
    overflow: hidden;
    background: var(--hp-navy-mid);
    flex-shrink: 0;
}

.pc__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

.pc:hover .pc__img img {
    transform: scale(1.08);
}

/* Placeholder */
.pc__img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--hp-navy) 0%, var(--hp-navy-light) 100%);
    color: rgba(255, 255, 255, 0.12);
    font-size: 3.5rem;
}

/* Gradient overlay — always visible at bottom */
.pc__img-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(10, 22, 38, 0.05) 0%,
        rgba(10, 22, 38, 0.15) 40%,
        rgba(10, 22, 38, 0.82) 100%
    );
    z-index: 1;
    transition: background 0.4s ease;
}

.pc:hover .pc__img-gradient {
    background: linear-gradient(
        180deg,
        rgba(10, 22, 38, 0.18) 0%,
        rgba(10, 22, 38, 0.45) 40%,
        rgba(10, 22, 38, 0.95) 100%
    );
}

/* ── Price Badge (bottom-left over image) ── */
.pc__price-badge {
    position: absolute;
    bottom: 14px;
    inset-inline-start: 14px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

html[dir="ltr"] .pc__price-badge {
    align-items: flex-start;
}

.pc__price-badge__label {
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.03em;
    margin-bottom: 2px;
}

.pc__price-badge__val {
    font-size: 1.18rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.pc__price-badge__val small {
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.75;
    margin-right: 3px;
}

/* ── Featured Badge (top-left in LTR, top-right in RTL) ── */
.pc__featured {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px;
    background: linear-gradient(135deg, var(--hp-gold), #b8941e);
    color: var(--hp-white);
    padding: 5px 13px;
    border-radius: var(--hp-radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(180, 140, 30, 0.4);
}

/* ── Location Badge (top-right in LTR, top-left in RTL) ── */
.pc__location {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    background: rgba(10, 22, 38, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--hp-white);
    padding: 6px 13px;
    border-radius: var(--hp-radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255,255,255,0.1);
}

.pc__location i {
    font-size: 0.65rem;
    color: var(--hp-copper);
}

/* ── Hover Reveal ── */
.pc__img-hover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.pc:hover .pc__img-hover {
    opacity: 1;
}

.pc__img-hover__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 10px 22px;
    border-radius: var(--hp-radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    transform: translateY(8px);
    transition: transform 0.35s ease;
}

.pc:hover .pc__img-hover__btn {
    transform: translateY(0);
}

/* ═══ BODY ═══ */
.pc__body {
    padding: 20px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
}

/* ── Meta Top: Type + Developer ── */
.pc__meta-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.pc__type-chip {
    display: inline-flex;
    align-items: center;
    background: var(--hp-copper-glow);
    color: var(--hp-copper);
    border: 1px solid rgba(193, 122, 74, 0.2);
    padding: 3px 11px;
    border-radius: var(--hp-radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.pc__dev-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #475569;
    text-decoration: none !important;
    font-weight: 600;
    transition: color 0.2s ease;
}

.pc__dev-link:hover {
    color: var(--hp-copper);
}

.pc__dev-link i {
    font-size: 0.72rem;
    color: var(--hp-copper);
}

/* ── Title ── */
.pc__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pc__title a {
    color: var(--hp-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.pc__title a:hover {
    color: var(--hp-copper);
}

/* ── Specs Row ── */
.pc__specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.pc__spec-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    background: #f1f5f9;
    padding: 5px 11px;
    border-radius: 8px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.pc:hover .pc__spec-item {
    background: var(--hp-copper-glow);
    color: var(--hp-dark);
}

.pc__spec-item i {
    font-size: 0.75rem;
    color: var(--hp-copper);
    flex-shrink: 0;
}

/* ═══ ACTIONS ═══ */
.pc__actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.pc__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none !important;
    border-radius: var(--hp-radius-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
    line-height: 1;
}

/* Primary: "عرض التفاصيل" */
.pc__btn--primary {
    flex: 1;
    padding: 12px 16px;
    background: var(--hp-dark);
    color: var(--hp-white) !important;
    position: relative;
    overflow: hidden;
}

.pc__btn--primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--hp-copper), var(--hp-copper-dark));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pc__btn--primary:hover::before {
    opacity: 1;
}

.pc__btn--primary > * {
    position: relative;
    z-index: 1;
}

.pc__btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(193, 122, 74, 0.35);
    color: var(--hp-white) !important;
}

.pc__btn--primary i {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.pc__btn--primary:hover i {
    transform: translateX(-3px);
}

html[dir="ltr"] .pc__btn--primary:hover i {
    transform: translateX(3px);
}

/* WhatsApp */
.pc__btn--wa {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: var(--hp-radius-sm);
    background: #25D366;
    color: var(--hp-white) !important;
    font-size: 1.15rem;
}

.pc__btn--wa:hover {
    background: #1db954;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
    .pc__img {
        height: 185px;
    }

    .pc__body {
        padding: 16px 14px 14px;
        gap: 8px;
    }

    .pc__title {
        font-size: 0.92rem;
    }

    .pc__price-badge__val {
        font-size: 1.05rem;
    }

    .pc__btn--primary {
        padding: 11px 14px;
        font-size: 0.8rem;
    }

    .pc__btn--wa {
        width: 40px;
        height: 40px;
        font-size: 1.05rem;
    }
}

@media (max-width: 480px) {
    .pc__img {
        height: 170px;
    }

    .pc__img-hover {
        display: none; /* على الموبايل مفيش hover */
    }

    .pc__specs {
        gap: 6px;
    }

    .pc__spec-item {
        font-size: 0.7rem;
        padding: 4px 9px;
    }
}