/*
Theme Name: Historias de Suipacha
Theme URI: https://historiasdesuipacha.com.ar
Author: Mariano Cappucci
Description: Tema literario para las historias de Suipacha
Version: 3.0.0
Requires at least: 5.0
Requires PHP: 7.4
License: GPL v2 or later
Text Domain: historiasdesuipacha
*/

/* ═══════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 17px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    font-size: 1rem;
    line-height: 1.8;
    color: #2c2416;
    background-color: #faf8f3;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #d4af37;
    text-decoration: none;
    transition: color 0.25s ease;
}

a:hover {
    color: #b8952a;
}

p {
    margin-bottom: 1.25rem;
}

p:last-child {
    margin-bottom: 0;
}

/* ═══════════════════════════════════════
   TIPOGRAFÍA
═══════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
    line-height: 1.2;
    color: #1a2332;
    font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }

/* ═══════════════════════════════════════
   LAYOUT
═══════════════════════════════════════ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2.5rem;
}

/* ═══════════════════════════════════════
   HEADER
═══════════════════════════════════════ */
header,
.site-header {
    display: block;
    width: 100%;
    background-color: #1a2332;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}


.header-container,
header > .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
    gap: 2rem;
}

header h1,
.site-branding h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin: 0;
}

.site-branding h1 a {
    color: #d4af37;
}

.site-branding h1 a:hover {
    color: #f0d060;
}

.site-branding img {
    max-height: 50px;
    width: auto;
}

.primary-navigation {
    background: transparent;
}

