/* Events listing + popup (general-pages/entry-types/_eventsList.twig, Figma 4979:1719 / 2978:1641).
   Pills reuse .tile-btn from page-modules/tile-common.css. */

.ev-listing,
.ev-modal {
    --ev-latte: #F4F3EC;
    --ev-blue: #0064FA;
    --ev-navy: #00285D;
    --ev-ink: #333333;
    --ev-text: #2D2A26;
    --ev-muted: #B3B3B3;
    --ev-flare: 32px;
}

.ev-listing {
    position: relative;
    overflow: hidden;
    padding-bottom: 6em;
}

/* ---------- Term tabs (Figma 5072:536) ---------- */
.ev-tabs {
    position: relative;
    z-index: 2;
    background-color: var(--ev-latte);
}

.ev-tabs__inner {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    max-width: 1440px;
    min-height: 105px;
    margin: 0 auto;
    padding: 19px 24px 0;
}

.ev-tabs__switch {
    position: absolute;
    left: max(24px, calc(50% - 710px));
    bottom: 26px;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #000000;
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 18px;
    line-height: 1.5;
    text-transform: uppercase;
    text-decoration: none;
}

.ev-tabs__switch img {
    width: 52px;
    height: 52px;
    margin: -12px 0;
    transform: rotate(180deg);
}

.ev-tabs__switch--upcoming img {
    transform: none;
}

/* Past / Upcoming switch: only the one that leads away from the current view shows. */
.ev-tabs__switch--upcoming,
.ev-listing.is-past .ev-tabs__switch--past {
    display: none;
}

.ev-listing.is-past .ev-tabs__switch--upcoming {
    display: inline-flex;
}

.ev-tabs__switch:hover,
.ev-tabs__switch:focus-visible {
    color: var(--ev-blue);
}

.ev-tabs__list {
    display: flex;
    align-items: flex-end;
}

.ev-tabs__tab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 190px;
    height: 86px;
    padding: 0 32px 9px;
    border-radius: 20px 20px 0 0;
    color: #000000;
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s ease;
}

.ev-tabs__tab:hover {
    color: var(--ev-blue);
}

.ev-tabs__tab.is-active {
    min-width: 274px;
    background-color: var(--ev-blue);
    color: #FFFFFF;
}

/* Concave corners at the foot of the active tab. */
.ev-tabs__tab.is-active::before,
.ev-tabs__tab.is-active::after {
    content: "";
    position: absolute;
    bottom: 0;
    width: var(--ev-flare);
    height: var(--ev-flare);
    pointer-events: none;
}

.ev-tabs__tab.is-active::before {
    left: calc(var(--ev-flare) * -1);
    background: radial-gradient(circle at 0 0, transparent calc(var(--ev-flare) - .5px), var(--ev-blue) var(--ev-flare));
}

.ev-tabs__tab.is-active::after {
    right: calc(var(--ev-flare) * -1);
    background: radial-gradient(circle at 100% 0, transparent calc(var(--ev-flare) - .5px), var(--ev-blue) var(--ev-flare));
}

.ev-tabs__tab:focus-visible,
.ev-tabs__switch:focus-visible,
.ev-term-links__item:focus-visible {
    outline: 3px solid var(--ev-blue);
    outline-offset: 3px;
}

.ev-tabs__tab.is-active:focus-visible {
    outline-color: var(--ev-navy);
}

/* ---------- Panels + grid ---------- */
.ev-listing__body {
    position: relative;
    max-width: 1420px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Chevron pattern on the right (Figma 4979:1734). */
.ev-listing::after {
    content: "";
    position: absolute;
    top: 296px;
    right: 0;
    z-index: 0;
    width: 742px;
    height: 1040px;
    max-width: 50%;
    background: url(../images/events/chevrons.svg) no-repeat right top / contain;
    pointer-events: none;
}

.ev-panel {
    position: relative;
    z-index: 1;
}

.ev-panel:focus {
    outline: none;
}

.ev-panel:focus-visible {
    outline: 3px solid var(--ev-blue);
    outline-offset: 8px;
}

.ev-panel__heading {
    margin: 62px 0 45px;
    color: #000000;
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.ev-panel__empty {
    margin: 0 auto;
    max-width: 640px;
    color: var(--ev-ink);
    font-size: 18px;
    text-align: center;
}

.ev-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 315px));
    justify-content: center;
    gap: 41px 28px;
}

