/**
 * Author bio module styles.
 * Full width like books (max-width 1200px). Section layout identical to autor.php (kategorie.css).
 * Link this file when using the bio module (n/bio/bio_module.php).
 */
*, *::before, *::after { box-sizing: border-box; }

/* Full width like books (same as #author-books: 1200px). Fonts from n/fonts.css */
#main-content {
  padding: 0 16px 32px;
  max-width: 1200px;
  margin: 0 auto;
  font-family: var(--n-font-family);
  font-size: var(--n-font-size-base);
  line-height: var(--n-line-height);
  color: var(--n-color-text);
}

.author-bio-main-section {
  padding: 0 0 32px;
  max-width: 1200px;
  margin: 0 auto;
  font-family: var(--n-font-family);
  font-size: var(--n-font-size-base);
  line-height: var(--n-line-height);
  color: var(--n-color-text);
}

/* Wrapper – full width within main */
.author-bio-wrapper {
  clear: both;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.author-bio-wrapper .author-bio {
  font-family: var(--n-font-family);
  font-size: var(--n-font-size-md);
  color: var(--n-color-text-body);
  line-height: var(--n-line-height);
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
}

/* Last update – top right above H1 */
.author-bio-wrapper .author-bio .author-bio-updated {
  text-align: right;
  margin: 0 0 0.5rem 0;
  font-size: 0.875rem;
  color: #555;
}

.author-bio-wrapper .author-bio .author-bio-header {
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Rozwiń / Zwiń – tylko CSS (ukryty checkbox + label)
   Ogranicza wysokość: 550px desktop, 440px mobile; gradient na dole, płynna animacja.
   ========================================================================== */

/* Opakowanie: checkbox (ukryty), treść zwinięta, przycisk label */
.author-bio-wrapper .author-bio .author-bio-collapse-wrap {
  position: relative;
  margin: 0 0 1rem 0;
}

/* Ukryty checkbox – niewidoczny, ale dostępny dla label i :checked */
.author-bio-wrapper .author-bio .author-bio-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Kontener zwiniętej treści: max 550px desktop, overflow ukryty, animacja max-height */
.author-bio-wrapper .author-bio .author-bio-collapsible {
  max-height: 550px;
  overflow: hidden;
  position: relative;
  transition: max-height 0.4s ease;
}

/* Stan rozwinięty: usunięcie limitu wysokości (duża wartość dla płynnej animacji) */
.author-bio-wrapper .author-bio .author-bio-toggle:checked ~ .author-bio-collapsible {
  max-height: 5000px;
}

/* Efekt zanikania na dole – gradient (treść jest kontynuowana).
   Nadpisz --author-bio-fade-end na rodzicu, jeśli tło strony jest inne niż #fff. */
.author-bio-wrapper .author-bio .author-bio-collapsible::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--author-bio-fade-end, #fff));
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Po rozwinięciu – ukrycie gradientu */
.author-bio-wrapper .author-bio .author-bio-toggle:checked ~ .author-bio-collapsible::after {
  opacity: 0;
  pointer-events: none;
}

/* Rząd: linie po bokach + przycisk na środku (na całej szerokości sekcji) */
.author-bio-wrapper .author-bio .author-bio-toggle-row {
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: 1rem;
  gap: 1rem;
}

/* Delikatne poziome linie po bokach przycisku */
.author-bio-wrapper .author-bio .author-bio-toggle-line {
  flex: 1;
  height: 0;
  border-top: 1px solid #e2e8f0;
  min-width: 0;
}

/* Przycisk Rozwiń / Zwiń (label) – subtelny, z daszkami góra/dół */
.author-bio-wrapper .author-bio .author-bio-toggle-label {
  flex-shrink: 0;
  display: inline-block;
  margin: 0;
  padding: 0.35rem 0.6rem;
  font-size: var(--n-font-size-sm);
  font-weight: var(--n-font-weight-normal);
  color: var(--n-color-text-muted, #64748b);
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.author-bio-wrapper .author-bio .author-bio-toggle-label:hover {
  color: var(--n-color-link, #2563eb);
  border-color: #cbd5e1;
  background: #f8fafc;
}

/* Ikony rozwiń: ▼ z obu stron tekstu */
.author-bio-wrapper .author-bio .author-bio-expand-text::before {
  content: "\25BC\00A0";
  font-size: 0.65em;
  opacity: 0.9;
}

.author-bio-wrapper .author-bio .author-bio-expand-text::after {
  content: "\00A0\25BC";
  font-size: 0.65em;
  opacity: 0.9;
}

/* Ikony zwiń: ▲ z obu stron tekstu */
.author-bio-wrapper .author-bio .author-bio-collapse-text::before {
  content: "\25B2\00A0";
  font-size: 0.65em;
  opacity: 0.9;
}

.author-bio-wrapper .author-bio .author-bio-collapse-text::after {
  content: "\00A0\25B2";
  font-size: 0.65em;
  opacity: 0.9;
}

/* Tekst „Rozwiń” widoczny gdy zwinięte */
.author-bio-wrapper .author-bio .author-bio-expand-text {
  display: inline;
}

.author-bio-wrapper .author-bio .author-bio-collapse-text {
  display: none;
}

/* Tekst "Zwiń" widoczny gdy rozwinięte (label jest wewnątrz .author-bio-toggle-row) */
.author-bio-wrapper .author-bio .author-bio-toggle:checked ~ .author-bio-toggle-row .author-bio-expand-text {
  display: none;
}

.author-bio-wrapper .author-bio .author-bio-toggle:checked ~ .author-bio-toggle-row .author-bio-collapse-text {
  display: inline;
}

.author-bio-wrapper .author-bio .author-bio-short {
  margin: 0 0 1rem 0;
  padding: 0;
  font-size: var(--n-font-size-md);
  line-height: var(--n-line-height);
  color: var(--n-color-text-body);
}

.author-bio-wrapper .author-bio .author-bio-section {
  margin: 0;
  padding: 0;
}

.author-bio-wrapper .author-bio .author-bio-section-title {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  padding: 0;
  border-bottom: 1px solid #ddd;
}

.author-bio-wrapper .author-bio .author-bio-section:first-of-type .author-bio-section-title {
  margin-top: 0;
}

.author-bio-wrapper .author-bio .author-bio-block-inner {
  margin-bottom: 1rem;
}

.author-bio-wrapper .author-bio .author-bio-section:last-child .author-bio-block-inner {
  margin-bottom: 0;
}

.author-bio-wrapper .author-bio .author-bio-dl {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 22% 1fr;
  gap: 0.35rem 1rem;
  align-items: start;
}

.author-bio-wrapper .author-bio .author-bio-dl dt {
  font-weight: var(--n-font-weight-semibold);
  font-size: var(--n-font-size-md);
  color: var(--n-color-text-body);
  margin: 0;
  padding: 0;
  grid-column: 1;
  min-width: 0;
}

.author-bio-wrapper .author-bio .author-bio-dl dd {
  margin: 0;
  padding: 0;
  grid-column: 2;
  font-size: var(--n-font-size-md);
  color: var(--n-color-text-body);
  line-height: var(--n-line-height);
  box-sizing: border-box;
  min-width: 0;
}

.author-bio-wrapper .author-bio .author-bio-dl dd:empty {
  display: none;
}

.author-bio-wrapper .author-bio .author-bio-dl a {
  font-size: var(--n-font-size-md);
  color: var(--n-color-link);
  text-decoration: none;
}

.author-bio-wrapper .author-bio .author-bio-dl a:hover {
  text-decoration: underline;
}

.author-bio-wrapper .author-bio .author-bio-full-text {
  margin: 0;
  padding: 0;
  font-size: var(--n-font-size-md);
  color: var(--n-color-text-body);
  line-height: var(--n-line-height);
}

.author-bio-wrapper .author-bio .author-bio-list.list {
  margin: 0.25rem 0;
  padding-left: 1.25rem;
  font-size: var(--n-font-size-md);
  color: var(--n-color-text-body);
  line-height: var(--n-line-height);
}

.author-bio-wrapper .author-bio .author-bio-list li {
  margin-bottom: 0.25rem;
}

.author-bio-wrapper .author-bio .author-bio-card {
  background: #f8f8f8;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
}

.author-bio-wrapper .author-bio .author-bio-quote {
  margin: 0 0 0.5rem 0;
  padding: 0;
  font-size: var(--n-font-size-md);
  color: var(--n-color-text-body);
  line-height: var(--n-line-height);
}

.author-bio-wrapper .author-bio .author-bio-meta {
  color: var(--n-color-text-muted);
  font-size: var(--n-font-size-meta);
  margin: 0;
  padding: 0;
}

/* Empty state */
.author-bio-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--n-color-text-meta);
  font-size: var(--n-font-size-md);
  background: #f8fafc;
  border-radius: 10px;
  border: 1px dashed #e2e8f0;
}

@media (max-width: 560px) {
  #main-content {
    padding: 0 12px 24px;
  }
  .author-bio-wrapper .author-bio .author-bio-collapsible {
    max-height: 440px;
  }
  .author-bio-wrapper .author-bio .author-bio-dl {
    grid-template-columns: 1fr;
  }
  .author-bio-wrapper .author-bio .author-bio-dl dt {
    grid-column: 1;
  }
  .author-bio-wrapper .author-bio .author-bio-dl dd {
    grid-column: 1;
  }
}
