/* ============================================================
   Deutsche Lektüre — общий стиль для всех сгенерированных страниц
   ============================================================ */

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Base --- */
html {
  font-size: 18px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  line-height: 1.75;
  color: #1c1c1e;
  background-color: #fdfbf7;
  padding: 0.75rem;
}

.page {
  max-width: 660px;
  margin: 0 auto;
  padding: 1.25rem 0 4rem;
}

/* --- Page header --- */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid #ddd;
}

.page-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #555;
  margin-bottom: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* --- Gender legend --- */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  font-size: 0.8rem;
  color: #555;
  margin-bottom: 0.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-m { background-color: #1d4ed8; }
.dot-f { background-color: #b91c1c; }
.dot-n { background-color: #15803d; }

.legend-cases {
  font-size: 0.78rem;
  color: #999;
  margin-top: 0.3rem;
}

/* --- Chunk --- */
.chunk {
  margin-bottom: 2.5rem;
}

.chunk-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.chunk-number {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  color: #ccc;
}

/* --- Play button --- */
.play-btn {
  background: none;
  border: 1.5px solid #d0d0ce;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  padding: 0;
  cursor: pointer;
  font-size: 0.6rem;
  color: #aaa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
  line-height: 1;
}

.play-btn:hover {
  border-color: #999;
  color: #666;
}

.play-btn.playing {
  border-color: #2563eb;
  color: #2563eb;
  background-color: #eff6ff;
}

.chunk-text {
  font-size: 1.08rem;
  line-height: 1.95;
}

/* --- Gender colours (article + adjectives + noun wrapped together) --- */
.m { color: #1d4ed8; }   /* Maskulinum  —  синий  */
.f { color: #b91c1c; }   /* Femininum   —  красный */
.n { color: #15803d; }   /* Neutrum     —  зелёный */

/* --- Gender colours (background only; text stays dark) --- */
.m { background-color: #dbeafe; padding: 0.07em 0.2em; border-radius: 3px; }  /* Maskulinum — голубой  */
.f { background-color: #fce7f3; padding: 0.07em 0.2em; border-radius: 3px; }  /* Femininum  — розовый */
.n { background-color: #d1fae5; padding: 0.07em 0.2em; border-radius: 3px; }  /* Neutrum    — зелёный */
.p { background-color: #ebebea; padding: 0.07em 0.2em; border-radius: 3px; }  /* 1./2. Person — нейтральный серый */

/* --- Case superscript (before the noun phrase, inside the span) --- */
sup.case {
  font-size: 0.52em;
  font-weight: 700;
  line-height: 0;          /* не растягивает межстрочный интервал */
  vertical-align: 0.65em;
  color: #555;
  margin-right: 2px;
}

/* --- Analysis (collapsible) --- */
details {
  margin-top: 0.9rem;
  border-top: 1px solid #e4e4e4;
  padding-top: 0.55rem;
}

summary {
  font-size: 0.8rem;
  color: #aaa;
  cursor: pointer;
  user-select: none;
  list-style: none;
  -webkit-appearance: none;
  appearance: none;
  padding: 0.15rem 0;
}

summary::-webkit-details-marker { display: none; }

summary::before {
  content: '▶  ';
  font-size: 0.65em;
  vertical-align: 0.1em;
}

details[open] summary::before {
  content: '▼  ';
}

.analysis {
  margin-top: 0.8rem;
}

.analysis-block {
  margin-bottom: 1rem;
}

.analysis-block h3 {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #bbb;
  margin-bottom: 0.45rem;
}

.analysis-block p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: #333;
}

.analysis-block ul {
  list-style: none;
  font-size: 0.86rem;
  line-height: 1.55;
}

.analysis-block ul li {
  padding: 0.28rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.analysis-block ul li:last-child {
  border-bottom: none;
}

/* keyword in analysis (German form being explained) */
.kw {
  font-weight: 600;
  font-style: italic;
  color: #333;
}

/* --- Small screens --- */
@media (max-width: 400px) {
  html { font-size: 16px; }
  body { padding: 0.5rem; }
}
