/* Passages Directory Page Styles */

/* Override page-wrapper padding */
body:has(.passages-directory-page) .page-wrapper {
  padding: 0;
}

.passages-directory-page {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #2a2a3e;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background: #f8f9fa;
}

.passages-directory-page .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.directory-header {
  padding: 20px 0;
  border-bottom: 1px solid #e9ecef;
  background: white;
  margin: 0;
}

.header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.back-link {
  color: #6c757d;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.back-link:hover {
  color: #667eea;
}

/* Hero Section */
.directory-hero {
  padding: 60px 0 40px;
  background: white;
  border-bottom: 1px solid #e9ecef;
}

.directory-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  text-align: center;
  color: #1a1a2e;
}

.hero-intro {
  font-size: 1.2rem;
  line-height: 1.7;
  color: #495057;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 1rem;
}

.helper-link {
  text-align: center;
  font-size: 0.95rem;
  color: #6c757d;
}

.inline-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid #667eea;
  transition: all 0.3s;
}

.inline-link:hover {
  color: #5568d3;
  border-bottom-color: #5568d3;
}

/* Filters Section */
.directory-filters {
  padding: 30px 0;
  background: white;
  border-bottom: 1px solid #e9ecef;
}

.filters-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-label {
  font-weight: 600;
  color: #495057;
  font-size: 0.95rem;
  min-width: 120px;
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1rem;
  background: #f8f9fa;
  color: #495057;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.filter-btn:hover {
  background: #e9ecef;
  color: #667eea;
}

.filter-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* Passages Directory */
.passages-directory {
  padding: 60px 0;
}

.grade-group {
  margin-bottom: 4rem;
}

.grade-group:last-child {
  margin-bottom: 0;
}

.grade-heading {
  font-size: 2rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid #667eea;
}

.passages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Passage Cards */
.passage-card {
  background: white;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
  border: 2px solid transparent;
  overflow: hidden;
}

.passage-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
  border-color: #667eea;
}

.passage-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #f8f9fa;
}

.thumbnail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.passage-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid #e9ecef;
}

.passage-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
  flex: 1;
}

.grade-badge {
  background: #667eea;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.passage-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0 1.5rem;
}

.meta-item {
  display: flex;
  gap: 0.5rem;
}

.meta-label {
  font-size: 0.875rem;
  color: #6c757d;
  font-weight: 500;
}

.meta-value {
  font-size: 0.875rem;
  color: #495057;
  font-weight: 600;
}

.passage-actions {
  display: flex;
  justify-content: center;
  padding: 0.5rem 1.5rem 1.5rem;
  margin-top: 1.5rem;
}

.btn-view-passage {
  display: inline-block;
  width: 100%;
  padding: 0.625rem 1.25rem;
  background: #667eea;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
}

.btn-view-passage:hover {
  background: #5568d3;
  transform: translateY(-2px);
}

/* Footer Upsell */
.directory-footer {
  padding: 60px 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.footer-upsell {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.upsell-content h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.upsell-content p {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  opacity: 0.95;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
  transform: translateY(-2px);
}

.btn-large {
  padding: 16px 32px;
  font-size: 1.1rem;
  background: white;
  color: #667eea;
}

.btn-large:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
  .directory-hero h1 {
    font-size: 2rem;
  }

  .hero-intro {
    font-size: 1.05rem;
  }

  .grade-heading {
    font-size: 1.5rem;
  }

  .passages-grid {
    grid-template-columns: 1fr;
  }

  .passage-card {
    padding: 1.25rem;
  }

  .upsell-content h3 {
    font-size: 1.5rem;
  }

  .upsell-content p {
    font-size: 1rem;
  }
}
