/* includes/author-select/author-select.css */

/* Gotham @font-face declarations now live in includes/shared/fonts.css */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #181a1a;
  color: #f6f7f2;
  font-family: "Gotham", system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

/* =========================
   PAGE SHELL
   ========================= */
.as-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: var(--app-max-w, 430px);
  margin: 0 auto;
  background: radial-gradient(circle at top, #1a2520 0, #181a1a 48%);
}

/* =========================
   STICKY HEADER
   9.1.1 – 9.1.5
   ========================= */
.as-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #181a1a;
  padding: 0px 16px 0;
}

/* 9.1.3 Compact bar — hidden until hero scrolls away */
.as-compact-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.as-header.is-compact .as-compact-bar {
  max-height: 60px;
  padding-top: 10px;
  padding-bottom: 4px;
  opacity: 1;
  pointer-events: auto;
}

.as-compact-text {
  font-size: 17px;
  font-weight: 500;
  font-family: "Gotham", system-ui, sans-serif;
}

/* 9.1.4 Hero row: back button + big title — collapses on scroll */
.as-hero {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  max-height: 100px;
  opacity: 1;
  margin-bottom: 16px;
  margin-top: 18px;
  transition: max-height 0.22s ease, margin-bottom 0.22s ease, margin-top 0.22s ease, opacity 0.18s ease;
}

.as-header.is-compact .as-hero {
  max-height: 0;
  margin-bottom: 0;
  margin-top: 0;
  opacity: 0;
  pointer-events: none;
}

.as-back {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.as-back img {
  display: block;
  filter: brightness(0) invert(1);
}

.as-hero-title {
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.4px;
  line-height: 1.1;
}

/* 9.1.5 Search bar — stays visible in sticky header */
.as-search-wrap {
  padding-bottom: 14px;
}

.as-search {
  position: relative;
  display: flex;
  align-items: center;
  height: 46px;
  border-radius: 8px;
  background: rgba(251, 255, 242, 1);
  padding: 0 12px;
  gap: 8px;
  overflow: hidden;
}

.as-search-icon {
  flex-shrink: 0;
}

.as-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #111111;
  font-size: 14px;
  font-family: "Gotham", system-ui, sans-serif;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

.as-search input::placeholder {
  color: rgba(179, 182, 172, 0.75);
}

.as-clear-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(17, 20, 21, 0.55);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.08s ease;
}
.as-clear-btn:active { transform: scale(0.98); }
.as-clear-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

/* =========================
   SCROLLABLE CONTENT
   ========================= */
.as-content {
  flex: 1;
  /* 9.1.6: 24px top gap before first chips; bottom pad for fixed footer */
  padding: 24px 16px 130px;
}

/* =========================
   CHIP GRID
   9.3.1 row-gap 8px | 9.3.2 col-gap 6px | 9.3.3 left margin via content padding
   ========================= */
.as-pills {
  display: flex;
  flex-wrap: wrap;
  row-gap: 8px;
  column-gap: 6px;
}

/* 9.2.1 Passive chip */
.pill {
  height: 40px;
  border-radius: 999px;
  padding: 0 12px;
  gap: 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #313333;
  background: transparent;
  color: #C4CCCC;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}
.pill:active { transform: scale(0.98); }

.pill .label {
  font-family: "Gotham", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
}

/* icon 20×20 */
.pill .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
  filter: brightness(0) invert(0.75);
}

/* 9.2.2 Active chip */
.pill.active {
  background: #CDE7BE;
  border-color: #CDE7BE;
  color: #313333;
}
.pill.active .icon {
  filter: brightness(0);
}

/* No results */
.no-results {
  padding: 10px 2px;
  color: #C4CCCC;
  font-size: 13px;
}

/* 9.4.1 Show more: Gotham Bold 14px, #CDE7BE, 16px above, 24px below */
.as-show-more {
  display: block;
  width: 100%;
  margin-top: 16px;
  margin-bottom: 24px;
  padding: 0;
  border: none;
  background: none;
  color: #CDE7BE;
  font-size: 14px;
  font-weight: 700; /* Gotham Bold */
  font-family: "Gotham", system-ui, sans-serif;
  text-align: center;
  cursor: pointer;
  user-select: none;
}

/* =========================
   FIXED FOOTER
   9.4.2 – 9.4.4
   ========================= */
.as-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: #181a1a;
  padding: 12px 16px 24px; /* 24px bottom — 9.4.4 */
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 9.4.2 Continue: 326×48px, Gotham Bold 14px, text #313333 */
.as-continue {
  width: 326px;
  height: 48px;
  border: none;
  border-radius: 14px;
  background: #CDE7BE;
  color: #313333;
  font-size: 14px;
  font-weight: 700;
  font-family: "Gotham", system-ui, sans-serif;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.08s ease;
}
.as-continue:active { transform: scale(0.99); }
.as-continue:disabled { opacity: 0.35; cursor: default; }

/* 9.4.3 Hint: Gotham Book 12px, #C4CCCC */
.as-hint {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 400; /* Gotham Book */
  color: #C4CCCC;
  text-align: center;
}

/* =========================
   ACCESSIBILITY
   ========================= */
.pill:focus-visible {
  outline: 2px solid #CDE7BE;
  outline-offset: 3px;
}
.pill.active:focus-visible {
  outline: 2px solid #313333;
  outline-offset: 3px;
}
.as-continue:focus-visible {
  outline: 2px solid #313333;
  outline-offset: 3px;
}
#authorSearch:focus-visible {
  outline: none;
}
.as-show-more:focus-visible {
  outline: 2px solid #CDE7BE;
  outline-offset: 3px;
  border-radius: 4px;
}
