/* Attachment rendering (timeline + composer) and image lightbox. */

/* --- Composer attach bar --- */
.composer-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--wt-border);
    color: var(--wt-fg-3);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.composer-attach-btn:hover { color: var(--wt-fg); border-color: var(--wt-fg-4); }

.composer-attach-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.composer-attach-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--wt-bg-3);
    border: 1px solid var(--wt-border);
    border-radius: 6px;
    font-size: 11.5px;
    color: var(--wt-fg-2);
}

.composer-attach-name { font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-attach-size { color: var(--wt-fg-4); font-size: 10.5px; }

.composer-attach-item button {
    background: transparent;
    border: 0;
    color: var(--wt-fg-3);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 0 2px;
}

.composer-attach-item button:hover { color: oklch(0.7 0.22 25); }

/* --- Timeline attachment grid --- */
.attach-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.attach-img-btn {
    background: transparent;
    border: 0;
    padding: 0;
    cursor: zoom-in;
    border-radius: 8px;
    overflow: hidden;
    display: inline-block;
}

.attach-img-btn img {
    display: block;
    max-width: 240px;
    max-height: 200px;
    width: auto;
    height: auto;
    border-radius: 8px;
    transition: transform 0.15s ease;
}

.attach-img-btn:hover img { transform: scale(1.02); }

.attach-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 8px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    text-decoration: none;
    color: var(--wt-fg);
    font-size: 12.5px;
    min-width: 200px;
    max-width: 320px;
}

.painel-msg.is-mine .attach-card { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.18); }

.attach-card:hover { background: rgba(255, 255, 255, 0.10); }

.attach-card-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}

.attach-card-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.attach-card-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attach-card-meta {
    color: var(--wt-fg-4);
    font-size: 10.5px;
}

.painel-msg.is-mine .attach-card-meta { color: rgba(255, 255, 255, 0.7); }

.attach-card-action {
    color: var(--wt-fg-3);
    flex-shrink: 0;
}

.painel-msg.is-mine .attach-card-action { color: rgba(255, 255, 255, 0.85); }

/* --- Lightbox --- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    outline: 0;
}

.lightbox-overlay img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
    border: 0;
    color: white;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.20); }

.lightbox-download {
    position: absolute;
    bottom: 22px;
    right: 22px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--wt-primary);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
}
