/* =============================================================================
   Quickiie CMS — sitio público
   Móvil primero: las reglas base son para teléfonos y los @media (min-width)
   suman para pantallas más grandes.
   ========================================================================== */

:root {
    --bg: #111214;
    --bg-2: #17191c;
    --bg-3: #1f2226;
    --line: #2c3036;
    --text: #eceef0;
    --muted: #9aa1a9;
    --accent: #00aec1;
    --accent-2: #22c6d8;
    --accent-ink: #032227;
    --amber: #f5a524;
    --danger: #ff6b6b;
    --radius: 10px;
    --header-h: 56px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: var(--accent) var(--bg-2); scrollbar-width: thin; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--sans); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
html.qk-lock, html.qk-lock body { overflow: hidden; }
img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -60px; left: 12px; z-index: 1000; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 0 0 8px 8px; font-weight: 700; transition: top .15s; }
.skip-link:focus { top: 0; color: var(--accent-ink); }
.qk-ico { width: 1.25em; height: 1.25em; flex: 0 0 auto; vertical-align: -.25em; }

/* --- Botones ------------------------------------------------------------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; transition: background .15s, color .15s, transform .15s; -webkit-tap-highlight-color: transparent; }
.btn:hover { background: var(--accent-2); color: var(--accent-ink); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-3); color: var(--text); border-color: var(--accent); }
.btn.is-done { background: var(--amber); border-color: var(--amber); }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; }

/* --- Cabecera ------------------------------------------------------------ */

/* Sin backdrop-filter: crearía un contenedor para los fixed y el cajón del menú quedaría atrapado en la cabecera. */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(17, 18, 20, .97); border-bottom: 1px solid var(--line); }
.site-header-inner { max-width: 1680px; margin: 0 auto; height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); }
.brand img { max-height: 36px; width: auto; }
.brand-text { font: 800 20px/1 var(--mono); letter-spacing: -.5px; color: var(--text); }
.brand-text::first-letter { color: var(--accent); }

.menu-toggle, .menu-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); cursor: pointer; }
.menu-toggle .qk-ico, .menu-close .qk-ico { width: 22px; height: 22px; }

/* Cajón lateral en móvil */
.site-nav { position: fixed; top: 0; right: 0; bottom: 0; width: min(84vw, 320px); background: var(--bg-2); border-left: 1px solid var(--line); z-index: 70; transform: translateX(105%); transition: transform .25s cubic-bezier(.4, 0, .2, 1); display: flex; flex-direction: column; padding: 0 0 calc(16px + var(--safe-b)); visibility: hidden; }
.site-nav.is-open { transform: none; visibility: visible; }
.site-nav-head { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); padding: 0 12px 0 20px; border-bottom: 1px solid var(--line); }
.site-nav-title { font: 700 13px var(--mono); text-transform: uppercase; letter-spacing: 2px; color: var(--muted); }
.site-nav ul { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.site-nav a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 14px; border-radius: 10px; color: var(--text); font-weight: 600; }
.site-nav a:hover, .site-nav a[aria-current] { background: var(--bg-3); color: var(--accent); }
.nav-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 60; }

@media (min-width: 900px) {
    .menu-toggle, .menu-close, .site-nav-head, .nav-backdrop { display: none !important; }
    .site-nav { position: static; width: auto; transform: none; visibility: visible; background: none; border: 0; padding: 0; transition: none; }
    .site-nav ul { display: flex; gap: 2px; padding: 0; overflow: visible; }
    .site-nav a { min-height: 40px; padding: 8px 12px; font-size: 14px; }
    .site-header-inner { padding: 0 20px; }
}

/* --- Contenido general --------------------------------------------------- */

.site-main { flex: 1; width: 100%; max-width: 1680px; margin: 0 auto; padding: 12px 8px 40px; outline: none; }
@media (min-width: 600px) { .site-main { padding: 16px 16px 48px; } }

