@import url('/assets/fonts/fonts.css?v=1');

/* ══════════════════════════════════════════════════════
   ADSSU EGBMS — Public Articles Pages
   Brand palette: Forest #063f13 · Gold #c8961a · Blue #14539a
   ══════════════════════════════════════════════════════ */

:root {
    --pa-green: #0b5a1c;
    --pa-green-btn: #12762a;
    --pa-green-deep: #08401a;
    --pa-green-soft: #e9f3e6;
    --pa-green-mid: #3d8a30;
    --pa-gold: #c8961a;
    --pa-gold-light: #e2b84a;
    --pa-gold-deep: #8a6a10;
    --pa-blue: #14539a;
    --pa-gold-soft: #fff3c9;
    --pa-ink: #1a1a2e;
    --pa-muted: #5a6275;
    --pa-surface: #ffffff;
    --pa-page-bg: #f4f5f7;
    --pa-border: rgba(0, 0, 0, 0.08);
    --pa-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --pa-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --pa-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.1);
    --pa-radius: 12px;
    --pa-radius-lg: 16px;
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--pa-ink);
    background: var(--pa-page-bg);
    -webkit-font-smoothing: antialiased;
}

/* ── Government bar + top navigation (emerald) ─────────
   Every colour on the bar is set explicitly so the text never inherits a
   dark ink colour against the green background. */
.pa-header { display: contents; }

.pa-govbar {
    border-top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--pa-green-deep);
    color: #fff;
    font-size: 0.78rem;
}

.pa-govbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(100%, 1760px);
    height: 28px;
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 3vw, 3rem);
}

.pa-govbar-left {
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pa-govbar-right {
    color: rgba(255, 255, 255, 0.76);
    font-weight: 500;
}

.pa-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    height: 76px;
    padding: 0 max(clamp(1.25rem, 3vw, 3rem), calc((100% - 1760px) / 2 + clamp(1.25rem, 3vw, 3rem)));
    background-color: var(--pa-green);
    background-image: linear-gradient(90deg, var(--pa-green-deep) 0%, var(--pa-green) 55%, var(--pa-green-btn) 100%);
    border-bottom: 3px solid var(--egbms-gold, #fbc217);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    color: #fff;
}

.pa-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex-shrink: 1;
    min-width: 0;
}

/* Both seals sit on white gold-ringed badges so their green artwork
   stays visible against the green bar. */
.pa-brand-logo {
    box-sizing: border-box;
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    padding: 4px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(251, 194, 23, 0.7), 0 4px 12px rgba(0, 0, 0, 0.25);
    object-fit: contain;
}

.pa-brand-logo--oubs {
    padding: 1px;
}

.pa-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
    min-width: 0;
    margin-left: 0.35rem;
    padding-left: 0.95rem;
    border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.pa-brand-eyebrow {
    color: var(--egbms-gold, #fbc217);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
}

.pa-brand-name {
    color: #fff;
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
}

.pa-nav {
    display: flex;
    align-items: center;
    gap: 0;
    height: 100%;
    margin-left: auto;
}

.pa-nav-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    height: 100%;
    padding: 0 1.1rem;
    color: rgba(255, 255, 255, 0.84);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    position: relative;
    transition: color 0.2s ease, background 0.2s ease;
}

.pa-nav-link:hover,
.pa-nav-link.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.pa-nav-link.is-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0.5rem;
    right: 0.5rem;
    height: 3px;
    background: var(--egbms-gold, #fbc217);
    border-radius: 3px 3px 0 0;
}

.pa-nav-link svg { width: 16px; height: 16px; opacity: 0.85; }

/* ── Articles dropdown ────────────────────────────────── */
.pa-dropdown { position: relative; height: 100%; }
.pa-dropdown-toggle { cursor: pointer; }

.pa-dropdown-toggle::before {
    content: '';
    display: inline-block;
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    margin-left: 0.35rem;
    vertical-align: middle;
    opacity: 0.7;
}

.pa-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 210px;
    background: #fff;
    border-radius: 0 0 var(--pa-radius) var(--pa-radius);
    box-shadow: var(--pa-shadow-lg);
    border: 1px solid var(--pa-border);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 200;
}

.pa-dropdown:hover .pa-dropdown-menu,
.pa-dropdown:focus-within .pa-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.pa-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.15rem;
    color: var(--pa-ink);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.15s ease;
}

.pa-dropdown-item:hover {
    background: rgba(34, 74, 30, 0.06);
    color: var(--pa-green);
}

.pa-dropdown-item svg { width: 16px; height: 16px; opacity: 0.5; flex-shrink: 0; }

/* Category with nothing published: visible but inert. pointer-events:none
   keeps the :hover rule above from matching and lets the pointer fall through
   to .pa-dropdown-menu, so crossing a disabled row never closes the menu. */
