/* --- Styling for the Portfolio Grid Section --- */

/* --- Header Title Style (Responsive) --- */

.portfolio-grid-title {
    /* 🔑 FLUID TYPOGRAPHY: 
        clamp(MIN: 24px, FLUID: 4vw, MAX: 36px) */
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: bold;
    letter-spacing: 1.5px;
    color: #C13584; 
    text-align: center;
    /* 🔑 FLUID MARGIN: 40px -> 2.5rem */
    margin-bottom: 2.5rem;
}

/* --- Responsive Grid Layout (Mimicking SliverGridDelegate) --- */

.grid-layout {
    display: grid;
    /* Default: 1 column for mobile (screenWidth <= 600) */
    grid-template-columns: repeat(1, 1fr);
    /* 🔑 FLUID GAP: 20px -> 1.25rem */
    gap: 1.25rem; 
    /* 🔑 FLUID PADDING: 20px -> 1.25rem */
    padding: 0 1.25rem;
}

/* Tablet (screenWidth > 600) - 2 columns */
@media (min-width: 601px) {
    .grid-layout {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop (screenWidth > 1000) - 3 columns */
@media (min-width: 1001px) {
    .grid-layout {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* 🚀 MOBILE LANDSCAPE FIX: For rotated phones (e.g., width 601px to 900px) */
/* This query ensures we use 2 columns effectively in the rotated orientation. 
   It mainly serves as an explicit confirmation/override for the 601px+ rule. */
@media (min-width: 601px) and (max-width: 900px) and (orientation: landscape) {
    .grid-layout {
        /* This is typically redundant if min-width: 601px already sets 2 columns,
           but it's good practice to ensure the layout is clean in this specific state. */
        grid-template-columns: repeat(2, 1fr);
        /* If you wanted to push for 3 columns on larger phones/small tablets rotated: */
        /* grid-template-columns: repeat(3, 1fr); */ 
    }
}

/* --- Portfolio Card Styling (Responsive) --- */

.portfolio-item {
    /* Aspect Ratio logic remains correct: 125% is (1 / 0.8) * 100% */
    position: relative;
    padding-bottom: 125%; 
    height: 0;
    overflow: hidden;

    /* 🔑 FLUID BORDER: 8px -> 0.5rem */
    border-radius: 0.5rem;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
}

.portfolio-item-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.portfolio-item-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* BoxFit.cover */
    display: block;
}

/* --- Image Overlay (Bottom text) --- */

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    /* 🔑 FLUID PADDING: 10px -> 0.625rem */
    padding: 0.625rem;
    background-color: rgba(0, 0, 0, 0.54); 
    /* 🔑 FLUID BORDER: 8px -> 0.5rem */
    border-radius: 0 0 0.5rem 0.5rem; 
}

.overlay-title {
    color: white;
    /* 🔑 FLUID FONT SIZE: 16px -> 1rem */
    font-size: 1rem;
    font-weight: 600; 
}

/* --- Loading/Error States (Responsive) --- */

.grid-loading-state {
    /* 🔑 FLUID HEIGHT: 150px -> 9.375rem */
    min-height: 9.375rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-indicator p {
    color: #C13584;
    /* 🔑 FLUID MARGIN: 10px -> 0.625rem */
    margin-top: 0.625rem;
    /* 🔑 FLUID FONT SIZE: 16px -> 1rem */
    font-size: 1rem;
}

.spinner {
    border: 4px solid rgba(193, 53, 132, 0.2);
    border-top: 4px solid #C13584;
    border-radius: 50%;
    /* 🔑 FLUID SIZE: 30px -> 1.875rem */
    width: 1.875rem;
    height: 1.875rem;
    animation: spin 1s linear infinite;
}

/* Error Text */
.grid-error-text {
    color: red;
    text-align: center;
    /* 🔑 FLUID PADDING: 40px -> 2.5rem */
    padding: 2.5rem;
}

/* --- Outlined Button Style (Responsive) --- */

.cta-outlined-button {
    display: block;
    width: fit-content;
    /* 🔑 FLUID MARGIN: 40px -> 2.5rem */
    margin: 2.5rem auto 0 auto;
    text-decoration: none;
    /* 🔑 FLUID PADDING: 20px 40px -> 1.25rem 2.5rem */
    padding: 1.25rem 2.5rem;
    
    color: #C13584;
    /* 🔑 FLUID FONT SIZE: 18px -> 1.125rem */
    font-size: 1.125rem;
    font-weight: bold;
    
    /* 🔑 FLUID BORDER: 8px -> 0.5rem */
    border: 2px solid #C13584; 
    border-radius: 0.5rem;
    background-color: transparent;
    transition: background-color 0.2s, color 0.2s;
}

.cta-outlined-button:hover {
    background-color: #C13584;
    color: white;
}