:root {
    --ink: #122033;
    --muted: #667085;
    --paper: #f5f7fb;
    --radius: 1.35rem;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.fw-black {
    font-weight: 900;
}

/* =========================================================
   HEADER INSTITUCIONAL
   ========================================================= */

.institutional-header {
    z-index: 1020;
}

.header-grid {
    display: grid !important;
    grid-template-columns: 20% 20% 80%;
    width: 100%;
}

.header-grid > [class*="col"] {
    width: auto;
    max-width: none;
}

.header-img {
    max-width: 100%;
    height: 80px;
    object-fit: contain;
}

.institution-name-img {
    width: 100%;
    object-position: left center;
}

.header-copy-col {
    padding-left: 1rem;
}

.header-title {
    font-size: clamp(1rem, 2vw, 1.65rem);
    font-weight: 850;
    line-height: 1.05;
}

.header-paragraph {
    font-size: 0.88rem;
    color: #64748b;
    line-height: 1.3;
    max-width: 75ch;
}

/* =========================================================
   HERO
   ========================================================= */

.hero-section {
    background:
        radial-gradient(
            circle at 20% 10%,
            #dbeafe 0,
            transparent 28%
        ),
        radial-gradient(
            circle at 80% 20%,
            #dcfce7 0,
            transparent 25%
        ),
        linear-gradient(
            180deg,
            #fff 0,
            var(--paper) 100%
        );
}

.hero-title {
    letter-spacing: -0.06em;
    line-height: 0.88;
    max-width: 1100px;
    color: #f60005;
    margin-inline: auto;
}

.hero-eyebrow {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;

    padding: 0.5rem 0.85rem;

    border-radius: 999px;
    background: #fff;
    border: 1px solid #e5e7eb;

    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hero-subtitle {
    max-width: 700px;
}

/* =========================================================
   BUSCADOR
   ========================================================= */

.search-shell {
    background: #fff;
    border: 1px solid #e6e9ef;
    border-radius: 999px;

    padding: 0.5rem 0.75rem 0.5rem 1rem;

    display: flex;
    align-items: center;
    gap: 0.5rem;

    position: sticky;
    top: 96px;
    z-index: 100;
}

.search-shell .form-control {
    background: transparent;
}

/* =========================================================
   FILTROS
   ========================================================= */

.filter-group {
    background: #fff;
    padding: 1rem 1.15rem;

    border-radius: var(--radius);
    border: 1px solid #e9edf3;
}

/* Categorías */

.category-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
}

.category-filter {
    position: relative;

    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;

    border: 2px solid transparent;

    min-height: 130px;

    transition: 0.2s ease;

    background-color: #fff !important;
}

.category-filter img {
    width: 100%;
    height: 92px;

    object-fit: cover;
    display: block;

    filter: saturate(0.85);
}

.category-name {
    display: flex;
    align-items: center;
    gap: 0.35rem;

    padding: 0.55rem 0.65rem;

    font-size: 0.78rem;
    font-weight: 800;

    background: rgba(255, 255, 255, 0.9);
}

.category-filter:has(input:checked) {
    border-color: currentColor;

    box-shadow:
        0 0 0 3px
        color-mix(
            in srgb,
            currentColor 18%,
            transparent
        );

    transform: translateY(-2px);
}

.category-check {
    display: none;

    position: absolute;
    right: 0.45rem;
    top: 0.45rem;

    width: 1.8rem;
    height: 1.8rem;

    border-radius: 50%;

    align-items: center;
    justify-content: center;

    background: #fff;
    box-shadow: 0 3px 10px #0002;

    z-index: 2;
}

.category-filter:has(input:checked) .category-check {
    display: flex;
}

/* Filtros tipo chip */

.chip-filter {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;

    padding: 0.55rem 0.75rem;

    border-radius: 999px;
    border: 1px solid #00000010;

    cursor: pointer;

    font-weight: 700;
    font-size: 0.88rem;
}

.chip-filter input {
    accent-color: currentColor;
}

/* =========================================================
   RESULTADOS
   ========================================================= */

.results-table th {
    font-size: 0.72rem;

    text-transform: uppercase;
    letter-spacing: 0.05em;

    color: #64748b;
    background: #f8fafc;

    padding: 1rem;
}

.results-table td {
    padding: 1rem;
}

.results-table .desc {
    max-width: 620px;
    color: #667085;
}

/* Resultado móvil */

.mobile-result-card {
    background: #fff;

    border: 1px solid #e5e7eb;
    border-radius: 1.2rem;

    padding: 1rem;
}

/* =========================================================
   FICHA DE PROPUESTA
   ========================================================= */

.proposal-hero {
    background: linear-gradient(
        135deg,
        #0f172a,
        #1e293b
    );

    color: white;
}

.proposal-code {
    font-size: 0.78rem;
    font-weight: 800;

    letter-spacing: 0.12em;
    text-transform: uppercase;

    color: #cbd5e1;
}

.proposal-title {
    letter-spacing: -0.035em;
}

.proposal-description {
    color: #dbe5f0;
    max-width: 800px;
}

.proposal-image-wrap {
    padding: 0.5rem;

    background: #ffffff18;
    border: 1px solid #ffffff33;

    border-radius: 1.5rem;
}

.proposal-image {
    width: 100%;
    height: 300px;

    object-fit: cover;

    border-radius: 1.1rem;
}

.proposal-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;

    border-radius: 999px;

    padding: 0.45rem 0.7rem;

    font-size: 0.8rem;
    font-weight: 800;
}

