/* Project Filtering Plugin CSS - Version 5.2 */
.pfp-filter-container {
    position: relative;
    width: 100%;
    text-align: center;
}

.pfp-decade-menu {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    margin-bottom: 10px;
    white-space: nowrap;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    min-width: 0;
    padding: 0;
    background-color: #181818;
}

.pfp-decade {
    flex: 0 0 auto;
    margin: 0 5px;
    cursor: pointer;
    padding: 5px;
    width: 10%; /* As per your adjustment */
}

.pfp-decade p {
    font-weight: bold;
    color: #ffffff;
}

.pfp-decade.active {
    border-bottom: 2px solid #ff0000; /* Red underline for active decade */
}

.pfp-year-menu {
    display: inline-flex; /* Strong inline flex to prevent wrapping on desktop */
    justify-content: center;
    flex-wrap: nowrap;
    margin: 10px auto 0;
    clear: both;
    visibility: visible !important;
    width: 100%; /* Full width to enforce single line on desktop */
    max-width: 100%;
    min-width: 0; /* Allow shrinking to fit content */
    position: relative;
    overflow-x: auto; /* Ensure horizontal scrolling on desktop */
    white-space: nowrap;
    padding: 0;
    text-align: center;
    box-sizing: border-box; /* Include padding in width calculation */
    background-color: #303030; /* Updated background color */
}

.pfp-year {
    flex: 0 0 auto;
    margin: 0 2px;
    cursor: pointer;
    white-space: nowrap;
    padding: 5px;
    width: 8%; /* As per your adjustment */
}

.pfp-year p {
    font-weight: bold; /* Make text bold */
    color: #ffffff; /* Updated text color */
}

.pfp-year.active {
    color: #FAEB53; /* Active year text color */
}

.pfp-year-menu-inner {
    display: flex;
    flex-wrap: nowrap;
    width: auto;
    justify-content: center;
}

.pfp-year-menu > div {
    display: flex;
    justify-content: center;
}

.pfp-project-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
    overflow-x: auto; /* Enable horizontal scrolling for mobile */
}

.pfp-project {
    margin: 10px;
    opacity: 1;
    transition: opacity 0.3s ease;
    flex: 0 0 auto; /* Prevent shrinking */
    width: 100%; /* Full width for mobile */
}

.pfp-project-link h3 {
    color: #ffffff; /* White text for project titles */
}

/* Modified empty state to show message */
.pfp-project-grid.empty {
    opacity: 1; /* Ensure visibility */
    display: flex; /* Maintain flex context */
    justify-content: center; /* Center the message */
    align-items: center; /* Vertically center the message */
    min-height: 100px; /* Add some height to make it noticeable */
}

.pfp-project-grid.empty p {
    margin: 0; /* Remove default margin on paragraph */
    padding: 10px; /* Add padding for better presentation */
    font-size: 16px; /* Ensure readable text size */
}

/* Desktop (min-width: 1201px) - 6 projects across */
@media (min-width: 1201px) {
    .pfp-project {
        width: calc(16.666% - 20px); /* 100% / 6 - adjusted for margin */
        max-width: calc(16.666% - 20px);
    }
}

/* Tablets and smaller laptops (min-width: 769px and max-width: 1200px) - 3 projects across */
@media (min-width: 769px) and (max-width: 1200px) {
    .pfp-decade-menu,
    .pfp-year-menu {
        flex-wrap: nowrap;
    }
    .pfp-decade-menu {
        width: 80%;
        margin-left: auto;
        margin-right: auto;
    }
    .pfp-year-menu {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-top: 10px;
    }
    .pfp-project {
        width: calc(33.333% - 20px); /* 100% / 3 - adjusted for margin */
        max-width: calc(33.333% - 20px);
    }
}

/* Mobile adjustments (up to 768px) */
@media (max-width: 768px) {
    .pfp-year-menu {
        flex-wrap: wrap; /* Allow wrapping to two rows */
        justify-content: center;
        overflow-x: hidden; /* Disable horizontal scrolling on mobile */
        width: 90%; /* Slightly narrower to fit content better */
        margin-left: auto;
        margin-right: auto;
    }

    .pfp-year {
        flex-basis: 45%; /* Approximately half width for two items per row */
        margin: 0 5px 10px; /* Increased horizontal and vertical spacing */
        padding: 8px; /* Increased padding for readability */
        width: auto; /* Let flex-basis control width */
        box-sizing: border-box; /* Ensure padding is included in width */
    }

    .pfp-modal-content {
        padding: 10px; /* Reduced padding for mobile modal */
        max-width: 95%; /* Adjusted to 95% of phone screen width */
        max-height: 85vh; /* Adjusted for smaller screens */
    }

    .pfp-project {
        width: 100%; /* Single column with thumb scrolling */
        margin: 5px 0; /* Reduced vertical margin for mobile */
    }
}

/* Tablet and desktop (above 768px) */
@media (min-width: 769px) {
    .pfp-modal-content {
        padding: 20px; /* Restore original padding for tablets and desktop */
        max-width: 80%;
    }
}

.pfp-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.pfp-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    max-width: 80%;
    max-height: 80vh; /* Use viewport height for scrolling */
    overflow-y: auto; /* Enable vertical scrolling */
    box-sizing: border-box;
}

.pfp-close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 20px;
}

.pfp-modal-content h2 {
    margin-top: 0;
}

.pfp-modal-content img {
    max-width: 100%;
    height: auto;
}

.pfp-modal-content p {
    margin: 10px 0;
}