/* ==========================================================================
   1. FONT IMPORT & GLOBAL STYLESS
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5;
    --text-color-dark: #111827;
    --text-color-light: #6b7280;
    --background-color: #f6f7fb;  /* <<< TU COLOR DE FONDO GENERAL */
    --card-background: #ffffff;      /* <<< COLOR PARA LA TARJETA FLOTANTE */
    --border-color: #e5e7eb;
    --font-sans: 'IBM Plex Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background-color);
    color: var(--text-color-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   2. HEADER (INTEGRADO CON EL FONDO)
   ========================================================================== */
.global-header {
    background-color: var(--background-color); /* <<< AHORA USA EL COLOR DE FONDO GENERAL */
    padding: 1.5rem 0;
    /*position: sticky;*/
    /*top: 0;*/
    /*z-index: 999;*/
    border-bottom: 1px solid var(--border-color); /* Borde sutil para separar al hacer scroll */
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color-dark);
    text-decoration: none;
}

.desktop-nav .nav-list {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.desktop-nav .nav-link {
    color: var(--text-color-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.desktop-nav .nav-link:hover,
.desktop-nav .nav-link.active {
    color: var(--primary-color);
}

/* ==========================================================================
   3. MOBILE MENU
   ========================================================================== */
#mobile-menu-button { display: none; background: none; border: none; font-size: 1.75rem; cursor: pointer; }
#mobile-menu-container { position: fixed; top: 0; right: 0; width: 280px; height: 100%; background: var(--card-background); z-index: 1002; transform: translateX(100%); transition: transform 0.3s ease-in-out; padding-top: 4rem; box-shadow: -5px 0 15px rgba(0,0,0,0.1); }
#mobile-menu-close-button { position: absolute; top: 1rem; right: 1.5rem; font-size: 2rem; background: none; border: none; cursor: pointer; }
#mobile-menu-container .nav-list-mobile { list-style: none; }
#mobile-menu-container .nav-list-mobile a { display: block; padding: 1rem 1.5rem; color: var(--text-color-dark); text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--border-color); }
#mobile-menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 1001; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
body.mobile-menu-open #mobile-menu-container { transform: translateX(0); }
body.mobile-menu-open #mobile-menu-overlay { opacity: 1; visibility: visible; }

/* ==========================================================================
   4. MAIN CONTENT & TOOL CONTAINER (TARJETA FLOTANTE)
========================================================================== */
main {
    padding: 3rem 2rem;
}
.content-wrapper {
    max-width: 1200px; /* MISMO ANCHO QUE LA TARJETA PRINCIPAL */
    margin: 0 auto;   /* LO CENTRA EN LA PÁGINA */
}

.tool-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--card-background); /* <<< FONDO BLANCO */
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); /* Sombra sutil y moderna */
    padding: 2.5rem 3rem;
    border: 1px solid var(--border-color);
}

.tool-section {
    margin-bottom: 2.5rem;
}

.tool-container .tool-section:last-child {
    margin-bottom: 0;
}

.page-header {
    text-align: center;
    padding-bottom: 1.5rem;
}

.page-header h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.page-header p { color: var(--text-color-light); max-width: 600px; margin: 0 auto; }
.section-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; }
/* --- ESTILOS CORREGIDOS PARA TEXTAREA E INPUTS --- */

/* Estilos comunes para ambos elementos (sin la fuente) */
textarea, .input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Regla específica para la fuente del TEXTAREA */
textarea {
    font-family: 'IBM Plex Mono', monospace; /* <<< ¡NUEVA FUENTE MONOESPACIADA! */
}

