/* Cards Telegram — baseado em grupostelegrama.com/static/style.css */

.tg-section-heading {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 800;
    color: #f7f9f9;
    letter-spacing: -0.3px;
}

.tg-section-sub {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.tg-section-sub a {
    color: var(--telegram, #0088cc);
}

.home-xchat-heading {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 700;
    color: #f7f9f9;
}

.home-telegram-block {
    margin-top: 8px;
}

.home-telegram-block.has-xchat-above {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.tg-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 28px;
    align-items: start;
}

.tg-group-card[data-href] {
    background: rgba(42, 47, 74, 0.5);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    width: 100%;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    box-sizing: border-box;
}

.tg-group-card[data-href]:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 136, 204, 0.3);
}

.tg-group-card[data-href]:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.5), 0 10px 30px rgba(0, 136, 204, 0.25);
}

.tg-group-card[data-href]:hover .tg-button,
.tg-group-card[data-href]:focus-visible .tg-button {
    background: #0077b3;
}

.tg-logo-circle {
    width: 80px;
    height: 80px;
    background: #0088cc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.tg-icon {
    width: 45px;
    height: 45px;
}

.tg-group-name {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px;
    color: #ffffff;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    width: 100%;
    line-height: 1.3;
}

.tg-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #0088cc;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
    width: fit-content;
    max-width: 100%;
    pointer-events: none;
    user-select: none;
}

.tg-icon-sm {
    width: 18px;
    height: 18px;
}

.tg-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 12px;
    padding-top: 15px;
    border-top: 1px solid #2a2f4a;
    font-size: 12px;
    flex-shrink: 0;
    gap: 8px;
}

.tg-rating {
    color: #4caf50;
    font-weight: 600;
    text-align: left;
}

.tg-rating-label {
    font-weight: 500;
    opacity: 0.9;
}

.tg-member-count {
    color: #8a8fa3;
    text-align: right;
    white-space: nowrap;
}

.tg-see-all {
    display: inline-block;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 640px) {
    .tg-groups-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .tg-group-card[data-href] {
        padding: 18px 14px;
    }

    .tg-logo-circle {
        width: 64px;
        height: 64px;
        margin-bottom: 12px;
    }

    .tg-icon {
        width: 36px;
        height: 36px;
    }

    .tg-group-name {
        font-size: 15px;
    }

    .tg-card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .tg-member-count {
        text-align: left;
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tg-group-card[data-href] {
        transition: none;
    }
}

/* "Outros grupos Telegram" na página /telegram/grupo/ — 4 colunas, largura total */
.telegram-details-page .telegram-related {
    margin-top: 36px;
}

.telegram-details-page .telegram-related .tg-groups-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    max-width: none;
}

.telegram-details-page .telegram-related .tg-group-card[data-href] {
    padding: 18px 14px;
}

.telegram-details-page .telegram-related .tg-logo-circle {
    width: 56px;
    height: 56px;
    margin-bottom: 10px;
}

.telegram-details-page .telegram-related .tg-icon {
    width: 32px;
    height: 32px;
}

.telegram-details-page .telegram-related .tg-group-name {
    font-size: 14px;
    margin-bottom: 10px;
}

@media (max-width: 1100px) {
    .telegram-details-page .telegram-related .tg-groups-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .telegram-details-page .telegram-related .tg-groups-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .telegram-details-page .telegram-related .tg-groups-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
}

/* Página de detalhe do grupo Telegram */
.group-details-card-telegram.group-details-card-link {
    min-height: 360px;
}

a.group-details-card-link.group-details-card-telegram:hover {
    border-color: rgba(0, 136, 204, 0.45);
    box-shadow:
        0 0 0 1px rgba(0, 136, 204, 0.14) inset,
        0 20px 48px rgba(0, 0, 0, 0.55),
        0 0 40px rgba(0, 136, 204, 0.12),
        0 12px 32px rgba(0, 136, 204, 0.08);
}

a.group-details-card-link.group-details-card-telegram:hover .group-details-photo-wrap.tg-detail-logo {
    transform: scale(1.06);
    box-shadow: 0 12px 36px rgba(0, 136, 204, 0.45);
}

