/* /css/blogs.css
 *
 * Blog listing and post layout - Cinematic "Refined" Edition.
 * Features: Geometric shapes, staggered reveals, and interactive glass surfaces.
 */

/* --- 1. Blog List Container & Spacing --- */
.blog-list-container {
    display: grid;
    gap: 3rem;
    margin-top: 4rem;
}

/* --- 2. The Blog Card (The "Fancy" Part) --- */
.blog-card {
    display: grid;
    gap: 0;
    position: relative;
    background: rgba(185, 208, 220, 0.02);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;

    /* Animation: Cinematic entry */
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    filter: blur(15px);
    animation: blogEntrance 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;

    transition:
        transform 0.6s cubic-bezier(0.2, 0, 0.2, 1),
        border-color 0.4s ease,
        box-shadow 0.6s ease;
}

@media (min-width: 900px) {
    .blog-card {
        grid-template-columns: 1fr 1.3fr;
    }
}

/* Hover State: Magnetic Lift & Glow */
.blog-card:hover {
    transform: translateY(-8px) scale(1.01);
    border-color: rgba(21, 122, 110, 0.4);
    box-shadow:
        0 30px 60px -15px rgba(0, 0, 0, 0.7),
        0 0 20px -5px var(--accent-glow);
}

/* --- 3. Thumbnail & Geometric Shapes --- */
.blog-thumbnail {
    position: relative;
    overflow: hidden;
    /* Shape: Subtle diagonal cut on the inner edge */
    clip-path: polygon(0 0, 100% 0, 95% 100%, 0% 100%);
}

@media (max-width: 900px) {
    .blog-thumbnail {
        clip-path: polygon(0 0, 100% 0, 100% 95%, 0% 100%);
        height: 250px;
    }
}

.blog-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-card:hover .blog-thumbnail img {
    transform: scale(1.1) rotate(1deg);
}

/* Floating "Shape" Decoration behind metadata */
.blog-meta::before {
    content: "";
    position: absolute;
    top: -10px;
    left: -20px;
    width: 40px;
    height: 40px;
    background: var(--accent-primary);
    opacity: 0.1;
    border-radius: 8px;
    transform: rotate(15deg);
    z-index: -1;
}

/* --- 4. Card Content & Typography --- */
.blog-content {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.blog-meta {
    position: relative;
    font-size: var(--text-sm);
    font-family: var(--font-mono);
    color: var(--accent-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.blog-byline {
    font-size: var(--text-sm);
    color: var(--text-dim);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.blog-byline span {
    color: var(--text-bright);
    font-weight: 600;
}

.blog-title {
    margin-bottom: 1rem;
    font-size: var(--text-xl);
}

.blog-title a {
    color: var(--text-bright);
    transition: color 0.3s ease;
}

.blog-card:hover .blog-title a {
    color: var(--accent-primary);
}

.blog-excerpt {
    color: var(--text-main);
    line-height: 1.8;
    margin-bottom: 2rem;
    opacity: 0.8;
}

/* --- 5. Interactive "Read More" Button --- */
.blog-content .btn {
    align-self: flex-start;
    padding: 0.8rem 1.8rem;
    overflow: hidden;
    position: relative;
}

/* --- 6. Staggered Entrance Animation Keyframes --- */
@keyframes blogEntrance {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.blog-card:nth-child(1) {
    animation-delay: 0.1s;
}

.blog-card:nth-child(2) {
    animation-delay: 0.25s;
}

.blog-card:nth-child(3) {
    animation-delay: 0.4s;
}

/* --- 7. Single Post Page Style --- */

.post-body p {
    margin-bottom: 1.5rem;
}

.post-wrapper {
    max-width: 850px;
    margin-inline: auto;
    padding-bottom: 6rem;
}

.post-header {
    margin-bottom: 4rem;
    text-align: left;
}

.post-header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.post-body h2, 
.post-body h3 {
    margin-top: 3.5rem;
    margin-bottom: 1.2rem;
    color: var(--text-bright);
}

.post-body {
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--text-main);
}

.post-body img {
    width: 100%;
    max-width: 700px;
    height: auto;
    display: block;
    margin: 3rem auto;
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border: 3px solid var(--border-color);
}

.video-embed {
    position: relative;
    padding-top: 56.25%;
    margin: 3rem auto;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 2px solid var(--border-color);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}



.post-body blockquote {
    position: relative;
    padding: 2.5rem;
    margin-block: 3rem;
    background: rgba(185, 208, 220, 0.03);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--accent-primary);
    font-style: italic;
    color: var(--text-bright);
}

/* --- 8. Voting Buttons --- */
.blog-votes {
    display: flex;
    gap: 1.5rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.blog-vote-btn {
    background: rgba(185, 208, 220, 0.05);
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.blog-vote-btn:hover {
    background: rgba(21, 122, 110, 0.1);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.blog-vote-btn.is-active {
    background: var(--accent-primary);
    color: white;
}

/* Accessibility: Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .blog-card {
        animation: none;
        opacity: 1;
        transform: none;
        filter: none;
    }
}