/* =========================================================
   BENTO GRID
   ========================================================= */

.bento-grid {
    display: grid;

    grid-template-columns: repeat(12, 1fr);

    gap: 1rem;
}

.info-card,
.mini-card,
.commitment-card {
    background: #fff;

    border: 1px solid #e6eaf0;
    border-radius: 1.35rem;

    padding: 1.35rem;

    box-shadow: 0 10px 35px #0f172a0a;
}

.info-card {
    display: flex;
    gap: 1rem;
}

.info-card h3,
.commitment-card h3 {
    font-size: 1.15rem;
    font-weight: 850;
}

.info-card p,
.commitment-card p {
    margin: 0;

    color: #526071;

    line-height: 1.65;
}

.card-icon {
    flex: 0 0 auto;

    width: 2.8rem;
    height: 2.8rem;

    border-radius: 0.9rem;

    display: grid;
    place-items: center;

    font-size: 1.2rem;
}

.card-kicker,
.mini-card > span {
    font-size: 0.7rem;

    text-transform: uppercase;
    letter-spacing: 0.08em;

    color: #7c8798;

    font-weight: 800;
}

/* Distribución */

.card-problem,
.card-objective {
    grid-column: span 6;
}

.mini-card {
    grid-column: span 4;
}

.card-meta {
    grid-column: span 7;
}

.card-measure {
    grid-column: span 5;
}

.card-benef {
    grid-column: span 12;
}

/* Compromisos */

.commitment-card {
    grid-column: span 6;

    padding: 1.6rem;
}

.commitment-card.candidate {
    background: linear-gradient(
        145deg,
        #eff6ff,
        #fff
    );
}

.commitment-card.citizen {
    background: linear-gradient(
        145deg,
        #f0fdf4,
        #fff
    );
}

/* =========================================================
   BARRA DE ACCIONES
   ========================================================= */

.share-bar {
    position: sticky;
    bottom: 1rem;
}

.share-bar .btn {
    box-shadow: 0 8px 25px #0f172a1a;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1199px) {

    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }

}

@media (max-width: 767px) {

    /* Header */

    .header-grid {
        grid-template-columns: 22% 28% 50%;
    }

    .header-img {
        height: 48px;
    }

    .header-title {
        font-size: 0.85rem;
    }

    .header-copy-col {
        padding-left: 0.35rem;
    }

    /* Hero */

    .hero-title {
        font-size: clamp(3rem, 14vw, 5rem);
    }

    /* Buscador */

    .search-shell {
        top: 70px;
    }

    /* Categorías */

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-filter {
        min-height: 112px;
    }

    .category-filter img {
        height: 75px;
    }

    /* Bento */

    .bento-grid {
        grid-template-columns: 1fr;
    }

    .card-problem,
    .card-objective,
    .mini-card,
    .card-meta,
    .card-measure,
    .card-benef,
    .commitment-card {
        grid-column: 1;
    }

    /* Imagen de propuesta */

    .proposal-image {
        height: 220px;
    }

}