/* =============================================================
   Upcoming Deadlines Block  (redesign 2026)
   Two-group nav (Who you are / Program) + flat divided date rows.
   Light + dark (theme uses [data-theme="dark"]).
   ============================================================= */

.udl {
    --udl-ink: #161616;
    --udl-muted: #6b6b6b;
    --udl-faint: #8a8a8a;
    --udl-label: #9a9a9a;
    --udl-gold: #fdb515;
    --udl-surface: #fff;
    --udl-chip-border: #d8d6cf;
    --udl-hairline: #eeece6;
    --udl-rule: #e6e4de;
    --udl-heading-rule: #161616;
    --udl-sublist-bg: #f9f8f5;

    container-type: inline-size;
    container-name: udl;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--udl-ink);
    display: flex;
    flex-direction: column;
    gap: 22px;
}

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

/* ---------- Top-level nav ---------- */

.udl__nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.udl__nav-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* On the full page the Program group is separated from the audience group. */
.udl--full .udl__nav-group--program {
    border-top: 1px solid var(--udl-hairline);
    padding-top: 20px;
}

/* No separator when the audience group is omitted (single-audience view). */
.udl--full .udl__nav-group--program:first-child {
    border-top: 0;
    padding-top: 0;
}

.udl__nav-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--udl-label);
}

.udl__tablist {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.udl__tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--udl-chip-border);
    background: var(--udl-surface);
    color: #5b5b5b;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.udl__tab--audience {
    border-radius: 6px;
    padding: 8px 16px;
}

.udl__tab--program {
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 13px;
}

.udl__tab-dot {
    display: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--udl-ink);
    flex-shrink: 0;
}

.udl__tab:hover {
    border-color: var(--udl-gold);
    color: var(--udl-ink);
}

.udl__tab.is-active {
    background: var(--udl-gold);
    border-color: var(--udl-gold);
    color: var(--udl-ink);
    font-weight: 700;
}

.udl__tab.is-active .udl__tab-dot {
    display: inline-block;
}

/* ---------- Panels ---------- */

.udl__panels {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* `hidden` must win over any surrounding display rules for the toggle to work. */
.udl [hidden] {
    display: none !important;
}

/* ---------- Program sub-list (Scholars / VPA) ---------- */

.udl__sublist {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    padding: 14px 16px;
    margin-bottom: 24px;
    background: var(--udl-sublist-bg);
    border-radius: 8px;
}

.udl__sublink {
    border: 0;
    background: transparent;
    padding: 0 0 2px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #5b5b5b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.udl__sublink:hover {
    color: var(--udl-ink);
}

.udl__sublink.is-active {
    color: var(--udl-ink);
    font-weight: 700;
    border-bottom-color: var(--udl-gold);
}

/* ---------- Season headings (full page) ---------- */

.udl__season-heading {
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--udl-heading-rule);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--udl-ink);
}

/* Add breathing room between a season's rows and the next heading. */
.udl__season-heading:not(:first-child) {
    margin-top: 28px;
}

/* ---------- Season sub-tabs (teaser) ---------- */

.udl__seasontabs {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    border-bottom: 1px solid var(--udl-rule);
    margin-bottom: 12px;
}

.udl__seasontab {
    border: 0;
    background: transparent;
    padding: 0 0 9px;
    margin-bottom: -1px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--udl-label);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.udl__seasontab:hover {
    color: var(--udl-ink);
}

.udl__seasontab.is-active {
    color: var(--udl-ink);
    font-weight: 700;
    border-bottom-color: var(--udl-gold);
}

/* ---------- Date rows ---------- */

.udl__rows {
    display: block;
}

.udl__row {
    display: flex;
    align-items: stretch;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--udl-hairline);
}

.udl__row:last-child {
    border-bottom: 0;
}

.udl__bar {
    flex-shrink: 0;
    width: 2px;
    border-radius: 2px;
    background: var(--udl-gold);
}

.udl__bar--teal  { background: #007176; }
.udl__bar--red   { background: #c1272d; }
.udl__bar--black { background: var(--udl-ink); }

.udl__date {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 56px;
    flex-shrink: 0;
}

.udl__month {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--udl-faint);
    line-height: 1.1;
}

.udl__day {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: var(--udl-ink);
}

.udl__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Each <ul> in the ACF rich text is one deadline (title + note). */
.udl__content ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.udl__content ul + ul {
    border-top: 1px solid var(--udl-hairline);
    padding-top: 12px;
}

/* First list item = the deadline title. */
.udl__content ul li:first-child {
    font-size: 16px;
    font-weight: 600;
    color: var(--udl-ink);
    line-height: 1.3;
}

/* Following items = the descriptive note (data wraps them in <em><small>). */
.udl__content ul li:not(:first-child) {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.5;
    color: var(--udl-muted);
}

.udl__content ul li small {
    font-size: inherit;
}

.udl__content ul li em {
    font-style: normal;
}

/* Labelled rows (Scholars): program name as the title, date text as the note. */
.udl__row-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--udl-ink);
    line-height: 1.3;
}

.udl__row-note {
    margin-top: -8px;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.5;
    color: var(--udl-muted);
}

/* Bare paragraphs in the rich text, if any. */
.udl__content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--udl-muted);
}

/* ---------- Teaser sizing tweaks ---------- */

.udl--teaser .udl__date {
    min-width: 52px;
}

.udl--teaser .udl__day {
    font-size: 26px;
}

.udl--teaser .udl__content ul li:first-child {
    font-size: 15px;
}

/* =============================================================
   Dark mode
   ============================================================= */

[data-theme="dark"] .udl {
    --udl-ink: #f5f3ee;
    --udl-muted: #a8a49c;
    --udl-faint: #8a857a;
    --udl-label: #8a857a;
    --udl-surface: transparent;
    --udl-chip-border: #3a382f;
    --udl-hairline: #2c2a24;
    --udl-rule: #34322b;
    --udl-heading-rule: #f5f3ee;
    --udl-sublist-bg: #171511;
}

[data-theme="dark"] .udl__tab {
    color: var(--udl-muted);
}

/* Active tab stays solid gold with dark label/dot in both themes. */
[data-theme="dark"] .udl__tab.is-active {
    color: #161616;
}

[data-theme="dark"] .udl__tab.is-active .udl__tab-dot {
    background: #161616;
}

[data-theme="dark"] .udl__sublink {
    color: var(--udl-muted);
}

[data-theme="dark"] .udl__sublink.is-active {
    color: var(--udl-ink);
}

/* =============================================================
   Responsive  (container-query first, media-query fallback)
   ============================================================= */

@container udl (max-width: 480px) {
    .udl__row {
        gap: 12px;
    }
    .udl__date {
        min-width: 46px;
    }
    .udl__day {
        font-size: 24px;
    }
    .udl__season-heading {
        font-size: 18px;
    }
}

@media (max-width: 600px) {
    .udl__sublist {
        gap: 10px 20px;
    }
    .udl__seasontabs {
        gap: 16px;
    }
}
