/* U4 News – in the design language of the theme (Roboto, white cards, green #009540 accents) */

.u4n {
    --u4n-green: #009540;
    --u4n-green-button: #007a33;
    --u4n-green-dark: #005a27;
    --u4n-text: #1f2937;
    --u4n-muted: #4b5563;
    --u4n-line: #e5e7eb;
    max-width: 900px;
    margin: 0 auto 2rem;
    color: var(--u4n-text);
    font-family: 'Roboto', sans-serif;
}
.u4n * {
    box-sizing: border-box;
}

/* --- category filter --- */
.u4n-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin: 0 0 2rem;
    scroll-margin-top: 110px;
}
.u4n-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    background: #f3f4f6;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--u4n-text) !important;
    font-size: 0.9rem;
    text-decoration: none !important;
    transition: background-color 0.2s;
}
.u4n-chip:hover {
    background: #e5e7eb;
}
.u4n-chip.is-active {
    background: #ecfdf3;
    border-color: var(--u4n-green-button);
    color: var(--u4n-green-dark) !important;
    font-weight: 700;
}
.u4n-count {
    padding: 0 0.4rem;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 999px;
    font-size: 0.75rem;
}
.u4n-chip:focus-visible,
.u4n-title a:focus-visible,
.u4n-lightbox:focus-visible,
.u4n-page-link:focus-visible,
.u4n-card:focus-visible {
    outline: 3px solid var(--u4n-green-dark);
    outline-offset: 2px;
}

/* --- list: date column + card --- */
.u4n-list {
    scroll-margin-top: 110px;
}
.u4n-item {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 1.25rem;
    margin: 0 0 1.5rem;
}
.u4n-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: start;
    padding: 0.6rem 0.25rem;
    background: var(--u4n-green-button);
    border-radius: 0.5rem;
    color: #fff;
    line-height: 1.1;
    text-align: center;
}
.u4n-day {
    font-size: 1.6rem;
    font-weight: 800;
}
.u4n-month {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}
.u4n-year {
    font-size: 0.75rem;
    opacity: 0.85;
}
.u4n-body {
    min-width: 0;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border: 1px solid var(--u4n-line);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
.u4n-cat {
    display: inline-block;
    margin-bottom: 0.3rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--u4n-green);
}
.u4n-title {
    margin: 0 0 0.6rem;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
}
.u4n-title a {
    color: var(--u4n-text) !important;
    text-decoration: none !important;
}
.u4n-title a:hover {
    color: var(--u4n-green-dark) !important;
}
.u4n-main {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}
.u4n-content {
    flex: 1;
    min-width: 0;
    color: var(--u4n-muted);
    line-height: 1.6;
}
.u4n-content p {
    margin: 0 0 0.6rem;
}
.u4n-content p:last-child {
    margin-bottom: 0;
}
.u4n-content a {
    color: var(--u4n-green-dark);
    font-weight: 600;
}

/* single image (often a logo): beside the text, never cropped */
.u4n-figure {
    flex: 0 0 180px;
    margin: 0;
}
.u4n-figure a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: #fff;
    border: 1px solid #f0f1f3;
    border-radius: 0.375rem;
}
.u4n-figure img {
    display: block;
    max-width: 100%;
    max-height: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* gallery: below the text, 3:2 tiles */
.u4n-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}
.u4n-gallery-count-1 { grid-template-columns: minmax(0, 480px); }
.u4n-gallery-count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.u4n-gallery-count-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.u4n-gallery a {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 3 / 2;
    border-radius: 0.375rem;
    background: #f3f4f6;
}
.u4n-gallery a.u4n-hidden {
    display: none;
}
.u4n-gallery img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.u4n-gallery a:hover img {
    transform: scale(1.04);
}
.u4n-more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 90, 39, 0.65);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
}

/* --- paging --- */
.u4n-pages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem 1.25rem;
    margin-top: 2rem;
}
.u4n-page-link {
    padding: 0.6rem 1.25rem;
    border: 2px solid var(--u4n-green-button);
    border-radius: 0.375rem;
    color: var(--u4n-green-button) !important;
    font-weight: 700;
    text-decoration: none !important;
}
.u4n-page-link:hover {
    background: #ecfdf3;
}
.u4n-page-info {
    color: #6b7280;
    font-size: 0.9rem;
}
.u4n-empty {
    text-align: center;
    color: var(--u4n-muted);
}

/* --- compact cards (homepage) --- */
.u4n-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}
.u4n-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--u4n-line);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    color: var(--u4n-text) !important;
    text-decoration: none !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.u4n-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
.u4n-card-media {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    padding: 0.75rem;
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
}
.u4n-card-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.u4n-card-media i {
    font-size: 2.5rem;
    color: #d1d5db;
}
.u4n-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.25rem 1.25rem;
}
.u4n-card-meta {
    font-size: 0.8rem;
    color: var(--u4n-green);
    font-weight: 600;
}
.u4n-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
}
.u4n-card-text {
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--u4n-muted);
}
.u4n-all {
    margin: 1rem 0 0;
    text-align: center;
}
.u4n-all a {
    color: var(--u4n-green-dark) !important;
    font-weight: 700;
}

/* --- single news page --- */
.u4n-single {
    max-width: none;
}
.u4n-single-meta {
    color: var(--u4n-green);
    font-weight: 600;
}
.u4n-back {
    margin-top: 2rem;
}
.u4n-back a {
    color: var(--u4n-green-dark);
    font-weight: 700;
}

/* --- phones --- */
@media (max-width: 600px) {
    .u4n-item {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }
    .u4n-date {
        flex-direction: row;
        justify-self: start;
        gap: 0.35rem;
        padding: 0.35rem 0.75rem;
        border-radius: 0.5rem 0.5rem 0 0;
        margin-left: 1rem;
    }
    .u4n-day,
    .u4n-month,
    .u4n-year {
        font-size: 0.85rem;
        opacity: 1;
    }
    .u4n-body {
        padding: 1rem;
    }
    .u4n-main {
        flex-direction: column-reverse;
    }
    .u4n-figure {
        flex-basis: auto;
        align-self: center;
    }
    .u4n-figure img {
        max-height: 120px;
    }
    .u4n-gallery,
    .u4n-gallery-count-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .u4n-gallery-count-1 {
        grid-template-columns: minmax(0, 1fr);
    }
    .u4n-title {
        font-size: 1.15rem;
    }
    .u4n-filter {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.25rem;
    }
    .u4n-chip {
        flex: 0 0 auto;
    }
}
