/* ===================== Footer ===================== */
/* Reemplaza las reglas genéricas que tenía en styles.css (fondo negro liso,
   height:300px fijo). Se mantiene el selector "body > footer" (en vez de
   "footer" a secas) por el mismo motivo que entonces: no se filtra a los
   <footer class="post-footer"> anidados en las tarjetas del blog. */
body > footer {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
    background:
        radial-gradient(circle at 78% 18%, rgba(104, 49, 109, 0.16), transparent 34%),
        linear-gradient(145deg, #05040a 0%, #0b0710 55%, #05040a 100%);
    border-top: 1px solid rgba(195, 135, 191, 0.25);
    color: #eee0f0;
    padding: 58px 24px 28px;
}

body > footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12%;
    width: 76%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(195, 135, 191, 0.8), transparent);
    box-shadow: 0 0 18px rgba(195, 135, 191, 0.35);
}

body > footer p {
    margin: 0;
}

.footer-content {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(180px, 0.85fr) minmax(260px, 1.35fr) minmax(190px, 0.8fr);
    align-items: center;
    gap: 42px;
}

.footer-brand,
.footer-signature,
.footer-meta {
    min-width: 0;
    text-align: center;
}

.footer-kicker {
    display: block;
    margin-bottom: 14px;
    color: rgba(195, 135, 191, 0.7);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    line-height: 1.4;
    text-transform: uppercase;
}

.footer-logo-link {
    display: block;
    width: fit-content;
    margin-inline: auto;
}

.footer-logo {
    display: block;
    max-width: 100%;
    height: 34px;
    width: auto;
    opacity: 0.85;
    transition: opacity 0.25s ease, filter 0.25s ease;
}

.footer-logo-link:hover .footer-logo {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(195, 135, 191, 0.45));
}

.footer-tagline {
    margin-top: 12px !important;
    font-size: 0.8rem;
    color: rgba(238, 224, 240, 0.5);
}

.footer-signature {
    padding: 0 28px;
    border-left: 1px solid rgba(195, 135, 191, 0.25);
    border-right: 1px solid rgba(195, 135, 191, 0.25);
}

.footer-signature h2 {
    margin: 0;
    color: #fff;
    font-family: "Bungee", cursive;
    font-size: 1.75rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1.1;
    text-shadow: 0 0 22px rgba(195, 135, 191, 0.35);
}

.footer-signature p {
    margin-top: 12px !important;
    color: rgba(238, 224, 240, 0.58);
    font-family: "JetBrains Mono", monospace;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
}

