/* ==============================
   VARIABLES GLOBALES
   ============================== */
:root {
    --bg-color: #fcfaf8;
    --text-color: #1a1a1a;
    --text-secondary-color: #6c6c6c;
    --accent-color: #6d5d4b;
    --border-color: #e5e0da;
    --card-bg-color: #ffffff;

    --font-heading: 'Lato', serif;
    --font-body: 'Roboto', sans-serif;

    --title-color: #856f5a;
    --hover-shadow: 0 10px 20px rgba(0,0,0,0.03);
}

html[data-theme='dark'] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --text-secondary-color: #a0a0a0;
    --accent-color: #a08a73;
    --border-color: #3a3a3a;
    --card-bg-color: #242424;
    --title-color: #c9b8a8;
    --hover-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

/* ==============================
   RESET Y BODY
   ============================== */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ==============================
   ENLACES UNIFICADOS
   ============================== */

a {
    display: inline-block;
    font-family: var(--font-body);
    font-size: .9rem;
    font-weight: 700;
    text-transform:none;
    letter-spacing: .5px;
    margin: 0 .5rem 0 0;   /* derecha: espacio entre enlaces */


    color: var(--accent-color);
    background: rgba(109,93,75,.08);

    padding: .10rem .45rem;
    border-radius: .4rem;

    text-decoration: none;
    transition: background .2s, color .2s, box-shadow .2s;

    margin-top: 1rem;
    margin-bottom: 1rem;
}

a:hover {
    background: var(--accent-color);
    color: var(--card-bg-color);
    box-shadow: 0 4px 8px rgba(0,0,0,.08);
}


/* ==============================
   CONTENEDORES
   ============================== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.containerPost { max-width: 800px; margin: 0 auto; padding: 0 1.5rem; }

header.container, footer.container {
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

header.container {
    display: flex; flex-direction: column; align-items: center;
    padding: 3rem 0 2rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 3rem;
}

footer.container {
    margin-top: 5rem; padding-bottom: 3rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem; color: var(--text-secondary-color);
}

/* ==============================
   TIPOGRAFÍA
   ============================== */
h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; margin: 2rem 0 1rem 0; color: var(--title-color); }
h1 { font-size: 2.5rem; margin-bottom: 1rem; letter-spacing: -0.5px; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.5rem 0; font-size: 1.05rem; line-height: 1.8; }

/* ==============================
   BOTONES
   ============================== */
.btn { display: inline-block; border: none; border-radius: 6px; padding: .6rem 1.2rem; font-size: .95rem; cursor: pointer; transition: background .2s; }
.btn--primary { background: var(--accent, #945dd6); color: #fff; }
.btn--primary:hover { background: #7b4bc2; }
.btn--danger { background: #ff6b6b; color: #fff; }
.btn--danger:hover { background: #e74c3c; }

/* ==============================
   POSTS
   ============================== */
#post-list {
    column-count: 1;              /* móvil */
    column-gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.post-item {
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;

    display: inline-block;
    width: 100%;
    margin-bottom: 1.5rem;
    break-inside: avoid;

    opacity: 0;
    transform: translateY(20px);
    transition: opacity .5s, transform .5s, box-shadow .3s;
}

.post-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.post-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.post-item h2 {
    font-size: 1.7rem;
    margin:0 0 .5rem 0;
    line-height:1.3;
    color: var(--text-color);
}

.post-item p {
    font-size: 1rem;
    line-height:1.6;
    color: var(--text-secondary-color);
    margin-bottom:1rem;
}

.post-meta { font-size:.8rem; color: var(--text-secondary-color); margin-bottom:1rem; }

/* ==============================
   AJUSTES DE TÍTULOS EN POST-ITEM
   ============================== */

/* TÍTULOS DENTRO DE LAS TARJETAS */
.post-item h2 a {
    display: contents;
    background: none !important;
    padding: 0 !important;
    margin: 0;
    border-radius: 0;
    color: var(--title-color);
    font-size: 1.7rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: none;
}
.post-item h2 a:hover {
    background: none !important;
    box-shadow: none;
}


/* ==============================
   POST CONTENT
   ============================== */
#post-header h1 { text-align:center; font-size:2.8rem; color: var(--title-color); margin-bottom:.5rem; }
#post-content { text-align:left; margin-bottom:3rem; }
#post-content .post-body p { white-space: pre-wrap; }

.post-note { margin-top:3rem; padding:1.5rem; background: var(--bg-color); border:1px dashed var(--border-color); border-radius:2px; font-style:italic; font-size:1rem; }

.post-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin: 1rem 0;      /* antes era grande, así queda compacto */
    padding: 0;          /* fuera rellenos */
    gap: 1rem;           /* separacion mínima */
}
.post-navigation a { font-family: var(--font-heading); font-weight:700; }

/* ==============================
   BOTÓN DE TEMA
   ============================== */
.theme-toggle {
    background:transparent; border:1px solid var(--border-color); border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    width:40px; height:40px; cursor:pointer; position:absolute; top:2.8rem; right:1.5rem;
}
.theme-toggle:hover { background-color: rgba(109,93,75,.08); }
.theme-toggle .icon { width:20px; height:20px; color: var(--text-secondary-color); }
.theme-toggle .sun-icon { display:none; }
.theme-toggle .moon-icon { display:block; }
html[data-theme='dark'] .theme-toggle .sun-icon { display:block; }
html[data-theme='dark'] .theme-toggle .moon-icon { display:none; }

/* ==============================
   MEDIA QUERIES
   ============================== */
/* laptops y pantallas medianas: 2 columnas */
@media (min-width: 768px) {
    #post-list {
        column-count: 2;
        column-gap: 2rem;
    }
}

/* pantallas grandes (monitor completo): 3 columnas */
@media (min-width: 1500px) {
    #post-list {
        column-count: 2;
        column-gap: 2.2rem;
    }
}