/* ===================== TOKENS ===================== */
:root{
    --fc-red:#e31b23;
    --fc-black:#121212;
    --fc-white:#ffffff;

    /* Light defaults */
    --fc-bg:#ffffff;
    --fc-surface:#ffffff;
    --fc-text:#111111;
    --fc-muted:#6b7280;   /* читабельнее, чем #9ca3af */
    --fc-border:#e5e7eb;
    --fc-soft:#f9fafb;
    --fc-shadow:rgba(0,0,0,.06);

    /* map на bootstrap */
    --bs-body-bg:var(--fc-bg);
    --bs-body-color:var(--fc-text);
    --bs-border-color:var(--fc-border);
}

/* Тёмная по системным настройкам, если нет data-theme */
@media (prefers-color-scheme: dark){
    :root:not([data-theme]){
        --fc-bg:#0c0c0c;
        --fc-surface:#121212;
        --fc-text:#eaeaea;
        --fc-muted:#b3b3b3;
        --fc-border:#262626;
        --fc-soft:#171717;
        --fc-shadow:rgba(0,0,0,.4);

        --bs-body-bg:var(--fc-bg);
        --bs-body-color:var(--fc-text);
        --bs-border-color:var(--fc-border);
    }
}

/* Принудительный дарк из JS: documentElement.setAttribute('data-theme','dark') */
html[data-theme="dark"]{
    --fc-bg:#0c0c0c;
    --fc-surface:#121212;
    --fc-text:#eaeaea;
    --fc-muted:#b3b3b3;
    --fc-border:#262626;
    --fc-soft:#171717;
    --fc-shadow:rgba(0,0,0,.4);

    --bs-body-bg:var(--fc-bg);
    --bs-body-color:var(--fc-text);
    --bs-border-color:var(--fc-border);
}

/* ===================== GLOBAL ===================== */
body{ background:var(--fc-bg); color:var(--fc-text); }

/* ===================== NAVBAR ===================== */
.navbar-fc{
    background: var(--fc-black)!important;
    border-bottom: 3px solid var(--fc-red);
}
.navbar-fc .navbar-brand,
.fc-brand{ display:flex; align-items:center; gap:.6rem; padding:.25rem 0; }

.fc-icon-img{
    height: clamp(50px, 5vw, 60px);
    width:auto; display:block; max-width:220px; object-fit:contain;
}

.fc-wordmark{
    font-family:'Montserrat',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
    font-weight:800; letter-spacing:.5px; display:inline-flex; gap:.2rem; line-height:1;
    transform: translateY(1px);
}
.fc-wordmark .fight{ color:var(--fc-red); }
.fc-wordmark .corner{ color:var(--fc-white); }

.fc-slogan{
    margin-left:.75rem; padding-left:.75rem;
    border-left:2px solid rgba(255,255,255,.15);
    color:var(--fc-muted); font-weight:600; letter-spacing:.2px; font-size:.9rem;
}
@media (max-width:420px){
    .fc-wordmark{ font-size:1.1rem; }
    .fc-slogan{ display:none!important; }
}

/* пункты меню */
.navbar-fc .navbar-nav .nav-link{
    position:relative; color:#e5e7eb!important; padding:.7rem .9rem;
}
.navbar-fc .navbar-nav .nav-link:hover,
.navbar-fc .navbar-nav .nav-link:focus{ color:var(--fc-red)!important; }
.navbar-fc .navbar-nav .nav-link.active::after,
.navbar-fc .navbar-nav .nav-link[aria-current="page"]::after,
.navbar-fc .navbar-nav .nav-item.active>.nav-link::after{
    content:""; position:absolute; left:.6rem; right:.6rem; bottom:.4rem; height:2px;
    background:var(--fc-red); border-radius:2px;
}

