/* За Приказко, a small page in the frame of the world pages (kategorii.css comes first). The cupboard holds one
   picture instead of books: the five friends in a wooden frame leaning on the plank, with a shelf tag under it. Below
   the room the text sits on the wall, left aligned, as on the home page. Night first, day under a light system
   setting, the plate switch and the lamp override either way. */
:root {
  --nadpis: #F7E2B3;
  --za-tih: #CDBB9F;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --nadpis: #34496A;
    --za-tih: #6A5A48;
  }
}

:root[data-theme="light"] {
  --nadpis: #34496A;
  --za-tih: #6A5A48;
}

/* the picture of the five on the shelf, standing on the plank */
.rafche {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: 18px 12px 6px;
}

.kartina {
  position: relative;
  width: min(100%, 210px);
  margin: 0;
}

.kartina-darvo {
  display: block;
  padding: 6px;
  background: var(--krem);
  box-shadow: 0 0 0 5px var(--dyska), 0 0 0 6px var(--dyska-tamna), 0 14px 20px -10px var(--syanka);
  transform: rotate(-1.2deg);
  transform-origin: 50% 100%;
}

.kartina-darvo img {
  display: block;
  width: 100%;
  height: auto;
}

/* the wall under the room */
.za {
  display: grid;
  gap: 18px;
  max-width: 34em;
  margin: 56px auto 0;
}

.za section {
  display: grid;
  gap: 16px;
}

.za h2 {
  margin: 18px 0 0;
  font-family: var(--zaglavie);
  font-weight: 400;
  font-size: clamp(1.75rem, 1.4rem + 1.3vw, 2.25rem);
  line-height: 1.15;
  text-wrap: balance;
  color: var(--nadpis);
}

.za section:first-child h2 { margin-top: 0; }

.za p { margin: 0; font-size: 1.125rem; line-height: 1.6; }

/* the five: a painted button in each one's own colours, then the name, the kind and one line */
.petimata {
  display: grid;
  gap: 18px;
  margin: 4px 0 0;
}

.petimata > div {
  display: grid;
  grid-template-columns: 34px 1fr;
  column-gap: 14px;
  align-items: start;
}

.petimata > div::before {
  content: "";
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  margin-top: 2px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 66%, var(--vtori) 0 26%, var(--parvi) 28%);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .14), 0 2px 4px var(--syanka);
}

.petimata .dino { --parvi: #8CBF8F; --vtori: #E6EEC9; }
.petimata .spayki { --parvi: #86ACC4; --vtori: #F3D58C; }
.petimata .triko { --parvi: #A98BC4; --vtori: #F0E4F2; }
.petimata .roki { --parvi: #F2CB5B; --vtori: #FFF4CF; }
.petimata .tirano { --parvi: #E9915E; --vtori: #F7DDB5; }

.petimata dt {
  font-family: var(--zaglavie);
  font-size: 1.375rem;
  line-height: 1.25;
}

.petimata dt span {
  font-family: var(--tekst);
  font-size: .9375rem;
  color: var(--za-tih);
}

.petimata dd {
  margin: 2px 0 0;
  font-size: 1.0625rem;
  line-height: 1.55;
}

/* the reading tips, each with a small red dot in front */
.saveti {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.saveti li {
  position: relative;
  padding-left: 28px;
  font-size: 1.125rem;
  line-height: 1.6;
}

.saveti li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .5em;
  width: 13px;
  height: 13px;
  background: radial-gradient(circle, var(--cherveno) 0 38%, transparent 42%);
}

/* the worlds: paper labels with the cloth of that world's books down the left edge */
.svetove {
  display: grid;
  gap: 14px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.svyat {
  position: relative;
  display: grid;
  gap: 2px;
  min-height: 64px;
  padding: 14px 16px 12px;
  border-left: 10px solid var(--plat);
  border-radius: 2px 6px 6px 2px;
  background: var(--hartiya);
  color: var(--mastilo);
  text-decoration: none;
  box-shadow: 0 3px 6px -2px rgba(0, 0, 0, .45);
}

.svyat::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  width: 36px;
  height: 4px;
  margin-left: -18px;
  background:
    repeating-linear-gradient(45deg, transparent 0 1.6px, var(--cherveno) 1.6px 2.8px, transparent 2.8px 4px),
    repeating-linear-gradient(-45deg, transparent 0 1.6px, var(--cherveno) 1.6px 2.8px, transparent 2.8px 4px);
}

.svyat b {
  font-family: var(--zaglavie);
  font-weight: 400;
  font-size: 1.375rem;
  line-height: 1.2;
}

.svyat span { font-size: .9375rem; line-height: 1.35; }

.svyat:hover b {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

/* the footer sits a little lower than on a world page, under the wall text */
.ram:has(> .za) + .podval { margin-top: 72px; }

@media (min-width: 640px) {
  .rafche { padding: 24px 12px 6px; }
  .kartina { width: 250px; }
  .svetove { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
