/* Template Page Styles */
.template-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
}

/* Parallax background with top left grey corner */
.template-page .parallax-background {
    position: fixed;
    top: -100vh;
    left: 0;
    width: 100%;
    height: 200vh;
    background: 
        /* Top left corner grey - maximum opacity 1.0, extending further to the right */
        radial-gradient(ellipse at 0% 0%, rgba(53, 57, 60, 1) 0%, transparent 70% 100%),
        
        /* White base */
        linear-gradient(180deg,
            rgba(255, 250, 250, 1) 0%,
            rgba(255, 250, 250, 1) 100%
        );
    z-index: -1;
    transform: translateY(calc(var(--scroll) * 0.15px));
    will-change: transform;
}

.template-page .parallax-content {
    position: relative;
    z-index: 1;
}

/* Portfolio Grid Styles */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
    margin-top: 1rem; /* Added margin to push grid down */
}

.portfolio-item {
    position: relative;
    aspect-ratio: 1/1;  /* Square aspect ratio */
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    background: #35393C;
}

.portfolio-item:hover {
    transform: translateY(-5px);
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    background: rgba(19, 23, 32, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay h3 {
    color: #FFFAFA;
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    margin: 0;
    text-align: center;
    padding: 1rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay h3 {
    transform: translateY(0);
}

/* Modal Styles */
.portfolio-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(19, 23, 32, 0.95);
    z-index: 1000;
    overflow: hidden;
}

.portfolio-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    background: transparent;
    padding: 0;
    max-width: 90vw;
    max-height: 90vh;
}

.modal-close {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: #FFFAFA;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.3s ease;
    z-index: 1001;
}

.modal-close:hover {
    color: #AD6F3B;
}

.modal-image {
    display: block;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    margin: 0;
    padding: 0;
    border-radius: 0;
}

.modal-info {
    color: #FFFAFA;
}

.modal-title {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #AD6F3B;
}

.modal-description {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    line-height: 1.6;
}

/* Template Content Styles */
.template-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 40px; /* Increased top padding */
}

/* Responsive Adjustments */
@media screen and (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
        padding: 1rem;
        margin-top: 3rem; /* Adjusted for mobile */
    }

    .modal-content {
        padding: 1rem;
    }

    .modal-title {
        font-size: 1.5rem;
    }
    
    .template-content {
        padding: 60px 20px 20px; /* Adjusted padding for mobile */
    }
}