/* ============================================================
   1. VARIABLES Y CONFIGURACIÓN (Soft Dark Mode)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Playfair+Display:wght@700&display=swap');

:root { 
    --principal: #2d3436; 
    --acento: #0984e3; 
    --texto: #636e72; 
    --fondo: #fafafa;
    --card-bg: #ffffff;
    --sidebar-bg: #f1f2f6;
    --border-color: #eeeeee;
    --hanko-red: #d63031;
    --texto-secundario: #888888;
}

body.dark-mode {
    --principal: #e3e3e3; 
    --texto: #b2bec3; 
    --fondo: #131314;     
    --card-bg: #1e1e20;   
    --sidebar-bg: #1e1e20;
    --border-color: #333333;
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    line-height: 1.8; 
    color: var(--principal); 
    max-width: 1100px; 
    margin: 40px auto; 
    padding: 0 20px; 
    background: var(--fondo); 
    transition: 0.3s ease, color 0.3s ease;
}

/* ✨ BARRA DE PROGRESO */
#progress-bar {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    background: var(--acento);
    width: 0%;
    z-index: 1001;
}

/* ============================================================
   2. HEADER Y NAVEGACIÓN
   ============================================================ */

header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 2px solid var(--acento);
    padding: 20px 0; 
    margin-bottom: 40px; 
}

h1, h2, h3 { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

h1 {
    margin: 0; /* Elimina el espacio extra que traen los títulos por defecto */
}

h1 a { 
    text-decoration: none; 
    color: var(--principal); 
    font-size: 1.8rem;
    transition: 0.3s;
    display: inline-block; /* ¡ESTO ES CLAVE! Ahora sí hará caso al margen */
    margin-bottom: -30px;
}

h1 a:hover { 
    color: var(--acento); 
}

.nav-utilities {
    display: flex;
    align-items: center;
    gap: 35px;
}

h3 {
    margin-bottom: 8px; /* Espacio pequeño antes del texto del post */
}

h3 a {
    display: inline-block; /* ¡Crucial! Permite que el enlace se mueva y crezca */
    text-decoration: none;
    color: #0077b5;
    font-family: 'Segoe UI', sans-serif;
    font-size: 1.4rem; /* Un poco más pequeño que el H1 de tu nombre */
    font-weight: 700;
    transition: transform 0.3s ease, color 0.3s ease; /* Hace que el crecimiento sea fluido */
}

h3 a:hover {
    color: var(--acento);
    transform: scale(1.05); /* Crece un 5% al hacer hover */
}

nav { 
    display: flex; 
    align-items: center; 
    gap: 20px; 
}

nav a {
    text-decoration: none;
    color: var(--acento);
    font-weight: bold;
    font-size: 0.85rem;
    text-transform: uppercase;
}

/* SWITCH DE MODO OSCURO (Minimalista y Proporcional) */
.switch {
    display: inline-block;
    height: 20px;
    position: relative;
    width: 40px;
}

.switch input {
    display: none !important; /* El !important asegura que Chrome no lo muestre por error */
    visibility: hidden;
    appearance: none;         /* Esto le dice a Android: "no uses tu estilo de sistema" */
    -webkit-appearance: none;
}


.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    background-color: #fff;
    bottom: 3px;
    content: "";
    height: 14px;
    left: 3px;
    position: absolute;
    transition: .4s;
    width: 14px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .slider {
    background-color: var(--acento); /* Usa tu azul personalizado */
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* ============================================================
   3. LAYOUT, POSTS Y SIDEBAR
   ============================================================ */
.contenedor-blog { display: flex; gap: 40px; align-items: flex-start; }
#lista-entradas { flex: 7; }

.post-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    margin-bottom: 25px;
}

.post-meta {
    
    margin-bottom: -35px;
}

.post-card:hover {
    /* Sube 5px y crece un 1% (muy sutil) */
    transform: translateY(-5px) scale(1.01); 
    
    /* Aumentamos un poco la sombra para reforzar el efecto de elevación */
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
    border-color: var(--acento);
}

.sidebar {
    flex: 3; 
    position: sticky; top: 20px;
    background: var(--sidebar-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* ============================================================
   4. DETALLES ESTÉTICOS (Tagline, Fecha y Hanko)
   ============================================================ */
.post-header-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-top: -35px;
    margin-bottom: 5px;
    border-bottom: none;
}

/* Seleccionamos específicamente la sección dentro del article */
article .post-header-inner {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Ajuste Zona Roja (Título -> Fecha) */
article .post-header-inner h2 {
    margin-top: 80px;  
    margin-bottom: 5px;
}

.tagline {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--texto);
    opacity: 0.7;
    letter-spacing: 0.5px;
    margin: 0;
}

/* 3. Ajuste del Párrafo */
article p {
    margin-top: 0;       /* Evita que el párrafo empuje hacia arriba y sume espacio extra */
}

.post-date {
    font-size: 13px;
    color: var(--texto);      
    opacity: 0.5;
    display: block;      /* Hace que la fecha ocupe toda la línea y respete los márgenes */
    margin-top: 0;       /* Elimina cualquier espacio residual arriba */
    margin-bottom: 50px; /* Este es el espacio azul; auméntalo si quieres más distancia */
}

.hanko-seal {
    display: inline-block;
    border: 2px solid var(--hanko-red);
    color: var(--hanko-red);
    padding: 4px 8px;
    font-weight: bold;
    margin-top: 30px;
    text-align: center;
    line-height: 1.2;
}

.tag-jp,
.tag-code,
.tag-diseño,
.tag-escritura {
    display: inline-block;
    color: #d9534f; /* Un rojo mate, no tan chillante */
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px; /* Un poco más de espacio entre letras para el toque de diseño */
    margin-right: 8px;
    padding: 0 4px;
    line-height: 1;
    vertical-align: middle;
    font-family: 'Segoe UI', sans-serif;
}

.categorias-list { list-style: none; padding: 0; }
.categorias-list a {
    text-decoration: none;
    color: var(--texto);
    font-size: 0.9rem;
}
.categorias-list a:hover { color: var(--acento); padding-left: 5px; }

/* ============================================================
   5. BOTÓN VOLVER ARRIBA (Sin bordes y con sombra), BOTONES LINKS
   ============================================================ */
#btn-back-to-top {
    opacity: 0; 
    visibility: hidden;
    position: fixed;
    bottom: 60px; 
    right: 5%;
    z-index: 1000;
    
    /* Estilos Visuales */
    background-color: var(--acento);
    color: white;
    border: none;               /* Elimina la línea negra */
    outline: none;
    border-radius: 50%;
    width: 50px; 
    height: 50px;
    
    /* Sombra suave para que flote */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    
    /* Alineación de ícono/kanji */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}


#btn-back-to-top span {
    font-size: 14px;
}

