/* eventos.css: /eventos and /en/eventos only. Loaded after style.css.
 *
 * The page is ONE panel, the calendar (round 3, 2026-11-29): "Lo próximo" is its header,
 * the month its main view, and the agenda and the archive two other views of the same
 * events. All of it is drawn from the <li class="evp-card"> rows that i18n/events.py
 * renders out of i18n/events.json; with scripting off those cards ARE the page. Nothing
 * here knows an event: it knows six categories.
 *
 * Categories. One system for the calendar, the legend, the cards, the dialog and the
 * homepage wheel: the marks are tokens in style.css (--cat-*), every one a brandbook
 * colour or a mix of two. A category is a GLYPH plus a mark, never a colour alone; chips
 * are quiet tints of their mark with the glyph in front, and the only solid red in the
 * grid is today's number and the next event (audit 2026-11-29, P1-2).
 *
 * Dark scheme. This page follows prefers-color-scheme with the brandbook's own dark block
 * (Gris 5 ground, Rojo 1 as the accent). The rest of the site is light only, so it is
 * scoped to body.evp-page instead of :root. Panels are lifted off the ground with a mix of
 * Gris 4 into Gris 5, not a new grey.
 *
 * eventos.js places a calendar bar on its week's grid; every other size and position is
 * here. Inside the panel nothing is a bordered card (a card in a card): rows are flat,
 * on a tint at most, and the panel is the only box.
 */

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- the six categories: their mark, light and dark ------------------------------------ */
.evp-cat-hackathon { --cat-mark: var(--cat-hackathon); }
.evp-cat-jam { --cat-mark: var(--cat-jam); }
.evp-cat-taller { --cat-mark: var(--cat-taller); }
.evp-cat-charla { --cat-mark: var(--cat-charla); }
.evp-cat-jornada { --cat-mark: var(--cat-jornada); }
.evp-cat-social { --cat-mark: var(--cat-social); }
.evp-card[data-cat="hackathon"] { --cat-mark: var(--cat-hackathon); }
.evp-card[data-cat="jam"] { --cat-mark: var(--cat-jam); }
.evp-card[data-cat="taller"] { --cat-mark: var(--cat-taller); }
.evp-card[data-cat="charla"] { --cat-mark: var(--cat-charla); }
.evp-card[data-cat="jornada"] { --cat-mark: var(--cat-jornada); }
.evp-card[data-cat="social"] { --cat-mark: var(--cat-social); }

/* ---- the dark scheme, for this page only --------------------------------------------- */
@media (prefers-color-scheme: dark) {
    body.evp-page {
        --ink:        var(--mt-grey-5);
        --ink-raised: color-mix(in srgb, var(--mt-grey-4) 22%, var(--mt-grey-5));
        --ink-sunken: color-mix(in srgb, var(--mt-grey-4) 40%, var(--mt-grey-5));
        --line:       var(--mt-grey-4);
        --text:       var(--mt-grey-1);
        --text-dim:   var(--mt-grey);
        /* Rojo 1 is 5.1:1 on Gris 5 but 4.0:1 on the lifted panels, so the dark accent is
           Rojo 1 mixed toward Blanco: 4.8:1 on a panel, 5.5:1 on the ground. */
        --accent:     color-mix(in srgb, var(--mt-red-1) 80%, var(--mt-white));
        --on-accent:  var(--mt-red-5);
        color-scheme: dark;
    }
    .evp-cat-hackathon, .evp-card[data-cat="hackathon"] { --cat-mark: var(--cat-hackathon-dk); }
    .evp-cat-jam, .evp-card[data-cat="jam"] { --cat-mark: var(--cat-jam-dk); }
    .evp-cat-taller, .evp-card[data-cat="taller"] { --cat-mark: var(--cat-taller-dk); }
    .evp-cat-charla, .evp-card[data-cat="charla"] { --cat-mark: var(--cat-charla-dk); }
    .evp-cat-jornada, .evp-card[data-cat="jornada"] { --cat-mark: var(--cat-jornada-dk); }
    .evp-cat-social, .evp-card[data-cat="social"] { --cat-mark: var(--cat-social-dk); }
    body.evp-page main a:not(.btn):hover { color: var(--mt-white); }
    body.evp-page .btn-quiet:hover, body.evp-page .btn-quiet:focus-visible, body.evp-page .menu-item ul li a.menu-item-cta:hover, body.evp-page .skip:hover { color: var(--on-accent); }
    /* the closing band is Rojo with white text in both schemes: scope the light tokens to it */
    body.evp-page .band { --accent: var(--mt-red); --on-accent: var(--mt-white); }
    .evp-dialog-inner { border: 1px solid var(--line); }
    body.evp-page .evp-day.is-weekend { background: color-mix(in srgb, var(--mt-grey-5) 45%, var(--ink-raised)); }
    /* The wordmark is Rojo on paper: on Gris 5 it is 2.1:1. The bar keeps the light scheme
       so the logo stays legible, and everything below it follows the preference. */
    body.evp-page .site-head, body.evp-page .menu-item {
        --ink-raised: var(--mt-white);
        --ink-sunken: var(--mt-grey-2);
        --line:       var(--mt-grey-2);
        --text:       var(--mt-grey-5);
        --text-dim:   var(--mt-grey-4);
        --accent:     var(--mt-red);
        --on-accent:  var(--mt-white);
        color-scheme: light;
        background: rgba(246, 246, 246, .94);
    }
    body.evp-page .site-head .btn:hover, body.evp-page .site-head .btn:focus-visible { background: var(--mt-red-4); border-color: var(--mt-red-4); color: var(--mt-white); }
    body.evp-page .btn:hover, body.evp-page .btn:focus-visible { background: var(--mt-white); border-color: var(--mt-white); color: var(--mt-red-4); }
    body.evp-page .btn-ghost:hover, body.evp-page .btn-ghost:focus-visible { background: transparent; border-color: var(--text); color: var(--text); }
}
@media (prefers-color-scheme: light) {
    body.evp-page { color-scheme: light; }
}

