/* =============================================================================
   BLOG PAGE CSS - Dr. Heike Bielek
   Extracted from blog.html monolith. Works with global.css.
   ============================================================================= */

/* --- Navbar overrides for blog page --- */
.page-blog .navbar {
    background: var(--dark-purple);
}
.page-blog .navbar .nav-menu a {
    color: white;
}
.page-blog .navbar .nav-menu a:hover {
    color: var(--cyan);
}
.page-blog .navbar .logo-image {
    max-height: 60px;
    width: auto;
}

@media (max-width: 768px) {
    .page-blog .navbar .logo-image {
        max-height: 50px;
    }
    .page-blog .navbar .nav-menu {
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    .page-blog .navbar .nav-menu.active {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100vw;
        height: calc(100vh - 70px);
        background: var(--dark-purple);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 9999;
        opacity: 1;
        visibility: visible;
    }
    .page-blog body.menu-open {
        overflow: hidden;
        height: 100vh;
    }
    .page-blog .navbar .nav-menu.active li {
        margin: 12px 0;
        list-style: none;
    }
    .page-blog .navbar .nav-menu.active a {
        color: white;
        font-size: 1.4rem;
        text-decoration: none;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 2px;
    }
}

/* --- Blog Hero --- */
.blog-hero {
    background: linear-gradient(135deg, rgba(63, 29, 103, 0.9), rgba(34, 226, 226, 0.7)),
                url('/assets/images/square/writing.jpg') center/cover;
    min-height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 20px 60px;
}
.blog-hero h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
}
.blog-hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* --- Search Bar --- */
.search-container {
    background: linear-gradient(135deg, rgba(63, 29, 103, 0.95), rgba(34, 226, 226, 0.3));
    padding: 1.5rem 2rem;
}
.search-wrapper {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
}
.search-icon {
    position: absolute;
    left: 1.25rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    pointer-events: none;
}
.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 3rem;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: white;
    outline: none;
    transition: all 0.3s ease;
}
.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}
.search-input:focus {
    border-color: var(--cyan);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(34, 226, 226, 0.2);
}
.search-input.has-suggestions {
    border-radius: 25px 25px 0 0;
    border-bottom: none;
    border-color: var(--cyan);
}
.clear-search {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 0.9rem;
    transition: color 0.3s;
}
.clear-search:hover {
    color: var(--cyan);
}
.search-results-count {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

/* --- Title Suggestions Dropdown --- */
.title-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    background: rgba(63, 29, 103, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--cyan);
    border-top: none;
    border-radius: 0 0 25px 25px;
    padding: 0.5rem 0;
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
}
.title-suggestions.visible {
    display: flex;
}
.title-suggestion {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}
.title-suggestion:hover {
    background: rgba(34, 226, 226, 0.2);
    border-left-color: var(--cyan);
}
.title-suggestion strong {
    color: var(--cyan);
}
.title-suggestion .suggestion-category {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 0.5rem;
}

/* --- Filter Chips --- */
.blog-filters {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.filter-chip {
    padding: 0.5rem 1.25rem;
    background: rgba(63, 29, 103, 0.08);
    border: none;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-purple);
    cursor: pointer;
    transition: all 0.3s ease;
}
.filter-chip:hover {
    background: rgba(63, 29, 103, 0.15);
    transform: translateY(-2px);
}
.filter-chip.active {
    background: linear-gradient(135deg, var(--dark-purple), var(--cyan));
    color: white;
    box-shadow: 0 4px 15px rgba(63, 29, 103, 0.3);
}
.filter-chip .chip-count {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.5rem;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-size: 0.75rem;
}

/* --- Blog Grid & Container --- */
.blog-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
@media (max-width: 1200px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .blog-grid { grid-template-columns: 1fr; }
    .blog-container { padding: 2rem 1rem; }
}

/* --- Blog Card --- */
.blog-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(63, 29, 103, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}
.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(63, 29, 103, 0.2);
}
.blog-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}
.blog-card-image {
    height: 220px;
    background: linear-gradient(135deg, var(--dark-purple), var(--cyan));
    overflow: hidden;
}
.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}
.blog-card-content {
    padding: 1.5rem;
}
.blog-card-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--dark-purple), var(--cyan));
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 20px;
    margin-bottom: 0.75rem;
}
.blog-card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--dark-purple);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}
.blog-card-excerpt {
    font-family: 'Droid Serif', serif;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.7;
    max-height: 4.8em;
    overflow: hidden;
}
.blog-card-meta {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: #888;
}
.blog-card-meta i {
    color: var(--cyan);
}

