/**
 * Single Post Styles
 * Professional WordPress single post page styles
 * Primary Color: #2596be
 */

/* POST HEADER */
.single-post-header {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e9ecef;
}

.single-post-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #212529;
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

.single-post-title:hover {
    color: #2596be;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.post-meta-item i {
    color: #2596be;
    font-size: 1rem;
}

.post-meta-item a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-meta-item a:hover {
    color: #2596be;
    text-decoration: underline;
}

.post-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #2596be;
}

.post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.post-category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background-color: #2596be;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.post-category-badge:hover {
    background-color: #1e7ba3;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 150, 190, 0.3);
}

/* FEATURED IMAGE */
.single-post-featured-image {
    margin-bottom: 2.5rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.single-post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

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

.featured-image-caption {
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.9rem;
    font-style: italic;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

/* POST CONTENT TYPOGRAPHY */
.single-post-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 3rem;
}

.single-post-content h1,
.single-post-content h2,
.single-post-content h3,
.single-post-content h4,
.single-post-content h5,
.single-post-content h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #212529;
    position: relative;
}

.single-post-content h2 {
    font-size: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #2596be;
    display: inline-block;
}

.single-post-content h3 {
    font-size: 1.75rem;
    color: #2596be;
}

.single-post-content h4 {
    font-size: 1.5rem;
}

.single-post-content h5 {
    font-size: 1.25rem;
}

.single-post-content h6 {
    font-size: 1.125rem;
    color: #6c757d;
}

.single-post-content p {
    margin-bottom: 1.5rem;
}

.single-post-content p:first-of-type::first-letter {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
    float: left;
    margin-right: 0.5rem;
    margin-top: 0.1rem;
    color: #2596be;
}

.single-post-content a {
    color: #2596be;
    text-decoration: underline;
    transition: all 0.3s ease;
}

.single-post-content a:hover {
    color: #1e7ba3;
    text-decoration: none;
}

.single-post-content ul,
.single-post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.single-post-content ul li,
.single-post-content ol li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.single-post-content ul li {
    list-style-type: none;
    position: relative;
}

.single-post-content ul li::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #2596be;
    position: absolute;
    left: -1.5rem;
}

.single-post-content ol {
    counter-reset: custom-counter;
}

.single-post-content ol li {
    counter-increment: custom-counter;
    list-style-type: none;
    position: relative;
}

.single-post-content ol li::before {
    content: counter(custom-counter);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background-color: #2596be;
    color: #fff;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
    position: absolute;
    left: -2rem;
    top: 0.1rem;
}

/* Blockquotes */
.single-post-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background-color: #f8f9fa;
    border-left: 5px solid #2596be;
    font-size: 1.25rem;
    font-style: italic;
    color: #495057;
    position: relative;
}

.single-post-content blockquote::before {
    content: "\f10d";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 2rem;
    color: #2596be;
    opacity: 0.3;
    position: absolute;
    top: 1rem;
    left: -0.5rem;
}

.single-post-content blockquote p:last-child {
    margin-bottom: 0;
}

.single-post-content blockquote cite {
    display: block;
    margin-top: 1rem;
    font-size: 0.9rem;
    font-style: normal;
    color: #6c757d;
}

.single-post-content blockquote cite::before {
    content: "— ";
}

/* Code */
.single-post-content code {
    padding: 0.2rem 0.4rem;
    font-size: 0.9em;
    color: #e83e8c;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-family: "Courier New", monospace;
}

.single-post-content pre {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background-color: #2d2d2d;
    color: #f8f9fa;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.single-post-content pre code {
    padding: 0;
    background-color: transparent;
    color: #f8f9fa;
    font-size: 0.95rem;
    border-radius: 0;
}

/* Images */
.single-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 1.5rem 0;
}

.single-post-content .wp-caption {
    max-width: 100%;
    margin: 1.5rem 0;
}

.single-post-content .wp-caption img {
    margin: 0;
}

.single-post-content .wp-caption-text {
    padding: 0.75rem;
    font-size: 0.9rem;
    font-style: italic;
    color: #6c757d;
    text-align: center;
}

/* Tables */
.single-post-content table {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.single-post-content table thead {
    background-color: #2596be;
    color: #fff;
}

.single-post-content table th,
.single-post-content table td {
    padding: 1rem;
    text-align: left;
    border: 1px solid #dee2e6;
}

.single-post-content table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.single-post-content table tbody tr:hover {
    background-color: #e9ecef;
}

.single-post-content hr {
    margin: 2.5rem 0;
    border: 0;
    border-top: 2px solid #e9ecef;
}

/* POST FOOTER */
.single-post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e9ecef;
}

