/* Site colors & fonts */
:root {
    --gold: #ccab5c;
    --dark-blue: #151f28
}

/**
 * Filtered Posts Page Styles
 * Scoped to #filtered-posts-page to prevent conflicts with other pages
 */

/* Filters Container */
#filtered-posts-page .filters-container {
    background: #f8f9fa;
    padding: 30px 0;
    margin-bottom: 40px;
    border-radius: 8px;
}

#filtered-posts-page .filters-header {
    display: flex;
    justify-content: space-between;
    align-items: first baseline;
    margin-bottom: 20px;
}

#filtered-posts-page .filters-heading {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

#filtered-posts-page .clear-filters-link {
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    font-weight: 400;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    transition: color 0.3s ease;
}

#filtered-posts-page .clear-filters-link:hover {
    color: #333;
}

/* Topic Tiles */
#filtered-posts-page .topic-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

#filtered-posts-page .topic-tile {
    flex: 1 1 calc(20% - 16px);
    min-height: 300px;
    padding: 12px 24px;
    background: var(--gold);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

#filtered-posts-page .topic-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(204, 171, 92, 0.8);
    border-radius: 4px;
    transition: background 0.3s ease;
}

#filtered-posts-page .topic-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#filtered-posts-page .topic-tile:hover::before {
    background: rgba(0, 0, 0, 0.4);
}

#filtered-posts-page .topic-tile.active::before {
    background: rgba(0, 0, 0, 0.1);
}

#filtered-posts-page .topic-tile-label {
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    font-family: 'Poppins', sans-serif;
}

/* Loading Indicator */
#filtered-posts-page-results .loading-indicator {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
}

#filtered-posts-page-results .loading-indicator span {
    display: inline-block;
    animation: filtered-posts-pulse 1.5s ease-in-out infinite;
}

@keyframes filtered-posts-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* No Results */
#filtered-posts-page-results .no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

/* Accordion Styles */
#filtered-posts-page-results .accordions-section {
    border: 1px solid var(--gold);
    padding: 40px;
    background-color: rgba(255,255,255,0.5);
    margin: 0 auto;
    max-width: 1245px;
}

#filtered-posts-page-results .accordions-section h4 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--gold);
}

#filtered-posts-page-results .articles-intro {
    font-size: 16px;
    color: #333;
    margin-bottom: 32px;
}

#filtered-posts-page-results .accordion-container {
    margin-bottom: 40px;
}

#filtered-posts-page-results .accordion-item {
    margin-bottom: 0;
    overflow: hidden;
}

#filtered-posts-page-results .accordion-header {
    width: 100%;
    padding: 20px 0px;
    background: none;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: first baseline;
    cursor: pointer;
    text-align: left;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    transition: all 0.5s ease;
}

#filtered-posts-page-results .accordion-header:hover {
    background: #f8f9fa;
}

#filtered-posts-page-results .accordion-item.active .accordion-header {
    border-bottom-color: var(--gold);
    color: var(--gold);
}

#filtered-posts-page-results .accordion-title {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

#filtered-posts-page-results .accordion-title-first {
    text-transform: uppercase;
    letter-spacing: 5px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

#filtered-posts-page-results .accordion-title-second {
    font-style: italic;
    font-family: 'Playfair Display', serif;
    font-weight: 400;
}

#filtered-posts-page-results .accordion-count {
    font-size: 12px;
    color: #909090;
    font-weight: 400;
    margin-right: 15px;
}

#filtered-posts-page-results .accordion-icon {
    width: 24px;
    height: 24px;
    border: 2px solid #333;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

#filtered-posts-page-results .accordion-icon::before,
#filtered-posts-page-results .accordion-icon::after {
    content: '';
    position: absolute;
    background: #333;
    transition: all 0.3s ease;
}

#filtered-posts-page-results .accordion-icon::before {
    width: 12px;
    height: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#filtered-posts-page-results .accordion-icon::after {
    width: 2px;
    height: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#filtered-posts-page-results .accordion-item.active .accordion-icon {
    border-color: var(--gold);
}

