
/* ========================================
   THE STUDENT VOICE — NEWS ARCHIVE
   Matches the main website design
   ======================================== */

/* 1. GLOBAL SETTINGS */

* {
    box-sizing: border-box;
}

:root {
    --blue: #2457a7;
    --blue-dark: #173d78;
    --blue-light: #edf4ff;
    --text: #263445;
    --text-muted: #64748b;
    --background: #ffffff;
    --border: #e2e8f0;
    --card-background: #ffffff;
    --shadow: 0 4px 16px rgba(23, 61, 120, 0.07);
    --radius: 12px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: "Comic Sans MS", "Comic Sans", sans-serif;
    font-size: 16px;
    line-height: 1.7;
}

/* 2. HEADINGS AND TEXT */

h1,
h2,
h3 {
    color: var(--blue-dark);
    line-height: 1.3;
    margin-top: 0;
}

h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
}

h2 {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    margin-bottom: 18px;
}

h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

p {
    margin-top: 0;
}

small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* 3. HEADER */

header {
    padding: 30px 20px 24px;
    text-align: center;
    background: var(--background);
    border-bottom: 1px solid var(--border);
}

header h1 {
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

header p {
    margin-bottom: 0;
    color: var(--text-muted);
}

/* 4. NAVIGATION */

nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(23, 61, 120, 0.04);
}

nav a {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

nav a:hover {
    background: var(--blue-light);
    color: var(--blue-dark);
}

nav a:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
}

/* 5. MAIN LAYOUT */

main {
    width: min(100% - 40px, 1000px);
    margin: 0 auto;
    padding: 36px 0 60px;
}

section {
    margin-bottom: 48px;
    scroll-margin-top: 90px;
}

/* 6. NEWS ARCHIVE INTRO */

#news-intro {
    padding: clamp(26px, 5vw, 42px);
    background: var(--blue-light);
    border: 1px solid #dce8fc;
    border-radius: 18px;
    text-align: center;
}

#news-intro h2 {
    margin-bottom: 12px;
    font-size: clamp(1.6rem, 4vw, 2.1rem);
}

#news-intro p {
    max-width: 650px;
    margin: 0 auto;
    color: #42536b;
}

/* 7. NEWS HISTORY HEADING */

#news > h2 {
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.news-count {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* 8. NEWS ARTICLE CARDS */
/* These match news-display.js */

#news-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.news-card {
    padding: 24px;
    margin: 0;
    background: var(--card-background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-wrap: anywhere;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.news-card:hover {
    border-color: #b7cdf0;
    transform: translateY(-2px);
}

.news-category {
    display: inline-block;
    margin-bottom: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--blue-light);
    color: var(--blue-dark);
    font-size: 0.78rem;
    font-weight: bold;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.news-card h2,
.news-card h3 {
    margin-bottom: 10px;
}

.news-date {
    margin-bottom: 14px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.news-body {
    margin-bottom: 0;
    white-space: pre-line;
}

/* 9. MORE BUTTON */

.more-button {
    display: inline-block;
    align-self: flex-start;
    margin-top: 8px;
    padding: 12px 24px;
    background: var(--blue);
    color: #ffffff;
    border: 2px solid var(--blue);
    border-radius: 9px;
    font: inherit;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.more-button:hover {
    background: var(--blue-dark);
    border-color: var(--blue-dark);
    color: #ffffff;
    transform: translateY(-2px);
}

.more-button:focus-visible {
    outline: 3px solid var(--blue-dark);
    outline-offset: 4px;
}

/* 10. GENERAL LINKS */

a {
    color: var(--blue);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--blue-dark);
}

/* 11. FOOTER */

footer {
    padding: 24px 20px;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    text-align: center;
}

footer p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 12. TEXT SELECTION */

::selection {
    background: #cfe0ff;
    color: var(--blue-dark);
}

/* 13. MOBILE RESPONSIVENESS */

@media (max-width: 600px) {
    body {
        font-size: 15px;
    }

    header {
        padding: 24px 16px 20px;
    }

    nav {
        gap: 4px;
        padding: 10px 8px;
    }

    nav a {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    main {
        width: calc(100% - 28px);
        padding-top: 24px;
        padding-bottom: 40px;
    }

    section {
        margin-bottom: 36px;
    }

    #news-intro {
        padding: 28px 20px;
        border-radius: 14px;
    }

    .news-card {
        padding: 19px;
    }

    .more-button {
        width: 100%;
        text-align: center;
    }

    footer {
        padding: 22px 16px;
    }
}

/* 14. ACCESSIBILITY */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* ========================================
   DISCORD-STYLE NEWS REACTIONS
   ======================================== */

.reaction-heading {
    margin: 20px 0 8px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: bold;
}

.reaction-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.reaction-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
    color: var(--text);
    font: inherit;
    font-size: 0.92rem;
    cursor: pointer;
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.reaction-button:hover:not(:disabled) {
    background: var(--blue-light);
    border-color: #b7cdf0;
    transform: translateY(-1px);
}

.reaction-button.is-selected {
    background: var(--blue-light);
    border-color: var(--blue);
    color: var(--blue-dark);
    box-shadow: 0 0 0 1px var(--blue);
}

.reaction-button:focus-visible {
    outline: 3px solid #b7cdf0;
    outline-offset: 3px;
}

.reaction-button:disabled {
    opacity: 0.65;
    cursor: wait;
}

@media (max-width: 600px) {
    .reaction-bar {
        gap: 7px;
    }

    .reaction-button {
        min-height: 40px;
        padding: 8px 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reaction-button {
        transition: none;
    }
}


/* SMOOTH NEWS REACTION ANIMATIONS */

.reaction-button {
    transform-origin: center;
    transition:
        background-color 180ms ease,
        border-color 180ms ease,
        color 180ms ease,
        box-shadow 180ms ease;
}

/* Gentle lift on hover */
.reaction-button:hover:not(:disabled) {
    transform: translateY(-2px);
}

/* Pop when a reaction is clicked */
.reaction-button.is-popping {
    animation: reaction-pop 320ms cubic-bezier(.18, .89, .32, 1.5);
}

/* Selected reactions get a subtle glow */
.reaction-button.is-selected {
    background: var(--blue-light);
    border-color: var(--blue);
    color: var(--blue-dark);
    box-shadow: 0 0 0 1px var(--blue);
}

@keyframes reaction-pop {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.22); }
    65%  { transform: scale(0.94); }
    100% { transform: scale(1); }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .reaction-button,
    .reaction-button.is-popping {
        animation: none;
        transition: none;
    }
}
