/**
 * Organizaciones RESCOP
 */

/* === CONTENEDOR PRINCIPAL === */
.rescop-organizations-component {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    margin-top: 0;
    margin-bottom: 0;
    min-height: 700px;
    background: white;
    overflow: hidden;
    display: flex;
    position: relative;
    padding: 100px 0 40px 0;
}

/* === CONTENEDOR ORGANIZACIONES 1280px === */
.rescop-organizations-container {
    width: 100%;
    max-width: 1280px !important; 
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 0 4rem;
}

/* === HEADER === */
.rescop-organizations-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 2.5rem;
    gap: 1.5rem;
}

.rescop-organizations-title {
    width: 100%;
    max-width: 1456px;
    color: black !important;
    font-size: clamp(28px, 3.5vw, 36px) !important;
    font-family: var(--rescop-font-display, 'Anton', sans-serif) !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
    word-wrap: break-word;
}

/* === FILTRO (preparado para futuro) === */
.rescop-organizations-filter-text {
    color: black !important;
    font-size: 14px !important;
    font-family: var(--rescop-font-secondary, 'Merriweather', serif) !important;
    font-weight: 400 !important;
    line-height: 22px !important;
    text-align: center;
    margin: 0 !important;
    padding: 0 !important;
}

/* === GRID 4 COLUMNAS - CARDS MÁS GRANDES === */
.rescop-organizations-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 1.5rem; 
    width: 100%;
    max-width: 1200px;
}

/* === FILTRO DE COMUNIDADES - SIN COMAS === */
.rescop-organizations-filter {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 2rem;
}

.rescop-ccaa-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    /* gap: 0.5rem;  */
    max-width: 1000px;
    line-height: 30px;
        text-align: center;
    }

/* === ELIMINAR TODAS LAS COMAS === */
.rescop-ccaa-filter-item:not(:first-child)::before {
    content: ''; 
}
.rescop-ccaa-filter-item:not(:last-child)::after {
    content: ''; 
}

/* === ELEMENTOS DEL FILTRO - SIN COMAS === */
    .rescop-ccaa-filter-item {
    background: none !important;
    border: none !important;
    outline: none !important;
    
    margin: 0 !important;
    cursor: pointer;
    display: inline-block; 
    color: black !important;
    font-size: 16px !important;
    font-family: var(--rescop-font-secondary, 'Merriweather', serif) !important;
    font-weight: 700 !important;
    line-height: 30px !important;
    word-wrap: break-word;

    /* Sin decoraciones */
    text-decoration: none !important;
    border-radius: 4px !important; 
    transition: all 0.3s ease;
    white-space: nowrap;
    text-transform: capitalize !important;
    }

.rescop-ccaa-filter-item.active {
    color: #ED2E38 !important;
}

.rescop-ccaa-filter-item:hover {
    color: #ED2E38 !important;
}

/* === RESET PARA EVITAR ESTILOS DEL TEMA === */
.rescop-ccaa-filter-item:focus {
    outline: 1px dotted #ED2E38;
    outline-offset: 2px;
    background: none !important;
}

.rescop-ccaa-filter-item:active {
    background: none !important;
    transform: none !important;
}

