/* Logo Gallery Block – assets/css/gallery.css */

.lg-wrap {
    font-family: -apple-system, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.lg-heading {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #6e6e73;
    margin: 0 0 20px;
}

/* Grid */
.lg-grid {
    width: 100%;
}

/* Card */
.lg-card {
    background: #ffffff;
    border: 0.5px solid rgba(0, 0, 0, .1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    transition: border-color .15s ease;
    min-height: 80px;
}

.lg-card:hover {
    border-color: rgba(0, 0, 0, .2);
}

/* Link wrapper: fills the whole card */
.lg-card-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    border-radius: inherit;
}

.lg-card-link:hover img {
    opacity: .85;
}

/* Logo image */
.lg-card img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    transition: opacity .15s ease;
}

/* Optional name label */
.lg-name {
    font-size: 12px;
    color: #6e6e73;
    text-align: center;
    line-height: 1.3;
    word-break: break-word;
}

/* Empty state */
.lg-empty {
    font-size: 14px;
    color: #6e6e73;
    padding: 24px 0;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .lg-card {
        background: #1c1c1e;
        border-color: rgba(255, 255, 255, .1);
    }
    .lg-card:hover {
        border-color: rgba(255, 255, 255, .22);
    }
    .lg-card img {
        filter: brightness(.9);
    }
    .lg-name,
    .lg-heading {
        color: #a1a1a6;
    }
}

/* Editor: highlight selected block */
.wp-block-logo-gallery-gallery.is-selected .lg-grid {
    outline: 2px dashed rgba(0, 113, 227, .35);
    outline-offset: 6px;
    border-radius: 4px;
}

/* ── Responsive ── */

/* Tablet */
@media (max-width: 768px) {
    .lg-card img {
        /* auto-fill already reduces columns; just ensure logos don't overflow */
        max-width: 100%;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .lg-grid {
        /* auto-fill fallback: never fewer than 2 columns unless only 1 logo */
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    .lg-card {
        /* slightly less padding on small screens for auto-fill layouts */
        padding: max(12px, min(var(--lg-pad, 24px), 16px));
    }
}
