/* Blog Magazine Update */
:root {
    --blog-accent: #0d6efd;
    --blog-bg: #0a0a0a;
    --blog-card-bg: #111;
    --blog-border: rgba(255, 255, 255, 0.1);
}

.blog-section {
    background-color: var(--blog-bg);
    color: #fff;
    padding-bottom: 15vw;
}

/* Toolbar Redesign */
.blog-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    margin-bottom: 60px;
    padding: 30px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--blog-border);
    backdrop-filter: blur(10px);
    border-radius: 16px;
}

.blog-toolbar-field {
    flex: 1;
    min-width: 200px;
}

.blog-toolbar label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 10px;
}

.blog-toolbar input,
.blog-toolbar select {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #333;
    color: #fff;
    padding: 10px 0;
    font-size: 1.1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.blog-toolbar input:focus,
.blog-toolbar select:focus {
    outline: none;
    border-color: var(--blog-accent);
}

.blog-toolbar-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid var(--blog-border);
    padding-left: 20px;
}

.blog-toolbar-meta span {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
}

.blog-toolbar-meta strong {
    font-size: 2rem;
    line-height: 1;
    color: var(--blog-accent);
}

/* Grid Layout overrides existing split view */
.blog-layout {
    display: block; /* Remove flex/grid split */
    position: relative;
}

.blog-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    width: 100%;
}

/* Card Redesign */
.blog-card {
    background: var(--blog-card-bg);
    border: 1px solid var(--blog-border);
    border-radius: 20px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), 
                box-shadow 0.4s ease, 
                border-color 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 400px;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
    border-color: rgba(100, 128, 255, 0.3);
}

.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--blog-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.blog-card:hover::before {
    transform: scaleX(1);
}

.blog-card-head {
    margin-bottom: auto;
}

.blog-card-meta {
    font-size: 0.8rem;
    color: var(--blog-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: block;
}

.blog-card h3 {
    font-size: 1.8rem;
    line-height: 1.2;
    margin-bottom: 20px;
    color: #fff;
    transition: color 0.3s ease;
}

.blog-card:hover h3 {
    /* color: var(--blog-accent); */
}

.blog-card-excerpt {
    color: #aaa;
    line-height: 1.6;
    margin-bottom: 30px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-open {
    margin-top: auto;
    background: transparent;
    border: 1px solid #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    align-self: flex-start;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.3s ease;
}

.blog-card-open:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* Reading Overlay (Modal) */
.blog-reader {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 800px;
    height: 100vh;
    background: #0f0f0f;
    z-index: 1000;
    overflow-y: auto;
    padding: 80px 60px;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    border-left: 1px solid var(--blog-border);
    box-shadow: -50px 0 100px rgba(0,0,0,0.8);
}

.blog-reader.is-open {
    transform: translateX(0);
}

/* Overlay Backdrop */
.blog-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.blog-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* Close Button */
.blog-reader-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.blog-reader-close:hover {
    transform: rotate(90deg) scale(1.1);
    color: var(--blog-accent);
}

/* Reader Typography */
.blog-reader-meta {
    color: var(--blog-accent);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.blog-reader-title {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 40px;
    background: linear-gradient(180deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.blog-reader-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #ccc;
}

.blog-reader-content h2 {
    font-size: 2rem;
    margin-top: 60px;
    margin-bottom: 30px;
    color: #fff;
}

.blog-reader-content p {
    margin-bottom: 25px;
}

.blog-reader-content ul {
    margin-bottom: 30px;
    padding-left: 20px;
}

.blog-reader-content li {
    margin-bottom: 10px;
    position: relative;
}

/* Hide original elements we don't need in this layout if they conflict */
.blog-reader-empty { display: none; }

/* Responsive */
@media (max-width: 900px) {
    .blog-list {
        grid-template-columns: 1fr;
    }
    
    .blog-reader {
        width: 100%;
        padding: 60px 20px;
    }
    
    .blog-reader-title {
        font-size: 2rem;
    }
}
