/* =============================================================
   SECTION — Portfolio (أعمالنا)
   ============================================================= */

#portfolio {
    padding: 140px 0;
    background-color: var(--brand-black);
    position: relative;
    overflow: hidden;
}

.portfolio-section-header {
    text-align: center;
    margin-bottom: 56px;
    direction: rtl;
}

.portfolio-section-title {
    font-size: 3.2rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.portfolio-section-desc {
    color: #aaaaaa;
    max-width: 750px;
    margin: 0 auto;
    font-size: 1.2rem;
    line-height: 1.8;
    font-weight: 300;
}

/* Badge */
.portfolio-badge {
    background: linear-gradient(90deg, rgba(var(--brand-bronze-rgb), 0.12), rgba(var(--brand-bronze-rgb), 0.02));
    color: var(--gold-primary);
    border-right: 2px solid var(--gold-primary);
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 20px;
}

/* Grid — 3 columns like reference */
.portfolio-premium-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    direction: rtl;
}

/* Project card */
.portfolio-project-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 300px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    text-align: center;
    font: inherit;
    color: inherit;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-project-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--brand-bronze-rgb), 0.35);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.portfolio-project-card:focus-visible {
    outline: 2px solid var(--gold-primary);
    outline-offset: 3px;
}

/* Image area ~75% */
.portfolio-project-card__media {
    flex: 3 1 0;
    min-height: 0;
    overflow: hidden;
    background: #111;
}

.portfolio-project-card__img {
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
    object-position: center;
    display: block;
    pointer-events: none;
}

/* Title area ~25% */
.portfolio-project-card__body {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 16px;
    background: #000;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.portfolio-project-card__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.5;
    color: #fff;
}

/* View more button */
.portfolio-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

.portfolio-more-btn {
    min-width: 200px;
    justify-content: center;
}

/* Lightbox */
body.portfolio-lightbox-open {
    overflow: hidden;
}

.portfolio-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.portfolio-lightbox[hidden] {
    display: none !important;
}

.portfolio-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.portfolio-lightbox-dialog {
    position: relative;
    z-index: 1;
    width: min(960px, 100%);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.portfolio-lightbox-close {
    position: absolute;
    top: -44px;
    left: 0;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.portfolio-lightbox-header {
    text-align: center;
    direction: rtl;
}

.portfolio-lightbox-title {
    margin: 0;
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
}

.portfolio-lightbox-title[hidden] {
    display: none;
}

.portfolio-lightbox-stage {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.portfolio-lightbox-content {
    flex: 1;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    min-height: 200px;
}

.portfolio-lightbox-content img {
    display: block;
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
    background: #000;
}

.portfolio-lightbox-nav {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(var(--brand-bronze-rgb), 0.45);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.portfolio-lightbox-nav:hover {
    background: var(--brand-btn-gradient);
    border-color: var(--gold-primary);
}

.portfolio-lightbox-nav[hidden] {
    display: none;
}

.portfolio-lightbox-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.portfolio-lightbox-dots[hidden] {
    display: none;
}

.portfolio-lightbox-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.75);
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.portfolio-lightbox-dot.is-active,
.portfolio-lightbox-dot:hover {
    background: #fff;
    border-color: #fff;
}