/* ---------- Card (Figma 4984:3447) ---------- */
.ev-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 493px;
    padding: 11px 11px 22px;
    border-radius: 20px;
    background-color: var(--ev-latte);
    box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
    transition: box-shadow .35s cubic-bezier(.22, .61, .36, 1), transform .35s cubic-bezier(.22, .61, .36, 1);
}

.ev-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
    transform: translateY(-6px);
}

.ev-card:has(.ev-card__open:focus-visible) {
    outline: 3px solid var(--ev-blue);
    outline-offset: 3px;
}

.ev-card__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 294 / 226;
    border-radius: 19px;
    background-color: #D9D9D9;
}

.ev-card__media::after,
.ev-modal__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 56.858%, rgba(0, 0, 0, .5) 76.991%);
    pointer-events: none;
}

.ev-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s cubic-bezier(.22, .61, .36, 1);
}

.ev-card:hover .ev-card__img {
    transform: scale(1.06);
}

.ev-card__date,
.ev-modal__date {
    position: absolute;
    left: 13px;
    bottom: 12px;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 17px;
    margin: 0;
    color: #FFFFFF;
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.012;
    text-transform: uppercase;
    text-shadow: 0 4px 24px rgba(0, 0, 0, .25);
}

.ev-card__date img {
    width: 37px;
    height: 37px;
}

.ev-card__title {
    flex: 1 0 auto;
    margin: 41px 0 24px;
    padding: 0 10px;
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
}

.ev-card__open {
    padding: 0;
    border: 0;
    background: none;
    color: #000000;
    font: inherit;
    line-height: inherit;
    text-align: left;
    cursor: pointer;
}

/* The title button covers the whole card. */
.ev-card__open::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: 20px;
}

.ev-card__open:focus {
    outline: none;
}

.ev-card__btn {
    width: auto;
    min-width: 211px;
    align-self: flex-start;
    margin-left: -1px;
    text-transform: uppercase;
}

.ev-card:hover .ev-card__btn,
.ev-card:has(.ev-card__open:focus-visible) .ev-card__btn,
.ev-card__btn:hover {
    background-color: var(--ev-blue);
    color: #FFFFFF;
}

/* ---------- Bottom term links (Figma 5077:196) ---------- */
.ev-term-links {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 92px;
    margin-top: 64px;
}

.ev-term-links__item {
    color: var(--ev-muted);
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: color .2s ease;
}

.ev-term-links__item:hover,
.ev-term-links__item.is-active {
    color: var(--ev-blue);
}

/* ---------- Past events list (like sjc.vic.edu.au's event calendar) ---------- */
.ev-listing.is-past .ev-term-links {
    display: none;
}

.ev-past {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 48px;
    max-width: 1372px;
    margin: 72px auto 0;
}

.ev-past[hidden] {
    display: none;
}

.ev-past:focus {
    outline: none;
}

.ev-past__title {
    position: sticky;
    top: 40px;
    margin: 0;
    color: #000000;
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 64px;
    font-weight: 700;
    line-height: 1.1;
}

.ev-past__year {
    margin: 0 0 28px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ev-latte);
    color: var(--ev-blue);
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
}

.ev-past__item + .ev-past__year {
    margin-top: 24px;
}

.ev-past__item {
    margin-bottom: 44px;
    color: #767676;
    transition: color .2s ease;
}

.ev-past__date {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin: 0 0 6px;
    font-family: 'Atkinson Hyperlegible', sans-serif;
    line-height: 1;
}

.ev-past__date time {
    display: contents;
}

.ev-past__day {
    color: #949494;
    font-size: 72px;
    font-weight: 700;
    transition: color .2s ease;
}

.ev-past__month {
    color: #5B95F0;
    font-size: 36px;
    transition: color .2s ease;
}

.ev-past__name {
    margin: 0 0 14px;
    color: #767676;
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    transition: color .2s ease;
}

.ev-past__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 32px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    letter-spacing: .28px;
}

.ev-past__meta li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ev-past__meta img {
    width: 16px;
    height: 20px;
    object-fit: contain;
    opacity: .6;
}

.ev-past__term {
    padding: 3px 12px;
    border-radius: 20px;
    background-color: var(--ev-latte);
}

.ev-past__item:hover .ev-past__day,
.ev-past__item:hover .ev-past__name {
    color: var(--ev-ink);
}

.ev-past__item:hover .ev-past__month {
    color: var(--ev-blue);
}

/* ---------- Popup (Figma 2978:1641) ---------- */
/* style.css tints every .modal and general-page.css forces .modal-content navy: undo both here. */
.modal.ev-modal {
    background-color: transparent;
}

