/* ABOUTME: Rust heart control on community and listing cards. */
/* ABOUTME: Mirrors .hub-home-card__heart in hub/style.css, the source of truth for this control. */

.community-card__favorite,
.rent-card__favorite {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: none;
    border: 0;
    color: var(--hoa-rust, #c4684e);
    cursor: pointer;
}

.community-card__favorite .material-symbols-outlined,
.rent-card__favorite .material-symbols-outlined {
    font-size: 20px;
    color: inherit;
    font-variation-settings: 'FILL' 1;
    -webkit-text-stroke: 1px #fff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
    transition: transform 0.15s ease;
}

.community-card__favorite:hover .material-symbols-outlined,
.rent-card__favorite:hover .material-symbols-outlined {
    transform: scale(1.08);
}

/* Unsaved: a white outline that reads as empty on a photo; no keyline, the drop shadow carries it. */
.community-card__favorite:not(.is-saved) .material-symbols-outlined,
.rent-card__favorite:not(.is-saved) .material-symbols-outlined {
    font-variation-settings: 'FILL' 0;
    color: #fff;
    -webkit-text-stroke: 0;
}

/* Over the photo on a listing card, placed as the Hub places its own. */
.rent-card__favorite {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
}

/* -6px cancels the tap target's padding so the glyph meets the card's 24px content edge. */
.community-card__favorite {
    margin-left: auto;
    margin-right: -6px;
    flex-shrink: 0;
}

/* On a stacked card the heart moves onto the photo: its white outline is drawn for one. */
@media (max-width: 1024px) {
    .community-card {
        position: relative;
    }

    .community-card__favorite {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        z-index: 2;
        margin: 0;
    }
}

/* Disabled only blocks a second POST; the heart already shows the new state, so no grey-out. */
.community-card__favorite:disabled,
.rent-card__favorite:disabled {
    cursor: pointer;
}

/* ------------------------------------------------- heart on a plain page -- */

/* Detail pages and the stacking-plan popup: a rust outline, filled once saved. */
.hub-heart,
.listing-content__heart {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: none;
    border: 0;
    color: var(--hoa-rust, #c4684e);
    cursor: pointer;
    flex-shrink: 0;
}

/* !important beats global.css's dark-blue .material-symbols-outlined rule; rust is set on the icon. */
.hub-heart .material-symbols-outlined,
.listing-content__heart .material-symbols-outlined {
    font-size: 24px;
    color: var(--hoa-rust, #c4684e) !important;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24 !important;
    -webkit-text-stroke: 1px var(--hoa-rust, #c4684e);
    transition: transform 0.15s ease;
}

.hub-heart.is-saved .material-symbols-outlined,
.listing-content__heart.is-saved .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24 !important;
    -webkit-text-stroke: 0;
}

.hub-heart:hover .material-symbols-outlined,
.listing-content__heart:hover .material-symbols-outlined {
    transform: scale(1.08);
}

/* A popup or drawer title with its heart beside it. */
.hub-heart-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

/* ---------------------------------------------------- follow confirmation -- */

/* Follow confirmation for pages outside the Hub; mirrors .hub-toast. */
.hub-flash {
    position: fixed;
    right: 24px;
    bottom: 24px;
    /* Above the email popup and the map/stacking-plan drawer (9999). */
    z-index: 10001;
    box-sizing: border-box;
    max-width: min(420px, calc(100vw - 48px));
    min-height: 54px;
    display: flex;
    align-items: flex-start;
    padding: 15px 24px 17px 13px;
    border-radius: 10px;
    box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.15);
    background-color: #181d24;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.hub-flash.is-in {
    opacity: 1;
    transform: translateY(0);
}

/* The 1px pushes the glyph off centre onto the first line's optical middle. */
.hub-flash__icon {
    flex-shrink: 0;
    margin-top: 1px;
    margin-right: 10px;
    width: 20px;
    height: 20px;
    color: #e3e3e3;
}

.hub-flash__message {
    position: relative;
    top: 1px;
    font-family: "Raleway", sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    color: #fff;
}

/* Sits in the sentence rather than beside it, so a wrapped message cannot
   leave it stranded on a line of its own. */
.hub-flash__action {
    margin-left: 17px;
    font-size: 16px;
    font-weight: 800;
    color: #c4684e;
    text-decoration: none;
    white-space: nowrap;
}

.hub-flash__action:hover {
    text-decoration: underline;
}

/* Same Undo as the Hub's own toast (.hub-toast__undo). */
.hub-flash__undo {
    flex-shrink: 0;
    margin-left: 17px;
    padding: 0;
    background: none;
    border: 0;
    font-family: "Raleway", sans-serif;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.4;
    color: #c4684e;
    cursor: pointer;
}

.hub-flash__close {
    flex-shrink: 0;
    margin-left: 38px;
    margin-top: 6px;
    position: relative;
    top: 1px;
    padding: 0;
    display: grid;
    place-items: center;
    background: none;
    border: 0;
    color: #fff;
    cursor: pointer;
}

.hub-flash__close-icon {
    display: block;
    width: 10px;
    height: 10px;
}

@media (max-width: 1024px) {
    .hub-flash {
        left: 16px;
        right: 16px;
        bottom: 16px;
        width: fit-content;
        max-width: calc(100vw - 32px);
        align-items: center;
        margin-inline: auto;
        padding-right: 16px;
    }

    .hub-flash__message {
        white-space: nowrap;
    }

    .hub-flash__action {
        margin-left: 12px;
    }

    .hub-flash__close {
        margin-left: 16px;
        /* The row centres now, so the nudge for a top-aligned pill goes. */
        margin-top: 0;
    }

    /* A sentence, not a label: it keeps the box and wraps inside it. */
    .hub-flash--wrap .hub-flash__message {
        white-space: normal;
    }

    .hub-flash--wrap {
        align-items: flex-start;
    }

    .hub-flash--wrap .hub-flash__close {
        margin-top: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hub-flash {
        transition: none;
    }
}
