/* ===========================================
   BIO GALLERY — PINTEREST MASONRY GRID STYLE
   =========================================== */

.bio-gallery {
    position: relative;
    margin-top: 10px;
}

.bio-gallery-container {
    position: relative;
    padding: 12px 8px 4px;
    border-radius: 16px;
    background: radial-gradient(circle at top, rgba(255,255,255,0.06), rgba(0,0,0,0.7));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

/* Masonry wrapper */
.bio-gallery-images {
    column-count: 3;
    column-gap: 12px;
    max-height: none;
    overflow: visible;
    padding-right: 4px;
}

/* (Scrollbars no longer needed, but kept harmless) */
.bio-gallery-images::-webkit-scrollbar {
    width: 0;
}
.bio-gallery-images::-webkit-scrollbar-track {
    background: transparent;
}
.bio-gallery-images::-webkit-scrollbar-thumb {
    background: transparent;
}

/* Each tile */
.bio-gallery-image-wrapper {
    display: inline-block;
    width: 100%;
    margin: 0 0 12px;
    break-inside: avoid;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(145deg, #141820, #101319);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.bio-gallery-image-wrapper:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.7);
    filter: brightness(1.05);
}

.bio-gallery-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

/* Optional description strip */
.bio-gallery-image-description {
    padding: 8px 10px 10px;
    font-size: 0.85rem;
    color: #e0e0e0;
    background: radial-gradient(circle at top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.95));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Loading */
.bio-loading {
    padding: 30px;
    text-align: center;
    color: #aaa;
    font-style: italic;
    width: 100%;
}

/* Error */
.bio-gallery-error {
    padding: 20px;
    text-align: center;
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.1);
    border-radius: 6px;
    margin: 15px 0;
}

/* Navigation buttons — HIDDEN (not removed) */
.gallery-nav-button,
.bio-gallery-nav,
.bio-gallery-navigation {
    display: none !important;
}

/* Send-to-Chat button */
.send-to-chat-button {
    background-color: #1565C0;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    bottom: 12px;
    right: 16px;
    z-index: 101;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
    transition: all 0.2s ease;
}

.send-to-chat-button:hover {
    background-color: #0D47A1;
    transform: translateY(-1px) scale(1.03);
}

/* ===========================================
   IMAGE MODAL
   =========================================== */

.bio-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.bio-image-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.bio-image-modal-content {
    max-width: 90%;
    max-height: 80%;
    position: relative;
}

.bio-image-modal-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.bio-image-modal-description-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-top: 15px;
    width: 100%;
}

.bio-image-modal-description {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    line-height: 1.5;
    flex: 1;
    margin-right: 15px;
}

#modal-send-to-chat {
    background-color: #1565C0;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    align-self: flex-start;
    margin-top: 15px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

#modal-send-to-chat:hover {
    background-color: #0D47A1;
    transform: scale(1.05);
}

.bio-image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* ===========================================
   RESPONSIVE LAYOUT
   =========================================== */

@media (max-width: 1200px) {
    .bio-gallery-images {
        column-count: 2;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .bio-gallery-container {
        padding: 10px 6px;
    }

    .bio-gallery-images {
        column-count: 2;
        max-height: none;
    }
}

@media (max-width: 540px) {
    .bio-gallery-images {
        column-count: 1;
        max-height: none;
    }
}


/* Base caption styling */
.imageCaption {
    display: block;
    font-size: 11.5px;
    color: #e0e0e0;
    font-weight: 150;
    letter-spacing: 0.3px;
    margin-top: 3px;
    max-width: 420px;
    line-height: 1.3;
    opacity: 1;
    transform: translateY(2px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    padding-right: 8px;
}

/* Mobile: always visible (no hover on touch devices) */
@media (max-width: 480px) {
    .imageCaption {
        opacity: 1 !important;
        transform: none !important;
        text-align: center;
        max-width: 65%;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ===========================================
   COLLAPSE / EXPAND STATES
   =========================================== */

/* Collapsed: show only about one row of masonry tiles */
.bio-gallery-container.collapsed .bio-gallery-images {
    overflow: hidden;
}

/* Optional soft fade at the bottom when collapsed */
.bio-gallery-container.collapsed::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60px;
    background: linear-gradient(
        to bottom,
        rgba(8, 10, 18, 0) 0%,
        rgba(8, 10, 18, 0.9) 55%,
        rgba(8, 10, 18, 1) 100%
    );
    pointer-events: none;
}

/* Expanded: your original "show everything" behavior */
.bio-gallery-container.expanded .bio-gallery-images {
    max-height: none;
    overflow: visible;
}

/* Footer wrapper for the toggle button */
.bio-gallery-footer {
    margin-top: 8px;
    display: flex;
    justify-content: center;
}

/* Toggle button styling */
.bio-gallery-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: rgba(255, 255, 255, 1);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.bio-gallery-toggle:hover {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.bio-gallery-toggle i {
    font-size: 10px;
}

/* Mobile tweaks */
@media (max-width: 480px) {
    .bio-gallery-footer {
        justify-content: center;
    }

    .bio-gallery-toggle {
        font-size: 11px;
        padding: 5px 10px;
    }
}
