/* ================================================================
   ARTICLES CMS — PUBLIC STYLESHEET
   French Blog | Habr-like Design | LTR
   ================================================================ */

/* ---------- DESIGN TOKENS ---------- */
:root {
    --primary:     #1e293b;   /* slate-800 */
    --accent:      #6366f1;   /* indigo */
    --accent-dark: #4f46e5;
    --accent2:     #f59e0b;   /* amber */
    --green:       #10b981;
    --red:         #ef4444;
    --bg:          #f1f5f9;
    --bg-white:    #ffffff;
    --text:        #1e293b;
    --muted:       #64748b;
    --border:      #e2e8f0;
    --shadow:      0 2px 16px rgba(30,41,59,.09);
    --shadow-lg:   0 8px 32px rgba(30,41,59,.14);
    --r-sm:  6px;
    --r-md: 12px;
    --r-lg: 20px;
    --tr: all .22s ease;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', 'Outfit', system-ui, sans-serif;
    font-size: 16px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.8;
}
img { max-width: 100%; display: block; }
a   { text-decoration: none; color: inherit; }

/* ---------- NAVBAR ---------- */
.site-navbar {
    background: var(--primary);
    padding: .65rem 0;
    position: sticky;
    top: 0;
    z-index: 1050;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.site-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.3rem;
    font-weight: 900;
    color: #fff !important;
    letter-spacing: -.01em;
}
.site-brand i { color: var(--accent); font-size: 1.35rem; }
.site-brand em { color: var(--accent); font-style: normal; }

.nav-link-custom {
    color: rgba(255,255,255,.8) !important;
    font-size: .88rem;
    font-weight: 500;
    padding: .35rem .8rem !important;
    border-radius: var(--r-sm);
    transition: var(--tr);
}
.nav-link-custom:hover { color: #fff !important; background: rgba(255,255,255,.1); }
.nav-link-custom.active-cat { color: var(--accent) !important; }

.nav-search-form {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.nav-search-input {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    border-radius: 50px;
    padding: .35rem 1rem;
    font-size: .85rem;
    font-family: 'Inter', sans-serif;
    width: 180px;
    transition: var(--tr);
}
.nav-search-input::placeholder { color: rgba(255,255,255,.4); }
.nav-search-input:focus {
    outline: none;
    background: rgba(255,255,255,.18);
    width: 220px;
}

/* ---------- BREADCRUMBS ---------- */
.breadcrumb-bar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: .65rem 0;
    font-size: .82rem;
    color: var(--muted);
}
.breadcrumb-bar a { color: var(--accent); transition: var(--tr); }
.breadcrumb-bar a:hover { color: var(--accent-dark); }

/* ---------- HERO / PAGE HEADER ---------- */
.page-hero {
    background: var(--primary);
    padding: 2.5rem 0 2rem;
    color: #fff;
}
.page-hero-label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(99,102,241,.15);
    border: 1px solid rgba(99,102,241,.35);
    padding: .28rem .85rem;
    border-radius: 50px;
    margin-bottom: .85rem;
}
.page-hero-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.25;
    margin-bottom: .5rem;
}
.page-hero-sub {
    color: rgba(255,255,255,.65);
    font-size: .95rem;
}

/* ---------- CATEGORY TABS ---------- */
.cat-tabs {
    background: #fff;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 55px;
    z-index: 900;
}
.cat-tabs-inner {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 .5rem;
}
.cat-tabs-inner::-webkit-scrollbar { display: none; }
.cat-tab {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .75rem 1.1rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    border-bottom: 2.5px solid transparent;
    transition: var(--tr);
    cursor: pointer;
    border-radius: 0;
    background: none;
    border-left: none;
    border-right: none;
    border-top: none;
}
.cat-tab:hover { color: var(--accent); }
.cat-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.cat-tab .cat-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    font-size: .68rem;
    font-weight: 700;
    background: var(--bg);
    border-radius: 50px;
    padding: 0 5px;
}

/* ---------- CATEGORY BADGE ---------- */
.cat-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .22rem .65rem;
    border-radius: 50px;
    border: 1.5px solid;
}

/* ---------- LAYOUT ---------- */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    padding: 2rem 0;
}
@media (max-width: 991px) {
    .blog-layout { grid-template-columns: 1fr; }
    .blog-sidebar { order: 2; }
}

/* ---------- ARTICLE CARDS ---------- */
/* Featured card (large, top of feed) */
.article-card-featured {
    background: #fff;
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 0;
    margin-bottom: 1.5rem;
    transition: var(--tr);
}
.article-card-featured:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}
@media (max-width: 767px) {
    .article-card-featured { grid-template-columns: 1fr; }
}
.article-card-featured .card-img {
    height: 280px;
    overflow: hidden;
}
@media (max-width: 767px) {
    .article-card-featured .card-img { height: 220px; }
}
.article-card-featured .card-img img,
.article-card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.article-card-featured:hover .card-img img,
.article-card:hover .card-img img {
    transform: scale(1.05);
}
.article-card-featured .card-body {
    padding: 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Regular card */
.article-card {
    background: #fff;
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--tr);
}
.article-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}
.article-card .card-img {
    height: 190px;
    overflow: hidden;
    background: var(--bg);
    position: relative;
}
.card-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--muted);
    opacity: .25;
}
.article-card .card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Card shared elements */
.card-top-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .7rem;
}
.featured-label {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--accent2);
    background: rgba(245,158,11,.12);
    border: 1px solid rgba(245,158,11,.3);
    padding: .18rem .6rem;
    border-radius: 50px;
}
.article-card-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.4;
    margin-bottom: .5rem;
    transition: var(--tr);
}
.article-card-featured .article-card-title {
    font-size: 1.45rem;
    line-height: 1.3;
    margin-bottom: .75rem;
}
.article-card-title-link:hover .article-card-title { color: var(--accent); }

