/* =======================================================
   single.css – Styles for all single blog posts
   (loaded only on single post pages)
   ======================================================= */

/* ----- Base: Dark Background & Typography ----- */
.single-post .site-main {
    background: #1a1a1a;   /* Dark background for all single posts */
    padding-top: 40px;
    padding-bottom: 40px;
    color: #e0e0e0;
}

.single-post .container {
    background: transparent;
}

/* ----- Typography & Layout ----- */
.single-post .entry-title,
.single-post .post-title {
    color: #ffffff;
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 15px;
}

.single-post .entry-meta,
.single-post .post-meta {
    font-size: 0.9rem;
    color: #aaaaaa;
    margin-bottom: 20px;
}
.single-post .entry-meta a,
.single-post .post-meta a {
    color: #66b3ff;
}
.single-post .entry-meta span,
.single-post .post-meta span {
    margin-right: 15px;
}

.single-post .post-thumbnail {
    margin: 20px 0 30px;
}
.single-post .post-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.single-post .entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #e0e0e0;
    margin-bottom: 40px;
}
.single-post .entry-content p,
.single-post .entry-content li {
    margin-bottom: 1.2em;
}
.single-post .entry-content h2,
.single-post .entry-content h3 {
    margin: 1.8em 0 0.8em;
    color: #ffffff;
}
.single-post .entry-content a {
    color: #66b3ff;
}
.single-post .entry-content a:hover {
    color: #99ccff;
}

/* ----- Tags ----- */
.single-post .tags-links,
.single-post .post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    margin-bottom: 20px;
}
.single-post .tags-links a,
.single-post .post-tags a {
    display: inline-block;
    background: #333333;
    color: #e0e0e0 !important;
    padding: 4px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.2s;
}
.single-post .tags-links a:hover,
.single-post .post-tags a:hover {
    background: #555555;
    color: #ffffff !important;
}

/* ----- Post Navigation (Previous/Next) ----- */
.single-post .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.single-post .nav-links a {
    color: #66b3ff;
    text-decoration: none;
    font-weight: 500;
}
.single-post .nav-links a:hover {
    text-decoration: underline;
}

/* ----- Breadcrumbs (for templates that use them) ----- */
.npadev-breadcrumbs {
    font-size: 0.9rem;
    margin-bottom: 20px;
    color: #aaaaaa;
}
.npadev-breadcrumbs a {
    color: #66b3ff;
    text-decoration: none;
}
.npadev-breadcrumbs a:hover {
    text-decoration: underline;
    color: #99ccff;
}
.npadev-breadcrumbs span {
    color: #ffffff;
}

/* ===============================
   STANDARD TEMPLATE (with sidebar)
   =============================== */
.single-post .row {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: stretch;  /* makes sidebar match content height */
}
.single-post .col-content {
    flex: 2;
    min-width: 0;
}
.single-post .col-sidebar {
    flex: 1;
    min-width: 250px;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column; /* allows children to stretch */
}
.single-post .col-sidebar * {
    color: #e0e0e0 !important;
}
.single-post .col-sidebar a {
    color: #66b3ff !important;
}
.single-post .col-sidebar a:hover {
    color: #99ccff !important;
}
.single-post .col-sidebar ul {
    list-style: none;
    padding: 0;
}
.single-post .col-sidebar li {
    margin-bottom: 8px;
}
.single-post .col-sidebar .widget-title {
    color: #ffffff;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding-bottom: 8px;
    margin-bottom: 12px;
}
/* Search in sidebar – hide the label */
.single-post .col-sidebar .widget_search label {
    display: none;
}
.single-post .col-sidebar .search-form {
    display: flex;
    gap: 8px;
}
.single-post .col-sidebar .search-field {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    color: #ffffff;
}
.single-post .col-sidebar .search-field::placeholder {
    color: #aaaaaa;
}
.single-post .col-sidebar .search-submit {
    padding: 8px 16px;
    background: var(--accent-color, #2271b1);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.single-post .col-sidebar .search-submit:hover {
    background: #0f3bcc;
}

/* ----- Post navigation (Standard) ----- */
.single-post .post-navigation-wrapper {
    margin: 30px 0;
    text-align: center;
}
.single-post .post-navigation-title {
    color: #ffffff;
    font-size: 1.3rem;
    margin-bottom: 10px;
}
.single-post .post-navigation-wrapper .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin: 0;
}
.single-post .post-navigation-wrapper .nav-links a {
    color: #66b3ff;
    text-decoration: none;
    font-weight: 500;
}
.single-post .post-navigation-wrapper .nav-links a:hover {
    text-decoration: underline;
}
/* Hide the default screen-reader heading */
.single-post .post-navigation-wrapper .screen-reader-text {
    display: none;
}
/* Align next link to the right when only one link exists */
.single-post .post-navigation-wrapper .nav-links .nav-next {
    margin-left: auto;
}
.single-post .post-navigation-wrapper .nav-links .nav-previous {
    margin-right: auto;
}


/* ===============================
   FULL-WIDTH TEMPLATE
   =============================== */
