.fo-events,
.fo-event-details {
    --fo-events-accent: #0061a5;
    --fo-events-border: #e2e5e9;
    --fo-events-muted: #5d6470;
    box-sizing: border-box;
}

.fo-events *,
.fo-event-details * {
    box-sizing: border-box;
}

.fo-events-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(200px, 320px)) auto;
    gap: 16px;
    align-items: end;
    margin: 0 0 28px;
    padding: 18px 0;
    background: #fff;
    border-top: 1px solid var(--fo-events-border);
    border-bottom: 1px solid var(--fo-events-border);
}

.fo-events-filter label,
.fo-event-fields label {
    display: grid;
    gap: 5px;
    font-weight: 600;
}

.fo-events-filter select,
.fo-events-filter button,
.fo-event-fields select,
.fo-event-fields input {
    min-height: 48px;
    width: 100%;
}

.fo-events-filter select {
    padding: 0 42px 0 14px;
    color: #20262d;
    background-color: #fff;
    border: 1px solid #aeb5bd;
    border-radius: 4px;
}

.fo-events-filter button {
    min-width: 112px;
    padding: 0 24px;
    color: #fff;
    background: var(--fo-events-accent);
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
}

.fo-events-filter button:hover,
.fo-events-filter button:focus-visible {
    background: #004f89;
}

.fo-events__grid {
    display: grid;
    grid-template-columns: repeat(var(--fo-events-columns, 3), minmax(0, 1fr));
    gap: 24px;
}

.fo-event-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    margin: 0;
    background: #fff;
    border: 1px solid var(--fo-events-border);
    border-radius: 8px;
    box-shadow: 0 7px 22px rgba(20, 27, 36, .07);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.fo-event-card:hover,
.fo-event-card:focus-within {
    transform: translateY(-3px);
    border-color: rgba(0, 97, 165, .32);
    box-shadow: 0 13px 30px rgba(20, 27, 36, .13);
}

.fo-event-card__image {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #eef0f3;
}

.fo-event-card__image img,
.fo-event-row__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fo-event-card__image img {
    transition: transform .35s ease;
}

.fo-event-card:hover .fo-event-card__image img,
.fo-event-card:focus-within .fo-event-card__image img {
    transform: scale(1.035);
}

.fo-event-card__placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #eceff2, #dfe3e8);
}

.fo-event-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 0 18px 18px;
}

.fo-event-card__date {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-self: flex-start;
    margin: -17px 0 14px;
    padding: 7px 10px;
    color: #fff;
    background: var(--fo-events-accent);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 97, 165, .24);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .035em;
    line-height: 1.2;
    text-transform: uppercase;
}

.fo-event-card__title,
.fo-event-row h3 {
    margin: 0 0 18px;
    font-size: 1.12rem;
    line-height: 1.32;
}

.fo-event-card__title a,
.fo-event-row h3 a {
    color: #20242a !important;
    text-decoration: none;
}

.fo-event-card__title a:hover,
.fo-event-card__title a:focus,
.fo-event-row h3 a:hover,
.fo-event-row h3 a:focus {
    color: var(--fo-events-accent) !important;
}

.fo-event-card__location,
.fo-event-row p {
    margin: 0;
    color: var(--fo-events-muted);
}

.fo-event-card__location {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 13px;
    border-top: 1px solid #edf0f3;
    font-size: .92rem;
    line-height: 1.4;
}

.fo-event-card__location::before {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    background: var(--fo-events-accent);
    border-radius: 50%;
    content: "";
}

.fo-event-row {
    display: grid;
    grid-template-columns: 72px 130px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid var(--fo-events-border);
}

.fo-event-row__date {
    text-align: center;
    color: var(--fo-events-accent);
    font-weight: 700;
    text-transform: uppercase;
}

.fo-event-row__date span {
    display: block;
    font-size: 2rem;
    line-height: 1;
}

.fo-event-row__image {
    display: block;
    aspect-ratio: 4 / 3;
}

.fo-events__pagination ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

.fo-events__pagination a,
.fo-events__pagination span {
    display: block;
    min-width: 38px;
    padding: 8px 12px;
    text-align: center;
    border: 1px solid var(--fo-events-border);
    text-decoration: none;
}

.fo-events__pagination .current {
    color: #fff;
    background: var(--fo-events-accent);
    border-color: var(--fo-events-accent);
}

.fo-event-details {
    overflow: hidden;
    margin: 24px 0 32px;
    padding: 0;
    color: #20242a;
    background: #fff;
    border: 1px solid var(--fo-events-border);
    border-left: 4px solid var(--fo-events-accent);
    border-radius: 4px;
    box-shadow: 0 5px 18px rgba(20, 27, 36, .06);
}

.fo-event-details__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 0;
}

.fo-event-details__row {
    display: grid;
    grid-template-columns: minmax(82px, 105px) minmax(0, 1fr);
    gap: 14px;
    align-items: baseline;
    margin: 0;
    padding: 18px 20px;
    list-style: none;
}

.fo-event-details__row--paired {
    border-right: 1px solid #edf0f3;
}

.fo-event-details__row--full,
.fo-event-details__row--wide {
    grid-column: 1 / -1;
}

.fo-event-details__row--wide {
    border-top: 1px solid #edf0f3;
}

.fo-event-details__label {
    color: var(--fo-events-accent);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .07em;
    line-height: 1.4;
    text-transform: uppercase;
}

.fo-event-details__value {
    color: #20242a;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
}

.fo-event-details__value small {
    display: block;
    margin-top: 2px;
    color: var(--fo-events-muted);
    font-size: .9rem;
    font-weight: 400;
}

.fo-events-admin__table {
    max-width: 800px;
    margin: 20px 0 30px;
}

.fo-events-admin__table th {
    width: 300px;
}

.fo-events-admin__preview {
    max-width: 900px;
}

.fo-event-fields__row {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 14px;
}

@media (max-width: 900px) {
    .fo-events-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fo-events__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .fo-event-details__grid {
        grid-template-columns: 1fr;
    }

    .fo-event-details__row,
    .fo-event-details__row--full,
    .fo-event-details__row--wide {
        grid-column: auto;
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 14px 16px;
        border: 0;
        border-bottom: 1px solid #edf0f3;
    }

    .fo-event-details__row:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 600px) {
    .fo-events-filter,
    .fo-events__grid,
    .fo-event-fields__row {
        grid-template-columns: 1fr;
    }

    .fo-event-row {
        grid-template-columns: 58px 88px minmax(0, 1fr);
        gap: 10px;
    }

}

@media (prefers-reduced-motion: reduce) {
    .fo-event-card,
    .fo-event-card__image img {
        transition: none;
    }
}