.article-excerpt {
    font-size: .87rem;
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: .8rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem .8rem;
    font-size: .77rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    padding-top: .75rem;
    margin-top: auto;
}
.card-meta-item {
    display: flex;
    align-items: center;
    gap: .28rem;
}
.card-meta-item i { color: var(--accent); font-size: .85rem; }

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin-bottom: .75rem;
}
.tag-pill {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: .15rem .55rem;
    border-radius: 50px;
    transition: var(--tr);
}
.tag-pill:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- SIDEBAR ---------- */
.sidebar-widget {
    background: #fff;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.sw-header {
    padding: 1rem 1.25rem .75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .88rem;
    font-weight: 800;
    color: var(--primary);
}
.sw-header i { color: var(--accent); }
.sw-body { padding: .75rem 1.25rem 1.25rem; }

.sidebar-cat-list { list-style: none; padding: 0; }
.sidebar-cat-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .55rem .1rem;
    border-bottom: 1px solid var(--border);
}
.sidebar-cat-list li:last-child { border-bottom: none; }
.sidebar-cat-list a {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .88rem;
    font-weight: 600;
    color: var(--primary);
    transition: var(--tr);
}
.sidebar-cat-list a:hover { color: var(--accent); }
.sidebar-cat-count {
    font-size: .72rem;
    color: var(--muted);
    background: var(--bg);
    padding: .15rem .5rem;
    border-radius: 50px;
}

.sidebar-article {
    display: flex;
    gap: .75rem;
    padding: .6rem 0;
    border-bottom: 1px solid var(--border);
}
.sidebar-article:last-child { border-bottom: none; }
.sidebar-article-img {
    width: 64px;
    height: 54px;
    border-radius: var(--r-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg);
}
.sidebar-article-title {
    font-size: .83rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.4;
    transition: var(--tr);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
a:hover .sidebar-article-title { color: var(--accent); }
.sidebar-article-meta {
    font-size: .72rem;
    color: var(--muted);
    margin-top: .25rem;
}

/* ---------- ARTICLE DETAIL PAGE ---------- */
.article-hero-img {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: var(--r-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
}
.article-title-main {
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    font-weight: 900;
    color: var(--primary);
    line-height: 1.3;
    margin-bottom: 1rem;
}
.article-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.25rem;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
    font-size: .84rem;
    color: var(--muted);
}
.article-meta-bar i { color: var(--accent); margin-right: .2rem; }
.article-content {
    font-size: 1.05rem;
    line-height: 2;
    color: #334155;
}
.article-content p {
    margin-bottom: 1.4rem;
}
.article-content h2, .article-content h3 {
    font-weight: 800;
    color: var(--primary);
    margin: 2rem 0 1rem;
}
.article-tags-section {
    margin: 2rem 0;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border);
}

/* Apply card */
.article-cta-card {
    background: linear-gradient(135deg, var(--primary) 0%, #334155 100%);
    border-radius: var(--r-lg);
    padding: 2rem 1.5rem;
    color: #fff;
    text-align: center;
    margin-top: 2rem;
}
.article-cta-card h5 {
    font-weight: 800;
    margin-bottom: .5rem;
}
.btn-accent {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    padding: .7rem 1.75rem;
    border-radius: 50px;
    transition: var(--tr);
    border: none;
    cursor: pointer;
}
.btn-accent:hover {
    background: var(--accent-dark);
    color: #fff;
    transform: translateY(-2px);
}

/* ---------- EMPTY STATE ---------- */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--muted);
}
.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
    opacity: .25;
}

/* ---------- FOOTER ---------- */
.site-footer {
    background: var(--primary);
    color: rgba(255,255,255,.75);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
    border-top: 3px solid var(--accent);
}
.footer-logo {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.25rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: .75rem;
}
.footer-logo i { color: var(--accent); }
.footer-logo em { color: var(--accent); font-style: normal; }
.footer-tagline { font-size: .85rem; opacity: .6; margin-bottom: 1.25rem; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { padding: .3rem 0; }
.footer-links a {
    font-size: .87rem;
    color: rgba(255,255,255,.65);
    transition: var(--tr);
    display: flex;
    align-items: center;
    gap: .4rem;
}
.footer-links a:hover { color: var(--accent); }
.footer-heading {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}
.footer-hr {
    border-color: rgba(255,255,255,.1);
    margin: 2rem 0 1.25rem;
}
.footer-copy {
    font-size: .78rem;
    color: rgba(255,255,255,.4);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 576px) {
    .cat-tab { padding: .65rem .8rem; font-size: .8rem; }
    .article-card-title { font-size: 1rem; }
}
