/* Posts Section Block Styles */

.wp-block-msb-banking-posts-section {
    padding: 41px 0 91px 0;
    background-color: #FFFFFF;
    overflow-x: hidden;
}

/* Header Section */
.posts-section-header {
    text-align: center;
    width:520px;
    max-width:100%;
    margin:0 auto 70px auto;
}

/* New editable heading with color styling */
.posts-heading-editable {
    text-align: center;
}

.posts-heading-editable strong:first-of-type,
.posts-heading-editable span:first-of-type {
    color: #D90077 !important;
}

.posts-heading-editable strong:last-of-type,
.posts-heading-editable span:last-of-type {
    color: #000000 !important;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 76px;
    margin-bottom: 70px;
}

@media (max-width: 650px) {
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Post Image */
.post-image {
    position: relative;
    height: 248px;
    overflow: hidden;
}

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

/* Post Content */
.post-content {
    padding: 22px 0 0 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-title {
    font-weight:700;
}

.post-title a  {
    color:#000000;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color:#D90077;
}

.post-excerpt {
    color:#000000;
    margin-bottom:26px;
}

.post-link {
    text-transform: uppercase;
    font-size:15px;
    font-weight:700;
    color:#D90077;
}

.post-link:hover {
    color: #000000;
}

.post-link:hover::after {
    background: url('data:image/svg+xml;utf8,<svg width="54" height="15" viewBox="0 0 54 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 6.41406C0.447715 6.41406 4.82823e-08 6.86178 0 7.41406C-4.82823e-08 7.96635 0.447715 8.41406 1 8.41406L1 7.41406L1 6.41406ZM53.7071 8.12117C54.0976 7.73065 54.0976 7.09748 53.7071 6.70696L47.3431 0.342999C46.9526 -0.0475257 46.3195 -0.0475257 45.9289 0.342999C45.5384 0.733523 45.5384 1.36669 45.9289 1.75721L51.5858 7.41407L45.9289 13.0709C45.5384 13.4614 45.5384 14.0946 45.9289 14.4851C46.3195 14.8757 46.9526 14.8757 47.3431 14.4851L53.7071 8.12117ZM1 7.41406L1 8.41406L53 8.41407L53 7.41407L53 6.41407L1 6.41406L1 7.41406Z" fill="%23000000"/></svg>');
}

.post-link::after {
    content: "";
    display: inline-block;
    width: 54px;
    height: 15px;
    margin-left: 9px;
    vertical-align: middle;
    background: url('data:image/svg+xml;utf8,<svg width="54" height="15" viewBox="0 0 54 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 6.41406C0.447715 6.41406 4.82823e-08 6.86178 0 7.41406C-4.82823e-08 7.96635 0.447715 8.41406 1 8.41406L1 7.41406L1 6.41406ZM53.7071 8.12117C54.0976 7.73065 54.0976 7.09748 53.7071 6.70696L47.3431 0.342999C46.9526 -0.0475257 46.3195 -0.0475257 45.9289 0.342999C45.5384 0.733523 45.5384 1.36669 45.9289 1.75721L51.5858 7.41407L45.9289 13.0709C45.5384 13.4614 45.5384 14.0946 45.9289 14.4851C46.3195 14.8757 46.9526 14.8757 47.3431 14.4851L53.7071 8.12117ZM1 7.41406L1 8.41406L53 8.41407L53 7.41407L53 6.41407L1 6.41406L1 7.41406Z" fill="%23D90077"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

.post-link:hover::after {
    transform: translateX(4px);
}

/* CTA Section */
.posts-section-footer {
    text-align: center;
}

.posts-cta-button {
    display: inline-block;
    border-color: #000000;
    border-width: 2px;
    border-style: solid;
    border-radius: 5px;
    color: #000000;
    padding: 15px 24px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 15px;
    cursor: pointer;
    background: transparent;
    text-transform: uppercase;
    width:495px;
    text-align:center;
    max-width:100%;
}

.posts-cta-button:hover {
    border-color:#F90095;
    background:#F90095;
    color:#000000;
}

/* Placeholder */
.posts-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    font-style: italic;
}

/* Responsive Design */
@media screen and (max-width:1024px) {
    .wp-block-msb-banking-posts-section {
        padding:40px 0 40px 0;
    }
}
@media (max-width: 768px) {
    
    .posts-heading-1 {
        font-size: 2rem;
    }
    
    .posts-heading-2 {
        font-size: 1.125rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        margin-bottom: 40px;
    }
    
    .post-content {
        padding: 24px;
    }
    
    .post-title {
        font-size: 1.25rem;
    }
    
    .posts-section-header {
        margin-bottom: 40px;
    }
}

@media (max-width: 480px) {
    
    .posts-heading-1 {
        font-size: 1.75rem;
    }
    
    .post-image {
        height: 200px;
    }
    
    .post-content {
        padding: 20px;
    }
    
    .posts-cta-button {
        padding: 15px 24px;
        font-size: 15px;
    }
}

/* Block Editor Specific Styles */
.wp-block-msb-banking-posts-section .posts-grid {
    min-height: 200px;
}

.wp-block-msb-banking-posts-section .posts-placeholder {
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
}

/* Full width alignment in editor */
.wp-block-msb-banking-posts-section.alignfull {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
}

/* Make button editable in editor */
.wp-block-msb-banking-posts-section .posts-cta-button[contenteditable="true"] {
    cursor: text;
    /* Ensure editor button matches frontend styles */
    display: inline-block;
    border-color: #000000;
    border-width: 2px;
    border-style: solid;
    border-radius: 5px;
    color: #000000;
    padding: 15px 24px;
    font-weight: 700;
    text-decoration: none;
    font-size: 15px;
    background: transparent;
    text-transform: uppercase;
    width: 495px;
    text-align: center;
    max-width: 100%;
    transition: all 0.3s ease;
}

.wp-block-msb-banking-posts-section .posts-cta-button[contenteditable="true"]:focus {
    outline: 2px solid #007cba;
    /* Maintain button styles on focus */
    border-color: #000000;
    color: #000000;
    background: transparent;
}
