/* Department cards and their pop-ups (lib/depts.php, depts.js). The pop-up springs in once when it opens;
   nothing moves with the scroll. With "reduce motion" it simply appears. */
.dept-card.has-popup { cursor: pointer; }
.dept-card.has-popup[style*="--dc"] .dept-ico { background: var(--dc); color: #fff; }
.dept-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--accent); text-decoration: none; }
.dept-more span { display: inline-block; transition: transform .3s var(--soft); }
.dept-card:hover .dept-more span { transform: translateX(3px); }

.dept-modal { --dc: var(--accent); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 22px; background: var(--paper); color: var(--ink); box-shadow: 0 40px 90px rgba(12, 8, 40, .35); overflow: auto; cursor: auto; text-align: left; }
.dept-modal[open] { animation: dm-pop .42s cubic-bezier(.2, .9, .25, 1.15) both; }
.dept-modal::backdrop { background: rgba(14, 10, 40, .55); animation: dm-fade .3s ease both; }
@keyframes dm-pop { from { opacity: 0; transform: translateY(18px) scale(.94); } }
@keyframes dm-fade { from { opacity: 0; } }
.dm-panel { position: relative; }
.dm-close { position: absolute; right: 14px; top: 14px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .22); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.dm-close:hover { background: rgba(255, 255, 255, .34); }
.dm-close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.dm-head { display: flex; align-items: center; gap: 16px; padding: 28px 60px 24px 28px; color: #fff; background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--dc) 70%, #fff), var(--dc) 55%, color-mix(in srgb, var(--dc) 70%, #000)); }
.dm-ico { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: rgba(255, 255, 255, .2); font-weight: 800; font-size: 1.1rem; letter-spacing: .02em; animation: dm-ico .6s .15s cubic-bezier(.2, .9, .25, 1.3) both; }
@keyframes dm-ico { from { transform: scale(.6) rotate(-12deg); opacity: 0; } }
.dm-head h2 { font-size: 1.45rem; line-height: 1.2; color: #fff; overflow-wrap: anywhere; }
.dm-counts { margin: 4px 0 0; color: rgba(255, 255, 255, .88); font-size: 14px; font-weight: 600; }
.dm-body { padding: 22px 28px 6px; display: grid; gap: 10px; }
.dm-desc { margin: 0; font-size: 15.5px; color: var(--ink); }
.dm-body h3 { margin: 8px 0 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink2); }
.dm-hl { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dm-hl li { position: relative; padding-left: 30px; font-size: 14.5px; animation: dm-in .45s cubic-bezier(.2, .8, .2, 1) both; }
.dm-hl li:nth-child(1) { animation-delay: .18s; } .dm-hl li:nth-child(2) { animation-delay: .24s; } .dm-hl li:nth-child(3) { animation-delay: .3s; }
.dm-hl li:nth-child(4) { animation-delay: .36s; } .dm-hl li:nth-child(5) { animation-delay: .42s; } .dm-hl li:nth-child(6) { animation-delay: .48s; }
@keyframes dm-in { from { opacity: 0; transform: translateY(8px); } }
.dm-hl li::before { content: ""; position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: color-mix(in srgb, var(--dc) 16%, transparent); }
.dm-hl li::after { content: ""; position: absolute; left: 7px; top: 6px; width: 5px; height: 9px; border: solid var(--dc); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.dm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.dm-chips span { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.dm-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 18px 28px 26px; }
.dm-btn { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.dm-apply { margin-left: auto; font-weight: 700; font-size: 14px; color: var(--accent); text-decoration: none; }
@media (max-width: 600px) { .dm-foot .btn { flex: 1 1 100%; justify-content: center; } .dm-apply { margin: 4px auto 0; } }
@media (prefers-reduced-motion: reduce) { .dept-modal[open], .dept-modal::backdrop, .dm-ico, .dm-hl li { animation: none; } }
