/* ============================================================
   0. RESET ALL EXTERNAL CSS INSIDE TELEGRAM FEED
   ============================================================ */

.tg-grid * {
    all: unset;
    all: revert; /* ⭐ resets theme + plugin overrides */
    box-sizing: border-box;
}

/* ============================================================
   1. TELEGRAM MOBILE FEED LAYOUT
   ============================================================ */

.tg-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
}

/* ============================================================
   2. TELEGRAM MESSAGE BUBBLE
   ============================================================ */

.tg-card {
    width: 100%;
    background: #ffffff;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e7e7e7;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden; /* ⭐ prevents image spill */
}

/* ============================================================
   3. IMAGE HANDLING — FIXES OVERHANG 100%
   ============================================================ */

.tg-image-wrapper {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.tg-card img.tg-image {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: cover !important;
    border-radius: 12px !important;
}

/* ============================================================
   4. TEXT
   ============================================================ */

.tg-text {
    font-size: 15px;
    line-height: 1.45;
    white-space: pre-wrap;
    color: #222;
    font-family: system-ui, sans-serif;
}

/* ============================================================
   5. FOOTER
   ============================================================ */

.tg-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.tg-date {
    font-size: 13px;
    color: #777;
}

.tg-open {
    font-size: 13px;
    color: #0088cc;
    text-decoration: none;
    font-weight: 600;
}

/* ============================================================
   6. PDF BUTTON
   ============================================================ */

.tg-pdf {
    display: inline-block;
    background: #f1f5ff;
    color: #1a56db;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
}