.group-details-card-telegram .group-details-photo-wrap.tg-detail-logo {
    transition:
        transform 0.24s cubic-bezier(0.34, 1.02, 0.68, 1),
        box-shadow 0.24s ease;
}

.group-details-card-telegram .tg-detail-category {
    margin-top: 10px;
    font-size: 14px;
    color: #8ed4fa;
}

.group-details-card-telegram .group-details-hero {
    padding: 48px 8px 12px;
}

.group-details-card-telegram .group-details-photo-wrap.tg-detail-logo {
    width: 120px;
    height: 120px;
    min-height: 120px;
    margin: 0 auto;
    padding: 0;
    border-radius: 50%;
    background: #0088cc;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 28px rgba(0, 136, 204, 0.35);
}

.group-details-card-telegram .tg-detail-logo .tg-icon-detail {
    width: 70px;
    height: 70px;
    color: #ffffff;
    display: block;
    flex-shrink: 0;
}

.home-xchat-block {
    margin-bottom: 8px;
}

.home-xchat-empty {
    margin: 0 0 4px;
    padding: 20px 18px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.02);
}

.home-xchat-empty a {
    font-weight: 600;
}

/* SEO: navegação, listagens, estatísticas (secção Telegram) */
.tg-seo-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0.75rem 0 1rem;
    font-size: 14px;
}

.tg-seo-nav a {
    color: #0088cc;
    font-weight: 600;
    text-decoration: none;
}

.tg-seo-nav a:hover {
    text-decoration: underline;
}

.listing-seo-intro h1 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
}

.listing-seo-text {
    color: var(--muted);
    line-height: 1.55;
    margin: 0 0 0.5rem;
}

.tg-seo-body {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.tg-seo-body p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
    margin: 0 0 0.75rem;
}

.tg-category-tag {
    font-size: 14px;
    margin: 0.25rem 0 0.75rem;
}

.tg-category-tag a {
    color: #0088cc;
    font-weight: 600;
}

.sobre-page .sobre-article {
    max-width: 720px;
    margin: 0 auto;
}

.sobre-categories {
    columns: 2;
    gap: 1rem;
    margin: 1rem 0;
}

.sobre-categories a {
    color: #0088cc;
}

.group-stats-panel {
    margin: 1.25rem 0;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(0, 136, 204, 0.06);
}

.group-stats-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
}

.group-stats-published {
    font-size: 13px;
    color: var(--muted);
}

.group-stats-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 13px;
    font-weight: 600;
}

.group-stats-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
}

.group-stats-status.is-offline .group-stats-dot {
    background: #94a3b8;
}

.group-stats-detail,
.group-stats-note {
    font-size: 12px;
    color: var(--muted);
    margin: 0.5rem 0;
}

.visitor-notice {
    margin: 0.75rem 0 1rem;
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.62);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.group-stats-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.75rem;
}

@media (max-width: 720px) {
    .group-stats-layout {
        grid-template-columns: 1fr;
    }
}

.group-stats-title {
    font-size: 15px;
    margin: 0 0 0.5rem;
}

.group-stats-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

.group-stats-list li {
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--line);
}

.growth-up { color: #16a34a; font-weight: 600; }
.growth-down { color: #dc2626; font-weight: 600; }

.group-stats-benchmark.is-top10 {
    font-weight: 600;
    color: #0088cc;
}

.group-stats-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
    height: 120px;
}

.group-stats-bar-col {
    flex: 1;
    text-align: center;
    font-size: 11px;
}

.group-stats-bar-wrap {
    height: 90px;
    display: flex;
    align-items: flex-end;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px 6px 0 0;
}

.group-stats-bar-fill {
    width: 100%;
    background: linear-gradient(180deg, #38bdf8, #0088cc);
    border-radius: 6px 6px 0 0;
    min-height: 4px;
}

.pagination-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin: 1.5rem 0;
    font-size: 14px;
}

.pagination-link {
    color: #0088cc;
    font-weight: 600;
}
