/**
 * Counter — bridge card
 * Floating stats card yang menjembatani hero (atas) dan list gigs (bawah).
 * Menggantikan counter-animation.css + counter-responsive-fix.css.
 */

:root{
    --tk-count-accent: #ffc400;
    --tk-count-ink: #12203a;
    --tk-count-muted: rgba(18, 32, 58, 0.58);
    --tk-count-line: rgba(18, 32, 58, 0.10);
}

/* ── Wrapper: kartu mengambang, overlap tipis di kedua ujung ───────────── */
.tk-counter-bridge{
    position: relative;
    z-index: 10;
    margin: -56px auto -56px;
    padding: 0 24px;
    max-width: 1180px;
    width: 100%;
    box-sizing: border-box;
}

/* Section pembungkus tidak boleh menambah tinggi atau latar */
.pb-themesection:has(.tk-counter-bridge){
    background: transparent !important;
    background-image: none !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative;
    z-index: 10;
    isolation: auto !important;
}
.pb-themesection:has(.tk-counter-bridge)::before{
    display: none !important;
    content: none !important;
}
.pb-themesection:has(.tk-counter-bridge) > .container{
    max-width: 100% !important;
    padding: 0 !important;
}
.pb-themesection:has(.tk-counter-bridge) > .container > .row,
.pb-themesection:has(.tk-counter-bridge) > .container > .row > .col-12{
    margin: 0 !important;
    padding: 0 !important;
}

body.tk-homepage{
    background: #ffffff !important;
}

/* ── Kartu ─────────────────────────────────────────────────────────────── */
.tk-counter-bridge-card{
    background: #ffffff;
    border: 1px solid var(--tk-count-line);
    border-radius: 18px;
    box-shadow:
        0 1px 2px rgba(15, 30, 60, 0.04),
        0 10px 30px rgba(15, 30, 60, 0.07);
    padding: 28px 24px;
    position: relative;
    overflow: hidden;
}

/* Sisa markup lama dari tema */
.tk-couter-wrapper{ display: contents !important; }
.tk-stats-section-content{ display: none !important; }

/* ── List ──────────────────────────────────────────────────────────────── */
.tk-counter-bridge-card .tk-counternum,
.tk-counternum{
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    list-style: none;
    width: 100%;
}

.tk-counternum li{
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    list-style: none;
    padding: 4px 28px !important;
    margin: 0;
    position: relative;
    text-align: center;
    display: flex;
    align-items: stretch;
    border: 0 !important;
}

/* Pemisah hairline antar kolom */
.tk-counternum li + li::before{
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--tk-count-line) 45%, var(--tk-count-line) 55%, transparent);
}

/* ── Item ──────────────────────────────────────────────────────────────── */
.tk-countitem{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    width: 100%;
    max-width: 100% !important;
    padding: 0;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    transition: transform 0.25s ease;
}
.tk-countitem:hover{ transform: translateY(-3px); }
.tk-countitem::before,
.tk-countitem::after{ display: none !important; }

/* Ikon dibungkus badge kuning lembut (tanpa markup tambahan) */
.tk-countitem img{
    height: 54px !important;
    width: 54px;
    max-width: 54px !important;
    padding: 13px;
    margin: 0 0 14px !important;
    box-sizing: border-box;
    border-radius: 16px;
    background: rgba(255, 196, 0, 0.13);
    object-fit: contain;
    transition: background 0.25s ease;
    /* SVG mono → kuning brand */
    filter: brightness(0) saturate(100%) invert(78%) sepia(85%) saturate(2079%) hue-rotate(359deg) brightness(104%) contrast(103%);
}
.tk-countitem:hover img{ background: rgba(255, 196, 0, 0.22); }

/* Angka + satuan */
.tk-countitem h3{
    margin: 0 0 6px !important;
    font: 700 30px/36px "Inter", sans-serif !important;
    color: var(--tk-count-ink) !important;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}
.tk-countitem h3 .tk-count-suffix{
    display: inline;
    margin-left: 4px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--tk-count-muted);
}
.tk-countitem:hover h3{ transform: none; }

