/**
 * Blog Post Single Page CSS
 * Additional styling for individual blog post pages
 * Complements blog-public.css
 */

/* ==================== POST CONTENT TYPOGRAPHY ==================== */
.prose {
    color: #374151;
    max-width: 65ch;
}

.prose h1 {
    font-size: 2.25em;
    margin-top: 0;
    margin-bottom: 0.8888889em;
    line-height: 1.1111111;
    font-weight: 800;
    color: #111827;
}

.prose h2 {
    font-size: 1.875em;
    margin-top: 2em;
    margin-bottom: 1em;
    line-height: 1.3333333;
    font-weight: 700;
    color: #111827;
}

.prose h3 {
    font-size: 1.5em;
    margin-top: 1.6em;
    margin-bottom: 0.6em;
    line-height: 1.6;
    font-weight: 600;
    color: #111827;
}

.prose h4 {
    font-size: 1.25em;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.5;
    font-weight: 600;
    color: #111827;
}

.prose p {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    line-height: 1.75;
}

.prose a {
    color: #2ab939;
    text-decoration: underline;
    font-weight: 500;
}

.prose a:hover {
    color: #22a32f;
}

.prose strong {
    color: #111827;
    font-weight: 600;
}

.prose em {
    font-style: italic;
}

.prose ul,
.prose ol {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.625em;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

.prose li {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.prose li p {
    margin-top: 0.75em;
    margin-bottom: 0.75em;
}

.prose blockquote {
    font-weight: 500;
    font-style: italic;
    color: #111827;
    border-left: 0.25rem solid #2ab939;
    quotes: "\201C""\201D""\2018""\2019";
    margin-top: 1.6em;
    margin-bottom: 1.6em;
    padding-left: 1em;
    background-color: #f9fafb;
    padding: 1.5em;
    border-radius: 0.5rem;
}

.prose blockquote p:first-of-type::before {
    content: open-quote;
}

.prose blockquote p:last-of-type::after {
    content: close-quote;
}

.prose code {
    color: #111827;
    font-weight: 600;
    font-size: 0.875em;
    background-color: #f3f4f6;
    padding: 0.25em 0.5em;
    border-radius: 0.25rem;
    font-family: 'Courier New', Courier, monospace;
}

.prose pre {
    color: #e5e7eb;
    background-color: #1f2937;
    overflow-x: auto;
    font-size: 0.875em;
    line-height: 1.7142857;
    margin-top: 1.7142857em;
    margin-bottom: 1.7142857em;
    border-radius: 0.375rem;
    padding: 1.1428571em;
}

.prose pre code {
    background-color: transparent;
    border-width: 0;
    border-radius: 0;
    padding: 0;
    font-weight: 400;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    line-height: inherit;
}

.prose img,
.prose video,
.prose figure {
    margin-top: 2em;
    margin-bottom: 2em;
    border-radius: 0.5rem;
}

.prose figure > * {
    margin-top: 0;
    margin-bottom: 0;
}

.prose figcaption {
    color: #6b7280;
    font-size: 0.875em;
    line-height: 1.4285714;
    margin-top: 0.8571429em;
    text-align: center;
}

.prose table {
    width: 100%;
    table-layout: auto;
    text-align: left;
    margin-top: 2em;
    margin-bottom: 2em;
    font-size: 0.875em;
    line-height: 1.7142857;
}

.prose thead {
    color: #111827;
    font-weight: 600;
    border-bottom: 2px solid #d1d5db;
}

.prose thead th {
    vertical-align: bottom;
    padding-right: 0.5714286em;
    padding-bottom: 0.5714286em;
    padding-left: 0.5714286em;
}

.prose tbody tr {
    border-bottom: 1px solid #e5e7eb;
}

.prose tbody tr:last-child {
    border-bottom-width: 0;
}

.prose tbody td {
    vertical-align: top;
    padding: 0.5714286em;
}

.prose hr {
    border-color: #e5e7eb;
    border-top-width: 1px;
    margin-top: 3em;
    margin-bottom: 3em;
}

/* ==================== SOCIAL SHARE BUTTONS ==================== */
.social-share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.social-share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.social-share-btn-large {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.social-share-btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ==================== POST NAVIGATION LINKS ==================== */
.post-nav-link {
    display: block;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.post-nav-link:hover {
    border-color: #2ab939;
    background-color: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 185, 57, 0.1);
}

/* ==================== FEATURED IMAGE ==================== */
#featuredImageContainer {
    position: relative;
    overflow: hidden;
    max-height: 500px;
}

#featuredImage {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* ==================== BREADCRUMBS ==================== */
nav[aria-label="Breadcrumb"] a {
    transition: color 0.2s ease;
}

nav[aria-label="Breadcrumb"] a:hover {
    color: #2ab939;
    text-decoration: underline;
}

/* ==================== COPY TOAST ANIMATION ==================== */
#copyToast {
    animation: slideInUp 0.3s ease-out;
}

#copyToast.hidden {
    animation: slideOutDown 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100px);
        opacity: 0;
    }
}

