/* =====================
   Blog Styles — RTL Dark Theme
   ===================== */

/* Page Layout */
.blog-page { padding: 60px 0 80px; }

.blog-page-header { text-align: center; margin-bottom: 40px; }
.blog-page-subtitle { color: rgba(255,255,255,0.45); font-size: 1rem; margin-top: 8px; }

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
    align-items: start;
}

/* =====================
   Blog Grid & Cards
   ===================== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.blog-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.blog-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color .2s, transform .2s;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    border-color: rgba(212,175,55,0.3);
    transform: translateY(-3px);
}

.blog-card-img-wrap {
    display: block;
    height: 180px;
    overflow: hidden;
    background: rgba(255,255,255,0.05);
}

.blog-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.blog-card:hover .blog-card-img { transform: scale(1.05); }

.blog-card-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    background: rgba(255,255,255,0.03);
}

.blog-card-placeholder-logo {
    max-height: 72px;
    width: auto;
    max-width: 85%;
    object-fit: contain;
    opacity: 0.9;
}

.blog-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.blog-card-cat {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #d4af37;
    background: rgba(212,175,55,0.1);
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: 20px;
    padding: 3px 12px;
    text-decoration: none;
    letter-spacing: .03em;
}

.blog-card-cat:hover { background: rgba(212,175,55,0.2); }

.blog-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 0;
    color: #fff;
}

.blog-card-title a { color: inherit; text-decoration: none; }
.blog-card-title a:hover { color: #d4af37; }

.blog-card-excerpt {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.7;
    margin: 0;
    flex: 1;
}

.blog-card-meta {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.35);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.blog-card-sep { opacity: .4; }

/* =====================
   Search Bar
   ===================== */
.blog-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
}

.blog-search-input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 12px 18px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color .2s;
}

.blog-search-input:focus {
    outline: none;
    border-color: rgba(212,175,55,0.5);
}

.blog-search-btn {
    background: #d4af37;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: background .2s;
}

.blog-search-btn:hover { background: #c9a227; }

/* =====================
   Sidebar
   ===================== */
.blog-sidebar { position: sticky; top: 90px; }

.blog-widget {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
}

.blog-widget-sticky { position: sticky; top: 90px; }

.blog-widget-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #d4af37;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.blog-cat-list { list-style: none; margin: 0; padding: 0; }

.blog-cat-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background .15s, color .15s;
    margin-bottom: 4px;
}

.blog-cat-link:hover, .blog-cat-link.active {
    background: rgba(212,175,55,0.1);
    color: #d4af37;
}

.blog-cat-count {
    font-size: 0.75rem;
    background: rgba(255,255,255,0.07);
    border-radius: 20px;
    padding: 2px 8px;
    color: rgba(255,255,255,0.4);
}

/* =====================
   Pagination
   ===================== */
.blog-pagination { margin-top: 36px; }

.blog-pag-nav {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.blog-pag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all .15s;
}

.blog-pag-btn:hover { background: rgba(212,175,55,0.15); border-color: rgba(212,175,55,0.3); color: #d4af37; }
.blog-pag-btn.active { background: #d4af37; border-color: #d4af37; color: #111; font-weight: 700; }
.blog-pag-btn.disabled { opacity: .3; pointer-events: none; }

/* =====================
   Empty State
   ===================== */
.blog-empty {
    text-align: center;
    padding: 80px 20px;
    color: rgba(255,255,255,0.3);
    font-size: 1.1rem;
}

/* =====================
   Single Article
   ===================== */
.blog-article { padding-bottom: 80px; }

.blog-article-cover {
    width: 100%;
    height: 420px;
    overflow: hidden;
    position: relative;
    margin-bottom: 0;
}

.blog-article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-article-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(18,18,18,0.95) 100%);
}

.blog-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.35);
    padding: 20px 0 0;
    flex-wrap: wrap;
}

.blog-breadcrumb a { color: rgba(255,255,255,0.5); text-decoration: none; }
.blog-breadcrumb a:hover { color: #d4af37; }
.blog-breadcrumb span { color: rgba(255,255,255,0.25); }

.blog-article-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 48px;
    align-items: start;
    margin-top: 32px;
}

.blog-article-header { margin-bottom: 32px; }

.blog-article-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.4;
    margin: 14px 0 16px;
}

.blog-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.blog-article-excerpt {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.8;
    margin: 20px 0 0;
    padding: 16px 20px;
    border-right: 3px solid #d4af37;
    background: rgba(212,175,55,0.05);
    border-radius: 0 8px 8px 0;
}

/* Table of Contents */
.blog-toc {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 32px;
}

.blog-toc-title {
    font-weight: 700;
    color: #d4af37;
    margin-bottom: 14px;
    font-size: 0.95rem;
}

#blog-toc-list { margin: 0; padding: 0; list-style: none; }

#blog-toc-list li { margin-bottom: 6px; }

#blog-toc-list li a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color .15s;
}

#blog-toc-list li a:hover { color: #d4af37; }

