/* assets/css/style.css */

/* Magazine News Layout - Modern Minimalist Design */
:root {
    --primary-color: #7c182a;
    --primary-dark: #5a1220;
    --primary-light: #9c2a3c;
    --primary-accent: #b8344a;
    --text-dark: #1a1a1a;
    --text-medium: #4a4a4a;
    --text-light: #6b6b6b;
    --text-muted: #9a9a9a;
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-lighter: #fafbfc;
    --bg-section: #fdfdfd;
    --border-light: #e9ecef;
    --border-medium: #dee2e6;
    --border-subtle: #f1f3f4;
    --shadow-light: 0 2px 12px rgba(124, 24, 42, 0.08);
    --shadow-medium: 0 4px 20px rgba(124, 24, 42, 0.12);
    --shadow-hover: 0 8px 32px rgba(124, 24, 42, 0.16);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --border-radius: 16px;
    --border-radius-small: 12px;
    --border-radius-large: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
    --spacing-xxl: 64px;
}

* {
    box-sizing: border-box;
}

.magazine-news {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}

/* Hero Section - Clickable */
.magazine-hero-clickable {
    color: white;
    position: relative;
    margin-bottom: var(--spacing-xxl);
    border-radius: var(--border-radius-large);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    background: var(--bg-white);
    border: 1px solid var(--border-subtle);
}

/*
.magazine-hero-clickable:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-6px);*/
    /*border-color: var(--primary-light);
}
*/

.hero-link {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.hero-image {
    position: relative;
    height: 480px;
    overflow: hidden;
    background: var(--bg-light);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
    filter: brightness(1.02) contrast(1.05);
}

.hero-link:hover .hero-image img {
    transform: scale(1.02);
    filter: brightness(1.05) contrast(1.08);
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    padding: var(--spacing-xl) var(--spacing-lg) var(--spacing-lg);
    color: var(--bg-white);
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin: 0 0 var(--spacing-sm) 0;
    line-height: 1.1;
    letter-spacing: -0.025em;
    text-shadow: 0 2px 12px rgba(0,0,0,0.7);
}

.hero-meta {
    margin-bottom: var(--spacing-md);
}

.hero-date {
    background: var(--primary-color);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(124, 24, 42, 0.3);
}

.hero-excerpt {
    font-size: 1.25rem;
    line-height: 1.4;
    opacity: 0.95;
    max-width: 85%;
    font-weight: 400;
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

/* Category Filter Section */
.magazine-category-filter {
    margin-bottom: var(--spacing-xl);
}

.magazine-categories-horizontal {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    /*gap: var(--spacing-sm);*/
    margin-bottom: var(--spacing-lg);
    /*padding: var(--spacing-md) 0;*/
    border-bottom: 1px solid var(--border-light);
}

.category-tab {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-white);
    border: 2px solid var(--border-medium);
    border-radius: 30px;
    text-decoration: none;
    color: var(--text-medium);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
}

.category-tab:hover {
    background: var(--bg-lighter);
    border-color: var(--primary-light);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.category-tab.active {
    background: var(--primary-color);
    color: var(--bg-white);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-light);
}

/* Latest Posts Horizontal */
.magazine-latest-posts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

@media (max-width: 1024px) {
    .magazine-latest-posts {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .magazine-latest-posts {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 480px) {
    .magazine-latest-posts {
        grid-template-columns: 1fr;
    }
}

.latest-post-item {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.latest-post-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-light);
}

.latest-post-item a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.latest-post-item img,
.no-image-placeholder {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.no-image-placeholder {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--border-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.no-image-placeholder::before {
    content: "Sin imagen";
}

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

.latest-post-content h4 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 var(--spacing-xs) 0;
    line-height: 1.4;
    color: var(--text-dark);
}

.latest-post-date {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Category Sections */
.magazine-category-section {
    margin-bottom: var(--spacing-xl);
}

.category-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 3px solid var(--primary-color);
    position: relative;
    letter-spacing: -0.01em;
}

.category-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 80px;
    height: 3px;
    background: var(--primary-dark);
}

/* Category Posts Layout */
.category-posts-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: start;
}

.featured-left .featured-post {
    order: 1;
}

.featured-left .posts-list {
    order: 2;
}

.featured-right .featured-post {
    order: 2;
}

.featured-right .posts-list {
    order: 1;
}

/* Featured Post */
.featured-post {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.featured-post:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-light);
}

.featured-post a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.featured-post img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.featured-content {
    padding: var(--spacing-lg);
}

.featured-content h3, .featured-content h4, .featured-content h5 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 var(--spacing-sm) 0;
    line-height: 1.3;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