#filtered-posts-page-results .accordion-item.active .accordion-icon::before,
#filtered-posts-page-results .accordion-item.active .accordion-icon::after {
    background: var(--gold);
}

#filtered-posts-page-results .accordion-item.active .accordion-icon::after {
    height: 0;
}

#filtered-posts-page-results .accordion-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 125px;
    border-top: 1px solid #e0e0e0;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

#filtered-posts-page-results .accordion-item.active .accordion-content {
    max-height: 5000px;
    padding: 25px 125px;
}

/* Posts Grid */
#filtered-posts-page-results .posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45%, 1fr));
    gap: 48px;
}

#filtered-posts-page-results .post-item {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-bottom: 1px solid rgba(195, 166, 96, 0.25);
    padding-bottom: 24px;
    position: relative;
}

#filtered-posts-page-results .post-item .draft-flag {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--gold, #ccab5c);
    color: white;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 10px 10px 5px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#filtered-posts-page-results .post-item__link {
    display: block;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

#filtered-posts-page-results .post-title {
    margin: 0 0 8px 0;
    font-size: 16px !important;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    transition: color 0.3s ease;
    text-align: left;
}

#filtered-posts-page-results .post-item__link:hover .post-title {
    color: var(--gold);
}

#filtered-posts-page-results .post-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 16px;
    transition: color 0.3s ease;
}

#filtered-posts-page-results .post-item__link:hover .post-excerpt {
    color: var(--gold);
}

#filtered-posts-page-results .post-excerpt p {
    margin: 0 0 10px 0;
}

#filtered-posts-page-results .post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

#filtered-posts-page-results .post-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f0f0;
    color: #666;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#filtered-posts-page-results .post-tag:hover {
    background: var(--gold);
    color: #fff;
}

/* Error State */
#filtered-posts-page-results .error {
    text-align: center;
    padding: 40px;
    color: #d9534f;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    #filtered-posts-page .topic-tile {
        flex: 1 1 calc(33.333% - 10px);
        min-width: 150px;
        min-height: 150px;
    }

    #filtered-posts-page .topic-tile-label {
        font-size: 16px;
    }

    #filtered-posts-page-results .accordion-item.active .accordion-content {
        padding: 20px 0px;
    }

    #filtered-posts-page-results .accordion-item {
        margin-bottom: 60px;
    }
}

@media (max-width: 768px) {
    /* Fix header positioning on mobile for solid sticky nav */
    body.solid-sticky-nav #header-outer header {
        position: fixed !important;
        top: 42px !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 10000;
    }

    body.solid-sticky-nav #ajax-content-wrap {
        margin-top: 125px !important;
    }

    #filtered-posts-page .filters-container {
        padding: 20px;
    }

    #filtered-posts-page .topic-tiles {
        gap: 10px;
    }

    #filtered-posts-page .topic-tile {
        flex: 1 1 calc(50% - 10px);

        padding: 10px 20px;
    }

    #filtered-posts-page .topic-tile-label {
        font-size: 16px;
    }

    #filtered-posts-page-results .posts-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    #filtered-posts-page-results .post-excerpt {
        margin-bottom: 8px;
    }

    #filtered-posts-page-results .post-tags {
        margin-top: 4px;
    }

    #filtered-posts-page-results .accordion-header {
        font-size: 16px;
    }

    #filtered-posts-page-results .accordion-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    #filtered-posts-page-results .accordion-title-separator {
        display: none;
    }

    #filtered-posts-page-results .accordion-content {
        padding: 20px 0;
    }
}

@media (max-width: 480px) {
    #filtered-posts-page .filters-container {
        padding: 15px;
    }

    #filtered-posts-page .topic-tile {
        flex: 1 1 100%;
        min-height: 125px;
    }

    #filtered-posts-page .topic-tile-label {
        font-size: 18px;
    }

    #filtered-posts-page-results .accordion-header {
        padding: 12px 15px;
        font-size: 15px;
    }

    #filtered-posts-page-results .post-title {
        font-size: 18px;
    }
}
