/* ===========================================
   Frontend Styles - Image Pins (Pinterest-style)
   =========================================== */

.image-pins-title {
    font-size: 1.8em;
    margin-bottom: 20px;
    font-weight: 700;
}

/* Grid container */
.image-pins-grid {
    display: block;
    column-count: 4;
    column-gap: 8px;
    margin: 0 auto;
    padding: 0;
}

.image-pins-columns-1 { column-count: 1; }
.image-pins-columns-2 { column-count: 2; }
.image-pins-columns-3 { column-count: 3; }
.image-pins-columns-4 { column-count: 4; }
.image-pins-columns-5 { column-count: 5; }
.image-pins-columns-6 { column-count: 6; }

/* Pin item */
.image-pins-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 8px;
    break-inside: avoid;
}

/* Card */
.image-pins-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-pins-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.image-pins-card img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: middle;
}

/* Overlay */
.image-pins-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    padding: 40px 12px 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-pins-card:hover .image-pins-overlay {
    opacity: 1;
}

.image-pins-caption {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Empty state */
.image-pins-empty {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 16px;
}

/* ===========================================
   Lightbox
   =========================================== */
.image-pins-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9998;
    cursor: pointer;
}

.image-pins-lightbox-overlay.active {
    display: block;
}

.image-pins-lightbox {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
}

.image-pins-lightbox.active {
    display: block;
}

.image-pins-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    z-index: 10000;
}

.image-pins-lightbox-content img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.image-pins-lightbox-caption {
    color: #fff;
    margin-top: 12px;
    font-size: 16px;
}

.image-pins-lightbox-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.image-pins-lightbox-prev,
.image-pins-lightbox-next {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 36px;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.image-pins-lightbox-prev:hover,
.image-pins-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ===========================================
   Responsive - respeita a configuracao do usuario
   =========================================== */

/* ===========================================
   Loading animation
   =========================================== */
.image-pins-loading {
    text-align: center;
    padding: 40px;
}

.image-pins-loading::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #eee;
    border-top-color: #e60023;
    border-radius: 50%;
    animation: image-pins-spin 0.8s linear infinite;
}

@keyframes image-pins-spin {
    to { transform: rotate(360deg); }
}