/* ============================================================
   DIHBU Convocatorias – Estilos públicos
   ============================================================ */

/* ---- Contenedor principal ---- */
.dihbu-conv-wrapper {
    font-family: inherit;
    color: inherit;
}

/* ================================================================
   FILTROS
================================================================ */
.dihbu-conv-filters {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 28px;
}

.dihbu-filters-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.dihbu-filter-search-wrap {
    position: relative;
    flex: 1 1 220px;
    min-width: 0;
}

.dihbu-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
}

.dihbu-filter-search {
    width: 100%;
    height: 40px;
    padding: 0 12px 0 32px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #111827;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.dihbu-filter-search:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(29,78,216,0.15);
}

.dihbu-filter-select {
    height: 40px;
    padding: 0 28px 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b7280'/%3E%3C/svg%3E") no-repeat right 10px center;
    -webkit-appearance: none;
    appearance: none;
    color: #374151;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s;
}

.dihbu-filter-select:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(29,78,216,0.15);
}

.dihbu-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.dihbu-filter-btn {
    height: 40px;
    padding: 0 20px;
    background: #1d4ed8;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.dihbu-filter-btn:hover {
    background: #1e40af;
}

.dihbu-filter-reset {
    display: inline-flex;
    align-items: center;
    height: 40px;
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
}

.dihbu-filter-reset:hover {
    color: #dc2626;
    text-decoration: none;
}

/* ---- Contador de resultados ---- */
.dihbu-results-count {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 20px;
}

/* ================================================================
   CUADRÍCULA
================================================================ */
.dihbu-conv-grid {
    display: grid;
    gap: 24px;
}

.dihbu-cols-1 { grid-template-columns: 1fr; }
.dihbu-cols-2 { grid-template-columns: repeat(2, 1fr); }
.dihbu-cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ================================================================
   TARJETA
================================================================ */
.dihbu-conv-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.dihbu-conv-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

/* Borde indicador de urgencia */
.dihbu-card--urgente {
    border-top: 3px solid #f59e0b;
}

.dihbu-card--cerrada {
    opacity: 0.75;
}

/* Imagen */
.dihbu-card-img img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

/* Cuerpo */
.dihbu-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

/* ---- Badges ---- */
.dihbu-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dihbu-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.6;
}

.dihbu-badge--lg {
    font-size: 13px;
    padding: 4px 14px;
}

