/**
 * Archive Templates Styles
 * Estilos para category.php, archive.php, search.php y 404.php
 * 
 * @package PlanaMayor_Theme
 * @since 1.0.0
 */

/* ========================================
   ARCHIVE & CATEGORY PAGES
   ======================================== */

.archive-container,
.search-container {
    padding: 40px 0;
    background-color: #f5f5f5;
    min-height: calc(100vh - 400px);
}

.archive-with-sidebar,
.search-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    align-items: start;
}

/* Archive Header */
.archive-header,
.search-header {
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.archive-header-content,
.search-header-content {
    text-align: center;
}

.archive-type,
.search-label {
    display: none !important;
}

.search-label svg {
    width: 16px;
    height: 16px;
}

.archive-title,
.search-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #000000;
    margin: 0 0 15px;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 4px solid var(--color-primary, #f70d28);
    padding-bottom: 15px;
    display: inline-block;
}

.archive-description {
    font-size: 1.125rem;
    color: var(--color-text-light);
    line-height: 1.6;
    margin: 20px 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.archive-count,
.search-count {
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin-top: 15px;
    font-weight: 500;
}

/* Author Info */
.author-info {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.author-avatar {
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--color-primary);
    box-shadow: 0 4px 12px rgba(247, 13, 40, 0.2);
}

.author-avatar img {
    display: block;
    width: 80px;
    height: 80px;
}

/* ========================================
   SEARCH PAGES
   ======================================== */

.search-again {
    margin-top: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-form-inline .search-form-wrapper {
    display: flex;
    gap: 0;
    background: white;
    border-radius: 30px;
    padding: 4px;
    border: 2px solid #e0e0e0;
    transition: border-color 0.3s ease;
}

.search-form-inline .search-form-wrapper:focus-within {
    border-color: var(--color-primary);
}

.search-form-inline .search-field {
    flex: 1;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    background: transparent;
    outline: none;
}

.search-form-inline .search-submit {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--color-primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.search-form-inline .search-submit:hover {
    background: var(--color-accent);
    transform: scale(1.05);
}

.search-suggestions {
    background: #f9f9f9;
    border-left: 4px solid var(--color-primary);
    padding: 25px 30px;
    border-radius: 8px;
    margin: 30px 0;
    text-align: left;
}

.search-suggestions h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 15px;
}

.search-suggestions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-suggestions li {
    padding: 8px 0 8px 30px;
    position: relative;
    color: var(--color-text-light);
    font-size: 0.95rem;
}

.search-suggestions li:before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: bold;
}

/* ========================================
   404 ERROR PAGE
   ======================================== */

.error-404-container {
    padding: 60px 0;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    min-height: calc(100vh - 400px);
}

.error-404-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.error-404-number {
    font-size: 150px;
    font-weight: 900;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 20px;
    text-shadow: 0 4px 10px rgba(247, 13, 40, 0.2);
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.error-404-icon {
    margin: 20px 0;
    color: var(--color-primary);
    opacity: 0.7;
}

.error-404-icon svg {
    filter: drop-shadow(0 4px 8px rgba(247, 13, 40, 0.15));
}

.error-404-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 30px 0 20px;
}

.error-404-text {
    font-size: 1.125rem;
    color: var(--color-text-light);
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 404 Search Form */
.error-404-search {
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin: 40px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.error-404-search h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 25px;
}

.search-form-404 .search-form-wrapper {
    display: flex;
    gap: 0;
    background: white;
    border-radius: 30px;
    padding: 4px;
    border: 2px solid #e0e0e0;
    max-width: 600px;
    margin: 0 auto;
    transition: border-color 0.3s ease;
}

.search-form-404 .search-form-wrapper:focus-within {
    border-color: var(--color-primary);
}

.search-form-404 .search-field {
    flex: 1;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    background: transparent;
    outline: none;
}

.search-form-404 .search-submit {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--color-primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.search-form-404 .search-submit:hover {
    background: var(--color-accent);
    transform: scale(1.05);
}

/* 404 Useful Links */
.error-404-links {
    margin: 50px 0;
}

.error-404-links h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 25px;
}

.error-404-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.button-primary,
.button-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.button-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(247, 13, 40, 0.3);
}

.button-primary:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(247, 13, 40, 0.4);
}

.button-secondary {
    background: white;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.button-secondary:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
}

/* 404 Recent Posts */
.error-404-recent-posts {
    margin-top: 60px;
}

.error-404-recent-posts h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 30px;
}

.error-404-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* ========================================
   NO RESULTS
   ======================================== */

