/* ============================================
   BLOG POST PAGE STYLES
   ============================================ */

/* ============================================
   READING PROGRESS BAR
   ============================================ */
.bp-reading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 9999;
    pointer-events: none;
}

.bp-reading-bar__fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--c-accent), #e6a817);
    border-radius: 0 2px 2px 0;
    transition: width .15s linear;
}

/* ============================================
   HERO — КЛЮЧЕВЫЕ ИСПРАВЛЕНИЯ
   ============================================ */
.bp-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    min-height: 420px;
    /* Верхний padding чтобы контент не залезал под шапку */
    padding-top: 120px;
}

.bp-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.bp-hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bp-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(15, 23, 42, .92) 0%,
        rgba(15, 23, 42, .65) 40%,
        rgba(15, 23, 42, .35) 100%
    );
}

.bp-hero__inner {
    position: relative;
    z-index: 1;
    padding: 40px 0 48px;
    max-width: 820px;
    width: 100%;
}

.bp-hero__breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 20px;
}

.bp-hero__breadcrumbs a {
    color: rgba(255, 255, 255, .6);
    text-decoration: none;
    transition: color .2s;
    flex-shrink: 0;
}

.bp-hero__breadcrumbs a:hover {
    color: var(--c-white);
}

.bp-hero__breadcrumbs span {
    color: rgba(255, 255, 255, .4);
}

.bp-hero__breadcrumbs span:last-child {
    color: rgba(255, 255, 255, .7);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.bp-hero__sep {
    color: rgba(255, 255, 255, .3);
    flex-shrink: 0;
}

.bp-hero__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.bp-hero__tag {
    display: inline-block;
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--c-accent);
    background: rgba(212, 133, 10, .15);
    border-radius: var(--r-pill);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.bp-hero__title {
    font-family: var(--ff-serif);
    font-size: clamp(24px, 4vw, 44px);
    font-weight: 700;
    color: var(--c-white);
    line-height: 1.2;
    margin-bottom: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.bp-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.bp-hero__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, .7);
    white-space: nowrap;
}

.bp-hero__meta-item i {
    font-size: 14px;
    opacity: .7;
}

/* ============================================
   LAYOUT: sidebar + article
   ============================================ */
.bp-section {
    padding: 48px 0 80px;
    background: var(--c-white);
}

.bp-layout {
    display: grid;
    grid-template-columns: 25% 1fr;
    gap: 48px;

}

/* ============================================
   SIDEBAR — STICKY
   ============================================ */
.bp-sidebar {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 24px; /* Отступ между карточкой автора и липким блоком */
}

/* Карточка автора (обычный блок, прокручивается) */
.bp-author-card {
    background: var(--c-lighter);
    border-radius: var(--r-card);
    padding: 24px 20px;
    text-align: center;
    flex-shrink: 0; /* Не сжимается */
    /* Остальные стили остаются без изменений */
}

/* Липкий контейнер */
.bp-sidebar__sticky {
    position: sticky;
    top: 110px; /* Отступ от верха экрана */
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--c-border) transparent;
}
/* --- Author Card --- */
.bp-author-card {
    background: var(--c-lighter);
    border-radius: var(--r-card);
    padding: 24px 20px;
    text-align: center;
    flex-shrink: 0;
}

.bp-author-card__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 12px;
    border: 3px solid var(--c-white);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .1);
}

.bp-author-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bp-author-card__info {
    margin-bottom: 8px;
}

.bp-author-card__name {
    display: block;
    font-family: var(--ff-serif);
    font-size: 16px;
    font-weight: 600;
    color: var(--c-dark);
    line-height: 1.3;
}

.bp-author-card__role {
    display: block;
    font-size: 12px;
    color: var(--c-muted);
    margin-top: 2px;
}

.bp-author-card__bio {
    font-size: 13px;
    line-height: 1.5;
    color: var(--c-body);
    margin: 0;
}

/* --- Table of Contents --- */
.bp-toc {
    background: var(--c-lighter);
    border-radius: var(--r-card);
    padding: 20px;
    position: relative;
    flex-shrink: 0;
}

.bp-toc__title {
    font-family: var(--ff-serif);
    font-size: 14px;
    font-weight: 600;
    color: var(--c-dark);
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.bp-toc__progress-track {
    position: absolute;
    left: 20px;
    top: 56px;
    bottom: 20px;
    width: 3px;
    background: var(--c-border);
    border-radius: 2px;
    overflow: hidden;
}

.bp-toc__progress-bar {
    width: 100%;
    height: 0%;
    background: var(--c-accent);
    border-radius: 2px;
    transition: height .25s ease;
}

.bp-toc__list {
    list-style: none;
    margin: 0;
    padding: 0 0 0 16px;
}

.bp-toc__list li {
    position: relative;
    margin-bottom: 4px;
}

.bp-toc__list li a {
    display: block;
    padding: 6px 10px 6px 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--c-muted);
    text-decoration: none;
    transition: color .2s;
    border-radius: 4px;
}