.single-post .fullwidth-post {
    max-width: 100%;
}
.single-post .fullwidth-post .entry-content {
    margin-left: auto;
    margin-right: auto;
}
/* Ensure same spacing as standard */
.single-post .fullwidth-post .entry-header,
.single-post .fullwidth-post .entry-footer,
.single-post .fullwidth-post .nav-links,
.single-post .fullwidth-post .related-posts {
    margin-left: auto;
    margin-right: auto;
}

/* --- Category separators --- */
.single-post .fullwidth-post .cat-links a:not(:last-child)::after {
    content: ", ";
}

/* --- Post navigation title: centered & white --- */
.single-post .fullwidth-post .post-navigation-wrapper .post-navigation-title {
    text-align: center !important;
    color: #ffffff !important;
}

/* --- Ensure breadcrumbs are visible --- */
.single-post .fullwidth-post .npadev-breadcrumbs {
    margin-bottom: 20px;
    color: #aaaaaa;
}
.single-post .fullwidth-post .npadev-breadcrumbs a {
    color: #66b3ff;
}
.single-post .fullwidth-post .npadev-breadcrumbs span {
    color: #ffffff;
}

/* --- Ensure navigation links are styled as in standard --- */
.single-post .fullwidth-post .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin: 0;
}
.single-post .fullwidth-post .nav-links a {
    color: #66b3ff;
    text-decoration: none;
    font-weight: 500;
}
.single-post .fullwidth-post .nav-links a:hover {
    text-decoration: underline;
}

/* Hide the default screen‑reader heading (the one WordPress outputs) */
.single-post .fullwidth-post .post-navigation-wrapper .screen-reader-text {
    display: none;
}

/* ===============================
   TOC TEMPLATE
   =============================== */

/* === TOC Layout === */
.toc-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.toc-content {
max-width: 90%;
}

.toc-sidebar {
    position: fixed;
    top: 120px;           /* adjust to match your header height */
    right: 20px;          /* distance from right edge */
    width: 260px;         /* width of the TOC box */
    max-height: calc(100vh - 160px); /* stay within viewport, with padding */
    overflow-y: auto;     /* scroll if TOC is longer than viewport */
    z-index: 999;         /* ensure it's above content */
    pointer-events: none; /* allow clicks to pass through except on the TOC itself */
}

.toc-sticky-wrapper {
    pointer-events: auto; /* re-enable clicks on the TOC */
    background: rgba(26, 26, 26, 0.95); /* dark background with slight transparency */
    backdrop-filter: blur(8px); /* optional blur effect */
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.toc-title {
    color: #ffffff;
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 8px;
}

.toc-nav {
    max-height: 60vh;
    overflow-y: auto;
}

.toc-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-nav li {
    margin-bottom: 4px;
}

.toc-nav a {
    display: block;
    padding: 6px 10px;
    color: #cccccc;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
}

.toc-nav a:hover,
.toc-nav a:focus {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.toc-nav a.active {
    background: var(--accent-color, #66b3ff);
    color: #ffffff;
}

/* Indent nested headings */
.toc-nav ul ul {
    padding-left: 15px;
}
.toc-nav ul ul ul {
    padding-left: 15px;
}

/* ----- Responsive: Hide TOC on small screens or move it ----- */
@media (max-width: 1024px) {
    .toc-sidebar {
        width: 220px;
        right: 10px;
        top: 100px;
    }
}

@media (max-width: 768px) {
    .toc-sidebar {
        position: static;      /* becomes part of the flow */
        width: 100%;
        max-height: 300px;
        margin-top: 20px;
        right: auto;
        top: auto;
        pointer-events: auto;
    }
    .toc-sticky-wrapper {
        background: rgba(26, 26, 26, 0.98);
        backdrop-filter: none;
    }
    .toc-layout {
        display: block;        /* revert to normal flow */
    }
}

/* Ensure the content headings have anchor IDs for linking */
.entry-content h2[id],
.entry-content h3[id],
.entry-content h4[id] {
    scroll-margin-top: 100px; /* adjust for fixed header */
}

/* ===============================
   HERO TEMPLATE
   =============================== */
.single-post .post-hero .hero-background {
    position: relative;
    width: 100%;
    min-height: 50vh;          /* at least half the viewport height */
    background-size: cover;
    background-position: center;
    margin-bottom: 40px;
}
.single-post .post-hero .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.single-post .post-hero .hero-title {
    color: #ffffff;
    font-size: 3rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
    margin: 0;
    text-align: center;
}
/* Fallback when no featured image */
.single-post .post-hero .no-hero {
    margin-bottom: 30px;
}
/* Content & navigation full width inside container */
.single-post .post-hero .entry-content,
.single-post .post-hero .post-navigation-wrapper,
.single-post .post-hero .related-posts {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* ----- Post navigation (Hero) ----- */
.single-post .post-hero .post-navigation-wrapper {
    margin: 30px 0;
    text-align: center;
}
.single-post .post-hero .post-navigation-title {
    color: #ffffff;
    font-size: 1.3rem;
    margin-bottom: 10px;
}
.single-post .post-hero .post-navigation-wrapper .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin: 0;
}
.single-post .post-hero .post-navigation-wrapper .nav-links a {
    color: #66b3ff;
    text-decoration: none;
    font-weight: 500;
}
.single-post .post-hero .post-navigation-wrapper .nav-links a:hover {
    text-decoration: underline;
}
/* Hide the default screen-reader heading */
.single-post .post-hero .post-navigation-wrapper .screen-reader-text {
    display: none;
}
/* Align next link to the right when only one link exists */
.single-post .post-hero .post-navigation-wrapper .nav-links .nav-next {
    margin-left: auto;
}
.single-post .post-hero .post-navigation-wrapper .nav-links .nav-previous {
    margin-right: auto;
}


/* ===============================
   MINIMAL TEMPLATE
   =============================== */

.single-post .minimal-post {
    max-width: 100%;   /* full width inside the 1200px container */
}
.single-post .minimal-post .entry-title {
    font-size: 2.2rem;
    text-align: center;
}
.single-post .minimal-post .entry-content {
    font-size: 1.05rem;
}
/* Navigation and related posts also full width */
.single-post .minimal-post .nav-links,
.single-post .minimal-post .related-posts {
    max-width: 100%;
}

/* ----- Post navigation (Minimal) ----- */
.single-post .post-navigation-wrapper {
    max-width: 100%;
    margin: 30px 0;
    text-align: center;
}
.single-post .post-navigation-title {
    color: #ffffff;
    font-size: 1.3rem;
    margin-bottom: 10px;
}
.single-post .post-navigation-wrapper .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin: 0;
}
.single-post .post-navigation-wrapper .nav-links a {
    color: #66b3ff;
    text-decoration: none;
    font-weight: 500;
}
.single-post .post-navigation-wrapper .nav-links a:hover {
    text-decoration: underline;
}
/* Hide the default screen-reader heading */
.single-post .post-navigation-wrapper .screen-reader-text {
    display: none;
}
/* Align next link to the right when only one link exists */
.single-post .post-navigation-wrapper .nav-links .nav-next {
    margin-left: auto;
}
.single-post .post-navigation-wrapper .nav-links .nav-previous {
    margin-right: auto;
}


/* ===============================
   RELATED POSTS (used by all templates)
   =============================== */
.related-posts {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.related-posts h3 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 20px;
}
.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}
.related-post-item {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, background 0.2s;
}
.related-post-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-4px);
}
.related-post-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.related-post-thumb img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}
.related-post-title {
    display: block;
    padding: 12px 16px;
    color: #ffffff;
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.3;
}