#btn-back-to-top.show {
    opacity: 1;
    visibility: visible;
}

#btn-back-to-top:hover {
    transform: scale(1.1);    /* Pequeño aumento al pasar el mouse */
    background-color: #21759b; /* Cambio de color al hacer hover */
}

/* Estilo Base para ambos */
.btn-linkedin, 
.btn-wordpress {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.85rem;
    transition: 0.3s ease; /* La transición va aquí para que afecte entrada y salida */
    margin-bottom: 10px;
    color: white; /* Color de texto base */
}

/* Colores de fondo individuales (Opcional si quieres que sean distintos) */
.btn-linkedin {
    background-color: #0077b5; 
}

.btn-wordpress {
    background-color: #21759b; /* El azul oficial de WordPress es un poco distinto */
}

/* EL HOVER: Ahora sí debería responder */
.btn-linkedin:hover, 
.btn-wordpress:hover {
    background-color: var(--acento); 
    transform: scale(1.05);
    color: white; /* Aseguramos que se mantenga blanco sin usar important */
}

.read-more {
    display: inline-block;
    color: #0077b5;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', sans-serif;
}

.read-more:hover {
    color: var(--acento); /* Cambia al color de acento que definimos */
    transform: translateX(5px); /* Efecto sutil de movimiento hacia la derecha */
}

/* Opcional: Un detalle para que la flecha se mueva sola */
.read-more:hover::after {
    margin-left: 8px;
}

.quote-destacada {
    text-align: center;
    margin: 40px 0;
    padding: 20px;
    background: var(--sidebar-bg);
    border-left: 5px solid var(--acento);
    border-radius: 0 10px 10px 0;
}


footer {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--texto-secundario);
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    /* Mantenemos tu padding, border y margin */
    padding: 40px 0;
    border-top: 1px solid #eee;
    margin-top: 30px;
    transition: color 0.3s ease;
    
    /* Añadimos esto para poder controlar la posición de los hijos */
    display: flex;
    flex-direction: column;
    align-items: center; /* Mantiene el p al centro */
}

.read-more-footer {
    /* Esto lo empuja a la izquierda ignorando el centro del padre */
    align-self: flex-start; 
    
    color: var(--acento);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 20px; /* Espacio antes del copy */
    transition: 0.3s;
}

.read-more-footer:hover {
    transform: translateX(-5px); /* Animación hacia la izquierda */
}

/* ============================================================
   6. TIMELINE DE LA BITÁCORA
   ============================================================ */

.ir-ultima {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--acento);
    text-decoration: none;
    margin: 6px 0 0;
    opacity: 0.8;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.ir-ultima:hover {
    opacity: 1;
    transform: translateY(3px);
}

/* Hilo fijo en el margen izquierdo (espejo del botón volver arriba) */
.timeline-rail {
    position: fixed;
    left: 5%;
    top: 60px;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--acento), transparent 95%);
    opacity: 0.3;
    pointer-events: none;
    z-index: 500;
}

.timeline {
    position: relative;
    padding-left: 0;
    margin-top: 28px;
}

/* Nodo del año */
.timeline-year {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--acento);
    margin-bottom: 24px;
    padding-left: 20px;
}

.timeline-year::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--acento);
}

/* Separador de mes */
.timeline-month {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 32px 0 18px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--texto);
    opacity: 0.75;
    padding-left: 16px;
}

.timeline-month::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--fondo);
    border: 2px solid var(--acento);
}

.timeline-month::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* Tarjetas sin borde extra */
.post-card {
    position: relative;
}

/* ============================================================
   7. RESPONSIVE (Ajustes para Celulares)
   ============================================================ */
@media (max-width: 768px) {
    /* El blog se vuelve una sola columna */
    .contenedor-blog {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: static;
        margin-top: 30px;
    }

    /* Rail oculto en móvil */
    .timeline-rail {
        display: none;
    }

    /* Ajuste del botón para que no estorbe en el móvil */
    #btn-back-to-top {
        bottom: 20px; 
        right: 20px;  
        width: 45px;  /* Más discreto en pantallas pequeñas */
        height: 45px;
        box-shadow: 0 2px 10px #ccc; /* Sombra más suave para móviles */
        
    }
}