.home-calendar {
    position: relative;
}

.calendar-card {
    position: absolute;
    right: 0;
    bottom: 60px;
    z-index: 2;
    display: flex;
    width: 431px;
    max-width: 100%;
    background: #fff;
    color: #000650;
}

.calendar-card:hover {
    color: #000650;
}

.calendar-card__preview {
    flex: 0 0 170px;
    height: 132px;
    object-fit: fill;
}

.calendar-card__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    min-width: 0;
    padding: 30px;
}

.calendar-card__place {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #135eab;
    font-size: 13px;
    line-height: 16px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.calendar-card__title {
    display: flex;
    align-items: flex-end;
    font-size: 20px;
    line-height: 24px;
}

.calendar-card__title img {
    flex: none;
}

.calendar-card:focus-visible,
.calendar-dialog__actions :is(a, button):focus-visible {
    outline: 2px solid #135eab;
    outline-offset: 3px;
}

html:has(.calendar-dialog[open]) {
    overflow: hidden;
}

.calendar-dialog {
    position: fixed;
    inset: 0;
    width: min(1240px, calc(100% - 32px));
    height: min(860px, calc(100% - 32px));
    max-width: none;
    max-height: none;
    margin: auto;
    padding: 0;
    border: 0;
    background: #fff;
    color: #000650;
    box-shadow: 0 24px 60px rgba(0, 6, 80, .35);
}

.calendar-dialog[open] {
    display: flex;
    flex-direction: column;
}

.calendar-dialog:not([open]) {
    display: none;
}

.calendar-dialog::backdrop {
    background: rgba(0, 6, 80, .25);
}

@media (prefers-reduced-motion: no-preference) {
    .calendar-dialog[open] {
        animation: calendar-appear 180ms ease-out;
    }

    .calendar-dialog[open]::backdrop {
        animation: calendar-backdrop-appear 180ms ease-out;
    }
}

@keyframes calendar-appear {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes calendar-backdrop-appear {
    from { opacity: 0; }
    to { opacity: 1; }
}

.calendar-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 30px 32px 30px 40px;
    border-bottom: 1px solid #e1e3e8;
}

.calendar-dialog .calendar-dialog__title {
    margin: 0;
    font-size: 32px !important;
    line-height: 38px;
    letter-spacing: -.02em;
}

.calendar-dialog__subtitle,
.calendar-dialog__notice-text {
    color: #707070;
    font-size: 16px;
    line-height: 20px;
}

.calendar-dialog__actions {
    display: flex;
    flex: none;
    gap: 12px;
}

.calendar-dialog__download,
.calendar-dialog__close {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
}

.calendar-dialog__download {
    gap: 10px;
    padding: 0 26px 0 24px;
    background: #135eab;
    color: #fff;
    font-size: 14px;
    line-height: 20px;
    text-transform: uppercase;
}

.calendar-dialog__download:hover {
    background: #000650;
    color: #fff;
}

.calendar-dialog__close {
    width: 50px;
    padding: 0;
    border: 1px solid #e1e3e8;
    background: #fff;
    cursor: pointer;
}

.calendar-dialog__close:hover {
    background: #f7f7f8;
}

.calendar-dialog__pages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 32px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 40px;
    background: #f7f7f8;
}

.calendar-dialog__notice:not([hidden]) {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 24px;
    border-left: 4px solid #135eab;
    background: #fff;
}

.calendar-dialog__notice-title {
    margin-bottom: 4px;
    font-size: 18px;
    line-height: 26px;
}

.calendar-dialog__page {
    flex: none;
    width: 100%;
    height: auto;
    box-shadow: 0 6px 20px rgba(0, 6, 80, .12);
}

@media (max-width: 767px), (max-height: 580px) {
    .calendar-card {
        position: relative;
        bottom: auto;
        margin-left: auto;
    }

    .calendar-dialog__header {
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px;
    }

    .calendar-dialog .calendar-dialog__title {
        font-size: 24px !important;
        line-height: 28px;
    }

    .calendar-dialog__actions {
        max-width: 100%;
        gap: 8px;
    }

    .calendar-dialog__download {
        padding: 0 12px;
    }

    .calendar-dialog__pages {
        gap: 16px;
        padding: 16px;
    }
}

@media (max-width: 431px) {
    .calendar-card__preview {
        flex-basis: 39%;
        width: 39%;
        object-fit: cover;
    }

    .calendar-card__content {
        padding: 16px;
    }
}
