/* Portfolio Filters - Compact Layout */
.portfolio-filters {
    margin-bottom: 2rem;
    padding: 1rem 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.portfolio-filters .container {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

#sector-filters,
#tech-filters {
    margin: 0;
    align-items: flex-start;
}

#sector-filters ul,
#tech-filters ul {
    margin: 0;
    padding: 0;
    flex: 1;
}

.filter-group-label {
    flex-shrink: 0;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Responsive behavior for filter groups */
@media (max-width: 767px) {
    .portfolio-filters {
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem 0.75rem;
    }

    #sector-filters,
    #tech-filters {
        margin-bottom: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
    }

    #sector-filters ul,
    #tech-filters ul {
        width: 100%;
        justify-content: flex-start;
    }

    .filter-group-label {
        margin-bottom: 0.375rem;
    }
}

.filter-link {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background-color: #fff;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.filter-link:hover,
.filter-link.active {
    background-color: #007cba;
    color: #fff;
    border-color: #007cba;
}

/* Portfolio Grid Container */
.row.g-4 {
    margin-bottom: 1.5rem;
}

/* Equal Height Portfolio Cards */
.portfolio-item {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    contain: layout style;
}

.portfolio-item .portfolio-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background-color: #f5f5f5;
}

.portfolio-item .portfolio-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.portfolio-thumbnail {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.portfolio-thumbnail img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-thumbnail img {
    transform: scale(1.05);
}

/* Portfolio Content - Flex Grow for Equal Height */
.portfolio-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.portfolio-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.portfolio-content h3 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.portfolio-content h3 a:hover {
    color: #007cba;
}

.portfolio-content p {
    color: #666;
    margin: 0;
    line-height: 1.5;
    flex: 1 1 auto;
    margin-top: auto;
}

/* Load More Button (match blog listing UI) */
#load-more-portfolio,
.load-more-posts {
    display: inline-block !important;
    padding: 0.75rem 2rem !important;
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #fff !important;
    background-color: #007cba !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
}

#load-more-portfolio:hover,
.load-more-posts:hover {
    background-color: #005a87 !important;
}

#load-more-portfolio:disabled,
.load-more-posts:disabled {
    background-color: #ccc !important;
    cursor: not-allowed !important;
}

.loading-indicator {
    text-align: center;
    padding: 2rem;
    font-size: 1.1rem;
    color: #666;
}

/* Portfolio Single View Styles */
.portfolio-single-header {
    margin-bottom: 2rem;
}

.portfolio-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.portfolio-sectors,
.portfolio-technologies {
    flex: 1;
    min-width: 200px;
}

.meta-label {
    font-weight: 600;
    color: #333;
    margin-right: 0.5rem;
}

.meta-value {
    color: #666;
    margin-right: 0.25rem;
}

.portfolio-featured-image {
    margin-bottom: 2rem;
    text-align: center;
}

.portfolio-featured-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.portfolio-content {
    line-height: 1.7;
    color: #555;
}

.portfolio-content h2,
.portfolio-content h3,
.portfolio-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.portfolio-content p {
    margin-bottom: 1.5rem;
}

.portfolio-content ul,
.portfolio-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.portfolio-content li {
    margin-bottom: 0.5rem;
}

/* Portfolio Single View Media Styles */
.portfolio-client,
.portfolio-url {
    flex: 1;
    min-width: 200px;
}

.portfolio-url .meta-value {
    color: #007cba;
    text-decoration: none;
}

.portfolio-url .meta-value:hover {
    text-decoration: underline;
}

/* Portfolio Media Content */
.portfolio-video {
    margin-bottom: 2rem;
    text-align: center;
}

.portfolio-video iframe,
.portfolio-video video,
.portfolio-video embed {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.portfolio-gallery {
    margin-bottom: 2rem;
    position: relative;
}

.portfolio-gallery-slider {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.gallery-item {
    display: none;
    position: relative;
}

.gallery-item:first-child {
    display: block;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    gap: 1rem;
}

.gallery-prev,
.gallery-next {
    flex: 1;
    padding: 0.75rem 1rem;
    background-color: #007cba;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 0.9rem;
}

.gallery-prev:hover,
.gallery-next:hover {
    background-color: #005a87;
}

.gallery-prev:disabled,
.gallery-next:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}