/* ================================================================
   PISTON TRIBE — SINGLE BLOG POST
   Layout: breadcrumb → 2-col (main + sidebar)
   Design language: flat, no shadows, border-radius 12px,
   border 1px solid #e4e6eb, accent #050505.
   ================================================================ */

/* Let the theme container go full-width so .pt-single-page controls sizing */
.single-post .grid-container,
.single-post .inside-site-container,
.single-post .site-content,
.single-post .content-area {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ── Page wrapper ── */
.pt-single-page {
    max-width: 1300px;
    margin: 0 auto;
    padding: 24px 40px 60px;
}

/* ================================================================
   BREADCRUMB — hide theme's breadcrumb, show ours only
   ================================================================ */

/* Suppress the theme's breadcrumb on single posts */
.single-post .woocommerce-breadcrumb,
.single-post .breadcrumb,
.single-post .breadcrumbs,
.single-post [class*="breadcrumb"]:not(.pt-single-breadcrumb) {
    display: none !important;
}

.pt-single-breadcrumb {
    margin-bottom: 28px;
}
.pt-single-breadcrumb nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    font-size: 0.8rem;
    font-weight: 500;
}
.pt-single-breadcrumb nav a {
    color: #050505;
    text-decoration: none;
    font-weight: 600;
}
.pt-single-breadcrumb nav a:hover {
    text-decoration: underline;
}
.pt-single-breadcrumb nav span[aria-hidden] {
    margin: 0 6px;
    color: #bcc0c4;
    font-weight: 400;
}
.pt-single-breadcrumb nav > span:last-child {
    color: #65676b;
    font-weight: 400;
}

/* ================================================================
   TWO-COLUMN LAYOUT
   ================================================================ */
.pt-single-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
}

/* ================================================================
   MAIN ARTICLE
   ================================================================ */
.pt-single-main {
    min-width: 0;
}

/* Category badge — reuses .pt-blog-category-badge from blog-styles.css */

/* ── Post title ── */
.pt-single-title {
    font-size: 2rem;
    font-weight: 800;
    color: #050505;
    line-height: 1.25;
    margin: 12px 0 20px;
    letter-spacing: -0.01em;
}

/* ── Author meta bar ── */
.pt-single-meta-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    border-top: 1px solid #e4e6eb;
    border-bottom: 1px solid #e4e6eb;
    margin-bottom: 28px;
}

.pt-single-avatar-link { flex-shrink: 0; }
.pt-single-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e4e6eb;
    object-fit: cover;
    display: block;
}

.pt-single-meta-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.pt-single-author-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #050505;
    text-decoration: none;
}
.pt-single-author-name:hover { text-decoration: underline; }
.pt-single-dates {
    font-size: 0.78rem;
    color: #65676b;
}

.pt-single-views {
    font-size: 0.72rem;
    font-weight: 700;
    color: #65676b;
    white-space: nowrap;
    margin-left: auto;
    background: #f0f2f5;
    border: 1px solid #e4e6eb;
    border-radius: 20px;
    padding: 3px 10px;
    letter-spacing: 0.02em;
}

/* ── Featured image ── */
.pt-single-featured-image {
    width: 100%;
    height: 420px;
    background: #f5f6f7 center / contain no-repeat;
    border-radius: 12px;
    margin-bottom: 32px;
    border: 1px solid #e4e6eb;
}

