/* ---------------------------------
   FLOATING THEME TOGGLE
---------------------------------- */
.theme-toggle {
  position: fixed;
  right: 1.2rem;
  bottom: 1.6rem;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--color-bg-panel-soft);
  background: var(--color-bg-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  color: var(--color-accent);
  font-size: 1.2rem;
}

[data-theme="light"] .theme-toggle::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: #4b5563;
  transform: rotate(-45deg);
  pointer-events: none;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: var(--shadow-cyan-glow);
  border-radius: 50%;
}

/* ---------------------------------
   SOCIAL ICONS
---------------------------------- */
.social-icon {
  display: inline-block;
  flex-shrink: 0;
  background-image: url("../img/social-sprite.png");
  background-repeat: no-repeat;
  transform: translateY(1px);
}

.topbar .social-icon {
  width: 1.5em;
  height: 1.5em;
  background-size: auto 9em;
  background-position-y: -3em;
  transition: filter 0.18s ease;
}

.topbar-link:hover .social-icon,
.topbar-link:focus-visible .social-icon {
  background-position-y: -3em;
  filter: brightness(0) saturate(100%) invert(82%) sepia(31%) saturate(798%)
    hue-rotate(169deg) brightness(102%) contrast(101%);
}

.footer-social .social-icon {
  width: 2em;
  height: 2em;
  background-size: auto 12em;
  background-position-y: -2em;
}

.social-icon--fb {
  background-position-x: 0;
}

.social-icon--ig {
  background-position-x: 25%;
}

.social-icon--x {
  background-position-x: 50%;
}

.social-icon--yt {
  background-position-x: 75%;
}

.parent-search-summary {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 32px;
  gap: 12px;
}

.parent-search-summary[hidden] {
  display: none;
}

.parent-search-summary .portal-status {
  font-size: 0.875rem;
  text-align: center;
}

.parent-search-summary .portal-reset {
  margin: 0;
  font-size: 0.875rem;
}

/* Shared compact AI search: available alongside navigation on every page. */
.nav-assistant { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; margin-left: 12px; padding: 0; line-height: 1; color: var(--color-white); background: transparent; border: 0; border-radius: 10px; cursor: pointer; }
.nav-assistant svg { display: block; width: 28px; height: 28px; }
.nav-assistant:hover, .nav-assistant:active,
.nav-toggle[aria-expanded="true"], .nav-toggle:active { background: rgba(255,255,255,.12); }
/* Touch browsers can retain :hover after tapping; use menu state there. */
@media (hover: hover) and (pointer: fine) {
  .nav-toggle:hover { background: rgba(255,255,255,.12); }
}
.nav-assistant:focus-visible, .compact-assistant__close:focus-visible { outline: 3px solid var(--action-focus); outline-offset: 3px; }
.compact-assistant { box-sizing: border-box; position: fixed; inset: var(--assistant-top, 108px) 0 auto; width: min(1000px, calc(100% - 48px)); max-width: none; max-height: calc(100dvh - var(--assistant-top, 108px) - 16px); margin: 0 auto; padding: 0; overflow: auto; overscroll-behavior: contain; color: var(--color-text-main); background: var(--color-bg-panel); border: 1px solid color-mix(in srgb, var(--blue-300) 25%, transparent); border-radius: 20px; box-shadow: 0 24px 70px #07142640; }
.compact-assistant::backdrop { background: rgba(9,28,53,.46); backdrop-filter: blur(5px); }
.compact-assistant__content { position: relative; padding: 28px; background: radial-gradient(ellipse at top right, color-mix(in srgb, var(--blue-300) 12%, transparent), transparent 60%); }
.compact-assistant__close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--color-text-muted); line-height: 1; cursor: pointer; }
.compact-assistant__close svg { display: block; width: 28px; height: 28px; }
.compact-assistant__close:hover { background: var(--color-bg-panel-soft); }
.compact-assistant .assistant-intro { display: block; margin-bottom: 18px; }
.compact-assistant .assistant-mark { display: none; }
.compact-assistant .assistant-kicker { padding-right: 42px; margin-bottom: 10px; font-size: .85rem; letter-spacing: .02em; }
.compact-assistant .assistant-kicker { display: flex; align-items: center; gap: 10px; }
.compact-assistant__symbol { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; color: var(--blue-700); }
.compact-assistant__symbol svg { display: block; width: 28px; height: 28px; }
[data-theme="dark"] .compact-assistant__symbol { color: var(--blue-300); }
.compact-assistant .assistant-intro h2 { padding-right: 22px; font-size: clamp(1.5rem, 2.6vw, 2.15rem); line-height: 1.15; }
.compact-assistant .assistant-intro p { max-width: none; margin-top: 8px; line-height: 1.5; }
.compact-assistant .assistant-submit:disabled { opacity: .65; cursor: wait; }
.compact-assistant .assistant-notice { max-width: none; }
.compact-assistant .assistant-response { overflow-wrap: anywhere; }
.compact-assistant .assistant-response[hidden] { display: none; }
@media (max-width: 1100px) { .navbar-inner > .nav-toggle { margin-left: auto; } .navbar-inner { gap: 8px; } .nav-assistant { margin-left: 0; } }
@media (max-width: 600px) {
  .compact-assistant { width: calc(100% - 24px); border-radius: 18px; }
  .compact-assistant__content { padding: 20px 18px; }
  .compact-assistant__close { top: 8px; right: 8px; }
  .compact-assistant .assistant-response__links { flex-direction: column; gap: 16px; }
  .compact-assistant .assistant-notice { font-size: .8rem; }
  .navbar-logo { min-width: 0; }
  .navbar-logo img { max-width: 100%; height: auto; max-height: 48px; }
  .navbar-inner > .nav-toggle { flex-shrink: 0; }
}

