/* css/components/posts.css */

/* Reading Progress Bar */
.reading-progress-bar {
    position: fixed;
    left: 0;
    width: 0;
    height: 4px;
    background-image: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    z-index: 1001;
    transition: width 0.1s linear;
    top: 0; /* Floats at the very top of viewport */
}

/* Individual Blog Post Header */
.post-header {
    text-align: center;
    margin-bottom: 40px; /* Increased margin below header */
}
.post-header .post-title { /* This is the main H1 of the blog post */
    font-size: 2.6em; /* Slightly larger H1 */
    margin-bottom: 15px;
    color: var(--primary-accent);
    line-height: 1.25;
    letter-spacing: -0.02em; /* Subtle tightenting */
}
.post-header .post-meta {
    font-size: 0.95em; /* Slightly larger meta */
    color: var(--subtle-text);
    margin-bottom: 25px;
}
.post-header .post-meta a { 
    text-decoration: none;
}
.post-header .post-meta a:hover {
    text-decoration: none;
    color: var(--primary-accent-darker); 
}

.post-header .featured-image-full {
    width: 100%;
    max-height: 450px; 
    object-fit: cover;
    border-radius: 16px; 
    margin-bottom: 30px; 
    box-shadow: 0 8px 16px rgba(0,0,0,0.15); 
}

/* Post Content Area Styling */
.post-content-area.card.glass { 
    padding: 30px 35px; 
    margin-bottom: 40px; 
}

.post-content {
    font-size: 1.25em; 
    line-height: 1.8; 
}
.post-content h2 {
    font-size: 1.9em; 
    margin-top: 2.2em; 
    margin-bottom: 1em; 
    color: var(--primary-accent);
    line-height: 1.3;
    border-bottom: 2px solid rgba(var(--primary-accent-darker), 0.2); 
    padding-bottom: 0.5em; 
    letter-spacing: -0.01em;
}
.post-content h3 {
    font-size: 1.5em; 
    margin-top: 2em; 
    margin-bottom: 0.8em; 
    color: var(--text-color);
    line-height: 1.3;
}
.post-content p {
    margin-bottom: 1.4em; 
}
.post-content ul, .post-content ol {
    margin-left: 30px; 
    margin-bottom: 1.5em; 
    padding: 0; 
}
.post-content li {
    margin-bottom: 0.8em; 
    padding-left: 0.5em; 
}
.post-content ul li::marker {
    color: var(--primary-accent); 
}
.post-content blockquote {
    border-left: 4px solid var(--primary-accent-darker); 
    padding: 20px 30px; 
    margin: 2.5em 0; 
    font-style: italic;
    background-color: var(--glass-card-bg); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-card-border);
    box-shadow: 0 4px 8px rgba(var(--card-border-rgb), 0.1); 
    border-radius: 0 12px 12px 0; 
}
.post-content blockquote p {
    margin-bottom: 0;
    color: var(--subtle-text); 
    font-size: 1em; 
}

.post-content img {
    max-width: 80%; 
    height: auto;
    border-radius: 16px; 
    margin: 2.5em auto; 
    box-shadow: 0 6px 12px rgba(0,0,0,0.12); 
    display: block; 
}
.post-content figure { 
    margin: 2.5em 0;
}
.post-content figcaption {
    text-align: center;
    font-size: 0.9em;
    color: var(--subtle-text);
    margin-top: 0.8em;
}
.post-content a { 
    color: var(--link-color);
    text-decoration: none; 
}
.post-content a:hover {
    text-decoration: none; 
    color: var(--primary-accent-darker);
}
html[data-theme="dark"] .post-content a:hover {
    color: var(--primary-accent); 
}

