/* News & Announcements: cards (home, list, About), the article page and the staff form. Light + dark. */
.ann-scope {
    --a-card: #ffffff; --a-border: #e3ebf7; --a-shadow: 0 14px 34px rgba(13, 71, 161, .10);
    --a-shadow-hover: 0 22px 44px rgba(13, 71, 161, .18); --a-accent: #1565c0; --a-accent-2: #1e88e5;
    --a-title: #0a2d5c; --a-text: #3a4a63; --a-muted: #6b7a90; --a-soft: #eef4fd;
}
body.dark-mode .ann-scope {
    --a-card: #11264a; --a-border: rgba(255, 255, 255, .10); --a-shadow: 0 14px 34px rgba(0, 0, 0, .35);
    --a-shadow-hover: 0 22px 44px rgba(0, 0, 0, .5); --a-accent: #6ea8ff; --a-accent-2: #8ab4ff;
    --a-title: #ffffff; --a-text: rgba(255, 255, 255, .85); --a-muted: rgba(255, 255, 255, .6); --a-soft: rgba(255, 255, 255, .06);
}

/* ---------- Section heading ---------- */
.news-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; }
.news-eyebrow {
    display: inline-flex; align-items: center; gap: .5rem; margin-bottom: .4rem; font-size: .78rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase; color: var(--a-accent) !important;
}
.news-eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; position: relative; }
.news-eyebrow .dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #22c55e; animation: ann-ping 1.8s cubic-bezier(0, 0, .2, 1) infinite; }
.news-title { margin: 0; font-weight: 800; color: var(--a-title) !important; }
.news-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.news-actions .stm-modal-slot { margin: 0; }
.news-actions .stm-modal-trigger { padding: .6rem 1.15rem; font-size: .9rem; }
.news-all {
    display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1.1rem; border-radius: 999px; font-weight: 600; font-size: .9rem;
    text-decoration: none; color: var(--a-accent) !important; background: var(--a-soft); border: 1px solid var(--a-border); transition: background .2s, transform .2s;
}
.news-all:hover { transform: translateX(2px); background: color-mix(in srgb, var(--a-accent) 14%, transparent); }

