/* ── Link Peek overlay  v1.7.0 ──────────────────────────────────── */

#link-peek-overlay {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 999999;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow:
        0 0 0 1px rgba(0,0,0,.07),
        0 4px 8px rgba(0,0,0,.08),
        0 16px 40px rgba(0,0,0,.15);
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px) scale(.97);
    transition: opacity .18s ease, transform .18s ease;
    /* Tamil script needs a font that covers the full Unicode Tamil block */
    font-family: "Latha", "Vijaya", "Tamil MN", "InaiMathi",
                 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1;
}

#link-peek-overlay.lp-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ── Preview image ── */
#link-peek-overlay .lp-img {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #f3f4f6;
}

/* ── Body ── */
#link-peek-overlay .lp-body {
    padding: 12px 14px 14px;
}

/* ── Domain row ── */
#link-peek-overlay .lp-domain {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 7px;
}

#link-peek-overlay .lp-favicon {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    flex-shrink: 0;
}

#link-peek-overlay .lp-domain-name {
    font-size: 10.5px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Title — no line-clamp, expands naturally for long Tamil titles ── */
#link-peek-overlay .lp-title {
    margin: 0 0 6px;
    font-size: 13.5px;
    font-weight: 660;
    color: #111827;
    line-height: 1.5;
}

/* ── Description — no line-clamp, word count / full mode controls length ── */
#link-peek-overlay .lp-desc {
    margin: 0;
    font-size: 12px;
    color: #4b5563;
    line-height: 1.65;
}

/* ── Skeleton loader ── */
#link-peek-overlay .lp-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e4e4e4 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: lp-shimmer 1.3s infinite linear;
    border-radius: 4px;
}

#link-peek-overlay .lp-sk-img {
    width: 100%;
    height: 140px;
    border-radius: 0;
    display: block;
}

#link-peek-overlay .lp-sk-line {
    height: 11px;
    display: block;
}

@keyframes lp-shimmer {
    from { background-position:  200% 0; }
    to   { background-position: -200% 0; }
}

/* ── Dark mode ── */
@media (prefers-color-scheme: dark) {
    #link-peek-overlay {
        background: #1f2937;
        box-shadow:
            0 0 0 1px rgba(255,255,255,.07),
            0 4px 8px rgba(0,0,0,.3),
            0 16px 40px rgba(0,0,0,.5);
    }
    #link-peek-overlay .lp-title       { color: #f9fafb; }
    #link-peek-overlay .lp-desc        { color: #9ca3af; }
    #link-peek-overlay .lp-domain-name { color: #6b7280; }
    #link-peek-overlay .lp-skeleton {
        background: linear-gradient(90deg, #2d3748 25%, #374151 50%, #2d3748 75%);
        background-size: 200% 100%;
    }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    #link-peek-overlay { transition: opacity .08s; transform: none !important; }
    #link-peek-overlay .lp-skeleton { animation: none; background: #ebebeb; }
}
