:root {
  --primary: #ce3823;
  --secondary: #f5f5f5;
  --text: #333;
  --font: 'Segoe UI', sans-serif;
  --max-width: 1024px;
}

/* Hintergrund */
body {
  margin: 0;
  font-family: var(--font);
  background: linear-gradient(to right, #fff 0%, #ce3823 100%);
  color: var(--text);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

/* Grid */
.grid-container {
  display: grid;
  grid-template-columns: repeat(28, 1fr);
  grid-template-rows: repeat(54, 1fr);
  width: 100%;
  max-width: var(--max-width);
  height: 100vh;
  box-sizing: border-box;
  padding: 0;
}

/* Button-Bar oben rechts (optional genutzt) */
.button-bar {
  position: fixed;
  top: 1rem;
  right: calc((100vw - var(--max-width)) / 2 + 1rem); /* bündig mit Boxen */
  display: flex;
  gap: 1rem;
  z-index: 101;
}

.button-bar .wort-btn,
.button-bar .impressum-btn {
  padding: 0.5rem 1rem;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.button-bar .wort-btn:hover,
.button-bar .impressum-btn:hover {
  background-color: #c00011;
}

/* Grid-Buttons */
.grid-button {
  display: flex;
  justify-content: center;
  align-items: center; /* vertikal zentriert */
  z-index: 101;
}

.wort-btn {
  grid-column: 20 / 23;
  grid-row: 2 / 3;
}

.impressum-btn {
  grid-column: 24 / 27;
  grid-row: 2 / 3;
}

.grid-button .btn {
  padding: 0.5rem 1rem;
  background-color: #bebebe;
  color: var(--text);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.grid-button .btn:hover {
  background-color: #c00011;
}

/* Popup-Fenster (Overlay) */
.popup {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(51, 51, 51, 0.6); /* Abdunklung – Website bleibt sichtbar */
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 200; /* über Grid-Inhalten */
}

/* Sicherstellen, dass sich Popups nicht verdecken */
#impressum-popup { z-index: 200; }
#wort-popup { z-index: 210; }

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
}

.popup-content {
  background-color: #fff;
  padding: 1rem;
  border-radius: 12px;
  max-width: 700px; /* etwas breiter als vorher */
  width: 90%;
  height: 80%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.popup-content iframe {
  flex: 1;
  width: 100%;
  border: none;
}

.popup-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.popup-text {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  padding: 1rem;
  overflow-y: auto;
}

.popup-title {
  font-size: 1.4rem;
  color: var(--primary);
  margin: 0;
}

/* Einheitliche Buttons (global) */
.btn {
  padding: 0.5rem 1rem;
  background-color: #bebebe;
  color: #333;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.btn:hover { background-color: #999; }

.btn.gray { background-color: #bebebe; color: #333; }
.btn.gray:hover { background-color: #999; }

/* Sprachumschalter */
.language-toggle {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text);
}

.language-toggle input[type="radio"] {
  accent-color: var(--primary);
  cursor: pointer;
}

/* Keyvisual */
.keyvisual {
  grid-column: 2 / 12;
  grid-row: 11 / 34;
  display: flex;
  justify-content: center;
  align-items: center;
}

.keyvisual img {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  object-fit: cover; /* Fläche füllen, ohne Verzerrung */
}

/* jraduss-Grafik oben */
.jraduss-image {
  grid-column: 2 / 12;
  grid-row: 2 / 10;
  display: flex;
  justify-content: center;
  align-items: center;
}

.jraduss-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Box 1 */
.box1 {
  grid-column: 13 / 27;
  grid-row: 5 / 19;
  background-color: var(--secondary);
  border-radius: 12px; /* Abrundung sichtbar */
  z-index: 1;
}

.box1-image {
  grid-column: 13 / 18;
  grid-row: 5 / 19;
  background-image: url('/assets/images/1_kv.png');
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  z-index: 10;
}

.box1-logo {
  grid-column: 18 / 27;
  grid-row: 5 / 8;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.box1-logo img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain; /* Logo bleibt im Bereich */
}

.box1-title {
  grid-column: 18 / 27;
  grid-row: 9 / 11;
  text-align: center;
  font-size: 1.4rem;
  color: #000;
  margin: 0;
  align-self: center;
  z-index: 10;
}

.box1-subtitle {
  grid-column: 18 / 27;
  grid-row: 11 / 16;
  text-align: center;
  font-size: 1rem;
  margin: 0;
  align-self: center;
  z-index: 10;
}

.box1-button {
  grid-column: 21 / 27;
  grid-row: 16 / 18;
  justify-self: center;
  align-self: center;
  padding: 0.6rem 1.2rem;
  background-color: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  font-size: 1rem;
  z-index: 10;
}

/* Box 2 */
.box2 {
  grid-column: 13 / 27;
  grid-row: 20 / 34;
  background-color: var(--secondary);
  border-radius: 12px; /* Abrundung sichtbar */
  z-index: 1;
}

.box2-image {
  grid-column: 13 / 18;
  grid-row: 20 / 34;
  background-image: url('/assets/images/2_kv.png');
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  z-index: 10;
}

.box2-logo {
  grid-column: 18 / 27;
  grid-row: 20 / 23;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.box2-logo img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain; /* Logo bleibt im Bereich */
}

.box2-title {
  grid-column: 18 / 27;
  grid-row: 24 / 26;
  text-align: center;
  font-size: 1.4rem;
  color: #000;
  margin: 0;
  align-self: center;
  z-index: 10;
}

.box2-subtitle {
  grid-column: 18 / 27;
  grid-row: 26 / 31;
  text-align: center;
  font-size: 1rem;
  margin: 0;
  align-self: center;
  z-index: 10;
}

.box2-button {
  grid-column: 21 / 27;
  grid-row: 31 / 33;
  justify-self: center;
  align-self: center;
  padding: 0.6rem 1.2rem;
  background-color: #0077cc;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  font-size: 1rem;
  z-index: 10;
}

/* Projektboxen generisch (falls separat genutzt) */
.project-box {
  background-color: var(--secondary);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.project-box img {
  max-width: 80px;
  margin-bottom: 1rem;
}

.project-box h2 {
  font-size: 1.4rem;
  color: var(--primary);
  margin: 0.5rem 0;
}

.project-box p {
  font-style: italic;
  margin-bottom: 1rem;
  font-size: 1rem;
}

/* Carousel-Bereich */
.carousel-section {
  grid-column: 2 / 27;
  grid-row: 35 / 54;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  /* WICHTIG: nicht abschneiden, damit Pagination nicht beschnitten wird */
  overflow: visible;
}

/* Splide-Container */
.splide {
  position: relative;     /* Basis für absolute Pagination */
  width: 94%;
  max-width: 960px;
  height: 100%;
  padding-bottom: 32px;   /* Platz für Pagination unterhalb der Slides */
}

/* Slides */
.splide__slide {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  box-sizing: border-box;
}

/* Pfeile */
.splide__arrow {
  width: 36px;
  height: 36px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s ease;
  z-index: 10;
}

.splide__arrow:hover { background-color: var(--primary); }

.splide__arrow--prev { left: -1.6rem; }
.splide__arrow--next { right: -1.6rem; }

/* Kachel-Layout */
.carousel-card {
  width: 100%;
  max-width: 280px;
  height: 240px;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-radius: 12px;
  background-color: var(--secondary);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  margin: 0.5rem; /* Abstand zwischen Kacheln */
}

.carousel-card:hover { transform: scale(1.03); }

/* Bild + Titel oben */
.carousel-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

/* Bild */
.carousel-top img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

/* Titel */
.carousel-top h3 {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: 1.1rem;
  color: var(--primary);
  text-align: center;
}

/* Text unten */
.carousel-bottom {
  flex-grow: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  padding-top: 0.5rem;
}

.carousel-bottom p {
  margin: 0;
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.4;
}

/* Pagination – sicher im sichtbaren Bereich der Splide-Box */
.splide__pagination {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0 8px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.splide__pagination li { list-style: none; }

.splide__pagination button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ccc;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.splide__pagination button.is-active {
  background-color: var(--primary);
}