/**
 * Blog Styles - Starhouse Theme
 *
 * Estilos para plantillas de blog completamente alineados al sistema de diseño:
 * - Archive/Listado de blogs (1 columna vertical)
 * - Single Post (post individual con relacionados)
 * - Paleta de colores HSL premium
 * - Tipografía Cormorant Garamond + Montserrat
 * - Efectos hover elegantes
 *
 * @package Starhouse
 * @since 1.0.6
 */

/* ==========================================================================
   ARCHIVE - LISTADO DE BLOGS
   ========================================================================== */

/* Archive Container */
.archive-container,
.blog-container {
    background: var(--background);
    padding: var(--spacing-lg) 0;
}

/* Page Header */
.page-header {
    text-align: center;
    padding: var(--spacing-md) 0 var(--spacing-lg);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--spacing-lg);
}

.page-title {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 700;
    color: var(--foreground);
    margin: 0 0 1rem;
    letter-spacing: 0.015em;
}

@media (min-width: 768px) {
    .page-title {
        font-size: 3.5rem;
    }
}

.archive-description {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--muted-foreground);
    max-width: 800px;
    margin: 0 auto;
}

/* Archive Grid - 1 Columna Vertical */
.archive-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    max-width: 896px; /* 4xl - same as single post */
    margin: 0 auto;
}

/* Archive Item (Post Card) */
.archive-item {
    background: hsl(0, 0%, 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 300ms ease;
    display: flex;
    flex-direction: column;
}

.archive-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

/* Post Thumbnail */
.post-thumbnail {
    position: relative;
    overflow: hidden;
    background: var(--muted);
}

.post-thumbnail a {
    display: block;
}

.post-thumbnail img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 300ms ease;
}

.archive-item:hover .post-thumbnail img {
    transform: scale(1.05);
}

/* Post Content */
.post-content {
    padding: var(--spacing-md);
}

/* Entry Header */
.entry-header {
    margin-bottom: var(--spacing-sm);
}

/* Category Badge */
.post-badge,
.category-badge {
    display: inline-block;
    background: var(--primary);
    color: var(--primary-foreground);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    margin-bottom: 1rem;
}

/* Entry Title */
.entry-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--foreground);
    margin: 0 0 1rem;
    letter-spacing: 0.02em;
}

@media (min-width: 768px) {
    .entry-title {
        font-size: 2.25rem;
    }
}

.entry-title a {
    color: var(--foreground);
    transition: color 300ms ease;
}

.entry-title a:hover {
    color: var(--primary);
}

/* Entry Meta */
.entry-meta,
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 1rem;
}

.entry-meta span,
.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.entry-meta svg,
.post-meta svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    flex-shrink: 0;
}

.entry-meta a,
.post-meta a {
    color: var(--muted-foreground);
    transition: color 300ms ease;
}

.entry-meta a:hover,
.post-meta a:hover {
    color: var(--primary);
}

/* Entry Summary (Excerpt) */
.entry-summary {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--foreground);
    margin-bottom: 1.5rem;
}

.entry-summary p {
    margin: 0;
}

/* Entry Footer */
.entry-footer {
    margin-top: auto;
}

/* Read More Button */
.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary);
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary);
    border-radius: var(--radius-md);
    transition: all 300ms ease;
}

.read-more svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    transition: transform 300ms ease;
}

.read-more:hover {
    background: var(--primary);
    color: var(--primary-foreground);
    transform: translateX(4px);
}

.read-more:hover svg {
    transform: translateX(4px);
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pagination,
.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border);
}

.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
    background: hsl(0, 0%, 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 300ms ease;
}

.page-numbers:hover {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

.page-numbers.current {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
    pointer-events: none;
}

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

/* ==========================================================================
   SINGLE POST
   ========================================================================== */

/* Single Post Container */
.single-post-container {
    background: var(--background);
    padding: var(--spacing-lg) 0;
}

.single-post-container .container {
    max-width: 896px; /* 4xl - optimal reading width */
}

/* Back to Blog Button */
.back-to-blog-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--muted-foreground);
    margin-bottom: var(--spacing-md);
    transition: all 300ms ease;
}

.back-to-blog-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    transition: transform 300ms ease;
}

.back-to-blog-btn:hover {
    color: var(--primary);
}

.back-to-blog-btn:hover svg {
    transform: translateX(-4px);
}

/* Post Header */
.post-header {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.post-header .post-badge {
    margin-bottom: 1rem;
}

.post-header .entry-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .post-header .entry-title {
        font-size: 3rem;
    }
}

.post-header .post-meta {
    justify-content: center;
}

/* Share Button */
.share-button {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 300ms ease;
}

.share-button svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.share-button:hover {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

/* Featured Image Wrapper */
.featured-image-wrapper {
    margin-bottom: var(--spacing-md);
    overflow: hidden;
    border-radius: 1rem;
}

.featured-image-wrapper img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Entry Content - Prose/Typography Styles */
.entry-content.prose {
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--foreground);
}

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

.entry-content.prose h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    margin-top: var(--spacing-md);
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.entry-content.prose h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: var(--spacing-md);
    margin-bottom: 0.75rem;
    letter-spacing: 0.025em;
}

