/**
 * Voces Block Styles (Testimonios)
 * Grid de celebrities y comunidad con videos
 * Based on Figma design: node 971-20509
 */

/* ==========================================================================
   Section Container
   ========================================================================== */

.voces-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 50px 64px 70px;
    background-color: #333;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

/* Container interno */
.voces-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    width: 100%;
    max-width: 1024px;
}

/* ==========================================================================
   Header Section
   ========================================================================== */

.voces-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.voces-titles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.voces-title {
    margin: 0;
    font-family: var(--font-family-primary, 'Inter', sans-serif);
    font-size: 36px;
    font-weight: 700;
    line-height: 1.21;
    text-align: center;
    color: #FFFFFF;
}

.voces-subtitle {
    margin: 0;
    font-family: var(--font-family-primary, 'Inter', sans-serif);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.21;
    text-align: center;
    color: #F4F4F4;
}

.voces-description {
    margin: 0;
    font-family: var(--font-family-primary, 'Inter', sans-serif);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.21;
    text-align: center;
    color: #F4F4F4;
    max-width: 600px;
}

/* ==========================================================================
   Grid de Celebrities
   ========================================================================== */

.voces-grid {
    display: grid;
    width: 100%;
}

.voces-celebrities-grid {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: 633px;
    gap: 16px;
}

/* Bento Layout según Figma */
/* Item 1: Arriba izquierda (ocupa 2 columnas) */
.voces-celebrities-grid .voces-celebrity-item:nth-child(1) {
    grid-column: 1 / 3;
    grid-row: 1;
}

/* Item 2: Abajo centro */
.voces-celebrities-grid .voces-celebrity-item:nth-child(2) {
    grid-column: 2;
    grid-row: 2;
}

/* Item 3: Derecha (ocupa 2 filas) */
.voces-celebrities-grid .voces-celebrity-item:nth-child(3) {
    grid-column: 3;
    grid-row: 1 / 3;
}

/* Item 4: Abajo izquierda */
.voces-celebrities-grid .voces-celebrity-item:nth-child(4) {
    grid-column: 1;
    grid-row: 2;
}

/* Grid Item */
.voces-grid-item {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background-color: #333333;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.voces-grid-item:hover {
    transform: scale(1.02);
}

.voces-grid-item:focus {
    outline: 2px solid #FFFFFF;
    outline-offset: 2px;
}

/* Item Overlay */
.voces-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 1;
    transition: background-color 0.3s ease;
}

