/**
 * PIDON ETR 2.0 – tekst łatwy do czytania
 * Wysoki kontrast, duża czytelna czcionka, krótkie wiersze, wyraźny fokus,
 * informacje nie są przekazywane wyłącznie kolorem.
 */

.pidon-etr {
  --etr-ink: #0f172a;
  --etr-muted: #475569;
  --etr-accent: #1d4ed8;
  --etr-bg: #f0f6ff;
  --etr-border: #1e3a8a;
  --etr-focus: #facc15;
  margin: 0 0 2rem;
  border: 2px solid var(--etr-border);
  border-radius: 14px;
  background: #fff;
  color: var(--etr-ink);
  overflow: hidden;
}

.pidon-etr__bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 16px;
  padding: 16px 20px;
  background: var(--etr-bg);
}

.pidon-etr__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--etr-border);
  color: #fff;
}

.pidon-etr__icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pidon-etr__intro {
  flex: 1;
  min-width: 200px;
}

.pidon-etr .pidon-etr__title {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--etr-ink);
}

.pidon-etr__badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border: 1.5px solid var(--etr-border);
  border-radius: 6px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  vertical-align: middle;
  color: var(--etr-border);
}

.pidon-etr .pidon-etr__lead {
  margin: 4px 0 0;
  font-size: 1rem;
  color: var(--etr-muted);
}

/* Przyciski */
.pidon-etr__toggle,
.pidon-etr__tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  border: 2px solid var(--etr-border);
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.pidon-etr__toggle {
  padding: 12px 22px;
  background: var(--etr-border);
  color: #fff;
  font-size: 1rem;
}

.pidon-etr__toggle:hover {
  background: #172554;
}

.pidon-etr__chevron {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s;
}

.pidon-etr__toggle[aria-expanded="true"] .pidon-etr__chevron {
  transform: rotate(180deg);
}

.pidon-etr__tool {
  padding: 8px 16px;
  background: #fff;
  color: var(--etr-border);
  font-size: .95rem;
}

.pidon-etr__tool svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pidon-etr__tool:hover,
.pidon-etr__tool[aria-pressed="true"] {
  background: var(--etr-border);
  color: #fff;
}

.pidon-etr button:focus-visible {
  outline: 4px solid var(--etr-focus);
  outline-offset: 3px;
}

/* Treść */
.pidon-etr__box {
  padding: 8px 24px 24px;
}

.pidon-etr__box[hidden] {
  display: none;
}

.pidon-etr__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 8px;
}

.pidon-etr__tools[hidden] {
  display: none;
}

.pidon-etr__content {
  max-width: 62ch;
  font-size: 1.15rem;
  line-height: 1.8;
  text-align: left;
  hyphens: none;
}

.pidon-etr.is-large .pidon-etr__content {
  font-size: 1.4rem;
}

.pidon-etr__content > * {
  margin: 0 0 1rem;
}

.pidon-etr__content h2,
.pidon-etr__content h3,
.pidon-etr__content h4 {
  margin-top: 1.6rem;
  font-weight: 700;
  line-height: 1.35;
}

.pidon-etr__content ul,
.pidon-etr__content ol {
  padding-left: 1.6rem;
}

.pidon-etr__content li {
  margin-bottom: .6rem;
}

.pidon-etr__content a {
  color: var(--etr-accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.pidon-etr__content strong,
.pidon-etr__content b {
  font-weight: 700;
}

.pidon-etr__content em {
  font-style: normal;
  text-decoration: underline;
}

/* Czytany na głos fragment – tło i obramowanie (nie tylko kolor tekstu) */
.pidon-etr__content .is-reading {
  background: #fef9c3;
  box-shadow: -8px 0 0 #fef9c3, 8px 0 0 #fef9c3, inset 4px 0 0 var(--etr-focus);
  border-radius: 4px;
}

@media (max-width: 640px) {
  .pidon-etr__bar {
    padding: 14px 16px;
  }
  .pidon-etr__toggle {
    width: 100%;
    justify-content: center;
  }
  .pidon-etr__box {
    padding: 8px 16px 20px;
  }
  .pidon-etr__tool {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pidon-etr__chevron {
    transition: none;
  }
}

@media print {
  .pidon-etr__box[hidden] {
    display: block !important;
  }
  .pidon-etr__toggle,
  .pidon-etr__tools {
    display: none !important;
  }
}
