/**
 * Archive Template Styles
 * 
 * Magazine-style archive layout matching screenshot design
 * - Multiple category sections
 * - Mixed grid layouts (large featured + stacked cards)
 * - 3-column grids
 * - Category labels below images
 * - Author names displayed
 */

/* ============================================
   Category Sections
   ============================================ */

.category-section {
    margin-bottom: 5rem;
}

.category-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #559da4;
}

.category-section-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-transform: uppercase;

}

.category-see-all {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;

    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: opacity 0.2s ease;
}

.category-see-all:hover,
.category-see-all:focus {
    opacity: 0.7;
    outline: none;
}

.see-all-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #559da4;
    font-size: 1rem;
    line-height: 1;
}

/* ============================================
   Mixed Layout (Large Featured + Stacked)
   ============================================ */

.category-posts-mixed {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.mixed-featured {
    display: flex;
    flex-direction: column;
}

.mixed-stacked {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Mobile: Stack vertically */
@media (max-width: 767px) {
    .category-posts-mixed {
        grid-template-columns: 1fr;
    }
    
    .mixed-stacked {
        margin-top: 2rem;
    }
}

/* ============================================
   Standard 3-Column Grid
   ============================================ */

.category-posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Tablet: 2 columns */
@media (min-width: 768px) {
    .category-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 3 columns */
@media (min-width: 1024px) {
    .category-posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   Post Card
   ============================================ */

.post-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.post-card:hover {
    opacity: 0.85;
}

.post-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    outline: none;
}

.post-card-link:focus {
    outline: 2px solid #000;
    outline-offset: 4px;
}

.post-card-link:focus:not(:focus-visible) {
    outline: none;
}

/* Featured card styling */
.post-card-featured .post-card-thumbnail {
    padding-top: 66.67%; /* 3:2 aspect ratio */
}

.post-card-featured .post-card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.post-card-featured .post-card-excerpt {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

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

.post-card-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
    background-color: #f5f5f5;
    margin-bottom: 1rem;
}

.post-card-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-card-thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    padding-top: 0;
    height: auto;
    min-height: 250px;
}

.post-card-placeholder-icon {
    color: #ccc;
    opacity: 0.5;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.post-card-placeholder-icon svg {
    width: 60px;
    height: 60px;
}

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

.post-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0;
}

.post-card-category-label {
    display: inline-block;
    margin-bottom: 0.5rem;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: transparent;
    color: #000;
    border: 1px solid #000;
    border-radius: 2px;
    line-height: 1.2;
    width: fit-content;
}

.post-card-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
    color: #000;
    letter-spacing: -0.01em;
}

.post-card-excerpt {
    flex: 1;
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #555;
    font-weight: 400;
}

.post-card-excerpt mark {
    background-color: #fff9c4;
    padding: 0 2px;
    font-weight: 500;
}

.post-card-author {
    font-size: 0.8125rem;
    color: #888;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: auto;
}

.post-card-date {
    display: block;
    font-size: 0.8125rem;
    color: #888;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   Legacy Archive Header (for other templates)
   ============================================ */

.archive-header {
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #559da4;
}

.archive-title {
    margin: 0 0 0.5rem 0;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: #000;
}

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

.archive-description p {
    margin: 0;
}

/* Author header specific styles */
.author-header {
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #559da4;
}

.author-info {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.author-avatar {
    border-radius: 50%;
    flex-shrink: 0;
}

.author-details {
    flex: 1;
}

.author-name {
    margin-bottom: 0.5rem;
}

.author-description {
    margin-top: 0.5rem;
}

/* Legacy grid for archive.php fallback */
.archive-posts-grid,
.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 4rem;
}

/* Tablet: 2 columns */
@media (min-width: 768px) {
    .archive-posts-grid,
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
}

/* Desktop: 3 columns */
@media (min-width: 1024px) {
    .archive-posts-grid,
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
}

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

.posts-navigation,
.navigation {
    margin: 4rem 0 2rem;
    padding-top: 2rem;
    border-top: 1px solid .hp-cat;
}

.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-links a,
.nav-links span {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    text-decoration: none;
    border: 1px solid #559da4;
    background-color: #fff;
    color: #000;
    border-radius: 0;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a:focus {
    background-color: #000;
    color: #fff;
    border-color: #000;
    outline: none;
}

.nav-links .current {
    background-color: #000;
    color: #fff;
    border-color: #000;
}

.nav-links .dots {
    border: none;
    padding: 0.625rem 0.5rem;
    background: transparent;
}

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

/* ============================================
   No Results / Not Found
   ============================================ */

.no-results {
    padding: 4rem 1rem;
    text-align: center;
}

.no-results .page-title {
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.no-results .page-content {
    max-width: 600px;
    margin: 0 auto;
}

.no-results .page-content p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #666;
}

/* Search form in no results */
.no-results .search-form {
    max-width: 400px;
    margin: 0 auto;
}

.no-results .search-form input[type="search"] {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    background-color: #fff;
}

.no-results .search-form input[type="submit"] {
    margin-top: 0.75rem;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    background-color: #000;
    color: #fff;
    border: 1px solid #000;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.no-results .search-form input[type="submit"]:hover,
.no-results .search-form input[type="submit"]:focus {
    background-color: #333;
    outline: none;
}

/* Search form in header */
.archive-header .search-form {
    margin-top: 1.5rem;
    max-width: 500px;
}

.archive-header .search-form input[type="search"] {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    background-color: #fff;
}

.archive-header .search-form input[type="submit"] {
    margin-top: 0.75rem;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    background-color: #000;
    color: #fff;
    border: 1px solid #000;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.archive-header .search-form input[type="submit"]:hover,
.archive-header .search-form input[type="submit"]:focus {
    background-color: #333;
    outline: none;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 767px) {
    .category-section-title {
        font-size: 1.5rem;
    }

    .category-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .post-card-title {
        font-size: 1rem;
    }

    .post-card-featured .post-card-title {
        font-size: 1.25rem;
    }

    .post-card-thumbnail {
        padding-top: 66.67%; /* 3:2 aspect ratio on mobile */
    }
}

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

@media print {
    .post-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .post-card-link {
        text-decoration: underline;
    }

    .category-see-all {
        display: none;
    }
}