.pa-dropdown-item.is-disabled {
    color: var(--pa-muted);
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.pa-dropdown-hint {
    margin-left: auto;
    padding-left: 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    font-style: italic;
    white-space: nowrap;
}

.pa-dropdown-divider {
    height: 1px;
    background: var(--pa-border);
    margin: 0.35rem 0;
}

/* ── Nav right actions ────────────────────────────────── */
.pa-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.pa-signin {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.8rem 1.25rem;
    border-radius: 8px;
    background: var(--egbms-gold, #fbc217);
    color: #2a2208;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
    transition: background 0.2s ease, transform 0.2s ease;
}

.pa-signin svg { width: 18px; height: 18px; }

.pa-signin:hover {
    background: #ffd54f;
    color: #1f1906;
    transform: translateY(-1px);
}

/* ── Page layout ─────────────────────────────────────── */
.pa-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.pa-page-header { margin-bottom: 1.75rem; }

.pa-page-header h1 {
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--pa-ink);
    margin: 0 0 1.25rem;
    letter-spacing: -0.04em;
    line-height: 1;
}

/* ── Filter pills ────────────────────────────────────── */
.pa-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pa-filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--pa-muted);
    margin-right: 0.25rem;
}

.pa-filter-pill {
    border: 1.5px solid var(--pa-border);
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--pa-muted);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pa-filter-pill:hover {
    color: var(--pa-green);
    border-color: var(--pa-green);
    background: rgba(34, 74, 30, 0.04);
}

.pa-filter-pill.is-active {
    color: #fff;
    background: var(--pa-green);
    border-color: var(--pa-green);
    box-shadow: 0 4px 12px rgba(34, 74, 30, 0.3);
}

/* Must stay after :hover and .is-active — same specificity, so source order
   decides. Keeps the pill dimmed even at /articles?category=<empty one>. */
.pa-filter-pill:disabled {
    color: var(--pa-muted);
    background: #fff;
    border-color: var(--pa-border);
    opacity: 0.5;
    box-shadow: none;
    cursor: default;
}

/* ── Article grid ────────────────────────────────────── */
.pa-article-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
    margin-top: 0.5rem;
}

/* ── Article card ────────────────────────────────────── */
.pa-card {
    background: #fff;
    border-radius: var(--pa-radius-lg);
    overflow: hidden;
    border: 1px solid var(--pa-border);
    box-shadow: var(--pa-shadow-sm);
    display: flex;
    flex-direction: column;
    min-width: 0; /* allow the grid item to shrink below its content width */
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pa-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--pa-shadow-lg);
}

.pa-card-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, var(--pa-green-soft) 0%, var(--pa-gold-soft) 50%, #e8f0fe 100%);
}

.pa-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.pa-card:hover .pa-card-image { transform: scale(1.06); }

.pa-card-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, rgba(34,74,30,0.08) 0%, rgba(251,194,23,0.06) 50%, rgba(25,58,122,0.04) 100%);
}

/* Category badge */
.pa-category {
    position: absolute;
    bottom: 0;
    left: 0;
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
}

