/*
 * Styles for single post templates.
 * Enqueued via functions.php using is_singular().
 */

:root {
    --container-wide: 1000px;
}


/* Post Header */
.post-header {
    padding: 4rem 0;
    background: var(--gradient-primary);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.post-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: subtle-move 20s ease-in-out infinite;
}

@keyframes subtle-move {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(50px, 50px);
    }
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-6);
    display: flex;
    flex-direction: column;
    align-items: center;
}


.post-title {
    font-size: var(--text-4xl);
    font-weight: 900;
    line-height: 1.2;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Main Content */
.post-content {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-16) 1rem;
    min-height: 400px;
}

/* Article Content */
.article-content {
    font-size: var(--text-lg);
    line-height: 1.8;
    color: var(--neutral-800);
}

.article-content p {
    margin-bottom: var(--space-6);
}


.article-content h3::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 70%;
    background: #ec8e23;
    border-radius: var(--radius-full);
}


/* WordPress Editor Blocks Styling */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    font-weight: 700;
    color: #10506d;
    line-height: 1.3;
}

.article-content h1 {
    font-size: var(--text-4xl);
    margin-top: var(--space-12);
    margin-bottom: var(--space-6);
}

.article-content h2 {
    font-size: var(--text-2xl);
    margin-top: var(--space-10);
    margin-bottom: var(--space-5);
}

.article-content h3 {
    font-size: var(--text-xl);
    font-weight: 800;
    margin-top: var(--space-8);
    margin-bottom: var(--space-4);
    position: relative;
    padding-right: var(--space-6);
}

.article-content h4 {
    font-size: var(--text-lg);
    margin-top: var(--space-8);
    margin-bottom: var(--space-4);
}

.projects-preview-section h4.about-project-title {
    padding-right: 0 !important;
    position: static !important;
}

.projects-preview-section .projects-preview-title {
    padding-right: 0 !important;
    position: static !important;
    color: #ec8e23 !important;
}

.projects-preview-section .projects-preview-title::before {
    display: none !important;
}

.article-content h5 {
    font-size: var(--text-base);
    margin-top: var(--space-6);
    margin-bottom: var(--space-3);
}

.article-content h6 {
    font-size: var(--text-sm);
    margin-top: var(--space-6);
    margin-bottom: var(--space-3);
}

.article-content p {
    margin-bottom: var(--space-6);
    line-height: 1.7;
    color: var(--neutral-700);
}

.article-content ul,
.article-content ol {
    margin-bottom: var(--space-6);
    padding-right: var(--space-6);
}

.article-content li {
    margin-bottom: var(--space-2);
    line-height: 1.7;
    color: var(--neutral-700);
}

.article-content a {
    color: var(--primary-600);
    text-decoration: underline;
    transition: color var(--transition-base);
}

.article-content a:hover {
    color: var(--primary-500);
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    margin: var(--space-8) 0;
}

.article-content figure {
    margin: var(--space-8) 0;
}

.article-content figcaption {
    font-size: var(--text-sm);
    color: var(--neutral-500);
    text-align: center;
    margin-top: var(--space-2);
}

/* Blockquote (Lead) Styling */
.article-content blockquote,
.article-content .lead {
    font-size: 1.25rem;
    line-height: 1.6;
    color: white;
    margin-bottom: var(--space-12);
    font-weight: 500;
    background: #10506d;
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    text-align: center;
}

.article-content blockquote p,
.article-content .lead p {
    margin-bottom: 0;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    font-weight: inherit;
}

/* WordPress Blocks */
.wp-block-quote {
    font-size: 1.25rem;
    font-weight: 500;
    color: white;
    background: #10506d;
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    margin: var(--space-8) 0;
    font-style: normal;
    text-align: center;
}

.wp-block-pullquote {
    border-top: 4px solid var(--primary-600);
    border-bottom: 4px solid var(--primary-600);
    padding: var(--space-8) 0;
    margin: var(--space-12) 0;
    text-align: center;
}

.wp-block-separator {
    border: none;
    border-top: 1px solid var(--neutral-400) !important;
    margin: var(--space-12) 0;
}

.wp-block-spacer {
    clear: both;
}


/* Featured Image */
.featured-image {
    margin: var(--space-12) calc(-1 * var(--space-6));
    position: relative;
    overflow: hidden;
    border-radius: 0;
    box-shadow: var(--shadow-2xl);
}

.featured-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--transition-slow);
}

.featured-image:hover img {
    transform: scale(1.05);
}

.image-caption {
    padding: var(--space-3) var(--space-6);
    background: var(--neutral-900);
    color: white;
    font-size: var(--text-sm);
    text-align: center;
}

/* Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
    margin: var(--space-12) 0;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* CTA Section */
.cta-section {
    margin: var(--space-16) 0;
    padding: var(--space-10);
    background: var(--gradient-warm);
    border-radius: var(--radius-2xl);
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.cta-content {
    position: relative;
    z-index: 2;
}

.cta-title {
    font-size: var(--text-2xl);
    font-weight: 800;
    margin-bottom: var(--space-3);
    color: #10506d;
}

.cta-description {
    font-size: var(--text-lg);
    opacity: 0.95;
    margin-bottom: var(--space-6);
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    background: white;
    color: var(--accent-600);
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: var(--text-base);
    text-decoration: none;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

/* Related Posts */
.related-posts {
    margin: var(--space-16) 0;
    padding: var(--space-16) 0;
    background: var(--neutral-50);
}

.related-container {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.related-header {
    text-align: center;
    margin-bottom: var(--space-10);
}

.related-title {
    font-size: var(--text-3xl);
    font-weight: 800;
    color: #10506d;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
}

.related-card {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-base);
    transition: all var(--transition-base);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.related-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.related-image {
    height: 180px;
    background: var(--gradient-cool);
    position: relative;
}

.related-content {
    padding: var(--space-6);
}

.related-post-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: #10506d;
    line-height: 1.4;
    margin-bottom: var(--space-2);
}

.related-excerpt {
    font-size: var(--text-base);
    color: var(--neutral-600);
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .back-button {
        top: var(--space-4);
        right: var(--space-4);
        width: 44px;
        height: 44px;
    }

    .post-header {
        padding: 3rem 0;
    }

    .post-title {
        font-size: var(--text-3xl);
    }

    .article-content h1 {
        font-size: var(--text-3xl);
    }

    .article-content h2 {
        font-size: var(--text-xl);
    }

    .article-content h3 {
        font-size: var(--text-xl);
    }

    .article-content h4 {
        font-size: var(--text-base);
    }

    .article-content blockquote,
    .article-content .lead,
    .wp-block-quote {
        text-align: right;
    }

    .featured-image {
        margin: var(--space-8) 0;
    }

    .image-gallery {
        grid-template-columns: 1fr;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .cta-section {
        padding: var(--space-8);
    }
}

/* Media Queries for larger screens */
@media (min-width: 1024px) {
    .featured-image {
        margin: var(--space-16) calc(-1 * var(--space-20));
        border-radius: var(--radius-xl);
    }
}