/* ── Post content ── */
.pt-single-content {
    font-size: 1rem;
    line-height: 1.75;
    color: #1c1e21;
}
.pt-single-content h2,
.pt-single-content h3,
.pt-single-content h4 {
    font-weight: 800;
    color: #050505;
    margin: 2em 0 0.5em;
    line-height: 1.3;
}
.pt-single-content h2 { font-size: 1.45rem; }
.pt-single-content h3 { font-size: 1.2rem; }
.pt-single-content h4 { font-size: 1rem; }
.pt-single-content p { margin: 0 0 1.25em; }
.pt-single-content a { color: #050505; font-weight: 600; }
.pt-single-content a:hover { text-decoration: none; }
.pt-single-content ul,
.pt-single-content ol {
    margin: 0 0 1.25em 1.5em;
}
.pt-single-content li { margin-bottom: 0.4em; }
.pt-single-content blockquote {
    border-left: 3px solid #050505;
    margin: 1.5em 0;
    padding: 12px 20px;
    background: #f5f6f7;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #444;
}
.pt-single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1em 0;
}
.pt-single-content figure { margin: 1.5em 0; }
.pt-single-content figcaption {
    font-size: 0.8rem;
    color: #8a8d91;
    text-align: center;
    margin-top: 6px;
}
.pt-single-content pre,
.pt-single-content code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    background: #f5f6f7;
    border-radius: 4px;
}
.pt-single-content pre {
    padding: 16px 20px;
    overflow-x: auto;
    border: 1px solid #e4e6eb;
}
.pt-single-content code { padding: 2px 6px; }
.pt-single-content hr {
    border: none;
    border-top: 1px solid #e4e6eb;
    margin: 2em 0;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.pt-single-sidebar {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Author card ── */
.pt-single-author-card {
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 12px;
    padding: 20px;
}
.pt-single-author-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
.pt-single-author-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid #e4e6eb;
    object-fit: cover;
    flex-shrink: 0;
}
.pt-single-author-card-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 700;
    color: #8a8d91;
    margin: 0 0 2px;
}
.pt-single-author-card-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: #050505;
    text-decoration: none;
}
.pt-single-author-card-name:hover { text-decoration: underline; }
.pt-single-author-card-bio {
    font-size: 0.83rem;
    color: #65676b;
    line-height: 1.55;
    margin: 0;
}

/* ── Generic widget ── */
.pt-single-widget {
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 12px;
    padding: 20px;
}
.pt-single-widget-title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #050505;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e4e6eb;
}

/* ── Category list ── */
.pt-single-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pt-single-cat-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #050505;
    text-decoration: none;
    transition: background 0.12s;
}
.pt-single-cat-link:hover { background: #f5f6f7; }
.pt-single-cat-link.is-active {
    background: #050505;
    color: #fff;
    font-weight: 700;
}
.pt-single-cat-count {
    font-size: 0.75rem;
    color: #8a8d91;
    font-weight: 400;
}
.pt-single-cat-link.is-active .pt-single-cat-count { color: rgba(255,255,255,0.6); }

/* ── Related posts ── */
.pt-single-related-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pt-single-related-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.12s;
}
.pt-single-related-item:hover { background: #f5f6f7; }
.pt-single-related-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: #e4e6eb center / cover no-repeat;
    flex-shrink: 0;
    border: 1px solid #e4e6eb;
}
.pt-single-related-thumb--empty { background: #f0f2f5; }
.pt-single-related-info { flex: 1; min-width: 0; }
.pt-single-related-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #050505;
    line-height: 1.35;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pt-single-related-date {
    font-size: 0.75rem;
    color: #8a8d91;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
    .pt-single-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .pt-single-sidebar {
        position: static;
    }
    .pt-single-featured-image {
        height: 260px;
    }
    .pt-single-title {
        font-size: 1.6rem;
    }
}
@media (max-width: 600px) {
    .pt-single-page {
        padding: 16px 8px 40px;
    }
    .pt-single-title {
        font-size: 1.35rem;
    }
    .pt-single-featured-image {
        height: 200px;
    }
}

/* ================================================================
   SCROLL TO TOP BUTTON
   ================================================================ */
#pt-scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    padding: 0;
    background: #000;
    color: #fff;
    border-radius: 4px;
    border: none;
    display: grid;
    place-items: center;
    line-height: 1;
    cursor: pointer;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, background 0.2s ease;
}
#pt-scroll-top svg {
    display: block;
    width: 18px;
    height: 18px;
}
#pt-scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
}
#pt-scroll-top:hover {
    background: #333;
}

/* ================================================================
   TABLE OF CONTENTS
   All selectors nested under .pt-single-toc to beat .pt-single-content
   child rules (h4, ol, li, a) which would otherwise leak in.
   ================================================================ */
.pt-single-toc {
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 32px;
}
.pt-single-toc .pt-single-toc-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #050505;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e4e6eb;
    line-height: 1.4;
}
.pt-single-toc .pt-single-toc-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pt-single-toc .pt-single-toc-list li {
    margin-bottom: 0;
}
.pt-single-toc .pt-single-toc-list li a {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1c1e21;
    text-decoration: none;
    transition: background 0.12s;
}
.pt-single-toc .pt-single-toc-list li a:hover {
    background: #f5f6f7;
    color: #050505;
    text-decoration: none;
}
.pt-single-toc .pt-single-toc-num {
    font-size: 0.72rem;
    font-weight: 700;
    color: #8a8d91;
    min-width: 18px;
    flex-shrink: 0;
}