/* ---- the header band: the brand's red, short, and the panel rises into it ------------- */
.evp-hero {
    position: relative;
    overflow: hidden;
    background: var(--mt-red);
    color: var(--mt-white);
    padding-top: clamp(28px, 4vw, 48px);
    padding-bottom: calc(clamp(28px, 4vw, 40px) + var(--rise));
}
.evp-page { --rise: 48px; }
.evp-hero h1 { text-transform: uppercase; letter-spacing: .02em; font-size: var(--t-hero); color: var(--mt-white); }
.evp-hero h1::after { content: ""; display: block; width: 40px; height: 4px; margin-top: var(--s3); background: var(--mt-white); border-radius: 2px; }
.evp-lede { margin-top: var(--s3); font-size: var(--t-md); line-height: 1.45; max-width: 52ch; color: var(--mt-grey-1); }
.evp-hero .wrap { position: relative; z-index: 1; }

/* The brand's one decorative shape, the hexagon, three times at three sizes. */
.evp-hex { position: absolute; display: block; clip-path: var(--hex); pointer-events: none; }
.evp-hex-a { width: clamp(180px, 30vw, 420px); aspect-ratio: 1; right: -4%; top: -14%; background: var(--mt-red-3); }
.evp-hex-b { width: clamp(90px, 14vw, 200px); aspect-ratio: 1; right: 22%; bottom: -12%; background: var(--mt-red-4); }
.evp-hex-c { width: clamp(50px, 7vw, 100px); aspect-ratio: 1; right: 9%; bottom: 30%; background: var(--mt-grey); }

/* ---- the page's one panel ---------------------------------------------------------------- */
.evp-page main .wrap { width: min(var(--wrap), 100%); }
.evp-hero, .evp, .evp-page .band { padding-left: var(--gutter); padding-right: var(--gutter); }
.evp-page main .section-tight { padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(40px, 6vw, 72px); }
.evp { padding-bottom: clamp(40px, 6vw, 72px); }
.evp-app { position: relative; z-index: 2; }
/* With the script the page is one panel lifted into the red band. Without it the page is
   the archive's cards on the ground, and a panel around them would only box them twice. */
html.evp-js .evp-app {
    margin-top: calc(-1 * var(--rise));
    background: var(--ink-raised);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    box-shadow: 0 1px 2px rgba(30, 33, 33, .06), 0 12px 32px rgba(30, 33, 33, .10);
    overflow: clip;
}
.evp-app > .evp-pane-archive { padding-top: var(--s6); }
html.evp-js .evp-app > .evp-pane { padding: var(--s5); }
html.evp-js .evp-app > .evp-pane-month { padding: 0; }

/* ---- the panel's header: what is next, the month and the views, the filters ---------- */
.evp-head { padding: var(--s5) var(--s5) 0; }
.evp-next-h, .evp-cal h3 { font-size: var(--t-sm); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.evp-next-list { display: grid; gap: var(--s3); margin: var(--s3) 0 0; padding: 0; list-style: none; }
.evp-next-empty { max-width: none; margin-top: var(--s2); color: var(--text-dim); }
@media (min-width: 1024px) {
    .evp-next-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.evp-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s3) var(--s4);
    margin-top: var(--s5);
    padding-top: var(--s4);
    border-top: 1px solid var(--line);
}
.evp-monthnav { display: flex; align-items: center; gap: var(--s1); min-width: 0; }
.evp-month, .evp-viewtitle { min-width: 0; margin: 0 0 0 var(--s2); font-size: var(--t-lg); font-weight: 700; line-height: 1.1; color: var(--text); white-space: nowrap; text-transform: none; letter-spacing: 0; }
.evp-viewtitle { margin-left: 0; }
.evp-viewtitle::after { display: none; }
.evp-year { font-weight: 400; color: var(--text-dim); }
.evp-step, .evp-today {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tap);
    min-width: var(--tap);
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.evp-step { width: var(--tap); padding: 0; border-radius: 50%; }
.evp-today { margin-right: var(--s1); padding: 0 var(--s4); border: 1.5px solid var(--line); border-radius: 999px; }
.evp-step:hover, .evp-step:focus-visible { background: var(--ink-sunken); color: var(--accent); }
.evp-today:hover, .evp-today:focus-visible { border-color: var(--text); }
.evp-today[aria-disabled="true"] { color: var(--text-dim); cursor: default; }
.evp-today[aria-disabled="true"]:hover { border-color: var(--line); }
.evp-prev .ic { transform: rotate(180deg); }

