/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: "Quicksand", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #b8895a;
}

/* ── Legal links (top-right corner) ── */
#legal-links {
  position: fixed; top: 10px; right: 14px; z-index: 300;
  display: flex; gap: 8px; align-items: center;
  font-size: 10px;
}
#legal-links a {
  color: rgba(255,254,246,0.75);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transition: color 0.2s;
}
#legal-links a:hover { color: #fff; }
#legal-links span { color: rgba(255,254,246,0.4); }
/* "Gemälde einreichen" pill button in the corner */
#legal-links .btn-einreichen {
  border: 1.5px solid rgba(255,254,246,0.55);
  background: rgba(255,254,246,0.15);
  padding: 12px 32px;
  border-radius: 30px;
  font-size: 15px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
#legal-links .btn-einreichen:hover {
  background-color: #FEA700;
  border-color: rgba(255,254,246,0.9);
  color: #fff;
}

/* ── Navigation Trail – BOTTOM ── */
#trail-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  height: 76px;
  background: #a97c50;
  background-image:
    repeating-linear-gradient(45deg, transparent, transparent 3px, rgba(0,0,0,0.04) 3px, rgba(0,0,0,0.04) 6px),
    repeating-linear-gradient(-45deg, transparent, transparent 3px, rgba(255,255,255,0.04) 3px, rgba(255,255,255,0.04) 6px);
  border-top: 3px solid #8b6340;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.35);
  /* CSS-only spread/scroll: inner uses min-width:100% + width:max-content     */
  /* → fits? inner = 100% → space-between spreads items across full width     */
  /* → overflows? inner = max-content → nav scrolls, items keep natural gap  */
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
#trail-nav::-webkit-scrollbar { display: none; }

#trail-nav-inner {
  position: relative;
  display: flex; align-items: center;
  justify-content: space-between;
  min-width: 100%;      /* fills nav → enables space-between spread on desktop */
  width: max-content;   /* grows beyond 100% when items need more room (scroll) */
  height: 100%;
  padding: 10px 20px;
  gap: 10px;            /* minimum gap between items in both modes */
}

#yarn-svg {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  overflow: visible;
}

.trail-item {
  position: relative; z-index: 2;
  background: #fffef8;
  border: none; outline: none;
  padding: 7px 13px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #3a2a1a;
  cursor: pointer;
  border-radius: 2px;
  box-shadow: 2px 3px 8px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.15);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
  white-space: nowrap;
  line-height: 1.3;
  text-align: center;
  transform: rotate(var(--item-rot, 0deg));
  flex-shrink: 0;
}
/* Pin sits at TOP of snippet (pointing up into the cork strip) */
.trail-item::before {
  content: '';
  position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--pin-color, #274B78);
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.45) 0%, var(--pin-color, #274B78) 60%);
  box-shadow: 0 2px 4px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.3);
}
.trail-item:hover {
  transform: rotate(0deg) translateY(-2px);
  box-shadow: 3px 5px 14px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.2);
  background: #fff;
}
.trail-item.active {
  background: #FEA700;
  color: #fff;
  font-weight: 700;
  transform: rotate(0deg) translateY(-2px);
  box-shadow: 3px 5px 14px rgba(254,167,0,0.45), 0 2px 4px rgba(0,0,0,0.2);
}
.trail-item.active::before { background: #FF6D03; }

/* ── Viewport & World ── */
#viewport {
  position: fixed;
  top: 0; left: 0; right: 0;
  bottom: 76px; /* nav height */
  overflow: hidden;
  cursor: default;
}

#world {
  position: absolute;
  top: 0; left: 0;
  width: 5800px; height: 4400px;
  transform-origin: 0 0;
  will-change: transform;
  cursor: grab;
  /* Cork board texture */
  background-color: #c49a6c;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E"),
    repeating-linear-gradient(0deg, transparent, transparent 18px, rgba(0,0,0,0.025) 18px, rgba(0,0,0,0.025) 19px),
    repeating-linear-gradient(90deg, transparent, transparent 18px, rgba(0,0,0,0.02) 18px, rgba(0,0,0,0.02) 19px);
}
#world.grabbing { cursor: grabbing; }