/* --- View Switching --- */
#listView, #postView {
    display: none;
}
#listView.active, #postView.active {
    display: block;
}

/* --- Single Post Hero --- */
.post-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-size: cover;
    background-position: center;
    padding-top: 80px;
    box-sizing: border-box;
}
.post-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(63, 29, 103, 0.85), rgba(34, 226, 226, 0.6));
    z-index: 1;
}
.post-hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 2rem;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}
.post-hero-title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}
.post-hero-excerpt {
    font-family: 'Droid Serif', serif;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.95);
    max-width: 700px;
    margin: 0 auto 1.5rem;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
}
.post-hero-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    flex-wrap: wrap;
}
.post-hero-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.post-hero-meta i {
    color: var(--cyan);
}

/* --- Post Content --- */
.post-content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--dark-purple);
    text-decoration: none;
    margin-bottom: 2rem;
    font-weight: 600;
    transition: color 0.3s;
}
.back-link:hover {
    color: var(--cyan);
}
.post-content {
    font-family: 'Droid Serif', serif;
    font-size: 1.15rem;
    line-height: 1.9;
    color: #444;
}
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    font-family: 'Montserrat', sans-serif;
    color: var(--dark-purple);
    margin: 2rem 0 1rem;
    font-weight: 700;
    line-height: 1.3;
}
.post-content h1 { font-size: 2rem; margin-top: 0; }
.post-content h2 { font-size: 1.6rem; }
.post-content h3 { font-size: 1.35rem; }
.post-content h4 { font-size: 1.15rem; }
.post-content p {
    margin-bottom: 1.5rem;
}
.post-content strong {
    color: var(--dark-purple);
}
.post-content ul, .post-content ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}
.post-content li {
    margin-bottom: 0.75rem;
}
.post-content blockquote {
    border-left: 4px solid var(--cyan);
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    background: rgba(34, 226, 226, 0.1);
    font-style: italic;
}
.post-author-signature {
    text-align: center;
    font-weight: 700;
    color: var(--dark-purple);
    font-size: 1.1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--cyan);
}

/* --- Auto-linked poem references --- */
.auto-link.poem-link {
    color: var(--royal-blue);
    text-decoration: underline;
    transition: all 0.2s ease;
}
.auto-link.poem-link:hover {
    color: var(--dark-purple);
}

/* --- Share Buttons --- */
.share-section {
    text-align: center;
    margin: 3rem 0;
    padding: 2rem 0;
}
.share-title {
    font-size: 0.9rem;
    color: var(--dark-purple);
    margin-bottom: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.share-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    max-width: 48px;
    max-height: 48px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    background: linear-gradient(135deg, var(--dark-purple), var(--cyan));
    color: white;
    aspect-ratio: 1 / 1;
    padding: 0;
    flex-shrink: 0;
}
.share-btn i {
    font-size: 1.2rem;
    line-height: 1;
}
.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(63, 29, 103, 0.3);
}
.share-btn.copied {
    background: var(--cyan);
}

/* --- Related Posts --- */
.related-posts {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, rgba(63, 29, 103, 0.05), rgba(34, 226, 226, 0.05));
}
.related-posts-container {
    max-width: 1200px;
    margin: 0 auto;
}
.related-posts-title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg, var(--dark-purple), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
@media (max-width: 1200px) {
    .related-posts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .related-posts-grid { grid-template-columns: 1fr; }
    .related-posts { padding: 3rem 1rem; }
}

/* --- Loading & Empty States --- */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
    color: var(--dark-purple);
    grid-column: 1 / -1;
}
.loading-spinner i {
    font-size: 3rem;
    animation: blog-spin 1s linear infinite;
}
@keyframes blog-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.empty-state {
    text-align: center;
    padding: 4rem;
    grid-column: 1 / -1;
}
.empty-state i {
    font-size: 4rem;
    color: var(--dark-purple);
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* --- Footer social icons override --- */
.page-blog .footer-section .social-icons {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: flex-start;
}
@media (max-width: 768px) {
    .page-blog .footer-section .social-icons {
        justify-content: center;
    }
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
}
