/*
 * Site theme layer. Loaded after the vendored Bootstrap/Grayscale styles.css
 * so the vendored file stays untouched. Keep colours in the tokens below.
 */

:root {
    --site-ink: #1d2430;
    --site-muted: #5b6575;
    --site-paper: #f5f6f8;
    --site-card: #ffffff;
    --site-section: #eceef2;
    --site-navy: #000080;
    --site-accent: #2f6fdd;
    --site-rule: #d6dae1;
    --site-radius: 12px;
    --site-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 16px rgba(16, 24, 40, 0.06);
}

/* ---------- Base typography ---------- */

html {
    scroll-behavior: smooth;
}

/* Keep in-page jumps from hiding section headings under the fixed navbar. */
section[id],
article [id] {
    scroll-margin-top: 5rem;
}

body {
    background: var(--site-paper);
    color: var(--site-ink);
    letter-spacing: normal;
    font-size: 1.0625rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

.text-black {
    color: var(--site-ink) !important;
}

.about-section p,
.projects-section p {
    max-width: 70ch;
}

.about-section h2,
.projects-section h2 {
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

/* Thin accent rule under the centred section headings. */
.about-section h2.text-center::after,
.projects-section h2.text-center::after {
    content: "";
    display: block;
    width: 3rem;
    height: 3px;
    margin: 0.75rem auto 0;
    border-radius: 2px;
    background: var(--site-accent);
}

/* Standalone blue divider bar, same look as the accent rule under centred headings. */
.section-divider {
    width: 3rem;
    height: 3px;
    margin: 2rem auto;
    border-radius: 2px;
    background: var(--site-accent);
}

/* ---------- Navigation ---------- */

#mainNav {
    background-color: var(--site-navy);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

#mainNav .navbar-brand {
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.02em;
}

#mainNav .nav-link {
    color: #fff;
    font-weight: 600;
    opacity: 0.85;
}

#mainNav .nav-link:hover,
#mainNav .nav-link.active {
    color: #fff;
    opacity: 1;
}

/* ---------- Hero (dark) ---------- */

.masthead {
    padding: 10rem 0 8rem;
    min-height: 0;
    background: linear-gradient(160deg, #1b2030 0%, #0b0e14 100%);
}

.masthead h1,
.masthead h2 {
    color: #fff;
}

/* The template paints the h1 as clipped text over a grey gradient; on the dark hero that must be white. */
.masthead h1 {
    font-weight: 900;
    letter-spacing: 0.04em;
    background: #ffffff;
    -webkit-background-clip: text;
            background-clip: text;
}

.masthead .btn-primary {
    background-color: var(--site-accent);
    border-color: var(--site-accent);
}

/* ---------- Section surfaces ---------- */

.about-section,
.signup-section {
    background: var(--site-section);
}

.projects-section {
    background: var(--site-paper) !important;
}

/* ---------- Company, people and reporting cards ---------- */

.projects-section .row {
    background: var(--site-card);
    border-radius: var(--site-radius);
    box-shadow: var(--site-shadow);
    margin-bottom: 2rem !important;
    overflow: hidden;
}

.projects-section .featured-text {
    padding: 1.75rem 2rem;
}

.projects-section .featured-text h4 {
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.projects-section .featured-text a {
    color: var(--site-accent);
    text-decoration: none;
    font-weight: 600;
    word-break: break-word;
}

.projects-section .featured-text a:hover {
    text-decoration: underline;
}

/* Logo column: centre each logo tile in its column. Tile colours stay as set inline. */
.projects-section .row > div:first-child {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.projects-section .row > div:first-child > div {
    border-radius: 10px !important;
}

/* Victims logo column (logo is the last column in each card): keep wide logos inside the card, proportions kept. */
#victims .row > div:last-child {
    padding: 1.5rem;
}

#victims .row > div:last-child img {
    max-width: 100%;
    height: 60px !important;
    object-fit: contain;
}

/* People photos: consistent frame and crop. */
.about-section img.img-fluid {
    border-radius: 10px;
    object-fit: cover;
}

/* ---------- Tables ---------- */

.table-responsive {
    border-radius: var(--site-radius);
    box-shadow: var(--site-shadow);
    background: var(--site-card);
}

.table-responsive thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.table-responsive td,
.table-responsive th {
    padding: 0.6rem 0.9rem;
    vertical-align: middle;
}

/* ---------- Contact form ---------- */

.signup-section .container .container {
    background: var(--site-card);
    border-radius: var(--site-radius);
    box-shadow: var(--site-shadow);
    padding: 2.5rem 2rem;
}

.signup-section .form-control {
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
}

/* ---------- Footer ---------- */

.footer {
    font-size: 0.9rem;
}

/* ---------- Page layout with sidebar table of contents ---------- */

.page-layout {
    display: block;
}

.toc {
    display: none;
}

.toc-link {
    display: block;
    padding: 0.45rem 0.75rem;
    border-left: 3px solid transparent;
    color: var(--site-muted);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
}

.toc-link:hover {
    color: var(--site-ink);
}

.toc-link.active {
    color: var(--site-navy);
    border-left-color: var(--site-accent);
    background: rgba(47, 111, 221, 0.08);
}

@media (min-width: 1200px) {
    .page-layout {
        display: flex;
        align-items: flex-start;
    }

    .toc {
        display: block;
        flex: 0 0 210px;
        position: sticky;
        top: 5.5rem;
        max-height: calc(100vh - 6rem);
        padding: 2rem 0 2rem 1.25rem;
        border-right: 1px solid var(--site-rule);
    }

    .page-main {
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* ---------- Small screens ---------- */

@media (max-width: 767.98px) {
    body {
        font-size: 1rem;
    }

    .masthead {
        padding: 8rem 0 6rem;
    }

    /* Let the three hero logos wrap instead of running off the screen. */
    .masthead .d-flex.justify-content-between {
        flex-wrap: wrap;
        justify-content: center !important;
        gap: 0.75rem;
    }

    .masthead h1 {
        font-size: 2.25rem;
    }

    .projects-section .featured-text {
        padding: 1.25rem;
    }

    .signup-section {
        padding: 5rem 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
