/* ===== Popup by timer: --toast (corner card) | --modal (centred card) ===== */
.hm-ptimer { font-family: var(--hm-font-body); }
.hm-ptimer[hidden] { display: none; }

.hm-ptimer__card {
    position: relative;
    background: var(--hm-c-bg);
    color: var(--hm-c-text);
    box-shadow: 0 16px 44px rgba(0, 0, 0, .22);
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .35s var(--hm-ease), transform .45s var(--hm-ease);
}
.hm-ptimer.is-open .hm-ptimer__card { opacity: 1; transform: none; }

.hm-ptimer__close {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--hm-c-muted);
    cursor: pointer;
    transition: color .2s, background-color .2s;
}
.hm-ptimer__close:hover { color: var(--hm-c-text); background: rgba(0, 0, 0, .06); }
.hm-ptimer__close svg { width: 20px; height: 20px; }

.hm-ptimer__media { overflow: hidden; background: var(--hm-c-alt); }
.hm-ptimer__img { width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50% 50%); }
.hm-ptimer__body { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.hm-ptimer__date {
    order: 1;
    margin: 4px 0 0;
    color: var(--hm-c-muted);
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.hm-ptimer__title {
    margin: 0;
    font-family: var(--hm-font-head);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}
.hm-ptimer__text { order: 2; margin: 12px 0 0; font-size: 14px; }
.hm-ptimer__link {
    order: 3;
    margin-top: 8px;
    color: var(--hm-c-accent);
    font-weight: 600;
}
.hm-ptimer__link:hover { color: var(--hm-c-accent-hover); }

/* ---------- Toast: small card bottom-left, non-modal ---------- */
.hm-ptimer--toast {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 200;
    width: min(380px, calc(100% - 48px));
}
.hm-ptimer--toast .hm-ptimer__backdrop { display: none; }
.hm-ptimer--toast .hm-ptimer__card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 12px 40px 12px 12px;
    border-radius: calc(var(--hm-radius-card) * .75);
}
.hm-ptimer--toast .hm-ptimer__media { aspect-ratio: 1; border-radius: calc(var(--hm-radius-card) * .5); }
.hm-ptimer--toast .hm-ptimer__text { display: none; }

/* ---------- Modal: centred card with backdrop ---------- */
.hm-ptimer--modal {
    position: fixed;
    inset: 0;
    z-index: 230;
    display: grid;
    place-items: center;
    padding: 24px;
}
.hm-ptimer--modal[hidden] { display: none; }
.hm-ptimer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    transition: opacity .3s var(--hm-ease);
}
.hm-ptimer.is-open .hm-ptimer__backdrop { opacity: 1; }
.hm-ptimer--modal .hm-ptimer__card {
    width: min(460px, 100%);
    max-height: calc(100svh - 48px);
    overflow-y: auto;
    border-radius: var(--hm-radius-card);
}
.hm-ptimer--modal .hm-ptimer__close { top: 12px; right: 12px; width: 38px; height: 38px; background: rgba(255, 255, 255, .92); color: var(--hm-c-text); }
.hm-ptimer--modal .hm-ptimer__media { aspect-ratio: 16 / 10; }
.hm-ptimer--modal .hm-ptimer__body { padding: 24px 28px 28px; }
.hm-ptimer--modal .hm-ptimer__title { font-size: var(--hm-fs-h3); }
.hm-ptimer--modal .hm-ptimer__link { margin-top: 18px; font-size: 14px; }

/* ---------- Mobile: toast sits above the fixed mobile bar ---------- */
@media (max-width: 767px) {
    .hm-ptimer--toast {
        left: 12px;
        right: 12px;
        bottom: calc(var(--hm-mbar-h, 64px) + env(safe-area-inset-bottom, 0px) + 12px);
        width: auto;
    }
    .hm-ptimer--toast .hm-ptimer__card { grid-template-columns: 76px minmax(0, 1fr); gap: 14px; padding: 10px 40px 10px 10px; }
    .hm-ptimer--modal { padding: 16px; }
}