/* ── Cards ── */
.card {
  position: absolute;
  left: var(--cx, 0px);
  top: var(--cy, 0px);
  /* translateZ(0) promotes each card to its own compositing layer so the
     browser re-rasterises it at the correct resolution after camera zoom,
     giving crisp text instead of upscaled-texture blur. */
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  width: 380px;
  background: #fffef6;
  border-radius: 3px;
  box-shadow: 4px 8px 24px rgba(0,0,0,0.28), 1px 2px 4px rgba(0,0,0,0.12);
  transition: box-shadow 0.3s;
  cursor: default;
  z-index: 1; /* always above background media */
}
.card::before {
  content: '';
  position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.4) 0%, var(--card-color, #274B78) 60%);
  box-shadow: 0 3px 7px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.25);
  z-index: 2;
}
.card::after {
  content: '';
  position: absolute; top: 5px; left: 50%; transform: translateX(-50%);
  width: 3px; height: 18px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(0,0,0,0.06));
  border-radius: 0 0 2px 2px;
  z-index: 1;
}
.card.active {
  box-shadow: 6px 12px 40px rgba(0,0,0,0.38), 2px 3px 8px rgba(0,0,0,0.15);
  z-index: 10;
}
.card.wide  { width: 460px; }
.card.narrow{ width: 300px; }

