/**
 * Feuerrohre: Verlauf durchs Wort (fixed) + eine Flamme pro Buchstabe, bündig oben am Glyphenkasten.
 */

.fire-page-h1 .fire-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.12em 0.35em;
}

.fire-h1-suffix {
  font-size: clamp(0.85rem, 2.1vw, 1.35rem);
  font-weight: 500;
  font-family: "Playfair Display", serif;
  letter-spacing: 0.04em;
  color: #2f271f;
  line-height: 1.25;
  max-width: 22em;
}

/* Fließtext & Abschnitte (Feuerrohre) */
.feuerrohre-main .sub-header {
  margin-bottom: 0.5rem;
}

.feuerrohre-main .feuerrohre-lead {
  max-width: 62ch;
  margin-top: 0.75rem;
  font-size: clamp(1.02rem, 1.35vw, 1.15rem);
  line-height: 1.7;
  color: #3d362c;
  letter-spacing: 0.01em;
}

.feuerrohre-prose {
  padding-bottom: 0.5rem;
}

.feuerrohre-prose .feuerrohre-section + .feuerrohre-section {
  margin-top: 0.25rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(47, 39, 31, 0.1);
}

.feuerrohre-main .feuerrohre-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 4rem) 1.75rem;
  padding-left: max(1.5rem, calc(var(--space, 1.5rem) * 1.5));
  padding-right: max(1.5rem, calc(var(--space, 1.5rem) * 1.5));
}

.feuerrohre-main .feuerrohre-section h2 {
  margin: 0 0 0.85em;
  padding-bottom: 0.35em;
  font-family: "Playfair Display", serif;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  font-weight: 600;
  color: #2a221a;
  letter-spacing: 0.02em;
  border-bottom: 1px solid rgba(156, 132, 104, 0.28);
  max-width: 68ch;
}

.feuerrohre-main .feuerrohre-section h3 {
  margin: 1.35em 0 0.55em;
  padding-left: 0.65rem;
  border-left: 3px solid rgba(156, 132, 104, 0.65);
  font-family: "Playfair Display", serif;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  font-weight: 600;
  color: #3d3329;
  line-height: 1.35;
}

.feuerrohre-main .feuerrohre-section p {
  margin: 0 0 1.05em;
  line-height: 1.72;
  color: #3a3328;
  max-width: 68ch;
  text-wrap: pretty;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.feuerrohre-main .feuerrohre-section p:last-child {
  margin-bottom: 0;
}

.feuerrohre-main .feuerrohre-section strong {
  font-weight: 600;
  color: #241c15;
}

/* Tab-Leiste: Auftragsarbeiten / Einsatzbereiche */
.feuerrohre-topic-tabs .feuerrohre-tabs-heading {
  margin: 0 0 0.6em;
  padding-bottom: 0;
  max-width: none;
  border-bottom: none;
  font-family: "Playfair Display", serif;
  font-size: clamp(1.12rem, 2.2vw, 1.45rem);
  font-weight: 600;
  color: #2a221a;
  letter-spacing: 0.02em;
}

/* Tabs + Panels: zweispaltig, Text rollt unter dem jeweiligen Button */
.feuerrohre-tabs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(0.65rem, 2.5vw, 1.35rem);
  row-gap: 0.45rem;
  align-items: start;
  width: 100%;
}

.feuerrohre-tabs-grid .feuerrohre-tabbar {
  display: contents;
}

/* Reihenfolge Desktop: Zeile 1 = beide Tabs, Zeile 2 = Panels jeweils darunter */
#tab-auftrag {
  grid-column: 1;
  grid-row: 1;
}

#tab-einsatz {
  grid-column: 2;
  grid-row: 1;
}

#panel-auftrag {
  grid-column: 1;
  grid-row: 2;
}

#panel-einsatz {
  grid-column: 2;
  grid-row: 2;
}

@media (max-width: 700px) {
  .feuerrohre-tabs-grid {
    grid-template-columns: 1fr;
  }

  #tab-auftrag {
    grid-column: 1;
    grid-row: 1;
  }

  #panel-auftrag {
    grid-column: 1;
    grid-row: 2;
  }

  #tab-einsatz {
    grid-column: 1;
    grid-row: 3;
  }

  #panel-einsatz {
    grid-column: 1;
    grid-row: 4;
  }
}

