/* ═══════════════════════════════════════════════════════════════════════════
   Centro de ayuda SIPRE — estilos
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
    --color-primario: #004cc7;
    --color-primario-osc: #00379a;
    --color-acento: #e67e22;
    --color-fondo: #f4f6f9;
    --color-texto: #2c3e50;
    --color-borde: #d2d6de;
    --color-muted: #7f8c8d;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--color-fondo);
    color: var(--color-texto);
    font-size: 14px;
}
a { color: var(--color-primario); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: 0; border-top: 1px solid #ecf0f1; margin: 18px 0; }

/* ═══ Header ═══════════════════════════════════════════════════════════ */
.ay-header {
    background: linear-gradient(135deg, var(--color-primario), var(--color-primario-osc));
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.ay-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.ay-logo {
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 300;
}
.ay-logo b { font-weight: 700; }
.ay-logo i { font-size: 24px; }
.ay-search-top {
    flex: 1;
    max-width: 500px;
    position: relative;
}
.ay-search-top i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-muted);
}
.ay-search-top input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 0;
    border-radius: 4px;
    font-size: 13px;
    background: rgba(255,255,255,0.95);
}
.ay-search-top input:focus { outline: 2px solid #fff; }
.ay-header-nav a {
    color: #fff;
    font-size: 13px;
    margin-left: 10px;
    opacity: .9;
}
.ay-header-nav a:hover { opacity: 1; text-decoration: none; }

/* ═══ Breadcrumb ═══════════════════════════════════════════════════════ */
.ay-breadcrumb-bar {
    background: #fff;
    border-bottom: 1px solid var(--color-borde);
}
.ay-breadcrumb {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 24px;
    font-size: 12px;
    color: var(--color-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.ay-breadcrumb a { color: var(--color-primario); }
.ay-breadcrumb .actual { color: var(--color-texto); font-weight: 600; }

/* ═══ Layout principal ═════════════════════════════════════════════════ */
.ay-wrapper {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 24px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* ═══ Sidebar ══════════════════════════════════════════════════════════ */
.ay-sidebar {
    width: 290px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--color-borde);
    border-radius: 6px;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.ay-sidebar-search {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}
.ay-sidebar-search { position: relative; }
.ay-sidebar-search i {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-muted);
    font-size: 11px;
}
.ay-sidebar-search input {
    width: 100%;
    padding: 6px 8px 6px 28px;
    border: 1px solid var(--color-borde);
    border-radius: 4px;
    font-size: 12px;
}

.ay-nav { padding: 6px 0; }
.ay-cat { border-bottom: 1px solid #ecf0f1; }
.ay-cat:last-child { border-bottom: 0; }
.ay-cat-titulo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    color: var(--color-texto);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
}
.ay-cat-titulo:hover { background: #f8f9fa; text-decoration: none; }
.ay-cat-titulo i:first-child {
    color: var(--color-primario);
    width: 18px;
    text-align: center;
}
.ay-cat-arrow {
    margin-left: auto;
    font-size: 10px;
    color: var(--color-muted);
    transition: transform .2s;
}
.ay-cat.abierta .ay-cat-arrow { transform: rotate(180deg); }
.ay-cat-articulos {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fafbfc;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}
.ay-cat.abierta .ay-cat-articulos { max-height: 1000px; }
.ay-cat-articulos li a {
    display: block;
    padding: 8px 14px 8px 42px;
    font-size: 12.5px;
    color: #555;
    border-left: 3px solid transparent;
    text-decoration: none;
}
.ay-cat-articulos li a:hover { background: #ecf0f1; }
.ay-cat-articulos li.activo a {
    background: #e6edf9;
    color: var(--color-primario);
    font-weight: 600;
    border-left-color: var(--color-primario);
}

/* ═══ Contenido ════════════════════════════════════════════════════════ */
.ay-content {
    flex: 1;
    background: #fff;
    border: 1px solid var(--color-borde);
    border-radius: 6px;
    padding: 32px 40px;
    max-width: 900px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.ay-content h1 {
    font-size: 24px;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--color-primario);
    color: var(--color-texto);
    text-transform: uppercase;
    letter-spacing: .3px;
}
.ay-content h2 {
    font-size: 18px;
    color: var(--color-texto);
    margin: 24px 0 12px;
}
.ay-content .ay-intro {
    font-size: 15px;
    line-height: 1.65;
    color: #555;
    margin-bottom: 22px;
}
.ay-content p { line-height: 1.65; }
.ay-content code {
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: "Consolas", "Monaco", monospace;
    font-size: 12.5px;
    color: #c0392b;
}

/* ─── Pasos numerados ─── */
.ay-pasos {
    list-style: none;
    padding: 0;
    counter-reset: paso;
}
.ay-pasos > li {
    counter-increment: paso;
    position: relative;
    background: #fbfcfd;
    border: 1px solid #ecf0f1;
    border-radius: 6px;
    padding: 16px 18px 16px 60px;
    margin-bottom: 18px;
    transition: .2s;
}
.ay-pasos > li:hover {
    border-color: var(--color-primario);
    box-shadow: 0 2px 8px rgba(0,76,199,0.10);
}
.ay-pasos > li::before {
    content: counter(paso);
    position: absolute;
    left: 16px;
    top: 16px;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    background: var(--color-primario);
    color: #fff;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
}
.ay-paso-texto { line-height: 1.6; }
.ay-paso-img {
    display: block;
    max-width: 100%;
    margin: 12px 0 4px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    cursor: zoom-in;
    transition: .2s;
}
.ay-paso-img:hover {
    border-color: var(--color-primario);
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}
.ay-paso-img-vacia {
    width: 100%;
    height: 180px;
    background: #f4f6f9;
    border: 2px dashed #bdc3c7;
    border-radius: 4px;
    cursor: default !important;
    box-shadow: none !important;
    display: block;
}

/* ─── Callouts ─── */
.ay-callout {
    margin: 14px 0;
    padding: 12px 16px;
    border-left: 4px solid var(--color-acento);
    background: #fef9e7;
    border-radius: 0 4px 4px 0;
}
.ay-callout.danger  { border-left-color: #e74c3c; background: #fdedec; }
.ay-callout.info    { border-left-color: var(--color-primario); background: #e6edf9; }
.ay-callout.success { border-left-color: #27ae60; background: #e8f8f0; }
.ay-callout-titulo {
    font-weight: bold;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ─── Feedback ─── */
.ay-feedback {
    margin: 30px 0 0;
    padding: 14px 18px;
    background: #f8f9fa;
    border: 1px solid #ecf0f1;
    border-radius: 6px;
    text-align: center;
}
.ay-feedback span { margin-right: 12px; color: var(--color-muted); }
.ay-feedback button {
    background: #fff;
    border: 1px solid var(--color-borde);
    border-radius: 4px;
    padding: 6px 14px;
    margin: 0 4px;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-texto);
    transition: .15s;
}
.ay-feedback button:hover {
    border-color: var(--color-primario);
    background: var(--color-primario);
    color: #fff;
}

/* ─── Navegación pie ─── */
.ay-nav-pie {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid #ecf0f1;
}
.ay-nav-pie a {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--color-borde);
    border-radius: 6px;
    text-decoration: none;
    color: var(--color-texto);
    display: flex;
    flex-direction: column;
    transition: .15s;
}
.ay-nav-pie a:hover {
    background: #f4f6f9;
    border-color: var(--color-primario);
    text-decoration: none;
}
.ay-nav-pie a.next { text-align: right; }
.ay-nav-pie .dir { font-size: 11px; color: var(--color-muted); text-transform: uppercase; }
.ay-nav-pie .titulo { font-weight: 600; margin-top: 4px; font-size: 14px; }

/* ─── Búsqueda ─── */
.ay-busqueda-box {
    margin-bottom: 20px;
    padding: 16px 20px;
    background: #fef9e7;
    border: 1px solid #f7dc6f;
    border-radius: 6px;
}
.ay-busqueda-box h2 { margin-top: 0; font-size: 16px; }
.ay-resultados { list-style: none; padding: 0; margin: 0; }
.ay-resultados li { border-bottom: 1px dashed #ecf0f1; }
.ay-resultados li:last-child { border-bottom: 0; }
.ay-resultados li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 6px;
    color: var(--color-texto);
}
.ay-resultados li a:hover { background: rgba(255,255,255,0.6); text-decoration: none; }
.ay-resultados small {
    margin-left: auto;
    color: var(--color-muted);
    font-size: 11px;
    text-transform: uppercase;
    background: #fff;
    padding: 2px 8px;
    border-radius: 10px;
}
.ay-vacio { color: var(--color-muted); font-style: italic; }

/* ═══ Footer ═══════════════════════════════════════════════════════════ */
.ay-footer {
    max-width: 1400px;
    margin: 30px auto 0;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-muted);
}

/* ═══ Lightbox ═════════════════════════════════════════════════════════ */
#ay-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
#ay-lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 4px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

/* ═══ Responsive ═══════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .ay-wrapper { flex-direction: column; padding: 0 12px; }
    .ay-sidebar { width: 100%; position: static; max-height: none; }
    .ay-content { padding: 20px; }
    .ay-header-inner { flex-direction: column; gap: 10px; padding: 12px; }
    .ay-search-top { width: 100%; }
}