/* One look for every "pick one" control on the page: the views here and the category
   chips below are pills, and the pressed one is filled with the text colour. */
.evp-views { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--ink-sunken); }
.evp-view {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--tap);
    padding: 0 var(--s4);
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-dim);
    font: inherit;
    font-size: var(--t-sm);
    font-weight: 700;
    cursor: pointer;
}
.evp-view .ic { width: 16px; height: 16px; }
.evp-view:hover { color: var(--text); }
.evp-view[aria-pressed="true"] { background: var(--text); color: var(--ink-raised); }

.evp-filterbar { display: flex; align-items: center; gap: var(--s2) var(--s3); padding: var(--s4) 0; }
.evp-chipfilters { display: flex; flex-wrap: wrap; flex: 1 1 auto; gap: var(--s2); min-width: 0; }
.evp-chipfilter {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    min-height: var(--tap);
    padding: 0 var(--s3);
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--ink-raised);
    color: var(--text);
    font: inherit;
    font-size: var(--t-sm);
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.evp-chipfilter .ic-cat { width: 16px; height: 16px; }
.evp-chipfilter:hover { border-color: var(--mt-grey-3); }
.evp-n { min-width: 1.6em; padding: 1px 6px; border-radius: 999px; background: var(--ink-sunken); color: var(--text-dim); font-size: var(--t-sm); font-variant-numeric: tabular-nums; text-align: center; }
.evp-n:empty { display: none; }
.evp-chipfilter[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--ink-raised); }
.evp-chipfilter[aria-pressed="true"] .ic-cat { color: currentColor; }
.evp-chipfilter[aria-pressed="true"] .evp-n { background: transparent; color: inherit; }
.evp-chipfilter[aria-pressed="true"]::after { content: "\2713"; font-weight: 700; }
.evp-clear, .evp-wholemonth {
    display: inline-flex;
    align-items: center;
    flex: none;
    min-height: var(--tap);
    padding: 0 var(--s1);
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-size: var(--t-sm);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.evp-clear:hover, .evp-wholemonth:hover { color: var(--text); }
.evp-app :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- an event as a row: "Lo próximo", the narrow month's list, the agenda ------------- */
.evp-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: var(--s3);
    width: 100%;
    min-height: 56px;
    padding: var(--s2);
    border: 0;
    border-radius: var(--r-lg);
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background var(--dur) var(--ease);
}
@media (hover: hover) { .evp-row:hover { background: var(--ink-sunken); } }
.evp-row-body { display: grid; gap: 2px; min-width: 0; }
.evp-row-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); font-size: var(--t-sm); font-weight: 500; color: var(--text-dim); }
.evp-row-top .ic-cat { width: 14px; height: 14px; }
.evp-row-top .evp-pill { min-height: 22px; padding: 0 var(--s2); }
.evp-row-title { font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.evp-row-sub { font-size: var(--t-sm); color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evp-row.is-cancelled .evp-row-title { text-decoration: line-through; color: var(--text-dim); }
.evp-row.is-past { opacity: .7; }
.evp-row.is-past:hover { opacity: 1; }

/* the picture, small; a shared drawing gives way to its category's glyph and tint */
.evp-thumb, .evp-chip-media {
    position: relative;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: var(--r);
    background: color-mix(in srgb, var(--cat-mark) 14%, var(--ink-raised));
    overflow: hidden;
}
.evp-thumb img, .evp-chip-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.evp-thumb.is-poster, .evp-chip-media.is-poster { background: var(--mt-grey-5); }
.evp-thumb.is-poster img, .evp-chip-media.is-poster img { object-fit: contain; }
.evp-thumb.is-logo img, .evp-chip-media.is-logo img { object-fit: contain; padding: 6px; }
.evp-thumb .ic-cat, .evp-chip-media .ic-cat { width: 28px; height: 28px; }

/* "Lo próximo": the panel's first thing, so a little larger, on a tint */
.evp-nx { min-height: 88px; padding: var(--s3); background: var(--ink-sunken); }
.evp-nx:hover { background: color-mix(in srgb, var(--text) 8%, var(--ink-sunken)); }
.evp-nx .evp-thumb { width: 72px; height: 72px; }
.evp-nx .evp-row-title { font-size: var(--t-md); }
.evp-nx.is-next, .evp-nx.is-now { box-shadow: inset 0 0 0 2px var(--accent); }

/* ---- the month, wide: a grid of weeks ------------------------------------------------------- */
.evp-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--ink-sunken); }
.evp-weekdays span { padding: var(--s2) var(--s3); font-size: var(--t-sm); font-weight: 700; color: var(--text-dim); }

