:root {
    --res-white: #ffffff;
    --res-light-gray: #f4f5fa;
    --res-light-blue: #016699;
    --res-dark-blue: #0b4778;
    --res-red: #8b0a03;
    --res-slate: #767676;
    --res-violet: #6e5aa6;
    --res-black: #000000;
}

/* Main Container */
.hiv-res-archive-container,
.hiv-res-single-container,
.hiv-res-archive-container *,
.hiv-res-single-container * {
    box-sizing: border-box;
}

.hiv-res-archive-container,
.hiv-res-single-container {
    margin: 40px auto;
    color: var(--res-black);
}

/* Results Layout with Sidebar */
.res-archive-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    align-items: start;
}

.res-archive-layout-full {
    grid-template-columns: 1fr;
}

.hiv-res-search-form {
    background: var(--res-white);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(11, 71, 120, 0.08);
    border: 1px solid rgba(1, 102, 153, 0.1);
}

.res-sidebar-logo {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: var(--res-white);
    border-radius: 16px;
    border: 1px solid rgba(1, 102, 153, 0.1);
}

.res-sidebar-logo img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.res-top-search {
    margin-bottom: 30px;
    background: var(--res-white);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid var(--res-light-gray);
}

.hiv-res-search-form-top .search-input-wrapper {
    display: flex;
    flex-direction: row !important;
    gap: 10px;
}

.hiv-res-search-form-top input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--res-light-gray);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.hiv-res-search-form-top .button {
    width: auto !important;
    white-space: nowrap;
}

.search-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.search-input-wrapper input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--res-light-gray);
    border-radius: 10px;
    font-size: 1rem;
    color: var(--res-black);
    transition: all 0.3s ease;
    background: var(--res-light-gray);
}

.search-input-wrapper input:focus {
    border-color: var(--res-light-blue);
    background: var(--res-white);
    outline: none;
    box-shadow: 0 0 0 4px rgba(1, 102, 153, 0.1);
}

.search-input-wrapper button {
    width: 100%;
    padding: 0 14px !important;
    background: var(--res-light-blue);
    color: var(--res-white);
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: var(--res-red);
}

.search-input-wrapper button:hover {
    background: var(--res-dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(11, 71, 120, 0.2);
}

.filters-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--res-dark-blue);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group select {
    padding: 12px;
    border: 2px solid var(--res-light-gray);
    border-radius: 8px;
    background: var(--res-light-gray);
    font-size: 0.9rem;
    width: 100%;
    color: var(--res-black);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-group select:focus {
    border-color: var(--res-light-blue);
    background: var(--res-white);
}

.form-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-top: 1px solid var(--res-light-gray);
    padding-top: 25px;
}

.reset-button {
    color: var(--res-slate);
    text-decoration: none;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 600;
    transition: color 0.2s;
}

.reset-button:hover {
    color: var(--res-red);
}

.res-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--res-light-gray);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.res-results-count {
    font-size: 0.95rem;
    color: var(--res-slate);
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Header Controls */
.header-view-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.res-per-page-select {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--res-slate);
}

.res-per-page-select select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--res-light-gray);
    background: var(--res-white);
    font-weight: 700;
    color: var(--res-dark-blue);
    cursor: pointer;
    transition: border-color 0.2s;
}

.res-per-page-select select:focus {
    border-color: var(--res-light-blue);
    outline: none;
}

/* Results Grid - Less Boxy */
.res-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

.res-card {
    background: var(--res-light-gray);
    border: none;
    border-radius: 12px;
    padding: 30px;
    transition: all 0.3s ease;
    display: grid;
    grid-template-columns: 1fr;
    box-shadow: none;
}

.res-card:hover {
    transform: none;
    box-shadow: none;
}

.res-card:hover .res-title a {
    color: var(--res-light-blue);
}

.res-title {
    margin: 0 0 10px 0;
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.res-title a {
    text-decoration: none;
    color: var(--res-dark-blue);
    line-height: 1.2;
}

.res-excerpt {
    color: var(--res-slate);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.res-read-more {
    display: inline-block;
    margin-top: 15px;
    font-weight: bold;
    color: var(--res-light-blue);
    text-decoration: none;
}

.res-read-more:hover {
    text-decoration: underline;
    color: var(--res-dark-blue);
}

/* Taxonomy Section */
.res-taxonomies-icons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px 30px;
    border-top: 1px solid var(--res-light-gray);
    padding-top: 20px;
    margin-top: 15px;
}

.res-tax-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--res-dark-blue);
    font-weight: 700;
}

.res-tax-item .res-tax-names {
    color: var(--res-slate);
    line-height: 1.4;
    font-weight: 500;
}

.res-card:hover .res-tax-item .res-tax-names {
    color: var(--res-black);
}