.ev-modal .modal-content.ev-modal__content {
    background: #FFFFFF !important;
}

.ev-modal .ev-modal__dialog {
    max-width: 1342px;
    width: calc(100% - 48px);
    margin-left: auto;
    margin-right: auto;
}

.ev-modal__content {
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 3.5rem);
    padding: 16px 16px 0;
    border: 0;
    border-radius: 27px;
    background-color: #FFFFFF;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .25);
    overflow: hidden;
}

.ev-modal__top {
    position: relative;
    flex: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 741px);
    gap: 24px;
    border-radius: 27px;
    background-color: var(--ev-latte);
}

.ev-modal__intro {
    align-self: center;
    padding: 44px 24px 22px 42px;
}

.ev-modal__line {
    display: block;
    width: 164px;
    height: 5px;
    margin-bottom: 26px;
}

.ev-modal__eyebrow {
    margin: 0 0 10px;
    color: var(--ev-ink);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    line-height: 1.25;
}

.ev-modal__title {
    margin: 0 0 28px;
    color: var(--ev-ink);
    font-family: 'Atkinson Hyperlegible', sans-serif;
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.ev-modal__meta {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.ev-modal__meta li {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0 0 14px;
    color: var(--ev-text);
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    line-height: 1.3;
    letter-spacing: .28px;
}

.ev-modal__meta img {
    flex: none;
    width: 16px;
    height: 20px;
    object-fit: contain;
}

/* Popup Note (field popupNote), e.g. FREE EVENT: always shown in capitals as in the design. */
.ev-modal__note {
    margin: 0;
    padding-left: 5px;
    color: #000000;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .28px;
    text-transform: uppercase;
}

.ev-modal__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 741 / 467;
    border-radius: 19px;
    background-color: #D9D9D9;
}

.ev-modal__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ev-modal__date {
    left: 33px;
    bottom: 33px;
    gap: 26px;
    font-size: 36.76px;
    text-shadow: 0 7.35px 44.11px rgba(0, 0, 0, .25);
}

.ev-modal__date img {
    width: 58px;
    height: 58px;
}

.ev-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 58px;
    height: 58px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: #FFFFFF;
    box-shadow: 0 0 13.33px rgba(0, 0, 0, .15);
    cursor: pointer;
    transition: background-color .2s ease;
}

.ev-modal__close::before,
.ev-modal__close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 25.8px;
    height: 2px;
    border-radius: 2px;
    background-color: var(--ev-navy);
    transform: translate(-50%, -50%) rotate(45deg);
}

.ev-modal__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.ev-modal__close:hover,
.ev-modal__close:focus-visible {
    background-color: #FDB927;
}

.ev-modal__close:focus-visible {
    outline: 3px solid var(--ev-blue);
    outline-offset: 2px;
}

/* Scrolling area under the top panel, with the slim grey bar from the design. */
.ev-modal__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 24px 0 56px;
    margin-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: #D9D9D9 rgba(217, 217, 217, .45);
}

.ev-modal__scroll::-webkit-scrollbar {
    width: 7px;
}

.ev-modal__scroll::-webkit-scrollbar-track {
    border-radius: 100px;
    background: rgba(217, 217, 217, .45);
}

.ev-modal__scroll::-webkit-scrollbar-thumb {
    border-radius: 100px;
    background: #D9D9D9;
}

.ev-modal__actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 741px);
    gap: 24px;
    align-items: center;
    margin-bottom: 40px;
}

.ev-modal__btn,
.ev-modal__btn:visited {
    background-color: var(--ev-blue);
    color: #FFFFFF;
}

.ev-modal__btn {
    grid-column: 2;
    justify-self: start;
    width: auto;
    min-width: 211px;
    margin-left: 28px;
}

/* Hover: site yellow, same as .tile-btn and the popup close button. */
.ev-modal__btn:hover,
.ev-modal__btn:focus-visible {
    background-color: #FDB927;
    color: #000000;
}

.ev-modal__body.full-text-editor {
    width: auto;
    max-width: 812px;
    margin: 0 auto;
    padding: 0 16px;
    color: #000000;
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.476;
    letter-spacing: .48px;
}

.ev-modal__body.full-text-editor p {
    font-size: inherit;
    line-height: inherit;
}

.ev-modal__body.full-text-editor h1 {
    left: 0;
}

.ev-modal__body.full-text-editor img {
    max-width: 100%;
    height: auto;
}