.entry-content.prose h4 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.entry-content.prose ul,
.entry-content.prose ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.entry-content.prose li {
    margin-bottom: 0.5rem;
}

.entry-content.prose ul {
    list-style-type: disc;
}

.entry-content.prose ol {
    list-style-type: decimal;
}

.entry-content.prose a {
    color: var(--primary);
    text-decoration: underline;
}

.entry-content.prose a:hover {
    color: var(--accent);
}

.entry-content.prose blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
    margin: var(--spacing-md) 0;
    font-style: italic;
    color: var(--muted-foreground);
}

.entry-content.prose img {
    margin: var(--spacing-md) 0;
    border-radius: var(--radius-lg);
}

.entry-content.prose code {
    background: var(--muted);
    color: var(--foreground);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-family: 'Courier New', monospace;
}

.entry-content.prose pre {
    background: var(--muted);
    padding: 1rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 1.5rem 0;
}

.entry-content.prose pre code {
    background: transparent;
    padding: 0;
}

/* Tags Section */
.tags-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
}

.tags-section svg {
    width: 20px;
    height: 20px;
    stroke: var(--muted-foreground);
    flex-shrink: 0;
}

.tags-label {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--muted-foreground);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-badge {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--foreground);
    background: var(--muted);
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    transition: all 300ms ease;
}

.tag-badge:hover {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

/* ==========================================================================
   RELATED POSTS SECTION
   ========================================================================== */

.related-posts-section {
    background: var(--background-alt);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-xl);
}

.related-posts-section .container {
    max-width: 1400px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--foreground);
    margin-bottom: var(--spacing-lg);
    letter-spacing: 0.02em;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 3rem;
    }
}

/* Blog Posts Grid (Related Posts) */
.blog-posts-grid,
.related-posts-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .blog-posts-grid,
    .related-posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Post Card (Compact version for related) */
.post-card-link {
    display: block;
    text-decoration: none;
}

.post-card {
    background: hsl(0, 0%, 100%);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 300ms ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.post-image-column {
    position: relative;
    overflow: hidden;
    background: var(--muted);
}

.post-image-column img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 300ms ease;
}

.post-card:hover .post-image-column img {
    transform: scale(1.05);
}

.post-content-column {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.post-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--foreground);
    margin: 0 0 0.75rem;

    /* Limit to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-content-column .post-meta {
    margin-top: auto;
    margin-bottom: 0;
}

/* ==========================================================================
   RELATED PRODUCTS SECTION
   ========================================================================== */

.related-products-section {
    background: var(--background);
    padding: var(--spacing-xl) 0;
    border-top: 1px solid var(--border);
}

.related-products-section .container {
    max-width: 1400px;
}

/* Products Grid */
.products-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Product Card (use same styles as WooCommerce) */
.product-card-link {
    display: block;
    text-decoration: none;
}

.product-card {
    background: hsl(0, 0%, 100%);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 300ms ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.product-image-wrapper {
    position: relative;
    overflow: hidden;
    background: var(--muted);
}

.product-image-wrapper img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 300ms ease;
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.05);
}

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

.product-title {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--foreground);
    margin: 0 0 0.5rem;

    /* Limit to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0 0 1rem;
}

.product-price del {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--muted-foreground);
    margin-right: 0.5rem;
}

.product-price ins {
    text-decoration: none;
    color: var(--destructive);
}

.product-button {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 300ms ease;
    margin-top: auto;
}

.product-button:hover {
    background: hsl(32, 36%, 42%); /* Primary dark */
    transform: scale(1.02);
}

.product-sale-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--destructive);
    color: var(--primary-foreground);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    z-index: 10;
}

/* ==========================================================================
   NO RESULTS / EMPTY STATE
   ========================================================================== */

.no-results {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    max-width: 600px;
    margin: 0 auto;
}

.no-results h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 1rem;
}

.no-results p {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--muted-foreground);
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 767px) {
    .archive-grid {
        gap: var(--spacing-md);
    }

    .post-content {
        padding: var(--spacing-sm);
    }

    .entry-title {
        font-size: 1.5rem;
    }

    .post-header .entry-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .page-title {
        font-size: 2.25rem;
    }
}

/* ==========================================================================
   ANIMATION
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.archive-item,
.post-card,
.product-card {
    animation: fadeInUp 0.5s ease-out backwards;
}

/* Stagger animation for grid items */
.archive-item:nth-child(1),
.post-card:nth-child(1),
.product-card:nth-child(1) { animation-delay: 0.05s; }

.archive-item:nth-child(2),
.post-card:nth-child(2),
.product-card:nth-child(2) { animation-delay: 0.1s; }

.archive-item:nth-child(3),
.post-card:nth-child(3),
.product-card:nth-child(3) { animation-delay: 0.15s; }

.archive-item:nth-child(4),
.post-card:nth-child(4),
.product-card:nth-child(4) { animation-delay: 0.2s; }

.archive-item:nth-child(5),
.post-card:nth-child(5),
.product-card:nth-child(5) { animation-delay: 0.25s; }

.archive-item:nth-child(6),
.post-card:nth-child(6),
.product-card:nth-child(6) { animation-delay: 0.3s; }