.voces-grid-item:hover .voces-item-overlay {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Play Button - Celebrities (fondo blanco, icono gris) */
.voces-play-btn {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 56px;
    height: 56px;
    padding: 0;
    background-color: #FFFFFF;
    border: none;
    border-radius: 50%;
    color: #333333;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.voces-play-btn:hover {
    background-color: #F4F4F4;
    transform: scale(1.1);
}

.voces-play-btn svg {
    width: 24px;
    height: 24px;
}

/* Item Title */
.voces-item-title {
    position: relative;
    z-index: 2;
    font-family: var(--font-family-primary, 'Inter', sans-serif);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.21;
    text-align: center;
    color: #FFFFFF;
}

/* ==========================================================================
   Tooltip
   ========================================================================== */

.voces-grid-item {
    position: relative;
}

.voces-tooltip {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 10;
    padding: 4px 8px;
    background-color: rgba(244, 244, 244, 0.2);
    border: 1px solid #787878;
    border-radius: 40px;
    font-family: var(--font-family-primary, 'Inter', sans-serif);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.21;
    text-align: center;
    color: #FFFFFF;
    white-space: nowrap;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
}


@media (max-width: 1140px) { 
    .voces-tooltip {
        padding: 4px 12px;
        font-size: 11px;
    }
}

@media (max-width: 992px) { 
    .voces-tooltip {
        padding: 4px 12px;
        font-size: 10px;
    }
}

/* ==========================================================================
   No Video State
   ========================================================================== */

.voces-no-video {
    cursor: default;
}

.voces-no-video:hover {
    transform: none;
}


/* ==========================================================================
   Community Section
   ========================================================================== */

.voces-community-label {
    margin: 0;
    font-family: var(--font-family-primary, 'Inter', sans-serif);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.21;
    text-align: center;
    color: #F4F4F4;
}

.voces-community-video {
    width: 100%;
    max-width: 1000px;
}

.voces-community-item {
    width: 100%;
    height: 562.5px;
    border-radius: 16px;
    box-shadow: 0px 14px 24px rgba(0, 0, 0, 0.12);
}

/* Play button grande para comunidad */
.voces-play-btn-large {
    width: 48px;
    height: 48px;
    border: 1px solid #787878;
    background-color: #FFFFFF;
    color: #333333;
}

.voces-play-btn-large:hover {
    background-color: #F4F4F4;
}

.voces-play-btn-large svg {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   CTA Button
   ========================================================================== */

.voces-cta {
    display: flex;
    justify-content: center;
}

.voces-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-family: var(--font-family-primary, 'Inter', sans-serif);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.21;
    text-decoration: none;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.voces-btn-secondary {
    background-color: #FFFFFF;
    border: 1px solid #787878;
    color: #333333;
}

.voces-btn-secondary:hover {
    background-color: #F4F4F4;
    border-color: #333333;
}

/* ==========================================================================
   Video Modal
   ========================================================================== */

.voces-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.voces-modal[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.voces-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.voces-modal-content {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
    background-color: #000000;
    border-radius: 8px;
    overflow: hidden;
}

.voces-modal-close {
    position: absolute;
    top: -48px;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background-color: transparent;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    transition: color 0.3s ease;
}

.voces-modal-close:hover {
    color: #F4F4F4;
}

.voces-modal-video {
    width: 100%;
    height: 100%;
}

.voces-modal-video iframe,
.voces-modal-video video {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .voces-section {
        padding: 40px 32px 50px;
        gap: 32px;
    }

    .voces-container {
        gap: 32px;
    }

    .voces-title {
        font-size: 32px;
    }

    .voces-subtitle {
        font-size: 16px;
    }

    .voces-celebrities-grid {
        height: 500px;
    }

    .voces-community-item {
        height: 450px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .voces-section {
        padding: 32px 16px 40px;
        gap: 24px;
    }

    .voces-container {
        gap: 24px;
    }

    .voces-title {
        font-size: 28px;
    }

    .voces-subtitle {
        font-size: 14px;
    }

    .voces-description {
        font-size: 13px;
    }

    .voces-celebrities-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        height: auto;
        gap: 12px;
    }

    .voces-celebrities-grid .voces-celebrity-item:nth-child(1),
    .voces-celebrities-grid .voces-celebrity-item:nth-child(2),
    .voces-celebrities-grid .voces-celebrity-item:nth-child(3),
    .voces-celebrities-grid .voces-celebrity-item:nth-child(4) {
        grid-column: 1;
        grid-row: auto;
    }

    .voces-grid-item {
        min-height: 200px;
    }

    .voces-community-item {
        height: 280px;
    }

    .voces-play-btn {
        width: 48px;
        height: 48px;
    }

    .voces-play-btn svg {
        width: 20px;
        height: 20px;
    }

    .voces-community-label {
        font-size: 16px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .voces-section {
        padding: 24px 12px 32px;
    }

    .voces-title {
        font-size: 24px;
    }

    .voces-grid-item {
        min-height: 180px;
        padding: 16px;
    }

    .voces-community-item {
        height: 220px;
    }
}

/* ==========================================================================
   Editor Styles
   ========================================================================== */

.is-admin .voces-section,
.block-editor-block-list__block .voces-section {
    min-height: 400px;
}

.is-admin .voces-grid-item[style*="background-image"],
.block-editor-block-list__block .voces-grid-item[style*="background-image"] {
    background-color: #555555;
}