.dihbu-badge--abierta   { background: #d1fae5; color: #065f46; }
.dihbu-badge--proxima   { background: #fef3c7; color: #92400e; }
.dihbu-badge--cerrada   { background: #fee2e2; color: #991b1b; }
.dihbu-badge--archivada { background: #f3f4f6; color: #6b7280; }
.dihbu-badge--cat       { background: #ede9fe; color: #5b21b6; }

/* ---- Título ---- */
.dihbu-card-title {
    margin: 0;
    font-size: 17px;
    line-height: 1.3;
    font-weight: 700;
}

.dihbu-card-title a {
    color: #111827;
    text-decoration: none;
}

.dihbu-card-title a:hover {
    color: #1d4ed8;
    text-decoration: none;
}

/* ---- Entidad ---- */
.dihbu-card-entidad {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dihbu-icon {
    font-size: 14px;
}

/* ---- Metadatos de la tarjeta ---- */
.dihbu-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    border-top: 1px solid #f3f4f6;
    padding-top: 10px;
}

.dihbu-meta-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dihbu-meta-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #9ca3af;
    font-weight: 600;
}

.dihbu-meta-value {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.dihbu-meta-item--cierre .dihbu-meta-value {
    color: #dc2626;
}

/* ---- Extracto ---- */
.dihbu-card-excerpt {
    margin: 0;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Acciones ---- */
.dihbu-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 4px;
}

.dihbu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    cursor: pointer;
    border: none;
}

.dihbu-btn--lg {
    height: 44px;
    padding: 0 24px;
    font-size: 15px;
    border-radius: 8px;
}

.dihbu-btn--primary {
    background: #1d4ed8;
    color: #fff !important;
}

.dihbu-btn--primary:hover {
    background: #1e40af;
    color: #fff !important;
    text-decoration: none;
}

.dihbu-btn--outline {
    border: 1px solid #d1d5db;
    color: #374151 !important;
    background: transparent;
}

.dihbu-btn--outline:hover {
    background: #f9fafb;
    color: #111827 !important;
    text-decoration: none;
}

/* ---- Etiquetas (tags) ---- */
.dihbu-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.dihbu-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 11px;
    color: #6b7280;
}

/* ---- Documentos en tarjeta ---- */
.dihbu-card-docs {
    font-size: 12px;
    color: #9ca3af;
}

/* ================================================================
   SIN RESULTADOS
================================================================ */
.dihbu-no-results {
    text-align: center;
    padding: 48px 24px;
    border: 2px dashed #e5e7eb;
    border-radius: 14px;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.dihbu-no-results p {
    margin: 0;
    font-size: 16px;
}

/* ================================================================
   PAGINACIÓN
================================================================ */
.dihbu-pagination {
    margin-top: 36px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.dihbu-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    transition: background 0.15s;
}

.dihbu-pagination .page-numbers.current {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.dihbu-pagination .page-numbers:hover:not(.current) {
    background: #f3f4f6;
    text-decoration: none;
}

/* ================================================================
   FICHA INDIVIDUAL (single)
================================================================ */
.dihbu-single-wrap {
    margin-top: 36px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.dihbu-single-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.dihbu-single-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Tabla ficha */
.dihbu-single-ficha {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 24px;
}

.dihbu-ficha-title {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.dihbu-ficha-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 0 0 20px;
}

.dihbu-ficha-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dihbu-ficha-item dt {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dihbu-ficha-item dd {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.dihbu-urgente-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.dihbu-cerrada-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Requisitos */
.dihbu-single-requisitos h3,
.dihbu-single-docs h3 {
    font-size: 18px;
    margin: 0 0 12px;
    color: #111827;
}

.dihbu-requisitos-content {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    font-size: 15px;
    line-height: 1.65;
    color: #374151;
}

/* Lista de documentos */
.dihbu-docs-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dihbu-doc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #1d4ed8;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.dihbu-doc-link:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    text-decoration: none;
    color: #1d4ed8;
}

/* Etiquetas en single */
.dihbu-single-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ================================================================
   LAYOUT: LISTA VERTICAL (sidebar / widget)
================================================================ */

.dihbu-lista {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dihbu-lista-item {
    border-bottom: 1px solid #f0f0f0;
}

.dihbu-lista-item:last-child {
    border-bottom: none;
}

.dihbu-lista-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    border-radius: 6px;
}

.dihbu-lista-link:hover {
    background: #f9fafb;
    text-decoration: none;
    color: inherit;
}

/* Miniatura */
.dihbu-lista-thumb {
    position: relative;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: visible;
}

.dihbu-lista-thumb img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.dihbu-lista-thumb-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
}

/* Dot de estado (esquina superior derecha de la miniatura) */
.dihbu-lista-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: block;
}

/* Texto */
.dihbu-lista-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.dihbu-lista-fecha {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.dihbu-lista-titulo {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dihbu-lista-link:hover .dihbu-lista-titulo {
    color: #1d4ed8;
}

/* Filtros compactos del layout lista */
.dihbu-lista-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.dihbu-lista-search-wrap {
    position: relative;
    display: flex;
}

.dihbu-lista-search {
    width: 100%;
    height: 36px;
    padding: 0 36px 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: #111827;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.dihbu-lista-search:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(29,78,216,0.12);
}

.dihbu-lista-search-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 36px;
    width: 36px;
    background: #1d4ed8;
    border: none;
    border-radius: 0 6px 6px 0;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.dihbu-lista-search-btn:hover {
    background: #1e40af;
}

.dihbu-lista-filters .dihbu-filter-select {
    height: 34px;
    width: 100%;
    font-size: 13px;
}

.dihbu-lista-reset {
    font-size: 12px;
    color: #9ca3af;
    text-decoration: none;
    text-align: right;
}

.dihbu-lista-reset:hover {
    color: #dc2626;
    text-decoration: none;
}

.dihbu-lista-empty {
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
    padding: 16px 0;
}

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 900px) {
    .dihbu-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .dihbu-ficha-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .dihbu-cols-2,
    .dihbu-cols-3 {
        grid-template-columns: 1fr;
    }

    .dihbu-filters-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .dihbu-filter-search-wrap,
    .dihbu-filter-select {
        width: 100%;
    }

    .dihbu-filter-actions {
        justify-content: space-between;
    }

    .dihbu-filter-btn {
        flex: 1;
    }

    .dihbu-card-meta {
        flex-direction: column;
        gap: 8px;
    }
}