/* A week is one grid: the seven day cells span every row as the background, and each
   event is a button spanning its days in a lane of its own. */
.evp-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: 36px repeat(var(--lanes, 1), auto) 1fr;
    min-height: clamp(88px, 8vw, 116px);
    padding-bottom: var(--s2);
    border-bottom: 1px solid var(--line);
}
.evp-week:last-child { border-bottom: 0; }
.evp-day {
    grid-row: 1 / -1;
    min-width: 0;
    padding: 6px var(--s2);
    border-right: 1px solid var(--line);
    margin-bottom: calc(-1 * var(--s2));
}
.evp-day:nth-child(7) { border-right: 0; }
.evp-day.is-weekend { background: color-mix(in srgb, var(--mt-grey-2) 30%, var(--ink-raised)); }
.evp-day:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.evp-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 var(--s1);
    border-radius: 999px;
    font-size: var(--t-sm);
    font-weight: 700;
    color: var(--text);
}
.evp-day.is-before .evp-num { color: var(--text-dim); font-weight: 500; }
.evp-day.is-out .evp-num { color: var(--mt-grey-3); font-weight: 400; }
.evp-day.is-today .evp-num { background: var(--accent); color: var(--on-accent); }

.evp-chip {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    min-height: 28px;
    padding: 3px var(--s2);
    border: 0;
    border-radius: var(--r);
    background: color-mix(in srgb, var(--cat-mark) 12%, var(--ink-raised));
    color: var(--text);
    font: inherit;
    font-size: var(--t-sm);
    font-weight: 500;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    transition: background var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.evp-week > .evp-chip { align-self: start; margin: 0 6px 4px; }
.evp-chip.has-time:not(.is-multi):not(.is-rich) { flex-wrap: wrap; row-gap: 1px; }
.evp-chip.has-time:not(.is-multi):not(.is-rich) > .evp-t { flex: 1 1 100%; }
.evp-chip .ic-cat { width: 14px; height: 14px; }
.evp-chip .evp-chip-media .ic-cat { width: 28px; height: 28px; }
.evp-chip time { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.evp-chip > .evp-t { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; hyphens: auto; }
.evp-chip:hover { background: color-mix(in srgb, var(--cat-mark) 24%, var(--ink-raised)); }
.evp-chip:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; z-index: 2; }
.evp-week > .evp-chip.is-multi { margin-left: 3px; margin-right: 3px; }
@media (pointer: coarse) { .evp-week > .evp-chip, .evp-more-day { min-height: var(--tap); } }
.evp-chip.is-multi > .evp-t { display: block; white-space: nowrap; text-overflow: ellipsis; }
.evp-week > .evp-chip.is-cont-l { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.evp-week > .evp-chip.is-cont-r { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.evp-chip.is-cont-l > .evp-t::before { content: "\2039\00a0"; opacity: .6; }
.evp-chip.is-cont-r > .evp-t::after { content: "\00a0\203A"; opacity: .6; }
.evp-chip.is-past { opacity: .6; }
.evp-chip.is-past:hover, .evp-chip.is-past:focus-visible { opacity: 1; }
.evp-chip.is-out { opacity: .45; }
.evp-chip.is-now:not(.is-rich) { background: var(--accent); color: var(--on-accent); opacity: 1; }
.evp-chip.is-now .ic-cat { color: currentColor; }
.evp-chip.is-tentative { background: var(--ink-raised); border: 1.5px dashed var(--cat-mark); padding: 1.5px 6.5px; }
.evp-chip.is-cancelled { background: transparent; border: 1px dashed var(--mt-grey-3); padding: 2px 7px; color: var(--text-dim); opacity: 1; }
.evp-chip.is-cancelled .ic-cat { color: var(--mt-grey-3); }
/* An upcoming one-day event in the wide grid: a small card, picture on top. The next one
   is ringed in red; the colour of the title stays the text's, so it reads on any picture. */
.evp-chip.is-rich {
    display: grid;
    gap: 0;
    padding: 0;
    overflow: hidden;
    background: color-mix(in srgb, var(--cat-mark) 8%, var(--ink-raised));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cat-mark) 30%, var(--ink-raised));
}
.evp-chip.is-rich .evp-chip-media { width: 100%; height: 64px; border-radius: 0; }
.evp-chip-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 6px var(--s2) 0; }
.evp-chip-top .evp-pill { min-height: 20px; padding: 0 6px; font-size: 12px; }
.evp-chip.is-rich > .evp-t { padding: 2px var(--s2) var(--s2); font-weight: 700; }
.evp-chip.is-rich.is-next { box-shadow: inset 0 0 0 2px var(--accent); }
.evp-chip.is-rich.is-next time { color: var(--accent); }
.evp-chip.is-rich.is-tentative { border: 0; padding: 0; box-shadow: inset 0 0 0 1.5px var(--cat-mark); }
.evp-more-day {
    position: relative;
    z-index: 1;
    justify-self: start;
    min-height: 28px;
    margin: 0 6px 4px;
    padding: 0 var(--s2);
    border: 0;
    border-radius: var(--r);
    background: transparent;
    color: var(--text-dim);
    font: inherit;
    font-size: var(--t-sm);
    font-weight: 700;
    cursor: pointer;
}
.evp-more-day:hover { background: var(--ink-sunken); color: var(--text); }

