.pg-container-8a242772 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(200px, auto);
}

.pg-item-8a242772 {
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: var(--pg-color-1, #bbf0fd); /* Base fallback */
    transition: transform 0.3s ease;
    overflow: hidden;
}

/* If a template is used, we need to ensure the template wrapper behaves properly in flex */
.pg-item-8a242772.pg-has-template > div {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.pg-template-placeholder {
    padding: 20px;
    background: rgba(255,255,255,0.5);
    border: 1px dashed #ccc;
    text-align: center;
    border-radius: 8px;
    margin: auto 0;
}

/* 1st item: 2 cols wide, 2 rows high */
.pg-item-8a242772:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
    background-color: var(--pg-color-1, #bbf0fd); /* Blue */
}

/* 2nd item: 1 col, 1 row */
.pg-item-8a242772:nth-child(2) {
    grid-column: span 1;
    grid-row: span 1;
    background-color: var(--pg-color-2, #e3f4b6); /* Green */
}

/* 3rd item: 1 col, 1 row */
.pg-item-8a242772:nth-child(3) {
    grid-column: span 1;
    grid-row: span 1;
    background-color: var(--pg-color-3, #fdcdd6); /* Pink */
}

/* All other items: 1x1 */
.pg-item-8a242772:nth-child(n+4) {
    grid-column: span 1;
    grid-row: span 1;
}

/* Strict color mapping based on visual grid to avoid neighbors sharing color */
/* Row 3: items 4, 5, 6 */
.pg-item-8a242772:nth-child(4) { background-color: var(--pg-color-3, #fdcdd6); } /* Pink */
.pg-item-8a242772:nth-child(5) { background-color: var(--pg-color-2, #e3f4b6); } /* Green */
.pg-item-8a242772:nth-child(6) { background-color: var(--pg-color-1, #bbf0fd); } /* Blue */

/* Row 4: items 7, 8, 9 */
.pg-item-8a242772:nth-child(7) { background-color: var(--pg-color-2, #e3f4b6); } /* Green */
.pg-item-8a242772:nth-child(8) { background-color: var(--pg-color-1, #bbf0fd); } /* Blue */
.pg-item-8a242772:nth-child(9) { background-color: var(--pg-color-3, #fdcdd6); } /* Pink */

/* Row 5: items 10, 11, 12 */
.pg-item-8a242772:nth-child(10) { background-color: var(--pg-color-1, #bbf0fd); } /* Blue */
.pg-item-8a242772:nth-child(11) { background-color: var(--pg-color-3, #fdcdd6); } /* Pink */
.pg-item-8a242772:nth-child(12) { background-color: var(--pg-color-2, #e3f4b6); } /* Green */

/* Loop the pattern for endless posts using nth-child math (cycles every 9 items starting after first 3) */
.pg-item-8a242772:nth-child(9n+4), .pg-item-8a242772:nth-child(9n+9), .pg-item-8a242772:nth-child(9n+11) { background-color: var(--pg-color-3, #fdcdd6); } /* Pink */
.pg-item-8a242772:nth-child(9n+5), .pg-item-8a242772:nth-child(9n+7), .pg-item-8a242772:nth-child(9n+12) { background-color: var(--pg-color-2, #e3f4b6); } /* Green */
.pg-item-8a242772:nth-child(9n+6), .pg-item-8a242772:nth-child(9n+8), .pg-item-8a242772:nth-child(9n+10) { background-color: var(--pg-color-1, #bbf0fd); } /* Blue */

/* Structure for pushing content to bottom */
.pg-date-8a242772 {
    font-size: 14px;
    color: #2b3a4a;
}

.pg-content-bottom-8a242772 {
    margin-top: auto; /* This pushes the block to the bottom of the flex container */
    padding-top: 20px;
}

/* Typography */
.pg-title-8a242772 {
    font-size: 22px;
    font-weight: bold;
    text-transform: uppercase;
    margin: 0 0 10px 0;
}

.pg-title-8a242772 a {
    color: #2b3a4a;
    text-decoration: none;
}

.pg-item-8a242772:nth-child(1) .pg-title-8a242772 {
    font-size: 32px;
}

.pg-excerpt-8a242772 {
    font-size: 14px;
    color: #2b3a4a;
    line-height: 1.5;
}

.pg-excerpt-8a242772 p {
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .pg-container-8a242772 {
        grid-template-columns: repeat(2, 1fr);
    }
    .pg-item-8a242772:nth-child(1) {
        grid-column: span 2;
        grid-row: span 1;
    }
}

@media (max-width: 767px) {
    .pg-container-8a242772 {
        grid-template-columns: 1fr;
    }
    .pg-item-8a242772:nth-child(1),
    .pg-item-8a242772:nth-child(n+2) {
        grid-column: span 1;
        grid-row: auto;
    }
}
