/* Portfolio Specific Overrides */

/* Hero */
.portfolio-hero {
    padding-top: 12vw; /* Ensure space for header */
}

.portfolio-hero-glass {
    background: #EFEFE8; /* offwhite color */
    display: flex;
    justify-content: center;
    align-items: center;
}

.portfolio-statue {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.hero-label {
    font-family: 'Source Code Pro', monospace;
    font-size: 1vw;
    color: #ffffff;
    opacity: 0.8;
    letter-spacing: 0.1em;
    margin-bottom: 1.5vw;
    display: block;
}

.hero-subtext {
    text-transform: none;
    font-size: clamp(14px, 1.2vw, 18px);
    opacity: 0.9;
}

/* Cards Grid layout */
.portfolio-cards-section {
    padding-top: 0;
}

.portfolio-grid {
    flex-wrap: wrap; 
    justify-content: flex-start; /* ensures Thambapanni is left aligned on new row */
    gap: 3vw;
}

.port-card {
    cursor: pointer;
    position: relative;
    /* Ensure EXACTLY 3 cards per row: 3 cards + 2 gaps (6vw) = 100% */
    width: calc((100% - 6.1vw) / 3);
    height: auto;
    aspect-ratio: 1 / 1;
}

/* Tags and Descriptions in minimized view */
.port-tag {
    font-family: 'Source Code Pro', monospace;
    font-size: 1vw;
    color: #ffffff;
    opacity: 0.7;
    letter-spacing: 0.05vw;
    margin-bottom: 0.5vw;
    display: block;
    text-transform: uppercase;
}

.port-heading {
    font-family: 'Arsenica Trial', serif;
    font-size: 3vw;
    color: #ffffff;
    margin: 0 0 1vw 0;
    line-height: 1;
    opacity: 0.9;
}
.thambapanni-text{
    font-size: 2.5vw;
}
.port-desc {
    font-family: 'Source Code Pro', monospace;
    color: #ffffff;
    font-size: clamp(12px, 1.1vw, 16px);
    line-height: 1.6;
    margin: 0;
}

/* Small glass card for logo at bottom right */
.port-logo-glass {
    position: absolute;
    bottom: 2.5vw;
    right: 2.5vw;
    width: 6.5vw;
    height: 6.5vw;
    border-radius: 1.5vw;
    background: rgba(239, 239, 232, 0.6); /* #EFEFE8 equivalent offwhite */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    box-sizing: border-box;
    padding: 0.6vw;
    z-index: 2;
}

/* Specific styling for Sith Sevana */
.sith-logo-glass {
    background: transparent !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    padding: 0;
    width: 6.5vw;
    height: 6.5vw;
}

.sith-logo-glass::before {
    display: none;
}

/* Smooth gradient border for small glass */
.port-logo-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.8) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

.port-logo-glass img,
.port-logo-glass .port-text-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.port-text-logo {
    font-family: 'Arsenica Trial', serif;
    font-weight: 700;
    font-size: 3vw;
    color: #1a1c13;
    line-height: 1;
}

/* Expanded Card hidden content initially */
.port-expanded-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Expanded State */
body.modal-open {
    overflow: hidden; /* prevent scrolling when card is expanded */
}

.portfolio-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.portfolio-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Expanded card styling */
.port-card.is-expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
    width: 50vw;
    height: auto;
    max-height: 80vh;
    z-index: 100;
    cursor: default;
    padding: 4vw;
}

/* Ensure expanded card maintains glass effect appropriately without inheriting hover translates */
.port-card.is-expanded:hover {
    transform: translate(-50%, -50%);
    box-shadow:
        0 20px 60px rgba(0,0,0,0.3),
        inset 0 0 0 1px rgba(255,255,255,0.1);
}

/* When expanded, hide the default tag, heading, desc, and logo */
.port-card.is-expanded > .port-tag,
.port-card.is-expanded > .port-heading,
.port-card.is-expanded > .port-desc,
.port-card.is-expanded > .port-logo-glass {
    display: none;
}

/* Show expanded content */
.port-card.is-expanded .port-expanded-content {
    display: flex;
    flex-direction: column;
    opacity: 1;
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

/* Expanded Content Internal Styling */
.port-expanded-header {
    display: flex;
    align-items: center;
    gap: 2vw;
    margin-bottom: 2vw;
}

.is-expanded-logo {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    flex-shrink: 0;
    z-index: 1 !important;
}

.port-expanded-title {
    font-family: 'Arsenica Trial', serif;
    font-size: 3vw;
    color: #ffffff;
    margin: 0;
}

.port-expanded-text {
    font-family: 'Source Code Pro', monospace;
    font-size: clamp(14px, 1.2vw, 18px);
    color: #ffffff;
    line-height: 1.6;
    margin-bottom: 3vw;
}

.port-expanded-meta {
    display: flex;
    flex-direction: column;
    gap: 1vw;
    margin-top: auto;
}

.meta-item {
    font-family: 'Source Code Pro', monospace;
    font-size: 1vw;
    color: #ffffff;
    opacity: 0.8;
}

.meta-item strong {
    font-weight: 600;
    color: #ffffff;
    opacity: 1;
    margin-right: 0.5vw;
}

/* Close Button for Modal */
.close-modal-btn {
    position: absolute;
    top: 2vw;
    right: 2vw;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 3vw;
    height: 3vw;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    font-size: 1.5vw;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 101;
}

.close-modal-btn:hover {
    background: rgba(255,255,255,0.3);
}

.port-card.is-expanded .close-modal-btn {
    opacity: 1;
    pointer-events: auto;
}


/* Mobile Adjustments */
@media (max-width: 768px) {
    .portfolio-hero { padding: 120px 10vw 60px; }
    .portfolio-hero-glass { width: 80vw; height: 80vw; }
    .hero-label { font-size: 3.5vw; margin-bottom: 4vw; }
    .hero-subtext { font-size: 3.5vw; }
    
    .portfolio-grid { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; gap: 5vw; margin: 0 auto; }
    .port-card { width: 100%; max-width: 80vw; height: auto; aspect-ratio: 1 / 1; margin: 0 auto; }
    .port-tag { font-size: 3.5vw; margin-bottom: 2vw; }
    .port-heading { font-size: 8vw; margin-bottom: 3vw; }
    .thambapanni-text { font-size: 7vw;}
    .port-desc { font-size: 3.8vw; }
    
    .port-logo-glass { width: 22vw; height: 22vw; border-radius: 3vw; bottom: 8.5vw; right: 8.5vw; padding: 2vw;}
    .sith-logo-glass { width: 22vw; height: 22vw; padding: 0; right: 8.5vw; bottom: 8.5vw; }
    .port-text-logo { font-size: 10vw; }
    
    .port-card.is-expanded { width: 90vw; padding: 6vw; border-radius: 40px; }
    .close-modal-btn { width: 10vw; height: 10vw; top: 4vw; right: 4vw; font-size: 5vw; }
    
    .port-expanded-header { flex-direction: column; align-items: flex-start; gap: 4vw; }
    .port-expanded-title { font-size: 7vw; line-height: 1.1; }
    .port-expanded-text { font-size: 3.5vw; }
    .meta-item { font-size: 3.5vw; margin-bottom: 1vw;}
}


