/* Tale-modulen – felles stil (ungdomsskole) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@600;700;800&display=swap');

:root {
  --tale-bg: #f8f7f4;
  --tale-paper: #ffffff;
  --tale-ink: #1c1917;
  --tale-muted: #57534e;
  --tale-accent: #0f766e; /* Teal-basert accent */
  --tale-accent-soft: #f0fdfa;
  --tale-line: #e7e5e4;
  --tale-radius: 16px;
  --tale-shadow: 0 4px 24px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--tale-ink);
  background: var(--tale-bg);
  -webkit-font-smoothing: antialiased;
}

.tale-wrap {
  max-width: 56rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.tale-article {
  background: var(--tale-paper);
  border: 1px solid var(--tale-line);
  border-radius: var(--tale-radius);
  box-shadow: var(--tale-shadow);
  padding: 2rem 1.75rem 2.25rem;
}

@media (min-width: 640px) {
  .tale-article {
    padding: 2.5rem 2.5rem 2.75rem;
  }
}

.tale-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--tale-accent);
}

/* Artikkel-overskrifter */
.tale-article h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.tale-article h2 {
  margin: 2.5rem 0 1rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--tale-ink);
  letter-spacing: -0.01em;
}

.tale-article h3 {
  margin: 1.5rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.tale-article p {
  margin: 0 0 1rem;
}

.tale-article ul,
.tale-article ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.tale-article li {
  margin-bottom: 0.35rem;
}

.tale-article strong {
  font-weight: 650;
}

.tale-term {
  font-weight: 600;
  color: var(--tale-accent);
}

.tale-note {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  background: var(--tale-accent-soft);
  border-radius: 10px;
  border-left: 4px solid var(--tale-accent);
  font-size: 0.98rem;
}

.tale-note p:last-child {
  margin-bottom: 0;
}

.tale-card-grid {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0;
}

@media (min-width: 560px) {
  .tale-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tale-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--tale-line);
  border-radius: 12px;
  background: #fafaf9;
}

.tale-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.tale-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--tale-muted);
}

/* Modelltekst – tydelig avsnitt */
.tale-speech {
  margin: 1.5rem 0;
  padding: 1.25rem 1.35rem;
  background: linear-gradient(180deg, #fafaf9 0%, #fff 100%);
  border: 1px solid var(--tale-line);
  border-radius: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.06rem;
  line-height: 1.75;
}

.tale-speech p {
  margin: 0 0 1rem;
}

.tale-speech p:last-child {
  margin-bottom: 0;
}

.tale-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--tale-muted);
}

.tale-meta-row span {
  padding: 0.2rem 0.55rem;
  background: #f5f5f4;
  border-radius: 6px;
}

/* Interaktivt: utdrag / analyse */
.tale-reveal {
  margin: 1rem 0;
  border: 1px dashed var(--tale-line);
  border-radius: 12px;
  overflow: hidden;
}

.tale-reveal-toggle {
  width: 100%;
  margin: 0;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  color: var(--tale-accent);
  background: #f8fafc;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tale-reveal-toggle:hover {
  background: #f1f5f9;
}

.tale-reveal-toggle::after {
  content: "▾";
  font-size: 0.75rem;
  opacity: 0.8;
  transition: transform 0.2s ease;
}

.tale-reveal.is-open .tale-reveal-toggle::after {
  transform: rotate(-180deg);
}

.tale-reveal-panel {
  display: none;
  padding: 0 1rem 1rem;
  font-size: 0.95rem;
  color: var(--tale-muted);
}

.tale-reveal.is-open .tale-reveal-panel {
  display: block;
}

.tale-reveal-panel p:last-child {
  margin-bottom: 0;
}

/* Footer-lenker (ikke full meny) */
.tale-footnav {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--tale-line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.tale-footnav a {
  color: var(--tale-accent);
  text-decoration: none;
  font-weight: 600;
}

.tale-footnav a:hover {
  text-decoration: underline;
}

.tale-footnav-single {
  justify-content: flex-end;
}

/* Ny: Hamburger-illustrasjon stiler */
.burger-wrap {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.burger-part {
  width: 100%;
  max-width: 320px;
  padding: 1rem;
  text-align: center;
  border-radius: 12px;
  font-weight: 600;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.burger-top { background: #fbbf24; color: #78350f; border-color: #d97706; border-radius: 40px 40px 10px 10px; }
.burger-filling { background: #ef4444; color: #fff; border-color: #b91c1c; }
.burger-bottom { background: #fbbf24; color: #78350f; border-color: #d97706; border-radius: 10px 10px 40px 40px; }

/* Animasjoner */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.tale-article > * {
  animation: slideUp 0.5s ease out both;
}

.tale-article > *:nth-child(1) { animation-delay: 0.05s; }
.tale-article > *:nth-child(2) { animation-delay: 0.1s; }
.tale-article > *:nth-child(3) { animation-delay: 0.15s; }
.tale-article > *:nth-child(4) { animation-delay: 0.2s; }
.tale-article > *:nth-child(5) { animation-delay: 0.25s; }

#game-root .tale-wrap .tale-article h1,
#game-root .tale-wrap .tale-article h2,
#game-root .tale-wrap .tale-article h3 {
  display: block !important;
}

#game-root .tale-wrap .tale-article h1 {
  color: var(--tale-ink);
}
