/* ============================================================================
   HOME REPERTOIRE SECTION
   ============================================================================ */

.home-repertoire {
  padding: 4rem 1.5rem;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.home-repertoire__header {
  text-align: center;
  margin-bottom: 2rem;
}

.home-repertoire__title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-strong);
  margin-bottom: 0.5rem;
}

.home-repertoire__subtitle {
  font-size: 1.05rem;
  color: var(--text-soft);
}

/* ── Search ── */
.home-repertoire__search-wrap {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto 1.5rem auto;
}

.home-repertoire__search-icon {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-faint);
  pointer-events: none;
}

.home-repertoire__search {
  width: 100%;
  padding: 1.2rem 1.5rem 1.2rem 3.5rem;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  transition: all 150ms ease;
}

.home-repertoire__search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.home-repertoire__search::placeholder {
  color: var(--text-faint);
}

/* ── Filter Pills ── */
.home-repertoire__filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.home-repertoire__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 150ms ease;
  user-select: none;
}

.home-repertoire__pill:hover {
  background: var(--surface-sunken);
  border-color: var(--border-soft);
}

.home-repertoire__pill.active {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent-strong);
  font-weight: 600;
}

.home-repertoire__pill-count {
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-left: 0.2rem;
}
.home-repertoire__pill.active .home-repertoire__pill-count { color: var(--accent); }

/* ── Results Bar ── */
.home-repertoire__results-bar {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 1rem;
  text-align: left;
}

/* ── Grid ── */
.home-repertoire__grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Card ── */
.home-repertoire__card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  transition: all 150ms ease;
}

.home-repertoire__card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(31,75,76,0.08);
  transform: translateY(-1px);
}

/* Card image placeholder */
.home-repertoire__card-thumb {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-sunken);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-faint);
}

.home-repertoire__card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Card Body */
.home-repertoire__card-body {
  flex: 1;
  min-width: 0;
}

.home-repertoire__card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.1rem;
}

/* Badge */
.home-repertoire__card-badge {
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-soft);
}

/* Arrow */
.home-repertoire__card-arrow {
  flex-shrink: 0;
  color: var(--border);
  font-size: 1.2rem;
  margin-left: 0.5rem;
  transition: color 150ms ease, transform 150ms ease;
}

.home-repertoire__card:hover .home-repertoire__card-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* ── Modal (Dialog) ── */
.home-repertoire__modal {
  border: none;
  border-radius: 16px;
  padding: 0;
  background: var(--surface);
  width: 90vw;
  max-width: 1000px;
  max-height: 90vh;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  margin: auto;
}

.home-repertoire__modal::backdrop {
  background: rgba(20,24,26,0.6);
  backdrop-filter: blur(4px);
}

.rep-modal-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 90vh;
}

.rep-modal-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-sunken);
  position: sticky;
  top: 0;
  z-index: 10;
}

.rep-modal-close {
  background: none;
  border: none;
  color: var(--text-soft);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
}

.rep-modal-close:hover {
  background: var(--border);
  color: var(--text);
}

.rep-modal-close svg { width: 24px; height: 24px; }

.rep-modal-header-text { flex: 1; min-width: 0; }

.rep-modal-title {
  font-size: 1.5rem;
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--accent-strong);
  margin: 0;
}

.rep-modal-subtitle {
  font-size: 0.95rem;
  color: var(--text-soft);
  margin-top: 0.2rem;
}

.rep-modal-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.rep-modal-nav {
  width: 240px;
  background: var(--surface-sunken);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 1.5rem 1rem;
}

.rep-nav-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--text-faint);
  margin-bottom: 1rem;
  padding-left: 0.5rem;
}

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

.rep-nav-list li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.5rem;
  border-radius: 8px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 150ms ease;
}

.rep-nav-list li a svg {
  width: 16px;
  height: 16px;
  opacity: 0.6;
}

.rep-nav-list li a:hover {
  background: rgba(31,75,76,0.06);
  color: var(--accent);
}

.rep-nav-list li a.active {
  background: var(--accent-tint);
  color: var(--accent-strong);
  font-weight: 600;
}
.rep-nav-list li a.active svg { opacity: 1; }

.rep-modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2.5rem;
  scroll-behavior: smooth;
}

.rep-section { margin-bottom: 3rem; }

.rep-section-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.rep-section-head h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--accent-strong);
}

.rep-section-head svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.rep-modal-content p, .rep-modal-content li {
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.rep-modal-content ul { padding-left: 1.5rem; }

/* Styling for specific medical elements without emojis */
.rep-flag {
  border-left: 4px solid #c62828;
  background: #ffebee;
  padding: 1rem;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
}
.rep-flag-title {
  color: #b71c1c;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.rep-pearl {
  border-left: 4px solid #f57f17;
  background: #fff8e1;
  padding: 1rem;
  border-radius: 0 8px 8px 0;
  margin: 1.5rem 0;
}
.rep-pearl-title {
  color: #e65100;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.rep-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}
.rep-table th, .rep-table td {
  border: 1px solid var(--border);
  padding: 0.75rem;
  text-align: left;
}
.rep-table th { background: var(--surface-sunken); font-weight: 600; }

/* ── Signature Finding ── */
.rep-signature {
  font-weight: 600;
  color: var(--accent-strong);
  border-left: 3px solid var(--accent);
  padding-left: 0.75rem;
  margin-left: -0.75rem;
}

/* ── Reference list ── */
.rep-ref-list {
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.7;
}
.rep-ref-list a {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Empty state ── */
.home-repertoire__empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-soft);
}
.home-repertoire__empty-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  color: var(--text-faint);
}
.home-repertoire__empty svg { width: 40px; height: 40px; }

/* ── Responsive modal ── */
@media (max-width: 680px) {
  .home-repertoire__modal {
    width: 100vw;
    max-width: 100vw;
    border-radius: 16px 16px 0 0;
    align-self: flex-end;
  }
  .rep-modal-layout { flex-direction: column; }
  .rep-modal-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem;
  }
  .rep-nav-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .rep-nav-list li a { padding: 0.4rem 0.75rem; border-radius: 50px; font-size: 0.8rem; }
  .rep-modal-content { padding: 1.25rem; }
}
