/* ============================================
   Single Post - Specific Styles
   Extends new-top-style.css + blog-style.css
   ============================================ */

/* Hero spacer */
.single-hero {
    height: 120px;
    background: linear-gradient(180deg, #f0f9ff 0%, #f9fafb 100%);
}

/* Hide first image in content (duplicate of featured image) */
.single-post__content > p:first-child img,
.single-post__content > figure:first-child,
.single-post__content > .wp-block-image:first-child,
.single-post__content > p:first-child > img {
    display: none;
}

/* If first element is an empty p (after hiding image), hide it too */
.single-post__content > p:first-child:has(img):not(:has(br)):not(:has(span)) {
    display: none;
}

/* ===== Article ===== */
.single-post {
    background: var(--white);
    border-radius: 20px;
    padding: 45px 40px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #f3f4f6;
}

/* Meta top (categories) */
.single-post__meta-top {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.single-post__category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.06);
    padding: 4px 12px;
    border-radius: 20px;
    transition: background 0.3s;
}

.single-post__category:hover {
    background: rgba(37, 99, 235, 0.12);
}

/* Title */
.single-post__title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-color);
    margin-bottom: 12px;
}

/* Meta */
.single-post__meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f3f4f6;
}

.single-post__date {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Thumbnail */
.single-post__thumbnail {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
}

.single-post__thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* Content */
.single-post__content {
    font-size: 1rem;
    line-height: 2;
    color: var(--text-color);
}

.single-post__content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.single-post__content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 3px solid var(--primary-color);
}

.single-post__content h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 25px;
    margin-bottom: 10px;
}

.single-post__content p {
    margin-bottom: 20px;
}

.single-post__content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 20px 0;
}

.single-post__content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.single-post__content a:hover {
    opacity: 0.7;
}

.single-post__content ul,
.single-post__content ol {
    margin-bottom: 20px;
    padding-left: 25px;
}

.single-post__content li {
    margin-bottom: 8px;
    list-style: disc;
}

.single-post__content ol li {
    list-style: decimal;
}

.single-post__content blockquote {
    background: var(--bg-gray);
    border-left: 4px solid var(--primary-color);
    padding: 20px 25px;
    margin: 25px 0;
    border-radius: 0 10px 10px 0;
    font-style: italic;
    color: var(--text-light);
}

.single-post__content pre,
.single-post__content code {
    background: #1f2937;
    color: #e5e7eb;
    padding: 15px 20px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 0.9rem;
    margin: 20px 0;
    display: block;
}

.single-post__content code {
    display: inline;
    padding: 2px 6px;
    font-size: 0.85em;
    border-radius: 4px;
}

.single-post__content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.single-post__content th,
.single-post__content td {
    padding: 12px 15px;
    border: 1px solid #e5e7eb;
    text-align: left;
    font-size: 0.9rem;
}

.single-post__content th {
    background: var(--bg-gray);
    font-weight: 600;
}

/* Post Navigation */
.single-post__nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #f3f4f6;
}

.single-post__nav-prev,
.single-post__nav-next {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.single-post__nav-next {
    text-align: right;
}

.single-post__nav-label {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.single-post__nav-title {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.5;
    transition: color 0.3s;
}

.single-post__nav-title:hover {
    color: var(--primary-color);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .single-post {
        padding: 25px 20px;
    }

    .single-post__title {
        font-size: 1.4rem;
    }

    .single-post__nav {
        grid-template-columns: 1fr;
    }

    .single-post__nav-next {
        text-align: left;
    }
}