/* ---------- Add to Calendar (AddEvent widget, restyled to the design) ---------- */
.ev-atc {
    grid-column: 1;
    padding-left: 58px;
}

.ev-atc .addeventatc {
    display: inline-flex !important;
    align-items: center;
    gap: 14px;
    padding: 4px 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    color: var(--ev-text) !important;
    font-family: 'Manrope', sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    letter-spacing: .28px;
    line-height: 1 !important;
    text-transform: uppercase;
    z-index: 5 !important;
}

.ev-atc .addeventatc:hover,
.ev-atc .addeventatc:focus-visible,
.ev-atc .addeventatc.addeventatc-selected {
    background: none !important;
    color: var(--ev-blue) !important;
    text-decoration: underline;
}

.ev-atc .addeventatc > img {
    width: 36px;
    height: 36px;
}

.ev-atc .addeventatc .addeventatc_icon,
.ev-atc .addeventatc .start,
.ev-atc .addeventatc .end,
.ev-atc .addeventatc .timezone,
.ev-atc .addeventatc .title,
.ev-atc .addeventatc .description,
.ev-atc .addeventatc .location,
.ev-atc .addeventatc .all_day_event {
    display: none !important;
}

.ev-atc .addeventatc_dropdown {
    text-transform: none;
}

/* ---------- Motion (page load, tab switch, scroll reveal, popup) ----------
   events.js adds .ev-js to the listing and .is-revealed to [data-ev-reveal] elements as they come into view
   (again whenever a tab or the Past view is shown); --ev-i staggers siblings. Nothing moves for visitors who
   prefer reduced motion, and without JS everything is simply visible. */
@keyframes ev-rise {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: none; }
}

@keyframes ev-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ev-drift-in {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: none; }
}

@keyframes ev-tab-in {
    from { opacity: .4; transform: scaleY(.55); }
    to { opacity: 1; transform: none; }
}