/* Keterangan */
.tk-countitem span{
    display: block;
    font: 400 13px/20px "Inter", sans-serif !important;
    color: var(--tk-count-muted) !important;
    max-width: 220px;
    margin: 0 auto;
}

/* ── Tablet ────────────────────────────────────────────────────────────── */
@media (max-width: 1024px){
    .tk-counter-bridge{
        margin: -44px auto -44px;
        padding: 0 18px;
        max-width: 760px;
    }
    .tk-counter-bridge-card{ padding: 24px 16px; }
    .tk-counternum li{ padding: 4px 14px !important; }
    .tk-countitem img{
        height: 48px !important;
        width: 48px;
        max-width: 48px !important;
        padding: 11px;
        margin-bottom: 12px !important;
    }
    .tk-countitem h3{ font-size: 25px !important; line-height: 31px !important; }
}

/* ── Mobile ──────────────────────────────────────────────────────────────
   Tetap tiga kolom, tidak ditumpuk. Yang membuat kartunya tinggi adalah
   keterangan panjang di bawah tiap angka; angkanya sendiri sudah menerangkan
   diri (4,91/5 · 732+ Pengajuan · 20+ Layanan), jadi keterangannya
   disembunyikan dan satu baris cukup. 441px turun ke sekitar 120px.

   Tinggi angka dikunci dua baris supaya ketiga kolom tetap sebaris meski
   hanya sebagian yang membungkus. */
@media (max-width: 767px){
    .tk-counter-bridge{
        margin: -36px auto -28px;
        padding: 0 14px;
    }
    .tk-counter-bridge-card{ padding: 16px 10px; }
    .tk-counternum li{
        flex: 1 1 0;
        max-width: none;
        padding: 2px 6px !important;
    }
    .tk-countitem img{
        height: 36px !important;
        width: 36px;
        max-width: 36px !important;
        padding: 8px;
        border-radius: 12px;
        margin-bottom: 8px !important;
    }
    .tk-countitem h3{
        margin: 0 0 2px !important;
        font-size: 16px !important;
        line-height: 1.3 !important;
    }
    /* Judul singkat di bawah angkanya. Isinya datang dari
       lang/{id,en}/pages.php lewat translateMeroText(); angkanya sendiri sudah
       dibersihkan dari satuan oleh migrasi, jadi tidak ada yang terulang. */
    .tk-countitem > span{
        font-size: 11px !important;
        line-height: 1.35 !important;
        max-width: 100%;
    }
}

@media (max-width: 480px){
    .tk-counter-bridge{
        margin: -28px auto -22px;
        padding: 0 10px;
    }
    .tk-counternum li{ padding: 2px 3px !important; }
    .tk-countitem img{
        height: 30px !important;
        width: 30px;
        max-width: 30px !important;
        padding: 7px;
        border-radius: 10px;
        margin-bottom: 6px !important;
    }
    .tk-countitem h3{ font-size: 14px !important; }
    .tk-countitem > span{ font-size: 10px !important; }
}

/* ── Animasi ───────────────────────────────────────────────────────────── */
.tk-counternum li{
    opacity: 0;
    animation: tkCountIn 0.6s ease forwards;
}
.tk-counternum li:nth-child(2){ animation-delay: 0.08s; }
.tk-counternum li:nth-child(3){ animation-delay: 0.16s; }
.tk-counternum li:nth-child(4){ animation-delay: 0.24s; }
.tk-counternum li:nth-child(5){ animation-delay: 0.32s; }
.tk-counternum li:nth-child(6){ animation-delay: 0.40s; }

@keyframes tkCountIn{
    from{ opacity: 0; transform: translateY(14px); }
    to  { opacity: 1; transform: translateY(0); }
}

@media (max-width: 767px){
    .tk-counternum li{ animation-delay: 0s !important; }
}

@media (prefers-reduced-motion: reduce){
    .tk-counternum li,
    .tk-countitem,
    .tk-countitem img{
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