.page-head { padding: 8px 4px 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.page-title { font: 800 clamp(22px, 5vw, 32px)/1.1 var(--sans); margin: 0; }
.page-title-hash { color: var(--accent); font-family: var(--mono); }
.page-meta { margin: 0; color: var(--muted); font: 12px var(--mono); text-transform: uppercase; letter-spacing: 1px; }
.page-desc { flex-basis: 100%; margin: 0; color: var(--muted); }
.page-head .btn { margin-left: auto; }
.page-included { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.page-included summary { cursor: pointer; min-height: 36px; display: inline-flex; align-items: center; }
.page-included .post_tags { margin: 8px 0 0; }
.empty { color: var(--muted); text-align: center; padding: 60px 0; }
.section-title { font: 700 13px var(--mono); text-transform: uppercase; letter-spacing: 2px; color: var(--muted); margin: 36px 4px 14px; }

.notice { padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); margin: 0 0 14px; }
.notice-warn { border-color: var(--amber); color: var(--amber); }
.notice-ok { border-color: var(--accent); }

.qk-ad { display: flex; justify-content: center; margin: 10px auto; max-width: 100%; overflow: hidden; }

/* --- Grilla -------------------------------------------------------------- */
/* --qk-col-width lo lee js/infinite.js para repartir en columnas iguales. */

.qk-toolbar-row { margin: 0 4px 10px; }
.qk-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.qk-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 16px 6px 6px; font-size: 13px; font-weight: 700; letter-spacing: .3px; color: var(--text); background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.qk-switch:hover { border-color: var(--accent); }
.qk-switch-track { position: relative; flex: 0 0 42px; height: 24px; background: #3a3f45; border-radius: 999px; transition: background .25s; }
.qk-switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #8a9096; border-radius: 50%; transition: transform .25s cubic-bezier(.4, 0, .2, 1), background .25s; }
.qk-switch[aria-checked="true"] { color: var(--accent); border-color: var(--accent); }
.qk-switch[aria-checked="true"] .qk-switch-track { background: rgba(0, 174, 193, .3); }
.qk-switch[aria-checked="true"] .qk-switch-thumb { transform: translateX(18px); background: var(--accent); box-shadow: 0 0 10px rgba(0, 174, 193, .7); }
.qk-switch-hint { display: none; margin: 0; font-size: 12px; color: var(--muted); }
@media (min-width: 600px) { .qk-switch-hint { display: block; } }

.custom-grid .masonry-container { --qk-col-width: 140px; column-width: 140px; column-gap: 10px; width: 100%; }
@media (min-width: 600px)  { .custom-grid .masonry-container { --qk-col-width: 180px; column-width: 180px; } }
@media (min-width: 1100px) { .custom-grid .masonry-container { --qk-col-width: 240px; column-width: 240px; } }

.custom-grid .masonry-item { display: inline-block; width: 100%; margin: 0 0 10px; break-inside: avoid; background: var(--bg-2); border-radius: var(--radius); overflow: hidden; position: relative; }
.custom-grid .masonry-container.qk-cols { column-width: auto; column-count: auto; display: flex; align-items: flex-start; gap: 10px; }
.custom-grid .masonry-container.qk-cols .qk-col { flex: 1 1 0; min-width: 0; }

.post-thumbnail a { display: block; position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent; }

/* --- Indicador de carga de imágenes -------------------------------------- */
/* Sólo con JS activo (clase .js en <html>): sin JS las imágenes se ven igual. */
.js .post-thumbnail a::before,
.js .single-media .postcontent::before {
    content: ""; position: absolute; inset: 0; margin: auto; z-index: 0;
    width: 34px; height: 34px; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .12); border-top-color: var(--accent);
    animation: qk-spin .8s linear infinite;
}
.js .single-media .postcontent { min-height: 120px; }
.js .post-thumbnail img, .js .single-media .postcontent img { position: relative; z-index: 1; opacity: 0; transition: opacity .3s ease, transform .35s ease; }
.js .post-thumbnail img.is-loaded, .js .single-media .postcontent img.is-loaded { opacity: 1; }
.js .post-thumbnail a.has-loaded::before, .js .single-media .postcontent.has-loaded::before { display: none; }
/* GIF de carga propio (Ajustes → General) */
.has-custom-loader .post-thumbnail a::before,
.has-custom-loader .single-media .postcontent::before {
    width: 56px; height: 56px; border: 0; border-radius: 0; animation: none;
    background: var(--qk-loader) center / contain no-repeat;
}
@keyframes qk-spin { to { transform: rotate(360deg); } }
.post-thumbnail img { display: block; width: 100%; height: auto; transition: transform .35s ease, opacity .2s; background: var(--bg-3); }
@media (hover: hover) { .masonry-item:hover .post-thumbnail img { transform: scale(1.05); } }
.post-thumbnail a:focus-visible { outline-offset: -3px; }
.card-badge { position: absolute; z-index: 2; top: 8px; right: 8px; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; pointer-events: none; }
.card-badge .qk-ico { width: 18px; height: 18px; }
.card-badge--gif { width: auto; padding: 0 8px; border-radius: 999px; background: var(--amber); color: #1a1200; }
.card-badge--gif .qk-ico { width: 24px; height: 24px; }
/* GIF animado al pasar el mouse (js/site.js) */
/* Más específico que la regla del indicador de carga (.js .post-thumbnail img). */
.post-thumbnail a .card-anim, .js .post-thumbnail a .card-anim { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s ease; pointer-events: none; background: transparent; transform: none; }
.post-thumbnail a .card-anim.is-ready, .js .post-thumbnail a .card-anim.is-ready { opacity: 1; }
.post-thumbnail a.is-animating img:not(.card-anim) { transform: none !important; }
.card-badge--gif { transition: opacity .2s ease; }
.post-thumbnail a.is-animating .card-badge--gif { opacity: .35; }

/* Videos: botón de play al centro de la miniatura */
.card-play { position: absolute; top: 50%; left: 50%; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(0, 0, 0, .55); border: 2px solid rgba(255, 255, 255, .85); color: #fff; pointer-events: none; box-shadow: 0 4px 18px rgba(0, 0, 0, .45); transition: transform .2s ease, background .2s ease; }
.card-play .qk-ico { width: 26px; height: 26px; margin-left: 3px; }
@media (hover: hover) { .masonry-item:hover .card-play { transform: scale(1.1); background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } }
@media (max-width: 599px) { .card-play { width: 44px; height: 44px; margin: -22px 0 0 -22px; } .card-play .qk-ico { width: 22px; height: 22px; } }

.banner-item { display: flex !important; justify-content: center; align-items: center; padding: 8px; }
.banner-item * { max-width: 100%; }
.post-edit-link { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; font-size: 12px; font-weight: 700; color: #fff; background: #4a1010; }
.post-edit-link:hover { background: #8a1a1a; color: #fff; }
.post-admin-links { display: flex; }
.post-admin-links > * { flex: 1 1 50%; min-width: 0; }
.post-del-link { border: 0; border-left: 1px solid rgba(255, 255, 255, .12); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; background: #2c0909; }
.post-del-link:hover, .post-del-link:focus-visible { background: #a61b1b; }
.post-del-link.is-armed, .btn-danger.is-armed { background: #d32f2f; border-color: #d32f2f; color: #fff; }
.post-del-link[disabled], .btn-danger[disabled] { opacity: .6; cursor: progress; }
.btn-danger { background: transparent; border-color: #d32f2f; color: #ff6b6b; }
.btn-danger:hover, .btn-danger:focus-visible { background: #d32f2f; color: #fff; }
.masonry-item.is-removing { transition: opacity .25s ease, transform .25s ease; opacity: 0; transform: scale(.96); }

/* --- Paginación ---------------------------------------------------------- */

.qk-pagination { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 28px 0 8px; }
.qk-pagination[hidden] { display: none; }
.qk-pagination .pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.qk-pagination .page-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-weight: 700; font-size: 14px; }
.qk-pagination a.page-link:hover { border-color: var(--accent); color: var(--accent); }
.qk-pagination .active .page-link { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.qk-pagination .page-ellipsis .page-link { border-color: transparent; background: none; min-width: 20px; }
.qk-pagination .page-word { display: none; }
.qk-pagination .page-number, .qk-pagination .page-edge { display: none; }
.qk-pagination .page-item.active { display: inline-flex; }
.qk-pagination-status { margin: 0; color: var(--muted); font: 12px var(--mono); text-transform: uppercase; letter-spacing: 1px; }
@media (min-width: 600px) {
    .qk-pagination .page-number, .qk-pagination .page-edge { display: inline-flex; }
    .qk-pagination .page-word { display: inline; }
}
.qk-pagination .page-ellipsis { display: none; }
@media (min-width: 600px) { .qk-pagination .page-ellipsis { display: inline-flex; } }

.qk-infinite-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 24px 0 8px; }
.qk-more { min-height: 48px; padding: 12px 34px; font-size: 14px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); background: transparent; border: 1px solid var(--accent); border-radius: 999px; cursor: pointer; }
.qk-more:hover { color: var(--accent-ink); background: var(--accent); }
.qk-infinite-foot.is-loading .qk-more { opacity: .6; pointer-events: none; }
.qk-infinite-status { margin: 0; min-height: 1em; color: var(--muted); font: 12px var(--mono); text-transform: uppercase; letter-spacing: 1px; text-align: center; }

/* --- Entrada individual -------------------------------------------------- */

.single { max-width: 1100px; margin: 0 auto; }
@media (min-width: 1000px) {
    .single { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; max-width: 1400px; }
    .single > .notice { grid-column: 1 / -1; }
    .single-body { position: sticky; top: calc(var(--header-h) + 16px); }
}
.single-media { background: #000; border-radius: var(--radius); overflow: hidden; margin: 0 -8px; }
@media (min-width: 600px) { .single-media { margin: 0; } }
.single-media .postcontent { position: relative; display: flex; justify-content: center; overflow: hidden; }
.single-media .zoomsingle { display: block; width: auto; max-width: 100%; max-height: calc(100vh - var(--header-h) - 24px); max-height: calc(100dvh - var(--header-h) - 24px); object-fit: contain; cursor: zoom-in; touch-action: pan-y; }
.gallery-stack { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.gallery-stack .zoomsingle { max-height: none; width: 100%; }

.qk-embed { position: relative; margin: 0; width: 100%; max-height: calc(100dvh - var(--header-h) - 24px); background: #000; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.qk-embed img, .qk-embed video, .qk-embed iframe { display: block; width: 100%; height: 100%; max-height: inherit; object-fit: contain; border: 0; }
.qk-embed--video video, .qk-embed--img img { height: auto; }
.qk-embed--facade { cursor: pointer; }
.qk-embed-poster { position: absolute; inset: 0; opacity: .75; object-fit: cover !important; }
.qk-embed-play { position: relative; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); transition: transform .2s; }
.qk-embed-play .qk-ico { width: 36px; height: 36px; margin-left: 4px; }
.qk-embed--facade:hover .qk-embed-play { transform: scale(1.08); }
.qk-embed.is-loading::after { content: ""; position: absolute; z-index: 3; width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: var(--accent); animation: qk-spin .8s linear infinite; }
.qk-embed.is-loading .qk-embed-play { opacity: 0; }
@keyframes qk-spin { to { transform: rotate(360deg); } }
.qk-player-notice { margin: 0; padding: 8px 12px; font-size: 13px; color: var(--amber); background: rgba(245, 165, 36, .08); border-bottom: 1px solid rgba(245, 165, 36, .25); }

.single-body { padding: 16px 4px 0; }
.single-title { font: 800 clamp(20px, 4.5vw, 28px)/1.2 var(--sans); margin: 0 0 6px; overflow-wrap: anywhere; }
.single-meta { color: var(--muted); font: 12px var(--mono); margin: 0 0 16px; }
.single-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
@media (max-width: 599px) {
    .single-actions .btn { flex: 1 1 calc(50% - 8px); }
}
.single-content { margin: 0 0 16px; overflow-wrap: anywhere; }
.single-content .qk-embed { border-radius: var(--radius); margin: 12px 0; }

.zip-form { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); margin: 0 0 16px; }
.zip-form strong { display: flex; align-items: center; gap: 8px; }
.zip-size { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.zip-status { margin: 0; font-size: 13px; color: var(--muted); min-height: 1em; }

.post_tags { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.post_tags a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px; background: var(--bg-3); color: var(--text); font-size: 13px; }
.post_tags a:hover { color: var(--accent); }
.post_tags .qk-ico { width: 14px; height: 14px; color: var(--accent); }

.post-navigation { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.post-navigation a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px; border-radius: 10px; color: var(--text); font-weight: 600; }
.post-navigation a:hover { background: var(--bg-3); color: var(--accent); }

/* --- Comentarios --------------------------------------------------------- */

.comments { max-width: 760px; margin: 0 auto; scroll-margin-top: calc(var(--header-h) + 12px); }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment { padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment-children { margin-left: 18px; padding-left: 12px; border-left: 2px solid var(--line); }
.comment-children .comment:last-child { border-bottom: 0; }
.comment.is-pinned { background: linear-gradient(90deg, rgba(245, 165, 36, .07), transparent); }
.comment-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.qk-avatar { border-radius: 8px; flex: 0 0 auto; }
.comment-author { font-weight: 700; }
.comment-badge { display: inline-flex; align-items: center; gap: 4px; font: 700 10px var(--mono); text-transform: uppercase; letter-spacing: 1px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 174, 193, .15); color: var(--accent); }
.comment-badge--pin { background: rgba(245, 165, 36, .15); color: var(--amber); }
.comment-badge .qk-ico { width: 12px; height: 12px; }
.comment-head time { color: var(--muted); font-size: 12px; margin-left: auto; }
.comment-text { overflow-wrap: anywhere; }
.comment-reply { margin-top: 6px; min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--muted); font-size: 13px; cursor: pointer; }
.comment-reply:hover { color: var(--accent); border-color: var(--accent); }

.comment-form { margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.comment-form-title { font-size: 17px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.optional { font-weight: 400; color: var(--muted); }
.form-row input, .form-row textarea { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 16px var(--sans); }
.form-row input:focus, .form-row textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(0, 174, 193, .25); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.comment-replying { color: var(--muted); font-size: 14px; }

/* --- Tags ---------------------------------------------------------------- */

.tag-letters { position: sticky; top: var(--header-h); z-index: 5; display: flex; gap: 4px; overflow-x: auto; padding: 8px 4px; background: var(--bg); scrollbar-width: none; }
.tag-letters a { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; border-radius: 10px; background: var(--bg-2); color: var(--text); font: 700 14px var(--mono); }
.tag-letters a:hover { color: var(--accent); }
.tag-index { columns: 1; column-gap: 24px; }
@media (min-width: 600px) { .tag-index { columns: 2; } }
@media (min-width: 1000px) { .tag-index { columns: 4; } }
.tag-group { break-inside: avoid; margin: 0 4px 20px; scroll-margin-top: calc(var(--header-h) + 60px); }
.tag-group h2 { font: 800 22px var(--mono); color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.tag-group ul { list-style: none; margin: 0; padding: 0; }
.tag-group a { display: flex; justify-content: space-between; gap: 8px; min-height: 40px; align-items: center; padding: 6px 8px; border-radius: 8px; color: var(--text); }
.tag-group a:hover { background: var(--bg-2); color: var(--accent); }
.tag-n { color: var(--muted); font: 12px var(--mono); }

/* --- Mensajes y 404 ------------------------------------------------------ */

.message-page { max-width: 520px; margin: 8vh auto; text-align: center; padding: 0 12px; }
.message-code { font: 800 clamp(64px, 20vw, 120px)/1 var(--mono); color: var(--accent); margin: 0; text-shadow: 0 0 40px rgba(0, 174, 193, .35); }
.message-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }

/* --- Pie y botones flotantes -------------------------------------------- */

.site-footer { border-top: 1px solid var(--line); padding: 20px 16px calc(84px + var(--safe-b)); text-align: center; color: var(--muted); font-size: 13px; }
.site-footer p { margin: 4px 0; }
.site-footer-links { display: flex; justify-content: center; gap: 16px; }
.site-footer-links a { color: var(--muted); padding: 8px; }
.scroll-buttons { position: fixed; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 40; display: flex; flex-direction: column; gap: 8px; }
.scroll-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(23, 25, 28, .9); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.scroll-btn:hover { border-color: var(--accent); color: var(--accent); }

/* =============================================================================
   POPUP
   En el teléfono ocupa toda la pantalla: se desliza a los costados para pasar
   de entrada y hacia abajo para cerrar. En escritorio es una ventana centrada
   con flechas.
   ========================================================================== */

.qk-popup { position: fixed; inset: 0; z-index: 200; display: flex; align-items: stretch; justify-content: center; }
.qk-popup[hidden] { display: none; }
.qk-popup-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .88); animation: qk-fade .2s ease; }
.qk-popup-panel { position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; background: #000; animation: qk-up .22s cubic-bezier(.2, .8, .2, 1); touch-action: pan-y; }
.qk-popup.is-dragging .qk-popup-panel { animation: none; transition: none; }
.qk-popup.is-closing .qk-popup-panel { transition: transform .18s ease, opacity .18s ease; }
@keyframes qk-fade { from { opacity: 0; } }
@keyframes qk-up { from { transform: translateY(24px); opacity: 0; } }

.qk-popup-bar { position: relative; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 6px 6px 14px; padding-top: max(6px, env(safe-area-inset-top)); background: rgba(17, 18, 20, .96); border-bottom: 1px solid var(--line); }
.qk-popup-grip { position: absolute; top: 5px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: #3a3f45; }
.qk-popup-title { flex: 1; min-width: 0; margin: 0; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qk-popup-title a { color: var(--text); }
.qk-popup-count { color: var(--muted); font: 12px var(--mono); }
.qk-popup-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--bg-3); cursor: pointer; }
.qk-popup-close:hover { color: var(--accent); }

.qk-popup-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.qk-popup-stage.is-loading::after { content: ""; position: absolute; width: 38px; height: 38px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: qk-spin .8s linear infinite; }
@keyframes qk-spin { to { transform: rotate(360deg); } }
.qk-popup-media { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.qk-popup-media > img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.qk-popup-frame { position: relative; background: #000; }
.qk-popup-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.qk-popup-error { color: var(--muted); padding: 20px; text-align: center; }

/* Galería dentro del popup: tira horizontal con imán */
.qk-popup-strip { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.qk-popup-strip::-webkit-scrollbar { display: none; }
.qk-popup-strip figure { flex: 0 0 100%; height: 100%; margin: 0; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; }
.qk-popup-strip img { max-width: 100%; max-height: 100%; object-fit: contain; }

.qk-popup-foot { background: rgba(17, 18, 20, .96); border-top: 1px solid var(--line); padding: 8px 8px calc(8px + var(--safe-b)); }
.qk-popup-tags { list-style: none; margin: 0 0 6px; padding: 0 2px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.qk-popup-tags:empty { display: none; }
.qk-popup-tags a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 32px; padding: 4px 10px; border-radius: 999px; background: var(--bg-3); color: var(--text); font-size: 13px; white-space: nowrap; }
.qk-popup-actions { display: flex; gap: 6px; }
.qk-popup-actions .btn { flex: 1; min-width: 0; padding: 8px 10px; font-size: 13px; }
.qk-popup-actions .btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.qk-popup-nav { display: none; }

@media (max-width: 599px) {
    .qk-popup-actions .btn .lbl { display: none; }
    .qk-popup-actions .btn { padding: 8px; }
}

@media (min-width: 900px) {
    .qk-popup { align-items: center; padding: 24px 72px; }
    .qk-popup-panel { width: min(1400px, 100%); height: min(94vh, 100%); border-radius: 16px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
    .qk-popup-grip { display: none; }
    .qk-popup-nav { position: fixed; top: 50%; z-index: 3; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-top: -26px; border-radius: 50%; border: 1px solid var(--line); background: rgba(23, 25, 28, .9); color: var(--text); cursor: pointer; }
    .qk-popup-nav:hover { color: var(--accent); border-color: var(--accent); }
    .qk-popup-nav[disabled] { opacity: .25; cursor: default; }
    .qk-popup-prev { left: 12px; }
    .qk-popup-next { right: 12px; }
    .qk-popup-foot { display: flex; align-items: center; gap: 12px; }
    .qk-popup-tags { flex: 1; margin: 0; }
    .qk-popup-actions { flex: 0 0 auto; }
    .qk-popup-actions .btn { flex: 0 0 auto; }
}