.primary-navigation ul {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.primary-navigation ul li {
    margin: 0;
}

.primary-navigation a {
    font-family: 'Lora', Georgia, serif;
    font-size: 0.82rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #c8bfaf;
    text-decoration: none;
    transition: color 0.25s;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
}

.primary-navigation a:hover,
.primary-navigation .current-menu-item > a {
    color: #d4af37;
    border-bottom-color: #d4af37;
}

/* fallback link cuando no hay menú */
.primary-navigation > a {
    font-family: 'Lora', Georgia, serif;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #c8bfaf;
}

/* ═══════════════════════════════════════
   HERO
═══════════════════════════════════════ */
.hero-section {
    background: linear-gradient(160deg, #1a2332 60%, #0f1820 100%);
    color: #e8dfc8;
    padding: 7rem 2.5rem 6rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center top, rgba(212, 175, 55, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

.hero-content {
    max-width: 780px;
    margin: 0 auto;
    position: relative;
}

.hero-section h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -0.5px;
    margin-bottom: 0.4rem;
}

.hero-section .subtitle {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-style: italic;
    color: #d4af37;
    margin-bottom: 1.75rem;
    font-weight: 400;
    display: block;
}

.hero-section .description {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.05rem;
    color: #b8b0a0;
    line-height: 1.85;
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.hero-cta {
    display: inline-block;
    background: transparent;
    color: #d4af37;
    border: 1.5px solid #d4af37;
    padding: 0.85rem 2.5rem;
    font-family: 'Lora', Georgia, serif;
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.3s, color 0.3s, transform 0.2s;
}

.hero-cta:hover {
    background: #d4af37;
    color: #1a2332;
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════
   SECCIONES
═══════════════════════════════════════ */
.section {
    padding: 5rem 0;
}

.section h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    text-align: center;
    color: #1a2332;
    margin-bottom: 0;
}

.section h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 2px;
    background: #d4af37;
    margin: 0.9rem auto 3rem;
}

.novedades-section {
    background-color: #faf8f3;
}

.libros-section {
    background-color: #f0ede5;
}

/* ═══════════════════════════════════════
   GRILLA DE CARDS
═══════════════════════════════════════ */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.post-card {
    background: #fff;
    border: 1px solid #e0d8c8;
    padding: 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s;
}

.post-card:hover {
    box-shadow: 0 8px 30px rgba(26, 35, 50, 0.1);
    transform: translateY(-4px);
    border-color: #d4af37;
}

.post-card h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    color: #1a2332;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.post-card h3 a {
    color: inherit;
    text-decoration: none;
}

.post-card h3 a:hover {
    color: #d4af37;
}

.post-card p {
    font-size: 0.93rem;
    color: #5a5040;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex: 1;
}

.post-card a:last-of-type {
    font-family: 'Lora', Georgia, serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-decoration: none;
    margin-top: auto;
    display: inline-block;
    transition: letter-spacing 0.2s;
}

.post-card a:last-of-type:hover {
    letter-spacing: 2.5px;
}

/* ═══════════════════════════════════════
   ENTRADA INDIVIDUAL
═══════════════════════════════════════ */
.single-post,
.page-content {
    width: 100%;
    margin: 0 0 5rem;
    padding: 0;
}

/* Cabecera oscura full-width — igual que archive-header y hero */
.single-post .post-header,
.page-content .post-header {
    background: linear-gradient(160deg, #1a2332 60%, #0f1820 100%);
    padding: 4rem max(2.5rem, calc((100% - 1200px) / 2 + 2.5rem)) 3rem;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    margin-bottom: 0;
    position: relative !important;
    top: auto !important;
}

/* Título — blanco sobre fondo oscuro, selectores dobles para ganar sobre CSS inyectado */
.single-post .post-header h1,
.page-content .post-header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    color: #ffffff;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    font-weight: 700;
    max-width: 860px;
    display: block;
}

.post-meta {
    font-family: 'Lora', Georgia, serif;
    font-size: 0.875rem;
    color: #b8b0a0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    align-items: center;
}

.post-meta span {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-meta a {
    color: #d4af37;
}

/* Cuerpo del artículo — ancho de lectura, centrado en la página */
.single-post .post-content,
.page-content .post-content {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.06rem;
    line-height: 1.9;
    color: #2c2416;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 3.5rem 2.5rem 2rem;
}

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

.post-content h2,
.post-content h3,
.post-content h4 {
    font-family: 'Playfair Display', Georgia, serif;
    color: #1a2332;
    margin: 2.5rem 0 1rem;
}

.post-content blockquote {
    margin: 2.5rem 0;
    padding: 1.25rem 1.75rem;
    border-left: 3px solid #d4af37;
    background: #f0ede5;
    font-style: italic;
    color: #4a4030;
}

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

.post-content img {
    width: 100%;
    margin: 2rem 0;
}

.post-content a {
    color: #d4af37;
    border-bottom: 1px solid rgba(212, 175, 55, 0.4);
    padding-bottom: 1px;
}

/* ═══════════════════════════════════════
   ARCHIVO / CATEGORÍA
═══════════════════════════════════════ */
.archive-header {
    background: linear-gradient(160deg, #1a2332 60%, #0f1820 100%);
    padding: 4rem 2.5rem;
    text-align: center;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
}

.archive-header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 4vw, 3rem);
    color: #d4af37;
    margin-bottom: 0.5rem;
}

.archive-header p {
    font-style: italic;
    color: #b8b0a0;
    font-size: 1.05rem;
    margin: 0;
}

/* ═══════════════════════════════════════
   PAGINACIÓN
═══════════════════════════════════════ */
.pagination,
nav.navigation.pagination {
    margin-top: 3rem;
    text-align: center;
}

.page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.2rem;
    border: 1px solid #d4c9b2;
    font-family: 'Lora', Georgia, serif;
    font-size: 0.9rem;
    color: #2c2416;
    background: transparent;
    transition: all 0.2s;
}

.page-numbers.current,
.page-numbers:hover {
    background: #d4af37;
    border-color: #d4af37;
    color: #fff;
}

.page-numbers.dots {
    border-color: transparent;
    background: transparent;
}

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
footer,
.site-footer {
    display: block;
    width: 100%;
    background-color: #141b27;
    color: #b0a898;
    padding: 4rem 0 2rem;
    margin-top: 5rem;
    border-top: 2px solid rgba(212, 175, 55, 0.3);
}

footer p,
.footer-bottom p {
    color: #8a8070;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h4 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    color: #d4af37;
    margin-bottom: 1.1rem;
    letter-spacing: 0.5px;
}

.footer-section p {
    font-size: 0.9rem;
    line-height: 1.75;
    color: #8a8070;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.6rem;
}

.footer-section ul a {
    font-size: 0.9rem;
    color: #8a8070;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section ul a:hover {
    color: #d4af37;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 1.5rem;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: #60584e;
    margin: 0;
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 900px) {
    .section { padding: 3.5rem 0; }
    .single-post .post-header,
    .page-content .post-header { padding: 2.5rem 1.75rem 2rem; }
    .single-post .post-content,
    .page-content .post-content { padding: 2.5rem 1.75rem; }
}

@media (max-width: 640px) {
    .container { padding: 0 1.25rem; }

    .header-container {
        flex-direction: column;
        gap: 0.75rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .primary-navigation ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem 1.75rem;
    }

    .hero-section { padding: 4rem 1.25rem 3.5rem; }
    .posts-grid { grid-template-columns: 1fr; }
    .post-card { padding: 1.5rem; }
    .single-post .post-header,
    .page-content .post-header { padding: 2rem 1.25rem 1.5rem; }
    .single-post .post-content,
    .page-content .post-content { padding: 2rem 1.25rem; }
    .footer-content { grid-template-columns: 1fr; gap: 2rem; }
    .archive-header { padding: 3rem 1.25rem; }
}

/* ═══════════════════════════════════════
   EXTRAS
═══════════════════════════════════════ */
main { min-height: 50vh; }

::selection {
    background: #d4af37;
    color: #1a2332;
}

/* ═══════════════════════════════════════
   SINGLE LIBRO — portada izquierda + texto derecha
═══════════════════════════════════════ */
.libro-layout {
    display: flex !important;
    flex-direction: row;
    gap: 3.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3.5rem 2.5rem 3rem;
    align-items: flex-start;
}

.book-single-cover {
    flex: 0 0 260px;
    width: 260px;
}

.book-single-cover img {
    width: 100%;
    height: auto;
    display: block;
    box-shadow: 0 10px 40px rgba(26, 35, 50, 0.25);
}

.libro-layout .post-content {
    flex: 1;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0;
}

.book-download-btn {
    display: block;
    margin-top: 1.5rem;
    background: #d4af37;
    color: #1a2332;
    text-align: center;
    padding: 0.9rem 1rem;
    font-family: 'Lora', Georgia, serif;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    transition: background 0.25s, color 0.25s, transform 0.2s;
    border: 1.5px solid #d4af37;
}

.book-download-btn:hover {
    background: transparent;
    color: #d4af37;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .libro-layout {
        flex-direction: column !important;
        gap: 2rem;
        padding: 2rem 1.25rem;
    }
    .book-single-cover {
        flex: none;
        width: 220px;
        position: static;
        margin: 0 auto;
    }
}

