/* ============================================================
   GERMANTALES — site styles
   White background, deep green accent, big buttons for small fingers.
   ============================================================ */

:root {
  --gruen-dunkel:    #1D4A2B;
  --gruen:           #2E6B3E;
  --gruen-mittel:    #3F8352;
  --gruen-hell:      #E8F2EA;
  --gruen-sehr-hell: #F5FAF6;
  --text:            #1B2A20;
  --text-leise:      #4C5F52;
  --weiss:           #FFFFFF;
  --fokus:           #F2A93B;
  --radius:          26px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--weiss);
  color: var(--text);
  font-family: ui-rounded, "Segoe UI Rounded", "Nunito", "Trebuchet MS",
               "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

a:focus-visible,
button:focus-visible {
  outline: 4px solid var(--fokus);
  outline-offset: 3px;
  border-radius: 14px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gruen-dunkel);
  color: #fff;
  padding: .8rem 1.4rem;
  font-weight: 700;
  border-radius: 0 0 14px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  background: var(--gruen-dunkel);
  color: #fff;
  padding: 1rem;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.5rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: .5px;
}
.logo .logo-emoji { font-size: 1.9rem; }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  padding: .65rem 1.1rem;
  border-radius: 999px;
  transition: background .15s ease;
}
.site-nav a:hover,
.site-nav a:focus { background: rgba(255, 255, 255, .18); }

/* ---------- Hero ---------- */
.hero {
  background: var(--gruen-hell);
  padding: 3.5rem 1rem 3rem;
  text-align: center;
  border-bottom: 6px solid var(--gruen-dunkel);
}
.hero-emoji {
  display: block;
  font-size: clamp(3.5rem, 12vw, 5.5rem);
  line-height: 1;
  margin-bottom: .75rem;
}
.hero h1 {
  margin: 0 auto .75rem;
  max-width: 22ch;
  color: var(--gruen-dunkel);
  font-size: clamp(2rem, 6.5vw, 3.25rem);
  line-height: 1.15;
  letter-spacing: -.5px;
}
.hero p {
  margin: 0 auto;
  max-width: 46ch;
  font-size: 1.15rem;
  color: var(--text-leise);
}

/* ---------- Sections ---------- */
.maerchen-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3.5rem 1rem 1rem;
}
.maerchen-section h2 {
  text-align: center;
  margin: 0 auto;
  color: var(--gruen-dunkel);
  font-size: clamp(1.6rem, 4.6vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -.3px;
}
.maerchen-section h2::after {
  content: "";
  display: block;
  width: 84px;
  height: 6px;
  border-radius: 999px;
  background: var(--gruen-mittel);
  margin: 1rem auto 0;
}

/* ---------- Card grid ---------- */
.maerchen-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 1.1rem;
  padding: 0;
  margin: 2.25rem 0 0;
}
.tale-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 145px;
  padding: 1.3rem .9rem;
  background: var(--gruen-sehr-hell);
  border: 3px solid var(--gruen-hell);
  border-radius: var(--radius);
  color: var(--gruen-dunkel);
  text-decoration: none;
  text-align: center;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.25;
  box-shadow: 0 4px 0 var(--gruen-hell);
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.tale-card:hover,
.tale-card:focus-visible {
  background: #fff;
  border-color: var(--gruen-mittel);
  transform: translateY(-4px);
  box-shadow: 0 8px 0 var(--gruen-hell);
}
.card-emoji {
  display: block;
  font-size: 2.6rem;
  line-height: 1;
}
.card-title {
  display: block;
}

