/*
 * FILE: assets/css/components/section-institucional.css
 * COMPONENT: section-institucional.php  →  .inst-section
 *
 * Paleta:
 *   #003824  fondo raíz
 *   #0a3d25  bloques alternos
 *   #45A85A  acentos, bordes activos
 *   #E94E89  detalle hover — máx 1 uso visible por bloque
 */

/* ============================================================
   SECCIÓN RAÍZ
   ============================================================ */
.inst-section {
    background: #021f14;
    color: #ffffff;
    overflow: hidden;
}

/* ============================================================
   ENCABEZADO DE BLOQUE — patrón repetido en A B C D
   ============================================================ */
.inst-block-header {
    margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.inst-block-header__tag {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #45A85A;
    margin-bottom: var(--space-3);
}

.inst-block-header__title {
    font-size: clamp(1.55rem, 2.8vw, 2.1rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

/* ============================================================
   A. HERO — degradado institucional
   ============================================================ */
.inst-hero {
    position: relative;
    padding: clamp(5rem, 9vw, 8rem) 0 clamp(4rem, 7vw, 7rem);
    border-bottom: 1px solid rgba(69, 168, 90, 0.10);
    overflow: hidden;
}

/* Glows de color — verde, azul, magenta */
.inst-hero__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.inst-hero__bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.28;
}

.inst-hero__bg-glow--green {
    width: 520px;
    height: 520px;
    background: #45A85A;
    top: -120px;
    left: -80px;
}

.inst-hero__bg-glow--blue {
    width: 420px;
    height: 420px;
    background: #1758A0;
    top: 40px;
    right: 10%;
    opacity: 0.22;
}

.inst-hero__bg-glow--magenta {
    width: 280px;
    height: 280px;
    background: #E94E89;
    bottom: -60px;
    right: 25%;
    opacity: 0.16;
}

/* Layout interior: dos columnas */
.inst-hero__inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(3rem, 6vw, 6rem);
    align-items: center;
}

/* ── Columna izquierda ───────────────────────────────────── */
.inst-hero__left {
    display: flex;
    flex-direction: column;
    gap: var(--space-7);
}

/* Badge */
.inst-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 16px;
    border: 1px solid rgba(69, 168, 90, 0.35);
    border-radius: 999px;
    background: rgba(69, 168, 90, 0.07);
    color: #7dce8e;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    width: fit-content;
}

/* Título */
.inst-hero__title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 5vw, 4.4rem);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.04em;
    color: #ffffff;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.05em;
}

.inst-hero__title-accent {
    color: #45A85A;
}

.inst-hero__title-place {
    font-size: 0.55em;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    margin-top: 0.3em;
}

/* Chips de pilares */
.inst-hero__pillars {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.inst-hero__pillar {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.inst-hero__pillar--green {
    background: rgba(69, 168, 90, 0.15);
    border: 1px solid rgba(69, 168, 90, 0.35);
    color: #7dce8e;
}

.inst-hero__pillar--blue {
    background: rgba(23, 88, 160, 0.20);
    border: 1px solid rgba(23, 88, 160, 0.40);
    color: #7aabdf;
}

.inst-hero__pillar--pink {
    background: rgba(233, 78, 137, 0.12);
    border: 1px solid rgba(233, 78, 137, 0.30);
    color: #f09bbf;
}

/* ── Columna derecha ─────────────────────────────────────── */
.inst-hero__right {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    padding-left: var(--space-8);
    border-left: 1px solid rgba(255,255,255,0.07);
}

.inst-hero__lead {
    font-size: clamp(1rem, 1.5vw, 1.1rem);
    line-height: 1.78;
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
}

.inst-hero__body {
    font-size: clamp(0.88rem, 1.2vw, 0.96rem);
    line-height: 1.82;
    color: rgba(255, 255, 255, 0.48);
    margin: 0;
}

.inst-hero__lead strong,
.inst-hero__body strong {
    color: rgba(255, 255, 255, 0.88);
    font-weight: 600;
}

/* Normativa en línea */
.inst-hero__norms {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding-top: var(--space-4);
    border-top: 1px solid rgba(255,255,255,0.06);
}

.inst-hero__norm {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 var(--space-4);
}

.inst-hero__norm:first-child {
    padding-left: 0;
}

.inst-hero__norm-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #45A85A;
    line-height: 1.2;
}

.inst-hero__norm-label--green { color: #7dce8e; }
.inst-hero__norm-label--blue  { color: #7aabdf; }
.inst-hero__norm-label--pink  { color: #f09bbf; }

.inst-hero__norm-desc {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.35);
    line-height: 1.4;
}

.inst-hero__norm-sep {
    width: 1px;
    background: rgba(255,255,255,0.08);
    align-self: stretch;
    flex-shrink: 0;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
    .inst-hero__inner {
        grid-template-columns: 1fr;
        gap: var(--space-10);
    }

    .inst-hero__right {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.07);
        padding-top: var(--space-8);
    }

    .inst-hero__bg-glow--blue,
    .inst-hero__bg-glow--magenta {
        display: none;
    }
}

@media (max-width: 560px) {
    .inst-hero__norms {
        flex-direction: column;
        gap: var(--space-4);
    }

    .inst-hero__norm {
        padding: 0;
    }

    .inst-hero__norm-sep {
        display: none;
    }
}

/* ============================================================
   B. BASE LEGAL
   ============================================================ */
.inst-legal {
    padding: clamp(4rem, 7vw, 6rem) 0;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(69, 168, 90, 0.08);
}

.inst-legal__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
}

.inst-legal__card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    padding: clamp(1.5rem, 2.5vw, 2rem);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(69, 168, 90, 0.12);
    border-radius: 16px;
    overflow: hidden;
    transition:
        background-color 0.3s ease,
        border-color     0.3s ease,
        transform        0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.inst-legal__card:hover {
    background: rgba(69, 168, 90, 0.06);
    border-color: rgba(69, 168, 90, 0.28);
    transform: translateY(-4px);
}

/* Barra superior acento magenta al hover */
.inst-legal__card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        to right,
        transparent,
        rgba(233, 78, 137, 0.55),
        transparent
    );
    transform: scaleX(0);
    transition: transform 0.35s ease;
}