/* ═══════════════════════════════════════
   LISTA DE LIBROS (archivo categoría)
═══════════════════════════════════════ */
.books-list {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.book-list-item {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e0d8c8;
    transition: box-shadow 0.3s, border-color 0.3s, transform 0.3s;
}

.book-list-item:hover {
    box-shadow: 0 6px 24px rgba(26, 35, 50, 0.1);
    border-color: #d4af37;
    transform: translateY(-2px);
}

.book-list-cover {
    flex: 0 0 160px;
    width: 160px;
    display: block;
    overflow: hidden;
    line-height: 0;
}

.book-list-cover .book-cover-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.book-list-item:hover .book-list-cover .book-cover-img {
    transform: scale(1.03);
}

.book-list-info {
    flex: 1;
    min-width: 0;
    padding: 1.75rem 1.75rem 1.75rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.book-list-info h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    color: #1a2332;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.book-list-info h3 a {
    color: inherit;
    text-decoration: none;
}

.book-list-info h3 a:hover {
    color: #d4af37;
}

.book-list-info p {
    font-size: 0.95rem;
    color: #5a5040;
    line-height: 1.75;
    margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
    .book-list-item {
        flex-direction: column;
        gap: 0;
    }
    .book-list-cover {
        width: 100%;
        flex: none;
    }
    .book-list-info {
        padding: 1.25rem;
    }
}

/* ═══════════════════════════════════════
   CARDS DE LIBROS (con portada)
═══════════════════════════════════════ */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2.5rem;
}