.evp-tbc { padding: var(--s4) var(--s5) var(--s5); border-top: 1px solid var(--line); }
.evp-tbc:empty { display: none; }
.evp-tbc h3 { margin-bottom: var(--s3); }
.evp-tbc .evp-chip { display: inline-flex; max-width: 100%; margin: 0 var(--s2) var(--s2) 0; }
.evp-empty-month { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s3); padding: var(--s5); text-align: center; max-width: none; color: var(--text-dim); border-top: 1px solid var(--line); }

/* ---- the month, narrow: a mini calendar with dots, and the month as a list ------------- */
.evp-mini, .evp-daylist { display: none; }
.evp-mini-wd, .evp-mini-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.evp-mini-wd span { padding: var(--s2) 0 var(--s1); font-size: var(--t-sm); font-weight: 700; text-align: center; color: var(--text-dim); }
.evp-mday {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 2px;
    min-height: var(--tap);
    padding: 2px 0;
    border-radius: var(--r-lg);
    cursor: pointer;
}
@media (hover: hover) { .evp-mday:hover { background: var(--ink-sunken); } }
.evp-mday:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.evp-mnum { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 500; font-variant-numeric: tabular-nums; }
.evp-mday.has-ev .evp-mnum { font-weight: 700; }
.evp-mday.is-before .evp-mnum { color: var(--text-dim); }
.evp-mday.is-out { opacity: .45; }
.evp-mday.is-today .evp-mnum { background: var(--accent); color: var(--on-accent); }
.evp-mday.is-sel .evp-mnum { background: var(--text); color: var(--ink-raised); }
.evp-dots { display: flex; gap: 3px; height: 6px; }
.evp-mday { position: relative; }
.evp-mday.has-long::after { content: ""; position: absolute; left: 0; right: 0; bottom: 1px; height: 3px; background: color-mix(in srgb, var(--cat-mark) 55%, var(--ink-raised)); }
.evp-mday.has-long.is-long-past::after { background: color-mix(in srgb, var(--cat-mark) 25%, var(--ink-raised)); }
.evp-mday.is-long-a::after { left: 6px; border-radius: 2px 0 0 2px; }
.evp-mday.is-long-z::after { right: 6px; border-radius: 0 2px 2px 0; }
.evp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cat-mark); }
.evp-dot.is-past { opacity: .45; }
.evp-dot.is-cancelled { background: transparent; box-shadow: inset 0 0 0 1.5px var(--mt-grey-3); }

.evp-daylist-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); max-width: none; padding: 0 var(--s2); font-weight: 700; }
.evp-agenda { margin: 0; padding: 0; list-style: none; }
.evp-arow { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: var(--s2); padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.evp-arow:last-child { border-bottom: 0; }
.evp-adate { padding-top: var(--s2); text-align: center; line-height: 1; }
.evp-adate b { display: block; font-size: var(--t-lg); font-weight: 700; color: var(--text); }
.evp-adate span { display: block; margin-top: var(--s1); font-size: var(--t-sm); font-weight: 700; color: var(--text-dim); }
.evp-adate.is-cont span { margin-top: var(--s2); line-height: 1.2; }
.evp-arow.is-past .evp-adate { opacity: .6; }
.evp-arow.is-today .evp-adate b { color: var(--accent); }
.evp-now { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; font-size: var(--t-sm); font-weight: 700; color: var(--accent); }
.evp-now::after { content: ""; flex: 1; height: 2px; background: var(--accent); border-radius: 1px; }
.evp-achips { display: grid; gap: var(--s1); min-width: 0; }
.evp-achips .evp-thumb { width: 52px; height: 52px; }
.evp-arow-none { padding: var(--s4) var(--s2); color: var(--text-dim); }

@media (max-width: 1023px) {
    .evp-weekdays, .evp-grid-days { display: none; }
    .evp-mini, .evp-daylist { display: block; }
    .evp-cal { display: grid; gap: var(--s3); padding: 0 var(--s4) var(--s4); }
    .evp-mini { padding-top: var(--s1); }
    .evp-tbc { padding: var(--s3) 0 0; }
    .evp-empty-month { padding: var(--s4) 0 0; }
}
@media (min-width: 640px) and (max-width: 1023px) {
    .evp-cal { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); align-items: start; gap: var(--s3) var(--s5); }
    .evp-daylist { padding-top: var(--s2); }
    .evp-tbc, .evp-empty-month { grid-column: 1 / -1; }
}