.footer-meta {
    justify-self: center;
    width: 100%;
    container: footer-meta / inline-size;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.footer-link {
    display: inline-block;
    white-space: nowrap;
    color: rgba(238, 224, 240, 0.75);
    text-decoration: none;
    cursor: pointer;
    padding-bottom: 2px;
    background-image: linear-gradient(#C387BF, #C387BF);
    background-size: 0 1px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: color 0.25s ease, background-size 0.25s ease;
}

.footer-link:hover,
.footer-link:focus-visible {
    color: #fff;
    background-size: 100% 1px;
}

.footer-divider {
    display: inline-block;
    color: #C387BF;
    font-size: 0.9em;
    line-height: 1;
    vertical-align: middle;
    text-shadow: 0 0 8px rgba(195, 135, 191, 0.7);
    animation: footerNodePulse 3.4s ease-in-out infinite;
}

@keyframes footerNodePulse {
    0%, 100% {
        opacity: 0.55;
        transform: translateY(-1px) scale(0.9);
    }
    50% {
        opacity: 1;
        transform: translateY(-1px) scale(1.1);
    }
}

.footer-copy {
    margin-top: 18px !important;
    font-size: 0.72rem;
    white-space: nowrap;
    color: rgba(238, 224, 240, 0.4);
}

.footer-scanline {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3px;
    margin: 42px auto 0;
    opacity: 0.35;
}

.footer-dot {
    display: block;
    flex: 0 0 2px;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #C387BF;
    box-shadow: 0 0 4px rgba(195, 135, 191, 0.7);
    animation: footerDotFlicker var(--dot-duration) ease-in-out var(--dot-delay) infinite;
}

@keyframes footerDotFlicker {
    0%, 100% {
        opacity: 0.25;
        transform: scale(0.75);
    }
    42% {
        opacity: 0.35;
        transform: scale(0.85);
    }
    50% {
        opacity: 1;
        transform: scale(1.4);
        box-shadow: 0 0 8px rgba(195, 135, 191, 0.95);
    }
    58% {
        opacity: 0.4;
        transform: scale(0.9);
    }
}

@media (min-width: 768px) {
    body > footer {
        padding: 64px 40px 32px;
    }

    .footer-signature h2 { font-size: 2.15rem; }
}

@media (max-width: 767px) {
    body > footer {
        padding: 48px 22px 24px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        align-items: center;
        gap: 34px;
    }

    .footer-signature {
        padding: 24px 0;
        border-top: 1px solid rgba(195, 135, 191, 0.25);
        border-left: 0;
        border-right: 0;
        border-bottom: 1px solid rgba(195, 135, 191, 0.25);
    }

    .footer-scanline {
        margin-top: 34px;
    }
}

@media (min-width: 768px) and (max-width: 1100px) {
    .footer-content {
        grid-template-columns: minmax(150px, 0.8fr) minmax(260px, 1.35fr) minmax(240px, 1.1fr);
        gap: 24px;
    }
}

@container footer-meta (max-width: 270px) {
    .footer-links {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .footer-dot {
        opacity: 0.55;
        animation: none;
    }
}

/* ===================== Modal de políticas legales ===================== */

.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.legal-modal.show {
    display: flex;
}

.legal-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 4, 10, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.legal-modal-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 720px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    background: rgba(10, 6, 18, 0.96);
    border: 1px solid rgba(195, 135, 191, 0.35);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(195, 135, 191, 0.15);
    padding: 26px 8px 18px 26px;
    animation: legalModalIn 0.25s ease;
}

@keyframes legalModalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .legal-modal-panel,
    .footer-divider { animation: none; }
}

.legal-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(195, 135, 191, 0.35);
    background: rgba(255, 255, 255, 0.05);
    color: #eee0f0;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.legal-modal-close:hover {
    background: rgba(195, 135, 191, 0.18);
    border-color: #C387BF;
    color: #fff;
}

.legal-modal-title {
    font-family: "Bungee", cursive;
    font-size: 1.05rem;
    color: #eee0f0;
    margin: 0 0 4px 0;
    padding-right: 34px;
}

.legal-modal-updated {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    color: rgba(195, 135, 191, 0.75);
    margin: 0 0 18px 0;
    padding-right: 34px;
}

.legal-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 18px;
    font-size: 0.88rem;
    line-height: 1.65;
    color: rgba(238, 224, 240, 0.85);
}

.legal-modal-body::-webkit-scrollbar {
    width: 10px;
}

.legal-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.legal-modal-body::-webkit-scrollbar-thumb {
    background: rgba(195, 135, 191, 0.35);
    border-radius: 10px;
}

.legal-content {
    display: none;
}

.legal-content.active {
    display: block;
}

.legal-content h3 {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #C387BF;
    margin: 22px 0 8px 0;
}

.legal-content h3:first-child {
    margin-top: 0;
}

.legal-content p {
    margin: 0 0 10px 0;
}

.legal-content ul {
    margin: 0 0 10px 0;
    padding-left: 20px;
}

.legal-content li {
    margin-bottom: 4px;
}

.legal-content a {
    color: #C387BF;
    text-decoration: underline;
    text-decoration-color: rgba(195, 135, 191, 0.4);
    text-underline-offset: 2px;
}

.legal-content a:hover {
    color: #fff;
}

.legal-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 4px 0 14px 0;
    font-size: 0.82rem;
}

.legal-content th,
.legal-content td {
    text-align: left;
    padding: 8px 10px;
    border: 1px solid rgba(195, 135, 191, 0.2);
    vertical-align: top;
}

.legal-content th {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #C387BF;
    background: rgba(195, 135, 191, 0.08);
}

.legal-content code {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.85em;
    background: rgba(195, 135, 191, 0.12);
    padding: 1px 5px;
    border-radius: 3px;
}

.legal-content .legal-switch {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: #C387BF;
    text-decoration: underline;
    text-decoration-color: rgba(195, 135, 191, 0.4);
    text-underline-offset: 2px;
    cursor: pointer;
}

.legal-content .legal-switch:hover {
    color: #fff;
}

@media (max-width: 600px) {
    .legal-modal-panel {
        max-height: 88vh;
        padding: 22px 6px 16px 20px;
    }
}
