/* Body of shared/share_modal.html. The shell (overlay, header, close) comes
   from shared/detail_modal.css. */

/* At <=800px the shell's own width applies (same as the property-units modal);
   wider screens keep that 500px instead of growing to the shell's 680px. */
@media (min-width: 801px) {
    .share-modal .share-modal__dialog {
        width: 500px;
    }
}

.share-modal .detail-modal__heading h2 {
    font-weight: 500;
}

.share-modal__body {
    padding: 30px 26px 38px;
}

/* The icon rows and the copy row share one width, so all three line up. */
.share-modal__row,
.share-modal__copy {
    width: min(324px, 100%);
    margin-right: auto;
    margin-left: auto;
}

.share-modal__row {
    display: grid;
    grid-template-columns: repeat(4, 52px);
    justify-content: space-between;
}

.share-modal__row + .share-modal__row {
    margin-top: 24px;
}

.share-modal__tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    /* Each tile sets its own logo size: the glyphs have different optical
       weight (Discord and the envelope are wide and short, the Facebook "f"
       is thin), so one shared size makes some look tiny. */
    font-size: var(--share-logo-size, 32px);
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.share-modal__tile:hover {
    transform: scale(1.06);
    filter: brightness(0.95);
}

.share-modal__tile:focus-visible,
.share-modal__copy-button:focus-visible {
    outline: 3px solid #1a73e8;
    outline-offset: 3px;
}

.share-modal__tile--snapchat {
    --share-logo-size: 32px;
    background: #fffc00;
    color: #fff;
    -webkit-text-stroke: 1.4px #111;
}

.share-modal__tile--facebook {
    --share-logo-size: 34px;
    background: #1877f2;
}

.share-modal__tile--instagram {
    --share-logo-size: 34px;
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}

.share-modal__tile--whatsapp {
    --share-logo-size: 35px;
    background: #25d366;
}

.share-modal__tile--reddit {
    --share-logo-size: 34px;
    background: #ff4500;
}

.share-modal__tile--discord {
    --share-logo-size: 31.5px;
    background: #5865f2;
}

.share-modal__tile--x {
    --share-logo-size: 28.5px;
    background: #000;
}

.share-modal__tile--email {
    --share-logo-size: 30px;
    background: #2a40b0;
}

.share-modal__copy-label {
    margin: 30px 0 16px;
    color: #222;
    font-size: 17px;
    line-height: 1.3;
    text-align: center;
}

.share-modal__copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-modal__copy-field,
.share-modal__copied {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    min-height: 46px;
    border-radius: 10px;
}

.share-modal__copy-field {
    overflow: hidden;
    background: #eff1f1;
}

.share-modal__copy-field[hidden],
.share-modal__copied[hidden] {
    display: none;
}

.share-modal__url {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    border: 0;
    background: transparent;
    color: #222;
    font: inherit;
    font-size: 15px;
    text-overflow: ellipsis;
}

.share-modal__url:focus {
    outline: none;
}

.share-modal__copy-button {
    display: inline-flex;
    flex: 0 0 58px;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    padding: 0;
    border: 0;
    background: #e3e6e5;
    color: #444;
    font-size: 21px;
    cursor: pointer;
}

.share-modal__copy-button:hover {
    background: #d7dbd9;
    color: #111;
}

.share-modal__copied {
    gap: 14px;
    margin: 0;
    padding: 10px 16px;
    background: #d3e9e4;
    color: #222;
    font-size: 16px;
    line-height: 1.3;
}

.share-modal__copied:focus {
    outline: none;
}

.share-modal__copied i {
    flex: 0 0 auto;
    color: #3fb393;
    font-size: 24px;
}

.share-modal__copied.is-error {
    background: #fbeaea;
}

.share-modal__copied.is-error i {
    display: none;
}

/* Edge fades under the dialog's scroll arrows (detail_modal.css zones): each
   shows while there is more to scroll that way and hides with its arrow. */
.share-modal .detail-modal__scroll-arrow {
    z-index: 1;
}

.share-modal__scroll-fade {
    position: absolute;
    right: 0;
    left: 0;
    pointer-events: none;
}

