/* ============================================================
   SERVICIOS DIGITALES VICTORIA - ESTILOS CUSTOM
   Mantiene la estética burocrático-industrial del diseño original
   ============================================================ */

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.paper-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    background-image: url("https://www.transparenttextures.com/patterns/felt.png");
}

.skewed-container {
    clip-path: polygon(0 0, 100% 2%, 100% 100%, 0 98%);
}

.persona-slash {
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0% 100%);
}

.hard-shadow {
    box-shadow: 8px 8px 0px 0px rgba(31, 28, 15, 1);
}

.hard-shadow-red {
    box-shadow: 6px 6px 0px 0px var(--c-primary, var(--c-primary, #610000));
}

.border-industrial {
    border: 1px solid #4A4A4A;
}

.active-folder {
    background-color: var(--c-primary, #610000);
    color: #fff9ee;
}

@keyframes pulse-scan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(1000%); }
}

.scanner-line {
    height: 2px;
    width: 100%;
    background: color-mix(in srgb, var(--c-primary, var(--c-primary, #610000)) 30%, transparent);
    position: absolute;
    animation: pulse-scan 4s linear infinite;
}

/* ============================================================
   FORMULARIOS (TERMINAL STYLE)
   ============================================================ */
.field-terminal label {
    display: block;
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    font-weight: 700;
    text-transform: uppercase;
    color: #5a403c;
    margin-bottom: 6px;
}

.field-terminal input,
.field-terminal select,
.field-terminal textarea {
    display: block;
    width: 100%;
    background: #fbf3df;
    border: 1px solid #4a4a4a;
    border-radius: 0;
    padding: 12px 14px;
    font-family: "Courier Prime", monospace;
    font-size: 16px;
    color: #1f1c0f;
    outline: none;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.field-terminal input:focus,
.field-terminal select:focus,
.field-terminal textarea:focus {
    border-color: var(--c-primary, #610000);
    box-shadow: 4px 4px 0px 0px color-mix(in srgb, var(--c-primary, var(--c-primary, #610000)) 35%, transparent);
}

.field-terminal ::placeholder {
    color: #8e706b;
    opacity: 0.7;
    font-size: 14px;
}

.btn-industrial {
    display: inline-block;
    background: #1f1c0f;
    color: #fff9ee;
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 14px 28px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease;
    box-shadow: 4px 4px 0px 0px var(--c-primary, var(--c-primary, #610000));
}

.btn-industrial:hover {
    background: var(--c-primary, #610000);
}

.btn-industrial:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px 0px var(--c-primary, var(--c-primary, #610000));
}

.btn-danger {
    background: #ba1a1a;
}
.btn-danger:hover { background: #93000a; }
.btn-danger:active { box-shadow: 2px 2px 0px 0px rgba(147, 0, 10, 1); }

.btn-ghost {
    background: transparent;
    color: #1f1c0f;
    border: 1px solid #4a4a4a;
    box-shadow: none;
}
.btn-ghost:hover { background: #f5edd9; color: var(--c-primary, #610000); }

/* ============================================================
   MARCOS / TABLEROS (resultados, alertas)
   ============================================================ */
.msg-box {
    border: 1px solid #4a4a4a;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.msg-error { background: #ffdad6; color: #93000a; border-left: 6px solid #ba1a1a; }
.msg-ok    { background: #e6f2e0; color: #1e5a1e; border-left: 6px solid #2e7d32; }
.msg-info  { background: #f5edd9; color: #474746; border-left: 6px solid #8e706b; }

/* ============================================================
   TABLAS (PANEL ADMIN)
   ============================================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff9ee;
    border: 1px solid #4a4a4a;
    font-size: 14px;
}

.data-table th,
.data-table td {
    border: 1px solid #d0c8b4;
    padding: 10px 12px;
    text-align: left;
    font-family: "Courier Prime", monospace;
    vertical-align: middle;
}

.data-table th {
    background: var(--c-primary, #610000);
    color: #fff9ee;
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
}

.data-table tr:nth-child(even) { background: #fbf3df; }
.data-table tr:hover { background: #f0e8d4; }

/* ============================================================
   COMENTARIOS
   ============================================================ */
.comentario {
    border: 1px solid #4a4a4a;
    background: #fbf3df;
    padding: 16px;
    margin-bottom: 12px;
}

.comentario .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 1px dashed #8e706b;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.estrellas { color: var(--c-primary, #610000); font-size: 18px; letter-spacing: 2px; }

/* ============================================================
   GALERÍA / VITRINA
   ============================================================ */
.card-img-shell {
    background: #eae2ce;
    border: 1px solid rgba(31, 28, 15, 0.2);
    overflow: hidden;
    position: relative;
}

.card-img-shell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tag-chip {
    display: inline-block;
    background: #f5edd9;
    color: #1f1c0f;
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid rgba(31, 28, 15, 0.15);
    padding: 4px 8px;
}

.badge-status {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
}

.badge-desarrollo { background: #f0e8d4; color: #5f5e5e; }
.badge-beta      { background: #ffe082; color: #5a4b00; }
.badge-lanzado   { background: #2e7d32; color: #fff; }
.badge-pausado   { background: #ba1a1a; color: #fff; }
.badge-completado{ background: #2e7d32; color: #fff; }
.badge-en_publicacion { background: #2e7d32; color: #fff; }

/* Paginación / navegación simple */
.pager { display: flex; gap: 8px; align-items: center; }
.pager a, .pager span {
    padding: 6px 12px;
    border: 1px solid #4a4a4a;
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    color: #1f1c0f;
    text-decoration: none;
}
.pager a:hover { background: #f0e8d4; }
.pager .activo { background: var(--c-primary, #610000); color: #fff; border-color: var(--c-primary, #610000); }

/* Avatares */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--c-primary, #610000);
    color: #fff;
    font-family: "Epilogue", sans-serif;
    font-weight: 800;
    text-transform: uppercase;
}

/* Scrollbar industrial */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #f5edd9; }
::-webkit-scrollbar-thumb { background: var(--c-primary, #610000); }
::-webkit-scrollbar-thumb:hover { background: var(--c-primary-container, #8b0000); }

/* Link hover general */
a.link-hover:hover { text-decoration: underline; text-decoration-thickness: 2px; }
/* ============================================================
   ÍCONO Y GALERÍA DE PROYECTOS (v4)
   ============================================================ */
.proy-icono {
    object-fit: cover;
    display: block;
    background: #f5edd9;
    border: 2px solid #1f1c0f;
    box-shadow: 3px 3px 0 0 var(--c-primary, #610000);
    flex-shrink: 0;
}
.card-img-shell .proy-icono-pos { position: absolute; left: 10px; bottom: 10px; z-index: 5; }
.proy-contador {
    position: absolute; right: 10px; bottom: 10px; z-index: 5;
    display: inline-flex; align-items: center; gap: 4px;
    background: #1f1c0f; color: #fff7e6;
    font-family: "JetBrains Mono", monospace; font-size: 11px; font-weight: 700;
    padding: 3px 8px;
}

.galeria-visor { position: relative; background: #1f1c0f; aspect-ratio: 16 / 9; overflow: hidden; }
.galeria-visor img { width: 100%; height: 100%; object-fit: contain; display: block; cursor: zoom-in; }
.galeria-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
    width: 40px; height: 56px; border: 0; cursor: pointer;
    background: rgba(31,28,15,.75); color: #fff7e6;
    display: flex; align-items: center; justify-content: center;
}
.galeria-nav:hover { background: var(--c-primary, #610000); }
.galeria-nav.prev { left: 0; } .galeria-nav.next { right: 0; }
.galeria-contador {
    position: absolute; right: 8px; top: 8px; z-index: 5;
    background: rgba(31,28,15,.8); color: #fff7e6;
    font-family: "JetBrains Mono", monospace; font-size: 11px; padding: 2px 8px;
}
.galeria-tiras { display: flex; gap: 8px; overflow-x: auto; padding: 10px; background: #eae2ce; }
.galeria-tiras button {
    flex: 0 0 auto; width: 96px; aspect-ratio: 16 / 10; padding: 0; cursor: pointer;
    border: 2px solid transparent; background: #1f1c0f; opacity: .65;
}
.galeria-tiras button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.galeria-tiras button.activa { border-color: var(--c-primary, #610000); opacity: 1; }

.lightbox {
    position: fixed; inset: 0; z-index: 9999; display: none;
    background: rgba(10,9,5,.94); align-items: center; justify-content: center;
}
.lightbox.abierto { display: flex; }
.lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; }
.lightbox .lb-btn {
    position: absolute; background: rgba(255,247,230,.12); color: #fff7e6; border: 0; cursor: pointer;
    width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
}
.lightbox .lb-btn:hover { background: var(--c-primary, #610000); }
.lightbox .lb-cerrar { top: 14px; right: 14px; }
.lightbox .lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 14px; top: 50%; transform: translateY(-50%); }

/* Admin: vista previa de imágenes */
.admin-miniaturas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.admin-miniaturas .mini { width: 92px; font-family: "JetBrains Mono", monospace; font-size: 10px; text-transform: uppercase; }
.admin-miniaturas .mini img { width: 92px; height: 68px; object-fit: cover; display: block; border: 1px solid #1f1c0f; margin-bottom: 3px; }

/* ============================================================
   ALTURA ESTABLE DEL MENÚ SUPERIOR (corrige el salto/parpadeo)
   El menú tiene una altura fija por breakpoint; el panel móvil y
   el menú lateral usan la misma variable, así nunca se desalinean.
   ============================================================ */
:root { --nav-h: 73px; }

.nav-fijo {
    /* Refuerzo en CSS propio: así el menú no “salta” mientras Tailwind
       (CDN) termina de aplicar sus clases al cargar la página. */
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    height: 73px;
    min-height: 73px;
    max-height: 73px;
    padding-top: 0;
    padding-bottom: 0;
    background-color: #fff9ee;
    border-bottom: 4px solid #1f1c0f;
    overflow: visible;
}

/* El menú fijo no debe tapar los títulos al usar enlaces con #ancla */
html { scroll-padding-top: calc(var(--nav-h) + 16px); }

/* Bloquea el scroll del fondo cuando el panel móvil está abierto */
body.menu-abierto { overflow: hidden; }

/* Panel móvil: estable incluso antes de que Tailwind CDN cargue.
   Sin esto, el panel puede verse un instante al abrir la página. */
#panel-movil { display: block; }
#panel-movil.hidden { display: none; }
@media (min-width: 1280px) { #panel-movil { display: none !important; } }

/* Respeta a quien prefiere menos animaciones */
@media (prefers-reduced-motion: reduce) {
    .scanner-line { animation: none; }
    * { transition-duration: 0.01ms !important; }
}

/* ============================================================
   DESARROLLO: progreso, características y bitácora (v5)
   ============================================================ */
.progreso-barra { background: #eae2ce; border: 2px solid #1f1c0f; width: 100%; overflow: hidden; }
.progreso-relleno { height: 100%; background: var(--c-primary, #610000); transition: width .4s; }

.carac-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.carac-lista li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid rgba(31,28,15,.2); background: #fff; }
.carac-lista .est { font-family: "JetBrains Mono", monospace; font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; margin-left: auto; white-space: nowrap; }
.carac-lista .est.hecha { background: #1f6b2d; color: #fff; }
.carac-lista .est.progreso { background: #b8860b; color: #fff; }
.carac-lista .est.pendiente { background: #eae2ce; color: #1f1c0f; }
.carac-lista li.hecha .txt { text-decoration: line-through; opacity: .65; }

.bitacora { position: relative; margin-left: 12px; padding-left: 26px; border-left: 4px solid #1f1c0f; }
.bitacora-item { position: relative; margin-bottom: 28px; }
.bitacora-item::before {
    content: ""; position: absolute; left: -36px; top: 6px; width: 16px; height: 16px;
    background: var(--c-primary, #610000); border: 3px solid #fff9ee; box-shadow: 0 0 0 2px #1f1c0f;
}
.bitacora-fecha { font-family: "JetBrains Mono", monospace; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--c-primary, #610000); }
.bitacora-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.bitacora-imgs a { display: block; aspect-ratio: 16 / 10; background: #1f1c0f; border: 1px solid #1f1c0f; overflow: hidden; }
.bitacora-imgs img { width: 100%; height: 100%; object-fit: cover; display: block; }


/* ============================================================
   TARJETAS COMPLETAMENTE CLICABLES
   El enlace con .card-link se estira para cubrir toda la tarjeta
   (la tarjeta debe ser position: relative). Lo que lleve
   .card-link-above queda por encima y sigue siendo un enlace aparte.
   ============================================================ */
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 10; }
.card-link:active { transform: none !important; }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after { outline: 3px solid var(--c-primary, #610000); outline-offset: -3px; }
.card-link-above { position: relative; z-index: 11; }


/* ============================================================
   ILUSTRACIONES: visor con imágenes, videos y enlaces (v15)
   ============================================================ */
.galeria-visor.arte-visor { aspect-ratio: 4 / 3; }
.arte-visor .am-media { width: 100%; height: 100%; border: 0; display: block; object-fit: contain; background: #000; }
.arte-visor img.am-media { cursor: zoom-in; }
.galeria-tiras button { position: relative; }
.am-thumb-vid { display: block; width: 100%; height: 100%; background: #1f1c0f; }
.am-play-ov {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    color: #fff7e6; background: rgba(31,28,15,.35);
}
.arte-badges { position: absolute; right: 8px; bottom: 8px; z-index: 5; display: flex; gap: 6px; }
.arte-badges > span {
    display: inline-flex; align-items: center; gap: 4px;
    background: #1f1c0f; color: #fff7e6;
    font-family: "JetBrains Mono", monospace; font-size: 11px; font-weight: 700; padding: 3px 8px;
}
