html {
  scroll-behavior: smooth;
}

#biografia, #lektury, #artykuly {
  scroll-margin-top: 80px; /* dopasuj do wysokości swojego menu głównego */
}

/* --- PROFIL AUTORA: UKŁAD NAGŁÓWKA --- */
.content-header.author-profile-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}

.author-header-info {
  flex-grow: 1;
}

.author-avatar-wrapper {
  flex-shrink: 0;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  background-color: rgba(255, 255, 255, 0.1);
}

.author-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Plakietki autora */
.author-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.author-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  backdrop-filter: blur(4px);
  width: fit-content;
}

.author-badge i {
  color: #ffffff;
}

/* --- SEKCJE POWIĄZANYCH TREŚCI --- */
.author-section-title {
  font-size: 22px;
  color: #1e293b;
  margin: 35px 0 20px 0;
  font-weight: 700;
  position: relative;
  padding-left: 15px;
}

.author-section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: linear-gradient(to bottom, #6366f1, #8b5cf6);
  border-radius: 2px;
}

.related-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.related-article-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  text-decoration: none !important;
  color: inherit !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
}

.related-article-card:hover {
  border-color: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.08);
}

.related-article-card h3 {
  font-size: 16px;
  color: #1e293b;
  margin: 8px 0 !important;
  line-height: 1.4;
  border: none !important;
  padding: 0 !important;
}

.related-article-card h3::before {
  display: none !important;
}

.related-article-card p {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  margin: 0 !important;
  flex-grow: 1;
}

/* Link pod listą lektur */
.content-bottom-link-autorzy {
  display: flex;
  justify-content: flex-end;
  margin-top: 15px;
}

/* --- RESPONSYWNOŚĆ MOBILNA --- */
@media (max-width: 768px) {
  .content-header.author-profile-card {
    flex-direction: column-reverse;
    text-align: center;
    gap: 20px;
  }

  .author-badges {
    align-items: center;
  }

  .badges-row {
    justify-content: center;
  }

  .author-avatar-wrapper {
    width: 120px;
    height: 120px;
  }
}

@media (max-width: 600px) {
  .content-bottom-link-autorzy {
    justify-content: flex-start;
  }
}

/* ===================================================
   SPIS I KATALOG AUTORÓW (/autorzy/index.html)
   =================================================== */

/* Wyszukiwarka i licznik w nagłówku */
.author-search-input {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 20px;
  padding: 8px 16px;
  color: #ffffff;
  font-size: 14px;
  outline: none;
  width: 260px;
  max-width: 100%;
  transition: all 0.25s ease;
  font-family: inherit;
}

.author-search-input::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.author-search-input:focus {
  background: rgba(255, 255, 255, 0.3);
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.authors-counter-badge {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.15);
  padding: 6px 12px;
  border-radius: 14px;
}

/* Wiersz pojedynczego autora */
.author-catalog-row {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  text-decoration: none !important;
  color: inherit !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.author-catalog-row:hover {
  border-color: #6366f1;
  background-color: #fcfdff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.08);
}

/* Lewa strona wiersza: Awatar + Nazwisko + Epoka */
.author-row-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-grow: 1;
}

.author-avatar-thumbnail {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #e2e8f0;
  background-color: #f1f5f9;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.author-avatar-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Fallback, gdy brak zdjęcia */
.author-placeholder-avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
  color: #6366f1;
  font-size: 20px;
}

.author-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.author-name {
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
}

.author-meta-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.author-epoch-tag {
  font-size: 13px;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.author-epoch-tag i {
  color: #818cf8;
  font-size: 12px;
}

/* Prawa strona wiersza: Przycisk / Strzałka */
.author-row-right {
  flex-shrink: 0;
}

.btn-author-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  color: #4f46e5;
  border: 1px solid #e2e8f0;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.25s ease;
}

.author-catalog-row:hover .btn-author-link {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.btn-author-link i {
  font-size: 12px;
  transition: transform 0.25s ease;
}

.author-catalog-row:hover .btn-author-link i {
  transform: translateX(4px);
}

/* Stan braku wyników w wyszukiwaniu */
.no-authors-found {
  text-align: center;
  padding: 50px 20px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  color: #64748b;
  margin-top: 15px;
}

.no-authors-found i {
  font-size: 36px;
  color: #94a3b8;
  margin-bottom: 12px;
  display: block;
}

.no-authors-found p {
  font-size: 15px;
  margin: 0;
}

/* Responsywność */
@media (max-width: 650px) {
  .author-catalog-row {
    padding: 12px 14px;
    gap: 12px;
  }
  
  .author-avatar-thumbnail {
    width: 48px;
    height: 48px;
  }
  
  .author-name {
    font-size: 15px;
  }
  
  .btn-author-link .btn-text {
    display: none; /* Na małych ekranach zostawiamy tylko elegancką pigułkę ze strzałką */
  }
  
  .btn-author-link {
    padding: 8px 12px;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    justify-content: center;
  }
  
  .author-search-input {
    width: 100%;
  }
}

.see-also-icon {
  overflow: hidden;
}

.see-also-icon img,
.see-also-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}