﻿:root {
  --brand: #0077ff;
  --brand-2: #0055aa;
  --surface: #f9f9f9;
  --text: #222;
  --muted: #666;
  --space: 1rem;
  --space-lg: 2rem;
  --max: 1200px;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: system-ui, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
  transition: background 0.4s ease, color 0.4s ease;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid #ddd;
  transition: background 0.4s ease, border 0.4s ease;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar {
  width: 100%;
  padding: 0.625rem var(--space);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Hamburger toggle — leftmost */
.nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 36px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 4px;
  transition: background 0.2s ease;
}
.nav-toggle:hover,
.nav-toggle:focus {
  background: rgba(0, 119, 255, 0.1);
  outline: none;
}
.nav-toggle__bar {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle.is-active .nav-toggle__bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.nav-toggle.is-active .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-active .nav-toggle__bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Logos — grouped together, left of centre */
.navbar__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.navbar .brand img {
  height: 40px;
  display: block;
  transition: transform 0.3s ease;
}
.navbar .brand img:hover {
  transform: scale(1.05);
}

/* Desktop nav links */
.nav-links {
  display: flex;
  gap: 2rem;
  flex: 1;
  justify-content: center;
}
.nav-link {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: color 0.3s ease, transform 0.2s ease;
}
.nav-link:hover,
.nav-link:focus {
  color: var(--brand);
  transform: translateY(-2px);
  outline: none;
}

.actions {
  display: flex;
  align-items: center;
  gap: var(--space);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .actions {
    margin-left: auto;
  }
}

/* Overlay backdrop */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.nav-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Left-side drawer */
.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 280px;
  max-width: 85vw;
  background: var(--surface);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 300;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.nav-drawer.is-open {
  transform: translateX(0);
}
.nav-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
}
.nav-drawer__logos {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-drawer__logo {
  height: 32px;
  display: block;
}
.nav-drawer__close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease;
  line-height: 1;
}
.nav-drawer__close:hover,
.nav-drawer__close:focus {
  background: rgba(0, 119, 255, 0.1);
  color: var(--brand);
  outline: none;
}
.nav-drawer__nav {
  padding: 0.75rem 0;
  flex: 1;
}
.nav-drawer__link {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.5rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  border-left: 3px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease, border-color 0.2s ease;
}
.nav-drawer__link:hover,
.nav-drawer__link:focus {
  background: rgba(0, 119, 255, 0.07);
  color: var(--brand);
  padding-left: 1.875rem;
  border-left-color: var(--brand);
  outline: none;
}
.nav-drawer__link.active {
  color: var(--brand);
  border-left-color: var(--brand);
  background: rgba(0, 119, 255, 0.05);
}

/* Buttons */
button,
.btn,
.theme-toggle,
.nav-toggle,
.search-btn {
  font-family: inherit;
  font-weight: 600;
  border-radius: 6px;
  padding: 8px 14px;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

/* CTA buttons */
.btn {
  display: inline-block;
  text-decoration: none;
}
.btn.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.btn.primary:hover,
.btn.primary:focus {
  background: var(--brand-2);
  transform: translateY(-2px);
  outline: none;
}
.btn.ghost {
  border: 1px solid var(--brand);
  color: var(--brand);
  background: transparent;
}
.btn.ghost:hover,
.btn.ghost:focus {
  background: var(--brand);
  color: #fff;
  transform: translateY(-2px);
  outline: none;
}

/* Toggle buttons */
.theme-toggle,
.nav-toggle {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.theme-toggle:hover,
.theme-toggle:focus,
.nav-toggle:hover,
.nav-toggle:focus {
  background: var(--brand-2);
  transform: translateY(-2px);
  outline: none;
}

/* Search */
.search-input {
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: border 0.3s ease, box-shadow 0.3s ease;
}
.search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0,119,255,0.2);
  outline: none;
}
.search-btn {
  background: var(--brand);
  color: #fff;
}
.search-btn:hover,
.search-btn:focus {
  background: var(--brand-2);
  transform: translateY(-2px);
  outline: none;
}

/* Hero */
.hero {
  text-align: center;
  padding: var(--space-lg);
  background: #eef6ff;
  transition: background 0.4s ease;
  animation: fadeInUp 0.6s ease;
}
.hero h1 {
  font-size: 2rem;
  margin-bottom: var(--space);
}
.hero p {
  max-width: 600px;
  margin: 0 auto var(--space);
  color: var(--muted);
}
.hero-cta {
  display: flex;
  justify-content: center;
  gap: var(--space);
}

/* Cards & Grid */
.grid {
  max-width: var(--max);
  margin: var(--space-lg) auto;
  padding: 0 var(--space);
  display: grid;
  gap: var(--space);
}
.cards {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: var(--space);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeInUp 0.5s ease;
}
.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Page headers */
.page-header {
  max-width: var(--max);
  margin: var(--space-lg) auto;
  padding: 0 var(--space);
  animation: fadeIn 0.6s ease;
}
.page-header h1 {
  margin-bottom: var(--space);
}
.page-header p {
  color: var(--muted);
}

/* Feature list */
.feature-list {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: var(--space);
}
.feature-list li {
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}
.feature-list li:hover {
  color: var(--brand);
}

/* Footer */
.site-footer {
  margin-top: var(--space-lg);
  padding: var(--space-lg) var(--space);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  transition: background 0.4s ease, color 0.4s ease;
}
.footer-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space);
  margin-bottom: var(--space);
}
.footer-grid h3 {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text);
}
.footer-links {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 6px;
}
.footer-links a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.3s ease;
}
.footer-links a:hover,
.footer-links a:focus {
  color: var(--brand);
  outline: none;
}
.footer-bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--space);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(0,0,0,0.1);
  padding-top: var(--space);
}
.footer-bottom p {
  margin: 0;
  font-size: 13px;
}
.footer-bottom .link {
  font-size: 13px;
  color: var(--brand);
  text-decoration: none;
  transition: color 0.3s ease;
}
.footer-bottom .link:hover,
.footer-bottom .link:focus {
  color: var(--brand-2);
  outline: none;
}

