/* Premium Blog & Blog Single Page Stylesheet */

/* Grid and Gutter Extensions */
.g-6, .gx-6 { --bs-gutter-x: 3.5rem }
.g-6, .gy-6 { --bs-gutter-y: 3.5rem }
.g-8, .gx-8 { --bs-gutter-x: 4.5rem }
.g-8, .gy-8 { --bs-gutter-y: 4.5rem }

/* Blog Hero Banner — Lebedev hard panel (no SaaS blue glow) */
.blog-hero {
    background: var(--card-bg, #fffdf8);
    border-radius: 4px;
    padding: 2rem 1.25rem;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--ink, #121212);
    box-shadow: 4px 4px 0 var(--ink, #121212);
}
.blog-hero::before {
    content: none;
}
.blog-hero-title {
    font-family: var(--font-display, system-ui, sans-serif);
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    letter-spacing: -0.03em;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.blog-hero-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 40rem;
    margin: 0 auto;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}
/* Never show raw HTML tags if something leaks */
.blog-hero-desc code,
.blog-hero-desc pre {
    white-space: pre-wrap;
}

/* Premium Blog Card — paper panel (NOT sidebar black) */
.blog-card {
    /* Was var(--sidebar-bg)=#121212 → black cards in light theme. Use paper. */
    background-color: var(--card-bg, #fffdf8);
    border: 2px solid var(--ink, #121212);
    border-radius: 4px;
    box-shadow: 3px 3px 0 var(--ink, #121212);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: var(--ink, #121212);
}
.blog-card:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 var(--ink, #121212);
    border-color: var(--ink, #121212);
}
html.dark .blog-card {
    background-color: var(--card-bg, #1a1a1a);
    border-color: var(--ink, #f4f1ea);
    box-shadow: 3px 3px 0 var(--ink, #f4f1ea);
    color: var(--ink, #f4f1ea);
}
html.dark .blog-card:hover {
    box-shadow: 4px 4px 0 var(--ink, #f4f1ea);
}
.blog-card-img-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background-color: #f4f1ea;
    width: 100%;
    display: block;
    isolation: isolate;
    border-bottom: 2px solid var(--ink, #121212);
}
html.dark .blog-card-img-wrap {
    border-bottom-color: var(--ink, #f4f1ea);
    background-color: #121212;
}
.blog-card-img-wrap a {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.blog-card-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    display: block !important;
    object-fit: cover !important;
    object-position: center center;
    background: #f4f1ea;
    transition: none !important;
}
.blog-card-img[src$=".svg"],
.blog-card-img[src*=".svg?"] {
    object-fit: cover !important;
    padding: 0;
}
.blog-card:hover .blog-card-img {
    transform: none;
}
.blog-card-body {
    padding: 1.15rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: var(--card-bg, #fffdf8);
}
html.dark .blog-card-body {
    background: var(--card-bg, #1a1a1a);
}
.blog-card-meta {
    font-size: 0.8rem;
    /* Light paper: dark readable ink (not grey-on-black) */
    color: #3a3630;
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
}
.blog-card-meta i {
    color: #121212;
    opacity: 0.75;
    font-size: 0.85em;
}
html.dark .blog-card-meta {
    color: #cfc7b8;
}
html.dark .blog-card-meta i {
    color: #ff8c1a;
    opacity: 1;
}
.blog-card-title {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 0.65rem;
    color: var(--ink, #121212);
    font-family: var(--font-display, system-ui, sans-serif);
}
.blog-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}
.blog-card-title a:hover {
    color: #121212;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}
html.dark .blog-card-title {
    color: var(--ink, #f4f1ea);
}
html.dark .blog-card-title a:hover {
    color: #ff8c1a;
}
.blog-card-excerpt {
    font-size: 0.92rem;
    color: #2a2a2a;
    line-height: 1.55;
    margin-bottom: 1.15rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-height: 4.8em;
    font-weight: 500;
    opacity: 1;
}
html.dark .blog-card-excerpt {
    color: #cfc7b8;
}
.blog-card-footer {
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(18, 18, 18, 0.14);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
html.dark .blog-card-footer {
    border-top-color: rgba(244, 241, 234, 0.18);
}
.blog-read-more {
    font-size: 0.82rem;
    font-weight: 700;
    color: #121212;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-bottom: 2px solid #ff8c1a;
    padding-bottom: 1px;
    transition: gap 0.15s ease, color 0.15s ease;
}
/* Compact arrow — never huge FA glyph */
.blog-read-more i,
.blog-read-more .blog-read-more-arrow {
    font-size: 0.75em !important;
    width: 0.85em;
    height: 0.85em;
    line-height: 1;
    opacity: 0.85;
    transition: transform 0.15s ease;
}
.blog-card:hover .blog-read-more {
    color: #121212;
    gap: 0.45rem;
}
.blog-card:hover .blog-read-more i,
.blog-card:hover .blog-read-more-arrow {
    transform: translateX(2px);
}
html.dark .blog-read-more {
    color: #ff8c1a;
    border-bottom-color: #ff8c1a;
}

/* Pagination Overrides */
.pagination {
    margin-top: 2rem;
    justify-content: center;
}
.pagination .page-item .page-link {
    border-radius: 8px;
    margin: 0 4px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg, #fffdf8);
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}
.pagination .page-item.active .page-link {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #121212 !important;
    box-shadow: 0 4px 10px rgba(234, 118, 0, 0.25);
}
.pagination .page-item .page-link:hover {
    background-color: var(--primary-color);
    color: #121212;
    border-color: var(--primary-color);
}

/* Blog Single Page */
.blog-single-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 1.5rem 0;
}
.blog-single-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.blog-single-title {
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-dark);
    margin-bottom: 1.25rem;
    letter-spacing: -0.5px;
}
@media (max-width: 768px) {
    .blog-single-title {
        font-size: 1.8rem;
    }
}
.blog-single-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    /* Light: not washed grey — readable date/time */
    color: #1c1916;
    font-size: 0.9rem;
    font-weight: 600;
}
html.dark .blog-single-meta {
    color: #cfc7b8;
}
.blog-single-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.blog-single-meta-item i {
    color: var(--primary-color);
}
.blog-single-img-wrap {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    margin-bottom: 3rem;
    aspect-ratio: 21 / 10;
    border: 1px solid var(--border-color);
    width: 100%;
    display: block;
    isolation: isolate;
}
.blog-single-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    display: block !important;
    object-fit: cover !important;
}
.blog-single-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 3rem;
}

/* Sharing Section */
.blog-single-share {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4rem;
}
.share-title {
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.share-buttons {
    display: flex;
    gap: 0.6rem;
}
.share-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-size: 0.95rem;
}
.share-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}
/* RU share: VK, Telegram, copy link */
.share-vk { background-color: #0077ff; }
.share-telegram { background-color: #26a5e4; }
.share-link {
  background-color: #6c757d;
  cursor: pointer;
  border: none;
  padding: 0;
  font-family: inherit;
}
.share-btn.is-copied {
  outline: 2px solid var(--accent-hot, #ff8c1a);
  outline-offset: 2px;
}

/* Back Button */
.back-to-blog-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 1.5rem;
    transition: color 0.2s ease, transform 0.2s ease;
}
.back-to-blog-btn:hover {
    color: #121212;
    background: rgba(255, 140, 26, 0.18);
    transform: translateX(-3px);
}
html.dark .back-to-blog-btn:hover {
    color: #ff8c1a;
    background: transparent;
}

/* Recent Posts section */
.recent-posts-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

/* Dark Mode Extensions */
html.dark .blog-hero {
    background: var(--card-bg, #1a1a1a);
    border-color: var(--ink, #f4f1ea);
    box-shadow: 4px 4px 0 var(--ink, #f4f1ea);
}
html.dark .blog-card-img-wrap,
html.dark .blog-single-img-wrap {
    background: #121212;
    border-color: var(--ink, #f4f1ea);
}
html.dark .blog-single-img-wrap {
    box-shadow: 4px 4px 0 var(--ink, #f4f1ea);
}
html.dark .blog-single-content .blog-figure,
html.dark .blog-content .blog-figure {
    background: #1a1a1a;
    border-color: #f4f1ea;
    box-shadow: 4px 4px 0 #f4f1ea;
}
html.dark .blog-single-content .blog-figure figcaption,
html.dark .blog-content .blog-figure figcaption {
    border-top-color: #121212;
    background: #ff8c1a;
    color: #121212;
}
html.dark .blog-tools-box {
    background: #1a1a1a;
    border-color: #f4f1ea;
    box-shadow: 3px 3px 0 #f4f1ea;
}
/* hard shadows for dark already set on .blog-card above */
html.dark .blog-single-img-wrap {
    box-shadow: 4px 4px 0 var(--ink, #f4f1ea);
    border-color: var(--ink, #f4f1ea);
}

/* Blog Search Bar */
.blog-search-wrap {
    max-width: 500px;
    margin: 0 auto 3rem auto;
}
.blog-search-wrap .input-group {
    background-color: var(--card-bg, #fffdf8);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.blog-search-wrap .input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 4px 25px rgba(0, 123, 255, 0.1);
}
.blog-search-icon {
    background-color: transparent !important;
    border: none !important;
    color: var(--text-muted);
    padding-left: 1.2rem;
}
.blog-search-input {
    border: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    color: var(--text-dark) !important;
    font-weight: 500;
}
.blog-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}
.btn-blog-search {
    background-color: var(--primary-color, #ff8c1a) !important;
    color: #121212 !important;
    border-radius: 24px !important;
    padding: 0.5rem 1.5rem !important;
    font-weight: 700;
    border: none !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
}
html.dark .btn-blog-search {
    background-color: #ff8c1a !important;
    color: #121212 !important;
}
.btn-blog-search:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
/* SEO article CTAs */
.blog-single-content .blog-cta { margin: 1.25rem 0; }
.blog-single-content .blog-cta .btn,
.blog-single-content a.btn-search {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 1.1rem;
  background: #ff8c1a;
  color: #121212 !important;
  border: 2px solid #121212;
  font-weight: 800;
  text-decoration: none !important;
  box-shadow: 3px 3px 0 #121212;
  font-size: 0.95rem;
}
/* Keep trailing → in CTA text modest, not a giant glyph */
.blog-single-content .blog-cta .btn,
.blog-single-content a.btn-search {
  letter-spacing: 0;
}
.blog-tools-box {
  margin: 1.75rem 0;
  padding: 1rem 1.15rem;
  border: 2px solid #121212;
  background: #fffdf8;
  box-shadow: 3px 3px 0 #121212;
}
.blog-tools-box h3 { font-size: 1.05rem; font-weight: 800; margin: 0 0 0.65rem; }
.blog-tools-box ul { margin: 0; padding-left: 1.1rem; }
.blog-tools-box a { font-weight: 700; color: inherit; }

/* Inline diagrams / figures in articles */
.blog-single-content .blog-figure,
.blog-content .blog-figure {
  margin: 1.5rem 0 1.75rem;
  padding: 0;
  border: 2px solid #121212;
  box-shadow: 4px 4px 0 #121212;
  background: #fffdf8;
  overflow: hidden;
}
.blog-single-content .blog-figure img,
.blog-content .blog-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border: 0;
  margin: 0;
}
.blog-single-content .blog-figure figcaption,
.blog-content .blog-figure figcaption {
  margin: 0;
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-top: 2px solid #121212;
  background: #ff8c1a;
  color: #121212;
}
.blog-single-img-wrap {
  border: 2px solid #121212;
  box-shadow: 4px 4px 0 #121212;
  overflow: hidden;
  background: #f4f1ea;
}
.blog-single-img,
.blog-card-img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}
.blog-card-img-wrap {
  border-bottom: 2px solid #121212;
  overflow: hidden;
  background: #f4f1ea;
}

/* ---- blog mobile fit ---- */
@media (max-width: 767.98px) {
  .blog-hero {
    padding: 1.35rem 1rem;
    margin-bottom: 1.25rem;
    box-shadow: 3px 3px 0 var(--ink, #121212);
  }
  .blog-hero-title {
    font-size: 1.55rem;
  }
  .blog-hero-desc {
    font-size: 0.95rem;
  }
  .blog-card-title {
    font-size: 1.05rem;
    overflow-wrap: anywhere;
  }
  .blog-card-img-wrap {
    aspect-ratio: 16 / 9;
  }
  .blog-search-wrap .input-group {
    flex-wrap: wrap;
  }
  .blog-search-wrap .form-control {
    min-width: 0;
    font-size: 16px; /* no iOS zoom */
  }
  .main-content.container {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
    overflow-x: hidden;
  }
}


/* Compact text arrows — no FA giant glyphs */
.back-to-blog-arrow {
  display: inline-block;
  font-size: 0.95em;
  font-weight: 700;
  line-height: 1;
  margin-right: 0.15rem;
}
.blog-read-more-arrow {
  font-size: 0.85em !important;
  font-weight: 700;
  opacity: 0.75;
  line-height: 1;
}
/* CTA button trailing arrows stay normal text weight */
.blog-single-content .blog-cta .btn,
.blog-single-content a.btn-search {
  font-variant-ligatures: none;
}

/* ---- Pagination (blog) — no giant Tailwind SVG arrows ---- */
nav[aria-label="Pagination Navigation"] svg,
.pagination svg,
svg.w-5.h-5 {
  width: 1.15rem !important;
  height: 1.15rem !important;
  max-width: 1.15rem !important;
  max-height: 1.15rem !important;
  display: inline-block !important;
  vertical-align: middle;
  flex: 0 0 auto;
}
.blog-pagination,
.d-flex.justify-content-center .pagination {
  gap: 0.25rem;
  flex-wrap: wrap;
}
.blog-pagination .page-link,
.pagination .page-link {
  border: 2px solid #121212 !important;
  color: #121212 !important;
  background: #fffdf8 !important;
  font-weight: 700 !important;
  min-width: 2.5rem;
  min-height: 2.5rem;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 2px !important;
  box-shadow: 2px 2px 0 #121212;
  margin: 0 0.15rem;
}
.pagination .page-item.active .page-link {
  background: #ff8c1a !important;
  color: #121212 !important;
  border-color: #121212 !important;
}
.pagination .page-item.disabled .page-link {
  opacity: 0.45;
  box-shadow: none;
}
html.dark .pagination .page-link {
  background: #1a1a1a !important;
  color: #f4f1ea !important;
  border-color: #f4f1ea !important;
  box-shadow: 2px 2px 0 #f4f1ea;
}
html.dark .pagination .page-item.active .page-link {
  background: #ff8c1a !important;
  color: #121212 !important;
}
