/* ─────────────────────────────────────────────
   TNM Eerlijk Meten – voorbeeldblok
   Thema's: .tnm-em--dark / .tnm-em--goud
   Layout:  .tnm-em--portrait (foto links, paneel rechts op canvas)
            .tnm-em--landscape (foto boven, stats-strip eronder)
   De foto behoudt zijn eigen verhouding (nodig voor de
   pijl/stempel-coördinaten) en loopt via een fade over
   in de canvas-achtergrond, zoals in het aangeleverde ontwerp.
   ───────────────────────────────────────────── */

.tnm-em {
  --tnm-em-bg: #121212;
  position: relative;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border-radius: 18px;
  background: var(--tnm-em-bg);
  font-family: Mulish, sans-serif;
  max-width: 1060px;
  height: clamp(460px, 62vh, 640px);
  margin: 0 auto 28px auto;
}

/* ── Foto ── */
.tnm-em__media {
  position: relative;
  flex: 1 1 58%;
  min-width: 0;
  overflow: hidden;
}
.tnm-em__frame {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-size: 0; /* geen inline-gap onder de img */
}
.tnm-em__media img {
  /* Fallback vóór JS; JS zet exacte cover-transformatie */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tnm-em__fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,0) 60%, var(--tnm-em-bg) 100%),
    linear-gradient(0deg, var(--tnm-em-bg) 0%, rgba(0,0,0,0) 12%);
}
.tnm-em__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ── Zijkolom: legenda + paneel ── */
.tnm-em__side {
  flex: 0 1 470px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: clamp(22px, 3.5vw, 44px);
}

.tnm-em__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 22px;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.tnm-em__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.tnm-em__legend-line {
  display: inline-block;
  width: 26px;
  height: 0;
  border-top: 2.5px solid currentColor;
  opacity: 0.9;
}
.tnm-em__legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: #d21f1f;
  border-radius: 3px;
}

/* ── Statspaneel ── */
.tnm-em__panel {
  border-radius: 18px;
  padding: clamp(20px, 2.4vw, 30px);
}
.tnm-em__stat + .tnm-em__stat {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid transparent;
}
.tnm-em__lbl {
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 2px;
}
.tnm-em__val {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 9px;
}
.tnm-em__num {
  font-size: clamp(2rem, 3.2vw, 2.9rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.tnm-em__unit {
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  font-weight: 700;
  opacity: 0.85;
}

/* ── Thema: dark ── */
.tnm-em--dark {
  --tnm-em-bg: #121212;
  color: #f2f2f2;
}
.tnm-em--dark .tnm-em__legend { color: #e6e6e6; }
.tnm-em--dark .tnm-em__panel {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(2px);
}
.tnm-em--dark .tnm-em__stat + .tnm-em__stat { border-top-color: rgba(255, 255, 255, 0.20); }
.tnm-em--dark .tnm-em__lbl { color: #fff; }
.tnm-em--dark .tnm-em__num--tnm { color: #BFA46A; }
.tnm-em--dark .tnm-em__num--bb { color: #fff; }
.tnm-em--dark .tnm-em__num--diff,
.tnm-em--dark .tnm-em__num--pct { color: #6db36f; }

/* ── Thema: goud ── */
.tnm-em--goud {
  --tnm-em-bg: #f4eee2;
  color: #222;
}
.tnm-em--goud .tnm-em__legend { color: #6b6152; }
.tnm-em--goud .tnm-em__legend-line { color: #1a1a1a; }
.tnm-em--goud .tnm-em__panel {
  background: #fff;
  border: 1px solid #e8dcc8;
  border-top: 4px solid #bd9f5d;
  box-shadow: 0 10px 28px rgba(150, 118, 60, 0.12);
}
.tnm-em--goud .tnm-em__stat + .tnm-em__stat { border-top-color: #ede8df; }
.tnm-em--goud .tnm-em__lbl { color: #3d3d3d; }
.tnm-em--goud .tnm-em__num--tnm { color: #bd9f5d; }
.tnm-em--goud .tnm-em__num--bb { color: #1a1a1a; }
.tnm-em--goud .tnm-em__num--diff,
.tnm-em--goud .tnm-em__num--pct { color: #3a7d44; }

/* ── Liggende foto: foto boven (gecentreerd), stats-strip eronder ── */
.tnm-em--landscape {
  flex-direction: column;
  height: auto;
}
.tnm-em--landscape .tnm-em__media {
  flex: none;
  height: clamp(340px, 46vh, 480px);
}
.tnm-em--landscape .tnm-em__fade {
  background:
    linear-gradient(0deg, var(--tnm-em-bg) 2%, rgba(0,0,0,0) 22%),
    linear-gradient(90deg, var(--tnm-em-bg) 0%, rgba(0,0,0,0) 8%, rgba(0,0,0,0) 92%, var(--tnm-em-bg) 100%);
}
.tnm-em--landscape .tnm-em__side {
  flex: 0 0 auto;
  padding-top: 0;
}
.tnm-em--landscape .tnm-em__panel { display: flex; gap: 0; }
.tnm-em--landscape .tnm-em__stat { flex: 1; padding: 0 clamp(14px, 2vw, 26px); }
.tnm-em--landscape .tnm-em__stat:first-child { padding-left: 0; }
.tnm-em--landscape .tnm-em__stat + .tnm-em__stat {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  border-left: 1px solid rgba(255, 255, 255, 0.20);
}
.tnm-em--goud.tnm-em--landscape .tnm-em__stat + .tnm-em__stat { border-left-color: #ede8df; }

/* ── Mobiel: altijd gestapeld, fade onderaan de foto ── */
@media (max-width: 781px) {
  .tnm-em,
  .tnm-em--landscape { flex-direction: column; height: auto; }
  .tnm-em__media { flex: none; height: clamp(300px, 48vh, 420px); }
  .tnm-em__fade,
  .tnm-em--landscape .tnm-em__fade {
    background: linear-gradient(0deg, var(--tnm-em-bg) 2%, rgba(0,0,0,0) 20%);
  }
  .tnm-em__side { padding-top: 0; }
  .tnm-em__legend { justify-content: center; }
  .tnm-em--landscape .tnm-em__panel { display: block; }
  .tnm-em--landscape .tnm-em__stat { padding: 0; }
  .tnm-em--landscape .tnm-em__stat + .tnm-em__stat {
    margin-top: 15px;
    padding-top: 15px;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.20);
  }
  .tnm-em--goud.tnm-em--landscape .tnm-em__stat + .tnm-em__stat { border-top-color: #ede8df; }
}

/* ── Smalle kaart: blok in een kolom (< 640px), bijv. 2 naast elkaar ── */
.tnm-em--narrow { flex-direction: column; height: auto; }
.tnm-em--narrow .tnm-em__media { flex: none; height: 340px; }
.tnm-em--narrow .tnm-em__side {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 0;
  gap: 12px;
}
.tnm-em--narrow .tnm-em__legend {
  justify-content: center;
  font-size: 0.78rem;
}
.tnm-em--narrow .tnm-em__num { font-size: clamp(1.7rem, 5vw, 2.2rem); }
.tnm-em--narrow .tnm-em__lbl { font-size: 0.95rem; }
.tnm-em--narrow .tnm-em__stat + .tnm-em__stat { margin-top: 11px; padding-top: 11px; }
.tnm-em--narrow.tnm-em--dark .tnm-em__fade {
  background: linear-gradient(0deg, var(--tnm-em-bg) 2%, rgba(0,0,0,0) 20%);
}