/* ==================== TAG LINKS ==================== */
#postTags a {
    transition: all 0.2s ease;
}

#postTags a:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==================== RESPONSIVE ADJUSTMENTS ==================== */
@media (max-width: 768px) {
    .prose {
        font-size: 1rem;
    }
    
    .prose h1 {
        font-size: 1.875em;
    }
    
    .prose h2 {
        font-size: 1.5em;
    }
    
    .prose h3 {
        font-size: 1.25em;
    }
    
    #featuredImageContainer {
        max-height: 300px;
    }
    
    .social-share-btn-large {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .post-nav-link {
        padding: 1rem;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .social-share-btn,
    .social-share-btn-large,
    #postTags,
    #prevPost,
    #nextPost,
    #relatedPosts {
        display: none;
    }
    
    .prose {
        max-width: 100%;
    }
    
    #postContent {
        padding: 0;
    }
}

/* ==================== CONTENT IMAGES ==================== */
.prose img {
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* ==================== RELATED POSTS SECTION ==================== */
#relatedPosts {
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
}

#relatedPostsGrid .blog-card {
    height: 100%;
}

/* ==================== LOADING STATE ==================== */
#postLoading {
    min-height: 500px;
}

/* ==================== ERROR STATE ==================== */
#postError {
    min-height: 400px;
}

/* ==================== ACCESSIBILITY ==================== */
.prose a:focus,
.post-nav-link:focus,
.social-share-btn:focus,
.social-share-btn-large:focus {
    outline: 2px solid #2ab939;
    outline-offset: 2px;
}

/* ==================== SMOOTH SCROLLING ==================== */
html {
    scroll-behavior: smooth;
}

/* ==================== STICKY HEADER ADJUSTMENT ==================== */
header {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

/* ==================== POST META INFO ==================== */
article header .flex {
    flex-wrap: wrap;
}

article header .flex > div {
    white-space: nowrap;
}

/* ==================== QUOTE STYLING ==================== */
.prose blockquote::before {
    content: '"';
    font-size: 4em;
    color: #2ab939;
    opacity: 0.2;
    position: absolute;
    margin-left: -0.5em;
    margin-top: -0.2em;
}

.prose blockquote {
    position: relative;
}

/* ==================== CODE BLOCK ENHANCEMENTS ==================== */
.prose pre {
    position: relative;
}

.prose pre::before {
    content: attr(data-language);
    position: absolute;
    top: 0.5em;
    right: 0.5em;
    font-size: 0.75em;
    color: #9ca3af;
    text-transform: uppercase;
}

/* ==================== HOVER EFFECTS ==================== */
.prose a {
    position: relative;
}

.prose a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #2ab939;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

.prose a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* ==================== SELECTION COLOR ==================== */
::selection {
    background-color: rgba(42, 185, 57, 0.3);
    color: #111827;
}

::-moz-selection {
    background-color: rgba(42, 185, 57, 0.3);
    color: #111827;
}
