/**
 * Enhanced Archive Pages - Frontend Styles
 */

/* ==========================================================================
   Archive Container
   ========================================================================== */

.eap-archive-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ==========================================================================
   Archive Header
   ========================================================================== */

.eap-archive-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.eap-archive-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    line-height: 1.2;
    color: #1a1a1a;
}

.eap-archive-description {
    font-size: 1.125rem;
    line-height: 1.6;
    color: #666;
    margin-top: 1rem;
}

.eap-archive-description p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Category Introduction
   ========================================================================== */

.eap-category-intro {
    background: #f8f9fa;
    border-left: 4px solid #0073aa;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 4px;
}

.eap-category-intro p:first-child {
    margin-top: 0;
}

.eap-category-intro p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Archive Statistics
   ========================================================================== */

.eap-archive-stats {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.eap-showing-count {
    margin: 0;
    font-size: 0.95rem;
    color: #666;
}

.eap-content-stats {
    margin-top: 3rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #666;
}

.eap-content-stats p {
    margin: 0;
}

/* ==========================================================================
   Posts Grid
   ========================================================================== */

.eap-posts-grid {
    display: grid;
    gap: 3rem;
    margin-bottom: 3rem;
}

/* ==========================================================================
   Individual Post Styling
   ========================================================================== */

.eap-archive-post {
    display: grid;
    gap: 1.5rem;
    padding: 2rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
}

.eap-archive-post:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* With thumbnail - two column layout */
.eap-archive-post.has-post-thumbnail {
    grid-template-columns: 250px 1fr;
}

@media (max-width: 768px) {
    .eap-archive-post.has-post-thumbnail {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Post Thumbnail
   ========================================================================== */

.eap-post-thumbnail {
    width: 100%;
    overflow: hidden;
    border-radius: 6px;
}

.eap-post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    transition: transform 0.3s ease;
}

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

/* Lazy loading */
.eap-post-thumbnail img.eap-lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.eap-post-thumbnail img.eap-lazy.loaded {
    opacity: 1;
}

/* ==========================================================================
   Post Content
   ========================================================================== */

.eap-post-content {
    min-width: 0; /* Prevent grid blowout */
}

.eap-post-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.75rem 0;
}

.eap-post-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s ease;
}

.eap-post-title a:hover {
    color: #0073aa;
}

/* ==========================================================================
   Post Meta
   ========================================================================== */

.eap-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
}

.eap-meta-separator {
    color: #ccc;
}

/* ==========================================================================
   Post Excerpt
   ========================================================================== */

.eap-post-excerpt {
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
    margin-bottom: 1.5rem;
}

.eap-post-excerpt p {
    margin-bottom: 1rem;
}

.eap-post-excerpt p:last-child {
    margin-bottom: 0;
}

.eap-post-excerpt a {
    color: #0073aa;
    text-decoration: underline;
}

.eap-post-excerpt a:hover {
    color: #005177;
}

.eap-post-excerpt strong,
.eap-post-excerpt b {
    font-weight: 600;
}

.eap-post-excerpt em,
.eap-post-excerpt i {
    font-style: italic;
}

/* Lists */
.eap-post-excerpt ul,
.eap-post-excerpt ol {
    margin: 1rem 0 1.5rem 1.5rem;
    padding-left: 0.5rem;
}

.eap-post-excerpt li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.eap-post-excerpt ul li {
    list-style-type: disc;
}

.eap-post-excerpt ol li {
    list-style-type: decimal;
}

/* Styled blocks (like "What You'll Learn" boxes) */
.eap-post-excerpt .wp-block-group,
.eap-post-excerpt .wp-block-columns,
.eap-post-excerpt [class*="wp-block"] {
    margin-bottom: 1.5rem;
}

.eap-post-excerpt blockquote,
.eap-post-excerpt .wp-block-quote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid #0073aa;
    background: #f8f9fa;
    font-style: italic;
}

/* Preserve any custom styled divs */
.eap-post-excerpt div[style],
.eap-post-excerpt div[class] {
    margin-bottom: 1rem;
}

/* ==========================================================================
   Read More Link
   ========================================================================== */

.eap-read-more {
    margin-top: 1rem;
}

.eap-read-more-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #0073aa;
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 0.5rem 0;
}

.eap-read-more-link:hover {
    color: #005177;
    gap: 0.75rem;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.eap-pagination-wrapper {
    margin: 3rem 0;
    text-align: center;
}

.eap-pagination {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.eap-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.eap-pagination .page-numbers:hover {
    background: #f8f9fa;
    border-color: #0073aa;
    color: #0073aa;
}

.eap-pagination .page-numbers.current {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

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

/* ==========================================================================
   No Posts Message
   ========================================================================== */

.eap-no-posts {
    padding: 3rem;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
}

.eap-no-posts p {
    margin: 0;
    font-size: 1.125rem;
    color: #666;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .eap-archive-container {
        padding: 1rem;
    }
    
    .eap-archive-title {
        font-size: 2rem;
    }
    
    .eap-archive-post {
        padding: 1.5rem;
    }
    
    .eap-post-title {
        font-size: 1.5rem;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .eap-pagination-wrapper,
    .eap-read-more {
        display: none;
    }
    
    .eap-archive-post {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

/* Skip to content link */
.eap-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999;
    padding: 1rem;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
}

.eap-skip-link:focus {
    left: 0;
}

/* Focus styles */
.eap-post-title a:focus,
.eap-read-more-link:focus,
.eap-pagination .page-numbers:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}
