/* Componente compartido: índice editorial de sectores
   (app/views/componentes/sectores_editorial.php). Se usa en inicio y en
   servicios/compensaciones; se enlaza desde el controlador vía 'styles'. */

/* =========================================================================
   Sectores en los que trabajamos — índice editorial
   Lenguaje visual: consultoría / executive search premium. Sin tarjetas,
   sin iconos grandes, sin gradientes llamativos. Tipografía como
   protagonista (Lora serif para cifras/títulos, Geist para el cuerpo,
   ya cargadas ambas en header.php), líneas finas como único ornamento.
   ========================================================================= */

.sectores-editorial {
    padding: 90px 0;
}

.sectores-editorial-head {
    margin-bottom: 56px;
}

.sectores-editorial-eyebrow {
    display: block;
    margin-bottom: 10px;
    color: #940A36;
    font-size: 14px;
    font-style: italic;
    letter-spacing: 0.04em;
}

.sectores-editorial-titulo {
    margin: 0;
    max-width: 640px;
    color: #122348;
    font-family: 'Lora', serif;
    font-weight: 600;
    font-size: clamp(28px, 3.4vw, 40px);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.sectores-editorial-body {
    display: grid;
    grid-template-columns: minmax(0, 460px) 1fr;
    gap: 0 72px;
    align-items: start;
}

/* --- Índice numerado --- */

.sectores-index {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(18, 35, 72, 0.12);
}

.sector-row {
    border-bottom: 1px solid rgba(18, 35, 72, 0.12);
}

.sector-row-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 17px 4px;
    background: none;
    border: 0;
    border-left: 2px solid transparent;
    cursor: pointer;
    text-align: left;
    font: inherit;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .3s ease, background-color .3s ease, padding-left .3s ease;
}

.sector-row-name {
    flex: 1;
    color: #122348;
    font-size: 19px;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: color .3s ease, transform .3s ease;
}

.sector-row-arrow {
    flex-shrink: 0;
    color: #940A36;
    font-size: 16px;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity .3s ease, transform .3s ease;
}

.sector-row-trigger:hover,
.sector-row-trigger:focus-visible,
.sector-row-trigger.is-active {
    padding-left: 16px;
    background-color: rgba(148, 10, 54, 0.035);
    border-left-color: #940A36;
}

.sector-row-trigger:hover .sector-row-name,
.sector-row-trigger:focus-visible .sector-row-name,
.sector-row-trigger.is-active .sector-row-name {
    color: #0f5a8d;
    transform: translateX(4px);
}

.sector-row-trigger:hover .sector-row-arrow,
.sector-row-trigger:focus-visible .sector-row-arrow,
.sector-row-trigger.is-active .sector-row-arrow {
    opacity: 1;
    transform: translateX(0);
}

.sector-row-trigger:focus-visible {
    outline: none;
}

/* Descripción inline por elemento: solo se usa en móvil (ver media query
   abajo) como acordeón debajo de cada fila. En escritorio permanece oculta
   porque la descripción se muestra en el panel .sectores-detalle. */
.sector-row-desc {
    display: none;
}

/* --- Panel de lectura (descripción del sector activo) --- */

.sectores-detalle {
    position: sticky;
    top: 120px;
    padding: 8px 0 8px 0;
    transition: opacity .18s ease;
}

.sectores-detalle.is-updating {
    opacity: 0;
}

.sectores-detalle-eyebrow {
    margin: 0 0 8px;
    color: #940A36;
    font-size: 13px;
    font-style: italic;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sectores-detalle-nombre {
    margin: 0 0 18px;
    color: #122348;
    font-family: 'Lora', serif;
    font-weight: 600;
    font-size: 30px;
}

.sectores-detalle-texto {
    max-width: 46ch;
    margin: 0;
    color: #3a4a63;
    font-size: 17px;
    line-height: 1.7;
}

/* Barra de progreso: única señal del auto-avance, se detiene y desaparece
   en cuanto el usuario interactúa (ver .sectores-detalle.is-paused). */
.sectores-detalle-progress {
    width: 140px;
    height: 2px;
    margin-top: 32px;
    background: rgba(18, 35, 72, 0.1);
    overflow: hidden;
    transition: opacity .4s ease;
}

.sectores-detalle-progress span {
    display: block;
    width: 0%;
    height: 100%;
    background: #940A36;
}

.sectores-detalle-progress span.is-animating {
    animation: sectores-progress var(--sectores-progress-dur, 5000ms) linear forwards;
}

.sectores-detalle.is-paused .sectores-detalle-progress {
    opacity: 0;
}

@keyframes sectores-progress {
    from { width: 0%; }
    to { width: 100%; }
}

@media (max-width: 991px) {
    .sectores-editorial {
        padding: 64px 0;
    }
    .sectores-editorial-body {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    .sectores-detalle {
        display: none;
    }
    .sector-row-desc {
        display: none;
        padding: 4px 4px 18px;
        color: #3a4a63;
        font-size: 15px;
        line-height: 1.7;
    }
    .sector-row-trigger.is-active + .sector-row-desc {
        display: block;
    }
}

@media (max-width: 480px) {
    .sector-row-trigger {
        padding: 14px 2px;
    }
    .sector-row-name {
        font-size: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sector-row-trigger,
    .sector-row-name,
    .sector-row-arrow,
    .sectores-detalle {
        transition: none;
    }
    .sectores-detalle-progress {
        display: none;
    }
}
