/*
 * blog.css – Estilos para archive.php, single.php y search.php
 * GeneratePress child – Nutrición por tu Salud
 * Cargado globalmente junto a base.css (o condicionalmente en is_singular/is_archive)
 */

/* ── Cabecera del blog ───────────────────────────────────────────────────── */

#blog-cabecera {
    background-color: #2d1d44;
    padding: 6rem 1rem 5rem;
    text-align: center;
}

#blog-cabecera h1 {
    font-size: 4.8rem;
    color: #fff;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.blog-eyebrow {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: .25em;
    text-transform: uppercase;
    color: #c31c4a;
    margin-bottom: 1.5rem;
    text-align: center;
}

.blog-subtitulo {
    font-size: 1.8rem;
    color: rgba(255,255,255,.75);
    max-width: 60rem;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Tarjeta de blog (archive, search, inicio) ───────────────────────────── */

.blog-card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease;
}

.blog-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.13); }

.blog-card-thumb {
    display: block;
    line-height: 0;
}

.blog-card-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.blog-card-body {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-meta {
    font-size: 1.3rem;
    color: #929499;
    margin-bottom: 1rem;
}

.blog-card-meta .sep { margin: 0 .4rem; }

.blog-card-meta a {
    color: #86ba5f;
    text-decoration: none;
}

.blog-card-title {
    font-size: 1.8rem;
    color: #2d1445;
    margin-bottom: 1rem;
    line-height: 1.3;
    flex: 1;
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
}

.blog-card-title a:hover { color: #d01f46; }

.blog-card-excerpt {
    font-size: 1.5rem;
    color: #313131;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.blog-card-cat {
    display: inline-block;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #c31c4a;
    margin-bottom: 1rem;
    text-decoration: none;
}

.blog-card-cat:hover { color: #2d1d44; }

.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: .1rem solid #e8e4f0;
}

.blog-card-date {
    font-size: 1.3rem;
    color: #929499;
}

.btn.small {
    font-size: 1.3rem;
    padding: .6rem 1.4rem;
}

.blog-empty {
    text-align: center;
    padding: 6rem 0;
    color: #929499;
    font-size: 1.8rem;
}

.blog-empty .btn { margin-top: 2rem; }

/* ── Scroll infinito ─────────────────────────────────────────────────────── */

.blog-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .6rem;
    padding: 3rem 0;
}

.blog-loader span {
    width: .9rem;
    height: .9rem;
    border-radius: 50%;
    background-color: #c31c4a;
    animation: blog-pulse 1.2s ease-in-out infinite;
}

.blog-loader span:nth-child(2) { animation-delay: .2s; }
.blog-loader span:nth-child(3) { animation-delay: .4s; }

@keyframes blog-pulse {
    0%, 80%, 100% { opacity: .25; transform: scale(.75); }
    40%           { opacity: 1;   transform: scale(1);    }
}

.blog-end {
    text-align: center;
    padding: 2rem 0 4rem;
    font-size: 1.4rem;
    color: #929499;
    letter-spacing: .05em;
}

.blog-grid { gap: 3rem; }

/* ── Paginación ──────────────────────────────────────────────────────────── */

.blog-pagination {
    margin: 4rem 0;
    text-align: center;
}

.blog-pagination .nav-links a,
.blog-pagination .nav-links span {
    display: inline-block;
    padding: .6rem 1.2rem;
    margin: .2rem;
    border: 1px solid #929499;
    border-radius: 2px;
    color: #2d1445;
    font-size: 1.5rem;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.blog-pagination .nav-links a:hover { background-color: #2d1445; color: #fff; }
.blog-pagination .nav-links span.current { background-color: #d01f46; color: #fff; border-color: #d01f46; }

/* ── Post individual – diseño premium ────────────────────────────────────── */

/* Barra de progreso */
#reading-progress-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 10001;
    background: rgba(45,29,68,.12);
    pointer-events: none;
}

#reading-progress {
    height: 100%;
    width: 100%;
    background: linear-gradient(to right, #c31c4a, #2d1d44);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .08s linear;
}

/* Cabecera del artículo */
#post-cabecera {
    background-color: #2d1d44;
    padding: 6rem 2rem 5.5rem;
    text-align: center;
}

.post-cabecera-inner {
    max-width: 80rem;
    margin: 0 auto;
}

.post-cats { margin-bottom: 2rem; }

.post-cat-pill {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: #fff;
    background: #c31c4a;
    padding: .45rem 1.3rem;
    border-radius: 2rem;
    text-decoration: none;
    margin: .2rem;
    transition: background-color .2s;
}

.post-cat-pill:hover { background: #a51639; color: #fff; }

.post-titulo {
    font-size: 4rem;
    color: #fff;
    line-height: 1.2;
    margin: 0 auto 2rem;
    text-align: center;
}

.post-meta-bar {
    font-size: 1.4rem;
    color: rgba(255,255,255,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.meta-sep { color: rgba(255,255,255,.25); }

/* Cuerpo del artículo */
.post-articulo { background: #fff; }

.post-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 5rem 2rem 7rem;
}

/* Tabla de contenidos */
.post-toc {
    background: #f9f6ff;
    border: .15rem solid #e8e4f0;
    border-left: .4rem solid #c31c4a;
    border-radius: 0 1rem 1rem 0;
    margin-bottom: 4rem;
    overflow: hidden;
}

.post-toc summary.toc-titulo {
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #2d1d44;
    padding: 1.4rem 2rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: .7rem;
    user-select: none;
}

.post-toc summary.toc-titulo::before {
    content: '≡';
    font-size: 2rem;
    color: #c31c4a;
    line-height: 1;
}

.post-toc summary.toc-titulo::-webkit-details-marker { display: none; }

.toc-lista {
    padding: .5rem 2rem 1.8rem 2rem;
}

.toc-lista ul {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: toc;
}

.toc-lista li {
    counter-increment: toc;
    display: flex;
    align-items: baseline;
    gap: .6rem;
    padding: .3rem 0;
}

.toc-lista li::before {
    content: counter(toc);
    font-size: 1.1rem;
    font-weight: 700;
    color: #c31c4a;
    min-width: 1.6rem;
    flex-shrink: 0;
}

.toc-lista a {
    font-size: 1.5rem;
    color: #555;
    text-decoration: none;
    line-height: 1.4;
    transition: color .15s;
}

.toc-lista a:hover,
.toc-lista a.active {
    color: #c31c4a;
    font-weight: 600;
}

/* Tipografía del contenido */
.post-content {
    font-size: 1.85rem;
    color: #3a3a3a;
    line-height: 1.85;
}

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

.post-content h2 {
    font-size: 2.6rem;
    color: #2d1d44;
    margin: 5rem 0 1.6rem;
    padding-bottom: .9rem;
    border-bottom: .2rem solid #e8e4f0;
    line-height: 1.3;
    scroll-margin-top: 9rem;
}

.post-content h3 {
    font-size: 2rem;
    color: #2d1d44;
    margin: 3.5rem 0 1.2rem;
    scroll-margin-top: 9rem;
}

.post-content h4 {
    font-size: 1.8rem;
    color: #2d1d44;
    margin: 2.5rem 0 .8rem;
}

.post-content ul,
.post-content ol {
    margin: 0 0 2.4rem 2.5rem;
    padding: 0;
}

.post-content li { margin-bottom: .7rem; line-height: 1.7; }

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 2.5rem 0;
    display: block;
}

.post-content blockquote {
    border-left: .4rem solid #c31c4a;
    margin: 3.5rem 0;
    padding: 2rem 2.5rem;
    background: #f9f6ff;
    border-radius: 0 1rem 1rem 0;
    font-size: 2rem;
    font-style: italic;
    color: #2d1d44;
    line-height: 1.65;
}

.post-content blockquote p { margin: 0; }

.post-content a           { color: #c31c4a; text-decoration: underline; text-underline-offset: .2em; }
.post-content a:hover     { color: #2d1d44; }
.post-content strong      { color: #2d1d44; font-weight: 700; }
.post-content em          { color: inherit; }

.post-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.6rem;
    margin-bottom: 2.5rem;
}

.post-content th {
    background: #2d1d44;
    color: #fff;
    padding: 1rem 1.5rem;
    text-align: left;
}

.post-content td {
    padding: .9rem 1.5rem;
    border-bottom: .1rem solid #e8e4f0;
}

.post-content tr:nth-child(even) td { background: #f9f6ff; }

/* Tarjeta de autora */
.post-author-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2.5rem 3rem;
    background: #f9f6ff;
    border-radius: 1.5rem;
    margin: 5rem 0 3rem;
    border: .1rem solid #e8e4f0;
}

.post-author-card .author-avatar {
    width: 7rem;
    height: 7rem;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    border: .3rem solid #e8e4f0;
}

.author-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2d1d44;
    margin: 0 0 .5rem;
}

.author-bio {
    font-size: 1.45rem;
    color: #747474;
    margin: 0;
    line-height: 1.55;
}

/* ── Navegación entre posts ────────────────────────────────────────────── */

.post-nav {
    margin-top: 5rem;
    padding-top: 4rem;
    border-top: .1rem solid #e8e4f0;
}

.post-nav .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.post-nav .nav-previous a,
.post-nav .nav-next a {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: 2.2rem 2.5rem;
    background: #f9f6ff;
    border: .15rem solid #e8e4f0;
    border-radius: 1.4rem;
    text-decoration: none;
    height: 100%;
    box-sizing: border-box;
    transition: border-color .2s, background-color .2s;
}

.post-nav .nav-previous a:hover,
.post-nav .nav-next a:hover {
    border-color: #c31c4a;
    background: #fff;
}

.post-nav .nav-next a { text-align: right; }

.post-nav .nav-label {
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #c31c4a;
}

.post-nav .nav-title {
    font-size: 1.5rem;
    color: #2d1d44;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Comentarios ───────────────────────────────────────────────────────── */

.comentarios-wrap {
    margin-top: 5rem;
    padding-top: 4rem;
    border-top: .1rem solid #e8e4f0;
}

.comentarios-titulo {
    font-size: 2rem;
    color: #2d1d44;
    margin-bottom: 3rem;
    font-weight: 700;
    text-align: left;
}

.lista-comentarios {
    list-style: none;
    margin: 0 0 4rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.comentario-item {
    background: #f9f6ff;
    border: .1rem solid #e8e4f0;
    border-radius: 1.4rem;
    padding: 0 !important;
}

.comentario-body {
    padding: 2.5rem;
}

.comentario-header {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    margin-bottom: 1.6rem;
}

.comentario-avatar {
    width: 4.8rem !important;
    height: 4.8rem !important;
    border-radius: 50% !important;
    border: .2rem solid #e0dcea;
    flex-shrink: 0;
    object-fit: cover;
}

.comentario-avatar-inicial {
    width: 4.8rem;
    height: 4.8rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #2d1d44, #c31c4a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
    text-transform: uppercase;
    user-select: none;
}

.comentario-nombre {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d1d44;
}

.comentario-nombre a { color: inherit; text-decoration: none; }

.comentario-fecha {
    display: block;
    font-size: 1.3rem;
    color: #929499;
    margin-top: .2rem;
}

.comentario-texto {
    font-size: 1.6rem;
    color: #3a3a3a;
    line-height: 1.75;
    text-align: left;
}

.comentario-texto p { text-align: left; }
.comentario-texto p:last-child { margin-bottom: 0; }

.comment-reply-link {
    display: inline-block;
    margin-top: 1.4rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: #c31c4a;
    text-decoration: none;
}

.comment-reply-link:hover { color: #2d1d44; }

.comment-awaiting {
    font-size: 1.3rem;
    color: #856404;
    background: #fff8e1;
    padding: .6rem 1.2rem;
    border-radius: .6rem;
    margin-bottom: 1.2rem;
}

/* Navegación de comentarios (paginación) */
.comments-navigation {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 1.4rem;
}

.comments-navigation a { color: #c31c4a; text-decoration: none; }

/* Formulario de comentarios */
#respond {
    background: #fff;
    border: .15rem solid #e8e4f0;
    border-radius: 1.4rem;
    padding: 3rem;
}

#reply-title {
    font-size: 2rem;
    color: #2d1d44;
    margin: 0 0 .5rem;
    font-weight: 700;
}

#cancel-comment-reply-link {
    font-size: 1.4rem;
    color: #929499;
    text-decoration: none;
    margin-left: 1rem;
    font-weight: 400;
}

.form-nota {
    font-size: 1.4rem;
    color: #929499;
    margin: 0 0 2.5rem;
}

.required { color: #c31c4a; }

.comment-form p { margin-bottom: 1.8rem; }

.comment-form label {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    color: #2d1d44;
    margin-bottom: .7rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    width: 100%;
    border: .15rem solid #e8e4f0;
    border-radius: .8rem;
    padding: 1.1rem 1.4rem;
    font-size: 1.6rem;
    font-family: 'Montserrat', sans-serif;
    color: #3a3a3a;
    background: #fafafa;
    transition: border-color .2s, background-color .2s;
    box-sizing: border-box;
}

.comment-form textarea {
    width: 100%;
    border: .15rem solid #e8e4f0;
    border-radius: .8rem;
    padding: 1.1rem 1.4rem;
    font-size: 1.6rem;
    font-family: 'Montserrat', sans-serif;
    color: #3a3a3a;
    background: #fafafa;
    transition: border-color .2s, background-color .2s;
    box-sizing: border-box;
    min-height: 14rem;
    resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #c31c4a;
    background: #fff;
}

.form-submit { margin-bottom: 0; }

@media (max-width: 768px) {
    .post-titulo             { font-size: 2.8rem; }
    .post-content            { font-size: 1.7rem; }
    .post-content h2         { font-size: 2.2rem; margin-top: 4rem; }
    .post-content h3         { font-size: 1.8rem; }
    .post-content blockquote { font-size: 1.7rem; }
    .post-author-card        { flex-direction: column; text-align: center; padding: 2rem; }
    .post-nav .nav-links     { grid-template-columns: 1fr; }
    .post-nav .nav-next      { text-align: left; }
    .post-toc details        { /* stays open but closeable on mobile */ }
}

/* Tags */
.post-tags { margin: 3rem 0 2rem; }
.tag-link {
    display: inline-block;
    padding: .4rem 1rem;
    margin: .3rem;
    background-color: #f7f7f7;
    color: #2d1445;
    font-size: 1.3rem;
    border-radius: 20px;
    text-decoration: none;
    transition: background-color 0.2s;
}
.tag-link:hover { background-color: #2d1445; color: #fff; }

/* ── 404 ─────────────────────────────────────────────────────────────────── */

.error-404 h1 { font-size: 10rem; margin-bottom: 0; }
.error-404 h2 { margin-bottom: 2rem; }
.search-404   { margin-top: 4rem; }

/* ── Búsqueda ────────────────────────────────────────────────────────────── */

.search-form label { font-size: 1.5rem; color: #313131; }

.search-form .search-field {
    border: 1px solid #929499;
    border-radius: 2px;
    padding: 1rem 1.5rem;
    font-size: 1.6rem;
    font-family: 'monse', sans-serif;
    width: 100%;
    max-width: 480px;
}

.search-form .search-submit {
    background-color: #d01f46;
    color: #fff;
    border: none;
    border-radius: 2px;
    padding: 1rem 2rem;
    font-size: 1.6rem;
    cursor: pointer;
    font-family: 'monse', sans-serif;
    transition: background-color 0.3s;
    margin-left: .5rem;
}

.search-form .search-submit:hover { background-color: #2d1445; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .blog-grid.grid.column3 { grid-template-columns: repeat(2, 1fr); }
    .single-post-title { font-size: 2.8rem; }
}

@media (max-width: 600px) {
    .blog-grid.grid.column3 { grid-template-columns: 1fr; }
    .single-post-title { font-size: 2.2rem; }
    .error-404 h1 { font-size: 7rem; }
}