.res-standalone-search {
    margin-bottom: 30px;
}

/* Active Filter Chips */
.res-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: rgba(1, 102, 153, 0.05);
    border: 1px solid rgba(1, 102, 153, 0.15);
    border-radius: 10px;
    animation: res-fade-in 0.25s ease;
}

@keyframes res-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.res-active-filters-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--res-slate);
    margin-right: 4px;
    white-space: nowrap;
}

.res-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--res-dark-blue);
    color: var(--res-white);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 5px 10px 5px 12px;
    border-radius: 50px;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease;
    line-height: 1;
}

.res-filter-chip:hover {
    background: var(--res-red);
    color: var(--res-white);
    transform: translateY(-1px);
}

.res-filter-chip .res-chip-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.2s;
}

.res-filter-chip:hover .res-chip-x {
    background: rgba(255, 255, 255, 0.4);
}

.res-filter-chip-search {
    background: var(--res-violet);
}

.res-filter-chip-search:hover {
    background: var(--res-red);
}

.res-active-filters-clear {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--res-slate);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--res-light-gray);
    background: var(--res-white);
}

.res-active-filters-clear:hover {
    color: var(--res-red);
    border-color: var(--res-red);
}

@media (max-width: 600px) {
    .res-active-filters-clear {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }
}

/* Fancy Pagination */
.res-pagination {
    margin-top: 60px;
    display: flex;
    justify-content: center;
}

.res-pagination .nav-links,
.res-pagination .page-numbers {
    display: flex;
    gap: 10px;
}

.res-pagination a.page-numbers,
.res-pagination span.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 0 15px;
    border-radius: 50px;
    background: var(--res-white);
    color: var(--res-dark-blue);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid var(--res-light-gray);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.res-pagination a.page-numbers:hover {
    border-color: var(--res-light-blue);
    color: var(--res-light-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(1, 102, 153, 0.1);
}

.res-pagination span.current {
    background-color: var(--res-dark-blue);
    color: var(--res-white);
    border-color: var(--res-dark-blue);
}

.no-results {
    text-align: center;
    padding: 100px 20px;
}

@media (max-width: 992px) {
    .res-archive-layout {
        grid-template-columns: 1fr;
    }

    .res-sidebar {
        order: -1;
        position: static;
        margin-bottom: 30px;
    }

    .search-input-wrapper {
        flex-direction: row;
    }

    .search-input-wrapper button {
        width: auto;
    }

    .filters-wrapper {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .form-footer {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Single View - Unified Layout */
.hiv-res-single-container {
    margin: 40px auto;
    color: var(--res-black);
}

.res-single-top-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--res-light-gray);
    margin-bottom: 30px;
}

.res-back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--res-light-blue);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.res-back-link:hover {
    color: var(--res-dark-blue);
}

.bp-email-results,
.res-email-results {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--res-white);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    background: var(--res-red);
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.bp-email-results:hover,
.res-email-results:hover {
    background: var(--res-dark-blue);
    color: var(--res-white);
}

.bp-email-results span,
.res-email-results span {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.res-entry-title {
    font-size: 2.8rem;
    color: var(--res-dark-blue);
    margin-bottom: 20px;
    line-height: 1.2;
}

.res-single-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    margin-top: 30px;
    align-items: start;
}

.res-single-sidebar {
    position: sticky;
    top: 40px;
}

ul.sidebar-nav,
.res-on-this-page {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul.sidebar-nav li,
.res-on-this-page li {
    padding: 0;
    margin: 0;
    font-size: 1rem;
    border-bottom: 2px solid #f5f5f5;
}

ul.sidebar-nav li a,
.res-on-this-page li a {
    color: #016699;
    font-weight: bold;
    text-decoration: none;
    display: block;
    padding: 1rem;
}

ul.sidebar-nav li a:hover,
.res-on-this-page li a:hover,
ul.sidebar-nav li a.active,
.res-on-this-page li a.active {
    color: #1976d2;
    background-color: #f0f7ff;
    border-left: 4px solid #1976d2;
    padding-left: calc(1rem - 4px);
    transition: all 0.2s ease;
}

.res-on-this-page ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.res-single-taxonomies-icons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--res-light-gray);
}

.res-tax-item-single {
    background: var(--res-light-gray);
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.res-tax-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--res-dark-blue);
    opacity: 0.8;
}

.res-tax-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.res-tax-content .res-icon {
    font-size: 24px;
    color: var(--res-light-blue);
    flex-shrink: 0;
}

.res-tax-names {
    font-weight: 600;
    color: var(--res-slate);
    line-height: 1.4;
}

@media (max-width: 992px) {
    .res-single-layout {
        grid-template-columns: 1fr;
    }

    .res-single-sidebar {
        order: -1;
        position: static;
        margin-bottom: 40px;
    }
}