/**
 * Our Work Masonry Styles
 * Creates a beautiful block-based layout with fixed sizes using CSS Grid
 */

.owm-masonry-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.owm-masonry-grid {
    display: grid;
    grid-template-columns: repeat(2, auto); /* Default 2 columns, overridden by inline style */
    grid-auto-rows: auto;
    grid-auto-flow: dense;
    gap: 15px;
    justify-content: start;
    align-items: start;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
}

/* Ensure items take up exact space */
.owm-masonry-grid .owm-masonry-item {
    box-sizing: border-box;
}

/* Masonry Item Base Styles */
.owm-masonry-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.owm-masonry-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Size classes (sizes applied via inline styles) */
.owm-size-square {
    /* Square images: 350x350 by default */
}

.owm-size-tall {
    /* Tall images: 350x650 by default */
}

/* Grid row spanning for proper block pattern */
/* Position 2 and 3 (tall images) span 2 rows to create the offset pattern */

/* Position 1: Square (top-left) - single row */
.owm-pos-1 {
    /* Single row, auto placement */
}

/* Position 2: Tall (top-right) - spans 2 rows */
.owm-pos-2 {
    grid-row: span 2;
}

/* Position 3: Tall (bottom-left) - spans 2 rows */
.owm-pos-3 {
    grid-row: span 2;
}

/* Position 4: Square (bottom-right) - single row */
.owm-pos-4 {
    /* Single row, auto placement */
}

/* Item Link */
.owm-item-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Item Image Background */
.owm-item-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.owm-item-image.owm-no-image {
    background-color: #cccccc;
}

/* Overlay for title */
.owm-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 20px;
}

/* Title Wrapper - block element for positioning */
.owm-title-wrapper {
    margin: 0;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    display: block;
    max-width: 100%;
}

/* Title Styling - inline span for per-line backgrounds */
.owm-item-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.8;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #000000;
    display: inline;
    padding: 8px 12px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    transition: background-color 0.3s ease;
}

.owm-masonry-item:hover .owm-item-title {
    background-color: #1a1a1a;
}

/* Load More Button */
.owm-load-more-wrapper {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

.owm-load-more-btn {
    display: inline-block;
    padding: 15px 40px;
    background-color: #000000;
    color: #ffffff;
    border: none;
    border-radius: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.owm-load-more-btn:hover {
    background-color: #333333;
}

.owm-load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.owm-load-more-btn.loading::after {
    content: '...';
    animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* No Posts Message */
.owm-no-posts {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666666;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .owm-masonry-grid {
        justify-content: center;
    }
}

@media screen and (max-width: 768px) {
    .owm-masonry-grid {
        justify-content: center;
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .owm-masonry-grid {
        gap: 10px;
        justify-content: center;
        width: 100%;
    }
}

/* Loading animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.owm-masonry-item {
    animation: fadeIn 0.5s ease forwards;
}

.owm-masonry-item:nth-child(1) { animation-delay: 0.05s; }
.owm-masonry-item:nth-child(2) { animation-delay: 0.1s; }
.owm-masonry-item:nth-child(3) { animation-delay: 0.15s; }
.owm-masonry-item:nth-child(4) { animation-delay: 0.2s; }
.owm-masonry-item:nth-child(5) { animation-delay: 0.25s; }
.owm-masonry-item:nth-child(6) { animation-delay: 0.3s; }
.owm-masonry-item:nth-child(7) { animation-delay: 0.35s; }
.owm-masonry-item:nth-child(8) { animation-delay: 0.4s; }