.pa-category--announcements { background: var(--pa-green); }
.pa-category--news { background: #c42b2b; }
.pa-category--memoranda { background: var(--pa-gold); }
.pa-category--events { background: #0d7a8e; }
.pa-category--general { background: #5f6f89; }

/* Card body */
.pa-card-body {
    padding: 1.1rem 1.25rem 0.85rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pa-card-title {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: var(--pa-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pa-card-summary {
    margin: 0;
    color: var(--pa-muted);
    font-size: 0.88rem;
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pa-card-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.85rem;
    color: var(--pa-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.pa-card-meta svg { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.5; }

/* Card CTA button — brand green */
.pa-card-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.8rem 1rem;
    margin: 0.25rem 1rem 1rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 800;
    color: #fff;
    background: var(--pa-green);
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(34, 74, 30, 0.2);
}

.pa-card-cta:hover {
    color: #fff;
    background: var(--pa-green-deep);
    box-shadow: 0 6px 20px rgba(34, 74, 30, 0.35);
}

/* ── Empty state ─────────────────────────────────────── */
.pa-empty {
    padding: 3rem 1.5rem;
    border-radius: var(--pa-radius-lg);
    border: 2px dashed rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.7);
    color: var(--pa-muted);
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
}

/* ── Article detail ──────────────────────────────────── */
.pa-detail {
    max-width: 860px;
    margin: 0 auto;
    background: #fff;
    border-radius: var(--pa-radius-lg);
    border: 1px solid var(--pa-border);
    box-shadow: var(--pa-shadow-md);
    padding: 2rem;
}

.pa-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--pa-green);
    text-decoration: none;
    margin-bottom: 1.25rem;
    transition: color 0.2s ease;
}

.pa-detail-back:hover { color: var(--pa-green-deep); }

.pa-detail-hero {
    border-radius: var(--pa-radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.pa-detail-hero img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

.pa-detail-header { margin-bottom: 1.75rem; }

.pa-detail-header h1 {
    margin: 0.75rem 0 0.65rem;
    font-size: 1.85rem;
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -0.03em;
    color: var(--pa-ink);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pa-detail-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--pa-muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.pa-detail-meta svg { width: 14px; height: 14px; opacity: 0.5; }

.pa-detail-body {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--pa-ink);
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ── Related articles ─────────────────────────────────── */
.pa-related-section {
    max-width: 1200px;
    margin: 2rem auto 0;
}

.pa-related-heading { margin-bottom: 1rem; }

.pa-related-heading .pa-section-kicker {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--pa-green);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.pa-related-heading h3 {
    margin: 0.25rem 0 0;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* ── Footer ──────────────────────────────────────────── */
.pa-footer {
    text-align: center;
    padding: 2rem 0 1rem;
    color: var(--pa-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

/* ── Mobile bottom tab bar (shared by all public pages) ──
   Hidden on desktop; revealed in the phone media query below. */
.lp-tabbar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    background: #fff;
    border-top: 1px solid var(--pa-border);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom));
}

.lp-tab {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.4rem 0;
    color: var(--pa-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
}

.lp-tab svg { width: 22px; height: 22px; }

.lp-tab.is-active { color: var(--pa-green); }

.lp-tab.is-active::before {
    content: "";
    position: absolute;
    top: 0;
    width: 34px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--pa-green);
}

/* ── Responsive ──────────────────────────────────────── */
@media screen and (max-width: 991.98px) {
    .pa-article-grid { grid-template-columns: minmax(0, 1fr); }
    .pa-page-header h1 { font-size: 1.8rem; }
}

@media screen and (max-width: 767.98px) {
    .pa-topbar { padding: 0.45rem 1rem; min-height: 58px; height: auto; }
    .pa-govbar-inner { height: 21px; padding: 0 1rem; }
    .pa-govbar-right { display: none; }
    .pa-brand { gap: 0.45rem; }
    .pa-brand-logo { width: 40px; height: 40px; padding: 3px; }
    .pa-brand-logo--oubs { padding: 1px; }
    .pa-brand-text { margin-left: 0.2rem; padding-left: 0.7rem; }
    .pa-brand-eyebrow { font-size: 0.58rem; }
    .pa-brand { min-width: 0; }
    .pa-brand-name {
        max-width: calc(100vw - 5.75rem);
        font-size: 0.9rem;
    }

    /* App-mode: brand-only header; navigation moves to the bottom tab bar. */
    .pa-nav,
    .pa-nav-actions { display: none; }

    .pa-main { padding: 1.25rem 1rem 2rem; }
    .pa-page-header h1 { font-size: 1.5rem; }
    .pa-detail { padding: 1.25rem; }
    .pa-detail-header h1 { font-size: 1.4rem; }

    /* Reveal the shared bottom tab bar; reserve space so content clears it. */
    .lp-tabbar { display: flex; }
    body { padding-bottom: 72px; }
}

@media screen and (max-width: 575.98px) {
    .pa-brand { flex-shrink: 1; }
    .pa-brand-name {
        display: block;
        max-width: calc(100vw - 5.5rem);
        white-space: normal;
    }
    .pa-nav-link {
        padding: 0 0.45rem;
        font-size: 0.76rem;
        white-space: nowrap;
    }
    .pa-nav-link svg { width: 14px; height: 14px; }
    .pa-nav-actions { gap: 0.25rem; }
    .pa-signin { padding: 0.55rem 0.8rem; font-size: 0.8rem; }
    .pa-dropdown-menu { position: fixed; top: 54px; left: 0; right: 0; border-radius: 0 0 var(--pa-radius) var(--pa-radius); }
    .pa-filter-bar { gap: 0.35rem; }
    .pa-filter-pill { padding: 0.38rem 0.85rem; font-size: 0.78rem; }
}

/* The ADSSU seal without its white gold-ringed circle: the white outline follows the seal's own shape instead.
   Placed last so it also wins over the phone sizes above. The OUBS seal keeps its circle. */
.pa-brand-logo.pa-brand-logo--adssu {
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    filter: drop-shadow(1.5px 0 0 #fff) drop-shadow(-1.5px 0 0 #fff) drop-shadow(0 1.5px 0 #fff) drop-shadow(0 -1.5px 0 #fff);
}

/* The ADSSU seal sits directly on the green bar with a white outline (no white circle). */
.pa-brand-logo--adssu {
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    filter: drop-shadow(1.5px 0 0 #fff) drop-shadow(-1.5px 0 0 #fff) drop-shadow(0 1.5px 0 #fff) drop-shadow(0 -1.5px 0 #fff);
}