/* ---- the agenda: from today on, by month ---------------------------------------------- */
.evp-sched { margin: 0; padding: 0; list-style: none; }
.evp-sched-h { padding: var(--s4) 0 var(--s1); }
.evp-sched-h:first-child { padding-top: 0; }
.evp-sched-h h3 { font-size: var(--t-md); color: var(--text); }
.evp-sched-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: var(--s2); border-bottom: 1px solid var(--line); }
.evp-sched-row .evp-adate { padding-top: 0; }
@media (min-width: 1024px) {
    .evp-sched-row { grid-template-columns: 64px minmax(0, 1fr); }
    .evp-sched-row .evp-thumb { width: 96px; height: 64px; }
}

/* ---- the cards: with scripting off they are the page; with it, the archive's rows ------ */
.evp-cards { display: grid; gap: var(--s5); margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(auto-fill, minmax(min(100%, 264px), 1fr)); }
.evp-card[hidden] { display: none; }
.evp-inner {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--ink-raised);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.evp-card.is-js .evp-inner { cursor: pointer; }
.evp-media { position: relative; aspect-ratio: 16 / 9; padding: var(--s3); background: color-mix(in srgb, var(--cat-mark) 12%, var(--ink-sunken)); overflow: hidden; }
.evp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.evp-card[data-kind="logo"] .evp-img { object-fit: contain; padding: var(--s6); }
.evp-card[data-kind="poster"] .evp-media { background: var(--mt-grey-5); }
.evp-card[data-kind="poster"] .evp-img { object-fit: contain; }
.evp-card.is-cancelled .evp-img { filter: grayscale(1); opacity: .6; }
.evp-media > .evp-pill { position: relative; z-index: 1; }

/* the date, as a stamp at the start of an archive row */
.evp-stamp {
    position: relative;
    z-index: 2;
    width: 56px;
    padding: 5px 0;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--ink-raised);
    text-align: center;
    line-height: 1;
}
.evp-stamp b { display: block; font-size: var(--t-md); font-weight: 700; color: var(--text); }
.evp-stamp b.is-year { font-size: var(--t-base); padding-top: var(--s2); padding-bottom: var(--s2); }
.evp-stamp span { display: block; margin-top: 2px; font-size: var(--t-sm); font-weight: 700; color: var(--accent); }

.evp-body { flex: 1; display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4) var(--s4) var(--s5); }
.evp-when { max-width: none; font-size: var(--t-sm); font-weight: 700; color: var(--accent); }
.evp-time::before, .evp-approx::before { content: "\00b7\00a0"; }
.evp-time, .evp-approx { margin-left: var(--s1); color: var(--text-dim); }
.evp-title { font-size: var(--t-md); line-height: 1.2; }
.evp-title button { all: unset; cursor: pointer; }
.evp-title button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
/* the whole row is the hit area of its title button; links inside it stay on top */
.evp-card.is-js .evp-title button::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.evp-summary { max-width: none; font-size: var(--t-base); color: var(--text-dim); }
.evp-where { max-width: none; font-size: var(--t-sm); color: var(--text-dim); margin-top: auto; padding-top: var(--s2); }
.evp-state { display: none; }
.evp-link { position: relative; z-index: 2; align-self: flex-start; display: inline-flex; align-items: center; min-height: var(--tap); font-weight: 700; }
.evp-card.is-cancelled .evp-title { text-decoration: line-through; }

/* the archive as rows: a date stamp, the title, the category and the place; ~70px each,
   under sticky year headings, two columns on a wide screen (UX P1-3) */
