/* ============================================
   PIQUE INSTAGRAM WIDGET - RESPONSIVE
   ============================================ */

/* Contenedor principal */
.pique-instagram-widget {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.pique-instagram-container {
    width: 100%;
    max-width: 100%;
}

/* Grid base - adaptable automáticamente */
.pique-instagram-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
    margin-bottom: 1em;
}

/* Items del grid */
.pique-instagram-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.pique-instagram-item a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none !important;
    border: none !important;
}

.pique-instagram-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.pique-instagram-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.pique-instagram-item:hover img {
    transform: scale(1.1);
}

/* Overlay */
.pique-instagram-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pique-instagram-item:hover .pique-instagram-overlay {
    opacity: 1;
}

.pique-instagram-overlay::before {
    content: '\f16d';
    font-family: 'Font Awesome 5 Brands', 'dashicons';
    font-size: 20px;
    color: white;
}

/* ============================================
   SIDEBAR ESPECÍFICO (Barra lateral estrecha)
   ============================================ */

/* Detecta cuando está en sidebar por el ancho del contenedor */
.widget-area .pique-instagram-grid,
.sidebar .pique-instagram-grid,
#secondary .pique-instagram-grid,
aside .pique-instagram-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

/* Para sidebars muy estrechos (menos de 300px) */
@media (max-width: 350px) {
    .pique-instagram-grid,
    .widget-area .pique-instagram-grid,
    .sidebar .pique-instagram-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3px;
    }
    
    .pique-instagram-item {
        border-radius: 4px;
    }
}

/* ============================================
   FOOTER Y ÁREAS AMPLIAS
   ============================================ */

/* En footer o áreas anchas, más columnas */
.site-footer .pique-instagram-grid,
.footer-widget-area .pique-instagram-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

/* ============================================
   BOTÓN SEGUIR
   ============================================ */

.pique-instagram-follow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white !important;
    text-decoration: none !important;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
}

.pique-instagram-follow:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 39, 67, 0.3);
    color: white !important;
}

.pique-instagram-follow .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ============================================
   ESTADOS Y MENSAJES
   ============================================ */

.pique-instagram-loading,
.pique-instagram-error,
.pique-instagram-success,
.pique-instagram-notice {
    grid-column: 1 / -1;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
}

.pique-instagram-loading {
    background: #f8f9fa;
    color: #666;
}

.pique-instagram-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.pique-instagram-success {
    background: #d4edda;
    color: #155724;
}

.pique-instagram-notice {
    background: #fff3cd;
    color: #856404;
    font-size: 11px;
    padding: 8px;
    margin-top: 8px;
}

/* ============================================
   ANIMACIONES
   ============================================ */

@keyframes piqueFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pique-instagram-item {
    animation: piqueFadeIn 0.4s ease forwards;
}

/* ============================================
   ADMIN - Estado del token
   ============================================ */

.pique-token-status {
    padding: 8px 12px;
    margin: 8px 0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.token-valid {
    background: #d4edda;
    color: #155724;
    border-left: 3px solid #28a745;
}

.token-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 3px solid #ffc107;
}

.token-expired {
    background: #f8d7da;
    color: #721c24;
    border-left: 3px solid #dc3545;
}

.token-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 3px solid #dc3545;
}

.pique-token-history {
    font-size: 11px;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}