/* ===============================
   COMMENTS (all templates)
   =============================== */
.single-post .comments-area {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.single-post .comments-title {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 20px;
}
.single-post .comment-list {
    list-style: none;
    padding: 0;
}
.single-post .comment {
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}
.single-post .comment-author {
    color: #ffffff;
}
.single-post .comment-metadata {
    color: #aaaaaa;
    font-size: 0.85rem;
}
.single-post .comment-content {
    color: #e0e0e0;
}
.single-post .reply a {
    color: #66b3ff;
    text-decoration: none;
}
.single-post .reply a:hover {
    text-decoration: underline;
}

/* Comment Form */
.single-post .comment-respond {
    margin-top: 30px;
}
.single-post .comment-reply-title {
    color: #ffffff;
    font-size: 1.3rem;
    margin-bottom: 15px;
}
.single-post .comment-form p {
    margin-bottom: 15px;
}
.single-post .comment-form label {
    display: block;
    color: #e0e0e0;
    font-weight: 500;
    margin-bottom: 5px;
}
.single-post .comment-form textarea,
.single-post .comment-form input[type="text"],
.single-post .comment-form input[type="email"],
.single-post .comment-form input[type="url"] {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 1rem;
    transition: border-color 0.2s;
}
.single-post .comment-form textarea:focus,
.single-post .comment-form input[type="text"]:focus,
.single-post .comment-form input[type="email"]:focus,
.single-post .comment-form input[type="url"]:focus {
    border-color: #66b3ff;
    outline: none;
}
.single-post .comment-form .required {
    color: #ff6b6b;
}
.single-post .comment-form .logged-in-as {
    color: #aaaaaa;
    font-size: 0.9rem;
}
.single-post .comment-form .logged-in-as a {
    color: #66b3ff;
}
.single-post .comment-form .form-submit {
    margin-top: 20px;
}
.single-post .comment-form .submit {
    background: var(--accent-color, #2271b1);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}
.single-post .comment-form .submit:hover {
    background: #0f3bcc;
}


/* =======================================================
   FIXES FOR ALL SINGLE POST TEMPLATES
   ======================================================= */

/* --- Category separators (comma) --- */
.single-post .cat-links a:not(:last-child)::after {
    content: ", ";
}

/* --- Ensure breadcrumbs are visible (if used) --- */
.single-post .npadev-breadcrumbs {
    margin-bottom: 20px;
    color: #aaaaaa;
}
.single-post .npadev-breadcrumbs a {
    color: #66b3ff;
}
.single-post .npadev-breadcrumbs span {
    color: #ffffff;
}