/* ============================================================================
   Hermithive - agenda   (/css/agenda.css)
   ----------------------------------------------------------------------------
   Styles whatever /agenda.js renders into a [data-agenda] element. Linked by
   the homepage (after /styles.css) and by /events/ (after /css/site-pages.css).

   It defines NO colours of its own beyond the two self-contained badges: it
   only uses the tokens both of those sheets share, so it follows the light /
   dark / system theme contract without a dark block here.
   ========================================================================== */

.agenda-heading {
    margin: 1.6rem 0 0.7rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border);
    color: var(--heading-fg);
    font-size: 1.15rem;
}

.agenda-groups > .agenda-heading:first-child { margin-top: 0.4rem; }

/* The full agenda is followed by another section; the short homepage list is not. */
[data-agenda="full"] { margin-bottom: 2rem; }

/* `main ul` on the homepage sets list padding; the class outranks it. */
.agenda-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
    max-width: none;
}

.agenda-item {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    margin: 0;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    /* Gold = at Hermithive. Decorative: the "Elsewhere" badge carries the meaning. */
    border-left: 5px solid var(--banner-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.agenda-item.is-elsewhere { border-left-color: var(--highlight-light); }

.agenda-item.is-cancelled .agenda-title,
.agenda-item.is-cancelled .agenda-when { text-decoration: line-through; }
.agenda-item.is-cancelled .agenda-badge { text-decoration: none; display: inline-block; }

/* ---- Date badge --------------------------------------------------------- */

.agenda-date {
    flex: 0 0 3.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem 0.2rem;
    background: var(--accent-bg-light);
    color: var(--secondary-fg);
    border: 1px solid var(--border);
    border-radius: 6px;
    line-height: 1.15;
    text-align: center;
}

.agenda-date-big { font-size: 1.35rem; font-weight: bold; }

.agenda-date-small {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Body --------------------------------------------------------------- */

.agenda-body { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }

.agenda-body > * { margin: 0 0 0.3rem; }
.agenda-body > *:last-child { margin-bottom: 0; }

.agenda-title {
    display: block;
    font-size: 1.05rem;
    line-height: 1.3;
    color: var(--heading-fg);
}

.agenda-when { font-weight: bold; font-size: 0.95rem; }

.agenda-soon {
    display: inline-block;
    margin-left: 0.2rem;
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    background: var(--banner-bg);
    color: var(--banner-fg);
    font-size: 0.8rem;
    white-space: nowrap;
}

.agenda-skipped,
.agenda-meta,
.agenda-status { font-size: 0.9rem; color: var(--muted-fg); }

.agenda-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.7rem;
}

.agenda-badge {
    padding: 0.05rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--primary-fg);
    font-size: 0.8rem;
    font-weight: normal;
    white-space: nowrap;
}

/* Self-contained pairs (white on dark green / dark red, both > 7:1), so they
   read the same in either theme. */
.agenda-badge-open { background: #1b5e20; border-color: #1b5e20; color: #ffffff; }
.agenda-badge-cancelled { background: #8c1d18; border-color: #8c1d18; color: #ffffff; }

/* ---- Filter + status ---------------------------------------------------- */

.agenda-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0 0.5rem;
}

.agenda-filter-label { font-weight: bold; color: var(--muted-fg); }

.agenda-filter-button {
    min-height: 2.75rem;
    padding: 0.4rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--heading-fg);
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
}

.agenda-filter-button:hover { background: var(--surface-alt); }

/* --highlight, not --accent-bg-light: the latter is almost the surface colour
   in the dark theme, which would leave "pressed" told by font weight alone. */
.agenda-filter-button[aria-pressed="true"] {
    background: var(--highlight);
    border-color: var(--highlight);
    color: var(--secondary-fg);
    font-weight: bold;
}

.agenda-status { margin: 0 0 0.4rem; }

.agenda-empty {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--border-radius);
    color: var(--muted-fg);
}

[data-agenda][aria-busy="true"] { opacity: 0.75; }

/* ---- Collapsed extras (the embedded wiki calendar on /events/) ---------- */

.agenda-details {
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
}

.agenda-details > summary {
    cursor: pointer;
    font-weight: bold;
    color: var(--heading-fg);
}

.agenda-details[open] > summary { margin-bottom: 0.8rem; }

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

@media (max-width: 480px) {
    .agenda-item { gap: 0.7rem; padding: 0.75rem; }
    .agenda-date { flex-basis: 3.1rem; }
    .agenda-date-big { font-size: 1.15rem; }
}

@media print {
    .agenda-filter, .agenda-link[download] { display: none; }
    .agenda-item { box-shadow: none; break-inside: avoid; }
}
