/* Policy Briefs Section Styling */
.policy-briefs-section {
    background-color: #f8f9fa;
    padding: 40px 0;
    min-height: 100vh;
}

/* Page Header */
.policy-briefs-header {
    text-align: center;
    margin-bottom: 3rem;
}

.policy-briefs-title {
    color: #0d1556;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.policy-briefs-subtitle {
    color: #6c757d;
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

/* Controls - reuse same pattern as projects */
.policy-briefs-controls {
    position: relative;
    z-index: 1000;
    margin-bottom: 2rem;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box {
    position: relative;
    flex-grow: 1;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 5;
}

.search-box input {
    padding-left: 2.5rem;
    padding-right: 3rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    width: 100%;
}

.search-box input:focus {
    border-color: #999999;
    box-shadow: 0 0 0 0.2rem rgba(153, 153, 153, 0.25);
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    color: #6c757d;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.clear-search-btn.show {
    display: flex !important;
}

.clear-search-btn i:hover {
    color: #C3020D;
    transform: scale(1.5);
}

.clear-search-btn i {
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

/* Sort Icon */
.sort-icon-container {
    position: relative;
    display: flex;
    justify-content: flex-end;
    z-index: 1002;
    isolation: isolate;
    margin-right: 0.5rem;
}

.sort-icon {
    background: none;
    color: #6c757d;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(153, 153, 153, 0.25);
}

.sort-icon:hover {
    background: #999999;
    color: white;
    transform: translateY(-1px);
}

.sort-icon.has-active-sort {
    background: #0d1556;
    color: white;
    box-shadow: 0 2px 8px rgba(140, 198, 62, 0.3);
}

.sort-icon.has-active-sort:hover {
    background: #0a1044;
}

.sort-icon i {
    font-size: 1.1rem;
}

/* Sort Popup */
.sort-popup {
    position: absolute !important;
    top: 55px;
    right: auto;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 9999 !important;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.sort-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-popup-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sort-popup-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.direction-arrow {
    color: #6c757d;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    min-width: 20px;
    text-align: center;
}

.direction-arrow:hover {
    color: #495057;
    background: rgba(0, 0, 0, 0.05);
}

.direction-arrow.disabled {
    color: #dee2e6;
    cursor: not-allowed;
}

.direction-arrow.disabled:hover {
    color: #dee2e6;
    background: none;
}

.sort-options {
    padding: 0.5rem 0;
}

.sort-option {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sort-option:hover {
    background-color: #f8f9fa;
}

.sort-option.active {
    background-color: #e3f2fd;
    color: #698EE9;
}

.sort-option i {
    margin-right: 0.75rem;
    width: 16px;
    color: #6c757d;
}

.sort-option.active i {
    color: #698EE9;
}

.sort-option-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.sort-option-divider {
    border-top: 1px solid #e9ecef;
    margin: 0.5rem 0;
}

.sort-option.reset-option {
    color: #6c757d;
    font-style: italic;
    padding: 0.5rem 1rem;
}

.sort-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    display: none;
}

.sort-backdrop.show {
    display: block;
}

/* BRIEF TILES GRID */
.brief-tiles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 1rem 0;
}

.brief-tile {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.brief-tile:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Cover Image - prominent, fills top of card */
.brief-cover {
    position: relative;
    width: 100%;
    height: 260px;
    overflow: hidden;
    background: #e9ecef;
    flex-shrink: 0;
}

.brief-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.3s ease;
}

.brief-tile:hover .brief-cover img {
    transform: scale(1.03);
}

.brief-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 4rem;
    background: #e9ecef;
}

/* PDF hover overlay on cover */
.brief-pdf-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
}

.brief-pdf-overlay i {
    font-size: 2rem;
}

.brief-tile:hover .brief-pdf-overlay {
    opacity: 1;
}

/* Featured star */
.featured-star-overlay {
    position: absolute;
    top: 8px;
    right: 10px;
    color: #FFD700;
    font-size: 1.1rem;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
    z-index: 20;
    pointer-events: none;
}

/* Brief Info */
.brief-info {
    padding: 1.25rem 1.5rem 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.brief-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.6rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.brief-description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.brief-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.brief-date {
    color: #adb5bd;
    font-size: 0.8rem;
}

.brief-pdf-badge {
    background: #fff0f0;
    color: #C3020D;
    border: 1px solid #ffcdd2;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Search hidden */
.brief-tile.search-hidden {
    display: none !important;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
    grid-column: 1 / -1;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.no-results p {
    font-size: 1.1rem;
}

/* Stats Cards */
.policy-briefs-stats {
    margin-top: 3rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 120px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #0d1556;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .policy-briefs-title { font-size: 2.5rem; }
    .brief-tiles-grid { gap: 1.5rem; }
    .brief-cover { height: 230px; }
}

@media (max-width: 992px) {
    .brief-tiles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    .brief-cover { height: 210px; }
}

@media (max-width: 768px) {
    .policy-briefs-title { font-size: 2rem; }
    .policy-briefs-subtitle { font-size: 1rem; }

    .brief-tiles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .brief-tile {
        width: 80%;
        justify-self: center;
    }

    .brief-cover { height: 220px; }

    .stat-card {
        width: 60%;
        justify-self: center;
    }
}

@media (max-width: 576px) {
    .brief-tile { width: 100%; }
    .brief-cover { height: 200px; }
}
