
/* Part 1: Grid Layout */
.posts {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
}

.posts article {
    display: flex;
    flex-direction: column;
    margin: 0 !important;
    height: 100%;
    width: 100% !important;
    max-width: none !important;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 255, 218, 0.3) !important;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 0 !important;
}

.posts article:hover {
    transform: scale(1.03) !important;
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.2);
    border-color: var(--accent-cyan) !important;
}

/* Card Content Styling */
.posts article .image {
    width: 100%;
    height: 200px;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
}

.posts article .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.posts article:hover .image img {
    transform: scale(1.1);
}

.posts article .content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.posts article header {
    margin-bottom: 1rem;
    text-align: left;
}

.posts article .date {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--accent-cyan);
    border-radius: 4px;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    margin-bottom: 0.8rem;
    background: rgba(0, 217, 255, 0.05);
}

.posts article h2 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
    padding: 0;
    border: none;
    text-align: left;
    line-height: 1.3;
}

.posts article h2 a {
    color: var(--text-highlight);
    border: none;
}

.posts article p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    text-align: left;
}

.posts article .actions {
    margin: 0;
    display: flex;
    justify-content: flex-start;
}

/* Part 2: Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #1a1d29;
    border: 1px solid var(--accent-cyan);
    box-shadow: 0 0 50px rgba(0, 217, 255, 0.15);
    width: 95%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--accent-cyan);
}

.modal-video-container {
    background: #000;
    position: relative;
    width: 90%;
    max-width: 900px;
    margin: 2.5rem auto 1rem auto; /* Centered with top margin */
    padding-bottom: 50.625%; /* 16:9 Aspect Ratio (56.25% * 90% width) */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.modal-video-container iframe,
.modal-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.modal-full-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    display: block; /* Visibility controlled by JS inline style */
}

.modal-details {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.modal-details h2 {
    font-size: 2rem;
    color: var(--text-highlight);
    margin-bottom: 1rem;
    border: none;
    text-align: center; /* Center title */
}

.modal-tags {
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center; /* Center tags */
}

.modal-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-purple);
    background: rgba(179, 136, 255, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(179, 136, 255, 0.3);
}

.modal-description ul {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
}

.modal-description li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
    line-height: 1.6;
}

.modal-description li::before {
    content: '•';
    color: var(--accent-cyan);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.modal-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Modal Responsive */
@media screen and (max-width: 980px) {
    .modal-content {
        max-height: 85vh;
        width: 95%;
    }
    
    .modal-video-container {
        width: 100%;
        padding-bottom: 56.25%;
        border-radius: 0;
    }
}

@media screen and (max-width: 736px) {
    .posts {
        grid-template-columns: 1fr;
    }
    
    .modal-details {
        padding: 1.5rem;
    }
    
    .modal-details h2 {
        font-size: 1.5rem;
    }
}
/ *   . . .   e x i s t i n g   s t y l e s   . . .   * / 
 
 
 
 . m o d a l - g a l l e r y - g r i d   { 
 
         d i s p l a y :   g r i d ; 
 
         g r i d - t e m p l a t e - c o l u m n s :   1 f r   1 f r ; 
 
         g r i d - t e m p l a t e - r o w s :   1 f r   1 f r ; 
 
         g a p :   1 0 p x ; 
 
         h e i g h t :   1 0 0 % ; 
 
         w i d t h :   1 0 0 % ; 
 
         p o s i t i o n :   a b s o l u t e ; 
 
         t o p :   0 ; 
 
         l e f t :   0 ; 
 
         p a d d i n g :   1 0 p x ; 
 
         b o x - s i z i n g :   b o r d e r - b o x ; 
 
 } 
 
 
 
 . m o d a l - g a l l e r y - g r i d   i m g   { 
 
         w i d t h :   1 0 0 % ; 
 
         h e i g h t :   1 0 0 % ; 
 
         o b j e c t - f i t :   c o v e r ; 
 
         b o r d e r - r a d i u s :   8 p x ; 
 
         b o r d e r :   1 p x   s o l i d   v a r ( - - a c c e n t - c y a n - d i m ) ; 
 
         t r a n s i t i o n :   t r a n s f o r m   0 . 3 s   e a s e ; 
 
 } 
 
 
 
 . m o d a l - g a l l e r y - g r i d   i m g : h o v e r   { 
 
         t r a n s f o r m :   s c a l e ( 1 . 0 5 ) ; 
 
         z - i n d e x :   2 ; 
 
         b o r d e r - c o l o r :   v a r ( - - a c c e n t - c y a n ) ; 
 
         b o x - s h a d o w :   0   0   1 5 p x   r g b a ( 0 ,   2 1 7 ,   2 5 5 ,   0 . 3 ) ; 
 
 } 
 
 