/* Nintendo Legacy – Apariencia global v2.6 */

:root {
    --nl-red: #e60012;
    --nl-red-dark: #ac000d;
    --nl-dark-bg: #111114;
    --nl-dark-surface: #1b1b20;
    --nl-dark-surface-2: #222228;
    --nl-dark-header: #17171c;
    --nl-dark-line: #38383f;
    --nl-dark-text: #f4f4f6;
    --nl-dark-muted: #b9bac1;
}

html[data-nl-theme="dark"] {
    color-scheme: dark;
    background: var(--nl-dark-bg) !important;

    /* Variables comunes de Blocksy y otros temas modernos. */
    --theme-palette-color-1: #e60012;
    --theme-palette-color-2: #ff4d5d;
    --theme-palette-color-3: #f4f4f6;
    --theme-palette-color-4: #dddde3;
    --theme-palette-color-5: #b9bac1;
    --theme-palette-color-6: #38383f;
    --theme-palette-color-7: #1b1b20;
    --theme-palette-color-8: #111114;
    --theme-text-color: #f4f4f6;
    --theme-link-initial-color: #f4f4f6;
    --theme-link-hover-color: #ff4d5d;
    --theme-border-color: #38383f;
    --theme-form-field-background-initial-color: #202026;
    --theme-form-field-border-initial-color: #44444c;
    --theme-form-field-text-initial-color: #f4f4f6;
}

html[data-nl-theme="dark"],
html[data-nl-theme="dark"] body,
html[data-nl-theme="dark"] #page,
html[data-nl-theme="dark"] .site,
html[data-nl-theme="dark"] .wp-site-blocks,
html[data-nl-theme="dark"] #main-container,
html[data-nl-theme="dark"] #content,
html[data-nl-theme="dark"] #main,
html[data-nl-theme="dark"] #primary,
html[data-nl-theme="dark"] .site-content,
html[data-nl-theme="dark"] .content-area,
html[data-nl-theme="dark"] .site-main,
html[data-nl-theme="dark"] .ct-container,
html[data-nl-theme="dark"] .ct-container-full,
html[data-nl-theme="dark"] .ct-drawer-canvas,
html[data-nl-theme="dark"] main:not(.nn-news-page) {
    color: var(--nl-dark-text) !important;
    background-color: var(--nl-dark-bg) !important;
}

html[data-nl-theme="dark"] body {
    transition: color 180ms ease, background-color 180ms ease;
}

/* Header, navegación, buscador y panel móvil. */
html[data-nl-theme="dark"] #header,
html[data-nl-theme="dark"] #masthead,
html[data-nl-theme="dark"] .ct-header,
html[data-nl-theme="dark"] .ct-sticky-container,
html[data-nl-theme="dark"] .ct-header [data-row],
html[data-nl-theme="dark"] .site-header,
html[data-nl-theme="dark"] .main-header-bar,
html[data-nl-theme="dark"] .ast-primary-header-bar,
html[data-nl-theme="dark"] header.wp-block-template-part,
html[data-nl-theme="dark"] .wp-site-blocks > header,
html[data-nl-theme="dark"] .wp-block-navigation__responsive-container,
html[data-nl-theme="dark"] .ct-panel,
html[data-nl-theme="dark"] .ct-panel-inner,
html[data-nl-theme="dark"] .ct-header-search,
html[data-nl-theme="dark"] .search-modal,
html[data-nl-theme="dark"] .mobile-menu-wrap,
html[data-nl-theme="dark"] [data-row="top"],
html[data-nl-theme="dark"] [data-row="middle"],
html[data-nl-theme="dark"] [data-row="bottom"] {
    color: var(--nl-dark-text) !important;
    background: var(--nl-dark-header) !important;
    border-color: var(--nl-dark-line) !important;
}

html[data-nl-theme="dark"] header a,
html[data-nl-theme="dark"] header button,
html[data-nl-theme="dark"] .ct-header a,
html[data-nl-theme="dark"] .ct-header button,
html[data-nl-theme="dark"] .site-header a,
html[data-nl-theme="dark"] .site-header button,
html[data-nl-theme="dark"] .wp-block-navigation-item__content,
html[data-nl-theme="dark"] .menu-item > a,
html[data-nl-theme="dark"] .ct-header-trigger,
html[data-nl-theme="dark"] .ct-search-initiator {
    color: var(--nl-dark-text) !important;
}

