/* Blog Design System */

:root {
    --blog-radius-lg: 30px;
    --blog-radius-md: 20px;
    --blog-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    --blog-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* --- Common Styles --- */
.tag-badge {
    background: var(--grundee-soft);
    color: var(--grundee);
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.tag-badge:hover,
.tag-badge.active {
    background: var(--grundee);
    color: white;
}

/* --- Blog List (post_list.html) --- */
.blog-hero {
    background: linear-gradient(135deg, var(--grundee-dark) 0%, #2c3e50 100%);
    padding: 80px 0;
    color: white;
    border-radius: 0 0 50px 50px;
    margin-bottom: 50px;
}

.search-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50px;
    padding: 12px 25px;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: none;
    border-color: var(--grundee);
}

.glass-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--blog-radius-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.glass-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--blog-shadow-hover);
}

.blog-image-wrapper {
    position: relative;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    overflow: hidden;
    background: var(--grundee-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-placeholder-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.glass-card:hover .blog-placeholder-logo {
    opacity: 0.5;
}

.blog-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.glass-card:hover .blog-image {
    transform: scale(1.1);
}

/* --- Blog Detail (post_detail.html) --- */
.post-detail-container {
    padding-top: 40px;
    padding-bottom: 80px;
}

.post-main-img-container {
    width: 100%;
    height: 450px;
    border-radius: var(--blog-radius-lg);
    overflow: hidden;
    margin-bottom: 30px;
    background: var(--grundee-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.post-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-placeholder-logo {
    width: 200px;
    opacity: 0.3;
    filter: brightness(0) invert(1);
}

.post-title-section {
    margin-bottom: 40px;
}

/* --- Sidebar --- */
.blog-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    background: white;
    border-radius: 25px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--blog-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.widget-title {
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--grundee-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Share Buttons */
.share-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.share-btn-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    color: #555;
    background: #f8f9fa;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

.share-btn-sidebar:hover {
    transform: translateY(-2px);
    color: white;
}

.share-fb:hover {
    background: #1877f2;
    border-color: #1877f2;
}

.share-tw:hover {
    background: #1da1f2;
    border-color: #1da1f2;
}

.share-wa:hover {
    background: #25d366;
    border-color: #25d366;
}

.share-ln:hover {
    background: #0077b5;
    border-color: #0077b5;
}

/* CTA Card */
.sidebar-cta-card {
    background: linear-gradient(135deg, var(--grundee) 0%, #3498db 100%);
    background: white;
    text-align: center;
}

.sidebar-cta-card .widget-title {
    justify-content: center;
}

.btn-cta-sidebar {
    background: white;
    color: var(--grundee);
    font-weight: 800;
    transition: all 0.3s;
}

.btn-cta-sidebar:hover {
    background: #f8f9fa;
    color: var(--grundee-primary);
    transform: scale(1.02);
}

/* Related Items */
.related-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.related-item:hover {
    opacity: 0.8;
    color: var(--grundee);
}

.related-item-img {
    width: 80px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    background: #f0f0f0;
}

.related-item-content h5 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-item-date {
    font-size: 0.8rem;
    color: #777;
}

/* Pagination */
.pagination .page-link {
    border-radius: 10px;
    margin: 0 5px;
    color: var(--grundee);
    border: none;
    background: #f8f9fa;
}

.pagination .page-item.active .page-link {
    background-color: var(--grundee);
    color: white;
}

/* --- Quill Typography & Content --- */
.post-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #333;
}

/* Safe typography for the rich-text content area */
.post-content p {
    margin-bottom: 1.5rem;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    color: var(--grundee-dark);
    font-weight: 800;
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
}

.post-content h1 {
    font-size: 2.2rem;
}

.post-content h2 {
    font-size: 1.8rem;
    border-left: 5px solid var(--grundee);
    padding-left: 20px;
}

.post-content h3 {
    font-size: 1.4rem;
}

.post-content blockquote {
    font-style: italic;
    border-left: 4px solid var(--grundee);
    padding: 20px 30px;
    background: var(--grundee-soft);
    border-radius: 15px;
    margin: 30px 0;
    color: #444;
}

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

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content pre {
    background: #f4f4f4;
    padding: 20px;
    border-radius: 15px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    margin: 25px 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    margin: 35px 0;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

.post-content strong {
    color: var(--grundee-dark);
    font-weight: 700;
}

/* Handle Quill alignment classes if present */
.ql-align-center {
    text-align: center;
}

.ql-align-right {
    text-align: right;
}

.ql-align-justify {
    text-align: justify;
}

.post-content .ql-video {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 20px;
    margin: 30px 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}