/* =============================================
   CONVOCATORIAS — Red de Salud Aguaytía
   ============================================= */

:root {
    --color-primary: #1e3a5f;
    --color-primary-light: #2563eb;
    --color-text: #334155;
    --color-text-soft: #64748b;
    --color-line: #e2e8f0;
    --color-bg: #f8fafb;
    --color-white: #ffffff;
    --radius: 14px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
}

/* ===== Hero ===== */
.conv-hero {
    position: relative;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.conv-hero-bg {
    position: absolute;
    inset: 0;
    background-image: url('../img/banner-convocatoria.png');
    background-size: cover;
    background-position: center;
}

/* El velo (--hero-velo) lo decide el panel: Diseño del sitio -> Convocatorias */
.conv-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 22, 40, var(--hero-velo, 0.4));
    z-index: 1;
}

.conv-hero-content {
    position: relative;
    z-index: 2;
}

.conv-hero-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.6rem;
}

.conv-hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.03em;
    margin: 0 0 0.5rem;
    line-height: 1.15;
}

.conv-hero p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* ===== Sección Convocatorias ===== */
.conv-section {
    background: var(--color-white);
    padding: 4rem 2rem;
}

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
}

/* Filtros */
.conv-filters {
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
}

.conv-form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.conv-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.conv-field label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: 0.01em;
}

.conv-field select,
.conv-field input {
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    font-family: inherit;
    color: #1e293b;
    background: var(--color-white);
    border: 1px solid var(--color-line);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    min-width: 140px;
}

.conv-field select:focus,
.conv-field input:focus {
    border-color: var(--color-primary-light);
}

.conv-field-search {
    flex: 1;
}

.conv-field-search input {
    width: 100%;
}

.conv-field-btn {
    display: flex;
    align-items: flex-end;
}

.conv-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: var(--color-primary-light);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.conv-btn:hover {
    background: var(--color-primary);
}

/* Tabla */
.conv-table-wrap h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 1rem;
    letter-spacing: -0.02em;
}

.conv-alert {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    background: #eef2ff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #1e40af;
    margin-bottom: 1.5rem;
}

.conv-alert svg {
    width: 20px;
    height: 20px;
    stroke: #2563eb;
    flex-shrink: 0;
}

.conv-alert strong {
    font-weight: 600;
}

.conv-table {
    overflow-x: auto;
    border: 1px solid var(--color-line);
    border-radius: 10px;
}

.conv-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.conv-table th {
    background: #f1f5f9;
    padding: 0.8rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid var(--color-line);
    white-space: nowrap;
}

.conv-table td {
    padding: 0.8rem 1rem;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-line);
}

.conv-table tbody tr:last-child td {
    border-bottom: none;
}

.conv-empty {
    text-align: center;
    color: var(--color-text-soft);
    padding: 2rem 1rem !important;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .conv-section {
        padding: 3rem 1.25rem;
    }

    .conv-form-row {
        flex-direction: column;
    }

    .conv-field {
        width: 100%;
    }

    .conv-field-search input {
        width: 100%;
    }

    .conv-field-btn {
        width: 100%;
    }

    .conv-btn {
        width: 100%;
    }

    .conv-hero {
        height: 220px;
    }
}