.bp-toc__list li a:hover {
    color: var(--c-dark);
}

.bp-toc__list li.is-active > a {
    color: var(--c-accent);
    font-weight: 600;
}

.bp-toc__list li.is-read > a {
    color: var(--c-dark);
}

/* --- Sidebar Actions --- */
.bp-sidebar-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.bp-like-btn,
.bp-share-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--r-pill);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    border: 1px solid var(--c-border);
    background: var(--c-white);
    color: var(--c-body);
}

.bp-like-btn:hover {
    border-color: #e74c3c;
    color: #e74c3c;
    background: rgba(231, 76, 60, .04);
}

.bp-like-btn.is-liked {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, .08);
    color: #e74c3c;
}

.bp-like-btn.is-liked i {
    font-weight: 900;
}

.bp-share-btn:hover {
    border-color: var(--c-accent);
    color: var(--c-accent);
    background: rgba(212, 133, 10, .04);
}

/* ============================================
   SHARE DROPDOWN
   ============================================ */
.bp-share-dropdown {
    position: fixed;
    z-index: 10000;
    display: none;
    flex-direction: column;
    min-width: 180px;
    background: var(--c-white);
    border: 1px solid var(--c-border);
    border-radius: var(--r-card);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .12);
    padding: 6px;
    animation: bpDropIn .2s ease;
}

.bp-share-dropdown.is-open {
    display: flex;
}

.bp-share-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--c-body);
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}

.bp-share-dropdown__item:hover {
    background: var(--c-lighter);
}

.bp-share-dropdown__item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.bp-share-dropdown__item[data-share="vk"] i { color: #4a76a8; }
.bp-share-dropdown__item[data-share="tg"] i { color: #0088cc; }
.bp-share-dropdown__item[data-share="wa"] i { color: #25d366; }
.bp-share-dropdown__item[data-share="copy"] i { color: var(--c-muted); }

@keyframes bpDropIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   ARTICLE CONTENT
   ============================================ */
.bp-article {
    min-width: 0;
}

.bp-article__content {
    font-size: 16.5px;
    line-height: 1.75;
    color: var(--c-body);
}

.bp-article__content h2 {
    font-family: var(--ff-serif);
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
    color: var(--c-dark);
    line-height: 1.25;
    margin: 48px 0 18px;
    padding-top: 16px;
}

.bp-article__content h2:first-child {
    margin-top: 0;
}

.bp-article__content h3 {
    font-family: var(--ff-serif);
    font-size: clamp(18px, 2.5vw, 22px);
    font-weight: 600;
    color: var(--c-dark);
    line-height: 1.3;
    margin: 36px 0 14px;
}

.bp-article__content h4 {
    font-size: 17px;
    font-weight: 600;
    color: var(--c-dark);
    margin: 28px 0 10px;
}

.bp-article__content p {
    margin: 0 0 18px;
}

.bp-article__content a {
    color: var(--c-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color .2s;
}

.bp-article__content a:hover {
    color: var(--c-dark);
}

.bp-article__content img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--r-card);
    margin: 28px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
}

.bp-article__content figure {
    margin: 28px 0;
}

.bp-article__content figure img {
    margin: 0;
}

.bp-article__content figcaption {
    font-size: 13px;
    color: var(--c-muted);
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

/* Floating images alongside text */
.bp-article__content .article-img {
    max-width: 45%;
    margin: 8px 0 20px;
}

.bp-article__content .article-img--right {
    float: right;
    margin-left: 28px;
    margin-right: 0;
}

.bp-article__content .article-img--left {
    float: left;
    margin-right: 28px;
    margin-left: 0;
}

.bp-article__content .article-img img {
    width: 100%;
    margin: 0;
}

.bp-article__content .article-img figcaption {
    font-size: 12px;
    line-height: 1.4;
    padding: 0 4px;
}

.bp-article__content ul,
.bp-article__content ol {
    margin: 0 0 18px;
    padding-left: 24px;
}

.bp-article__content li {
    margin-bottom: 8px;
}

.bp-article__content blockquote {
    position: relative;
    margin: 32px 0;
    padding: 24px 28px 24px 32px;
    background: var(--c-lighter);
    border-left: 4px solid var(--c-accent);
    border-radius: 0 var(--r-card) var(--r-card) 0;
    font-size: 16px;
    font-style: italic;
    color: var(--c-dark);
    line-height: 1.6;
}

.bp-article__content blockquote p:last-child {
    margin-bottom: 0;
}

.bp-article__content code {
    background: var(--c-lighter);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
}

.bp-article__content pre {
    background: var(--c-dark);
    color: var(--c-lighter);
    padding: 24px;
    border-radius: var(--r-card);
    overflow-x: auto;
    margin: 24px 0;
}

.bp-article__content pre code {
    background: none;
    padding: 0;
    font-size: 14px;
    color: inherit;
}

.bp-article__content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 14px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.bp-article__content th,
.bp-article__content td {
    padding: 12px 16px;
    border: 1px solid var(--c-border);
    text-align: left;
}

.bp-article__content th {
    background: var(--c-lighter);
    font-weight: 600;
    color: var(--c-dark);
}

.bp-article__content hr {
    border: none;
    height: 1px;
    background: var(--c-border);
    margin: 40px 0;
}

.bp-article__content .info-box {
    background: #eef6ff;
    border: 1px solid #b8d8fb;
    border-radius: var(--r-card);
    padding: 20px 24px;
    margin: 24px 0;
    font-size: 15px;
    line-height: 1.6;
}

.bp-article__content .info-box::before {
    content: '\1F4A1';
    font-size: 18px;
    margin-right: 8px;
}

.bp-article__content .warning-box {
    background: #fff8ec;
    border: 1px solid #f5d89a;
    border-radius: var(--r-card);
    padding: 20px 24px;
    margin: 24px 0;
    font-size: 15px;
    line-height: 1.6;
}

.bp-article__content .warning-box::before {
    content: '\26A0\FE0F';
    font-size: 18px;
    margin-right: 8px;
}

/* ============================================
   ARTICLE TAGS (bottom)
   ============================================ */
.bp-article__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--c-border);
}

.bp-article__tag {
    display: inline-block;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--c-accent);
    background: rgba(212, 133, 10, .06);
    border: 1px solid rgba(212, 133, 10, .15);
    border-radius: var(--r-pill);
}

