/* ============================================================
   Glossary Archive Page
   ============================================================ */

.glossary-archive-wrapper {
  padding: 72px 20px;
  display: flex;
  justify-content: center;
  background-color: #0a1628;
  color: #fff;
}

.glossary-inner {
  max-width: 1240px;
  width: 100%;
}

/* Header
   ============================================================ */
.glossary-header {
  margin-bottom: 40px;
}

.glossary-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--event-primary-color, #1ac2a7);
  margin: 0 0 12px;
}

.glossary-title {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 16px;
}

.glossary-subtitle {
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  max-width: 600px;
}

/* Search
   ============================================================ */
.glossary-search-wrapper {
  margin-bottom: 32px;
}

.glossary-search-input {
  width: 90%;
  max-width: 480px;
  padding: 12px 16px;
  font-size: 16px;
  border: 1px solid #393939;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
  background-color: #2d3746;
  color: rgba(255, 255, 255, 0.63);
}

.glossary-search-input:focus {
  border-color: white;
  color: white;
}

/* A–Z Alphabet Navigation
   ============================================================ */
.glossary-alphabet-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 24px;
}

.glossary-alpha-btn {
  min-width: 36px;
  height: 32px;
  padding: 0 6px;
  font-size: 18px;
  font-weight: 600;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  color: white;
  transition:
    background-color 0.15s,
    color 0.15s,
    border-color 0.15s;
  font-family: inherit;
}

.glossary-alpha-btn:hover:not(:disabled) {
  background-color: var(--event-primary-color, #007b8c);
}

.glossary-alpha-btn.is-active {
  background-color: var(--event-primary-color, #007b8c);
}

.glossary-alpha-btn.is-disabled,
.glossary-alpha-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* Content Layout: Sidebar + Terms
   ============================================================ */
.glossary-content {
  display: flex;
  gap: 100px;
  align-items: flex-start;
}

/* Sidebar (category filter)
   ============================================================ */
.glossary-sidebar {
  flex: 0 0 200px;
  position: sticky;
  top: 24px;
}

.glossary-sidebar-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--event-primary-color, #007b8c);
  margin: 0 0 12px;
}

/* Mobile toggle button — hidden on desktop */
.glossary-sidebar-toggle {
  display: none;
}

/* Label inside the toggle is desktop-hidden; the standalone <p> handles desktop */
.glossary-sidebar-toggle .glossary-sidebar-label {
  display: none;
}

.glossary-toggle-active {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  margin-left: 8px;
}

.glossary-toggle-arrow {
  margin-left: auto;
  font-size: 14px;
  color: #fff;
  transition: transform 0.2s;
}

.glossary-sidebar.is-open .glossary-toggle-arrow {
  transform: rotate(180deg);
}

.glossary-cat-btn {
  display: block;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  background: none;
  border: none;
  text-transform: uppercase;
  letter-spacing: 1px;

  cursor: pointer;
  color: #919191;
  transition:
    background-color 0.15s,
    color 0.15s;
  font-family: inherit;
}

.glossary-cat-btn:hover {
  background-color: #0b2332;
  color: #fff;
}

.glossary-cat-btn.is-active {
  font-weight: 700;

  background-color: #0b2332;
  border-left: 4px solid var(--event-primary-color, #007b8c);
  color: #fff;
}

/* Terms Wrapper
   ============================================================ */
.glossary-terms-wrapper {
  flex: 1;
  min-width: 0;
}

.glossary-empty {
  color: #888;
  font-size: 16px;
}

/* Letter Group
   ============================================================ */
.glossary-letter-group {
  margin-bottom: 40px;
}

.glossary-letter-header {
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0;
  padding-bottom: 8px;
}

.glossary-letter-header span {
  font-size: 28px;
  font-weight: 700;
  color: var(--event-primary-color, #007b8c);
  line-height: 1;
}

/* Term Item
   ============================================================ */
.glossary-term-item {
  padding: 32px 0;
}

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

.glossary-term-link {
  text-decoration: none;
  color: inherit;
}

.glossary-term-link:hover .glossary-term-title {
  color: var(--event-primary-color, #007b8c);
}

.glossary-term-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: Lato, sans-serif;
  color: var(--event-primary-color, #007b8c);
  margin: 0 0 8px;
  transition: color 0.15s;
}

.glossary-term-definition {
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
}

/* Responsive
   ============================================================ */
@media only screen and (max-width: 900px) {
  .glossary-content {
    flex-direction: column;
    gap: 24px;
  }

  .glossary-sidebar {
    flex: none;
    width: 100%;
    position: static;
  }

  /* Hide standalone label on mobile — toggle button has its own */
  .glossary-sidebar > .glossary-sidebar-label {
    display: none;
  }

  /* Show label inside the toggle on mobile */
  .glossary-sidebar-toggle .glossary-sidebar-label {
    display: block;
    margin: 0;
  }

  .glossary-sidebar-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    background: #0b2332;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
  }

  /* Collapse the cat list by default on mobile */
  .glossary-cat-list {
    display: none;
    margin-top: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
  }

  .glossary-sidebar.is-open .glossary-cat-list {
    display: block;
  }

  .glossary-cat-btn {
    display: block;
    width: 100%;
    margin-bottom: 0;
  }
}

@media only screen and (max-width: 600px) {
  .glossary-archive-wrapper {
    padding: 48px 16px;
  }

  .glossary-title {
    font-size: 32px;
  }

  .glossary-search-input {
    max-width: 100%;
  }

  .glossary-alphabet-nav {
    gap: 2px;
  }

  .glossary-alpha-btn {
    min-width: 28px;
    height: 28px;
    font-size: 12px;
  }
}