.inst-legal__card:hover::before {
    transform: scaleX(1);
}

.inst-legal__card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(69, 168, 90, 0.10);
    color: #45A85A;
    transition: background-color 0.3s ease;
}

.inst-legal__card:hover .inst-legal__card-icon {
    background: rgba(69, 168, 90, 0.20);
}

.inst-legal__card-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    flex: 1;
}

.inst-legal__card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.3;
}

.inst-legal__card-desc {
    font-size: 0.80rem;
    line-height: 1.68;
    color: rgba(255, 255, 255, 0.46);
}

/* ============================================================
   C. ORGANIGRAMA
   ============================================================ */
.inst-org {
    padding: clamp(4rem, 7vw, 6rem) 0;
    border-bottom: 1px solid rgba(69, 168, 90, 0.08);
}

.inst-org__chart {
    max-width: 560px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.inst-org__node {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-6);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(69, 168, 90, 0.13);
    border-radius: 14px;
    transition:
        background-color 0.25s ease,
        border-color     0.25s ease;
}

.inst-org__node:hover {
    background: rgba(69, 168, 90, 0.06);
    border-color: rgba(69, 168, 90, 0.28);
}

/* Nodo destacado: Coordinación */
.inst-org__node--highlight {
    background: linear-gradient(
        135deg,
        rgba(69, 168, 90, 0.12) 0%,
        rgba(69, 168, 90, 0.06) 100%
    );
    border-color: rgba(69, 168, 90, 0.35);
    box-shadow: 0 0 0 1px rgba(69, 168, 90, 0.12),
                0 8px 32px rgba(0, 0, 0, 0.25);
}

.inst-org__node--highlight:hover {
    background: linear-gradient(
        135deg,
        rgba(69, 168, 90, 0.18) 0%,
        rgba(69, 168, 90, 0.09) 100%
    );
    border-color: rgba(69, 168, 90, 0.50);
}

.inst-org__node--highlight .inst-org__node-icon {
    background: rgba(69, 168, 90, 0.20);
    color: #45A85A;
}

.inst-org__node--highlight .inst-org__node-role {
    color: #45A85A;
}

.inst-org__node--highlight .inst-org__node-name {
    color: #ffffff;
}

.inst-org__node-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.45);
    flex-shrink: 0;
}

.inst-org__node-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inst-org__node-role {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.32);
    line-height: 1;
}

.inst-org__node-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.35;
}

/* Conector vertical entre nodos */
.inst-org__connector {
    width: 1px;
    height: 24px;
    background: linear-gradient(
        to bottom,
        rgba(69, 168, 90, 0.35),
        rgba(69, 168, 90, 0.10)
    );
}

/* ============================================================
   D. FUNCIONES
   ============================================================ */
.inst-funcs {
    padding: clamp(4rem, 7vw, 6rem) 0 clamp(5rem, 9vw, 8rem);
    background: rgba(0, 0, 0, 0.10);
}

.inst-funcs__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-4);
}

.inst-funcs__card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: clamp(1.25rem, 2vw, 1.75rem);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(69, 168, 90, 0.10);
    border-radius: 14px;
    overflow: hidden;
    transition:
        background-color 0.28s ease,
        border-color     0.28s ease,
        transform        0.28s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow       0.28s ease;
}

.inst-funcs__card:hover {
    background: rgba(69, 168, 90, 0.06);
    border-color: rgba(69, 168, 90, 0.26);
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.30);
}

/* Indicador magenta inferior — único uso visible de E94E89 */
.inst-funcs__card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: rgba(233, 78, 137, 0.55);
    transform: scaleX(0);
    transition: transform 0.30s cubic-bezier(0.16, 1, 0.3, 1);
}

.inst-funcs__card:hover::after {
    transform: scaleX(1);
}

.inst-funcs__card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(69, 168, 90, 0.10);
    color: #45A85A;
    transition: background-color 0.28s ease;
}

.inst-funcs__card:hover .inst-funcs__card-icon {
    background: rgba(69, 168, 90, 0.20);
}

.inst-funcs__card-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.90);
    line-height: 1.3;
}

.inst-funcs__card-desc {
    font-size: 0.76rem;
    line-height: 1.62;
    color: rgba(255, 255, 255, 0.42);
    flex: 1;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
    .inst-funcs__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .inst-legal__grid  { grid-template-columns: 1fr; }
    .inst-funcs__grid  { grid-template-columns: repeat(2, 1fr); }
    .inst-org__chart   { max-width: 100%; }
    .inst-intro::before { display: none; }
}

@media (max-width: 560px) {
    .inst-funcs__grid  { grid-template-columns: 1fr; }
    .inst-intro__body  { padding-left: var(--space-4); }
}
