/* === Galería Responsiva Cacheada - Frontend === */

.grc-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 30px 0;
    padding: 0;
    list-style: none;
}

.grc-gallery-item {
    margin: 0;
    padding: 0;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.grc-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.grc-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.grc-item-link:hover,
.grc-item-link:focus {
    color: inherit;
    outline: none;
}

.grc-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f0f0f0;
}

.grc-image-wrapper .grc-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
    border: none;
    margin: 0;
    padding: 0;
}

.grc-gallery-item:hover .grc-image {
    transform: scale(1.08);
}

.grc-caption {
    padding: 16px;
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
}

.grc-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #2c3338;
    line-height: 1.5;
    margin: 0;
    padding: 15px;
    word-wrap: break-word;
}

@media (max-width: 1024px) {
    .grc-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .grc-caption {
        padding: 14px;
    }
}

@media (max-width: 640px) {
    .grc-gallery {
        grid-template-columns: 1fr;
        gap: 16px;
        margin: 20px 0;
    }
    
    .grc-caption {
        padding: 12px;
    }
    
    .grc-title {
        font-size: 14px;
    }
    
    .grc-image-wrapper .grc-image {
        max-height: 300px;
        object-fit: cover;
    }
}

@media (hover: none) and (pointer: coarse) {
    .grc-gallery-item:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    .grc-gallery-item:hover .grc-image {
        transform: none;
    }
}

@media (prefers-color-scheme: dark) {
    .grc-gallery-item {
        background: #1e1e1e;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }
    
    .grc-caption {
        background: #1e1e1e;
        border-top: 1px solid #333;
    }
    
    .grc-title {
        color: #e0e0e0;
    }
    
    .grc-image-wrapper {
        background: #0a0a0a;
    }
    
    .grc-gallery-item:hover {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
    }
}

.grc-item-link:focus-visible {
    outline: 3px solid #2271b1;
    outline-offset: 3px;
    border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
    .grc-gallery-item,
    .grc-image {
        transition: none;
        transform: none;
    }
}

.grc-error {
    padding: 16px 20px;
    background: #fcf0f1;
    border-left: 4px solid #d63638;
    border-radius: 4px;
    color: #50575e;
    margin: 20px 0;
    font-size: 14px;
}

.entry-content .grc-gallery,
.post-content .grc-gallery,
.wp-block-group .grc-gallery,
article .grc-gallery {
    margin: 30px 0;
}

.grc-gallery,
.grc-gallery * {
    box-sizing: border-box;
}

.grc-gallery img {
    max-width: 100%;
    height: auto;
    border: none;
    box-shadow: none;
}

.grc-gallery a {
    text-decoration: none;
    color: inherit;
    border: none;
    box-shadow: none;
}

.grc-gallery a:hover,
.grc-gallery a:focus {
    color: inherit;
    border: none;
    box-shadow: none;
}

.grc-gallery figure {
    margin: 0;
    padding: 0;
}

.grc-gallery figcaption {
    margin: 0;
    padding: 0;
}