.evp-cards-past.is-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--s6); }
@media (min-width: 1024px) { .evp-cards-past.is-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#evp-archive .evp-card { content-visibility: auto; contain-intrinsic-size: auto 72px; }
.evp-year-h { grid-column: 1 / -1; }
.evp-cards-past.is-list .evp-year-h { position: sticky; top: var(--head-h); z-index: 3; padding: var(--s4) 0 var(--s2); background: var(--ink-raised); border-bottom: 2px solid var(--text); }
.evp-cards-past.is-list .evp-year-h:first-child { padding-top: 0; }
.evp-year-h h3 { font-size: var(--t-lg); color: var(--text); }
.evp-cards-past.is-list .evp-inner {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 0 var(--s3);
    min-height: 56px;
    padding: var(--s3) var(--s2);
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
}
@media (hover: hover) { .evp-cards-past.is-list .evp-card.is-js .evp-inner:hover { background: var(--ink-sunken); } }
.evp-cards-past.is-list .evp-media,
.evp-cards-past.is-list .evp-summary,
.evp-cards-past.is-list .evp-when,
.evp-cards-past.is-list .evp-role,
.evp-cards-past.is-list .evp-link { display: none; }
.evp-cards-past.is-list .evp-stamp { grid-row: 1; }
.evp-cards-past.is-list .evp-body { flex-direction: row; flex-wrap: wrap; align-items: center; align-content: center; padding: 0; gap: var(--s1) var(--s2); }
.evp-cards-past.is-list .evp-title { flex: 1 1 100%; font-size: var(--t-base); }
.evp-cards-past.is-list .evp-meta { order: 3; flex-wrap: nowrap; gap: var(--s2); min-width: 0; }
.evp-cards-past.is-list .evp-badge { min-height: 24px; flex: none; }
.evp-cards-past.is-list .evp-where { order: 4; flex: 1 1 0; min-width: 0; margin: 0; padding: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.evp-empty { max-width: none; padding: var(--s6); text-align: center; color: var(--text-dim); border: 2px dashed var(--line); border-radius: var(--r-lg); }

/* ---- the archive's tools ------------------------------------------------------------- */
.evp-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.evp-field { display: grid; }
.evp-field input, .evp-field select {
    min-height: var(--tap);
    padding: 0 var(--s4);
    border: 1.5px solid var(--mt-grey-3);
    border-radius: 999px;
    background: var(--ink-raised);
    color: var(--text);
    font: inherit;
    font-size: var(--t-base);
}
.evp-field input:focus-visible, .evp-field select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.evp-field-search { flex: 1 1 260px; }
.evp-search { position: relative; display: block; }
.evp-search > .ic { position: absolute; left: var(--s4); top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--text-dim); pointer-events: none; }
.evp-search input { width: 100%; padding-left: 44px; padding-right: var(--tap); }
.evp-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.evp-search-clear { position: absolute; right: 0; top: 0; display: grid; place-items: center; width: var(--tap); height: var(--tap); border: 0; background: transparent; color: var(--text-dim); cursor: pointer; }
.evp-search-clear .ic { width: 18px; height: 18px; }
.evp-search-clear:hover { color: var(--text); }
.evp-field select { min-width: 170px; }
.evp-count { display: flex; align-items: center; min-height: var(--tap); max-width: none; margin-left: auto; font-size: var(--t-sm); font-weight: 700; color: var(--text-dim); }
.evp-morewrap { display: flex; justify-content: center; margin-top: var(--s5); }
.evp-morewrap:has(.evp-more[hidden]) { display: none; }

/* ---- a category mark, used on cards, in the dialog and in the agenda ---------------- */
.evp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 var(--s3) 0 var(--s2);
    border-radius: 999px;
    background: color-mix(in srgb, var(--cat-mark) 12%, var(--ink-raised));
    color: var(--text);
    font-size: var(--t-sm);
    font-weight: 700;
}
.evp-badge .ic-cat { width: 16px; height: 16px; }
.evp-role { font-size: var(--t-sm); color: var(--text-dim); }
.evp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); max-width: none; }
.evp-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin: 0;
    padding: 0 var(--s3);
    border-radius: 999px;
    background: var(--mt-grey-5);
    color: var(--mt-white);
    font-size: var(--t-sm);
    font-weight: 700;
}
.evp-pill.is-next, .evp-pill.is-now { background: var(--accent); color: var(--on-accent); }
.evp-pill.is-cancelled { background: var(--mt-grey-4); color: var(--mt-white); }


/* ---- the detail dialog --------------------------------------------------------------- */
body:has(.evp-dialog[open]) { overflow: hidden; }
.evp-dialog {
    width: min(720px, 100% - 24px);
    max-width: none;
    max-height: calc(100dvh - 24px);
    margin: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    overflow: visible;
}
.evp-dialog::backdrop { background: rgba(30, 33, 33, .78); }
/* the panel is the inner box, so the picture can run edge to edge while the text keeps
   its inset */