/* Dark theme */
body.dark-theme {
  background: #121212;
  color: #eee;
}
body.dark-theme .site-header {
  background: #1e1e1e;
  border-bottom: 1px solid #333;
}
body.dark-theme .nav-link {
  color: #eee;
}
body.dark-theme .nav-link:hover {
  color: var(--brand);
}
body.dark-theme .search-input {
  background: #222;
  border: 1px solid #444;
  color: #eee;
}
body.dark-theme .search-btn {
  background: var(--brand-2);
}
body.dark-theme .search-btn:hover {
  background: var(--brand);
}
body.dark-theme .hero {
  background: #1a1a1a;
}
body.dark-theme .hero p {
  color: #bbb;
}
body.dark-theme .card {
  background: #1e1e1e;
  border: 1px solid #333;
}
body.dark-theme .card p {
  color: #bbb;
}
body.dark-theme .card a {
  color: inherit;
}
body.dark-theme .nav-drawer {
  background: #1e1e1e;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}
body.dark-theme .nav-drawer__header {
  border-bottom: 1px solid #333;
}
body.dark-theme .nav-drawer__close {
  color: #aaa;
}
body.dark-theme .nav-drawer__link {
  color: #eee;
}
body.dark-theme .nav-drawer__link:hover,
body.dark-theme .nav-drawer__link:focus {
  background: rgba(0, 119, 255, 0.12);
}
body.dark-theme .nav-toggle__bar {
  background: #eee;
}
body.dark-theme .site-footer {
  background: #1e1e1e;
  color: #aaa;
}
body.dark-theme .footer-grid h3 {
  color: #eee;
}
body.dark-theme .footer-links a {
  color: #aaa;
}
body.dark-theme .footer-links a:hover,
body.dark-theme .footer-links a:focus {
  color: var(--brand);
}
body.dark-theme .footer-bottom {
  border-top: 1px solid #333;
  color: #aaa;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Clickable card links */
.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.card-link:hover {
  text-decoration: none;
}
.card-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* ── Carousel ────────────────────────────────────── */
.events-controls {
  max-width: var(--max);
  margin: 0 auto var(--space);
  padding: 0 var(--space);
  display: flex;
  align-items: center;
  gap: var(--space);
  flex-wrap: wrap;
}
.events-controls label {
  font-weight: 600;
  color: var(--text);
}
.date-picker {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border 0.3s ease, box-shadow 0.3s ease;
}
.date-picker:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0,119,255,0.2);
  outline: none;
}
.carousel-section {
  max-width: var(--max);
  margin: 0 auto var(--space-lg);
  padding: 0 var(--space);
  display: flex;
  align-items: center;
  gap: 12px;
}
.carousel-track-wrap {
  flex: 1;
  overflow: hidden;
}
.carousel-track {
  display: flex;
  gap: 24px;
  transition: transform 0.4s ease;
}
.carousel-card {
  flex: 0 0 280px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeInUp 0.4s ease;
}
.carousel-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.carousel-card h2 {
  margin: 0.5rem 0 0.4rem;
  font-size: 1.1rem;
}
.carousel-card p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}
.event-tag {
  display: inline-block;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
  margin-bottom: 6px;
}
.event-date {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.carousel-btn {
  flex-shrink: 0;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.2s ease;
}
.carousel-btn:hover:not(:disabled) {
  background: var(--brand-2);
  transform: scale(1.1);
}
.carousel-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.carousel-empty {
  text-align: center;
  color: var(--muted);
  padding: var(--space-lg);
}
body.dark-theme .date-picker {
  background: #222;
  border: 1px solid #444;
  color: #eee;
}
body.dark-theme .carousel-card {
  background: #1e1e1e;
  border: 1px solid #333;
}
body.dark-theme .carousel-card p {
  color: #bbb;
}
/* ── Event status colours ──────────────────────────── */
.carousel-card.past-event,
.card.past-event {
  background: #d4edda;
  border-color: #5cb85c;
  border-left: 5px solid #28a745;
}
.carousel-card.upcoming-event,
.card.upcoming-event {
  background: #cce5ff;
  border-color: #4dabf7;
  border-left: 5px solid #0077ff;
}
.carousel-card.cancelled-event,
.card.cancelled-event {
  background: #fff3cd;
  border-color: #ffc107;
  border-left: 5px solid #fd7e14;
  opacity: 0.85;
}
.carousel-card.cancelled-event h2,
.card.cancelled-event .event-grid-title {
  text-decoration: line-through;
  text-decoration-color: #fd7e14;
}
/* ── Today marker (carousel) ─────────────────────── */
.today-marker {
  background: #fff;
  border: 2px solid #f39c12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}
.today-marker__icon {
  font-size: 2rem;
  line-height: 1;
}
.today-marker__label {
  font-size: 1rem;
  font-weight: 800;
  color: #e67e22;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.today-marker__date {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}
/* ── Today divider (grid) ────────────────────────── */
.today-divider {
  grid-column: 1 / -1;
  background: #fff;
  border: 2px solid #f39c12;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}
.today-divider__line {
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, transparent, #f39c12);
  border-radius: 1px;
}
.today-divider__line:last-child {
  background: linear-gradient(to left, transparent, #f39c12);
}
.today-divider__label {
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #e67e22;
  white-space: nowrap;
}
/* ── Dark theme: status colours ──────────────────── */
body.dark-theme .carousel-card.past-event,
body.dark-theme .card.past-event {
  background: #1a3326;
  border-color: #28a745;
  border-left-color: #48c774;
}
body.dark-theme .carousel-card.upcoming-event,
body.dark-theme .card.upcoming-event {
  background: #1a2840;
  border-color: #4dabf7;
  border-left-color: #74c0fc;
}
body.dark-theme .carousel-card.cancelled-event,
body.dark-theme .card.cancelled-event {
  background: #2d2510;
  border-color: #ffc107;
  border-left-color: #fd7e14;
}
body.dark-theme .carousel-card.cancelled-event h2,
body.dark-theme .card.cancelled-event .event-grid-title {
  text-decoration-color: #fd7e14;
}
body.dark-theme .today-marker {
  background: #1e1e1e;
  border-color: #f39c12;
}
body.dark-theme .today-divider {
  background: #1e1e1e;
  border-color: #f39c12;
}
body.dark-theme .today-divider__label {
  color: #f39c12;
}

/* ── Org-chart tree ──────────────────────────────── */
.org-tree-section {
  max-width: var(--max);
  margin: 0 auto var(--space-lg);
  padding: 0 var(--space);
  overflow-x: auto;
}
.org-tree {
  display: inline-block;
  min-width: 100%;
}
.org-tree ul {
  display: flex;
  flex-direction: column;
  align-items: center;
  list-style: none;
  padding: 0;
  position: relative;
}
.org-tree > ul > li > ul {
  flex-direction: row;
  align-items: flex-start;
  gap: 48px;
  padding-top: 96px;
  position: relative;
}
.org-tree > ul > li > ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 48px;
  background: #ccc;
}
.org-tree ul li {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.org-tree > ul > li > ul > li::before {
  content: '';
  position: absolute;
  top: -48px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 48px;
  background: #ccc;
}
.org-node {
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.org-node:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
.org-node.root {
  background: var(--brand-2);
  font-size: 1.1rem;
  padding: 12px 32px;
}
.org-node.branch {
  font-size: 1.1rem;
  padding: 14px 36px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
body.dark-theme .org-node.branch {
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}
.org-tree > ul > li > ul > li::after {
  content: '';
  position: absolute;
  top: -48px;
  height: 2px;
  background: #ccc;
}
.org-tree > ul > li > ul > li:first-child::after {
  left: 50%;
  right: -24px;
}
.org-tree > ul > li > ul > li:last-child::after {
  right: 50%;
  left: -24px;
}
.org-tree > ul > li > ul > li:not(:first-child):not(:last-child)::after {
  left: -24px;
  right: -24px;
}
.org-tree > ul > li > ul > li:only-child::after {
  display: none;
}
.org-tree > ul > li > ul > li > ul > li:only-child::after {
  display: none;
}
body.dark-theme .org-tree > ul > li > ul > li::before,
body.dark-theme .org-tree > ul > li > ul > li::after,
body.dark-theme .org-tree > ul > li > ul::before {
  background: #444;
}
/* Level 3 (children of a level-2 node, e.g. Design/Research/Code under Management) */
.org-tree > ul > li > ul > li > ul {
  flex-direction: row;
  align-items: flex-start;
  gap: 80px;
  padding-top: 96px;
  position: relative;
}
.org-tree > ul > li > ul > li > ul > li {
  min-width: 200px;
}
.org-tree > ul > li > ul > li > ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 48px;
  background: #ccc;
}
.org-tree > ul > li > ul > li > ul > li::before {
  content: '';
  position: absolute;
  top: -48px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 48px;
  background: #ccc;
}
.org-tree > ul > li > ul > li > ul > li::after {
  content: '';
  position: absolute;
  top: -48px;
  height: 2px;
  background: #ccc;
}
.org-tree > ul > li > ul > li > ul > li:first-child::after {
  left: 50%;
  right: -40px;
}
.org-tree > ul > li > ul > li > ul > li:last-child::after {
  right: 50%;
  left: -40px;
}
.org-tree > ul > li > ul > li > ul > li:not(:first-child):not(:last-child)::after {
  left: -40px;
  right: -40px;
}
body.dark-theme .org-tree > ul > li > ul > li > ul > li::before,
body.dark-theme .org-tree > ul > li > ul > li > ul > li::after,
body.dark-theme .org-tree > ul > li > ul > li > ul::before {
  background: #444;
}

/* ── Social links (Contact page) ─────────────────── */
.social-links {
  display: flex;
  gap: var(--space);
  margin-top: var(--space);
  flex-wrap: wrap;
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 16px;
  transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.social-link:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,119,255,0.25);
}
.social-icon {
  width: 28px;
  height: 28px;
  fill: #E1306C;
  flex-shrink: 0;
  transition: fill 0.25s ease;
}
.social-link:hover .social-icon {
  fill: #fff;
}
body.dark-theme .social-link {
  background: #1e1e1e;
  border-color: #333;
  color: #eee;
}
body.dark-theme .social-link:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ── Org-node link wrapper ───────────────────────── */
.org-node-link {
  text-decoration: none;
}

/* ── Back button ─────────────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: var(--space);
  font-size: 0.9rem;
}
.view-toggle {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.view-btn {
  background: transparent;
  border: 1px solid #ccc;
  color: var(--text);
  font-size: 0.85rem;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.view-btn.active,
.view-btn:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
body.dark-theme .view-btn {
  border-color: #444;
  color: #eee;
}
body.dark-theme .view-btn.active,
body.dark-theme .view-btn:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.events-grid-section {
  max-width: var(--max);
  margin: 0 auto var(--space-lg);
  padding: 0 var(--space);
}
.grid-controls {
  display: flex;
  align-items: center;
  gap: var(--space);
  flex-wrap: wrap;
  flex: 1;
}
.category-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-btn {
  background: transparent;
  border: 1px solid #ccc;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.filter-btn:hover {
  background: var(--filter-colour, var(--brand));
  color: #fff;
  border-color: var(--filter-colour, var(--brand));
}
.filter-btn.active {
  background: var(--filter-colour, var(--brand));
  color: #fff;
  border-color: var(--filter-colour, var(--brand));
}
.sort-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
}
.sort-select {
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  transition: border 0.2s ease;
}
.sort-select:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,119,255,0.2);
}
.event-count {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
body.dark-theme .filter-btn {
  border-color: #444;
  color: #eee;
}
body.dark-theme .sort-select {
  background: #222;
  border-color: #444;
  color: #eee;
}
.event-grid-title {
  margin: 0.5rem 0 0.4rem;
  font-size: 1.1rem;
}
.event-grid-description {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ── Events key/legend ───────────────────────────── */
.events-key {
  max-width: var(--max);
  margin: 0 auto 1rem;
  padding: 0 var(--space);
}
.events-key__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
}
.events-key__label {
  font-weight: 700;
  color: var(--text);
  margin-right: 0.25rem;
}
.events-key__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 3px 12px 3px 9px;
  border-radius: 6px;
  font-weight: 600;
  border-left: 4px solid transparent;
}
.events-key__item.past {
  background: #d4edda;
  border-left-color: #28a745;
  color: #155724;
}
.events-key__item.upcoming {
  background: #cce5ff;
  border-left-color: #0077ff;
  color: #004085;
}
.events-key__item.cancelled {
  background: #fff3cd;
  border-left-color: #fd7e14;
  color: #7d4e00;
}
body.dark-theme .events-key__inner {
  background: #1e1e1e;
  border-color: #333;
}
body.dark-theme .events-key__item.past {
  background: #1a3326;
  color: #8fcf9f;
}
body.dark-theme .events-key__item.upcoming {
  background: #1a2840;
  color: #74c0fc;
}
body.dark-theme .events-key__item.cancelled {
  background: #2d2510;
  color: #ffc107;
}

/* ── Grid pagination ─────────────────────────────── */
.grid-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem var(--space) 2rem;
  max-width: var(--max);
  margin: 0 auto;
}
.pagination-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.pagination-btn:hover:not(:disabled) {
  background: var(--brand-2);
  transform: translateY(-1px);
}
.pagination-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.pagination-info {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  min-width: 140px;
  text-align: center;
}

/* ── Recruitment page ────────────────────────────── */
.recruit-hero {
  background: linear-gradient(135deg, #0055aa 0%, #0077ff 100%);
  color: #fff;
  text-align: center;
  padding: 4rem var(--space) 3rem;
  animation: fadeIn 0.6s ease;
}
.recruit-hero__inner {
  max-width: 680px;
  margin: 0 auto;
}
.recruit-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 1rem;
  border: 1px solid rgba(255,255,255,0.35);
}
.recruit-hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}
.recruit-hero p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 520px;
  margin: 0 auto;
}

