/* ── Explorador de normas — llamita.pe ──────────────────────────────────
──────────────────────────────────────────────────────────────────────── */

/* ── Campo de búsqueda ───────────────────────────────────────────────── */

.explorer-field {
    margin: 1.5rem 0 0.25rem;
    display: flex;
    justify-content: center;
}

.explorer-field input {
    width: 80%;
    padding: 0.6rem 0.8rem;
    font-family: var(--font-content);
    font-weight: 350;
    font-size: 1rem;
    line-height: 1.4;
    background: var(--color-bg-muted);
    border: none;
    border-bottom: 2px solid var(--color-border);
    outline: none;
    -webkit-appearance: none; /* Importante para que el borde inferior */
    appearance: none; /* Importante para que el borde inferior */
}

.explorer-field input::placeholder {
    color: var(--color-text-muted);
    font-style: italic;
}

.explorer-field input:focus {
    border-bottom-color: var(--color-link);
}

.explorer-field input::-webkit-search-cancel-button {
    -webkit-appearance: none; /* Importante para que el botón de cancelar no aparezca */
}

/* ── Estado ──────────────────────────────────────────────────────────── */

.explorer-status {
    text-align: center;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--color-text-muted);
    font-style: italic;
    margin: 0.8rem 0 0;
}

/* ── Sin resultados ──────────────────────────────────────────────────── */

.explorer-empty {
    text-align: center;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--color-text-muted);
    margin: 0.8rem 0 0;
}

/* ── Resultados ──────────────────────────────────────────────────────── */

#explorer-results {
    font-size: 0.9rem;
}

/* ── Grupo por norma ─────────────────────────────────────────────────── */

.explorer-group {
    margin: 2rem 0 0;
}

.explorer-norm {
    font-family: var(--font-ui);
    font-weight: 650;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    color: var(--color-link);
    text-transform: uppercase;
    text-align: left;
    margin: 0 0 0.9rem; 
}

/* ── Lista de resultados ─────────────────────────────────────────────── */

.explorer-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    font-family: var(--font-content);
    line-height: 1.5;
}

.explorer-item {
    padding: 0.8rem 1.2rem;
    border: 1px solid var(--color-bg-muted);
    cursor: pointer;
}

.explorer-item:hover {
    background: var(--color-bg-muted);
}

/* ── Etiqueta del artículo ───────────────────────────────────────────── */

.explorer-label {
    display: block;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--color-text-heading);
    margin-bottom: 0.25rem;
}

.explorer-list .explorer-snippet {
    line-height: 1.5;
}

/* ── Resaltado ───────────────────────────────────────────────────────── */

.explorer-label mark,
.explorer-snippet mark,
.explorer-modal-body mark {
    background: rgba(155, 48, 48, 0.12);
    color: var(--color-link);
    font-weight: 550;
    padding: 0 2px;
}

/* ── Modal overlay ───────────────────────────────────────────────────── */

.explorer-modal {
    position: fixed;
    inset: 0;
    background: rgba(28, 26, 23, 0.5);
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem 0.8rem;
    overflow-y: auto;
}

/* ── Panel del modal ─────────────────────────────────────────────────── */

.explorer-modal-panel {
    background: var(--color-bg-muted);
    width: 100%;
    max-width: 680px;
    box-shadow:
        0 20px 60px rgba(28, 26, 23, 0.15),
        0 4px 16px rgba(28, 26, 23, 0.08);
}

/* ── Header del modal ────────────────────────────────────────────────── */

.explorer-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 1.2rem;
}

.explorer-modal-norm {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.explorer-modal-close {
    display: grid;
    place-items: center;
    width: 1.2rem;
    height: 1.2rem;
    background-color: var(--color-text-muted);
    border: none;
    cursor: pointer;
    font-family: var(--font-ui);
    padding: 0;
    -webkit-mask: url('/assets/img/close.svg') center / contain no-repeat;
    mask: url('/assets/img/close.svg') center / contain no-repeat;
}

.explorer-modal-close:hover {
    background-color: var(--color-link);
}

.explorer-modal-close:focus {
    outline: none;
}

.explorer-modal-close:focus-visible {
    outline: 2px solid var(--color-link);
    outline-offset: 2px;
}

/* ── Cuerpo del modal ────────────────────────────────────────────────── */

.explorer-modal-body {
    display: flow-root;
    background: var(--color-bg);
    padding: 0 1.2rem 1.2rem;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (min-width: 640px) {
    .explorer-field input {
        width: 60%;
    }

    .explorer-modal {
        padding: 3rem 1.5rem;
    }

    .explorer-modal-body {
        padding: 0 1.6rem 1.6rem;
    }
}