.evp-dialog-inner { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); overflow-y: auto; border-radius: var(--r-xl); background: var(--ink-raised); }
.evp-dialog-media { position: relative; flex: none; height: clamp(160px, 32vh, 280px); background: color-mix(in srgb, var(--cat-mark) 12%, var(--ink-sunken)); overflow: hidden; }
.evp-dialog-media img { width: 100%; height: 100%; object-fit: cover; }
.evp-dialog-media.is-poster { background: var(--mt-grey-5); }
.evp-dialog-media.is-poster img { object-fit: contain; }
.evp-dialog-media.is-logo img { object-fit: contain; padding: var(--s5); }
.evp-dialog-body { display: grid; gap: var(--s3); padding: var(--s5) var(--s6) var(--s4); }
.evp-dialog-title { font-size: var(--t-2xl); line-height: 1.05; }
.evp-dialog-title:focus { outline: none; }
.evp-facts { display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: var(--s2) var(--s3); margin: 0; }
.evp-facts dt { display: flex; }
.evp-facts dt .ic { width: 22px; height: 22px; color: var(--accent); }
.evp-facts dd { margin: 0; font-size: var(--t-md); font-weight: 500; }
.evp-facts dd:empty, .evp-facts dt:has(+ dd:empty) { display: none; }
.evp-dialog-summary { max-width: none; font-size: var(--t-md); line-height: 1.45; color: var(--text-dim); }
.evp-dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); padding: var(--s2) var(--s6) var(--s6); }
.evp-dialog-primary:empty { display: none; }
.evp-dialog-actions .btn { text-decoration: none; }
.evp-dialog-actions .btn .ic { width: 18px; height: 18px; }
.evp-dialog-close {
    position: absolute;
    top: var(--s3);
    right: var(--s3);
    z-index: 2;
    display: grid;
    place-items: center;
    width: var(--tap);
    height: var(--tap);
    border: 0;
    border-radius: 50%;
    background: rgba(30, 33, 33, .72);
    color: var(--mt-white);
    cursor: pointer;
}
.evp-dialog-close:hover, .evp-dialog-close:focus-visible { background: var(--mt-red); }
.evp-dialog-close:focus-visible { outline: 3px solid var(--mt-red-1); outline-offset: 2px; }


/* ---- narrow screens --------------------------------------------------------------------- */
@media (max-width: 1023px) {
    .evp-head { padding: var(--s4) var(--s4) 0; }
    html.evp-js .evp-app > .evp-pane { padding: var(--s4); }
    html.evp-js .evp-app > .evp-pane-month { padding: 0; }
    .evp-filterbar { padding: var(--s3) 0; }
    .evp-chipfilters {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-inline: calc(-1 * var(--s4));
        padding-inline: var(--s4);
        scroll-snap-type: x proximity;
        scroll-padding-inline: var(--s4);
        scrollbar-width: none;
    }
    .evp-chipfilters::-webkit-scrollbar { display: none; }
    .evp-chipfilter { flex: none; scroll-snap-align: start; }
    /* "Lo próximo" is a short stack below 1024px, so the next event is on the first
       screen whole, never the edge of a card off to the right */
    .evp-next-list { gap: var(--s2); }
    .evp-nx { min-height: 72px; padding: var(--s2); }
    .evp-nx .evp-row-title { -webkit-line-clamp: 1; }
}
@media (max-width: 639px) {
    .evp-page { --rise: 32px; }
    .evp-lede { font-size: var(--t-base); }
    .evp-bar { margin-top: var(--s4); }
    .evp-bar { gap: var(--s2); }
    .evp-monthnav { flex: 1 1 100%; }
    .evp-month, .evp-viewtitle { font-size: var(--t-md); }
    .evp-views { flex: 1 1 100%; }
    .evp-view { flex: 1; justify-content: center; padding: 0 var(--s2); }
    .evp-nx .evp-thumb { width: 56px; height: 56px; }
    .evp-nx .evp-row-title { font-size: var(--t-base); }
    .evp-dialog {
        width: 100%;
        max-height: 92dvh;
        margin: auto 0 0;
        border-radius: var(--r-xl) var(--r-xl) 0 0;
    }
    .evp-dialog-inner { max-height: 92dvh; border-radius: var(--r-xl) var(--r-xl) 0 0; }
    .evp-dialog-media { height: auto; aspect-ratio: 21 / 9; }
    .evp-dialog-media.is-illustration { display: none; }
    .evp-dialog-body { padding: var(--s5) var(--s4) var(--s4); }
    .evp-dialog-media.is-illustration + .evp-dialog-body { padding-right: calc(var(--tap) + var(--s4)); }
    .evp-dialog-title { font-size: var(--t-lg); }
    .evp-dialog-actions { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); padding: var(--s3) var(--s4); background: var(--ink-raised); border-top: 1px solid var(--line); }
    .evp-dialog-primary { grid-column: 1 / -1; display: grid; }
    .evp-dialog-actions .btn { justify-content: center; padding-inline: var(--s2); font-size: var(--t-sm); }
    .evp-dialog-actions .evp-dialog-primary .btn { font-size: var(--t-base); }
    .evp-hex-b, .evp-hex-c { display: none; }
    .evp-field, .evp-field select { width: 100%; }
    .evp-count { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .evp-chip, .evp-row { transition: none; }
}