.recruit-highlights {
  max-width: var(--max);
  margin: 2.5rem auto 0;
  padding: 0 var(--space);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.recruit-highlight {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: #fff;
  border: 1px solid #e0e8f5;
  border-radius: 10px;
  padding: 1.25rem 1.25rem;
  box-shadow: 0 2px 8px rgba(0,119,255,0.07);
  animation: fadeInUp 0.5s ease;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.recruit-highlight:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,119,255,0.13);
}
.recruit-highlight__icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}
.recruit-highlight h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--text);
}
.recruit-highlight p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.recruit-form-section {
  max-width: 900px;
  margin: 2.5rem auto 3rem;
  padding: 0 var(--space);
  animation: fadeInUp 0.6s ease;
}
.recruit-form-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.recruit-form-intro {
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}
.recruit-form-wrapper {
  border: 1px solid #dde5f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,119,255,0.08);
  background: #fff;
}
.recruit-form-iframe {
  display: block;
  width: 100%;
  min-height: 800px;
  border: none;
}
.recruit-form-fallback {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.recruit-form-fallback a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.recruit-form-fallback a:hover {
  text-decoration: underline;
}

/* Dark theme — recruitment */
body.dark-theme .recruit-highlight {
  background: #1e1e1e;
  border-color: #2a2a2a;
}
body.dark-theme .recruit-highlight h3 {
  color: #eee;
}
body.dark-theme .recruit-highlight p {
  color: #bbb;
}
body.dark-theme .recruit-form-wrapper {
  background: #1e1e1e;
  border-color: #2a2a2a;
}
body.dark-theme .recruit-form-section h2 {
  color: #eee;
}

/* ── FAQ ─────────────────────────────────────────── */
.faq-section {
  max-width: 800px;
  margin: 0 auto var(--space-lg);
  padding: 0 var(--space);
}
.faq-list {
  display: grid;
  gap: var(--space);
}
.faq-item {
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, background 0.4s ease, border-color 0.4s ease;
}
.faq-item:hover {
  box-shadow: 0 4px 16px rgba(0, 119, 255, 0.1);
}
.faq-item details {
  padding: 0;
}
.faq-item details summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}
.faq-item details summary::-webkit-details-marker {
  display: none;
}
.faq-item details summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1;
  color: var(--brand);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}
