/* =====================================
   OPINION SECTION WIDGET STYLES
   =====================================
*/

.opinion-section {
    width: 100%;
    margin: 20px 0;
    padding: 0 15px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: #000;
    margin: 0 0 25px 0;
    padding-top: 10px;
    border-top: 4px solid #E30613;
    display: inline-block;
}

.opinion-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Tarjeta individual */
.opinion-card {
    background-color: #ffffff;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* CLAVE: Definimos la tarjeta como un contenedor flexible vertical */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Empuja el contenido al inicio y el autor al final (aunque aquí solo afecta al contenido interno) */
}

.opinion-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Contenido de texto (MODIFICADO) */
.card-content {
    padding: 15px;
    padding-bottom: 20px;

    /* CLAVE: Usamos flexbox para gestionar el espacio interno */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-tag {
    background-color: #E30613;
    color: #ffffff;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 12px;
    text-transform: uppercase;
}

/* Titular (MODIFICADO: CRECE PARA EMPUJAR AL AUTOR) */
.card-headline {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.3;

    /* CLAVE: Esto fuerza al titular a ocupar todo el espacio vertical disponible */
    flex-grow: 1;
    /* Añadimos un margen inferior para que no choque con el autor */
    margin-bottom: 20px;
}

.card-headline a {
    color: #111;
    text-decoration: none;
    transition: color 0.2s ease;
}

.card-headline a:hover {
    color: #E30613;
}

/* Autor */
.author-info {
    display: flex;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
    margin-top: auto; /* IMPORTANTE: Asegura que siempre esté en el fondo del flex-container */
}

/* Avatar */
.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #E30613;
    margin-right: 10px;
}

.card-author {
    font-size: 15px;
    color: #555;
    font-weight: 600;
    margin: 0;
}

/* --- NEW: Initials Avatar Styles --- */
.initials-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #E30613;
    margin-right: 10px;
    color: #ffffff;
    font-weight: 600;
    font-size: 16px;
    line-height: 1;
    text-transform: uppercase;
    flex-shrink: 0; /* Prevent shrinking */
}

.initials-avatar span {
    transform: translateY(1px);
}


/* --- Responsividad --- */

/* Tablet */
@media (max-width: 900px) {
    .opinion-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 600px) {
    .opinion-list {
        grid-template-columns: 1fr;
    }
    .section-title {
        font-size: 24px;
    }
    .card-headline {
        font-size: 17px;
    }
}

/* Elementor responsive classes */
.opinion-grid1- .opinion-list {
    grid-template-columns: 1fr;
}

.opinion-grid2- .opinion-list {
    grid-template-columns: repeat(2, 1fr);
}

.opinion-grid3- .opinion-list {
    grid-template-columns: repeat(3, 1fr);
}

.opinion-grid4- .opinion-list {
    grid-template-columns: repeat(4, 1fr);
}

/* Tablet responsive overrides */
@media (max-width: 1024px) {
    .opinion-grid1-tablet .opinion-list,
    .opinion-grid2-tablet .opinion-list,
    .opinion-grid3-tablet .opinion-list,
    .opinion-grid4-tablet .opinion-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile responsive overrides */
@media (max-width: 767px) {
    .opinion-grid1-mobile .opinion-list,
    .opinion-grid2-mobile .opinion-list,
    .opinion-grid3-mobile .opinion-list,
    .opinion-grid4-mobile .opinion-list {
        grid-template-columns: 1fr;
    }
}
