:root {
    --primary: #0052cc;
    --primary-dark: #003b95;
    --primary-soft: #edf4ff;
    --ink: #111827;
    --muted: #64748b;
    --surface: #ffffff;
    --page: #f5f7fb;
    --line: #e5eaf1;
    --gold: #f4c94a;
    --shadow-sm: 0 7px 24px rgba(15, 23, 42, .06);
    --shadow-lg: 0 20px 48px rgba(15, 23, 42, .13);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    overflow-x: hidden;
    background: var(--page);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 14px;
    z-index: 9999;
    padding: 10px 14px;
    border-radius: 8px;
    background: #000;
    color: #fff;
    text-decoration: none;
}

.skip-link:focus {
    top: 14px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(226, 232, 240, .9);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(16px);
}

.navbar {
    min-height: 76px;
    padding: 6px 0;
}

.navbar-brand img {
    display: block;
    width: auto;
    height: 60px;
    object-fit: contain;
}

.nav-link {
    margin: 0 2px;
    border-radius: 9px;
    color: #263244;
    font-size: .86rem;
    font-weight: 700;
    transition: .2s ease;
}

.nav-link:hover,
.nav-link:focus {
    background: var(--primary-soft);
    color: var(--primary);
}

.page-shell {
    padding-top: 28px;
    padding-bottom: 55px;
}

.compact-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.eyebrow,
.section-title span {
    color: var(--primary);
    font-size: .69rem;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.compact-top h1 {
    margin: 4px 0 0;
    font-size: clamp(1.7rem, 3.4vw, 2.55rem);
    font-weight: 850;
    letter-spacing: -.035em;
    line-height: 1.08;
}

.site-search {
    display: flex;
    width: min(100%, 410px);
    min-height: 48px;
    overflow: hidden;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.site-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    padding: 0 15px;
    background: transparent;
    color: var(--ink);
    font-size: .91rem;
}

.site-search button {
    width: 54px;
    flex: 0 0 54px;
    border: 0;
    background: var(--primary);
    color: #fff;
    transition: .2s ease;
}

.site-search button:hover {
    background: var(--primary-dark);
}

.category-strip {
    display: flex;
    gap: 8px;
    margin-bottom: 31px;
    padding: 2px 0 9px;
    overflow-x: auto;
    scrollbar-width: none;
}

.category-strip::-webkit-scrollbar {
    display: none;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid #dbe3ed;
    border-radius: 999px;
    background: #fff;
    color: #344155;
    font-size: .75rem;
    font-weight: 750;
    text-decoration: none;
    transition: .2s ease;
}

.category-chip span {
    padding: 2px 6px;
    border-radius: 999px;
    background: #eef2f7;
    color: #64748b;
    font-size: .65rem;
}

.category-chip:hover,
.category-chip.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}

.category-chip:hover span,
.category-chip.active span {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 18px;
}

.section-title h2 {
    margin: 4px 0 0;
    font-size: clamp(1.35rem, 2.4vw, 1.9rem);
    font-weight: 850;
    letter-spacing: -.025em;
}

.section-title strong {
    color: var(--muted);
    font-size: .77rem;
    font-weight: 750;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 21px;
}

.post-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    border-color: #bdd1ff;
    box-shadow: var(--shadow-lg);
}

.featured-card {
    border-color: #ecd16f;
}

.featured-badge {
    position: absolute;
    top: 11px;
    right: 11px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    border: 1px solid #efd66e;
    border-radius: 999px;
    background: rgba(255, 248, 215, .96);
    color: #725000;
    box-shadow: 0 5px 16px rgba(0, 0, 0, .08);
    font-size: .63rem;
    font-weight: 850;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.post-media {
    position: relative;
    display: flex;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #edf1f5;
    background: #f2f5f9;
    text-decoration: none;
}

/*
|--------------------------------------------------------------------------
| Full image display
|--------------------------------------------------------------------------
| contain = show the complete image without cropping.
| This is ideal for Gazette notices, vacancy posters and advertisements.
*/
.post-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #f2f5f9;
    transition: transform .28s ease;
}

.post-card:hover .post-media img {
    transform: scale(1.012);
}

.image-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: var(--primary);
    font-size: 3rem;
}

