/* ---------- layout tweaks ---------- */
/* Body styles are in styles.css - only archive-specific overrides here */
body {
    scroll-behavior: smooth;
}

#archive {
    padding: 1rem 2vw;
    max-width: 1200px;
    margin: auto
}

.archive-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: 1rem;
}

.archive-mode-toolbar {
    justify-content: center;
    margin-bottom: 0.75rem;
}

.archive-search-controls {
    margin-bottom: 0.75rem;
}

#archive.is-search-mode .archive-search-controls {
    display: block;
}

#archive.is-search-mode .archive-browse-controls {
    display: none;
}

#archive.is-browse-mode .archive-search-controls {
    display: none;
}

.archive-search-form {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    max-width: none;
    align-items: flex-end;
}

.archive-search-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.archive-search-form input[type='search'] {
    width: 100%;
}

.archive-search-form button {
    align-self: flex-end;
    padding: 0.65rem 1.25rem;
    font: inherit;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: none;
    border-radius: 4px;
    background: var(--haiti-blue, #002a9f);
    color: #fff;
    cursor: pointer;
}

.archive-mode-toggle {
    display: inline-flex;
    border: 1px solid #999;
    border-radius: 4px;
    overflow: hidden;
}

.archive-mode-toggle button {
    padding: 0.5rem 1rem;
    font: inherit;
    font-weight: 600;
    border: none;
    background: #fff;
    cursor: pointer;
}

.archive-mode-toggle button.is-active {
    background: var(--haiti-blue, #002a9f);
    color: #fff;
}

.archive-search-form input[type='search'] {
    font: inherit;
    padding: 0.65rem 0.85rem;
    border: 1px solid #999;
    border-radius: 4px;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
}

.archive-filter-chips {
    margin: 0.5rem 0 1rem;
}

.archive-category-tags {
    margin: 0 0 1.25rem;
}

.category-tag {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--tag-border, #8a8a8a);
    background: transparent;
    color: var(--dark-text, #0b111e);
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 16px;
    border-radius: 4px;
}

#archive.is-search-mode .archive-category-tags {
    display: none;
}

.archive-category-tags-heading {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--haiti-blue, #002a9f);
    margin: 0 0 0.75rem;
    text-align: center;
}

.archive-category-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.archive-category-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font: inherit;
}

.archive-category-tag.is-active {
    border-color: var(--haiti-blue, #002a9f);
    background: rgba(0, 42, 159, 0.08);
    color: var(--haiti-blue, #002a9f);
}

.archive-category-tag-count {
    font-size: 0.875rem;
    color: #555;
}

.archive-category-tag.is-active .archive-category-tag-count {
    color: var(--haiti-blue, #002a9f);
}

.archive-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.archive-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}

.archive-chip-remove {
    font-size: 1.1rem;
    line-height: 1;
    color: #666;
}

.archive-clear-all {
    font-size: 0.875rem;
}

.archive-results-section {
    margin-top: 2rem;
}

.archive-results-heading {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
    margin: 0 0 0.5rem;
}

.archive-results-stats {
    text-align: center;
    font-size: 0.95rem;
    color: #444;
    margin: 0 0 1rem;
}

.archive-results-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .archive-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.archive-day-heading {
    grid-column: 1 / -1;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 1rem 0 0.25rem;
    color: #333;
}

.archive-results-empty,
.archive-browse-prompt {
    text-align: center;
    color: #555;
    padding: 2rem 1rem;
}

.archive-search-status {
    text-align: center;
}

.archive-search-status-error {
    color: #d21034;
}

/* Legacy controls removed in #192 */

#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: .7rem .9rem;
    border: none;
    border-radius: 50%;
    background: #ca102f;
    color: #fff;
    font-size: 1.2rem;
    display: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
    cursor: pointer;
    z-index: 40
}

.ghost {
    background: #fff;
    cursor: pointer;
    border: 1px solid #999;
    border-radius: 4px;
    padding: 0.25rem 0.6rem;
}

.card {
    break-inside: avoid;
    margin-bottom: 1rem;
    background: #fff;
    border-radius: 4px;
    padding: .6rem .8rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05)
}

.card h4 {
    margin: .2rem 0;
    font-size: 1rem;
    font-weight: 600
}

.meta {
    font-size: .85rem;
    color: #555;
    display: flex;
    gap: .4rem;
    align-items: center
}

.archive-result-category {
    font-size: 0.875rem;
}

/* legacy category chip palette — retained for any downstream viz references */
.cat-politics {
    background: #5470c6
}

.cat-economy {
    background: #91cc75
}

.cat-society {
    background: #fac858
}

.cat-culture {
    background: #ee6666
}

.cat-education {
    background: #73c0de
}

.cat-health {
    background: #3ba272
}

.cat-infra {
    background: #fc8452
}

.cat-law {
    background: #9a60b4
}

.cat-security {
    background: #ea7ccc
}

.cat-disaster {
    background: #d14a61
}

.cat-intl {
    background: #6e7074
}

.cat-sports {
    background: #5470c6a6
}

.cat-miscellaneous {
    background: #090909
}

/* skeleton */
.skeleton {
    height: 110px;
    background: #f0f0f0;
    animation: pulse 1.2s infinite ease-in-out;
    border-radius: 4px
}

@keyframes pulse {
    0% {
        opacity: .7
    }

    50% {
        opacity: .4
    }

    100% {
        opacity: .7
    }
}

@keyframes fadeIn {
    to {
        opacity: 1
    }
}