.no-results {
    background: white;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.no-results-icon {
    margin-bottom: 30px;
    color: var(--color-primary);
    opacity: 0.5;
}

.no-results h1,
.no-results h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 15px;
}

.no-results p {
    font-size: 1.125rem;
    color: var(--color-text-light);
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   SIDEBAR
   ======================================== */

.archive-sidebar,
.search-sidebar {
    /* Sidebar sin sticky - se mueve con el contenido */
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablets */
@media (max-width: 1024px) {
    .archive-with-sidebar,
    .search-with-sidebar {
        grid-template-columns: 1fr 300px;
        gap: 30px;
    }
    
    .archive-title,
    .search-title {
        font-size: 2rem;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .archive-container,
    .search-container,
    .error-404-container {
        padding: 20px 0;
    }
    
    .archive-with-sidebar,
    .search-with-sidebar {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .archive-sidebar,
    .search-sidebar {
        position: static;
    }
    
    .archive-header,
    .search-header {
        padding: 30px 20px;
        margin-bottom: 20px;
    }
    
    .archive-title,
    .search-title {
        font-size: 1.75rem;
    }
    
    .archive-description {
        font-size: 1rem;
    }
    
    .error-404-number {
        font-size: 100px;
    }
    
    .error-404-title {
        font-size: 1.75rem;
    }
    
    .error-404-text {
        font-size: 1rem;
    }
    
    .error-404-search {
        padding: 25px 20px;
    }
    
    .error-404-search h2 {
        font-size: 1.25rem;
    }
    
    .error-404-grid {
        grid-template-columns: 1fr;
    }
    
    .error-404-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .button-primary,
    .button-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .archive-title,
    .search-title {
        font-size: 1.5rem;
    }
    
    .error-404-number {
        font-size: 80px;
    }
    
    .archive-type,
    .search-label {
        font-size: 0.75rem;
        padding: 6px 15px;
    }
}

/* ========================================
   PAGE TEMPLATE
   ======================================== */

.page-container {
    padding: 40px 0;
    background-color: #f5f5f5;
    min-height: calc(100vh - 400px);
}

.page-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    align-items: start;
}

.page-article {
    background: white;
    border-radius: 12px;
    padding: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.page-header {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 3px solid var(--color-primary);
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 15px;
    line-height: 1.2;
}

.page-excerpt {
    font-size: 1.25rem;
    color: var(--color-text-light);
    line-height: 1.6;
    margin-top: 15px;
}

.page-thumbnail {
    margin: 30px 0;
    border-radius: 12px;
    overflow: hidden;
}

.page-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.page-content {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--color-text);
}

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

.page-content h2, .page-content h3, .page-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.page-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.page-sidebar {
    position: sticky;
    top: 100px;
}

/* ========================================
   TAG TEMPLATE
   ======================================== */

.popular-tags {
    margin: 30px 0;
    text-align: center;
}

.popular-tags h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 20px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.tag-cloud .tag-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: white;
    border: 2px solid var(--color-primary);
    border-radius: 20px;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tag-cloud .tag-link:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(247, 13, 40, 0.3);
}

.tag-cloud .tag-count {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ========================================
   AUTHOR TEMPLATE
   ======================================== */

.author-header .archive-header-content {
    text-align: left;
}

.author-info-header {
    display: flex;
    gap: 30px;
    align-items: start;
    margin-top: 30px;
}

.author-avatar-large {
    flex-shrink: 0;
}

.author-avatar-large img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--color-primary);
    box-shadow: 0 4px 12px rgba(247, 13, 40, 0.2);
}

.author-details {
    flex: 1;
}

.author-name {
    margin-bottom: 15px;
}

.author-bio {
    margin-bottom: 20px;
}

.author-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 0.95rem;
    color: var(--color-text-light);
}

.author-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-meta svg {
    flex-shrink: 0;
}

.author-meta a {
    color: var(--color-primary);
    font-weight: 600;
}

.author-posts-section {
    margin: 40px 0 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.author-posts-section .section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.author-name-highlight {
    color: var(--color-primary);
}

.other-authors {
    margin: 30px 0;
    text-align: left;
}

.other-authors h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 20px;
    text-align: center;
}

.authors-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.author-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.author-item:hover {
    border-color: var(--color-primary);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(247, 13, 40, 0.15);
}

.author-item-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.author-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.author-item-name {
    font-weight: 600;
    color: var(--color-text);
    font-size: 1rem;
}

.author-item-count {
    font-size: 0.875rem;
    color: var(--color-text-light);
}