.feuerrohre-tabbar {
  margin-bottom: 0;
}

.feuerrohre-tab {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.78em 1.35em;
  font-family: "Playfair Display", serif;
  font-size: clamp(0.78rem, 1.35vw, 0.9rem);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: #352a22;
  cursor: pointer;
  border-radius: 11px;
  border: 1px solid rgba(115, 90, 64, 0.38);
  background: linear-gradient(168deg, #fdfbf7 0%, #efe8dd 42%, #e0d4c4 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(115, 90, 64, 0.06),
    0 2px 10px rgba(47, 39, 31, 0.07);
  transition:
    border-color 0.28s ease,
    box-shadow 0.32s ease,
    color 0.22s ease,
    transform 0.22s ease;
}

.feuerrohre-tab::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, transparent 48%);
  transition: opacity 0.35s ease;
}

.feuerrohre-tab:hover {
  border-color: rgba(156, 132, 104, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 4px 16px rgba(156, 132, 104, 0.14);
  transform: translateY(-1px);
}

.feuerrohre-tab:hover::after {
  opacity: 0.55;
}

.feuerrohre-tab[aria-selected="true"] {
  color: #140e09;
  border-color: rgba(156, 132, 104, 0.92);
  background: linear-gradient(168deg, #fffefb 0%, #f7efe4 38%, #ead8c4 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 6px rgba(156, 132, 104, 0.08),
    0 6px 22px rgba(156, 132, 104, 0.22),
    0 1px 0 rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

.feuerrohre-tab[aria-selected="true"]::after {
  opacity: 0.75;
}

.feuerrohre-tab:active {
  transform: translateY(0);
}

.feuerrohre-tab:focus-visible {
  outline: 2px solid #8a6f52;
  outline-offset: 3px;
}

/* Sanftes Aufrollen (Grid 0fr → 1fr) */
.feuerrohre-tabpanel {
  max-width: none;
  min-width: 0;
}

.feuerrohre-tabpanel.is-closed {
  margin-top: 0;
  padding-top: 0;
}

.feuerrohre-tabpanel.is-open {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(156, 132, 104, 0.28);
}

.feuerrohre-tabpanel-roll {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.58s cubic-bezier(0.33, 0.82, 0.32, 1);
}

.feuerrohre-tabpanel.is-open .feuerrohre-tabpanel-roll {
  grid-template-rows: 1fr;
}

.feuerrohre-tabpanel-inner {
  min-height: 0;
  overflow: hidden;
  opacity: 0.94;
  transition: opacity 0.42s ease 0.06s;
}

.feuerrohre-tabpanel.is-open .feuerrohre-tabpanel-inner {
  opacity: 1;
}

.feuerrohre-tabpanel.is-closed .feuerrohre-tabpanel-inner {
  transition: opacity 0.22s ease;
}

@media (prefers-reduced-motion: reduce) {
  .feuerrohre-tabpanel-roll {
    transition-duration: 0.01ms !important;
  }

  .feuerrohre-tabpanel-inner {
    transition: none;
  }

  .feuerrohre-tab {
    transition: none;
  }

  .feuerrohre-tab:hover,
  .feuerrohre-tab[aria-selected="true"] {
    transform: none;
  }
}

.feuerrohre-topic-tabs.feuerrohre-section {
  padding-bottom: 1rem;
}

.feuerrohre-main .feuerrohre-section a {
  color: #6d543e;
  border-bottom: 1px solid rgba(156, 132, 104, 0.45);
  text-decoration: none;
}

.feuerrohre-main .feuerrohre-section a:hover {
  border-bottom-color: #9c8468;
}

.feuerrohre-gallery-lead {
  margin-bottom: 0.9rem !important;
  font-size: 0.98rem !important;
  line-height: 1.65 !important;
  color: #4b4339 !important;
  font-style: italic;
}

.feuerrohre-gallery-wrap .art-grid {
  padding-top: 0.5rem;
}

.fire-title-wrap {
  display: inline-block;
  overflow: visible;
}

.fire-title-text {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  letter-spacing: inherit;
}

.fire-letter {
  position: relative;
  display: inline-block;
  line-height: 1;
}

/* Flamme: unten bündig mit der Oberkante des jeweiligen Buchstabens (kein Abstand) */
.fire-spark {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 100%;
  width: 0.2em;
  min-width: 6px;
  max-width: 12px;
  height: 0.45em;
  margin: 0;
  padding: 0;
  pointer-events: none;
  transform-origin: 50% 100%;
  border-radius: 50% 50% 45% 55% / 72% 72% 32% 28%;
  background: linear-gradient(
    to top,
    #c01808 0%,
    #ff5010 38%,
    #ffb028 68%,
    rgba(255, 248, 200, 0.85) 92%,
    rgba(255, 255, 255, 0.45) 100%
  );
  box-shadow:
    0 0 4px rgba(255, 130, 40, 0.75),
    0 0 10px rgba(255, 80, 0, 0.35);
  mix-blend-mode: screen;
  opacity: 0.88;
  animation: feuer-funkeln 0.72s ease-in-out infinite alternate;
}

.fire-letter:nth-child(3n + 1) .fire-spark {
  animation-duration: 0.64s;
  animation-delay: 0s;
  height: 0.4em;
}

.fire-letter:nth-child(3n + 2) .fire-spark {
  animation-duration: 0.78s;
  animation-delay: -0.18s;
  height: 0.5em;
}

.fire-letter:nth-child(3n) .fire-spark {
  animation-duration: 0.7s;
  animation-delay: -0.32s;
  height: 0.43em;
}

@keyframes feuer-funkeln {
  0% {
    transform: translate(-50%, 0) scaleY(0.82) scaleX(1.05);
    opacity: 0.72;
    filter: brightness(0.9);
  }
  100% {
    transform: translate(-50%, -2px) scaleY(1.12) scaleX(0.95);
    opacity: 1;
    filter: brightness(1.18);
  }
}

/* Gleicher laufender Verlauf im ganzen Wort dank background-attachment: fixed */
.fire-letter-char {
  display: inline-block;
  position: relative;
  z-index: 1;
  font: inherit;
  letter-spacing: inherit;
  color: transparent;
  -webkit-text-stroke: 0.45px rgba(90, 35, 18, 0.55);
  background-image: repeating-linear-gradient(
    90deg,
    #1a0403 0px,
    #3a0805 20px,
    #6a1008 44px,
    #9c180c 72px,
    #cc200e 100px,
    #f03810 128px,
    #ff6816 152px,
    #ffa01e 174px,
    #ffd060 198px,
    #fff3d0 218px,
    #fffefb 232px,
    #ffffff 242px,
    #fffefb 252px,
    #fff3d0 264px,
    #ffd060 282px,
    #ffa01e 306px,
    #ff6816 332px,
    #f03810 360px,
    #cc200e 388px,
    #9c180c 414px,
    #6a1008 438px,
    #3a0805 458px,
    #1a0403 480px,
    #1a0403 500px
  );
  background-size: 500px 100%;
  background-position: 0 50%;
  background-repeat: repeat;
  background-attachment: fixed;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 2px rgba(255, 230, 160, 0.75)) drop-shadow(0 0 10px rgba(255, 140, 40, 0.45))
    drop-shadow(0 0 22px rgba(255, 70, 0, 0.28));
  animation: feuer-fluss 9s linear infinite;
}

@keyframes feuer-fluss {
  from {
    background-position: 0 50%;
  }
  to {
    background-position: 500px 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fire-spark {
    animation: none;
    transform: translate(-50%, -1px) scaleY(1);
    opacity: 0.88;
    filter: none;
  }

  .fire-letter-char {
    animation: none;
    background-position: 0 50%;
    filter: drop-shadow(0 0 2px rgba(255, 230, 160, 0.75)) drop-shadow(0 0 10px rgba(255, 140, 40, 0.45))
      drop-shadow(0 0 22px rgba(255, 70, 0, 0.28));
  }
}