html[data-nl-theme="dark"] header a:hover,
html[data-nl-theme="dark"] header button:hover,
html[data-nl-theme="dark"] .ct-header a:hover,
html[data-nl-theme="dark"] .ct-header button:hover,
html[data-nl-theme="dark"] .site-header a:hover,
html[data-nl-theme="dark"] .site-header button:hover,
html[data-nl-theme="dark"] .wp-block-navigation-item__content:hover,
html[data-nl-theme="dark"] .menu-item > a:hover {
    color: #ff4d5d !important;
}

html[data-nl-theme="dark"] header svg,
html[data-nl-theme="dark"] .ct-header svg,
html[data-nl-theme="dark"] .site-header svg,
html[data-nl-theme="dark"] footer svg {
    color: currentColor;
    fill: currentColor;
}

/* Contenido de entradas, páginas, archivos y categorías. */
html[data-nl-theme="dark"] article,
html[data-nl-theme="dark"] .entry-content,
html[data-nl-theme="dark"] .wp-block-post-content,
html[data-nl-theme="dark"] .entry-card,
html[data-nl-theme="dark"] .post,
html[data-nl-theme="dark"] .page,
html[data-nl-theme="dark"] .ct-related-posts,
html[data-nl-theme="dark"] .post-navigation,
html[data-nl-theme="dark"] .author-box,
html[data-nl-theme="dark"] .comment-respond,
html[data-nl-theme="dark"] .comment-list .comment-body,
html[data-nl-theme="dark"] .ct-sidebar .ct-widget,
html[data-nl-theme="dark"] .widget,
html[data-nl-theme="dark"] .wp-block-latest-posts li,
html[data-nl-theme="dark"] .wp-block-query .wp-block-post {
    color: var(--nl-dark-text) !important;
    border-color: var(--nl-dark-line) !important;
}

html[data-nl-theme="dark"] .entry-card,
html[data-nl-theme="dark"] .ct-related-posts,
html[data-nl-theme="dark"] .author-box,
html[data-nl-theme="dark"] .comment-respond,
html[data-nl-theme="dark"] .comment-list .comment-body,
html[data-nl-theme="dark"] .ct-sidebar .ct-widget,
html[data-nl-theme="dark"] .widget {
    background-color: var(--nl-dark-surface) !important;
}

html[data-nl-theme="dark"] h1,
html[data-nl-theme="dark"] h2,
html[data-nl-theme="dark"] h3,
html[data-nl-theme="dark"] h4,
html[data-nl-theme="dark"] h5,
html[data-nl-theme="dark"] h6,
html[data-nl-theme="dark"] .entry-title,
html[data-nl-theme="dark"] .page-title,
html[data-nl-theme="dark"] .wp-block-post-title {
    color: #f7f7f9 !important;
}

html[data-nl-theme="dark"] p,
html[data-nl-theme="dark"] li,
html[data-nl-theme="dark"] blockquote,
html[data-nl-theme="dark"] figcaption,
html[data-nl-theme="dark"] .entry-summary {
    border-color: var(--nl-dark-line);
}

html[data-nl-theme="dark"] .entry-meta,
html[data-nl-theme="dark"] .post-meta,
html[data-nl-theme="dark"] .ct-breadcrumbs,
html[data-nl-theme="dark"] .wp-block-post-date,
html[data-nl-theme="dark"] time,
html[data-nl-theme="dark"] .comment-metadata {
    color: var(--nl-dark-muted) !important;
}

html[data-nl-theme="dark"] .entry-content a:not(.wp-element-button):not(.wp-block-button__link),
html[data-nl-theme="dark"] .site-main a:not(.wp-element-button):not(.wp-block-button__link) {
    color: #ff6573;
}

html[data-nl-theme="dark"] .entry-content a:hover,
html[data-nl-theme="dark"] .site-main a:hover {
    color: #ff8b95;
}

/* Formularios, tablas, código y controles. */
html[data-nl-theme="dark"] input:not([type="submit"]):not([type="button"]),
html[data-nl-theme="dark"] select,
html[data-nl-theme="dark"] textarea,
html[data-nl-theme="dark"] .wp-block-search__input,
html[data-nl-theme="dark"] .ct-search-form input,
html[data-nl-theme="dark"] .search-field {
    color: var(--nl-dark-text) !important;
    background: #202026 !important;
    border-color: #44444c !important;
}