@keyframes ev-settle {
    from { transform: scale(1.08); }
    to { transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
    .ev-js [data-ev-reveal]:not(.is-revealed) {
        opacity: 0;
    }

    /* fill-mode backwards: once finished, normal styles (e.g. card hover lift) take over again */
    .ev-js [data-ev-reveal].is-revealed {
        animation: ev-rise .8s cubic-bezier(.22, .61, .36, 1) backwards;
        animation-delay: calc(var(--ev-i, 0) * 90ms);
    }

    .ev-js .ev-past__title.is-revealed {
        animation-name: ev-drift-in;
    }

    /* Tab bar and stripes on page load */
    .ev-js .ev-tabs__inner {
        animation: ev-rise .8s .1s cubic-bezier(.22, .61, .36, 1) backwards;
    }

    .ev-js.ev-listing::after {
        animation: ev-drift-in 1.6s .35s cubic-bezier(.22, .61, .36, 1) backwards;
    }

    /* Active tab grows up from the bar each time it changes */
    .ev-tabs__tab.is-active {
        transform-origin: 50% 100%;
        animation: ev-tab-in .45s cubic-bezier(.22, .61, .36, 1);
    }

    .ev-tabs__tab {
        transition: color .25s ease;
    }

    /* Popup: dialog scales in, image settles, intro lines rise one by one */
    .ev-modal.fade .modal-dialog {
        transform: translateY(24px) scale(.96);
        transition: transform .5s cubic-bezier(.22, .61, .36, 1);
    }

    .ev-modal.show .modal-dialog {
        transform: none;
    }

    .ev-modal.show .ev-modal__img {
        animation: ev-settle 1.4s cubic-bezier(.22, .61, .36, 1) both;
    }

    .ev-modal.show .ev-modal__intro > *,
    .ev-modal.show .ev-modal__date,
    .ev-modal.show .ev-modal__actions,
    .ev-modal.show .ev-modal__body {
        animation: ev-rise .7s cubic-bezier(.22, .61, .36, 1) backwards;
    }

    .ev-modal.show .ev-modal__intro > :nth-child(1) { animation-delay: .12s; }
    .ev-modal.show .ev-modal__intro > :nth-child(2) { animation-delay: .18s; }
    .ev-modal.show .ev-modal__intro > :nth-child(3) { animation-delay: .24s; }
    .ev-modal.show .ev-modal__intro > :nth-child(4) { animation-delay: .30s; }
    .ev-modal.show .ev-modal__intro > :nth-child(5) { animation-delay: .36s; }
    .ev-modal.show .ev-modal__date { animation-delay: .35s; }
    .ev-modal.show .ev-modal__actions { animation-delay: .42s; }
    .ev-modal.show .ev-modal__body { animation-delay: .5s; }

    .ev-modal__close {
        transition: background-color .2s ease, transform .3s cubic-bezier(.22, .61, .36, 1);
    }

    .ev-modal__close:hover {
        transform: rotate(90deg);
    }
}

/* ---------- Responsive ---------- */
@media only screen and (max-width: 1440px) {
    .ev-grid {
        grid-template-columns: repeat(3, minmax(0, 315px));
    }

    .ev-tabs__switch {
        position: static;
        flex: none;
        margin-right: auto;
        padding-bottom: 26px;
        align-self: center;
    }

    .ev-tabs__inner {
        justify-content: space-between;
        gap: 24px;
    }

    .ev-tabs__list {
        margin-right: auto;
    }
}

@media only screen and (max-width: 1199px) {
    .ev-listing::after {
        display: none;
    }

    .ev-tabs__tab {
        min-width: 150px;
        font-size: 26px;
    }

    .ev-tabs__tab.is-active {
        min-width: 200px;
    }

    .ev-modal__title {
        font-size: 40px;
    }
}

@media only screen and (max-width: 1023px) {
    .ev-grid {
        grid-template-columns: repeat(2, minmax(0, 315px));
    }

    .ev-tabs__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 12px 0 0;
    }

    .ev-tabs__switch {
        align-self: center;
        margin: 0;
        padding-bottom: 0;
    }

    /* Tabs scroll sideways on narrow screens. */
    .ev-tabs__list {
        margin: 0;
        padding: 0 var(--ev-flare);
        overflow-x: auto;
        scrollbar-width: none;
        justify-content: flex-start;
    }

    .ev-tabs__list::-webkit-scrollbar {
        display: none;
    }

    .ev-tabs__tab {
        flex: none;
        min-width: 0;
        height: 66px;
        padding: 0 22px 6px;
        font-size: 22px;
    }

    .ev-tabs__tab.is-active {
        min-width: 140px;
    }

    .ev-modal__top,
    .ev-modal__actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .ev-modal__media {
        order: -1;
    }

    .ev-modal__intro {
        padding: 24px 24px 28px;
    }

    .ev-modal__title {
        font-size: 34px;
    }

    .ev-modal__actions {
        gap: 20px;
        padding: 0 24px;
        justify-items: start;
    }

    .ev-atc {
        padding-left: 0;
    }

    .ev-modal__btn {
        grid-column: 1;
        margin-left: 0;
    }

    /* The whole popup scrolls on tablets and phones. */
    .ev-modal__content {
        overflow-y: auto;
    }

    .ev-modal__scroll {
        overflow: visible;
        margin-right: 0;
    }
}

@media only screen and (max-width: 767px) {
    .ev-listing {
        padding-bottom: 4em;
    }

    .ev-listing__body {
        padding: 0 16px;
    }

    .ev-panel__heading {
        margin: 40px 0 28px;
        font-size: 32px;
    }

    .ev-grid {
        grid-template-columns: minmax(0, 360px);
        gap: 28px;
    }

    .ev-card {
        min-height: 0;
    }

    .ev-card__title {
        margin: 28px 0 22px;
        font-size: 26px;
    }

    .ev-term-links {
        gap: 12px 32px;
        margin-top: 44px;
    }

    .ev-term-links__item {
        font-size: 22px;
    }

    .ev-past {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
        margin-top: 40px;
    }

    .ev-past__title {
        position: static;
        font-size: 40px;
    }

    .ev-past__day {
        font-size: 52px;
    }

    .ev-past__month {
        font-size: 26px;
    }

    .ev-past__name {
        font-size: 22px;
    }

    .ev-modal .ev-modal__dialog {
        width: calc(100% - 24px);
    }

    .ev-modal__content {
        padding: 10px 10px 0;
        border-radius: 20px;
    }

    .ev-modal__top {
        border-radius: 20px;
    }

    .ev-modal__title {
        font-size: 28px;
    }

    .ev-modal__date {
        left: 16px;
        bottom: 16px;
        gap: 12px;
        font-size: 22px;
    }

    .ev-modal__date img {
        width: 37px;
        height: 37px;
    }

    .ev-modal__close {
        top: 10px;
        right: 10px;
        width: 46px;
        height: 46px;
    }

    .ev-modal__close::before,
    .ev-modal__close::after {
        width: 20px;
    }

    .ev-modal__body.full-text-editor {
        padding: 0 14px;
    }
}