.rescop-organization-card {
    flex: 0 0 calc(25% - 1.125rem); 
    width: calc(25% - 1.125rem);
    min-width: 332px; 
    max-width: 370px; 
    height: 140px; 
    background: white;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.rescop-organization-card:hover {
    transform: translateY(-2px);
}

.rescop-org-logo {
    position: absolute;
    left: 12px; 
    top: 20px; 
    width: 60px; 
    height: 60px; 
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
    }
    
.rescop-org-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.rescop-org-logo-placeholder {
    width: 100%;
    height: 100%;
    background: #E5E5E5;
    border: 1px rgba(0, 0, 0, 0.30) solid;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: rgba(0, 0, 0, 0.5);
}

.rescop-org-logo-placeholder::after {
    content: 'Logo';
}

/* === NOMBRE - AJUSTAR A CARD MÁS GRANDE === */
    .rescop-org-name {
    position: absolute;
    left: 85px; /* CAMBIO: ajustar por logo más grande */
    top: 20px; /* CAMBIO: ajustar por logo más grande */
    width: calc(100% - 100px); /* CAMBIO: ancho dinámico */
    height: 60px; /* CAMBIO: más altura para 3-4 líneas */

    /* Tipografía */
    color: black !important;
    font-size: 16px !important; /* CAMBIO: texto un poco más grande */
    font-family: var(--rescop-font-display, 'Anton', sans-serif) !important;
    font-weight: 400 !important;
    line-height: 18px !important; /* CAMBIO: line-height más generosa */
    text-transform: capitalize !important;
    margin: 0 !important;
    padding: 0 !important;
    word-wrap: break-word;

    /* 3 LÍNEAS con puntos suspensivos */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    white-space: normal;
    }

/* === ALTERNATIVA: Si quieres 2 líneas con puntos suspensivos === */
.rescop-org-name.multiline {
    /* Solo usar esta clase si quieres 2 líneas */
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === TAG - AJUSTAR A CARD MÁS GRANDE === */
.rescop-org-tag {
    position: absolute;
    left: 12px; 
    top: 90px; 
    /* width: 100px; */
    height: 15px; 
    background: linear-gradient(0deg, #BE252D 0%, #BE252D 100%), #ED2E38;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rescop-org-tag span {
    color: white !important;
    font-size: 12px !important; 
    font-family: var(--rescop-font-primary, 'Merriweather Sans', serif) !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    text-align: center;
    text-transform: capitalize !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 0.25rem;
    margin: 1rem;
    }

/* === CONTACTO - AJUSTAR A CARD MÁS GRANDE === */
.rescop-org-contact {
    position: absolute;
    top: 88px; /* CAMBIO: ajustar por card más grande */
    right: 12px; /* CAMBIO: más separación del borde */
    width: 40px;
    height: 18px; /* CAMBIO: más altura */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* === ICONOS - UN POCO MÁS GRANDES === */
.rescop-org-email {
    width: 18px; /* CAMBIO: iconos más grandes */
    height: 18px; /* CAMBIO: iconos más grandes */
    background: currentColor;
    color: #292D32;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0;

    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='currentColor' stroke-width='1.5' d='M4 7l8 5 8-5M4 7v10h16V7H4z'/%3E%3C/svg%3E");
    mask-size: 15px 12px; /* CAMBIO: mask más grande */
    mask-repeat: no-repeat;
    mask-position: center;
    margin: 0 !important;
    padding: 0 !important;
}

.rescop-org-website {
    width: 18px; /* CAMBIO: iconos más grandes */
    height: 18px; /* CAMBIO: iconos más grandes */
    background: currentColor;
    color: #292D32;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0;

    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='currentColor' stroke-width='1.5' d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E");
    mask-size: 15px 12px; /* CAMBIO: mask más grande */
    mask-repeat: no-repeat;
    mask-position: center;
    margin: 0 !important;
    padding: 0 !important;
}

.rescop-org-email:hover,
.rescop-org-website:hover {
    color: #BE252D;
    transform: scale(1.1);
}

/* === RESPONSIVE ACTUALIZADO PARA 4 COLUMNAS === */
@media (max-width: 1680px) {
    .rescop-organizations-container {
        padding: 0 4rem;
    }
    
    .rescop-organizations-grid {
        gap: 1.5rem;
    }
}

@media (max-width: 1400px) {
    .rescop-organizations-grid {
        justify-content: center;
    }

    .rescop-organization-card {
        flex: 0 0 calc(25% - 1.125rem); /* Mantener 4 columnas */
        min-width: 230px;
    }
}

@media (max-width: 1200px) {
    .rescop-organizations-grid {
        justify-content: center;
    }
    
    .rescop-organization-card {
        flex: 0 0 calc(33.333% - 1rem); /* 3 columnas */
        min-width: 250px;
    }

    .rescop-ccaa-filter {
        gap: 0.75rem;
        max-width: 90%;
    }

    .rescop-ccaa-filter-item {
        font-size: 14px !important;
        padding: 0.25rem 0.75rem !important;
    }
}

@media (max-width: 900px) {
    .rescop-organizations-grid {
        justify-content: center;
    }

    .rescop-organization-card {
        flex: 0 0 calc(50% - 0.75rem); /* 2 columnas */
        min-width: 280px;
        height: 130px; /* Más altura en móvil */
    }

    /* Ajustar elementos en móvil */
    .rescop-org-logo {
        width: 70px;
        height: 70px;
        top: 25px;
    }

    .rescop-org-name {
        left: 90px;
        top: 25px;
        height: 70px;
        font-size: 16px !important;
        line-height: 20px !important;
    }

    .rescop-org-tag {
        top: 100px;
        width: 110px;
        height: 18px;
    }

    .rescop-org-contact {
        top: 98px;
        right: 15px;
    }
}

@media (max-width: 768px) {
    .rescop-organizations-component {
        padding: 2rem 0;
    }
    .rescop-organizations-container {
        padding: 0 1rem;
}

    .rescop-organizations-grid {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    
    .rescop-organization-card {
        flex: 0 0 auto;
        width: 100%;
        max-width: 350px; /* CAMBIO: más ancha en móvil */
        height: 140px; /* CAMBIO: más alta en móvil */
    }

    .rescop-ccaa-filter {
        gap: 0.5rem;
        line-height: 1.8;
    }

    .rescop-ccaa-filter-item {
        font-size: 14px !important;
        padding: 0.25rem 0.5rem !important;
    }
}

/* === ELIMINAR RESTRICCIONES DEL TEMA === */
.entry-content .rescop-organizations-component,
.wp-block-post-content .rescop-organizations-component,
.site-main .rescop-organizations-component {
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    max-width: none !important;
}

