/* ============================================
   Phi Kappa Mu Roster — Styles
   ============================================ */

:root {
  --color-primary: #1e3a5f;
  --color-primary-dark: #142943;
  --color-accent: #b8860b;
  --color-accent-light: #d4a017;
  --color-bg: #f4f6f9;
  --color-card-bg: #ffffff;
  --color-row-even: #ffffff;
  --color-row-odd: #f0f3f7;
  --color-row-hover: #eaf0f8;
  --color-text: #1f2733;
  --color-text-muted: #5b6675;
  --color-border: #e1e6ec;
  --shadow-sm: 0 1px 3px rgba(20, 41, 67, 0.08);
  --shadow-md: 0 4px 14px rgba(20, 41, 67, 0.12);
  --header-height: 132px;
  --font-sans: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  scroll-behavior: smooth;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 10px 16px;
  z-index: 200;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-seal {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-text p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: #c8d2e0;
}

.menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
}

.search-bar-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 14px;
}

.search-bar {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.search-icon {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

#search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text);
  background: transparent;
}
#search-input::placeholder {
  color: #97a1b0;
}

.clear-search {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 4px 6px;
  border-radius: 6px;
}
.clear-search:hover {
  background: var(--color-row-odd);
  color: var(--color-text);
}

.search-status {
  font-size: 0.78rem;
  color: #c8d2e0;
  margin-top: 6px;
  min-height: 1em;
  padding-left: 4px;
}

/* ---------- Layout ---------- */
.layout {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
  padding: 20px;
}

/* ---------- Decade nav ---------- */
.decade-nav {
  position: sticky;
  top: calc(var(--header-height) + 20px);
  align-self: start;
  max-height: calc(100vh - var(--header-height) - 40px);
  overflow-y: auto;
}

.decade-nav-inner {
  background: var(--color-card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 14px;
}

.decade-nav-title {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-text-muted);
  margin-bottom: 10px;
  padding-left: 4px;
}

.decade-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.decade-list a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.decade-list a:hover {
  background: var(--color-row-odd);
}

.decade-list a.active {
  background: var(--color-primary);
  color: #fff;
}

/* ---------- Main content ---------- */
.main-content {
  min-width: 0;
}

.roster-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- Batch card ---------- */
.batch-card {
  background: var(--color-card-bg);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  scroll-margin-top: calc(var(--header-height) + 12px);
}

.batch-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, #274d78 100%);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.batch-header:hover,
.batch-header:focus-visible {
  background: linear-gradient(135deg, #234a73 0%, #2d5786 100%);
}

.batch-header:focus-visible {
  outline: 2px solid var(--color-accent-light);
  outline-offset: -2px;
}

.batch-year {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.batch-alias {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-accent-light);
  background: rgba(0,0,0,0.18);
  padding: 3px 10px;
  border-radius: 20px;
}

.batch-count {
  margin-left: auto;
  font-size: 0.78rem;
  color: #c8d2e0;
  font-weight: 500;
}

.batch-expand-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-accent-light);
  white-space: nowrap;
}

.expand-chevron {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.expand-label-active {
  display: none;
}

.batch-card.expanded-batch .expand-chevron {
  transform: rotate(180deg);
}

.batch-card.expanded-batch .expand-label-default {
  display: none;
}

.batch-card.expanded-batch .expand-label-active {
  display: inline;
}

.batch-card.expanded-batch .batch-header {
  background: linear-gradient(135deg, #2a5586 0%, #35618f 100%);
}

.member-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.member-item {
  padding: 10px 20px;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.12s;
}

.member-item:last-child {
  border-bottom: none;
}

.member-item:nth-child(odd) {
  background: var(--color-row-odd);
}

.member-item:nth-child(even) {
  background: var(--color-row-even);
}

.member-item:hover {
  background: var(--color-row-hover);
}

.member-item.hidden-item {
  display: none;
}

.member-item mark {
  background: var(--color-accent-light);
  color: #1f2733;
  padding: 0 2px;
  border-radius: 3px;
}

.batch-card.hidden-batch {
  display: none;
}

.no-results {
  text-align: center;
  color: var(--color-text-muted);
  padding: 60px 20px;
  font-size: 1.05rem;
}
.no-results i {
  font-size: 2rem;
  display: block;
  margin-bottom: 12px;
  color: #c3cbd6;
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-md);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 90;
  transition: transform 0.15s, background 0.15s;
}
.back-to-top:hover {
  background: var(--color-primary-dark);
  transform: translateY(-3px);
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 30px 20px 50px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}
.site-footer p {
  margin: 4px 0;
}
.legend span {
  font-weight: 700;
  color: var(--color-text);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  :root {
    --header-height: 118px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 14px;
  }

  .decade-nav {
    position: static;
    max-height: none;
    display: none;
  }

  .decade-nav.open {
    display: block;
  }

  .decade-list {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .decade-list a {
    padding: 6px 10px;
    font-size: 0.82rem;
  }

  .brand-text h1 {
    font-size: 1.1rem;
  }

  .brand-text p {
    font-size: 0.72rem;
  }

  .batch-header {
    padding: 12px 16px;
  }

  .batch-count {
    margin-left: 0;
  }

  .batch-expand-hint {
    margin-left: auto;
    font-size: 0.72rem;
  }

  .member-item {
    padding: 9px 16px;
    font-size: 0.9rem;
  }

  .back-to-top {
    bottom: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .search-bar-wrap {
    padding: 0 14px 12px;
  }
  .header-inner {
    padding: 12px 14px 6px;
  }
  .batch-count {
    margin-left: 0;
    width: 100%;
  }
}