.card-stripe {
  height: 8px;
  background: var(--card-color, #274B78);
  border-radius: 3px 3px 0 0;
}

.card-body {
  padding: 20px 22px 18px;
  user-select: text;
  cursor: text;
}
.card-body h2 {
  font-size: 15.5px; font-weight: 800;
  color: var(--card-color, #274B78);
  margin-bottom: 10px; line-height: 1.25;
  letter-spacing: 0.01em;
}
.card-body h3 {
  font-size: 12px; font-weight: 700;
  color: #5a4030;
  margin: 12px 0 5px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.card-body p {
  font-size: 13px; color: #3a2e22;
  line-height: 1.6; margin-bottom: 8px;
}
.card-body ul {
  font-size: 12.5px; color: #3a2e22;
  line-height: 1.6; padding-left: 17px; margin-bottom: 8px;
}
.card-body ul li { margin-bottom: 3px; }
.card-body blockquote {
  border-left: 3px solid var(--card-color, #274B78);
  padding: 6px 10px; margin: 10px 0;
  font-style: italic; font-size: 12px;
  color: #5a4a38; background: rgba(0,0,0,0.03);
  border-radius: 0 2px 2px 0;
}
.card-body a {
  color: var(--card-color, #274B78);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
  cursor: pointer;
}
.card-body a:hover { opacity: 0.75; }

.card-label {
  display: inline-block;
  font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: #fff; background: var(--card-color, #274B78);
  border-radius: 2px; padding: 2px 7px;
  margin-bottom: 10px; opacity: 0.85;
}

.card-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 22px 18px;
  gap: 8px;
  user-select: none; cursor: default;
}
.card-footer:only-child { justify-content: flex-end; }

/* Primary action button (Weiter / Nächster Abschnitt) */
.btn-weiter {
  background: none;
  border: 2px solid var(--card-color, #274B78);
  color: var(--card-color, #274B78);
  font-family: inherit; font-size: 12px; font-weight: 700;
  padding: 6px 15px; border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.btn-weiter:hover {
  background: var(--card-color, #274B78); color: #fff;
}
/* CTA button variant (e.g. PDF, Formular) */
.btn-cta {
  background: var(--card-color, #274B78);
  border: 2px solid var(--card-color, #274B78);
  color: #fff;
  font-family: inherit; font-size: 12px; font-weight: 700;
  padding: 6px 15px; border-radius: 20px;
  cursor: pointer;
  transition: opacity 0.2s;
  text-decoration: none; display: inline-block;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.btn-cta:hover { opacity: 0.8; }

/* ── Table cards ── */
.card-table {
  width: 100%; border-collapse: collapse;
  font-size: 11.5px; margin-top: 6px;
}
.card-table th {
  background: var(--card-color, #274B78);
  color: #fff; padding: 6px 8px;
  text-align: left; font-weight: 700; font-size: 11px;
  min-width: 75px;
}
.card-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  vertical-align: top; line-height: 1.4;
}
.card-table tr:nth-child(even) td { background: rgba(0,0,0,0.025); }

/* ── Termine ── */
.termine-loading {
  font-size: 12px; color: rgba(0,0,0,0.45); margin: 10px 0;
}
.termine-leer {
  font-size: 12px; color: rgba(0,0,0,0.45); margin: 10px 0;
}
.card-table .btn-info {
  background: none;
  border: 1.5px solid var(--card-color, #FF6D03);
  color: var(--card-color, #FF6D03);
  font-family: inherit; font-size: 10.5px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  cursor: pointer; white-space: nowrap;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}
.card-table .btn-info:hover {
  background: var(--card-color, #FF6D03); color: #fff;
}
.termine-location {
  font-size: 12px; margin-top: 10px;
  color: rgba(0,0,0,0.65);
}
.termine-location a {
  color: var(--card-color, #FF6D03);
  text-decoration: underline;
}
.termine-location a:hover { opacity: 0.75; }
.termine-desc {
  white-space: pre-line;
  font-size: 12px; line-height: 1.6;
  margin-top: 10px;
  color: rgba(0,0,0,0.75);
}
.termine-meta {
  font-size: 12px; font-weight: 700;
  color: var(--card-color, #FF6D03);
  margin-bottom: 4px;
}

/* ── Förderverein Split-Karte ── */
.card-zone {
  padding: 14px 22px 16px;
}
.card-zone + .card-zone { margin-top: 2px; }
.card-zone:last-of-type { margin-bottom: 14px; }
.card-zone-a {
  background: rgba(254,167,0,0.1);
  border-left: 3px solid #FEA700;
}
.card-zone-b {
  background: rgba(39,75,120,0.08);
  border-left: 3px solid #274B78;
  margin-bottom: 10px;
}
.card-zone h3 {
  font-size: 12px; font-weight: 700; margin: 0 0 5px;
  color: rgba(0,0,0,0.7);
}
.card-zone p {
  font-size: 12px; line-height: 1.5; margin: 0 0 10px;
  color: rgba(0,0,0,0.65);
}

/* ── FAQ ── */
.faq-item { border-bottom: 1px solid rgba(0,0,0,0.08); }
.faq-q {
  width: 100%; background: none; border: none;
  text-align: left; font-family: inherit; font-size: 12.5px;
  font-weight: 700; color: var(--card-color, #274B78);
  padding: 10px 0; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  user-select: none;
}
.faq-q::after { content: '+'; font-size: 17px; opacity: 0.6; flex-shrink: 0; margin-left: 8px; }
.faq-q.open::after { content: '−'; }
.faq-a {
  font-size: 12px; color: #3a2e22; line-height: 1.55;
  padding-bottom: 10px; display: none; user-select: text;
}
.faq-a.open { display: block; }

/* ── Contact Form ── */
.contact-form { display: flex; flex-direction: column; gap: 10px; user-select: none; }
.form-row label {
  display: block; font-size: 11px; font-weight: 700;
  color: #5a4030; text-transform: uppercase; letter-spacing: 0.05em;
}
.form-row input, .form-row textarea {
  display: block; width: 100%; margin-top: 4px;
  border: 1.5px solid rgba(0,0,0,0.14);
  border-radius: 4px; padding: 7px 10px;
  font-family: inherit; font-size: 12.5px;
  background: #fff; color: #3a2e22;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--card-color, #274B78);
  box-shadow: 0 0 0 2px rgba(39,75,120,0.12);
}
.form-row textarea { resize: vertical; min-height: 80px; }
.btn-submit {
  align-self: flex-end;
  background: var(--card-color, #274B78); color: #fff;
  border: none; border-radius: 20px;
  padding: 9px 22px;
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: opacity 0.2s;
}
.btn-submit:hover { opacity: 0.82; }
.form-success {
  display: none; text-align: center;
  padding: 16px 0; font-size: 14px; font-weight: 700;
  color: #2a6040;
}

/* ── World decorations (flat, no pin, behind cards) ──
   Usage: <div class="world-deco" style="--dx:Xpx;--dy:Ypx;--dw:WIDTHpx;--drot:DEGdeg;">
            <img src="assets/…" alt="">
          </div>
   --dx / --dy  : position (Mittelpunkt des Bildes, wie --cx/--cy bei Karten)
   --dw         : Breite (Höhe skaliert proportional)
   --drot       : Rotation in deg (positiv = im Uhrzeigersinn)
   --dopacity   : Deckkraft, Standard 1
── */
.world-deco {
  position: absolute;
  left: var(--dx, 0px);
  top:  var(--dy, 0px);
  width: var(--dw, 200px);
  transform: translate(-50%, -50%) rotate(var(--drot, 0deg));
  transform-origin: center center;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  opacity: var(--dopacity, 1);
}
.world-deco img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2px;
}

/* ── Background media pins ── */
.media-pin {
  position: absolute;
  transform-origin: top center;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}
.media-pin::before {
  content: '';
  position: absolute;
  top: -14px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.45) 0%, var(--pin-col, #8b4a1a) 60%);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
  z-index: 2;
  pointer-events: none;
}
.media-pin::after {
  content: '';
  position: absolute;
  top: 2px; left: 50%; transform: translateX(-50%);
  width: 2px; height: 14px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(0,0,0,0.06));
  border-radius: 0 0 2px 2px;
  z-index: 1;
  pointer-events: none;
}
.media-pin img,
.media-pin video {
  display: block;
  border-radius: 2px;
  box-shadow: 3px 6px 22px rgba(0,0,0,0.32), 1px 2px 5px rgba(0,0,0,0.14);
}
/* Videos are interactive – pointer-events on a child overrides the
   parent's pointer-events:none, so images stay purely decorative
   while videos are fully clickable / draggable / fullscreen-able. */
.media-pin video {
  background: #000;
  pointer-events: auto;
  cursor: default;
  /* Prevent the video element itself from triggering board-drag */
  user-select: none;
}

/* ── Intro overlay ── */
#intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;

  background:
          url("/assets/building.webp") center / cover no-repeat,
          rgba(166,120,72,0.96);
  text-shadow:
          0 0 6px rgba(0,0,0,0.9),
          0 0 18px rgba(0,0,0,0.8),
          0 0 40px rgba(0,0,0,0.7);
  background-blend-mode: soft-light;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;
  padding: 32px;
  transition: opacity 0.8s;
}
#intro-overlay.hidden { opacity: 0; pointer-events: none; }
#intro-overlay h1 {
  font-size: clamp(22px, 4vw, 38px); font-weight: 800;
  color: #fffef6; margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
#intro-overlay p { font-size: 18px; color: rgba(255,254,246,0.85); margin-bottom: 28px; }
#intro-btn {
  background: #FEA700; border: none; color: #fff;
  font-family: inherit; font-size: 15px; font-weight: 700;
  padding: 12px 32px; border-radius: 30px; cursor: pointer;
  box-shadow: 0 4px 16px rgba(254,167,0,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
#intro-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(254,167,0,0.5); }
#intro-cross {
  font-size: 160px;
  margin-bottom: 12px;
  opacity: 0.9;
  line-height: 100%;

  background: radial-gradient(
          ellipse at 50% 120%,
          red 0%,
          orange 12%,
          yellow 24%,
          green 36%,
          cyan 48%,
          blue 60%,
          violet 72%,
          transparent 74%
  );
  background-position: 50% 100%;
  background-repeat: repeat;

  background-size: 100% 100%;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.4));

  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  background-clip: text;
  color: transparent;

  text-shadow: 0 0 4px rgba(255,255,255,0.5);
}
/*
#intro-cross {
  background-size: 400% 100%;
  animation: rainbowMove 18s linear infinite;
}*/

@keyframes rainbowArc {
  0% { background-size: 100% 100%; }
  50% {  background-size: 120% 160%;}
  100% { background-size: 100% 100%; }
}

#intro-cross {
  animation: rainbowArc 42s ease-in-out infinite;
}

@keyframes rainbowMove {
  0% { background-position: 0% 50%; }
  100% { background-position: 400% 50%; }
}

/* ── Hint ── */
#hint {
  position: fixed; bottom: 83px; left: 50%; transform: translateX(-50%);
  background: rgba(39,75,120,0.85); color: #fff;
  font-size: 15px; padding: 6px 14px; border-radius: 20px;
  pointer-events: none; z-index: 100;
  opacity: 1; transition: opacity 1.2s;
  max-width: 90vw;
}
#hint.hidden { opacity: 0; }