.book-card {
    background: #fff;
    border: 1px solid #e0d8c8;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s;
}

.book-card:hover {
    box-shadow: 0 8px 30px rgba(26, 35, 50, 0.12);
    transform: translateY(-4px);
    border-color: #d4af37;
}

.book-cover {
    display: block;
    overflow: hidden;
    line-height: 0;
}

.book-cover-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.book-card:hover .book-cover-img {
    transform: scale(1.03);
}

.book-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.book-info h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.15rem;
    color: #1a2332;
    margin-bottom: 0.6rem;
    line-height: 1.3;
}

.book-info h3 a {
    color: inherit;
    text-decoration: none;
}

.book-info h3 a:hover {
    color: #d4af37;
}

.book-info p {
    font-size: 0.9rem;
    color: #5a5040;
    line-height: 1.7;
    margin-bottom: 1.25rem;
    flex: 1;
}

.book-link {
    font-family: 'Lora', Georgia, serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-decoration: none;
    display: inline-block;
    transition: letter-spacing 0.2s;
    margin-top: auto;
}

.book-link:hover {
    letter-spacing: 2.5px;
    color: #b8952a;
}

@media (max-width: 640px) {
    .books-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}

/* ═══════════════════════════════════════
   SECCIÓN OTROS LIBROS
═══════════════════════════════════════ */
.otros-libros-section {
    background-color: #f0ede5;
}

/* ═══════════════════════════════════════
   SECCIÓN ACERCA DEL AUTOR
═══════════════════════════════════════ */
.autor-section {
    background: #1a2332;
}

.autor-section h2 {
    color: #d4af37;
}

.autor-section h2::after {
    background: rgba(212, 175, 55, 0.35);
}

.autor-content {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.autor-content p {
    color: #e8dfc8;
    font-size: 1.05rem;
    line-height: 1.85;
    font-style: italic;
    margin-bottom: 1.25rem;
}

.autor-content p:last-child {
    margin-bottom: 0;
}

/* ═══════════════════════════════════════
   STRETCHED LINKS — cards completamente clickeables
═══════════════════════════════════════ */
.post-card,
.book-card,
.book-list-item {
    position: relative;
}

.post-card > a::after,
.book-card .book-link::after,
.book-list-item .book-link::after {
    content: '';
    position: absolute;
    inset: 0;
}

/* ═══════════════════════════════════════
   SHARE BAR — botones de redes sociales
═══════════════════════════════════════ */
.share-bar {
    max-width: 860px;
    margin: 0 auto 3rem;
    padding: 1.5rem 2.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    border-top: 1px solid rgba(44, 36, 22, 0.12);
    border-bottom: 1px solid rgba(44, 36, 22, 0.12);
}

.share-label {
    font-family: 'Lora', Georgia, serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #7a6a52;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 4px;
    font-family: 'Lora', Georgia, serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.15s ease;
    line-height: 1;
}

.share-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
    color: #fff;
}

.share-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex-shrink: 0;
}

.share-facebook  { background: #1877f2; }
.share-twitter   { background: #000; }
.share-whatsapp  { background: #25d366; }
.share-linkedin  { background: #0a66c2; }
.share-telegram  { background: #0088cc; }

@media (max-width: 640px) {
    .share-bar {
        padding: 1.25rem 1.25rem;
        gap: 0.75rem;
    }
    .share-label { width: 100%; }
    .share-btn { font-size: 0.78rem; padding: 0.4rem 0.75rem; }
}
