.hob-newsletter-popup {
    position: fixed;
    inset: 0;
    z-index: var(--hob-z-popup);
    display: grid;
    place-items: center;
    padding:
        max(16px, env(safe-area-inset-top, 0px))
        max(16px, env(safe-area-inset-right, 0px))
        max(16px, env(safe-area-inset-bottom, 0px))
        max(16px, env(safe-area-inset-left, 0px));
    pointer-events: none;
    visibility: hidden;
}

.hob-newsletter-popup.hob-newsletter-popup--open {
    pointer-events: auto;
    visibility: visible;
}

.hob-newsletter-popup__overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    border: 0;
    background: rgba(12, 32, 48, .26);
    opacity: 0;
    transition: opacity var(--hob-transition-base);
}

@supports ((-webkit-backdrop-filter: blur(2px)) or (backdrop-filter: blur(2px))) {
    .hob-newsletter-popup__overlay {
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
    }
}

.hob-newsletter-popup.hob-newsletter-popup--open .hob-newsletter-popup__overlay {
    opacity: 1;
}

.hob-newsletter-popup__dialog {
    position: relative;
    width: min(960px, 100%);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    display: grid;
    grid-template-columns: minmax(0, 46%) minmax(0, 54%);
    overflow: auto;
    border: 1px solid rgba(12, 32, 48, .16);
    border-radius: 0;
    background: #f8f3f0;
    color: #0c2030;
    box-shadow: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--hob-transition-base), transform var(--hob-transition-base);
}

.hob-newsletter-popup.hob-newsletter-popup--open .hob-newsletter-popup__dialog {
    opacity: 1;
    transform: translateY(0);
}

.hob-newsletter-popup__media {
    position: relative;
    min-width: 0;
    min-height: 520px;
    overflow: hidden;
    background: #ded8d2;
}

.hob-newsletter-popup__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100% !important;
    max-width: none;
    display: block;
    object-fit: cover;
    object-position: 54% 52%;
    transform: scale(1.02);
    transition: transform 700ms ease;
}

.hob-newsletter-popup--open .hob-newsletter-popup__image {
    transform: scale(1);
}

.hob-newsletter-popup__content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: clamp(56px, 5vw, 72px);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 420ms ease 80ms, transform 420ms ease 80ms;
}

.hob-newsletter-popup--open .hob-newsletter-popup__content {
    opacity: 1;
    transform: translateY(0);
}

.hob-newsletter-popup__title {
    max-width: 15ch;
    margin: 0;
    color: #0c2030;
    font-family: "HOB Editorial", serif;
    font-size: clamp(2rem, 2.65vw, 2.375rem);
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.08;
    text-wrap: balance;
}

.hob-newsletter-popup__text {
    max-width: 38ch;
    margin: 22px 0 0;
    color: rgba(12, 32, 48, .78);
    font-family: var(--hob-body-font);
    font-size: clamp(.9375rem, 1vw, 1rem);
    line-height: 1.7;
}

.hob-newsletter-popup__form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-top: 34px;
}

.hob-newsletter-popup__input,
.hob-newsletter-popup__submit {
    width: 100%;
    min-width: 0;
    min-height: 52px;
    border-radius: 0;
    box-shadow: none;
    font-family: var(--hob-body-font);
    font-size: .875rem;
    line-height: 1.2;
}

.hob-newsletter-popup__input {
    padding: 0 18px;
    border: 1px solid rgba(12, 32, 48, .42);
    background: rgba(255, 255, 255, .42);
    color: #0c2030;
}

.hob-newsletter-popup__input::placeholder {
    color: rgba(12, 32, 48, .56);
    opacity: 1;
}

.hob-newsletter-popup__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    border: 1px solid #0c2030;
    background: #0c2030;
    color: #ffffff;
    font-weight: 500;
    letter-spacing: .025em;
    text-align: center;
    transition: background-color var(--hob-transition-fast), color var(--hob-transition-fast);
}

.hob-newsletter-popup__submit:not(:disabled):hover {
    background: transparent;
    color: #0c2030;
}

.hob-newsletter-popup__submit:disabled {
    cursor: default;
    opacity: 1;
}

.hob-newsletter-popup__input:focus-visible,
.hob-newsletter-popup__submit:focus-visible,
.hob-newsletter-popup__close:focus-visible {
    outline: 2px solid #0c2030;
    outline-offset: 3px;
}

.hob-newsletter-popup__legal {
    margin: 18px 0 0;
    color: rgba(12, 32, 48, .64);
    font-family: var(--hob-body-font);
    font-size: .75rem;
    line-height: 1.55;
}

.hob-newsletter-popup__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(12, 32, 48, .2);
    border-radius: 0;
    background: rgba(248, 243, 240, .9);
    color: #0c2030;
    font-size: 1.6rem;
    line-height: 1;
    transition: background-color var(--hob-transition-fast), color var(--hob-transition-fast);
}

.hob-newsletter-popup__close:hover {
    background: #0c2030;
    color: #ffffff;
}

.hob-newsletter-popup__close span[aria-hidden="true"] {
    display: none;
}

.hob-newsletter-popup__close::before,
.hob-newsletter-popup__close::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 1px;
    background: currentColor;
    content: "";
    transform-origin: center;
}

.hob-newsletter-popup__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.hob-newsletter-popup__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.hob-newsletter-popup-is-open {
    overflow: hidden;
}

.hob-newsletter-popup--without-image .hob-newsletter-popup__dialog {
    width: min(560px, 100%);
    grid-template-columns: minmax(0, 1fr);
}

.hob-newsletter-popup--without-image .hob-newsletter-popup__media {
    display: none;
}

@media (max-width: 640px) {
    .hob-newsletter-popup {
        padding:
            max(12px, env(safe-area-inset-top, 0px))
            max(12px, env(safe-area-inset-right, 0px))
            max(12px, env(safe-area-inset-bottom, 0px))
            max(12px, env(safe-area-inset-left, 0px));
    }

    .hob-newsletter-popup__dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        grid-template-columns: minmax(0, 1fr);
    }

    .hob-newsletter-popup__media {
        min-height: 0;
        aspect-ratio: 4 / 3;
    }

    .hob-newsletter-popup__content {
        padding: 32px 20px 36px;
    }

    .hob-newsletter-popup__title {
        padding-right: 42px;
        font-size: clamp(1.875rem, 8.5vw, 2.125rem);
    }

    .hob-newsletter-popup__text {
        margin-top: 18px;
    }

    .hob-newsletter-popup__form {
        margin-top: 28px;
    }

    .hob-newsletter-popup__close {
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hob-newsletter-popup__overlay,
    .hob-newsletter-popup__dialog,
    .hob-newsletter-popup__image,
    .hob-newsletter-popup__content,
    .hob-newsletter-popup__submit,
    .hob-newsletter-popup__close {
        transition: none;
    }
}