#blog-toc-list li.toc-h3 { padding-right: 16px; }
#blog-toc-list li.toc-h3 a { font-size: 0.85rem; }

/* Article Content Typography */
.blog-article-content.prose {
    color: rgba(255,255,255,0.8);
    font-size: 1.05rem;
    line-height: 1.9;
}

.blog-article-content.prose h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin: 40px 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(212,175,55,0.3);
}

.blog-article-content.prose h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #d4af37;
    margin: 30px 0 12px;
}

.blog-article-content.prose p { margin-bottom: 18px; }

.blog-article-content.prose a {
    color: #d4af37;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.blog-article-content.prose ul,
.blog-article-content.prose ol {
    padding-right: 24px;
    margin-bottom: 18px;
}

.blog-article-content.prose li { margin-bottom: 8px; }

.blog-article-content.prose blockquote {
    border-right: 4px solid #d4af37;
    padding: 12px 20px;
    margin: 24px 0;
    background: rgba(212,175,55,0.06);
    border-radius: 0 8px 8px 0;
    color: rgba(255,255,255,0.65);
    font-style: italic;
}

.blog-article-content.prose img {
    max-width: 100%;
    border-radius: 10px;
    margin: 20px 0;
}

.blog-article-content.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.95rem;
}

.blog-article-content.prose th,
.blog-article-content.prose td {
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.1);
    text-align: right;
}

.blog-article-content.prose th {
    background: rgba(212,175,55,0.1);
    color: #d4af37;
    font-weight: 700;
}

.blog-article-content.prose code {
    background: rgba(255,255,255,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    direction: ltr;
    display: inline-block;
}

.blog-article-content.prose pre {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 20px;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
    margin: 24px 0;
}

/* Tags */
.blog-article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.blog-tags-label {
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
}

.blog-tag-pill {
    display: inline-block;
    padding: 5px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    color: rgba(255,255,255,0.6);
    font-size: 0.82rem;
    text-decoration: none;
    transition: all .15s;
}

.blog-tag-pill:hover {
    background: rgba(212,175,55,0.1);
    border-color: rgba(212,175,55,0.3);
    color: #d4af37;
}

/* Share Buttons */
.blog-share {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.blog-share-label {
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
}

.blog-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .15s;
}

.blog-share-btn:hover { opacity: .85; }
.blog-share-wa  { background: #25D366; color: #fff; }
.blog-share-tg  { background: #0088cc; color: #fff; }
.blog-share-tw  { background: #1DA1F2; color: #fff; }

/* Related Posts */
.blog-related { margin-top: 60px; padding-top: 40px; border-top: 1px solid rgba(255,255,255,0.07); }

.blog-related-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 24px;
}

/* =====================
   Admin Blog Form
   ===================== */
.blog-form-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    align-items: start;
}

.blog-form-main { display: flex; flex-direction: column; gap: 20px; }
.blog-form-side { display: flex; flex-direction: column; gap: 16px; }

.admin-form-group { display: flex; flex-direction: column; gap: 6px; }

.admin-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
}

.admin-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    width: 100%;
    transition: border-color .2s;
}

.admin-input:focus {
    outline: none;
    border-color: rgba(212,175,55,0.5);
}

textarea.admin-input { resize: vertical; }

select.admin-input { cursor: pointer; }

.admin-error {
    font-size: 0.78rem;
    color: #e74c3c;
}

.admin-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
}

.admin-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #d4af37;
    cursor: pointer;
}

.blog-seo-box {
    background: rgba(212,175,55,0.04);
    border: 1px solid rgba(212,175,55,0.15);
    border-radius: 12px;
    padding: 20px;
}

.blog-seo-box-title {
    font-weight: 700;
    color: #d4af37;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.blog-side-widget {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 16px;
}

.blog-side-widget-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 12px;
}

.blog-tags-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.blog-tag-check-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 4px 12px;
    transition: all .15s;
}

.blog-tag-check-label:hover {
    background: rgba(212,175,55,0.1);
    border-color: rgba(212,175,55,0.3);
    color: #d4af37;
}

.blog-tag-check-label input { accent-color: #d4af37; }

/* Admin badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: rgba(39,174,96,0.15); color: #2ecc71; border: 1px solid rgba(39,174,96,0.3); }
.badge-muted   { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.35); border: 1px solid rgba(255,255,255,0.08); }

/* =====================
   Responsive
   ===================== */
@media (max-width: 1024px) {
    .blog-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .blog-article-layout { grid-template-columns: 1fr; }
    .blog-article-sidebar { display: none; }
    .blog-form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .blog-layout { grid-template-columns: 1fr; }
    .blog-sidebar { display: none; }
    .blog-grid { grid-template-columns: 1fr; }
    .blog-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .blog-article-cover { height: 240px; }
    .blog-article-title { font-size: 1.4rem; }
}

@media (max-width: 480px) {
    .blog-grid-4 { grid-template-columns: 1fr; }
}
