/* ===============================
   CLEAN MASONRY GRID
================================ */
.masonry-gallery {
    column-count: 3;
    column-gap: 22px;
}

@media(max-width:1200px){
    .masonry-gallery { column-count: 3; }
}
@media(max-width:992px){
    .masonry-gallery { column-count: 2; }
}
@media(max-width:576px){
    .masonry-gallery { column-count: 1; }
}

/* Each Card */
.masonry-gallery .grid-item {
    width: 100%;
    display: inline-block;
    margin-bottom: 22px;
    position: relative;
    border-radius: 18px;
    overflow: hidden;

    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    -moz-column-break-inside: avoid;
}

/* ===============================
   IMAGE POLISH
================================ */
.protfolio__item-media img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 18px;
    transition: transform .45s ease, filter .35s ease;
}

.protfolio__item:hover img {
    transform: scale(1.06);
    filter: brightness(.9);
}

/* ===============================
   FORCE OVERRIDE THEME CSS
================================ */
.protfolio__item-text,
.gallery .protfolio__item-text {
    all: unset;
    position: absolute !important;
    inset: 0 !important;
    padding: 18px !important;
    display: flex !important;
    flex-direction: column;
    justify-content: flex-end;
    border-radius: 18px !important;

    background: linear-gradient(
        to top,
        rgba(0,0,0,.95),
        rgba(0,0,0,.50),
        rgba(0,0,0,0)
    );

    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease !important;
}

/* Show overlay */
.protfolio__item:hover .protfolio__item-text {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ===============================
   TEXT STYLES
================================ */
.price {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 10px;
    color: #fff !important;
}

.project-info {
    list-style: none;
    padding: 0;
    margin: 0;
    color: rgba(255,255,255,0.9);
    max-height: 45%;
    overflow-y: auto;
    padding-right: 6px;
}

.project-info li {
    font-size: 15px;
    line-height: 1.55;
    margin-bottom: 6px;
}

.project-info li strong {
    color: #fff;
}

/* Scrollbar Beauty */
.project-info::-webkit-scrollbar {
    width: 4px;
}
.project-info::-webkit-scrollbar-thumb {
    background: rgba(8, 8, 8, 0.4);
    border-radius: 10px;
}

/* ===============================
   FILTER ACTIVE COLOR
================================ */
.protfolio__tab button.active {
    color: #c9a36a;
}

/* ===============================
   POPUP IMAGE FIX
================================ */
.mfp-img {
    max-height: 90vh !important;
    width: auto !important;
    object-fit: contain !important;
}

.mfp-content {
    max-width: 95% !important;
}

img.mfp-img {
    display: block;
    margin: 0 auto;
}

.mfp-bg {
    opacity: .95 !important;
}

.mfp-close {
    top: 10px !important;
    right: 10px !important;
    opacity: 1 !important;
    color: white !important;
    font-size: 28px !important;
    z-index: 99999 !important;
}

/* ===============================
   MOBILE ALWAYS SHOW CAPTION
================================ */
/* @media(max-width:768px){
    .protfolio__item-text{
        opacity: 1 !important;
        visibility: visible !important;
    }
} */


/* ===============================
   OVERLAY BASE
================================ */
.gallery .protfolio__item-text{
    position:absolute !important;
    inset:0 !important;
    width:100% !important;
    height:100% !important;

    display:flex !important;
    flex-direction:column !important;
    justify-content:flex-end !important;

    padding:18px !important;
    box-sizing:border-box !important;
    border-radius:18px !important;

    background:linear-gradient(
        to top,
        rgba(0,0,0,.95),
        rgba(0,0,0,.6),
        rgba(0,0,0,0)
    ) !important;

    opacity:0 !important;
    visibility:hidden !important;
    transition:opacity .3s ease !important;
    z-index:5 !important;
}

/* Desktop hover */
@media (hover:hover){
    .gallery .protfolio__item:hover .protfolio__item-text{
        opacity:1 !important;
        visibility:visible !important;
    }
}

/* Mobile + Tablet default hidden */
@media (hover:none){
    .gallery .protfolio__item-text{
        opacity:0 !important;
        visibility:hidden !important;
    }
}


.gallery .protfolio__item-text.active{
    opacity:1 !important;
    visibility:visible !important;
}

