/* ==========================================================================
   TS Sources — Perplexity-style favicon pills
   Version 1.1.0
   ========================================================================== */

/* Container */
.ts-sources {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.08);
}

/* Section heading */
.ts-sources h3 {
    font-size: 0.8rem !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #888;
    margin-bottom: 0.75rem !important;
    font-weight: 600;
}

/* Flex row of pills (new format) */
.ts-sources-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* Individual pill — circular favicon container */
.ts-source-pill {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f5f5;
    border: 1px solid rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    text-decoration: none !important;
    box-shadow: none !important;
}

.ts-source-pill:hover {
    background: #eee;
    border-color: rgba(0,0,0,0.15);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

.ts-source-pill img {
    width: 20px !important;
    height: 20px !important;
    border-radius: 2px;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
}

/* ==========================================================================
   Embeds — YouTube and Twitter inline embeds
   ========================================================================== */

.ts-embed {
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
}

.ts-embed.ts-youtube {
    background: #000;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.ts-embed.ts-youtube iframe {
    width: 100% !important;
    aspect-ratio: 16/9;
    border: none !important;
    border-radius: 12px;
    display: block;
}

.ts-embed.ts-tweet {
    display: flex;
    justify-content: center;
}

.ts-embed.ts-tweet .twitter-tweet {
    margin: 0 auto !important;
}

/* ==========================================================================
   Fallback — old <ul><li> format on existing posts
   ========================================================================== */

.ts-sources ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.ts-sources ul li {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f5f5;
    border: 1px solid rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
}

.ts-sources ul li:hover {
    background: #eee;
    border-color: rgba(0,0,0,0.15);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Hide the domain text in old format, show only favicon */
.ts-sources ul li a {
    font-size: 0 !important;
    line-height: 0 !important;
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    text-decoration: none !important;
    z-index: 1;
}

.ts-sources ul li img {
    width: 20px !important;
    height: 20px !important;
    border-radius: 2px;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}
