/**
 * Social GL — estilos del frontend.
 * Las variables --sgl-* las inyecta el render según la configuración.
 */

.socialgl-app {
    background: var(--sgl-bg, #f5f5f5);
    color: var(--sgl-text, #333);
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
}

/* En la plantilla lienzo, quitar márgenes del body. */
.socialgl-canvas-page {
    margin: 0;
    padding: 0;
}

.socialgl-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

/* ----- Logo + palomita ----- */
.socialgl-logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 10px;
}

.socialgl-logo {
    max-width: 200px;
    height: auto;
}

.socialgl-verified-badge {
    position: absolute;
    bottom: 0;
    right: -4px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 0 4px rgba(0, 0, 0, .2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.socialgl-verified-badge img {
    width: 100%;
    height: 100%;
    display: block;
}

/* ----- Descripción ----- */
.socialgl-description {
    margin: 0 auto 20px;
    max-width: 600px;
    font-size: 1.1em;
    line-height: 1.5;
}

/* ----- Redes sociales ----- */
.socialgl-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.socialgl-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.socialgl-links img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

/* ----- Categorías ----- */
.socialgl-categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.socialgl-categories button {
    padding: 8px 16px;
    border: none;
    background: #eee;
    color: #333;
    cursor: pointer;
    border-radius: 20px;
    transition: background-color .3s, color .3s;
}

.socialgl-categories button.active,
.socialgl-categories button:hover {
    background: #333;
    color: #fff;
}

/* ----- Cuadrícula ----- */
.socialgl-image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.grid-item {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.square-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* relación 1:1 */
    overflow: hidden;
}

.square-wrapper img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--sgl-radius, 0);
    border: var(--sgl-border-thickness, 0) solid var(--sgl-border-color, transparent);
    transition: transform .4s ease, box-shadow .4s ease;
}

.square-wrapper.effect-hover:hover img {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 0, 0, .3);
}

/* ----- Estados ----- */
.socialgl-loading,
.socialgl-no-more,
.socialgl-empty {
    margin: 24px 0;
    opacity: .7;
}

/* ----- Botones flotantes de compartir ----- */
.socialgl-share-buttons {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 9999;
}

.socialgl-share-buttons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: #333;
    color: #fff;
    border-radius: 50%;
    text-decoration: none;
    transition: background-color .3s, transform .2s;
}

.socialgl-share-buttons a:hover {
    background: #555;
    transform: scale(1.1);
}

/* ----- Responsive ----- */
@media (max-width: 1024px) {
    .socialgl-image-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .socialgl-image-grid { grid-template-columns: 1fr; }
    .socialgl-share-buttons { bottom: 10px; }
}

/* Diseño no responsive: 3 columnas fijas. */
body.socialgl-no-responsive .socialgl-image-grid {
    grid-template-columns: repeat(3, 1fr);
}
