/* ==== Justified Layout ==== */
.petruth-justified {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 15px;
}

.petruth-justified .petruth-item {
    width: 100%;
    margin-bottom: 50px;
    text-align: center;
}

.petruth-justified .petruth-item-inner {
    display: inline-block;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
    text-align: left;
    max-width: 100%;
}

.petruth-justified .petruth-list-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

.petruth-justified .petruth-content {
    padding: 15px;
    max-width: 700px;
    margin: 0 auto;
}


/* ==== List Layout ==== */
.petruth-list {
    display: flex;
    flex-direction: column;
    padding: 30px 15px;
}

.petruth-list-item {
    width: 100%;
    margin-bottom: 30px;
    box-sizing: border-box;
}

.petruth-list-item-inner {
    display: flex;
    gap: 20px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.petruth-list-image {
    flex: 0 0 40%;
    max-width: 40%;
}
.petruth-list-image img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    max-height: 200px;
}

.petruth-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 1024px) {
    .petruth-list-image {
        flex: 0 0 35%;
    }
}
@media (max-width: 767px) {
    .petruth-list-item-inner {
        flex-direction: column;
    }
    .petruth-list-image,
    .petruth-content {
        flex: 0 0 100%;
        max-width: 100%;
    }
}


/* ==== Grid Layout ==== */
.petruth-container.petruth-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 30px 15px;
}

.petruth-grid-item-inner {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.petruth-grid-item-inner:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.petruth-grid-image {
    position: relative;
    overflow: hidden;
}

.petruth-grid-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}



/* Masonry container */

.petruth-masonry-container {
    padding: 30px 15px;
}

/* Masonry grid handled by JS */
.petruth-masonry-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -15px; /* match gutter */
}

.petruth-masonry-item {
    width: calc(25% - 30px); /* 4 columns, adjust with gutter */
    margin: 15px;
}

@media (max-width: 1024px) {
    .petruth-masonry-item {
        width: calc(50% - 30px); /* 2 columns */
    }
}

@media (max-width: 600px) {
    .petruth-masonry-item {
        width: 100%;
        margin: 15px 0;
    }
}


/* Inner card */
.petruth-masonry-item-inner {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
}
.petruth-masonry-item-inner:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Image wrapper */
.petruth-masonry-image {
    position: relative;
    overflow: hidden;
}
.petruth-masonry-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Overlay */
.petruth-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.65);
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
    padding: 20px;
    text-align: center;
    z-index: 2;
}
.petruth-masonry-image:hover .petruth-overlay {
    opacity: 1;
}
.petruth-overlay-content {
    color: #fff;
    max-width: 90%;
}



/* ==== Overlay ==== */
/* Add this to ensure overlay is constrained to the image wrapper */
.petruth-grid-image,
.petruth-list-image,
.petruth-image {
    position: relative;
    overflow: hidden;
}

/* Fix overlay hover triggers */
.petruth-grid-image:hover .petruth-overlay,
.petruth-list-image:hover .petruth-overlay,
.petruth-image:hover .petruth-overlay {
    opacity: 1;
}

.petruth-grid-image img,
.petruth-list-image img,
.petruth-image img {
    transition: transform 0.3s ease;
}

.petruth-grid-image:hover img,
.petruth-list-image:hover img,
.petruth-image:hover img {
    transform: scale(1.05);
}

.petruth-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
    padding: 20px;
    text-align: center;
    z-index: 2;
}

.petruth-item:hover .petruth-overlay,
.petruth-grid-item:hover .petruth-overlay,
.petruth-list-item-inner:hover .petruth-overlay,
.petruth-masonry-item:hover .petruth-overlay {
    opacity: 1;
}

.petruth-overlay-content {
    color: #fff;
    max-width: 90%;
}

.petruth-overlay h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
}
.petruth-overlay h3 a {
    color: #fff;
    text-decoration: none;
}

.petruth-project-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: #fff;
    color: #333;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.3s ease;
}

.petruth-project-link:hover {
    background: #eee;
}


/* ==== Gallery ==== */
.petruth-project-gallery {
    margin-top: 2rem;
}
.petruth-project-gallery h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #222;
}
.petruth-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
.petruth-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}
.petruth-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.petruth-gallery-item:hover img {
    transform: scale(1.05);
    opacity: 0.9;
}


/* ==== Meta Details ==== */
.petruth-meta-details,
.petruth-meta-pro-details {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-left: 4px solid #0073aa;
    border-radius: 6px;
}
.petruth-meta-details p,
.petruth-meta-pro-details p {
    margin: 0 0 0.5rem 0;
    font-size: 16px;
}
