/* =========================================
   Portfolio Specific Styles (portfolio.css)
   ========================================= */

/* Navigation Override for Standalone Pages */
.portfolio-nav {
    padding: 2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.back-link {
    color: var(--text-pure);
    text-decoration: none;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.back-link:hover,
.back-link:focus {
    color: var(--primary-red);
}

.nav-brand {
    font-size: 1.2rem;
    letter-spacing: 2px;
    font-weight: 500;
}

/* Main Layout */
.portfolio-main {
    flex: 1;
    padding: 4rem 5%;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.portfolio-hero {
    text-align: left;
    margin-bottom: 4rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 2rem;
}

.portfolio-hero h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
}

.portfolio-hero p {
    font-size: 1.1rem;
    max-width: 700px;
    line-height: 1.6;
}

/* =========================================
   Portfolio Grid & Vertical Cards
   ========================================= */

.portfolio-grid {
    display: grid;
    /* Automatically creates responsive columns that won't shrink below 320px */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-bottom: 4rem;
}

.project-card {
    margin-right: 4rem;
    margin-top: 2rem;
    margin-left: 4rem;
    background-color: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    /* Stacks image on top, content below */
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    height: 100%;
    /* Ensures cards in the same row stretch to equal height */
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(204, 51, 79, 0.3);
}

.project-card:focus-within {
    outline: 2px solid var(--primary-red);
    outline-offset: 4px;
}

/* Card Visuals (Top Side) */
.project-visual {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.project-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    aspect-ratio: 4 / 3;
    display: block;
    transition: transform 0.5s ease;
}

.project-card:hover .project-visual img {
    transform: scale(1.05);
}

/* Card Content (Bottom Side) */
.project-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    /* Allows content area to fill remaining height */
}

/* Header (Title & Badge) */
.project-header {
    display: flex;
    flex-direction: column;
    /* Stack title and badge vertically */
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.project-header h2 {
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0;
}

/* Tech Stack Restyling */
.tech-stack {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.tech-tag {
    font-size: 0.8rem;
    color: var(--text-pure);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* Description */
.project-content p {
    line-height: 1.6;
    margin-bottom: 2rem;
    font-size: 1rem;
    flex-grow: 1;
    /* Pushes the button to the very bottom */
}

/* View Site Button */
.btn-view-site {
    display: block;
    width: 100%;
    /* Full width for vertical layout */
    text-align: center;
    padding: 0.85rem 1.5rem;
    background-color: var(--primary-red);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 4px;
    transition: background-color 0.2s ease, outline 0.2s ease;
    margin-top: auto;
    /* Anchors button to bottom */
}

.btn-view-site:hover,
.btn-view-site:focus {
    background-color: #a8273f;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* WIP Image Blur & Icon Overlay */
.wip-blur {
    filter: blur(8px) brightness(0.4);
}

.wip-overlay-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

/* Mobile Adjustments (Not much needed since CSS Grid handles it naturally) */
@media (max-width: 1000px) {
    .portfolio-grid {
        gap: 3rem;
        margin-left: 1rem;
        margin-right: 1rem;

        /* Slightly tighter gap on mobile */
    }

    .project-card {
        margin-right: 1rem;
        margin-left: 1rem;
        /* Less horizontal margin on small screens */
    }
    .project-content {
        padding: 1.5rem;
        /* Less padding on small screens */
    }
}