/* =========================================================
   TABERIK V3 — ULTRA STABLE PRODUCTION CSS
   100% RESPONSIVE FOR MOBILE, TABLET & DESKTOP
========================================================= */

:root {
    --tb-bg: #ffffff;
    --tb-text: #0f172a;
    --tb-muted: #5b6b80;
    --tb-border: #e2e8f0;
    --tb-border-soft: #f1f5f9;
    --tb-primary: #2563eb;
    --tb-primary-hover: #1d4ed8;
    --tb-box: #f8fafc;
    --tb-radius: 16px;
    --tb-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
    
    /* Категориялардын дефолттук түсү */
    --tb-cat-general: #64748b;
}

/* =========================================================
   1. БАЗАЛЫК СТИЛДЕР (BASE & SAFETY GLOBAL)
========================================================= */

* {
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    color: var(--tb-text);
    background: var(--tb-bg);
}

.taberik-v3 {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 18px;
    font-family: Inter, system-ui, sans-serif;
}

/* Сүрөттөр жана видеолор экрандан чыгып кетпейт (CLS коргоо) */
img, video {
    max-width: 100%;
    height: auto;
}

/* Узун сөздөр же шилтемелер макетти бузбайт */
.entry-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* =========================================================
   2. СЕТКА (GRID LAYOUT)
========================================================= */

.t-grid {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    min-width: 0;
    width: 100%;
}

/* =========================================================
   3. КАТЕГОРИЯ, СҮРӨТ, МЕТА ЖАНА МАКАЛА ЭЛЕМЕНТТЕРИ
========================================================= */

/* Үстүнкү Окуу Прогресс-бары */
.t-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--tb-primary);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s ease;
}

.entry-title {
    font-size: 32px;
    line-height: 1.25;
    font-weight: 800;
    margin: 12px 0 16px 0;
    letter-spacing: -0.02em;
}

.t-category {
    display: inline-block;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 20px;
    text-decoration: none;
    background: var(--tb-border-soft);
    color: var(--tb-cat-general);
    transition: background 0.2s ease;
}

.t-category:hover {
    opacity: 0.9;
}

.t-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--tb-muted);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.t-meta-author {
    font-weight: 600;
    color: var(--tb-text);
}

/* Башкы Сүрөт макети жана Заглушка туруктуулугу */
.t-thumb {
    width: 100%;
    margin-bottom: 28px;
    border-radius: var(--tb-radius);
    overflow: hidden;
    background: var(--tb-border-soft);
    aspect-ratio: 16 / 9;
}

.t-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Макаланын тексти */
.entry-content {
    font-size: 17px;
    line-height: 1.75;
    color: #334155;
    margin-bottom: 40px;
}

.entry-content p {
    margin-bottom: 20px;
}

/* =========================================================
   4. БОКС БАЗА (SIDEBAR BOX BASE)
========================================================= */

.t-box {
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--tb-border);
    border-radius: 14px;
    background: var(--tb-box);
    overflow: hidden;
}

/* =========================================================
   5. ЖАРНАМА БЛОКТОРУ (ADS & VIDEO BANNER SYSTEM)
========================================================= */

.t-ad {
    margin-bottom: 28px;
    padding: 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.t-ad-sidebar {
    width: 100%;
    overflow: visible;
}

.t-ad-placeholder {
    width: 100%;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 12px;
    color: #94a3b8;
}

/* Видео жарнаманын негизги жөндөөсү */
.t-ad-sidebar video {
    display: block;
    border-radius: 12px;
    object-fit: cover;
    background-color: #000;
}

/* =========================================================
   6. 🔥 TABERIK INSIDER (EMAIL SUBSCRIBE)
========================================================= */

.t-subscribe {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    border: none;
    padding: 22px;
    border-radius: 14px;
    overflow: hidden;
}

.t-subscribe-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 8px;
}

.t-subscribe-text {
    font-size: 13px;
    line-height: 1.6;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.t-subscribe-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.t-subscribe-form input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 14px;
    outline: none;
}