/* ============================================
   BOTTOM AUTHOR & LIKE
   ============================================ */
.bp-article__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 32px;
    padding: 24px 28px;
    background: var(--c-lighter);
    border-radius: var(--r-card);
}

.bp-author-inline {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bp-author-inline__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.bp-author-inline__text {
    display: flex;
    flex-direction: column;
}

.bp-author-inline__text strong {
    font-family: var(--ff-serif);
    font-size: 15px;
    color: var(--c-dark);
}

.bp-author-inline__text span {
    font-size: 13px;
    color: var(--c-muted);
    margin-top: 2px;
}

.bp-like-btn--large {
    padding: 12px 24px;
    font-size: 14px;
    border-radius: var(--r-pill);
    border: 1px solid var(--c-border);
    background: var(--c-white);
    color: var(--c-body);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all .2s;
}

.bp-like-btn--large:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

.bp-like-btn--large.is-liked {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, .08);
    color: #e74c3c;
}

.bp-like-btn--large.is-liked i {
    font-weight: 900;
}

.bp-like-btn__count {
    font-weight: 600;
}

/* ============================================
   POST NAVIGATION
   ============================================ */
.bp-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--c-border);
}

.bp-nav__link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 24px;
    background: var(--c-lighter);
    border-radius: var(--r-card);
    text-decoration: none;
    color: inherit;
    transition: box-shadow .2s, transform .2s;
    border: 1px solid transparent;
}

.bp-nav__link:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    border-color: var(--c-border);
}

.bp-nav__link--next {
    text-align: right;
}

.bp-nav__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--c-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bp-nav__link--next .bp-nav__label {
    justify-content: flex-end;
}

.bp-nav__title {
    font-family: var(--ff-serif);
    font-size: 15px;
    font-weight: 600;
    color: var(--c-dark);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   CTA BANNER
   ============================================ */
.bp-cta-banner {
    padding: 0;
    background: var(--c-white);
}

.bp-cta-banner__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 40px 48px;
    background: var(--c-dark);
    border-radius: var(--r-card);
    margin-bottom: 80px;
}

.bp-cta-banner__text h2 {
    font-family: var(--ff-serif);
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 700;
    color: var(--c-white);
    margin: 0 0 8px;
}

.bp-cta-banner__text p {
    font-size: 15px;
    color: rgba(255, 255, 255, .65);
    margin: 0;
}

/* ============================================
   RESPONSIVE — TABLET
   ============================================ */
@media (max-width: 1024px) {
    .bp-layout {
        grid-template-columns: 220px 1fr;
        gap: 32px;
    }

    .bp-author-card__bio {
        display: none;
    }
}

