/*
Theme Name: Geserisk
Theme URI: https://www.geserisk.es
Author: Geserisk
Author URI: https://www.geserisk.es
Description: Tema corporativo de Geserisk — Ciberseguridad Gestionada IT/OT. Diseño oscuro con tipografía Syne + DM Sans, acento rojo #B82132.
Version: 1.0.0
License: Proprietary
Text Domain: geserisk
*/

/* DESIGN TOKENS */
:root {
  --red: #B82132; --red-dark: #8B1A27; --red-light: #D94555;
  --bg: #0A0A0C; --bg2: #111115; --bg3: #18181E; --surface: #1E1E26;
  --border: rgba(255,255,255,0.07); --text: #F0EEE8; --muted: #888890; --accent: #FF3A50;
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: "DM Sans", sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; line-height: 1.6; }
body::before { content: ""; position: fixed; inset: 0; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E"); opacity: 0.025; pointer-events: none; z-index: 9999; }
a { color: var(--red-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--red); }
img { max-width: 100%; height: auto; display: block; }

/* NAV */
#site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 0 5vw; height: 72px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid rgba(0,0,0,0.08); box-shadow: 0 1px 20px rgba(0,0,0,0.06); }
.site-branding a { text-decoration: none; display: flex; align-items: center; }
.site-branding img { height: 40px; width: auto; }
.site-title-text { font-family: "Syne", sans-serif; font-size: 1.5rem; font-weight: 800; color: #111; letter-spacing: -0.03em; }
.site-title-text span { color: var(--red); }
#primary-navigation ul { display: flex; gap: 2rem; list-style: none; }
#primary-navigation ul li a { color: #444; text-decoration: none; font-size: 0.9rem; font-weight: 500; letter-spacing: 0.02em; transition: color 0.2s; }
#primary-navigation ul li a:hover { color: var(--red); }
#primary-navigation ul li.menu-item-cta a { background: var(--red); color: #fff !important; padding: 0.5rem 1.25rem; border-radius: 4px; }
#primary-navigation ul li.menu-item-cta a:hover { background: var(--red-light); }
.hamburger { display: none; flex-direction: column; justify-content: space-between; width: 28px; height: 20px; cursor: pointer; background: none; border: none; padding: 0; }
.hamburger span { display: block; width: 100%; height: 2px; background: #333; border-radius: 2px; transition: all 0.3s ease; }
.hamburger.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
#mobile-nav { display: none; position: fixed; top: 72px; left: 0; right: 0; bottom: 0; background: #fff; z-index: 150; overflow-y: auto; padding: 0.5rem 0 2rem; border-top: 3px solid var(--red); }
#mobile-nav.open { display: block; }
#mobile-nav ul { list-style: none; }
#mobile-nav ul li { border-bottom: 1px solid #f0f0f0; }
#mobile-nav ul li a { display: block; padding: 1rem 5vw; color: #222; font-size: 0.97rem; font-weight: 600; }
#mobile-nav ul li a:hover { color: var(--red); }
@media (max-width: 900px) { #primary-navigation { display: none; } .hamburger { display: flex; } }

/* LAYOUT */
#page { padding-top: 72px; }
.site-content { max-width: 1280px; margin: 0 auto; padding: 4rem 5vw; display: grid; grid-template-columns: 1fr 320px; gap: 4rem; align-items: start; }
@media (max-width: 960px) { .site-content { grid-template-columns: 1fr; gap: 3rem; } }

/* BLOG HEADER */
.blog-header { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 5rem 5vw 4rem; text-align: center; position: relative; overflow: hidden; }
.blog-header::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(184,33,50,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(184,33,50,0.05) 1px, transparent 1px); background-size: 60px 60px; mask-image: radial-gradient(ellipse 80% 100% at 50% 100%, black, transparent); }
.blog-header-label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--red-light); margin-bottom: 1rem; position: relative; }
.blog-header-label::before { content: ""; width: 20px; height: 1px; background: var(--red-light); }
.blog-header h1 { font-family: "Syne", sans-serif; font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; position: relative; }
.blog-header p { color: var(--muted); max-width: 500px; margin: 1.25rem auto 0; line-height: 1.7; position: relative; }

/* TICKER */
.ticker-wrap { background: var(--red); padding: 0.7rem 0; overflow: hidden; white-space: nowrap; }
.ticker { display: inline-block; animation: ticker 30s linear infinite; }
.ticker span { font-family: "Syne", sans-serif; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.8); }
.ticker span.dot { color: rgba(255,255,255,0.4); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* POST CARDS */
#primary article.post { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; transition: border-color 0.3s, transform 0.3s; margin-bottom: 2rem; }
#primary article.post:hover { border-color: rgba(184,33,50,0.3); transform: translateY(-2px); }
.post-thumbnail img { width: 100%; height: 220px; object-fit: cover; border-bottom: 1px solid var(--border); }
.post-inner { padding: 2rem; }
.post-meta { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.875rem; flex-wrap: wrap; }
.post-category { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--red-light); border: 1px solid rgba(184,33,50,0.3); padding: 0.25rem 0.75rem; border-radius: 2px; }
.post-date { font-size: 0.78rem; color: var(--muted); }
.post-title { font-family: "Syne", sans-serif; font-size: clamp(1.15rem, 2vw, 1.4rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; margin-bottom: 0.875rem; }
.post-title a { color: var(--text); text-decoration: none; }
.post-title a:hover { color: var(--red-light); }
.post-excerpt { color: var(--muted); font-size: 0.93rem; line-height: 1.7; margin-bottom: 1.5rem; }
.read-more { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--red-light); transition: gap 0.2s; }
.read-more:hover { gap: 10px; color: var(--red); }
.read-more::after { content: "→"; }