.post-meta {
    margin-bottom: var(--spacing-sm);
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.post-date {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

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

.post-excerpt {
    color: var(--text-medium);
    line-height: 1.6;
    margin: 0;
}

/* Posts List */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.list-post-item {
    background: var(--bg-white);
    border-radius: var(--border-radius-small);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.list-post-item:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-light);
}

.list-post-item a {
    display: flex;
    text-decoration: none;
    color: inherit;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
}

.list-post-thumbnail {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    border-radius: var(--border-radius-small);
    overflow: hidden;
    background: var(--bg-light);
}

.list-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-post-content {
    flex: 1;
    min-width: 0;
}

.list-post-content h4 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 var(--spacing-xs) 0;
    line-height: 1.3;
    color: var(--text-dark);
}

.list-post-date {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    display: block;
}

.list-post-excerpt {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* All News Section */
.magazine-all {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 2px solid var(--border-light);
}

.magazine-all h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-lg);
    text-align: center;
    letter-spacing: -0.01em;
}

.grid-four {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

@media (max-width: 1024px) {
    .grid-four {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-four {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .grid-four {
        grid-template-columns: 1fr;
    }
}

.post-item {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.post-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-light);
}

.post-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.post-item h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: var(--spacing-sm);
    line-height: 1.4;
    color: var(--text-dark);
}

.post-item p {
    margin: 0 var(--spacing-sm) var(--spacing-sm);
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Placeholder styles for posts without featured images */
.hero-placeholder,
.post-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-light-gray);
    border-radius: var(--border-radius);
    min-height: 200px;
}

.hero-placeholder svg,
.post-placeholder svg {
    max-width: 100%;
    height: auto;
    opacity: 0.7;
}

.hero-placeholder {
    min-height: 300px;
}

/* Error and loading states */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-light);
    font-style: italic;
}

.error {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

/* Load More Button */
.load-more {
    display: block;
    margin: var(--spacing-xl) auto;
    padding: var(--spacing-sm) var(--spacing-xl);
    background: var(--primary-color);
    color: var(--bg-white);
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
    letter-spacing: 0.02em;
}

.load-more:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.load-more:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading States */
.loading {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
    font-style: italic;
}

.error {
    text-align: center;
    padding: var(--spacing-xl);
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: var(--border-radius-small);
    margin: var(--spacing-md) 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .magazine-news {
        padding: 0 var(--spacing-sm);
    }
    
    .hero-content {
        padding: var(--spacing-lg) var(--spacing-md) var(--spacing-md);
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-excerpt {
        max-width: 100%;
        font-size: 1.1rem;
    }
    
    .magazine-categories-horizontal {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: var(--spacing-sm);
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .magazine-categories-horizontal::-webkit-scrollbar {
        display: none;
    }
    
    .category-tab {
        flex-shrink: 0;
    }
    
    .magazine-latest-posts {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .category-posts-layout {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .featured-left .featured-post,
    .featured-right .featured-post {
        order: 1;
    }
    
    .featured-left .posts-list,
    .featured-right .posts-list {
        order: 2;
    }
    
    .grid-four {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--spacing-sm);
    }
    
    .list-post-item a {
        padding: var(--spacing-sm);
        gap: var(--spacing-sm);
    }
    
    .list-post-thumbnail {
        width: 80px;
        height: 80px;
    }
    
    .category-title {
        font-size: 1.75rem;
    }
    
    .magazine-all h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .category-title {
        font-size: 1.5rem;
    }
    
    .magazine-all h2 {
        font-size: 1.5rem;
    }
    
    .magazine-latest-posts {
        grid-template-columns: 1fr;
    }
    
    .grid-four {
        grid-template-columns: 1fr;
    }
    
    .hero-image {
        height: 300px;
    }
}

/* Legacy styles for other models */
.magazine-hero {
    position: relative;
    margin-bottom: var(--spacing-md);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.magazine-hero img {
    width: 100%;
    height: auto;
}

.magazine-hero h1 {
    position: absolute;
    bottom: var(--spacing-sm);
    left: var(--spacing-sm);
    color: var(--bg-white);
    background: rgba(0,0,0,0.7);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-small);
    margin: 0;
}

.magazine-categories {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    gap: var(--spacing-sm);
}

.magazine-categories a {
    padding: var(--spacing-xs) var(--spacing-sm);
    text-decoration: none;
    color: var(--primary-color);
    border-radius: var(--border-radius-small);
    transition: var(--transition);
}

.magazine-categories a:hover,
.magazine-categories a.active {
    background: var(--primary-color);
    color: var(--bg-white);
}

.two-columns {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.col-three, .col-one {
    flex: 1;
    min-width: 300px;
}

.left-three .col-three {
    order: 1;
}

.left-three .col-one {
    order: 2;
}

.right-three .col-three {
    order: 2;
}

.right-three .col-one {
    order: 1;
}

.masonry-grid {
    column-count: 3;
    column-gap: var(--spacing-md);
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-light);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-small);
    background: var(--bg-white);
}