:root {
  color-scheme: light;
  --paper: #faf6ed;
  --card: #fffdf8;
  --ink: #4d493d;
  --muted: #6f6354;
  --accent: #52643e;
  --border: #ded4c0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.site-header {
  padding: clamp(1.75rem, 5vw, 3.5rem) 1rem 1.5rem;
  text-align: center;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.15;
}

.site-header h1 {
  margin: 0;
  font: inherit;
}

.site-header a {
  color: inherit;
  text-decoration: none;
}

.site-header:has(+ .home) {
  padding-bottom: 1rem;
}

.home,
.reading {
  width: calc(100% - 2rem);
  margin-inline: auto;
}

.home {
  max-width: 64rem;
}

.illustration {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.65rem;
}

.cover {
  max-width: 50rem;
  margin-inline: auto;
}

#mesetar {
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-top: clamp(1.25rem, 3vw, 2rem);
  border-top: 1px solid var(--border);
}

#mesetar h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  font-weight: normal;
}

.story-filters:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem 1rem;
  margin-bottom: 1.75rem;
}

.story-filters label {
  display: grid;
  gap: 0.25rem;
  flex: 1 1 12rem;
  min-width: 0;
  max-width: 100%;
}

.story-filters select,
.story-filters button {
  min-width: 0;
  max-width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--muted);
  border-radius: 0.4rem;
  background: var(--card);
  color: var(--ink);
  font: inherit;
}

.story-filters button {
  cursor: pointer;
}

.story-filters [role="status"] {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.story-card[hidden] {
  display: none;
}

.story-category:not([hidden]) ~ .story-category:not([hidden]) {
  margin-top: clamp(2rem, 5vw, 3.25rem);
  padding-top: clamp(1.25rem, 3vw, 2rem);
  border-top: 1px solid var(--border);
}

.story-category > h3 {
  margin: 0 0 1rem;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: normal;
  line-height: 1.3;
}

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

@media (min-width: 36rem) {
  .story-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 56rem) {
  .story-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.story-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--card);
  color: inherit;
  text-decoration: none;
}

.story-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.card-text {
  padding: 1rem 1.15rem;
}

.card-text h4 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.age-label {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.reading .age-label {
  margin-bottom: 1rem;
}

.read-link {
  color: var(--accent);
  font-size: 0.95rem;
}

.story-card:hover .read-link,
.story-card:focus-visible .read-link {
  text-decoration: underline;
}

.reading {
  max-width: 68ch;
  font-size: clamp(1.125rem, 2.5vw, 1.3rem);
}

.back-link {
  font-size: 1rem;
}

.reading h1,
.legal #adatvedelem {
  margin: 1.5rem 0 1rem;
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: normal;
  line-height: 1.2;
}

.story-text {
  margin-top: 1.75rem;
  line-height: 1.75;
}

.story-text p {
  margin: 0 0 1.2em;
}

.legal {
  margin-top: 1.25rem;
  overflow-wrap: anywhere;
}

.legal .draft-notice {
  color: var(--muted);
  font-size: 0.95rem;
}

.legal h2:not(#adatvedelem),
.legal h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.15em;
  line-height: 1.3;
}

.site-footer {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding: 1.25rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  margin: 0 0 0.25rem;
}

.site-footer nav {
  font-size: 0.95rem;
}
