/* ========================================
   2. Layout
   ======================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.site-main {
    min-height: calc(100vh - 200px);
}

@media (max-width: 768px) {
    :root {
        --container-padding: 1.25rem;
    }
}

/* ========================================
   Hero Section Grid (Latest Project)
   User Spec: 12 cols, 5 rows
   ======================================== */
.hero-grid-parent {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 0px;
    height: 600px; /* Fixed height for hero impact */
    margin-bottom: var(--spacing-10);
}

.hero-grid-item {
    grid-column: span 12 / span 12;
    grid-row: span 5 / span 5;
    position: relative;
    overflow: hidden;
    border-radius: 0; /* Full width means usually no corners */
}

/* Hero Slider Styles */
.hero-slider-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.hero-slider-slide.active {
    opacity: 1;
    z-index: 2;
}

.hero-slider-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hero Overlay (Bottom Right) */
.hero-overlay {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 25px;
    color: #fff;
    border-radius: 4px;
    z-index: 10;
    text-align: right;
    backdrop-filter: blur(5px);
}

.hero-overlay h2 {
    font-size: 2rem;
    margin: 0;
    color: #fff;
    font-weight: 700;
}

.hero-overlay p {
    margin: 5px 0 0;
    font-size: 1rem;
    color: #ddd;
}

/* Hero Slider Navigation */
.hero-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.hero-slider-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.hero-slider-prev {
    left: 20px;
}

.hero-slider-next {
    right: 20px;
}

/* ========================================
   Projects Grid (Featured)
   User Spec: 12 cols, 3 items (4 cols each) for Full Page Width
   ======================================== */
.projects-grid-parent {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    /* auto rows to allow expansion */
    grid-auto-rows: minmax(100px, auto); 
    gap: 3px;
}

.project-grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: 400px; /* Base height for items */
}

.project-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-grid-item:hover img {
    transform: scale(1.05);
}

.project-grid-item .grid-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 20px 15px;
    z-index: 2;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
}

.project-grid-item .grid-text {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Projects Grid Positions (12 Col System) */
.div1 {
    grid-column: span 4 / span 4;
    grid-row: span 4 / span 4;
}

.div2 {
    grid-column: span 4 / span 4;
    grid-row: span 4 / span 4;
    grid-column-start: 5;
}

.div3 {
    grid-column: span 4 / span 4;
    grid-row: span 4 / span 4;
    grid-column-start: 9;
}

/* Responsive */
@media (max-width: 992px) {
    .hero-grid-parent {
        height: 400px;
    }
    
    .hero-overlay h2 {
        font-size: 1.5rem;
    }
    
    .projects-grid-parent {
        grid-template-columns: repeat(2, 1fr);
    }

    .project-grid-item {
        grid-column: auto !important;
        grid-row: auto !important;
        height: 300px;
    }
    
    /* Reset specific div positions on mobile */
    .div1, .div2, .div3 {
        grid-column: auto !important;
        grid-row: auto !important;
        grid-column-start: auto;
    }
}

@media (max-width: 768px) {
    .hero-grid-parent {
        height: 300px;
    }
    
    .projects-grid-parent {
        grid-template-columns: 1fr;
    }
}