.faq-item details[open] summary::after {
  transform: rotate(45deg);
}
.faq-item details[open] summary {
  color: var(--brand);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.faq-item details p {
  padding: 1rem 1.25rem;
  color: var(--muted);
  animation: fadeInUp 0.2s ease;
}
.faq-item details p .link {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s ease;
}
.faq-item details p .link:hover {
  color: var(--brand-2);
}

/* Dark theme — FAQ */
body.dark-theme .faq-item {
  background: #1e1e1e;
  border-color: #2a2a2a;
}
body.dark-theme .faq-item details[open] summary {
  border-bottom-color: #2a2a2a;
}
body.dark-theme .faq-item details p {
  color: #bbb;
}

/* ── Search dropdown ─────────────────────────────── */
.search-dropdown {
  position: fixed;
  width: 400px;
  max-width: calc(100vw - 1rem);
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  z-index: 500;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, visibility 0.18s, transform 0.18s ease;
  pointer-events: none;
  max-height: 500px;
  overflow-y: auto;
}
.search-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.search-dropdown__header {
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
}
.search-dropdown__count {
  font-weight: 700;
  color: var(--brand);
}
.search-result-card {
  display: block;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #f5f5f5;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}
.search-result-card:last-child {
  border-bottom: none;
}
.search-result-card:hover,
.search-result-card:focus {
  background: #f0f6ff;
  outline: none;
}
.search-result-card__meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.2rem;
  flex-wrap: wrap;
}
.search-result-card__icon {
  font-size: 1rem;
  flex-shrink: 0;
  line-height: 1;
}
.search-result-card__badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 20px;
  color: #fff;
  flex-shrink: 0;
}
.search-result-card__title {
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--brand);
}
.search-result-card__desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-no-results {
  padding: 1.75rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.search-no-results__icon {
  display: block;
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

/* Dark mode — search dropdown */
body.dark-theme .search-dropdown {
  background: #1e1e1e;
  border-color: #333;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
body.dark-theme .search-dropdown__header {
  background: #252525;
  border-bottom-color: #333;
  color: #aaa;
}
body.dark-theme .search-result-card {
  border-bottom-color: #2a2a2a;
}
body.dark-theme .search-result-card:hover,
body.dark-theme .search-result-card:focus {
  background: #252a38;
}
body.dark-theme .search-result-card__title {
  color: #7ab4ff;
}
body.dark-theme .search-result-card__desc {
  color: #aaa;
}
body.dark-theme .search-no-results {
  color: #aaa;
}

/* ── Mobile responsive improvements ────────────────────
   Tablets and smaller (≤768 px)
   ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Slightly smaller logos so the navbar stays compact */
  .navbar .brand img {
    height: 32px;
  }

  /* Constrain the search input so it never overflows */
  .search-input {
    width: 90px;
  }

  /* Footer columns → single column */
  .footer-grid {
    grid-template-columns: 1fr;
  }

  /* Recruitment highlights → single column */
  .recruit-highlights {
    grid-template-columns: 1fr;
  }
}

/* ── Small phones (≤480 px)
   ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* Navbar: tighten up spacing between action items */
  .actions {
    gap: 0.5rem;
  }

  /* Even smaller logos to give search room */
  .navbar .brand img {
    height: 28px;
  }

  /* Compact search input on very small screens */
  .search-input {
    width: 70px;
    font-size: 0.85rem;
    padding: 6px 4px;
  }

  /* Hero: smaller heading */
  .hero h1 {
    font-size: 1.5rem;
  }

  /* Hero CTA buttons: stack vertically and fill available width */
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
  .hero-cta .btn {
    width: 100%;
    max-width: 260px;
    text-align: center;
  }

  /* Carousel: near-full-width cards on small phones */
  .carousel-card {
    flex: 0 0 calc(100vw - 6rem);
  }

  /* Recruitment hero: smaller heading */
  .recruit-hero h1 {
    font-size: 1.75rem;
  }

  /* Events controls: stack vertically */
  .events-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Events grid controls row: stack vertically */
  .grid-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Footer bottom: stack copyright and back-to-top */
  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  /* Org-tree section: hint that the chart scrolls sideways */
  .org-tree-section::before {
    content: "← Swipe to explore →";
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
    margin-bottom: 0.5rem;
  }
}

/* ── Nav drawer search ───────────────────────────────── */
.nav-drawer__search {
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid #ddd;
}
.drawer-search-form {
  display: flex;
  align-items: center;
  border: 1.5px solid #ccc;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.drawer-search-form:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 119, 255, 0.15);
}
.drawer-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.95rem;
  background: transparent;
  color: var(--text);
  min-width: 0;
}
.drawer-search-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  transition: background 0.2s ease;
  border-radius: 0;
}
.drawer-search-btn:hover,
.drawer-search-btn:focus {
  background: var(--brand-2);
  outline: none;
}

/* Dark theme — drawer search */
body.dark-theme .nav-drawer__search {
  border-top-color: #333;
}
body.dark-theme .drawer-search-form {
  border-color: #444;
}
body.dark-theme .drawer-search-input {
  color: #eee;
  background: transparent;
}