/* Tags */
.post-tags {
    margin-bottom: 2rem;
}

.post-tags-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-tags-title i {
    color: #2596be;
}

.post-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.post-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: #495057;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.post-tag:hover {
    color: #fff;
    background-color: #2596be;
    border-color: #2596be;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 150, 190, 0.3);
}

/* Share Buttons */
.post-share {
    margin-bottom: 2rem;
}

.post-share-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-share-title i {
    color: #2596be;
}

.post-share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.share-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.share-button i {
    font-size: 1.1rem;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #fff;
}

.share-facebook { background-color: #1877f2; }
.share-facebook:hover { background-color: #145dbf; }
.share-twitter { background-color: #1da1f2; }
.share-twitter:hover { background-color: #1a8cd8; }
.share-linkedin { background-color: #0a66c2; }
.share-linkedin:hover { background-color: #004182; }
.share-whatsapp { background-color: #25d366; }
.share-whatsapp:hover { background-color: #1ebe57; }
.share-email { background-color: #6c757d; }
.share-email:hover { background-color: #545b62; }

/* Author Bio */
.post-author-bio {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.author-bio-avatar {
    flex-shrink: 0;
}

.author-bio-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #2596be;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.author-bio-content {
    flex: 1;
}

.author-bio-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.5rem;
}

.author-bio-name a {
    color: #212529;
    text-decoration: none;
    transition: color 0.3s ease;
}

.author-bio-name a:hover {
    color: #2596be;
}

.author-bio-role {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.author-bio-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #495057;
    margin-bottom: 1rem;
}

.author-bio-social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.author-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: #fff;
    background-color: #2596be;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.author-social-link:hover {
    background-color: #1e7ba3;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(37, 150, 190, 0.4);
}

/* POST NAVIGATION */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding: 1.5rem 0;
    border-top: 2px solid #e9ecef;
    border-bottom: 2px solid #e9ecef;
}

.nav-post {
    display: block;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-post::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: #2596be;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-post:hover::before {
    transform: scaleY(1);
}

.nav-post:hover {
    background-color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.nav-post-prev {
    text-align: left;
}

.nav-post-next {
    text-align: right;
}

.nav-post-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.nav-post-prev .nav-post-label {
    justify-content: flex-start;
}

.nav-post-next .nav-post-label {
    justify-content: flex-end;
}

.nav-post-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
    transition: color 0.3s ease;
}

.nav-post:hover .nav-post-title {
    color: #2596be;
}

.nav-post-thumbnail {
    margin-top: 1rem;
    border-radius: 5px;
    overflow: hidden;
}

.nav-post-thumbnail img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.nav-post:hover .nav-post-thumbnail img {
    transform: scale(1.1);
}

/* RELATED POSTS */
.related-posts {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 3px solid #2596be;
}

.related-posts-title {
    font-size: 2rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

.related-posts-title::after {
    content: "";
    display: block;
    width: 80px;
    height: 4px;
    background-color: #2596be;
    margin: 1rem auto 0;
    border-radius: 2px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.related-post-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.related-post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.related-post-thumbnail {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.related-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.related-post-card:hover .related-post-thumbnail img {
    transform: scale(1.1);
}

.related-post-date {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background-color: rgba(37, 150, 190, 0.9);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 20px;
}

.related-post-content {
    padding: 1.5rem;
}

.related-post-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background-color: #2596be;
    border-radius: 15px;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.related-post-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.related-post-card:hover .related-post-title {
    color: #2596be;
}

.related-post-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #6c757d;
    margin-bottom: 1rem;
}

.related-post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.related-post-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.related-post-author img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.related-post-read-more {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2596be;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: gap 0.3s ease;
}

.related-post-card:hover .related-post-read-more {
    gap: 0.5rem;
}

/* RESPONSIVE DESIGN */
@media (max-width: 991px) {
    .single-post-title {
        font-size: 2rem;
    }
    
    .single-post-content {
        font-size: 1.0625rem;
    }
    
    .single-post-content h2 {
        font-size: 1.75rem;
    }
    
    .single-post-content h3 {
        font-size: 1.5rem;
    }
    
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .post-author-bio {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .author-bio-social {
        justify-content: center;
    }
}

@media (max-width: 767px) {
    .single-post-title {
        font-size: 1.75rem;
    }
    
    .post-meta {
        gap: 1rem;
    }
    
    .single-post-content {
        font-size: 1rem;
    }
    
    .single-post-content p:first-of-type::first-letter {
        font-size: 2.5rem;
    }
    
    .single-post-content h2 {
        font-size: 1.5rem;
    }
    
    .single-post-content h3 {
        font-size: 1.25rem;
    }
    
    .single-post-content h4 {
        font-size: 1.125rem;
    }
    
    .single-post-content blockquote {
        padding: 1rem 1.5rem;
        font-size: 1.125rem;
    }
    
    .post-navigation {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .nav-post-next {
        text-align: left;
    }
    
    .nav-post-next .nav-post-label {
        justify-content: flex-start;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .post-share-buttons {
        flex-direction: column;
    }
    
    .share-button {
        justify-content: center;
        width: 100%;
    }
    
    .author-bio-avatar img {
        width: 80px;
        height: 80px;
    }
    
    .single-post-content table {
        font-size: 0.85rem;
    }
    
    .single-post-content table th,
    .single-post-content table td {
        padding: 0.5rem;
    }
}

@media (max-width: 575px) {
    .single-post-title {
        font-size: 1.5rem;
    }
    
    .single-post-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .single-post-featured-image {
        margin-bottom: 1.5rem;
    }
    
    .single-post-content {
        margin-bottom: 2rem;
    }
    
    .related-posts-title {
        font-size: 1.5rem;
    }
    
    .related-post-thumbnail {
        height: 180px;
    }
}

/* RTL SUPPORT */
[dir="rtl"] .single-post-content ul,
[dir="rtl"] .single-post-content ol {
    padding-left: 0;
    padding-right: 2rem;
}

[dir="rtl"] .single-post-content ul li::before {
    left: auto;
    right: -1.5rem;
}

[dir="rtl"] .single-post-content ol li::before {
    left: auto;
    right: -2rem;
}

[dir="rtl"] .single-post-content blockquote {
    border-left: none;
    border-right: 5px solid #2596be;
}

[dir="rtl"] .single-post-content blockquote::before {
    left: auto;
    right: -0.5rem;
}

[dir="rtl"] .single-post-content p:first-of-type::first-letter {
    float: right;
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .nav-post::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .nav-post-prev {
    text-align: right;
}

[dir="rtl"] .nav-post-next {
    text-align: left;
}

[dir="rtl"] .nav-post-prev .nav-post-label {
    justify-content: flex-end;
}

[dir="rtl"] .nav-post-next .nav-post-label {
    justify-content: flex-start;
}

[dir="rtl"] .related-post-date {
    right: auto;
    left: 1rem;
}

[dir="rtl"] .single-post-content table th,
[dir="rtl"] .single-post-content table td {
    text-align: right;
}

/* PRINT STYLES */
@media print {
    .post-share,
    .post-navigation,
    .related-posts,
    .post-author-bio,
    .share-button,
    .author-bio-social {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
    
    .single-post-title,
    .single-post-content h1,
    .single-post-content h2,
    .single-post-content h3,
    .single-post-content h4,
    .single-post-content h5,
    .single-post-content h6 {
        color: #000;
        page-break-after: avoid;
    }
    
    .single-post-content p,
    .single-post-content li,
    .single-post-content blockquote {
        page-break-inside: avoid;
    }
    
    .single-post-featured-image,
    .single-post-content img {
        max-width: 100%;
        page-break-inside: avoid;
    }
    
    .post-meta-item a,
    .single-post-content a {
        text-decoration: underline;
        color: #000;
    }
    
    .single-post-content a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    
    .single-post-content blockquote {
        border-left: 2px solid #000;
        background-color: #f5f5f5;
    }
    
    [dir="rtl"] .single-post-content blockquote {
        border-left: none;
        border-right: 2px solid #000;
    }
    
    .post-category-badge,
    .post-tag {
        border: 1px solid #000;
        background-color: #fff;
        color: #000;
    }
    
    * {
        box-shadow: none !important;
        text-shadow: none !important;
        transition: none !important;
        animation: none !important;
    }
}

/* ACCESSIBILITY & FOCUS STATES */
.share-button:focus,
.post-tag:focus,
.post-category-badge:focus,
.author-social-link:focus,
.nav-post:focus,
.related-post-card:focus {
    outline: 3px solid #2596be;
    outline-offset: 3px;
}

.single-post-content a:focus {
    outline: 2px solid #2596be;
    outline-offset: 2px;
}

html {
    scroll-behavior: smooth;
}

::selection {
    background-color: #2596be;
    color: #fff;
}

::-moz-selection {
    background-color: #2596be;
    color: #fff;
}

/* ANIMATIONS */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.single-post-header,
.single-post-featured-image,
.single-post-content,
.single-post-footer {
    animation: fadeInUp 0.6s ease-out;
}

.single-post-featured-image {
    animation-delay: 0.1s;
}

.single-post-content {
    animation-delay: 0.2s;
}

.single-post-footer {
    animation-delay: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
