/* Section 4 Wrapper */
.section-4-wrapper {
    background-color: #f4f6f8;
    padding: 30px 0;
    margin-bottom: 15px;
}

/* Headers */
.s4-main-header {
    margin-bottom: 20px;
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 8px;
}

.s4-main-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    padding-left: 10px;
    border-left: 4px solid var(--primary-color);
    line-height: 1.2;
}

.s4-main-header h2 a {
    color: var(--text-color);
    text-decoration: none;
}

.s4-second-header {
    margin-top: 30px;
}

/* Filter Bar */
.s4-filter-bar {
    display: flex;
    gap: 15px;
    align-items: center;
}

.s4-filter-select {
    flex: 1;
}

.s4-filter-select select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    font-size: 15px;
    font-family: inherit;
    color: #475569;
    border-radius: 2px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23475569%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 10px auto;
}

.s4-filter-select select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.s4-filter-submit button {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.3s;
    border-radius: 2px;
    min-width: 150px;
}

.s4-filter-submit button:hover {
    background-color: #111;
}

/* Top Grid (Lead + Ad) */
.s4-top-grid {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 30px;
    margin-bottom: 25px;
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 25px;
}

.s4-lead-post {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
}

.s4-lead-image {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.s4-lead-image a {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

.s4-lead-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.s4-lead-post:hover .s4-lead-image img {
    transform: scale(1.05);
}

.s4-lead-content {
    display: flex;
    flex-direction: column;
}

.s4-lead-title {
    font-size: 28px;
    line-height: 1.4;
    margin: 0 0 10px 0;
}

.s4-lead-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.s4-lead-title a:hover {
    color: var(--primary-color);
}

.s4-lead-excerpt {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
}

.s4-lead-excerpt::after {
    content: "";
    display: table;
    clear: both;
}

.s4-lead-read-more {
    float: right;
    color: var(--primary-color);
    font-weight: 600;
    margin-left: 10px;
    text-decoration: none;
    transition: color 0.3s;
}

.s4-lead-read-more:hover {
    color: #111;
}

.s4-lead-read-more i {
    font-size: 12px;
    margin-left: 2px;
}

.s4-ad-col {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.s4-side-ad img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Bottom Grid */
.s4-bottom-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.s4-grid-item {
    display: flex;
    flex-direction: column;
}

.s4-grid-image {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    margin-bottom: 12px;
}

.s4-grid-image a {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

.s4-grid-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.s4-grid-item:hover .s4-grid-image img {
    transform: scale(1.05);
}

.s4-grid-title {
    font-size: 16px;
    line-height: 1.4;
    margin: 0;
}

.s4-grid-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.s4-grid-title a:hover {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 1024px) {
    .s4-top-grid {
        grid-template-columns: 1fr;
    }
    
    .s4-ad-col {
        justify-content: center;
        margin-top: 20px;
    }

    .s4-bottom-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .s4-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .s4-filter-submit button {
        width: 100%;
    }
    
    .s4-lead-post {
        grid-template-columns: 1fr;
    }
    .s4-bottom-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}
