/* ─── Artwork Cards Importer — Frontend CSS v1.2 ─── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Grid ── */
.aci-grid {
    display: grid;
    grid-template-columns: repeat(var(--aci-cols, 3), 1fr);
    gap: 20px;
    margin-bottom: 48px;
}
@media (max-width: 900px) { .aci-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .aci-grid { grid-template-columns: 1fr; } }

/* ── Card — fondo gris como en Gutenberg ── */
.aci-card {
    background: #f0f0f0;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: box-shadow .25s ease;
}
.aci-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.15);
}

/* ── Contenido interno (padding lateral) ── */
.aci-card__inner {
    padding: 14px 14px 0;
}

/* ── Autor ── */
.aci-card__author {
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    margin: 0 0 8px;
    color: #111;
    line-height: 1.3;
}

/* ── Redes sociales del autor (centradas, debajo del nombre) ── */
.aci-author-socials {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
}

/* ── Imagen — ocupa todo el ancho de la card ── */
.aci-card__thumb {
    position: relative;
    width: 100%;
    /* Sin padding-top fijo: la imagen define su propia proporción */
    overflow: hidden;
    background: #ddd;
    cursor: zoom-in;
}
.aci-card__thumb img {
    display: block;
    width: 100%;
    height: auto;          /* respeta la proporción original */
    transition: transform .4s ease;
}
.aci-card:hover .aci-card__thumb img {
    transform: scale(1.03);
}
.aci-card__no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #aaa;
    font-size: 13px;
}

/* Overlay zoom */
.aci-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .22s ease;
}
.aci-card:hover .aci-card__overlay { opacity: 1; }
.aci-zoom-icon { color: #fff; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }

/* ── Caption: artwork_name + materials ── */
.aci-card__caption {
    padding: 10px 14px 0;
}
.aci-card__artwork {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 2px;
    color: #111;
    line-height: 1.3;
}
.aci-card__materials {
    font-size: 12px;
    font-weight: 400;
    color: #444;
    margin: 0;
    font-style: italic;
}

/* ── Redes sociales de la obra (derecha, "View online") ── */
.aci-artwork-socials-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 8px 14px 14px;
    margin-top: auto;
}
.aci-artwork-socials-label {
    font-size: 11px;
    color: #666;
    white-space: nowrap;
}
.aci-artwork-socials-icons {
    display: flex;
    gap: 4px;
}

/* ── Botones de iconos sociales ── */
.aci-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #000;
    transition: opacity .18s, transform .15s;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
}
.aci-social-btn svg {
    width: 20px;
    height: 20px;
    display: block;
    /* fill heredado de currentColor — NO sobreescribir aquí */
}
.aci-social-btn:hover {
    opacity: .55;
    transform: translateY(-1px);
    text-decoration: none;
}

/* ── Paginación ── */
.aci-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}
.aci-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all .2s;
}
.aci-page-btn:hover,
.aci-page-btn.active {
    background: #111;
    border-color: #111;
    color: #fff;
    text-decoration: none;
}

/* Vacío */
.aci-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #aaa;
    padding: 60px 0;
    font-size: 16px;
}

/* ═══════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════ */
.aci-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: aci-fade-in .2s ease;
}
.aci-lightbox[hidden] { display: none; }

@keyframes aci-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.aci-lb-close {
    position: absolute;
    top: 18px;
    right: 22px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    opacity: .7;
    transition: opacity .15s, transform .15s;
    padding: 0;
}
.aci-lb-close:hover { opacity: 1; transform: rotate(90deg); }

.aci-lb-inner {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    max-width: 960px;
    width: 100%;
    max-height: 90vh;
    animation: aci-pop-in .25s ease;
}
@keyframes aci-pop-in {
    from { opacity: 0; transform: scale(.96); }
    to   { opacity: 1; transform: scale(1); }
}
@media (max-width: 640px) {
    .aci-lb-inner { flex-direction: column; max-height: none; }
}

.aci-lb-img {
    flex: 1 1 0;
    max-width: 65%;
    max-height: 86vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0,0,0,.5);
    display: block;
}
@media (max-width: 640px) {
    .aci-lb-img { max-width: 100%; max-height: 50vh; }
}

/* Info en lightbox — mismo orden que la card */
.aci-lb-info {
    flex: 0 0 200px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
}
.aci-lb-author {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: #fff;
    text-align: center;
}
.aci-lb-author-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}
.aci-lb-name {
    font-size: 13px;
    font-weight: 700;
    margin: 0;
    color: #fff;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.15);
}
.aci-lb-materials {
    font-size: 12px;
    color: #bbb;
    margin: 0;
    font-style: italic;
}
.aci-lb-artwork-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,.12);
    align-items: center;
}
.aci-lb-view-label {
    font-size: 11px;
    color: #888;
}

/* Botones sociales en lightbox */
.aci-lb-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #fff;
    text-decoration: none;
    transition: opacity .18s;
    background: transparent;
}
.aci-lb-social svg { width: 18px; height: 18px; display: block; fill: currentColor; }
.aci-lb-social:hover { opacity: .6; color: #fff; text-decoration: none; }

/* ── Premios en la card ── */
.aci-card__awards {
    padding: 6px 14px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.aci-card__award-badge {
    display: inline-block;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    color: #856404;
}

/* ── Premios en el lightbox ── */
.aci-lb-awards {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}
.aci-lb-award-badge {
    display: inline-block;
    background: rgba(255, 193, 7, .2);
    border: 1px solid rgba(255, 193, 7, .5);
    border-radius: 4px;
    font-size: 11px;
    padding: 3px 8px;
    color: #ffc107;
}