/* ============================================
   RESPONSIVE — SMALL TABLET & MOBILE (≤860)
   ============================================ */
@media (max-width: 860px) {
    .bp-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .bp-sidebar {
        order: -1;
    }

    .bp-sidebar__sticky {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .bp-author-card {
        display: none;
    }

    .bp-toc {
        margin-bottom: 32px;
    }

    .bp-toc__progress-track {
        display: none;
    }

    .bp-toc__list {
        padding-left: 0;
    }

    .bp-toc__list li a {
        padding: 8px 12px;
        background: var(--c-white);
        border-radius: 6px;
    }

    .bp-sidebar-actions {
        display: none;
    }

    .bp-nav {
        grid-template-columns: 1fr;
    }

    .bp-nav__link--next {
        text-align: left;
    }

    .bp-nav__link--next .bp-nav__label {
        justify-content: flex-start;
    }

    .bp-cta-banner__inner {
        flex-direction: column;
        text-align: center;
        padding: 32px 24px;
    }

    .bp-article__bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

/* ============================================
   RESPONSIVE — MOBILE (≤768)
   ============================================ */
@media (max-width: 768px) {

    /* ── HERO: боковые отступы + отступ от шапки ── */
    .bp-hero {
        min-height: auto;
        padding-top: 100px;
    }

    .bp-hero__inner {
        padding: 24px 16px 32px;
    }

    .bp-hero__breadcrumbs {
        font-size: 12px;
        margin-bottom: 14px;
    }

    .bp-hero__breadcrumbs span:last-child {
        max-width: 180px;
    }

    .bp-hero__tags {
        gap: 6px;
        margin-bottom: 12px;
    }

    .bp-hero__tag {
        padding: 4px 10px;
        font-size: 10px;
    }

    .bp-hero__title {
        font-size: clamp(20px, 5.5vw, 28px);
        margin-bottom: 16px;
        line-height: 1.3;
    }

    .bp-hero__meta {
        gap: 8px 14px;
    }

    .bp-hero__meta-item {
        font-size: 12px;
        gap: 5px;
    }

    .bp-hero__meta-item i {
        font-size: 12px;
    }

    /* ── Контент ── */
    .bp-section {
        padding: 24px 0 48px;
    }

    .bp-article__content {
        font-size: 15.5px;
    }

    .bp-article__content h2 {
        font-size: clamp(20px, 5vw, 24px);
        margin: 36px 0 14px;
    }

    .bp-article__content h3 {
        font-size: clamp(17px, 4vw, 20px);
        margin: 28px 0 12px;
    }

    .bp-article__content blockquote {
        padding: 16px 16px 16px 20px;
        margin: 24px 0;
        font-size: 15px;
    }

    .bp-article__content .info-box,
    .bp-article__content .warning-box {
        padding: 16px 18px;
        font-size: 14px;
    }
}

/* ============================================
   RESPONSIVE — SMALL MOBILE (≤480)
   ============================================ */
@media (max-width: 768px) {
    /* Disable float on mobile for better readability */
    .bp-article__content .article-img {
        float: none;
        max-width: 100%;
        margin: 24px 0;
    }

    .bp-article__content .article-img--right,
    .bp-article__content .article-img--left {
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 480px) {

    .bp-hero {
        padding-top: 80px;
    }

    .bp-hero__inner {
        padding: 20px 16px 24px;
    }

    .bp-hero__breadcrumbs span:last-child {
        max-width: 140px;
    }

    .bp-hero__title {
        font-size: clamp(18px, 5vw, 22px);
        line-height: 1.3;
        margin-bottom: 14px;
    }

    .bp-article__content {
        font-size: 15px;
        line-height: 1.7;
    }

    .bp-article__content img {
        margin: 20px -16px;
        max-width: calc(100% + 32px);
        border-radius: 0;
    }

    .bp-article__bottom {
        padding: 18px 16px;
    }

    .bp-nav__link {
        padding: 16px;
    }

    .bp-cta-banner__inner {
        margin-bottom: 40px;
        padding: 24px 20px;
    }
}

/* ============================================
   MOBILE TOC — collapsible
   ============================================ */
@media (max-width: 860px) {
    .bp-toc__title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        margin-bottom: 0;
    }

    .bp-toc__title::after {
        content: '\f078';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        font-size: 12px;
        color: var(--c-muted);
        transition: transform .25s;
    }

    .bp-toc.is-collapsed .bp-toc__title::after {
        transform: rotate(-90deg);
    }

    .bp-toc.is-collapsed .bp-toc__list {
        display: none;
    }

    .bp-toc:not(.is-collapsed) .bp-toc__title {
        margin-bottom: 14px;
    }
}