/* ---------- Cards ---------- */
.ann-card {
    position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: 20px;
    background: var(--a-card); border: 1px solid var(--a-border); box-shadow: var(--a-shadow);
    transition: transform .3s ease, box-shadow .3s ease;
}
.ann-card:hover { transform: translateY(-4px); box-shadow: var(--a-shadow-hover); }
.ann-card:hover .ann-thumb img, .ann-card:hover .ann-thumb video { transform: scale(1.05); }
.ann-card-body { display: flex; flex-direction: column; flex: 1; padding: 1.15rem 1.25rem 1.25rem; min-width: 0; }
.ann-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .55rem; font-size: .78rem; color: var(--a-muted) !important; }
.ann-meta time, .ann-meta span { color: var(--a-muted) !important; }
.ann-card-title { margin: 0 0 .5rem; font-weight: 700; font-size: 1.08rem; line-height: 1.35; word-break: break-word; }
.ann-card-title a { color: var(--a-title) !important; text-decoration: none; }
.ann-card-title a:hover { color: var(--a-accent) !important; }
.ann-excerpt {
    margin: 0 0 .9rem; font-size: .9rem; line-height: 1.6; color: var(--a-text) !important; word-break: break-word;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ann-read { margin-top: auto; font-size: .85rem; font-weight: 700; color: var(--a-accent) !important; display: inline-flex; align-items: center; gap: .35rem; }
.ann-card:hover .ann-read i { transform: translateX(3px); }
.ann-read i { transition: transform .2s; }

.ann-new {
    font-size: .62rem; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; padding: .18rem .5rem; border-radius: 999px;
    color: #fff !important; background: linear-gradient(135deg, #f97316, #ef4444); animation: ann-glow 2s ease-in-out infinite;
}
.ann-new[hidden] { display: none; }

/* Featured (newest) card: picture beside the text on wide screens */
.ann-card-featured .ann-card-title { font-size: clamp(1.25rem, 2.2vw, 1.7rem); }
.ann-card-featured .ann-excerpt { -webkit-line-clamp: 5; font-size: .98rem; }
@media (min-width: 992px) {
    .ann-card-featured { flex-direction: row; }
    .ann-card-featured .ann-thumb { flex: 0 0 56%; aspect-ratio: auto; min-height: 340px; }
    .ann-card-featured .ann-card-body { padding: 2rem 2.2rem; justify-content: center; }
    .ann-card-featured.no-media .ann-thumb { flex-basis: 34%; }
}

/* ---------- Thumbnails ---------- */
.ann-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #0a2d5c; flex: none; }
.ann-thumb img, .ann-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.ann-thumb-plain {
    display: grid; place-items: center; color: rgba(255, 255, 255, .9); font-size: 2.6rem;
    background: radial-gradient(circle at 80% 15%, rgba(255, 255, 255, .22), transparent 45%), linear-gradient(135deg, #0a2d5c 0%, #1565c0 65%, #1e88e5 100%);
}
.ann-thumb-plain i { animation: ann-wiggle 3.2s ease-in-out infinite; transform-origin: 30% 70%; }
.ann-play {
    position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%;
    display: grid; place-items: center; font-size: 1.9rem; color: #fff; background: rgba(10, 45, 92, .72);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, .22); backdrop-filter: blur(3px); transition: transform .25s, background .25s;
}
.ann-card:hover .ann-play { transform: scale(1.1); background: #ef4444; }
.ann-badge {
    position: absolute; left: .75rem; bottom: .75rem; display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem;
    border-radius: 999px; font-size: .72rem; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px);
}

/* Staff delete button sits above the card's full-card link */
.ann-del { position: absolute; top: .65rem; right: .65rem; z-index: 3; margin: 0; }
.ann-del-btn {
    border: 0; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; cursor: pointer;
    color: #fff; background: rgba(220, 38, 38, .85); box-shadow: 0 4px 12px rgba(0, 0, 0, .25); transition: transform .2s, background .2s;
}
.ann-del-btn:hover { background: #b91c1c; transform: scale(1.08); }

/* Empty state */
.ann-empty { text-align: center; padding: 3rem 1rem; border-radius: 20px; border: 2px dashed var(--a-border); color: var(--a-muted) !important; }
.ann-empty p { color: var(--a-muted) !important; margin: 0; }
.ann-empty-icon {
    width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem;
    color: var(--a-accent); background: var(--a-soft);
}

/* Scroll-in animation (only when JS is running) */
.ann-js .ann-reveal { opacity: 0; transform: translateY(18px); }
.ann-js .ann-reveal.in { opacity: 1; transform: none; transition: opacity .55s ease calc(var(--i, 0) * 90ms), transform .55s cubic-bezier(.2, .9, .3, 1.1) calc(var(--i, 0) * 90ms), box-shadow .3s; }
.ann-js .ann-reveal.in:hover { transform: translateY(-4px); transition-delay: 0s; }

/* ---------- Compact list (About page sidebar) ---------- */
.ann-mini { display: flex; gap: .8rem; align-items: flex-start; padding: .7rem 0; border-bottom: 1px solid var(--a-border); text-decoration: none; }
.ann-mini:last-child { border-bottom: 0; }
.ann-mini .ann-thumb { width: 92px; border-radius: 12px; font-size: 1.3rem; }
.ann-mini .ann-play { width: 30px; height: 30px; margin: -15px 0 0 -15px; font-size: 1rem; box-shadow: none; }
.ann-mini .ann-badge { display: none; }
.ann-mini-title { display: block; font-weight: 700; font-size: .92rem; line-height: 1.3; color: var(--a-title) !important; }
.ann-mini:hover .ann-mini-title { color: var(--a-accent) !important; }
.ann-mini small { color: var(--a-muted) !important; }

/* ---------- Article page ---------- */
.ann-article { max-width: 860px; margin: 0 auto; }
.ann-article-title { font-weight: 800; color: var(--a-title) !important; line-height: 1.2; }
.ann-article-body { font-size: 1.06rem; line-height: 1.8; color: var(--a-text) !important; word-break: break-word; }
.ann-article-body p { color: var(--a-text) !important; }
.ann-media { border-radius: 20px; overflow: hidden; background: #000; box-shadow: var(--a-shadow); margin-bottom: 1.75rem; }
.ann-media video { display: block; width: 100%; max-height: 75vh; background: #000; }
.ann-media iframe { border: 0; }
.ann-photo { margin: 0 0 1.75rem; }
.ann-photo img { display: block; width: 100%; max-height: 80vh; object-fit: contain; border-radius: 20px; background: var(--a-soft); box-shadow: var(--a-shadow); cursor: zoom-in; }
.ann-photo.zoomed img { max-height: none; cursor: zoom-out; }
.ann-back { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; text-decoration: none; color: var(--a-accent) !important; }
.ann-draft { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #fde68a; color: #78350f !important; }

/* ---------- Staff form ---------- */
.ann-form-media { padding: 1rem; border-radius: 14px; background: rgba(21, 101, 192, .06); border: 1px dashed rgba(21, 101, 192, .35); }
.ann-form-media-title { font-weight: 700; margin-bottom: .75rem; }
.ann-form-media-title span { font-weight: 400; opacity: .7; }
.ann-form-preview { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .9rem; }
.ann-form-preview[hidden] { display: none; }
.ann-form-preview img, .ann-form-preview video { max-height: 160px; max-width: 100%; border-radius: 10px; background: #000; }

@keyframes ann-ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }
@keyframes ann-glow { 0%, 100% { box-shadow: 0 3px 8px rgba(239, 68, 68, .4); } 50% { box-shadow: 0 3px 16px rgba(239, 68, 68, .75); } }
@keyframes ann-wiggle { 0%, 88%, 100% { transform: rotate(0); } 91% { transform: rotate(-14deg); } 94% { transform: rotate(12deg); } 97% { transform: rotate(-8deg); } }
@media (prefers-reduced-motion: reduce) {
    .ann-thumb-plain i, .news-eyebrow .dot::after, .ann-new { animation: none; }
    .ann-js .ann-reveal { opacity: 1; transform: none; }
    .ann-card, .ann-thumb img, .ann-thumb video { transition: none; }
}

/* ---------- Home page: announcements side column (scrolls when there are many) ---------- */
.ann-side {
    display: flex; flex-direction: column; border-radius: 20px; overflow: hidden;
    background: var(--a-card); border: 1px solid var(--a-border); box-shadow: var(--a-shadow);
}
.ann-side-head {
    display: flex; align-items: center; gap: .7rem; padding: 1rem 1.2rem; color: #fff;
    background: radial-gradient(circle at 90% 0%, rgba(255,255,255,.2), transparent 45%), linear-gradient(135deg, #0a2d5c 0%, #1565c0 70%, #1e88e5 100%);
}
.ann-side-title { margin: 0; flex: 1; font-size: 1.05rem; font-weight: 700; color: #fff !important; display: flex; align-items: center; gap: .55rem; }
.ann-side-title i { animation: ann-wiggle 3.2s ease-in-out infinite; transform-origin: 30% 70%; }
.ann-side-dot { position: relative; width: 10px; height: 10px; border-radius: 50%; background: #4ade80; flex: none; }
.ann-side-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #4ade80; animation: ann-ping 1.8s cubic-bezier(0, 0, .2, 1) infinite; }
.ann-side-count { min-width: 28px; height: 28px; padding: 0 .5rem; border-radius: 999px; display: inline-grid; place-items: center;
                  font-weight: 700; font-size: .8rem; color: #0a2d5c !important; background: #fff; }
.ann-side-tools { padding: .8rem 1rem 0; }
.ann-side-tools .stm-modal-slot { margin: 0; }
.ann-side-tools .stm-modal-trigger { width: 100%; justify-content: center; padding: .55rem 1rem; font-size: .9rem; }
.ann-side-list {
    max-height: min(560px, 70vh); overflow-y: auto; overscroll-behavior: contain; padding: .8rem;
    display: flex; flex-direction: column; gap: .65rem;
    scrollbar-width: thin; scrollbar-color: var(--a-accent) transparent;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
            mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
    padding-bottom: 1.6rem;
}
.ann-side-list::-webkit-scrollbar { width: 6px; }
.ann-side-list::-webkit-scrollbar-thumb { background: var(--a-accent); border-radius: 6px; }
.ann-side-list:focus-visible { outline: 2px solid var(--a-accent); outline-offset: -2px; }
.ann-side-item {
    position: relative; display: flex; gap: .75rem; align-items: flex-start; padding: .65rem; border-radius: 14px;
    background: var(--a-soft); border: 1px solid transparent; transition: background .2s, border-color .2s, transform .2s;
}
.ann-side-item:hover { border-color: var(--a-border); transform: translateY(-2px); }
.ann-side-item .ann-thumb { flex: 0 0 84px; width: 84px; aspect-ratio: 1; border-radius: 10px; font-size: 1.4rem; }
.ann-side-item .ann-play { width: 30px; height: 30px; margin: -15px 0 0 -15px; font-size: 1rem; box-shadow: none; }
.ann-side-item .ann-badge { display: none; }
.ann-side-body { min-width: 0; flex: 1; }
.ann-side-item-title { margin: 0 0 .2rem; font-size: .95rem; font-weight: 700; line-height: 1.3; word-break: break-word; padding-right: 1.6rem; }
.ann-side-item-title a { color: var(--a-title) !important; text-decoration: none; }
.ann-side-item:hover .ann-side-item-title a { color: var(--a-accent) !important; }
.ann-side-text { margin: 0 0 .3rem; font-size: .82rem; line-height: 1.45; color: var(--a-text) !important;
                 display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ann-side-item .ann-meta { font-size: .72rem; gap: .4rem; }
.ann-side-del { position: absolute; top: .45rem; right: .45rem; z-index: 3; margin: 0; }
.ann-side-del button { border: 0; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: .8rem;
                       color: #dc2626; background: rgba(220,38,38,.1); cursor: pointer; }
.ann-side-del button:hover { background: #dc2626; color: #fff; }
.ann-side-all {
    border: 0; border-top: 1px solid var(--a-border); background: transparent; width: 100%; padding: .85rem 1rem;
    font-weight: 700; font-size: .9rem; color: var(--a-accent); display: flex; align-items: center; justify-content: center; gap: .45rem;
}
.ann-side-all:hover { background: var(--a-soft); }

/* ---------- "View all" pop-up ---------- */
.ann-all { border: 0; border-radius: 20px; overflow: hidden; background: var(--a-card); }
.ann-all-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.4rem;
    background: radial-gradient(circle at 90% 0%, rgba(255,255,255,.2), transparent 45%), linear-gradient(135deg, #0a2d5c 0%, #1565c0 70%, #1e88e5 100%);
}
.ann-all-head .news-eyebrow, .ann-all-head .news-eyebrow .dot { color: rgba(255,255,255,.75) !important; }
.ann-all-item {
    position: relative; display: flex; gap: 1rem; padding: .9rem; border-radius: 16px; border: 1px solid var(--a-border);
    background: var(--a-card); transition: box-shadow .2s, transform .2s;
}
.ann-all-item + .ann-all-item { margin-top: .8rem; }
.ann-all-item:hover { box-shadow: var(--a-shadow); transform: translateY(-2px); }
.ann-all-item .ann-thumb { flex: 0 0 200px; width: 200px; border-radius: 12px; font-size: 2rem; }
.ann-all-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
@media (max-width: 575.98px) {
    .ann-all-item { flex-direction: column; }
    .ann-all-item .ann-thumb { width: 100%; flex-basis: auto; }
}
@media (prefers-reduced-motion: reduce) {
    .ann-side-title i, .ann-side-dot::after { animation: none; }
    .ann-side-item, .ann-all-item { transition: none; }
}