/**
 * FD Spotlight Gallery – Frontend Styles
 */

/* ---- Gallery Wrapper / Heading ---- */
.fdsg-gallery-output {
    display: grid;
    gap: 1rem;
}

.fdsg-gallery-header {
    display: grid;
    gap: 0.75rem;
}

.fdsg-gallery-heading {
    margin: 0;
}

.fdsg-gallery-description > :first-child {
    margin-top: 0;
}

.fdsg-gallery-description > :last-child {
    margin-bottom: 0;
}

/* ---- Thumbnail Grid ---- */
.fdsg-gallery-grid {
    --fdsg-columns: 4;
    --fdsg-row-gap: 8px;
    --fdsg-column-gap: 8px;
    --fdsg-thumb-min: 200px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, max(var(--fdsg-thumb-min), calc((100% - (var(--fdsg-columns) - 1) * var(--fdsg-column-gap)) / var(--fdsg-columns)))), 1fr));
    row-gap: var(--fdsg-row-gap);
    column-gap: var(--fdsg-column-gap);
    width: 100%;
}

@media (max-width: 1024px) {
    .fdsg-gallery-grid {
        --fdsg-thumb-min: 160px;
    }
}

@media (max-width: 640px) {
    .fdsg-gallery-grid {
        --fdsg-thumb-min: 140px;
    }
}

.fdsg-gallery-item {
    min-width: 0;
}

.fdsg-gallery-link {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 4px;
    line-height: 0;
}

.fdsg-gallery-more-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.fdsg-gallery-more-overlay-text {
    color: #fff;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.fdsg-gallery-link--hidden {
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.fdsg-gallery-grid a img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.fdsg-gallery-grid a:hover img {
    transform: scale(1.05);
    opacity: 0.85;
}

.fdsg-gallery-caption {
    margin-top: 8px;
    line-height: 1.4;
}

.fdsg-gallery-caption-title {
    font-weight: 600;
}

.fdsg-gallery-caption-description {
    margin-top: 4px;
    font-size: 0.9375rem;
}

.fdsg-gallery-caption-description p {
    line-height: normal;
}

.fdsg-gallery-caption-description > :first-child {
    margin-top: 0;
}

.fdsg-gallery-caption-description > :last-child {
    margin-bottom: 0;
}

/* ---- Gallery Button ---- */
.fdsg-gallery-button {
    display: inline-block;
    padding: 10px 24px;
    font-size: 1rem;
    line-height: 1.5;
    color: #fff;
    background-color: #0073aa;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.fdsg-gallery-button:hover {
    background-color: #005177;
}

.fdsg-gallery-button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