html[data-nl-theme="dark"] input::placeholder,
html[data-nl-theme="dark"] textarea::placeholder {
    color: #a9a9b0 !important;
}

html[data-nl-theme="dark"] table,
html[data-nl-theme="dark"] th,
html[data-nl-theme="dark"] td,
html[data-nl-theme="dark"] hr {
    color: var(--nl-dark-text);
    border-color: var(--nl-dark-line) !important;
}

html[data-nl-theme="dark"] th {
    background: #202026 !important;
}

html[data-nl-theme="dark"] pre,
html[data-nl-theme="dark"] code,
html[data-nl-theme="dark"] .wp-block-code {
    color: var(--nl-dark-text) !important;
    background: #202026 !important;
    border-color: #44444c !important;
}

html[data-nl-theme="dark"] .pagination,
html[data-nl-theme="dark"] .nav-links,
html[data-nl-theme="dark"] .page-numbers {
    border-color: var(--nl-dark-line) !important;
}

html[data-nl-theme="dark"] .page-numbers.current {
    color: #ffffff !important;
    background: var(--nl-red) !important;
}

/* Footer. */
html[data-nl-theme="dark"] #footer,
html[data-nl-theme="dark"] #colophon,
html[data-nl-theme="dark"] .ct-footer,
html[data-nl-theme="dark"] .ct-footer [data-row],
html[data-nl-theme="dark"] .site-footer,
html[data-nl-theme="dark"] footer.wp-block-template-part,
html[data-nl-theme="dark"] .wp-site-blocks > footer,
html[data-nl-theme="dark"] .footer-widget-area {
    color: #d8d8de !important;
    background: var(--nl-dark-header) !important;
    border-color: var(--nl-dark-line) !important;
}

html[data-nl-theme="dark"] footer a,
html[data-nl-theme="dark"] .ct-footer a,
html[data-nl-theme="dark"] .site-footer a {
    color: var(--nl-dark-text) !important;
}

html[data-nl-theme="dark"] footer a:hover,
html[data-nl-theme="dark"] .ct-footer a:hover,
html[data-nl-theme="dark"] .site-footer a:hover {
    color: #ff4d5d !important;
}

/* Portada personalizada de Nintendo Legacy. */
html[data-nl-theme="dark"] .nn-news-page {
    --nn-text: #f4f4f6;
    --nn-muted: #b9bac1;
    --nn-line: #38383f;
    --nn-soft: #25252b;
    color-scheme: dark;
    background:
        radial-gradient(circle at 8% 7%, rgba(230, 0, 18, 0.14) 0 90px, transparent 91px),
        radial-gradient(circle at 94% 30%, rgba(91, 105, 216, 0.12) 0 120px, transparent 121px),
        var(--nl-dark-bg) !important;
}

html[data-nl-theme="dark"] .nn-news-page .nn-card {
    background: var(--nl-dark-surface) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.30);
}

html[data-nl-theme="dark"] .nn-news-page .nn-card:hover {
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.42);
}

html[data-nl-theme="dark"] .nn-news-page .nn-compact-card {
    background: var(--nl-dark-surface-2) !important;
}

html[data-nl-theme="dark"] .nn-news-page .nn-compact-card:hover {
    background: var(--nl-dark-surface) !important;
}

html[data-nl-theme="dark"] .nn-news-page .nn-compact-image {
    background: #2b2b31 !important;
}

