:root {
    --navy: #073b4c;
    --teal: #087e8b;
    --green: #2e8b57;
    --background: #eaf4f8;
    --surface: #ffffff;
    --surface-muted: #ddf3f2;
    --text: #15313b;
    --text-muted: #61767d;
    --accent: #087e8b;
    --accent-dark: #073b4c;
    --accent-soft: #ddf3f2;
    --border: #d4e3e6;
    --success: #2e8b57;
    --shadow: 0 5px 16px rgba(7, 59, 76, 0.06);
    --radius: 8px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    color: var(--text);
    background: var(--background);
    font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

body.modal-open {
    overflow: hidden;
}

button,
input,
select {
    color: inherit;
    font: inherit;
}

button,
select {
    cursor: pointer;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

button {
    min-height: 44px;
}

[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    width: min(1200px, calc(100% - 2rem));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    z-index: 50;
    top: 0;
    border-bottom: 1px solid #0b5268;
    background: var(--navy);
}

.header-content,
.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.header-content {
    min-height: 60px;
}

.brand {
    display: inline-flex;
    align-items: center;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.4rem;
    list-style: none;
}

.nav-links a,
.site-footer a {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.9rem;
    font-weight: 650;
    text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.site-footer a:hover,
.site-footer a:focus-visible {
    color: #ffffff;
}

.hero {
    position: relative;
    min-height: 360px;
    overflow: hidden;
    padding-block: 3.5rem;
    color: #ffffff;
    background: linear-gradient(120deg, #073b4c 0%, #087e8b 62%, #2e8b57 115%);
}

.hero::before {
    position: absolute;
    z-index: 0;
    inset: 0;
    background-image: url("world.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: min(1100px, 92vw) auto;
    content: "";
    filter: grayscale(1) sepia(1) saturate(2) hue-rotate(115deg);
    mix-blend-mode: screen;
    opacity: 0.16;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 248px;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-copy {
    width: min(760px, 100%);
}

.eyebrow {
    margin-bottom: 0.75rem;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    line-height: 1.2;
}

h1 {
    font-size: clamp(2.25rem, 5vw, 3.7rem);
    letter-spacing: -0.035em;
}

h2 {
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    letter-spacing: -0.025em;
}

.hero-description {
    max-width: 680px;
    margin: 1.15rem auto 1.7rem;
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.02rem;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.1rem;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
}

.primary-button {
    border: 1px solid var(--accent);
    color: #ffffff;
    background: var(--accent);
}



.hero .eyebrow {
    color: #bfe9e5;
}

.hero .primary-button {
    border-color: #ffffff;
    color: var(--navy);
    background: #ffffff;
}

.hero .primary-button:hover,
.hero .primary-button:focus-visible {
    border-color: #bfe9e5;
    background: #bfe9e5;
}

.primary-button:hover,
.primary-button:focus-visible {
    border-color: var(--accent-dark);
    background: var(--accent-dark);
}

.secondary-button {
    border: 1px solid var(--border);
    background: var(--surface);
}

.secondary-button:hover,
.secondary-button:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
}

.statistics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
    margin-block: 1.75rem 3.25rem;
}

.stat-card,
.filter-panel,
.event-card,
.state-panel,
.modal {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.stat-card {
    display: flex;
    min-height: 92px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-color: var(--teal);
}

.stat-card:nth-of-type(even) {
    border-color: var(--green);
}

.stat-copy {
    min-width: 0;
}

.stat-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    padding: 8px;
    border-radius: 50%;
    color: var(--teal);
    background: var(--surface-muted);
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.stat-card:nth-of-type(even) .stat-icon {
    color: var(--green);
    background: #e7f4ec;
}

.stat-label {
    margin-bottom: 0.2rem;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.stat-value {
    color: var(--navy);
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.25;
}

.stat-date {
    font-size: 1.08rem;
}

.events-section {
    padding-bottom: 3.25rem;
    scroll-margin-top: 90px;
}

#event-filters {
    scroll-margin-top: 90px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.section-heading h2 {
    font-size: clamp(1.45rem, 2.4vw, 1.9rem);
}

.section-heading > p {
    max-width: 360px;
    color: var(--text-muted);
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(175px, 1.5fr) repeat(4, minmax(120px, 1fr)) auto;
    gap: 0.75rem;
    align-items: end;
    padding: 1rem;
    background: var(--surface-muted);
    box-shadow: none;
}

.field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.3rem;
}

.field label {
    font-size: 0.74rem;
    font-weight: 700;
}

.field input,
.field select {
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    background: var(--surface);
}

.field input:focus,
.field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.clear-button {
    grid-column: auto;
    padding-inline: 0.85rem;
    color: var(--navy);
    background: transparent;
}

.results-heading {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.65rem;
    margin-block: 1.8rem 0.85rem;
}

.results-heading p {
    padding: 0.22rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    background: var(--surface);
    font-size: 0.76rem;
}

.event-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.view-more-button {
    display: block;
    margin: 1.25rem auto 0;
    border-color: var(--teal);
    color: var(--teal);
    background: var(--surface);
}

.view-more-button:hover,
.view-more-button:focus-visible {
    border-color: var(--navy);
    color: #ffffff;
    background: var(--navy);
}

.event-card {
    display: flex;
    min-width: 0;
    min-height: 255px;
    flex-direction: column;
    padding: 1.15rem 1.2rem;
}

.card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.category-tag,
.status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 750;
}

.category-tag {
    padding: 0.25rem 0.55rem;
    color: var(--navy);
    background: var(--surface-muted);
}

.status-badge {
    gap: 0.35rem;
    color: var(--success);
}

.status-badge::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.status-badge.closed {
    color: var(--text-muted);
}

.event-card h3 {
    min-height: 2.8rem;
    margin-bottom: 0.9rem;
    color: var(--navy);
    font-size: 1.1rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.event-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 0.9rem;
}

.event-details div {
    display: block;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f6fbfc;
}

.event-details dt {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.event-details dd {
    margin-top: 0.1rem;
    text-align: left;
    font-size: 0.84rem;
    font-weight: 650;
}

.text-button {
    display: inline-flex;
    align-self: flex-start;
    min-height: 38px;
    align-items: center;
    gap: 0.45rem;
    margin-top: auto;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--teal);
    border-radius: 6px;
    color: #ffffff;
    background: var(--teal);
    font-size: 0.8rem;
    font-weight: 750;
}

.text-button::before {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
    background: currentColor;
    content: "";
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='black' stroke-width='2.5'/%3E%3Cpath d='m16 16 5 5' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='black' stroke-width='2.5'/%3E%3Cpath d='m16 16 5 5' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.text-button:hover,
.text-button:focus-visible {
    border-color: var(--navy);
    color: #ffffff;
    background: var(--navy);
    text-decoration: none;
}

.card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: auto;
}

.source-link {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 650;
}

.source-link:hover,
.source-link:focus-visible {
    color: var(--accent);
}

.state-panel {
    margin-top: 0.85rem;
    padding: 2.25rem 1.25rem;
    background: var(--surface-muted);
    box-shadow: none;
    text-align: center;
}

.state-panel p {
    margin-top: 0.5rem;
    color: var(--text-muted);
}

.error-state .primary-button {
    margin-top: 1rem;
}

.error-state {
    border-color: #edc8c2;
    background: #fff1ef;
}

#loading-state {
    background: #eaf4f8;
}

.loading-indicator {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.about-section {
    padding-block: 3.25rem;
    border-block: 1px solid var(--border);
    background: var(--surface-muted);
}

.about-content {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: clamp(2rem, 6vw, 5rem);
}

.about-copy {
    display: grid;
    gap: 1rem;
    color: var(--text-muted);
}

.site-footer {
    padding-block: 1.5rem;
    color: #c9dadd;
    background: var(--navy);
    font-size: 0.85rem;
}

.site-footer a {
    color: #ffffff;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: #bfe9e5;
}

.modal-backdrop {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: grid;
    padding: 1rem;
    place-items: center;
    background: rgba(7, 59, 76, 0.62);
}

.modal {
    position: relative;
    width: min(540px, 100%);
    min-width: 0;
    max-height: calc(100vh - 2rem);
    padding: 0;
    overflow: hidden auto;
}

.modal-header {
    position: relative;
    padding: 1.3rem 4rem 1.2rem 1.5rem;
    color: #ffffff;
    background: var(--teal);
}

.modal-header .eyebrow {
    margin-bottom: 0.35rem;
    color: #c9f1ed;
}

.modal-header h2 {
    font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.modal-body {
    padding: 1.35rem 1.5rem 1.5rem;
    background: var(--surface);
}

.modal-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: 0;
}

.modal-details div {
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f6fbfc;
}

.modal-details dt {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 650;
}

.modal-details dd {
    margin-top: 0.2rem;
    font-size: 0.88rem;
    font-weight: 650;
}

.modal-section {
    margin-top: 1.5rem;
}

.modal-section h3 {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.modal-section p {
    color: var(--text-muted);
}

.modal-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.modal-sources a {
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.modal-sources a:hover,
.modal-sources a:focus-visible {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.9rem;
    width: 44px;
    height: 44px;
    border: 0;
    color: #ffffff;
    background: transparent;
    font-size: 1.5rem;
}

@media (max-width: 960px) {
    .filter-panel {
        grid-template-columns: repeat(3, 1fr);
    }

    .search-field {
        grid-column: span 2;
    }

    .event-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 720px) {
    .section-heading,
    .footer-content {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-content {
        flex-direction: column;
        align-items: center;
        gap: 0.65rem;
        padding-block: 0.9rem;
        text-align: center;
    }

    .site-header nav {
        width: 100%;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.2rem;
    }

    .hero {
        min-height: 330px;
        padding-block: 2.75rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .statistics {
        grid-template-columns: repeat(2, 1fr);
        margin-bottom: 3.5rem;
    }

    .filter-panel,
    .event-grid {
        grid-template-columns: 1fr;
    }

    .search-field,
    .clear-button {
        grid-column: auto;
    }

    .event-card {
        min-height: auto;
    }
}

@media (max-width: 420px) {
    .statistics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .stat-card {
        padding: 0.8rem;
    }

    h1 {
        font-size: 2.15rem;
    }

    .modal-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 340px) {
    .statistics {
        grid-template-columns: 1fr;
    }
}

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

    .loading-indicator {
        animation: none;
    }
}
