/* ======================================================================
 * Zotikos.pl — lista autorów i profil autora (EXT:md_news_author)
 * Plik: zotikos-authors.css
 * Ładowanie: PO Bootstrap Package, custom-styles.css i zotikos-home8.css.
 * Tylko istniejące klasy z HTML /autorzy i /autorzy/dane/piotr-burda.
 * Bez zmian Fluid, bez JavaScriptu, bez zależności od uid strony/rekordu.
 * Jasny motyw; kolory i font dziedziczone z Zotikos z wartościami zapasowymi.
 * ====================================================================== */

body .md-newsauthor {
  --za-green: var(--z-green, #328152);
  --za-green-dark: var(--z-green-dark, #245c3b);
  --za-text: var(--z-text, #18352a);
  --za-muted: var(--z-muted, #52645b);
  --za-surface: var(--z-surface, #fff);
  --za-soft: var(--z-soft, #e1efea);
  --za-border: var(--z-border, #d4e0d9);
  --za-date: var(--z-terra-text, #91572f);
  --za-radius: var(--z-radius, .75rem);
  --za-radius-lg: var(--z-radius-lg, 1rem);
  --za-font: var(--z-font, "Source Sans Pro", "Source Sans 3", system-ui, sans-serif);
  --za-small: .9375rem;
  --za-base: 1.0625rem;
  --za-heading: clamp(1.25rem, 1.12rem + .45vw, 1.5rem);
  --za-title: clamp(1.75rem, 1.35rem + 1.3vw, 2.5rem);
  --za-1: .25rem;
  --za-2: .5rem;
  --za-3: .75rem;
  --za-4: 1rem;
  --za-5: 1.25rem;
  --za-6: 1.5rem;
  --za-8: 2rem;
  --za-10: 2.5rem;
  color: var(--za-text);
  font-family: var(--za-font);
  font-size: var(--za-base);
  line-height: 1.6;
  min-width: 0;
  padding-bottom: var(--za-8);
}

body .md-newsauthor *,
body .md-newsauthor *::before,
body .md-newsauthor *::after { box-sizing: border-box; }

body .md-newsauthor :where(h2, h3, p, dt, dd, a, time, figcaption) {
  font-family: var(--za-font);
}

body .md-newsauthor a {
  color: var(--za-green-dark);
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

body .md-newsauthor a:focus-visible {
  outline: 3px solid var(--za-green);
  outline-offset: 4px;
}

/* Szablon ma układ maincontent + pusty subcontent. Zwalniamy miejsce
 * WYŁĄCZNIE przy wtyczce autorów i gdy sidebar nie zawiera elementów HTML.
 * :not(:has(*)) uwzględnia białe znaki, inaczej niż :empty.
 * Wypełniony sidebar, stopka i inne podstrony zachowują swój układ. */
body .section-row:has(> .maincontent-wrap .md-newsauthor):not(:has(> .subcontent-wrap > *)) {
  display: block;
}
body .section-row:has(> .maincontent-wrap .md-newsauthor):not(:has(> .subcontent-wrap > *)) > .maincontent-wrap {
  flex: 0 0 100%;
  width: 100%;
  max-width: none;
}
body .section-row:has(> .maincontent-wrap .md-newsauthor) > .subcontent-wrap:not(:has(*)) {
  display: none;
}

/* LISTA AUTORÓW: 1 kolumna (poziomy wiersz) / 2 od 576 px / 3 od 768 px. */
body .md-newsauthor .newsauthor-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--za-6);
  margin: 0;
  padding: 0;
}
body .md-newsauthor .newsauthor-wrapper { min-width: 0; margin: 0; }
body .md-newsauthor .newsauthor-wrapper > .detail {
  display: flex;
  align-items: center;
  gap: var(--za-5);
  height: 100%;
  min-height: 7rem;
  padding: var(--za-5);
  background: var(--za-surface);
  border: 1px solid var(--za-border);
  border-radius: var(--za-radius-lg);
}
body .md-newsauthor .newsauthor-wrapper > .detail:hover {
  background: var(--za-soft);
  border-color: var(--za-green);
}
body .md-newsauthor .newsauthor-img { margin: 0; padding: 0; }
body .md-newsauthor .newsauthor-img img {
  display: block;
  max-width: 100%;
  height: auto;
}
body .md-newsauthor .newsauthor-list .newsauthor-img {
  flex: 0 0 5rem;
  width: 5rem;
  min-width: 0;
}
body .md-newsauthor .newsauthor-list .newsauthor-img img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
}
body .md-newsauthor .newsauthor-img figcaption {
  margin-top: var(--za-2);
  color: var(--za-muted);
  font-size: var(--za-small);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
body .md-newsauthor .name {
  margin: 0;
  color: var(--za-text);
  font-size: var(--za-heading);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
body .md-newsauthor .detail:hover .name {
  color: var(--za-green-dark);
  text-decoration: underline;
  text-underline-offset: .2em;
  text-decoration-thickness: 1px;
}

/* PROFIL: nazwisko, organizacja, stanowisko, zdjęcie, kontakt i biografia.
 * Grid nie zależy od liczby pól opcjonalnych ani kolejności bio/kontaktu. */
body .md-newsauthor .newsauthor-detail { min-width: 0; }
body .md-newsauthor .author-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  padding: var(--za-5);
  background: var(--za-surface);
  border: 1px solid var(--za-border);
  border-radius: var(--za-radius-lg);
}
body .md-newsauthor .author-wrapper > * { min-width: 0; }
body .md-newsauthor .author-wrapper > h2 {
  margin: 0 0 var(--za-3);
  color: var(--za-text);
  font-size: var(--za-title);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
body .md-newsauthor .author-wrapper > dt:empty { display: none; }
body .md-newsauthor .author-wrapper > dt {
  margin: var(--za-2) 0 0;
  color: var(--za-muted);
  font-size: var(--za-small);
  font-weight: 700;
}
body .md-newsauthor .author-wrapper > dd {
  margin: 0 0 var(--za-1);
  color: var(--za-muted);
  font-size: var(--za-base);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
body .md-newsauthor .author-wrapper > .newsauthor-img {
  width: min(100%, 15rem);
  margin: var(--za-5) 0;
}
body .md-newsauthor .author-wrapper > .newsauthor-img img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--za-radius);
}
/* Puste ikony Font Awesome nie mają załadowanego fontu na badanych stronach.
 * Nie ładujemy dodatkowej biblioteki, nie zmieniamy też ich font-family. */
body .md-newsauthor .author-wrapper .fa { margin-right: var(--za-2); }
body .md-newsauthor .author-wrapper .fa:empty:not(:has(*)) { margin-right: 0; }

body .md-newsauthor .contact-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: var(--za-5) 0 0;
  padding: var(--za-4);
  background: var(--za-soft);
  border-radius: var(--za-radius);
}
body .md-newsauthor .contact-details dt {
  margin: 0;
  color: var(--za-muted);
  font-size: var(--za-small);
  font-weight: 400;
}
body .md-newsauthor .contact-details dd {
  margin: 0 0 var(--za-3);
  min-width: 0;
  font-size: var(--za-base);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
body .md-newsauthor .contact-details dd:last-child { margin-bottom: 0; }
body .md-newsauthor .contact-details a {
  display: inline-block;
  padding-block: var(--za-1);
  text-decoration: underline;
  text-decoration-color: var(--za-border);
  text-underline-offset: .18em;
  overflow-wrap: anywhere;
}
body .md-newsauthor .contact-details a:hover { text-decoration-color: currentColor; }

body .md-newsauthor .bio {
  margin-top: var(--za-6);
  padding-top: var(--za-6);
  border-top: 1px solid var(--za-border);
  overflow-wrap: anywhere;
}
body .md-newsauthor .bio p,
body .md-newsauthor .bio li {
  max-width: 75ch;
  color: var(--za-text);
  font-size: var(--za-base);
  line-height: 1.75;
}
body .md-newsauthor .bio p { margin: 0 0 var(--za-4); }
body .md-newsauthor .bio > :last-child { margin-bottom: 0; }
body .md-newsauthor .bio a {
  text-decoration: underline;
  text-underline-offset: .18em;
}
body .md-newsauthor .bio a:hover { color: var(--za-green); }
body .md-newsauthor .newsauthor-back {
  margin-top: var(--za-6);
  color: var(--za-muted);
  font-size: var(--za-small);
}
body .md-newsauthor .newsauthor-back .back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--za-2) var(--za-5);
  border: 1px solid var(--za-border);
  border-radius: var(--za-radius);
  background: var(--za-surface);
  font-weight: 700;
}
body .md-newsauthor .newsauthor-back .back:hover {
  background: var(--za-soft);
  border-color: var(--za-green);
}

/* ARTYKUŁY: rzeczywisty HTML ma tekst i datę, bez miniatur. */
body .md-newsauthor .articles-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--za-5);
  margin: var(--za-10) 0 0;
  padding: 0;
  scroll-margin-top: 8rem;
}
body .md-newsauthor .articles-wrapper > h2 {
  grid-column: 1 / -1;
  margin: 0 0 var(--za-2);
  padding: 0;
  color: var(--za-text);
  font-size: clamp(1.5rem, 1.25rem + .8vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
}
body .md-newsauthor .articles-wrapper > article { min-width: 0; margin: 0; padding: 0; }
body .md-newsauthor .articles-wrapper > article > a {
  display: flex;
  flex-direction: column;
  gap: var(--za-3);
  height: 100%;
  padding: var(--za-5);
  background: var(--za-surface);
  border: 1px solid var(--za-border);
  border-radius: var(--za-radius);
}
body .md-newsauthor .articles-wrapper > article > a:hover {
  background: var(--za-soft);
  border-color: var(--za-green);
}
body .md-newsauthor .article-meta {
  margin: 0;
  color: var(--za-date);
  font-size: var(--za-small);
  line-height: 1.4;
}
body .md-newsauthor .news-list-date time { font-variant-numeric: tabular-nums; }
body .md-newsauthor .articles-wrapper h3 {
  margin: 0;
  padding: 0;
  color: var(--za-text);
  font-size: var(--za-heading);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
body .md-newsauthor .articles-wrapper > article > a:hover h3 {
  color: var(--za-green-dark);
  text-decoration: underline;
  text-underline-offset: .16em;
  text-decoration-thickness: 1px;
}
body .md-newsauthor .teaser-text,
body .md-newsauthor .teaser-text p {
  margin: 0;
  color: var(--za-muted);
  font-size: var(--za-base);
  font-weight: 400;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
body .md-newsauthor .teaser-text p + p { margin-top: var(--za-3); }

@media (min-width: 576px) {
  body .md-newsauthor .newsauthor-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body .md-newsauthor .newsauthor-wrapper > .detail {
    flex-direction: column;
    gap: var(--za-5);
    padding: var(--za-6) var(--za-4);
    text-align: center;
  }
  body .md-newsauthor .newsauthor-list .newsauthor-img { flex-basis: auto; width: 8rem; }
  body .md-newsauthor .contact-details {
    grid-template-columns: 6rem minmax(0, 1fr);
    column-gap: var(--za-4);
    row-gap: var(--za-2);
  }
  body .md-newsauthor .contact-details dt { padding-top: var(--za-1); }
  body .md-newsauthor .contact-details dd { margin-bottom: 0; }
}

@media (min-width: 768px) {
  body .md-newsauthor .newsauthor-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body .md-newsauthor .author-wrapper { padding: var(--za-8); }
  body .md-newsauthor .author-wrapper:has(> .newsauthor-img) {
    grid-template-columns: minmax(0, 1fr) 15rem;
    column-gap: var(--za-8);
  }
  body .md-newsauthor .author-wrapper:has(> .newsauthor-img) > * { grid-column: 1; }
  body .md-newsauthor .author-wrapper > .newsauthor-img {
    grid-column: 2 !important;
    grid-row: 1 / span 4;
    margin: 0;
  }
  body .md-newsauthor .author-wrapper:has(> .newsauthor-img) > .bio,
  body .md-newsauthor .author-wrapper:has(> .newsauthor-img) > .newsauthor-back { grid-column: 1 / -1; }
  body .md-newsauthor .articles-wrapper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--za-6);
  }
  body .md-newsauthor .articles-wrapper > article > a { padding: var(--za-6); }
}

@media (min-width: 992px) {
  body .md-newsauthor .newsauthor-wrapper > .detail { gap: var(--za-6); padding: var(--za-8); }
  body .md-newsauthor .newsauthor-list .newsauthor-img { width: 10rem; }
}

@media (prefers-reduced-motion: reduce) {
  body .md-newsauthor a { transition: none; }
}