html[data-nl-theme="dark"] .nn-news-page .nn-amazon-banner {
    background:
        radial-gradient(circle at 92% 18%, rgba(230, 0, 18, 0.18) 0 86px, transparent 88px),
        radial-gradient(circle at 77% 112%, rgba(91, 105, 216, 0.12) 0 170px, transparent 172px),
        linear-gradient(135deg, #1b1b20 0%, #1b1b20 63%, #2a171b 100%) !important;
    border-color: rgba(230, 0, 18, 0.34) !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
}

html[data-nl-theme="dark"] .nn-news-page .nn-amazon-points span {
    color: #ececef !important;
    background: #27272d !important;
}

html[data-nl-theme="dark"] .nn-news-page .nn-amazon-action {
    color: #242424 !important;
    background: rgba(255, 255, 255, 0.97) !important;
}

html[data-nl-theme="dark"] .nn-news-page .nn-amazon-action small {
    color: #66666c !important;
}

html[data-nl-theme="dark"] .nn-news-page .nn-status {
    background: #202026 !important;
}

html[data-nl-theme="dark"] .nn-news-page .nn-disclaimer {
    color: #a9a9b0 !important;
}



/* =========================================================
   Refuerzo global para entradas y páginas en tablet/móvil.
   Cubre las plantillas responsive del tema, no solo la portada.
   ========================================================= */
html[data-nl-theme="dark"] body.single,
html[data-nl-theme="dark"] body.page,
html[data-nl-theme="dark"] body.archive,
html[data-nl-theme="dark"] body.category,
html[data-nl-theme="dark"] body.search,
html[data-nl-theme="dark"] body.blog,
html[data-nl-theme="dark"] .hero-section,
html[data-nl-theme="dark"] .entry-header,
html[data-nl-theme="dark"] .page-header,
html[data-nl-theme="dark"] .single-content,
html[data-nl-theme="dark"] .ct-comments,
html[data-nl-theme="dark"] .comments-area,
html[data-nl-theme="dark"] #comments,
html[data-nl-theme="dark"] .ct-share-box,
html[data-nl-theme="dark"] .ct-author-box,
html[data-nl-theme="dark"] .ct-related-posts-container,
html[data-nl-theme="dark"] .ct-posts-shortcode,
html[data-nl-theme="dark"] .ct-archive-container,
html[data-nl-theme="dark"] [data-content="normal"],
html[data-nl-theme="dark"] [data-content="narrow"],
html[data-nl-theme="dark"] [data-content="wide"] {
    color: var(--nl-dark-text) !important;
    background-color: var(--nl-dark-bg) !important;
    border-color: var(--nl-dark-line) !important;
}

html[data-nl-theme="dark"] article.post,
html[data-nl-theme="dark"] article.page,
html[data-nl-theme="dark"] .entry-content,
html[data-nl-theme="dark"] .wp-block-post-content,
html[data-nl-theme="dark"] .comment-content {
    color: var(--nl-dark-text) !important;
    background-color: transparent !important;
}

html[data-nl-theme="dark"] .entry-content > *,
html[data-nl-theme="dark"] .wp-block-post-content > * {
    border-color: var(--nl-dark-line);
}

html[data-nl-theme="dark"] .wp-block-group.has-background,
html[data-nl-theme="dark"] .wp-block-columns.has-background,
html[data-nl-theme="dark"] .wp-block-media-text.has-background,
html[data-nl-theme="dark"] .wp-block-cover__inner-container {
    color: var(--nl-dark-text) !important;
    border-color: var(--nl-dark-line) !important;
}

@media (max-width: 1319px) {
    html[data-nl-theme="dark"],
    html[data-nl-theme="dark"] body,
    html[data-nl-theme="dark"] #page,
    html[data-nl-theme="dark"] #main-container,
    html[data-nl-theme="dark"] #main,
    html[data-nl-theme="dark"] #content,
    html[data-nl-theme="dark"] #primary,
    html[data-nl-theme="dark"] .site,
    html[data-nl-theme="dark"] .site-content,
    html[data-nl-theme="dark"] .site-main,
    html[data-nl-theme="dark"] .content-area,
    html[data-nl-theme="dark"] .ct-container,
    html[data-nl-theme="dark"] .ct-container-full,
    html[data-nl-theme="dark"] .hero-section,
    html[data-nl-theme="dark"] .entry-header,
    html[data-nl-theme="dark"] .page-header,
    html[data-nl-theme="dark"] .comments-area,
    html[data-nl-theme="dark"] #comments {
        color: var(--nl-dark-text) !important;
        background-color: var(--nl-dark-bg) !important;
        border-color: var(--nl-dark-line) !important;
    }

    html[data-nl-theme="dark"] .entry-card,
    html[data-nl-theme="dark"] .ct-related-posts,
    html[data-nl-theme="dark"] .ct-sidebar .ct-widget,
    html[data-nl-theme="dark"] .widget,
    html[data-nl-theme="dark"] .comment-list .comment-body,
    html[data-nl-theme="dark"] .comment-respond {
        color: var(--nl-dark-text) !important;
        background-color: var(--nl-dark-surface) !important;
        border-color: var(--nl-dark-line) !important;
    }
}

