/**
 * CR Instagram Like Gallery - Public CSS
 */

.cril-gallery-wrapper {
    margin-bottom: 20px;
    box-sizing: border-box;
}

.cril-gallery-wrapper * {
    font-family: "cranach";
}

.cril-gallery-grid {
    column-count: 5; /* Default to 5 columns, adjust as needed */
    column-gap: 20px; /* Gap between columns */
    width: 100%; /* Ensure it takes full available width */
}

.cril-gallery-item {
    border: 1px solid #eee;
    position: relative;
    background-color: #f9f9f9;
    overflow: hidden; 
    box-sizing: border-box;
    display: flex; /* Kept for internal item layout */
    flex-direction: column; /* Kept for internal item layout */
    width: 100%; /* Ensure item takes full width of its column */
    margin-bottom: 20px; /* Vertical gap between items in the same column or next column */
    break-inside: avoid-column; /* Prevent items from breaking across columns */
}

.cril-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    font-size: 12px;
    text-align: center;
}


.cril-like-section {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

.cril-like-button {
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 16px;
    padding: 4px 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    line-height: 1;
    color: #555;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.cril-like-button:hover {
    background-color: #f8f8f8;
    border-color: #ccc;
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.12);
}
.cril-like-button:active {
    transform: scale(0.96);
    background-color: #f0f0f0;
}

.cril-like-button.liked {
    background-color: #ff8477;
    color: white;
    border-color: #e74c3c;
    box-shadow: 0 1px 3px rgba(231, 76, 60, 0.3);
}
.cril-like-button.liked:hover {
    box-shadow: 0 2px 5px rgba(192, 57, 43, 0.4);
}

.cril-icon-heart {
    font-size: 14px;
    line-height: 1;
}
.cril-icon-heart img {
    position: initial;
}

.cril-like-count {
    margin-left: 6px;
    font-weight: 600;
    font-size: 12px;
}

/* Styles for when like count is zero */
.cril-like-button.no-count .cril-icon-heart {
    margin-right: 0;
}

.cril-like-button.no-count .cril-like-count {
    display: none;
}

.cril-image-caption {
    padding: 8px 10px;
    font-size: 12px;
    color: #444;
    background-color: #fff;
    border-top: 1px solid #eee;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    margin-top: auto; /* Pushes caption to bottom if item flex direction is column */
}

.cril-like-button.cril-processing {
    opacity: 0.6;
    cursor: default;
}

.cril-info, .cril-error {
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
    border: 1px solid transparent;
}
.cril-info {
    background-color: #e7f3fe;
    border-color: #d0e3f0;
    color: #31708f;
}
.cril-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.cril-load-more-wrapper {
    margin-top: 60px;
}

.cril-load-more-button {
    cursor: pointer;
    background-color: #26211d;
    color: #fafafa;
    border: 1px solid #26211d;
    border-radius: 32px;
    padding: 10px 20px;
    font-size: 16px;
    width: 100%;
    transition: all .3s;
}
.cril-load-more-button:hover {
    background-color: #fff;
    color: #26211d;
}

@media (max-width: 1200px) {
    .cril-gallery-grid {
        column-count: 4;
        column-gap: 10px;
    }
    .cril-gallery-item {
        margin-bottom: 10px;
    }
}

@media (max-width: 768px) {
    .cril-gallery-grid {
        column-count: 2;
    }
}