/* кнопка login/logout */
.btn-login{
    background:var(--fc-red); color:#fff!important; font-weight:600;
    border:none; border-radius:.375rem; padding:.45rem .95rem; line-height:1.1;
    transition:background .2s ease;
}
.btn-login:hover{ background:#c0161c; color:#fff!important; }

/* ===================== FOOTER ===================== */
.footer-fc{
    background:var(--fc-black);
    color:var(--fc-muted);
    border-top:3px solid var(--fc-red);
}

/* ===================== LINKS & BREADCRUMBS ===================== */
a{ color:var(--fc-red); }
a:hover{ color:#c0161c; }
.breadcrumb .breadcrumb-item a{ color:var(--fc-red); }
.breadcrumb .breadcrumb-item a:hover{ color:#c0161c; }

/* ===================== NEWS LIST ===================== */
.page-title{ font-weight:800; color:var(--fc-text); margin:.5rem 0 1rem; }

.news-grid{ display:grid; grid-template-columns:1fr; gap:16px; }
@media(min-width:768px){ .news-grid{ grid-template-columns:repeat(2,1fr); } }
@media(min-width:1200px){ .news-grid{ grid-template-columns:repeat(3,1fr); } }

.news-card{
    position:relative; display:flex; flex-direction:column; height:100%;
    border:1px solid var(--fc-border); border-radius:12px; overflow:hidden; background:var(--fc-surface);
}
.news-card::after{
    content:""; position:absolute; left:0; bottom:0; height:3px; width:0;
    background:var(--fc-red); transition:width .18s ease;
}
.news-card:hover::after{ width:100%; }

.news-thumb img{ width:100%; height:180px; object-fit:cover; display:block; }
@media(min-width:992px){ .news-thumb img{ height:160px; } }
html[data-theme="dark"] .news-summary{ color:#d1d1d1; }

.news-meta{
    display:flex; align-items:center; gap:.75rem; flex-wrap:wrap;
    color:var(--fc-muted); font-size:.85rem;
}
.news-meta .author,
.news-meta time{ white-space:nowrap; }
.btn-reset {
    color: var(--fc-red);
}
.form-label{
    color: var(--fc-red)!important;
}
.fc-division{
    color: var(--fc-red)!important;
}
.fc-counters{ display:inline-flex; align-items:center; gap:.5rem; margin-left:auto; }

/* ===================== CHIPS ===================== */
.fc-chip{
    display:inline-flex; align-items:center; gap:.35rem; white-space:nowrap;
    color:#374151; background:var(--fc-soft); border:1px solid var(--fc-border);
    border-radius:999px; padding:.22rem .55rem; line-height:1; font-weight:600;
}
.fc-chip .bi{ vertical-align:-0.125em; opacity:.85; font-size:1rem; }
html[data-theme="dark"] .fc-chip{ color:#e6e6e6; }

/* ===================== CARD ACTIONS ===================== */
.news-actions{
    margin-top:auto; display:flex; gap:.5rem; padding-top:.5rem; border-top:1px solid var(--fc-border);
}
.btn.btn-read{
    background:var(--fc-red); color:#fff; border:none; padding:.4rem .75rem; border-radius:8px; font-weight:700;
}
.btn.btn-read:hover{ background:#c0161c; color:#fff; }
.btn.btn-source{
    background:#111; color:#fff; border:none; padding:.4rem .75rem; border-radius:8px; opacity:.9;
}
.btn.btn-source:hover{ opacity:1; }
html[data-theme="dark"] .btn.btn-source{ background:#222; }

/* ===================== ARTICLE ===================== */
.article-head h1{ margin:.2rem 0 .6rem; font-weight:800; line-height:1.15; }
.article-meta{ color:var(--fc-muted); margin-bottom:1rem; font-size:.95rem; }

.article-hero{ margin:0 0 1rem; border-radius:12px; overflow:hidden; border:1px solid var(--fc-border); }
.article-hero img{
    width:100%; height:auto; max-height:520px; object-fit:cover; display:block; aspect-ratio:16/9;
}

.article-body{
    color:#1f2937; font-size:1.06rem; line-height:1.75; white-space:normal;
}
.article-body p{ margin:0 0 1rem; text-wrap:pretty; hyphens:auto; }
html[data-theme="dark"] .article-body{ color:#e5e5e5; }

.fc-quote{
    margin:1.25rem 0; padding:.9rem 1rem .9rem 1.1rem;
    background:var(--fc-surface); border:1px solid var(--fc-border);
    border-left:4px solid var(--fc-red); border-radius:12px;
}
.fc-quote p{ margin:.4rem 0; }

/* ===================== PAGINATION ===================== */
.fc-pager{ gap:6px; margin-top:20px; }
.fc-pager .page-item{ display:inline-flex; }
.fc-pager .page-link{
    color:var(--fc-text); background:var(--fc-surface); border:1px solid var(--fc-border);
    border-radius:10px; padding:.45rem .8rem; line-height:1.1;
}
.fc-pager .page-link:hover,
.fc-pager .page-link:focus{
    color:#fff; background:var(--fc-red); border-color:var(--fc-red);
    box-shadow:0 0 0 .16rem rgba(227,27,35,.18);
}
.fc-pager .page-item.active .page-link{
    color:#fff; background:var(--fc-red); border-color:var(--fc-red);
    box-shadow:0 6px 14px rgba(227,27,35,.25);
}
.fc-pager .page-item.disabled .page-link{
    color:#9ca3af; background:#f3f4f6; border-color:var(--fc-border);
}
html[data-theme="dark"] .fc-pager .page-item.disabled .page-link{
    color:#7a7a7a; background:#151515;
}



/* ===================== REACTIONS BAR ===================== */
.fc-reactbar{ display:flex; align-items:center; gap:.5rem; }
.btn.btn-react{
    display:inline-flex; align-items:center; gap:.4rem;
    background:var(--fc-surface); color:var(--fc-text);
    border:1px solid var(--fc-border); border-radius:10px;
    padding:.35rem .7rem; line-height:1.1; font-weight:700;
}
.btn.btn-react .bi{ vertical-align:-0.125em; }
.btn.btn-react:hover{
    color:#fff; background:var(--fc-red); border-color:var(--fc-red);
    box-shadow:0 0 0 .16rem rgba(227,27,35,.15);
}

/* ===================== COMMENTS ===================== */
#comments-list{ display:block; }

.fc-comment{ display:block; margin:0 0 14px 0; }
.fc-comment .meta{
    display:flex; align-items:center; flex-wrap:wrap; gap:.5rem;
    font-size:.9rem; color:var(--fc-muted); margin-bottom:4px;
}
.fc-comment .meta strong{ color:var(--fc-text); }
.fc-comment .meta .sep{ opacity:.5; }

.fc-comment .body{
    background:var(--fc-surface); border:1px solid var(--fc-border); border-radius:10px;
    padding:.6rem .75rem; line-height:1.5; color:var(--fc-text);
    white-space:pre-wrap; /* сохраняем переводы строк */
}

.fc-comment .children{
    margin-top:8px; margin-left:16px; border-left:2px solid var(--fc-red); padding-left:12px;
}

.fc-reply{ font-size:.85rem; }