/* =========================================================
   Interruptor global v3 — una sola forma en todo el sitio.
   El JavaScript nunca mueve este nodo dentro del contenido;
   solo calcula su posición visual mediante CSS variables.
   ========================================================= */

#nl-theme-v3-control[hidden] {
    display: none !important;
}

.nl-theme-v3-control {
    --nl-v3-left: auto;
    --nl-v3-top: 220px;
    position: fixed !important;
    z-index: 2147482000 !important;
    top: var(--nl-v3-top) !important;
    left: var(--nl-v3-left) !important;
    right: auto !important;
    bottom: auto !important;
    width: 92px !important;
    height: 50px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    pointer-events: none !important;
    isolation: isolate !important;
}

.nl-theme-v3-switch {
    all: unset;
    box-sizing: border-box !important;
    display: block !important;
    width: 92px !important;
    height: 50px !important;
    margin: 0 !important;
    padding: 3px !important;
    color: #ffffff !important;
    background: #e60012 !important;
    border: 2px solid rgba(255, 255, 255, 0.96) !important;
    border-radius: 999px !important;
    box-shadow: 0 7px 0 #ac000d, 0 14px 28px rgba(0, 0, 0, 0.22) !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    -webkit-tap-highlight-color: transparent !important;
    transition: transform 170ms ease, background 170ms ease, box-shadow 170ms ease !important;
}

.nl-theme-v3-switch:hover {
    background: #c90010 !important;
    transform: translateY(2px) !important;
    box-shadow: 0 5px 0 #740008, 0 12px 24px rgba(0, 0, 0, 0.24) !important;
}

.nl-theme-v3-switch:focus-visible {
    outline: 4px solid #3946a0 !important;
    outline-offset: 4px !important;
}

.nl-theme-v3-track {
    box-sizing: border-box !important;
    position: relative !important;
    display: grid !important;
    grid-template-columns: repeat(2, 40px) !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 82px !important;
    height: 40px !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

.nl-theme-v3-thumb {
    box-sizing: border-box !important;
    position: absolute !important;
    z-index: 1 !important;
    top: 0 !important;
    left: 0 !important;
    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    border: 0 !important;
    border-radius: 50% !important;
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.24) !important;
    transform: translateX(0) !important;
    transition: transform 240ms cubic-bezier(.2,.8,.2,1), background 200ms ease !important;
}

.nl-theme-v3-icon {
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 2 !important;
    display: grid !important;
    place-items: center !important;
    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: color 200ms ease, opacity 200ms ease, transform 220ms ease !important;
}

.nl-theme-v3-icon svg {
    display: block !important;
    width: 23px !important;
    height: 23px !important;
    margin: 0 !important;
    padding: 0 !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 2.2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
}

.nl-theme-v3-sun {
    color: #e60012 !important;
    opacity: 1 !important;
}

.nl-theme-v3-moon {
    color: #ffffff !important;
    opacity: 0.76 !important;
}

.nl-theme-v3-switch:hover .nl-theme-v3-icon {
    transform: scale(1.06) !important;
}

html[data-nl-theme="dark"] .nl-theme-v3-switch {
    background: #e60012 !important;
    border-color: rgba(255, 255, 255, 0.80) !important;
    box-shadow: 0 7px 0 #650008, 0 14px 28px rgba(0, 0, 0, 0.46) !important;
}

html[data-nl-theme="dark"] .nl-theme-v3-thumb {
    background: #24242a !important;
    transform: translateX(42px) !important;
}

html[data-nl-theme="dark"] .nl-theme-v3-sun {
    color: #ffffff !important;
    opacity: 0.62 !important;
}

html[data-nl-theme="dark"] .nl-theme-v3-moon {
    color: #ffffff !important;
    opacity: 1 !important;
}

/*
 * En tablet y móvil se conserva exactamente la misma forma y dimensiones.
 * Solo cambia la posición a una esquina segura porque no existe margen lateral
 * suficiente para colocarlo fuera del contenido.
 */
.nl-theme-v3-control[data-nl-layout="compact"] {
    top: auto !important;
    left: auto !important;
    right: max(12px, env(safe-area-inset-right)) !important;
    bottom: max(22px, calc(env(safe-area-inset-bottom) + 12px)) !important;
}

@media (prefers-reduced-motion: reduce) {
    .nl-theme-v3-switch,
    .nl-theme-v3-thumb,
    .nl-theme-v3-icon {
        transition: none !important;
    }
}
