/*
  Page-specific stylesheet for the Showcase page
  Version: 2.5 - "The Final Spectrum Gallery"
*/

/* --- 1. Hero & Final CTA Sections --- */
.page-hero,
.final-cta-section {
    background-image: linear-gradient(rgba(0, 0, 0, .5), rgba(0, 0, 0, .5)), url(../images/backgrounds/bg-showcase-main.jpg);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* --- 2. Filter Section --- */
.filter-section {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--color-border);
    position: -webkit-sticky;
    position: sticky;
    top: var(--header-height);
    z-index: 900;
    background-color: rgba(248, 249, 250, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: padding 0.4s ease;
}

.filter-section.is-collapsed {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.filter-section .section-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.filter-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.toggle-filters-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-primary);
    font-weight: 500;
    padding: 0.5rem;
}

.toggle-filters-btn .chevron-icon {
    transition: transform 0.3s ease;
}

.collapsible-filters {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: all 0.4s ease-out;
    max-height: 500px;
    overflow: hidden;
    max-width: 1130px;
    margin: 0 auto;
    /* padding-top: 5px; */
    /* ★ ADD THIS LINE ★ */
}

.filter-section.is-collapsed .collapsible-filters {
    max-height: 0;
    opacity: 0;
    visibility: hidden;
}

.filter-section.is-collapsed .toggle-filters-btn .chevron-icon {
    transform: rotate(180deg);
}

.filter-group {
    display: grid;
    grid-template-columns: max-content 1fr;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 15px;
    padding-top: 10px;
}

.filter-label {
    font-weight: 600;
    color: var(--color-dark);
    flex-shrink: 0;
    text-align: right;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    background-color: var(--color-light);
    color: var(--color-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

.filter-btn.is-active {
    background-color: var(--color-primary);
    color: var(--color-light);
    border-color: var(--color-primary);
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.15);
}

/* --- 3. ★ REBUILT: "Spectrum-Style" Projects Grid ★ --- */
.projects-grid-section {
    padding: var(--section-padding);
    background-color: var(--color-light);
    /* ★ ADDED: Set section background to white ★ */
}

.projects-grid {
    display: grid;
    /* ★ MODIFIED: Two columns for the new layout */
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: 1fr 1fr;
    }
}


.project-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    background-color: var(--color-light-grey);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

.project-card-image {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-card:hover .project-card-image img {
    transform: scale(1.05);
}

.project-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ★ ADDED: Alternating layout logic ★ */
.projects-grid .project-card:nth-child(4n - 2),
.projects-grid .project-card:nth-child(4n - 1) {
    flex-direction: row-reverse;
}

@media (max-width: 768px) {

    .project-card,
    .projects-grid .project-card:nth-child(4n - 2),
    .projects-grid .project-card:nth-child(4n - 1) {
        flex-direction: column;
    }

    .project-card-image {
        width: 100%;
    }
}

.project-card-tech {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-secondary);
    margin-bottom: 0.5rem;
}

.project-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    /* ★ ADDED: Ensure title area has a consistent minimum height (handles 1 vs 2 lines) ★ */
    min-height: 2.6em;
    /* 1.3 * 2 lines */
}

.project-card-excerpt {
    font-size: 1rem;
    color: var(--color-secondary);
    line-height: 1.6;
    /* ★ ADDED: The complete line-clamp solution ★ */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* Allow up to 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-clamp: 3;
    /* The standard property */
}

/* --- 4. Load More & Final CTA --- */
.load-more-container {
    padding-top: 4rem;
    text-align: center;
}

.load-more-container .cta-button {
    min-width: 250px;
}