@import url('https://fonts.googleapis.com/css2?family=Merriweather+Sans:ital,wght@0,300..800;1,300..800&family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

:root {
    /* Colors */
    --accent-color: #A0002B;
    --secondary-color: #0a7958;
    --off-color: #c7c7c7;
    --text-color: #000000;
    --background-color: #ffffff;
    --link-color: #004b5b;

    /* Shared semantic tokens */
    --accent: var(--accent-color);
    --accent-hover: rgb(144, 0, 0);
    --surface: var(--background-color);
    --surface-hover: #f5f5f5;
    --surface-subtle: #fafafa;
    --border: #d9d9d9;
    --text-primary: var(--text-color);
    --text-secondary: #333333;
    --text-muted: #666666;
    --input-bg: #ffffff;

    /* Layout */
    --navbar-height: 64px;
    --footer-height: 64px;

    /* Fonts */
    --font-heading: 'Rubik';
    --font-normal: 'Merriweather Sans';
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-normal);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--accent-color);
}

a {
    display: inline-block;
    text-decoration: none;
    transition: transform 0.3s ease;
    color: var(--link-color);
}

a:hover {
    transform: translateY(-1px);
}

/* Body */
body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    background: var(--background-color);
    color: var(--text-color);
}

body.modal-open {
    overflow: hidden;
}

body.has-navbar {
    padding-top: var(--navbar-height);
}

/* Navbar */
.navbar__top {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--navbar-height);
    background-color: var(--background-color);
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
    overflow-x: scroll;
    z-index: 1000;
}

.navbar__top-ul {
    display: flex;
    list-style: none;
    justify-content: space-evenly;
    align-items: center;
    height: 100%;
}

.nav__link {
    margin: 0 1rem;
}

.nav__link a {
    color: var(--accent-color);
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: capitalize;
}

.nav__logout-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--accent-color);
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.nav__logout-btn:hover {
    background: var(--surface-hover);
}

/* Content */
.content {
    width: 75%;
    margin: 2rem auto;
}

.content > * {
    margin-top: 10px;
}

.content > section {
    display: grid;
    grid-template-columns: repeat(calc(auto-fit - 1), minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
    border-radius: 1px;
}

.content > section > a {
    /* Take up a full row */
    grid-column: 1 / -1;
}

.content > section > div {
    padding: 8px;
    cursor: pointer;
}

/* List containers in index sections span full width */
#events-list,
#resolutions-list,
#motions-list {
    grid-column: 1 / -1;
    cursor: default;
    padding: 0;
}

/* Footer */
.footer {
    position: relative;
    width: 100%;
    min-height: var(--footer-height);
    background-color: rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto;
}

/* ── Index page ── */
.index-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.25rem 0;
}

.index-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
}

.index-card {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s;
    gap: 0.75rem;
}

.index-card:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

.index-card__body {
    flex: 1;
    min-width: 0;
}

.index-card__title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.index-card__meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* Ongoing event highlight */
.event-card--ongoing {
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15);
}

.event-card--ongoing .event-card__date-block {
    background: #16a34a;
}

/* Live badge */
.badge {
    display: inline-block;
    padding: 0.1em 0.55em;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.6;
    text-transform: uppercase;
}

.badge--live {
    background: #dcfce7;
    color: #15803d;
}

/* ---- Markdown line-numbered display ---- */
.markdown-line-display {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    font-size: 0.85rem;
    line-height: 1.6;
    padding: 0.5rem 0;
}

.md-line {
    display: flex;
    align-items: flex-start;
    gap: 0 0.75em;
    padding: 0 0.9rem;
    min-height: 1.6em;
}

.md-line__num {
    min-width: 2.5ch;
    text-align: right;
    color: var(--text-muted, #94a3b8);
    font-size: 0.8em;
    font-family: 'Courier New', monospace;
    user-select: none;
    flex-shrink: 0;
    padding-top: 0.18em;
    line-height: inherit;
}

.md-line__inner {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

/* List lines */
.md-line--list .md-line__inner {
    display: flex;
    align-items: flex-start;
    gap: 0.35em;
    padding-left: calc(var(--md-indent, 0) * 1.5em);
}

.md-line__marker {
    flex-shrink: 0;
    user-select: none;
    color: var(--text-muted, #666);
}

.md-line__content {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

/* Heading lines */
.md-line--h1 .md-line__inner { font-size: 1.1em; font-weight: 700; }
.md-line--h2 .md-line__inner { font-size: 1.02em; font-weight: 700; }
.md-line--h3 .md-line__inner,
.md-line--h4 .md-line__inner,
.md-line--h5 .md-line__inner,
.md-line--h6 .md-line__inner { font-weight: 600; }

/* Quote lines */
.md-line--quote {
    border-left: 3px solid var(--border, #ccc);
    background: rgba(0, 0, 0, 0.03);
}

.md-line--quote .md-line__inner {
    color: var(--text-muted, #666);
    font-style: italic;
}