.t-subscribe-form input::placeholder {
    color: #94a3b8;
}

.t-subscribe-form input:focus {
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.12);
}

.t-subscribe-form button {
    padding: 12px;
    border-radius: 10px;
    border: none;
    background: var(--tb-primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.t-subscribe-form button:hover {
    background: var(--tb-primary-hover);
    transform: translateY(-1px);
}

/* =========================================================
   7. 🔗 OKШОШ ЖАҢЫЛЫКТАР (RELATED LOOP)
========================================================= */

.t-related-title {
    font-size: 20px;
    font-weight: 800;
    margin: 40px 0 20px 0;
    border-bottom: 2px solid var(--tb-border-soft);
    padding-bottom: 10px;
}

.t-related {
    display: grid;
    gap: 20px;
    margin-bottom: 40px;
}

.t-related-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--tb-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--tb-border-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.t-related-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--tb-shadow);
}

.t-related-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--tb-border-soft);
    overflow: hidden;
}

.t-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.t-related-item:hover .t-related-thumb img {
    transform: scale(1.04);
}

.t-related-text {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.t-related-headline {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--tb-text);
}

.t-related-meta {
    font-size: 12px;
    color: var(--tb-muted);
    margin-top: auto;
}

/* =========================================================
   8. ДИСПЛЕЙЛЕРГЕ ЫЛАЙЫКТАШУУ (RESPONSIVE MEDIA QUERIES)
========================================================= */

/* --- 🖥️ КОМПЬЮТЕРЛЕР ҮЧҮН (DESKTOP) --- */
@media (min-width: 992px) {
    .t-content {
        flex: 1 1 70%;
        min-width: 0;
    }
    
    .t-sidebar {
        flex: 0 0 320px;
        max-width: 320px;
        min-width: 320px;
        position: sticky;
        top: 24px;
        align-self: flex-start;
    }

    /* Окшош жаңылыктар 3 катар болот */
    .t-related {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Видео компьютерде идеалдуу 300x600 болот */
    .t-ad-sidebar video {
        width: 100%;
        height: 600px !important;
    }
}

/* --- 💻 ПЛАНШЕТТЕР ҮЧҮН (TABLETS: iPad, Galaxy Tab) --- */
@media (min-width: 768px) and (max-width: 991px) {
    .t-grid {
        flex-direction: column;
        gap: 32px;
    }

    .t-content, .t-sidebar {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 auto;
    }

    /* Планшетте жаңылыктар 2 катар тизилет */
    .t-related {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
    }

    /* Видеонун планшеттеги бийиктиги */
    .t-ad-sidebar video {
        width: 100%;
        height: auto !important;
        max-height: 400px;
    }
}

/* --- 📱 ТЕЛЕФОНДОР ҮЧҮН (SMARTPHONES: iPhone, Android) --- */
@media (max-width: 767px) {
    .taberik-v3 {
        padding: 16px 12px;
    }

    .t-grid {
        flex-direction: column;
        gap: 24px;
    }

    .t-sidebar, .t-content {
        width: 100%;
        max-width: 100%;
        position: static;
        flex: 1 1 auto;
    }

    /* Телефондо баары 1 катар болот */
    .t-related {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .entry-title {
        font-size: 22px !important;
        line-height: 1.3;
        margin-bottom: 12px;
    }

    .t-ad-sidebar {
        min-height: auto !important;
        padding: 0 !important;
    }

    /* Видео телефон экранын бузбайт */
    .t-ad-sidebar video {
        width: 100%;
        height: auto !important;
        max-height: 350px;
    }
    
    .entry-content {
        font-size: 16px !important;
        line-height: 1.65;
    }
}

/* =========================================================
   9. ЖЕТКИЛИКТҮҮЛҮК (ACCESSIBILITY & FOCUS-VISIBLE)
========================================================= */

:focus-visible {
    outline: 2px solid var(--tb-primary);
    outline-offset: 3px;
    border-radius: 6px;
}