/**
 * Handbook A-Z Page
 * Based on Figma node: 2045-96276
 */

/* ===========================================
 * HERO SECTION
 * =========================================== */

.handbook-hero {
  position: relative;
  padding: 40px 0;
  background-color: #F6F6F6;
  overflow: hidden;
}

.handbook-hero__bg {
  position: absolute;
  inset: 0;
  background-image: url('../img/bg-pattern.png');
  background-size: cover;
  background-position: center;
  opacity: 0.5;
  pointer-events: none;
}

.handbook-hero .container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Breadcrumbs */
.handbook-hero__breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  line-height: 16px;
  color: #888888;
}

.handbook-hero__breadcrumbs a {
  color: #888888;
  text-decoration: none;
  transition: color 0.2s ease;
}

.handbook-hero__breadcrumbs a:hover {
  color: #6E4F95;
}

.handbook-hero__breadcrumb-sep {
  color: #888888;
}

.handbook-hero__breadcrumb-current {
  color: #888888;
}

/* Title */
.handbook-hero__title {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 40px;
  color: #000000;
  margin: 0;
}

@media (min-width: 768px) {
  .handbook-hero__title {
    font-size: 48px;
    line-height: 56px;
  }
}

/* ===========================================
 * SEARCH BLOCK
 * =========================================== */

.handbook-search {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 24px;
  background-color: #ffffff;
  border-radius: 16px;
}

@media (min-width: 768px) {
  .handbook-search {
    padding: 48px;
  }
}

.handbook-search__form {
  width: 100%;
}

.handbook-search__input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 12px 16px;
  background-color: #F6F6F6;
  border-radius: 8px;
}

.handbook-search__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  line-height: 20px;
  color: #303030;
  outline: none;
}

.handbook-search__input::placeholder {
  color: #878787;
}

.handbook-search__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.handbook-search__btn svg {
  width: 24px;
  height: 24px;
}

/* Search Tags */
.handbook-search__tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.handbook-search__tags::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

@media (min-width: 768px) {
  .handbook-search__tags {
    flex-wrap: wrap;
    gap: 16px;
    overflow-x: visible;
  }
}

.handbook-search__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background-color: #ffffff;
  border: 1px solid #DBDBDB;
  border-radius: 12px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  line-height: 20px;
  color: #303030;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

@media (min-width: 768px) {
  .handbook-search__tag {
    font-size: 16px;
  }
}

.handbook-search__tag:hover {
  border-color: #6E4F95;
  background-color: #F6F6F6;
}

/* ===========================================
 * CONTENT SECTION
 * =========================================== */

.handbook-content {
  position: relative;
  padding: 40px 0;
  background-color: #F6F6F6;
}

.handbook-content__layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 992px) {
  .handbook-content__layout {
    grid-template-columns: 280px 1fr;
  }
}

@media (min-width: 1200px) {
  .handbook-content__layout {
    gap: 40px;
  }
}

/* Sidebar (desktop only) */
.handbook-content__sidebar {
  display: none;
}

@media (min-width: 992px) {
  .handbook-content__sidebar {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }
}

/* Main Content */
.handbook-content__main {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ===========================================
 * MOBILE FIXED ALPHABET (right edge of screen)
 * =========================================== */

.handbook-alphabet-mobile {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 8px;
  background-color: #ffffff;
  border-radius: 10px 0 0 10px;
  box-shadow: -4px 0 10px rgba(0, 0, 0, 0.1);
}

@media (min-width: 992px) {
  .handbook-alphabet-mobile {
    display: none;
  }
}

.handbook-alphabet-mobile__letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 20px;
  padding: 2px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #303030;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.handbook-alphabet-mobile__letter:hover {
  color: #6E4F95;
}

.handbook-alphabet-mobile__letter.is-active {
  color: #6E4F95;
}

.handbook-alphabet-mobile__letter--disabled {
  color: #A6A6A6;
  cursor: default;
}

/* ===========================================
 * ALPHABET NAVIGATION
 * =========================================== */

.handbook-alphabet {
  display: none; /* Hidden on mobile, shown on desktop */
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 8px 16px;
  background-color: #ffffff;
  border-radius: 10px;
  overflow-x: auto;
}

@media (min-width: 992px) {
  .handbook-alphabet {
    display: flex;
    position: sticky;
    top: calc(var(--header-height, 86px) + 24px);
    z-index: 10;
  }
}

.handbook-alphabet__letter {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 24px;
  height: 28px;
  padding: 2px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  color: #000000;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.handbook-alphabet__letter:hover {
  color: #6E4F95;
}

/* Active letter (currently viewing) - purple */
.handbook-alphabet__letter.is-active {
  color: #6E4F95;
}

/* Disabled letter (no posts) - muted gray */
.handbook-alphabet__letter--disabled {
  color: #A6A6A6;
  cursor: default;
}

/* ===========================================
 * ARTICLES LISTING
 * =========================================== */

.handbook-articles {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.handbook-articles__section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background-color: #ffffff;
  border-radius: 10px;
}

@media (min-width: 768px) {
  .handbook-articles__section {
    padding: 32px;
  }
}

.handbook-articles__letter {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 32px;
  font-weight: 500;
  line-height: 32px;
  color: #6E4F95;
  margin: 0;
}

.handbook-articles__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 768px) {
  .handbook-articles__grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 32px;
  }
}

.handbook-articles__item {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid #E4E4E4;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  color: #4D4D4D;
  text-decoration: none;
  transition: color 0.2s ease;
}

.handbook-articles__item:hover {
  color: #6E4F95;
}

.handbook-articles__empty {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  line-height: 24px;
  color: #878787;
  text-align: center;
  padding: 48px 24px;
  background-color: #ffffff;
  border-radius: 10px;
}