/* The modal is outside main, so it needs the same surface-specific focus token. */
.compact-assistant { --action-focus: var(--blue-700); }
[data-theme="dark"] .compact-assistant { --action-focus: var(--blue-300); }
@media (max-width: 1100px) {
  .navbar-inner > .nav-assistant { order: 1; margin-left: auto; }
  .navbar-inner > .nav-toggle { order: 2; margin-left: 0; }
}

/* Homepage announcements share the portal content and the existing panel palette. */
.home-notices {
  font-size: .9rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink-900);
  box-shadow: 0 10px 26px rgba(7, 20, 38, 0.06);
}
.home-notices__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; }
.home-notices__header h3 { display: flex; align-items: center; gap: .65rem; margin: 0; font-size: 1rem; text-transform: uppercase; }
.home-notices__dot { width: .65rem; height: .65rem; flex-shrink: 0; border-radius: 50%; background: #ef476f; box-shadow: 0 0 0 4px rgba(239,71,111,.12); }
.home-notices a,
.home-notices .notice-card__links a { font-size: inherit; }
.home-notices .home-notices__header a {
  color: var(--action-outline-text);
  font-weight: 500;
  background-size: 0 1px;
}
.home-notices .home-notices__header a:hover {
  color: var(--action-outline-text);
  background-size: 100% 1px;
}
.home-notices .notice-card__links a:hover .notice-card__link-label,
.home-notices .notice-card__links a:focus-visible .notice-card__link-label { text-decoration: none; }
.home-notice { border-top: 1px solid var(--line-strong); }
.home-notice summary { display: flex; align-items: center; gap: .8rem; padding: 1rem 0; cursor: pointer; list-style: none; }
.home-notice summary::-webkit-details-marker { display: none; }
.home-notice__label { flex-shrink: 0; padding: .2rem .5rem; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface-blue); color: var(--action-outline-text); font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.home-notice__title { flex: 1; font-size: .9rem; font-weight: 600; }
.home-notice__arrow { width: 20px; height: 20px; flex-shrink: 0; color: var(--action-outline-text); transition: transform 180ms ease; }
.home-notice[open] .home-notice__arrow { transform: rotate(180deg); }
.home-notice__content { padding: 0 0 1rem; font-size: .9rem; color: var(--ink-700); }
.home-notice__content p { margin: 0 0 1rem; }
.home-notice summary:hover .home-notice__title { color: var(--action-outline-text); }
.calendar-event-body { min-width: 0; border-left: 1px solid var(--line-strong); padding-left: .9rem; display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 600px) {
  .home-notices { padding: 1rem; }
  .home-notices__header { flex-wrap: wrap; gap: .75rem; }
  .home-notice summary { display: grid; grid-template-columns: minmax(0, 1fr) 20px; gap: .6rem; }
  .home-notice__label { justify-self: start; }
  .home-notice__title { grid-column: 1; }
  .home-notice__arrow { grid-column: 2; grid-row: 1 / 3; }
}
@media (prefers-reduced-motion: reduce) { .home-notice__arrow { transition: none; } }

/* Shared article and event loading, visible before client JavaScript starts. */
.news-status.calendar-loader {
  padding: 0;
  border: 0;
  border-radius: 0;
}
.calendar-loader {
  min-height: 20rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  color: var(--ink-600, #52637c);
}
.calendar-loader__spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid var(--line, #dce2ea);
  border-top-color: var(--blue-700, #0d5fba);
  border-radius: 50%;
  animation: home-calendar-spin 0.8s linear infinite;
}
[data-theme="dark"] .calendar-loader { color: #a3b8cf; }
[data-theme="dark"] .calendar-loader__spinner { border-top-color: var(--blue-300, #85d4ff); }
@keyframes home-calendar-spin { to { transform: rotate(360deg); } }