/* Social Share */
.social-share.card.glass { 
    margin-top: 40px; 
    padding: 30px; 
}
.social-share p.share-prompt { 
    font-weight: 500;
    margin-bottom: 15px;
    font-size: 1.15em; 
    color: var(--text-color);
}
.social-share-buttons {
    display: flex;
    flex-wrap: wrap; 
    gap: 10px; 
}
.social-share-buttons button {
    background: transparent;
    border: 1px solid var(--primary-accent);
    color: var(--primary-accent);
    padding: 10px 20px; 
    border-radius: 8px; 
    cursor: pointer;
    font-size: 0.95em; 
    transition: background-color 0.2s, color 0.2s, transform 0.1s ease, box-shadow 0.2s ease;
    display: inline-flex; 
    align-items: center;
    text-decoration: none; 
}
.social-share-buttons button:hover {
    background-color: var(--primary-accent);
    color: white;
    transform: translateY(-2px); 
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.social-share-buttons button svg {
    width: 18px; 
    height: 18px;
    margin-right: 8px; 
    fill: currentColor;
}

/* Related Articles */
.related-articles.card.glass { 
    margin-top: 40px; 
    padding: 30px; 
}
.related-articles .section-title { 
    margin-bottom: 25px;
}
.related-articles .posts-grid .card {
     transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.related-articles .posts-grid .card:hover {
     transform: translateY(-5px);
     box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

/* Sidebar Widgets */
.sidebar-widget {
    margin-bottom: 30px;
}
.sidebar-widget:last-child {
    margin-bottom: 0;
}
.sidebar-widget h4 { 
    font-size: 1.2em; 
    margin-bottom: 18px; 
    color: var(--primary-accent);
    border-bottom: 1px solid var(--glass-card-border);
    padding-bottom: 10px;
}
.sidebar-widget ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0; 
}
.sidebar-widget ul li {
    margin-bottom: 10px; 
}
.sidebar-widget ul li:last-child {
    margin-bottom: 0;
}
.sidebar-widget ul li a.sidebar-post-link { 
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9em; 
    transition: background-color 0.2s ease, box-shadow 0.15s ease;
    display: flex; 
    align-items: center; 
    padding: 8px; 
    border-radius: 8px; 
}
.sidebar-widget ul li a.sidebar-post-link:hover {
    background-color: rgba(var(--card-bg-rgb), 0.7); 
    box-shadow: 0 2px 8px rgba(var(--card-border-rgb), 0.1);
    text-decoration: none; 
}
.sidebar-post-image {
    width: 60px; 
    height: 45px; 
    object-fit: cover; 
    border-radius: 6px; 
    margin-right: 12px; 
    flex-shrink: 0; 
    background-color: rgba(var(--card-border-rgb), 0.05); 
}
.sidebar-post-image.loaded { 
    background-color: transparent;
}
.sidebar-post-image-placeholder { 
    width: 60px;
    height: 45px;
    border-radius: 6px;
    margin-right: 12px;
    background-color: rgba(var(--subtle-text), 0.1); 
    flex-shrink: 0;
    display: flex; 
    align-items: center;
    justify-content: center;
}
.sidebar-post-title {
    line-height: 1.4; 
    color: var(--text-color); 
    transition: color 0.2s ease;
}
.sidebar-widget ul li a.sidebar-post-link:hover .sidebar-post-title {
    color: var(--primary-accent); 
}
.sidebar-widget ul li a.sidebar-post-link::before {
    content: none; 
}

.ad-placeholder {
    width:100%;
    min-height:200px;
    background: rgba(var(--card-bg-rgb), 0.3);
    border: 1px dashed var(--input-border);
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    color: var(--subtle-text);
    font-size: 0.9em;
    border-radius: 12px; 
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
html[data-theme="dark"] .ad-placeholder {
     text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* --- FAQ Section Styling --- */
.faq-section.card.glass {
    margin-top: 40px; /* Space above FAQ section */
    padding: 25px 30px; /* Padding inside the FAQ card */
}

.faq-section .faq-title { /* Styles for "Frequently Asked Questions" h2 */
    font-size: 1.7em; 
    color: var(--primary-accent);
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(var(--primary-accent-darker), 0.2);
    display: inline-block; 
}

.faq-list {
    margin-top: 15px;
}

.faq-item {
    border-bottom: 1px solid var(--glass-card-border); 
    padding: 15px 0;
}
.faq-item:last-child {
    border-bottom: none;
}

.faq-question { /* This is the <summary> tag */
    font-size: 1.15em;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    position: relative;
    padding-right: 30px; /* Space for the arrow */
    list-style: none; /* Remove default marker for summary */
    transition: color 0.2s ease;
    display: block; /* Make summary take full width for better click target */
}
.faq-question::-webkit-details-marker { 
    display: none;
}
.faq-question::after { /* Custom arrow */
    content: '▼'; 
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    font-size: 0.8em;
    color: var(--primary-accent);
    transition: transform 0.3s ease;
}
.faq-item[open] > .faq-question::after {
    transform: translateY(-50%) rotate(180deg); 
}
.faq-item[open] > .faq-question {
    color: var(--primary-accent); 
}

.faq-answer { /* This is the <div> inside <details> */
    padding-top: 15px;
    font-size: 1em;
    line-height: 1.7;
    color: var(--subtle-text); /* Use a more subtle text color for answers */
    padding-left: 5px; /* Slight indent for the answer */
}
.faq-answer p { 
    margin-bottom: 1em;
}
.faq-answer p:last-child {
    margin-bottom: 0;
}
.faq-answer a {
    color: var(--link-color);
    text-decoration: none; 
}
.faq-answer a:hover {
    color: var(--primary-accent-darker);
    text-decoration: none;
}
/* --- End of FAQ Section Styling --- */


/* Responsive adjustments for posts */
@media (max-width: 768px) {
    .post-header { margin-bottom: 30px; }
    .post-header .post-title { font-size: 2.2em; } 
    .post-content-area.card.glass { padding: 25px; margin-bottom: 30px; } 
    .post-content { font-size: 1.2em; line-height: 1.7; } 
    .post-content h2 { font-size: 1.7em; margin-top: 2em; margin-bottom: 0.8em; padding-bottom: 0.4em; }
    .post-content h3 { font-size: 1.3em; margin-top: 1.8em; margin-bottom: 0.6em; }
    .post-content p { margin-bottom: 1.2em; }
    .post-content ul, .post-content ol { margin-left: 20px; margin-bottom: 1.2em; }
    .post-content li { margin-bottom: 0.7em; }
    .post-content blockquote { padding: 15px 20px; margin: 2em 0; }
    
    .post-content img { /* Ensure content images are full width on mobile */
        margin: 2em auto; 
        max-width: 100%; 
    }
    .post-content figure { margin: 2em 0; }


    .reading-progress-bar {
        bottom: 68px; 
    }

    .social-share.card.glass, .related-articles.card.glass {
        margin-top: 30px; 
        padding: 25px; 
    }
     .social-share p.share-prompt { font-size: 1.05em; }
     .social-share-buttons button { padding: 8px 16px; font-size: 0.9em; gap: 8px; }
     .social-share-buttons svg { width: 16px; height: 16px; margin-right: 6px; }


    .sidebar-widget { margin-bottom: 25px; }
    .sidebar-widget h4 { font-size: 1.1em; margin-bottom: 15px; }
    .sidebar-widget ul li { margin-bottom: 8px; } 
    .sidebar-widget ul li a.sidebar-post-link { 
        font-size: 0.85em; 
        padding: 6px; 
    } 
    .sidebar-post-image, .sidebar-post-image-placeholder {
        width: 50px;
        height: 37px; 
        margin-right: 10px;
    }

    /* FAQ Responsive */
    .faq-section.card.glass {
        padding: 20px;
        margin-top: 30px;
    }
    .faq-section .faq-title {
        font-size: 1.5em;
        margin-bottom: 20px;
    }
    .faq-question {
        font-size: 1.05em;
    }
    .faq-answer {
        font-size: 0.95em;
    }
}