/* ==========================================================================
   Single Blog Post Layout
   Three-column layout with TOC, content, and sidebar
   ========================================================================== */

/* ----- Post Hero ----- */

.onyx-post-hero {
    background: linear-gradient(180deg, var(--onyx-navy) 0%, var(--onyx-bg-charcoal) 100%);
    padding: 80px 0 40px;
    text-align: center;
}

.onyx-post-hero__categories {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.onyx-post-hero__category {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 187, 9, 0.15);
    border: 1px solid var(--onyx-gold);
    border-radius: 20px;
    font-size: 12px;
    font-weight: var(--onyx-font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--onyx-gold);
    text-decoration: none;
    transition: background 0.2s ease;
}

.onyx-post-hero__category:hover {
    background: rgba(255, 187, 9, 0.25);
}

.onyx-post-hero__title {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: var(--onyx-font-bold);
    color: var(--onyx-text-white);
    line-height: 1.2;
    margin: 0 auto 16px;
    max-width: 800px;
}

.onyx-post-hero__meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.onyx-post-hero__sep {
    opacity: 0.5;
}

.onyx-post-hero__image-wrap {
    margin-top: 40px;
}

.onyx-post-hero__image {
    width: 100%;
    max-width: 900px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ----- Post Body Grid ----- */

.onyx-single-post__body {
    background: var(--onyx-bg-white);
    padding: 48px 0 80px;
}

.onyx-single-post__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 1024px) {
    .onyx-single-post__grid {
        grid-template-columns: 200px 1fr 280px;
        gap: 40px;
    }
}

@media (min-width: 1200px) {
    .onyx-single-post__grid {
        grid-template-columns: 220px 1fr 300px;
        gap: 48px;
    }
}

/* ----- Table of Contents ----- */

.onyx-single-post__toc {
    display: none;
}

@media (min-width: 1024px) {
    .onyx-single-post__toc {
        display: block;
    }
}

.onyx-toc {
    position: sticky;
    top: 100px;
}

.onyx-toc--empty {
    display: none;
}

.onyx-toc__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.onyx-toc__title {
    font-size: 12px;
    font-weight: var(--onyx-font-bold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--onyx-text-caption);
}

.onyx-toc__toggle {
    display: none;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--onyx-text-body);
}

.onyx-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid rgba(31, 39, 59, 0.1);
}

.onyx-toc__item {
    margin: 0;
}

.onyx-toc__item--sub {
    padding-left: 12px;
}

.onyx-toc__link {
    display: block;
    padding: 8px 0 8px 16px;
    font-size: 13px;
    color: var(--onyx-text-body);
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-left: -2px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.onyx-toc__link:hover {
    color: var(--onyx-navy);
}

.onyx-toc__link.is-active {
    color: var(--onyx-navy);
    font-weight: var(--onyx-font-semibold);
    border-left-color: var(--onyx-gold);
}

/* ----- Post Content ----- */

.onyx-single-post__content {
    max-width: 720px;
}

.onyx-single-post__entry {
    font-size: 17px;
    line-height: 1.8;
    color: var(--onyx-text-body);
}

.onyx-single-post__entry h2 {
    font-size: 28px;
    font-weight: var(--onyx-font-bold);
    color: var(--onyx-navy);
    margin: 48px 0 16px;
    scroll-margin-top: 100px;
}

.onyx-single-post__entry h3 {
    font-size: 22px;
    font-weight: var(--onyx-font-semibold);
    color: var(--onyx-navy);
    margin: 32px 0 12px;
    scroll-margin-top: 100px;
}

.onyx-single-post__entry p {
    margin: 0 0 24px;
}

.onyx-single-post__entry ul,
.onyx-single-post__entry ol {
    margin: 0 0 24px;
    padding-left: 24px;
}

.onyx-single-post__entry li {
    margin-bottom: 8px;
}

.onyx-single-post__entry img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px 0;
}

.onyx-single-post__entry blockquote {
    margin: 32px 0;
    padding: 24px 32px;
    background: var(--onyx-bg-off-white, #f8f9fa);
    border-left: 4px solid var(--onyx-gold);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--onyx-navy);
}

.onyx-single-post__entry a {
    color: var(--onyx-navy);
    text-decoration: underline;
    text-decoration-color: var(--onyx-gold);
    text-underline-offset: 2px;
}

.onyx-single-post__entry a:hover {
    color: var(--onyx-gold);
}

/* ----- Author Meta ----- */

.onyx-author-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    margin-bottom: 32px;
    border-bottom: 1px solid rgba(31, 39, 59, 0.1);
}

.onyx-author-meta__avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

.onyx-author-meta__initials {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--onyx-navy);
    color: var(--onyx-text-white);
    font-weight: var(--onyx-font-bold);
    font-size: 20px;
}

.onyx-author-meta__info {
    flex: 1;
}

.onyx-author-meta__name {
    display: block;
    font-weight: var(--onyx-font-semibold);
    color: var(--onyx-navy);
}

.onyx-author-meta__role {
    display: block;
    font-size: 14px;
    color: var(--onyx-text-body);
}

.onyx-author-meta__date {
    font-size: 13px;
    color: var(--onyx-text-caption);
}

/* ----- Sidebar ----- */

