/**
 * Portfolio Grid Styles
 */

/* Widget Container - ensure 100% width */
.elementor-widget-dm_portfolio_grid {
    width: 100% !important;
}

.elementor-widget-dm_portfolio_grid .elementor-widget-container {
    width: 100% !important;
}

/* Grid Container */
.dm-portfolio-grid {
    display: grid;
    width: 100%;
}

/* Grid Item */
.dm-portfolio-item {
    position: relative;
    /* overflow: hidden; REMOVED - was clipping focus outline */
    border-radius: 12px;
    aspect-ratio: 4/3;
    transition: all 0.3s ease;
}

/* Link Wrapper */
.dm-portfolio-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
    overflow: hidden;
    /* Clip scaled image on hover */
    border-radius: 12px;
    /* Match item border radius */
}

/* Image */
.dm-portfolio-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
    overflow: hidden;
    /* Clip image to rounded corners */
    border-radius: 12px;
    /* Match card border radius */
}

.dm-portfolio-link:hover .dm-portfolio-image {
    transform: scale(1.05);
}

/* Overlay */
.dm-portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background controlled by Elementor */
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.dm-portfolio-link:hover .dm-portfolio-overlay {
    opacity: 1;
}

/* Category Label */
.dm-portfolio-category {
    display: inline-block;
    /* background and color controlled by Elementor */
    padding: 0;
    border-radius: 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

/* Title */
.dm-portfolio-title {
    /* color controlled by Elementor */
    font-size: 24px;
    font-weight: 600;
    text-align: left;
    margin: 0;
    padding: 0;
    line-height: 1.3;
    word-break: break-word;
}

/* Magnifying Glass Icon */
.dm-portfolio-icon {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    /* background controlled by Elementor */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Icon center preset */
.dm-portfolio-link .dm-portfolio-icon-center {
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%) !important;
    opacity: 0;
}

.dm-portfolio-link:hover .dm-portfolio-icon-center {
    opacity: 1;
    transform: translate(-50%, -50%) !important;
}

.dm-portfolio-link:hover .dm-portfolio-icon {
    opacity: 1;
}

.dm-portfolio-link:hover .dm-portfolio-icon:not(.dm-portfolio-icon-center) {
    transform: scale(1);
}

.dm-portfolio-icon svg {
    width: 28px;
    height: 28px;
    /* fill controlled by Elementor */
}

/* Filters */
.dm-portfolio-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.dm-portfolio-filter-btn {
    /* background, border, color controlled by Elementor */
    padding: 12px 28px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    /* Focus managed by global WCAG settings */
}

/* Hover and active states controlled by Elementor */

/* Heading */
.dm-portfolio-heading {
    margin-bottom: 30px;
}

/* Empty State */
.dm-portfolio-empty {
    text-align: center;
    padding: 40px;
    color: #999;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}