/* Regla específica para la fuente de los INPUTS */
.input-group input {
    font-family: var(--font-sans); /* Mantiene la fuente principal del sitio ('IBM Plex Sans') */
}
textarea:focus, .input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}
.textarea-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}
.counter { color: var(--text-color-light); font-size: 0.875rem; }
.find-replace-section { background-color: #f9fafb; border-radius: 0.75rem; padding: 1.5rem; border: 1px solid var(--border-color); }
.find-replace-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.btn { padding: 0.625rem 1.25rem; border: none; border-radius: 0.5rem; font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.btn-primary { background-color: var(--primary-color); color: white; font-size: 1rem; width: 100%; padding: 0.875rem 1.5rem; margin-top: 1rem; }
.btn-primary:hover { background-color: #4338ca; }
.btn-add { background-color: #16a34a; color: white; }
.btn-add:hover { background-color: #15803d; }
.btn-remove { background-color: #dc2626; color: white; }
.btn-remove:hover { background-color: #b91c1c; }
.btn-reset { background-color: #f59e0b; color: #111827; }
.btn-reset:hover { background-color: #d97706; }
.btn-secondary { background-color: #e5e7eb; color: #374151; }
.btn-secondary:hover { background-color: #d1d5db; }
.checkbox-container { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
input[type="checkbox"] { height: 1rem; width: 1rem; border-radius: 0.25rem; border: 1px solid var(--border-color); }

/* --- ESTILOS CORREGIDOS PARA LA SECCIÓN DE INSTRUCCIONES --- */

.seo-section {
    margin-top: 3rem; /* Añade el espacio superior para separarlo de la tarjeta flotante */
    padding-top: 2rem; /* Espacio interno superior */
    padding-bottom: 2rem; /* Espacio interno inferior */
}

.seo-section hr {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    margin: 0 auto 3rem auto;
    width: 100px;
}

.seo-section h2 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.seo-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
}

.seo-section p, .seo-section li {
    color: var(--text-light); /* Un color de texto más suave para diferenciarlo */
    line-height: 1.7;
}

/* En móvil, ajustamos el padding */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 0 1rem; /* Añade un poco de espacio lateral en móvil */
    }
    .instructions-container {
        padding: 2rem 0;
    }
}

/* ==========================================================================
   5. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
    .desktop-nav {
        display: none; 
    }
    #mobile-menu-button {
        display: block;
    }
    main {
        padding: 1.5rem 0;
    }
    .header-content {
        padding: 0 1rem;
    }
    .tool-container {
        padding: 1.5rem;
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        box-shadow: none;
    }
    .find-replace-pair {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   6. FOOTER
   ========================================================================== */
.global-footer {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-color-light);
    font-size: 0.875rem;
}
.footer-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.footer-links a {
    color: var(--text-color-light);
    text-decoration: none;
}
.footer-links a:hover {
    color: var(--primary-color);
}
/* ==========================================================================
   6. FORMULARIO DE CONTACTO
   ========================================================================== */
.form-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-group textarea {
    min-height: 220px;
    resize: vertical;
}

.submit-btn {
    background-color: #007bff;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

.submit-btn:hover {
    background-color: #0056b3;
}

/* Content Styles */
.content-section {
    margin-bottom: 30px;
}

.content-section h2 {
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 15px;
    font-weight: 600;
}

.content-section p {
    color: #6c757d;
    line-height: 1.7;
    margin-bottom: 15px;
}

/* ==========================================================================
   7. BLOG LISTING PAGE STYLES
   ========================================================================== */
.blog-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}
.blog-page-header {
    text-align: center;
    margin-bottom: 4rem;
}
.blog-page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color-dark);
    margin-bottom: 1rem;
}
.blog-page-header p {
    font-size: 1.125rem;
    color: var(--text-color-light);
    max-width: 600px;
    margin: 0 auto;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Dos columnas */
    gap: 2.5rem; /* Espacio entre tarjetas */
}

.post-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
}
.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.post-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
    width: 100%;
}
.post-card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color-dark);
    margin-bottom: 1rem;
}
.post-card-excerpt {
    color: var(--text-color-light);
    line-height: 1.6;
}
.post-card-meta {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-color-light);
    display: flex;
    gap: 0.75rem;
}
/* ==========================================================================
   8. INDIVIDUAL BLOG POST STYLES
   ========================================================================== */

.blog-post-container {
    max-width: 1200px; /* Ancho de lectura óptimo */
    margin: 3rem auto;
    background: var(--card-background);
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    border: 1px solid var(--border-color);
    padding: 3rem;
}

.post-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.post-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-color-dark);
    margin-bottom: 1rem;
}

.post-meta {
    color: var(--text-color-light);
    font-size: 0.9rem;
}

.post-content {
    font-size: 1.125rem; /* Tamaño de fuente más grande para la lectura */
    line-height: 1.8;
    color: #333;
}

.post-content h2, .post-content h3 {
    font-weight: 600;
    color: var(--text-color-dark);
    margin: 2.5rem 0 1.5rem 0;
    line-height: 1.3;
}
.post-content h2 {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}
.post-content h3 {
    font-size: 1.4rem;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content ol, .post-content ul {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.post-content li {
    margin-bottom: 0.75rem;
}

.post-content strong {
    font-weight: 600;
    color: var(--text-color-dark);
}

.post-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(79, 70, 229, 0.3);
    transition: all 0.2s ease;
}
.post-content a:hover {
    background-color: rgba(79, 70, 229, 0.1);
    border-bottom-color: var(--primary-color);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
}

.post-content hr {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    margin: 3rem 0;
}

.cta-section {
    background-color: #f3f4f6;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    margin-top: 3rem;
    border: 1px solid var(--border-color);
}
.cta-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.cta-button {
    display: inline-block;
    margin-top: 1rem;
    background-color: #fafafa;;
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
}
.cta-button:hover {
    background-color: #fafafa;
}

/* Ajustes responsivos para el post */
@media (max-width: 768px) {
    .blog-post-container {
        padding: 1.5rem;
        margin: 1rem 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .post-header h1 {
        font-size: 2rem;
    }
    .post-content {
        font-size: 1rem;
    }
}
/* --- Estilos para la sección de Artículos Relacionados --- */
.related-posts-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}
.related-posts-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color-dark);
}
.related-posts-list {
    list-style: none;
    padding: 0;
}
.related-posts-list li {
    margin-bottom: 1rem;
}
.related-posts-list a {
    text-decoration: none;
    font-weight: 500;
    color: var(--primary-color);
    font-size: 1.1rem;
    transition: color 0.2s;
}
.related-posts-list a:hover {
    color: #4338ca; /* Un tono más oscuro */
    text-decoration: underline;
}