.category-badge {
    position: absolute;
    left: 11px;
    bottom: 11px;
    z-index: 3;
    max-width: calc(100% - 22px);
    overflow: hidden;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(0, 82, 204, .94);
    color: #fff;
    box-shadow: 0 5px 16px rgba(0, 0, 0, .12);
    font-size: .63rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-body {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    padding: 16px;
}

.post-body h3 {
    display: -webkit-box;
    margin: 0 0 10px;
    overflow: hidden;
    font-size: 1.03rem;
    font-weight: 800;
    letter-spacing: -.015em;
    line-height: 1.43;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.post-body h3 a {
    color: var(--ink);
    text-decoration: none;
}

.post-body h3 a:hover {
    color: var(--primary);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 13px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: .71rem;
}

.post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.post-meta i {
    color: var(--primary);
}

.post-body p {
    display: -webkit-box;
    margin: 0 0 14px;
    overflow: hidden;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.58;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.details-button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: .78rem;
    font-weight: 800;
    text-decoration: none;
    transition: .2s ease;
}

.details-button:hover {
    background: var(--primary);
    color: #fff;
}

.featured-section {
    margin-top: 48px;
    padding-top: 34px;
    border-top: 1px solid var(--line);
}

.featured-section .section-title h2 i {
    color: #e0a900;
}

.empty-state {
    padding: 60px 20px;
    border: 1px dashed #cad4e0;
    border-radius: 18px;
    background: #fff;
    text-align: center;
}

.empty-state i {
    margin-bottom: 12px;
    color: var(--primary);
    font-size: 3rem;
}

.empty-state h3 {
    margin-bottom: 5px;
    font-weight: 800;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.page-numbers {
    display: flex;
    gap: 6px;
}

.page-button,
.page-number {
    display: inline-flex;
    min-width: 40px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #d7dfeb;
    border-radius: 10px;
    background: #fff;
    color: var(--primary);
    font-size: .76rem;
    font-weight: 800;
    text-decoration: none;
    transition: .2s ease;
}

.page-button {
    padding: 0 13px;
}

.page-button:hover,
.page-number:hover,
.page-number.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.site-footer {
    padding: 43px 0 0;
    background: #101827;
    color: #c8d0dc;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 40px;
    padding-bottom: 35px;
}

.footer-grid img {
    width: auto;
    height: 50px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.footer-grid p {
    max-width: 530px;
    margin: 14px 0 0;
    color: #aeb9c8;
    font-size: .85rem;
    line-height: 1.65;
}

.footer-grid nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 11px 24px;
}

.footer-grid nav a {
    color: #d7deea;
    font-size: .8rem;
    font-weight: 650;
    text-decoration: none;
}

.footer-grid nav a:hover {
    color: #fff;
}

.copyright {
    padding: 17px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: #8f9bac;
    font-size: .74rem;
    text-align: center;
}

.back-to-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 900;
    display: grid;
    width: 44px;
    height: 44px;
    visibility: hidden;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    opacity: 0;
    box-shadow: 0 12px 28px rgba(0, 82, 204, .3);
    transform: translateY(10px);
    transition: .2s ease;
}

.back-to-top.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

@media (min-width: 769px) and (max-width: 1100px) {
    .post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .navbar-brand img {
        height: 53px;
    }

    .compact-top {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }

    .site-search {
        width: 100%;
    }

    .post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .post-media {
        aspect-ratio: 4 / 3;
    }

    .post-body {
        padding: 11px;
    }

    .post-body h3 {
        margin-bottom: 8px;
        font-size: .84rem;
        line-height: 1.4;
    }

    .post-meta {
        gap: 5px 8px;
        margin-bottom: 8px;
        font-size: .62rem;
    }

    .post-body p {
        margin-bottom: 10px;
        font-size: .72rem;
        -webkit-line-clamp: 2;
    }

    .details-button {
        min-height: 36px;
        font-size: .7rem;
    }

    .featured-badge {
        top: 7px;
        right: 7px;
        padding: 4px 7px;
        font-size: .54rem;
    }

    .category-badge {
        left: 7px;
        bottom: 7px;
        max-width: calc(100% - 14px);
        padding: 4px 7px;
        font-size: .54rem;
    }

    .section-title {
        align-items: flex-start;
    }

    .section-title strong {
        padding-top: 4px;
    }

    .pagination-wrap {
        flex-wrap: wrap;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

@media (max-width: 390px) {
    .post-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
