@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800;900&family=Playfair+Display:ital,wght@0,700;0,900;1,400&display=swap');

:root {
    --gold: #c9a84c;
    --gold-soft: #e8d5a3;
    --bg: #050505;
    --text: #fff;
    --muted: #666;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ========== INDEX GRID — 4x2, Fills Viewport ========== */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    height: 100vh;
    width: 100vw;
}

.card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #111;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease, filter 0.5s ease;
    filter: brightness(0.7);
}

.card:hover img {
    transform: scale(1.06);
    filter: brightness(1);
}

.card .label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 20px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
    pointer-events: none;
}

.card .label h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.1rem, 1.8vw, 2rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.5px;
}

.card .label small {
    display: block;
    color: var(--gold);
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    margin-bottom: 5px;
}

/* Sattas placeholder (no photo) */
.card.no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #111 0%, #1a1a1a 100%);
}

.card.no-photo .placeholder-name {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 900;
    color: var(--gold);
    text-align: center;
    letter-spacing: 5px;
    text-transform: uppercase;
    opacity: 0.3;
}

/* ========== DETAIL PAGE — Poster-Style ========== */
.detail {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
}

.detail.open {
    display: block;
}

.detail-page {
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Full-bleed background image */
.detail-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.detail-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}

/* Gradient overlay for text readability */
.detail-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.95) 0%,
            rgba(0, 0, 0, 0.6) 35%,
            rgba(0, 0, 0, 0.15) 65%,
            rgba(0, 0, 0, 0.3) 100%);
}

.detail-bg.no-img {
    background: linear-gradient(160deg, #0a0a0a 0%, #1a1510 50%, #0a0a0a 100%);
}

/* Logo watermark */
.detail-logo {
    position: absolute;
    top: 25px;
    left: 40px;
    width: 90px;
    height: auto;
    z-index: 15;
    opacity: 0.5;
    pointer-events: none;
    filter: brightness(10) drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

/* Content positioned over the image */
.detail-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 60px 80px;
    max-width: 900px;
}

.detail-content .tag {
    display: inline-block;
    color: var(--gold);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 5px;
}

.detail-content h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 900;
    font-style: italic;
    line-height: 0.95;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #f5e6b8 0%, #c9a84c 40%, #e8d5a3 70%, #a8863a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.7));
    letter-spacing: -1px;
}

.detail-content .bio {
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    max-height: 35vh;
    overflow-y: auto;
    padding-right: 15px;
}

.detail-content .bio::-webkit-scrollbar {
    width: 3px;
}

.detail-content .bio::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 10px;
}

/* Buttons */
.detail-actions {
    position: absolute;
    top: 30px;
    right: 40px;
    z-index: 20;
    display: flex;
    gap: 12px;
}

.btn {
    padding: 12px 28px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    color: #fff;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.btn:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.btn-gold {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
}

.btn-gold:hover {
    background: #fff;
}

/* ========== PRINT — POSTER DESIGN ========== */
@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }

    body {
        background: #000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .grid {
        display: none !important;
    }

    .detail {
        display: block !important;
        position: absolute !important;
        top: 0;
        left: 0;
        width: 210mm !important;
        height: 297mm !important;
        overflow: hidden !important;
        background: #000 !important;
    }

    .detail-page {
        width: 210mm !important;
        height: 297mm !important;
    }

    .detail-bg {
        position: absolute !important;
        top: 0;
        left: 0;
        width: 210mm !important;
        height: 297mm !important;
    }

    .detail-bg img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center 20% !important;
    }

    .detail-bg::after {
        background: linear-gradient(to top,
                rgba(0, 0, 0, 1) 0%,
                rgba(0, 0, 0, 0.65) 35%,
                rgba(0, 0, 0, 0.05) 70%,
                transparent 100%) !important;
    }

    .detail-content {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 20mm !important;
        max-width: none !important;
    }

    .detail-content .tag {
        display: none !important;
    }

    .detail-content h1 {
        font-size: 55pt !important;
        font-style: italic !important;
        color: #f5e6b8 !important;
        -webkit-text-fill-color: #f5e6b8 !important;
        background: none !important;
        text-shadow: 0 4px 20px rgba(0, 0, 0, 1), 0 0 40px rgba(201, 168, 76, 0.3) !important;
        margin-bottom: 5mm !important;
        letter-spacing: -1px !important;
    }

    .detail-content .bio {
        color: #eee !important;
        font-size: 10pt !important;
        line-height: 1.5 !important;
        max-height: none !important;
        overflow: visible !important;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 1) !important;
    }

    .detail-actions {
        display: none !important;
    }

    .detail-logo {
        position: absolute !important;
        top: 10mm !important;
        left: 10mm !important;
        width: 28mm !important;
        opacity: 0.4 !important;
        z-index: 15 !important;
        filter: brightness(10) drop-shadow(0 0 5px rgba(255, 255, 255, 0.5)) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(4, 1fr);
    }

    .detail-content {
        padding: 40px;
    }

    .detail-content h1 {
        font-size: 3rem;
    }
}

@media (max-width: 600px) {
    .grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: auto;
    }

    .card {
        aspect-ratio: 3/4;
    }

    .detail-content {
        padding: 24px;
    }

    .detail-content h1 {
        font-size: 2.5rem;
    }
}