/* SINGLE POST */
.single-post-header { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 5rem 5vw 4rem; position: relative; overflow: hidden; }
.single-post-header::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(184,33,50,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(184,33,50,0.04) 1px, transparent 1px); background-size: 60px 60px; mask-image: radial-gradient(ellipse 80% 100% at 50% 100%, black, transparent); }
.single-post-header-inner { max-width: 780px; margin: 0 auto; position: relative; }
.single-post-header .entry-title { font-family: "Syne", sans-serif; font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 1.5rem; }
.author-row { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; color: var(--muted); }
.author-avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; border: 1px solid var(--border); }
.author-name { color: var(--text); font-weight: 500; }
.single-featured-image { max-width: 780px; margin: 0 auto; padding: 0 5vw; }
.single-featured-image img { width: 100%; border-radius: 8px; border: 1px solid var(--border); margin: 2rem 0; }

/* ENTRY CONTENT */
.entry-content { max-width: 780px; margin: 0 auto; font-size: 1.05rem; line-height: 1.85; color: var(--text); padding: 2rem 5vw 4rem; }
.entry-content h2 { font-family: "Syne", sans-serif; font-size: clamp(1.4rem, 2.5vw, 1.9rem); font-weight: 700; margin: 3rem 0 1rem; }
.entry-content h3 { font-family: "Syne", sans-serif; font-size: 1.2rem; font-weight: 600; margin: 2rem 0 0.75rem; }
.entry-content p { margin-bottom: 1.5rem; color: var(--muted); }
.entry-content a { color: var(--red-light); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:hover { color: var(--accent); }
.entry-content ul, .entry-content ol { padding-left: 1.5rem; margin-bottom: 1.5rem; color: var(--muted); }
.entry-content li { margin-bottom: 0.5rem; }
.entry-content blockquote { border-left: 3px solid var(--red); padding: 1.25rem 1.5rem; margin: 2rem 0; background: var(--bg2); border-radius: 0 6px 6px 0; }
.entry-content blockquote p { color: var(--text); margin: 0; }
.entry-content code { background: var(--surface); border: 1px solid var(--border); padding: 0.15em 0.45em; border-radius: 3px; font-family: monospace; font-size: 0.875em; color: var(--accent); }
.entry-content pre { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 1.5rem; overflow-x: auto; margin: 1.5rem 0; }
.entry-content pre code { background: none; border: none; padding: 0; }
.entry-content img { border-radius: 6px; border: 1px solid var(--border); margin: 1.5rem 0; }
.entry-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.entry-tags a { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.3rem 0.75rem; border: 1px solid var(--border); border-radius: 3px; color: var(--muted); transition: all 0.2s; }
.entry-tags a:hover { border-color: rgba(184,33,50,0.4); color: var(--red-light); background: rgba(184,33,50,0.06); }

/* SIDEBAR */
#secondary { position: sticky; top: 96px; }
.widget { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 1.75rem; margin-bottom: 1.5rem; }
.widget-title { font-family: "Syne", sans-serif; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--red-light); margin-bottom: 1.25rem; display: flex; align-items: center; gap: 8px; }
.widget-title::before { content: ""; width: 16px; height: 1px; background: var(--red-light); }
.widget ul { list-style: none; }
.widget ul li { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.widget ul li:last-child { border-bottom: none; padding-bottom: 0; }
.widget ul li a { font-size: 0.88rem; font-weight: 500; color: var(--text); line-height: 1.4; display: block; margin-bottom: 0.25rem; }
.widget ul li a:hover { color: var(--red-light); }
.widget ul li .post-date { font-size: 0.72rem; color: var(--muted); display: block; }
.widget-cta { background: linear-gradient(135deg, var(--red-dark) 0%, var(--red) 100%); border: none; text-align: center; }
.widget-cta h3 { font-family: "Syne", sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; color: #fff; }
.widget-cta p { font-size: 0.85rem; color: rgba(255,255,255,0.75); margin-bottom: 1.25rem; line-height: 1.5; }
.widget-cta a { display: inline-block; background: #fff; color: var(--red) !important; font-size: 0.85rem; font-weight: 700; padding: 0.65rem 1.5rem; border-radius: 4px; }
.widget-cta a:hover { background: rgba(255,255,255,0.88); }

/* PAGINATION */
.pagination { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.pagination .page-numbers { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 4px; font-size: 0.88rem; color: var(--muted); transition: all 0.2s; }
.pagination .page-numbers:hover, .pagination .page-numbers.current { background: var(--red); border-color: var(--red); color: #fff; }

/* FOOTER */
#colophon { background: var(--bg2); border-top: 1px solid var(--border); padding: 4rem 5vw 2rem; }
.footer-grid { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; padding-bottom: 3rem; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; gap: 2rem; } }
.footer-brand .footer-logo { font-family: "Syne", sans-serif; font-size: 1.4rem; font-weight: 800; color: var(--text); margin-bottom: 1rem; text-decoration: none; display: inline-block; }
.footer-brand .footer-logo span { color: var(--red); }
.footer-brand p { color: var(--muted); font-size: 0.9rem; line-height: 1.7; max-width: 280px; margin-bottom: 1.25rem; }
.footer-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--border); padding: 0.35rem 0.75rem; border-radius: 3px; }
.footer-badge::before { content: ""; width: 6px; height: 6px; background: #3FB950; border-radius: 50%; }
.footer-col h4 { font-family: "Syne", sans-serif; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.25rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.6rem; }
.footer-col ul li a { color: rgba(240,238,232,0.6); font-size: 0.88rem; transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--text); }
.footer-bottom { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-bottom p, .footer-legal a { font-size: 0.78rem; color: var(--muted); }
.footer-legal { display: flex; gap: 1.5rem; }
.footer-legal a:hover { color: var(--text); }

/* UTILS */
.screen-reader-text { position: absolute; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }
.btn-primary { background: var(--red); color: #fff; padding: 0.875rem 2rem; border-radius: 4px; font-size: 0.95rem; font-weight: 500; text-decoration: none; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary:hover { background: var(--red-light); }

.reading-progress-container {
    position: fixed;
    top: 72px; /* Ajusta esto según la altura exacta de tu menú (nav height) */
    left: 0;
    width: 100%;
    height: 3px; /* Muy fina para que sea elegante */
    background: transparent;
    z-index: 999;
}

.reading-progress-bar {
    height: 100%;
    background: #B82132; /* Tu rojo corporativo */
    width: 0%; /* Empieza en cero */
    box-shadow: 0 0 10px rgba(184, 33, 50, 0.5); /* Un pequeño brillo */
    transition: width 0.1s ease-out;
}

/* Contenedor principal del artículo */
.single-post {
    background-color: #0F0F12 !important; /* Un negro menos agresivo */
}

.entry-content {
    max-width: 750px; /* Ancho ideal para lectura */
    margin: 0 auto;
    font-size: 1.15rem; /* Un poco más grande para comodidad */
    line-height: 1.8; /* Más aire entre líneas */
    color: #D1D1D1; /* Blanco roto para evitar el brillo excesivo */
    padding: 40px 20px;
}

/* La caja donde vive el texto */
.post-article-container {
    background: rgba(30, 30, 38, 0.4); /* Transparencia sutil */
    backdrop-filter: blur(10px); /* Efecto cristal esmerilado */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 3rem;
    margin-top: 2rem;
}

/* Título del Post */
.entry-title {
    font-family: "Syne", sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    color: #FFFFFF;
}

/* Meta información (Autor, fecha, tiempo de lectura) */
.post-meta {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: #888890;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(184, 33, 50, 0.3); /* Línea roja sutil */
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.entry-content img {
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

blockquote {
    border-left: 4px solid #B82132;
    padding-left: 20px;
    font-style: italic;
    color: #F0EEE8;
    background: rgba(184, 33, 50, 0.05);
    padding: 20px;
    margin: 2rem 0;
}

.post-article-container {
    max-width: 900px;
    margin: 40px auto;
    background: rgba(255, 255, 255, 0.03); /* Transparencia muy sutil */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 20px; /* Espacio interno para que el texto no toque los bordes */
}