/**
 * Core Template Styles for SpeedRead Theme
 * Basic styling for archive, single, page, and 404 templates
 */

/* Archive Templates */
.archive-container,
.single-container,
.page-container,
.error-404-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.archive-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.archive-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
    margin-bottom: 1rem;
}

.archive-description {
    font-size: 1.1rem;
    color: var(--text-secondary, #6b7280);
    max-width: 600px;
    margin: 0 auto;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.archive-post {
    background: var(--bg-primary, #ffffff);
    border-radius: var(--border-radius, 8px);
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
    overflow: hidden;
    transition: var(--transition, all 0.3s ease);
}

.archive-post:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
}

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

.post-content {
    padding: 1.5rem;
}

.post-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.post-title a {
    color: var(--text-primary, #1f2937);
    text-decoration: none;
}

.post-title a:hover {
    color: var(--primary-color, #2563eb);
}

.post-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-light, #9ca3af);
    margin-bottom: 1rem;
}

.post-excerpt {
    color: var(--text-secondary, #6b7280);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.read-more {
    display: inline-block;
    color: var(--primary-color, #2563eb);
    text-decoration: none;
    font-weight: 500;
}

.read-more:hover {
    text-decoration: underline;
}

/* Single Post/Page */
.single-post,
.single-page {
    max-width: 1200px;
    margin: 0 auto;
}

.post-header,
.page-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.post-title,
.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.page-excerpt {
    font-size: 1.1rem;
    color: var(--text-secondary, #6b7280);
    font-style: italic;
}

.post-thumbnail,
.page-thumbnail {
    margin-bottom: 2rem;
    text-align: center;
}

.post-thumbnail img,
.page-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius, 8px);
}

.post-content,
.page-content {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-primary, #1f2937);
}

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

.post-footer,
.page-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.post-tags {
    margin-bottom: 1rem;
}

.post-tags a {
    display: inline-block;
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-secondary, #6b7280);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    text-decoration: none;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.post-tags a:hover {
    background: var(--primary-color, #2563eb);
    color: white;
}

/* 404 Page */
.error-404 {
    text-align: center;
    padding: 3rem 0;
}

.error-404 .page-title {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-404-search {
    max-width: 400px;
    margin: 2rem auto;
}

.error-404-widgets {
    margin-top: 3rem;
}

.widget-area {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: left;
}

.widget {
    background: var(--bg-secondary, #f9fafb);
    padding: 1.5rem;
    border-radius: var(--border-radius, 8px);
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary, #1f2937);
}

.widget ul {
    list-style: none;
    padding: 0;
}

.widget li {
    margin-bottom: 0.5rem;
}

.widget a {
    color: var(--text-secondary, #6b7280);
    text-decoration: none;
}

.widget a:hover {
    color: var(--primary-color, #2563eb);
}

/* No Posts Found */
.no-posts {
    text-align: center;
    padding: 3rem;
    background: var(--bg-secondary, #f9fafb);
    border-radius: var(--border-radius, 8px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .archive-container,
    .single-container,
    .page-container,
    .error-404-container {
        padding: 1rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .archive-title,
    .post-title,
    .page-title {
        font-size: 2rem;
    }
    
    .error-404 .page-title {
        font-size: 2.5rem;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .widget-area {
        grid-template-columns: 1fr;
    }
    
    .post-content {
        padding: 1rem;
    }
}

/* Mobile Padding Consistency */
@media (max-width: 480px) {
    .archive-container {
        padding: 1rem 0.75rem;
    }
    
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Extra Small Mobile (320px and below) */
@media (max-width: 320px) {
    .archive-container,
    .single-container,
    .page-container,
    .error-404-container {
        padding: 0.8rem;
    }
    
    .archive-title,
    .post-title,
    .page-title {
        font-size: 1.6rem;
        line-height: 1.2;
    }
    
    .archive-description,
    .page-excerpt {
        font-size: 0.9rem;
    }
    
    .posts-grid {
        gap: 1rem;
    }
    
    .post-content {
        padding: 0.8rem;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.8rem;
    }
    
    .post-excerpt {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .read-more {
        font-size: 0.9rem;
        padding: 0.5rem 0;
        min-height: 44px; /* Touch-friendly */
        display: inline-flex;
        align-items: center;
    }
    
    .post-thumbnail img,
    .page-thumbnail img {
        border-radius: 6px;
    }
}