.share-modal__scroll-fade--up {
    top: 0;
    height: 40px;
    background: linear-gradient(to bottom, #fff, rgba(255, 255, 255, 0));
}

.share-modal__scroll-fade--down {
    bottom: 0;
    height: 60px;
    background: linear-gradient(to top, #fff 15%, rgba(255, 255, 255, 0));
}

.detail-modal__scroll-arrow.is-disabled + .share-modal__scroll-fade {
    display: none;
}

/* Facebook-groups version (shared/share_groups_panel.html). The panel is dense,
   so the logos drop to one compact row and every section spans the body. */
.share-modal__subtitle {
    font-size: 15px;
}

.share-modal--groups .share-modal__body {
    padding: 20px 24px 28px;
}

.share-modal--groups .share-modal__copy-label {
    margin: 22px 0 12px;
    color: #444;
    font-size: 15px;
}

.share-modal--groups .share-modal__tiles {
    display: flex;
    justify-content: space-between;
}

.share-modal--groups .share-modal__row {
    display: contents;
}

.share-modal--groups .share-modal__tile {
    width: 42px;
    height: 42px;
    font-size: calc(var(--share-logo-size, 32px) * 0.72);
}

.share-modal--groups .share-modal__copy {
    width: 100%;
}

/* Same pill as the detail pages' Show all details button (detailview.css
   .housing-details-button), restated so this file stands alone. */
.share-groups__copy-post {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    border: none;
    border-radius: 999px;
    background-color: #f6f6f6;
    color: #222;
    font-size: 18px;
    line-height: 1.2;
    cursor: pointer;
    -webkit-text-stroke: 0.2px currentColor;
}

.share-groups__copy-post:hover,
.share-groups__copy-post:focus-visible {
    background: #e6e6e6;
    outline: none;
}

/* Copy result shown in the pill (share_modal.js setPill). */
.share-groups__copy-post .share-groups__copied-icon,
.share-groups__copy-post.is-copied .share-groups__copy-icon {
    display: none;
}

.share-groups__copy-post.is-copied .share-groups__copied-icon {
    display: inline-block;
}

.share-groups__copy-post.is-copied {
    background: #d3e9e4;
    color: #1d7a5f;
}

.share-groups__copy-post.is-error {
    background: #fbeaea;
    color: #a33;
}

/* The whole post, shown after a failed copy so it can be selected by hand. */
.share-groups__post {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid #e3e6e5;
    border-radius: 12px;
    background: #f7f8f8;
    color: #111;
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.share-groups__post-headline {
    margin: 0;
}

.share-groups__post-url {
    color: #1459c7;
}

.share-groups__post-description {
    margin: 6px 0 0;
    color: #555;
    white-space: pre-line;
}

.share-groups__toggle:focus-visible,
.share-group__posted:focus-visible {
    outline: 3px solid #1a73e8;
    outline-offset: 2px;
}

/* Screen-reader only; the pill shows the same result. */
.share-groups__status {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.share-groups__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 18px 0 8px;
}

.share-groups__label {
    margin: 0;
    color: #111;
    font-size: 15px;
    font-weight: 600;
}

.share-groups__count {
    margin: 0;
    color: #555;
    font-size: 13.5px;
    white-space: nowrap;
}

.share-groups__count strong {
    color: #111;
}

.share-groups__list {
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #ececec;
    border-radius: 12px;
    list-style: none;
}

.share-group {
    display: flex;
    align-items: center;
    border-top: 1px solid #ececec;
}

.share-group:first-child {
    border-top: 0;
}

.share-group[hidden] {
    display: none;
}

/* Rows Show all just revealed tint once (share_modal.js followToggle glides
   them into view), so they read as new. */
.share-group.is-revealed {
    animation: share-group-reveal 1s ease-out 0.25s backwards;
}

@keyframes share-group-reveal {
    from {
        background-color: #e3edfb;
    }

    to {
        background-color: transparent;
    }
}

@media (prefers-reduced-motion: reduce) {
    .share-group.is-revealed {
        animation: none;
    }
}

.share-group__open {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 46px;
    padding: 0 12px;
    color: #111;
    text-decoration: none;
}

.share-group__open:hover {
    background: #f5f7fa;
    color: #111;
    text-decoration: none;
}

.share-group__open:focus-visible {
    outline: 3px solid #1a73e8;
    outline-offset: -3px;
}

.share-group__icon {
    display: inline-flex;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1877f2;
    color: #fff;
    font-size: 15px;
}

.share-group__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 14.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-group__post,
.share-group__posted {
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.share-group__post {
    display: inline-flex;
    flex: 0 0 auto;
    background: #e7f0fd;
    color: #1459c7;
}

.share-group__post i {
    font-size: 11px;
}

.share-group__posted {
    display: none;
    flex: 0 0 auto;
    margin-right: 12px;
    border: 0;
    background: #d3e9e4;
    color: #1d7a5f;
    font-family: inherit;
    cursor: pointer;
}

.share-group__undo-label {
    display: none;
}

.share-group.is-posted .share-group__post {
    display: none;
}

.share-group.is-posted .share-group__posted {
    display: inline-flex;
}

.share-group.is-posted .share-group__name {
    color: #555;
}

.share-group__posted:hover,
.share-group__posted:focus-visible {
    background: #fbeaea;
    color: #a33;
}

.share-group__posted:hover .share-group__posted-label,
.share-group__posted:focus-visible .share-group__posted-label {
    display: none;
}

.share-group__posted:hover .share-group__undo-label,
.share-group__posted:focus-visible .share-group__undo-label {
    display: inline;
}

.share-groups__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #1459c7;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.share-groups__toggle:hover {
    background: #f2f6fd;
}

.share-groups__toggle i {
    font-size: 12px;
    transition: transform 0.15s ease;
}

.share-groups__toggle.is-expanded i {
    transform: rotate(180deg);
}

@media (max-width: 480px) {
    .share-modal__body {
        padding: 24px 16px 30px;
    }

    .share-modal--groups .share-modal__body {
        padding: 16px 14px 24px;
    }

    .share-modal--groups .share-modal__tile {
        width: 36px;
        height: 36px;
        font-size: calc(var(--share-logo-size, 32px) * 0.62);
    }

    .share-modal__row {
        grid-template-columns: repeat(4, 46px);
    }

    /* Circles shrink from 52px to 46px, so the per-tile logo sizes scale with them. */
    .share-modal__tile {
        width: 46px;
        height: 46px;
        font-size: calc(var(--share-logo-size, 32px) * 0.885);
    }

    .share-modal__copy-label {
        margin: 24px 0 14px;
        font-size: 16px;
    }
}