/* ---------- Tale page ---------- */
.tale {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1rem 1rem;
}
.tale-header h1 {
  margin: 0 0 .4rem;
  color: var(--gruen-dunkel);
  font-size: clamp(2rem, 5.5vw, 2.85rem);
  line-height: 1.15;
  letter-spacing: -.3px;
}
.tale-sub {
  margin: 0 0 1.5rem;
  color: var(--text-leise);
  font-size: 1.1rem;
  font-style: italic;
}
.featured {
  margin: 0 0 2rem;
  text-align: center;
}
.featured img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--gruen-hell);
  background: #fff;
}
.tale-body {
  font-size: 1.18rem;
  line-height: 1.7;
  color: var(--text);
}
.tale-body p { margin: 0 0 1rem; }
.tale-intro {
  background: var(--gruen-sehr-hell);
  border-left: 5px solid var(--gruen-mittel);
  padding: 1rem 1.25rem;
  border-radius: 0 14px 14px 0;
  font-size: 1rem;
  color: var(--text-leise);
  margin-bottom: 1.5rem;
}
.tale-meta {
  margin: 2.5rem 0;
  padding: 1.5rem;
  background: var(--gruen-sehr-hell);
  border-radius: var(--radius);
}
.tale-meta h2 {
  margin: 0 0 .75rem;
  color: var(--gruen-dunkel);
  font-size: 1.25rem;
}
.tale-meta dl { margin: 0; display: grid; gap: .5rem 1.5rem; grid-template-columns: max-content 1fr; }
.tale-meta dt { font-weight: 700; color: var(--text-leise); }
.tale-meta dd { margin: 0; color: var(--text); }
.more-tales { margin: 3rem 0 1rem; }
.more-tales h2 {
  text-align: center;
  color: var(--gruen-dunkel);
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: .5rem;
}

/* ---------- Legal ---------- */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1rem;
}
.legal h1 {
  margin: 0 0 1rem;
  color: var(--gruen-dunkel);
  font-size: 2rem;
}
.legal p { color: var(--text); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--gruen-dunkel);
  color: #fff;
  padding: 2.5rem 1rem;
  text-align: center;
  margin-top: 4rem;
}
.site-footer p {
  margin: 0 auto 1rem;
  max-width: 50ch;
  font-size: 1rem;
  opacity: .92;
}
.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem 1.5rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.site-footer a {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: .35rem .25rem;
}
.site-footer a:hover { color: var(--gruen-hell); }
.site-footer .copy { opacity: .7; font-size: .9rem; }

/* ---------- Language picker ---------- */
.lang-picker {
  margin: 0 auto 1.25rem;
  text-align: center;
}
.lang-picker summary {
  display: inline-block;
  cursor: pointer;
  padding: .35rem .8rem;
  background: rgba(255, 255, 255, .12);
  border-radius: 999px;
  font-weight: 700;
  list-style: none;
}
.lang-picker summary::-webkit-details-marker { display: none; }
.lang-picker summary:hover { background: rgba(255, 255, 255, .22); }
.lang-list {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem .5rem !important;
  margin: .75rem auto 0 !important;
  padding: .5rem !important;
  max-width: 760px;
  background: rgba(255, 255, 255, .08);
  border-radius: 16px;
}
.lang-list li {
  list-style: none;
}
.lang-list a {
  display: block;
  padding: .25rem .5rem;
  font-size: .9rem;
  text-decoration: none;
  border-radius: 6px;
  color: #fff;
  opacity: .85;
}
.lang-list a:hover { background: rgba(255, 255, 255, .12); opacity: 1; }
.lang-list .lang-current a {
  background: rgba(255, 255, 255, .22);
  opacity: 1;
  font-weight: 800;
}

/* ---------- RTL ---------- */
body[dir="rtl"] .site-header { direction: rtl; }
body[dir="rtl"] .tale-meta dl { direction: rtl; }
body[dir="rtl"] .tale-intro { border-left: none; border-right: 5px solid var(--gruen-mittel); border-radius: 14px 0 0 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  body { font-size: 17px; }
  .hero { padding: 2.5rem 1rem 2.25rem; }
  .maerchen-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: .85rem;
  }
  .tale-card {
    min-height: 125px;
    padding: 1rem .6rem;
    font-size: .98rem;
  }
  .card-emoji { font-size: 2.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .tale-card:hover { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header,
  .site-nav,
  .site-footer,
  .lang-picker,
  .more-tales,
  .hero,
  .skip-link,
  .featured img { display: none !important; }

  body { background: #fff; color: #000; font-size: 14pt; line-height: 1.55; }
  .tale { max-width: none; padding: 0; }
  .tale-header h1 { font-size: 22pt; color: #000; }
  .tale-sub { color: #444; font-style: italic; }
  .tale-body { font-size: 14pt; }
  .tale-meta { background: none; border: 1px solid #ccc; }
  .featured { margin: 0 0 1rem; }
  a { color: #000; text-decoration: underline; }
}