.onyx-single-post__sidebar {
    display: none;
}

@media (min-width: 1024px) {
    .onyx-single-post__sidebar {
        display: block;
    }
}

.onyx-post-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.onyx-post-sidebar__card {
    padding: 24px;
    background: var(--onyx-bg-off-white, #f8f9fa);
    border-radius: 12px;
}

.onyx-post-sidebar__heading {
    font-size: 16px;
    font-weight: var(--onyx-font-bold);
    color: var(--onyx-navy);
    margin: 0 0 8px;
}

.onyx-post-sidebar__text {
    font-size: 14px;
    color: var(--onyx-text-body);
    margin: 0 0 16px;
    line-height: 1.5;
}

.onyx-post-sidebar__form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.onyx-post-sidebar__input {
    padding: 12px 16px;
    border: 1px solid rgba(31, 39, 59, 0.2);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.onyx-post-sidebar__input:focus {
    outline: none;
    border-color: var(--onyx-gold);
}

.onyx-post-sidebar__submit {
    padding: 12px 16px;
    background: var(--onyx-navy);
    color: var(--onyx-text-white);
    border: none;
    border-radius: 6px;
    font-weight: var(--onyx-font-semibold);
    cursor: pointer;
    transition: background 0.2s ease;
}

.onyx-post-sidebar__submit:hover {
    background: var(--onyx-bg-charcoal);
}

.onyx-post-sidebar__privacy {
    font-size: 12px;
    color: var(--onyx-text-caption);
    margin: 8px 0 0;
}

.onyx-post-sidebar__btn {
    width: 100%;
    text-align: center;
}

/* ----- Footer CTA ----- */

.onyx-post-footer-cta {
    margin-top: 48px;
    padding-top: 48px;
    border-top: 1px solid rgba(31, 39, 59, 0.1);
}

.onyx-post-footer-cta__primary {
    background: var(--onyx-gold);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    margin-bottom: 24px;
}

.onyx-post-footer-cta__heading {
    font-size: 24px;
    font-weight: var(--onyx-font-bold);
    color: var(--onyx-navy);
    margin: 0 0 12px;
}

.onyx-post-footer-cta__text {
    font-size: 16px;
    color: var(--onyx-navy);
    margin: 0 0 20px;
    opacity: 0.9;
}

.onyx-post-footer-cta__primary .onyx-btn-primary {
    background: var(--onyx-navy);
    color: var(--onyx-text-white);
}

.onyx-post-footer-cta__primary .onyx-btn-primary:hover {
    background: var(--onyx-bg-charcoal);
}

.onyx-post-footer-cta__secondary {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
}

.onyx-post-footer-cta__resource-label,
.onyx-post-footer-cta__share-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--onyx-text-caption);
    margin-bottom: 8px;
}

.onyx-post-footer-cta__resource-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: var(--onyx-font-semibold);
    color: var(--onyx-navy);
    text-decoration: none;
}

.onyx-post-footer-cta__resource-link:hover {
    color: var(--onyx-gold);
}

.onyx-post-footer-cta__share-btns {
    display: flex;
    gap: 8px;
}

.onyx-post-footer-cta__share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(31, 39, 59, 0.15);
    border-radius: 8px;
    background: transparent;
    color: var(--onyx-text-body);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.onyx-post-footer-cta__share-btn:hover {
    background: var(--onyx-navy);
    color: var(--onyx-text-white);
    border-color: var(--onyx-navy);
}

.onyx-post-footer-cta__share-btn.is-copied {
    background: var(--onyx-gold);
    color: var(--onyx-navy);
    border-color: var(--onyx-gold);
}

/* ----- Related Posts ----- */

.onyx-related-posts {
    margin-top: 64px;
    padding-top: 48px;
    border-top: 1px solid rgba(31, 39, 59, 0.1);
}

.onyx-related-posts__heading {
    font-size: 20px;
    font-weight: var(--onyx-font-bold);
    color: var(--onyx-navy);
    margin: 0 0 24px;
}

.onyx-related-posts__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 600px) {
    .onyx-related-posts__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.onyx-related-posts__card {
    background: var(--onyx-bg-off-white, #f8f9fa);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.onyx-related-posts__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(31, 39, 59, 0.1);
}

.onyx-related-posts__image-link {
    display: block;
}

.onyx-related-posts__image {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.onyx-related-posts__content {
    padding: 16px;
}

.onyx-related-posts__category {
    display: inline-block;
    font-size: 11px;
    font-weight: var(--onyx-font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--onyx-gold);
    margin-bottom: 8px;
}

.onyx-related-posts__title {
    font-size: 15px;
    font-weight: var(--onyx-font-semibold);
    line-height: 1.4;
    margin: 0 0 8px;
}

.onyx-related-posts__title a {
    color: var(--onyx-navy);
    text-decoration: none;
}

.onyx-related-posts__title a:hover {
    color: var(--onyx-gold);
}

.onyx-related-posts__date {
    font-size: 12px;
    color: var(--onyx-text-caption);
}

/* ----- Mobile Responsive ----- */

@media (max-width: 1023px) {
    .onyx-single-post__grid {
        grid-template-columns: 1fr;
    }

    .onyx-single-post__content {
        max-width: 100%;
    }
}
