/* ===========================
   Hintergrund & Grundlayout
   =========================== */

body.texts-page {
  background:
    radial-gradient(circle at 0% 0%, #1a1018 0, #050509 55%) fixed,
    radial-gradient(circle at 100% 100%, #101622 0, #050509 55%) fixed,
    #050509;
  color: #f4f0f4;
  animation: texts-bg-shift 40s ease-in-out infinite alternate;
}

@keyframes texts-bg-shift {
  0% {
    background-position: 0% 0%, 100% 100%;
  }
  100% {
    background-position: 20% 10%, 80% 90%;
  }
}

.texts-page .cursor-glow {
  opacity: 0.22;
  transform: scale(0.7);
}

.texts-page .cursor-glow-mask {
  mix-blend-mode: screen;
}

.cursor-glow-mask {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  -webkit-mask-image: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 1) 45%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  -webkit-mask-mode: alpha;
  mask-image: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 255, 255, 1) 45%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  mask-mode: alpha;
}

.section {
  scroll-margin-top: 80px;
}

.section-texts {
  padding-top: 4.5rem;
  padding-bottom: 4rem;
  background: transparent;
}

.section-texts .container {
  max-width: 1200px;
  width: 92vw;
}

.texts-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ===========================
   Sortierung
   =========================== */

.texts-controls-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.texts-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(240, 235, 240, 0.75);
}

.texts-sort-label {
  color: #fff;
  white-space: nowrap;
}

.texts-sort-select-wrapper {
  position: relative;
}

.texts-sort-select-wrapper::after {
  content: "▾";
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  pointer-events: none;
  color: #fff;
  opacity: 0.6;
}

#texts-sort-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-radius: 999px;
  border: 1px solid #fff;
  background: #000;
  color: #f5f2ee;
  padding: 0.35rem 1.8rem 0.35rem 0.8rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

/* ===========================
   Filmstreifen
   =========================== */

.texts-strip-wrapper {
  position: relative;
  padding: 0.4rem 0 0.8rem;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin-top: 0.4rem;
  margin-bottom: 0.1rem;
}

.texts-strip-wrapper::before,
.texts-strip-wrapper::after {
  content: "";
  position: sticky;
  top: 0;
  width: 24px;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.texts-strip-wrapper::before {
  left: 0;
  background: linear-gradient(
    to right,
    rgba(5, 5, 10, 0.95),
    transparent
  );
}

.texts-strip-wrapper::after {
  right: 0;
  background: linear-gradient(
    to left,
    rgba(5, 5, 10, 0.95),
    transparent
  );
}

.texts-strip {
  display: inline-flex;
  gap: 0.9rem;
  padding: 0 1.2rem;
  min-height: 118px;
}

.texts-strip-wrapper::-webkit-scrollbar {
  height: 6px;
  background: transparent;
}

.texts-strip-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
}

.texts-strip-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

.texts-strip-wrapper {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.texts-strip-hint {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 0.4rem;
  margin-bottom: 0.2rem;
  opacity: 0.9;
  text-align: center;
}

.texts-strip-hint-icon {
  font-size: 1.35rem;
  line-height: 1;
  opacity: 0.7;
  margin-bottom: 0.15rem;
}

.texts-strip-hint-text {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(240, 235, 245, 0.65);
}

/* ===========================
   Filmstreifen-Karten
   =========================== */

.texts-placeholder {
  font-size: 0.9rem;
  color: #111015;
  opacity: 0.6;
  padding: 0.6rem 0.2rem;
  white-space: nowrap;
}

.text-card {
  min-width: 220px;
  max-width: 260px;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(245, 242, 238, 0.16);
  background:
    radial-gradient(
      circle at 0 0,
      rgba(224, 50, 50, 0.18),
      transparent 55%
    ),
    radial-gradient(
      circle at 100% 100%,
      rgba(255, 118, 170, 0.16),
      transparent 65%
    ),
    rgba(7, 6, 10, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65);
  color: #f4f0f4;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.text-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.85);
  border-color: rgba(248, 230, 236, 0.65);
}

.text-card.is-selected {
  border-color: var(--accent-strong, #ff3344);
  box-shadow:
    0 0 0 1px rgba(255, 51, 68, 0.65),
    0 18px 46px rgba(0, 0, 0, 0.95);
}

.text-card-issue {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #b5aebf;
  margin-bottom: 0.15rem;
}

.text-card-issue span {
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(245, 242, 238, 0.4);
  background: rgba(7, 6, 10, 0.9);
}

.text-card-title {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
  font-weight: 600;
  color: #f8f5f1;
}

.text-card-author {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b5aebf;
}

.text-card-meta {
  margin: 0.1rem 0 0;
  font-size: 0.75rem;
  color: rgba(220, 210, 220, 0.7);
}

/* ===========================
   Reader als „Blatt Papier“
   =========================== */

.text-viewer {
  position: relative;
  border-radius: 2px;
  background: #f7f5f3;
  color: #111015;
  border: 1px solid rgba(230, 226, 220, 0.9);
  padding: 3.2rem 2.4rem 2.1rem;
  box-shadow:
    0 22px 60px rgba(0, 0, 0, 0.35),
    0 8px 20px rgba(0, 0, 0, 0.18);
  overflow: visible;
  font-family: "Lora", "Times New Roman", serif;
}

.text-viewer::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: #faf8f6;
  z-index: -1;
  transform: translate(6px, 6px);
  border: 1px solid rgba(240, 237, 232, 0.7);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.text-viewer::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3' stitchTiles='noStitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.text-viewer-inner {
  max-width: 60ch;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.text-viewer-header {
  margin-top: 0.6rem;
  position: relative;
  z-index: 1;
}

.text-viewer-issue {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #7f7265;
  margin: 0 0 0.4rem;
}

.text-viewer-title {
  font-size: 1.35rem;
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-family: "Lora", "Times New Roman", serif;
  color: #111015;
}

.text-viewer-meta,
.text-viewer-tags {
  font-size: 0.86rem;
  color: #6a5c52;
  margin: 0.1rem 0;
}

.text-viewer-tags strong {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
}

/* ===========================
   Reader-Inhalt & Paging
   =========================== */

.text-viewer-body {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
  line-height: 1.75;
  font-size: 0.97rem;
  max-width: 100%;
  overflow: visible;
  font-family: "Lora", serif;
  text-rendering: optimizeLegibility;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.text-viewer-body p {
  margin: 0 0 1rem;
}

.text-viewer-body p:last-child {
  margin-bottom: 0;
}

.text-viewer-body.align-justify {
  text-align: justify;
  hyphens: auto;
}

.text-viewer-body.align-left {
  text-align: left;
}

.text-viewer-body.is-prose p + p {
  text-indent: 1.15em;
}

.text-viewer-body.is-poem .poem-text {
  text-indent: 0;
  white-space: normal;
  letter-spacing: 0.01em;
}

.text-viewer-links {
  margin-top: 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.text-viewer-pagination {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #6a5c52;
}

.text-page-btn {
  border: 1px solid rgba(17, 16, 21, 0.18);
  background: rgba(247, 245, 243, 0.9);
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.text-page-btn:hover:not(:disabled) {
  background: #f0ece7;
  transform: translateY(-1px);
  border-color: rgba(17, 16, 21, 0.32);
}

.text-page-btn:disabled {
  opacity: 0.3;
  cursor: default;
  transform: none;
}

.text-page-indicator {
  display: inline-block;
  min-width: 4.8rem;
  padding: 0 0.2rem;
  text-align: center;
  letter-spacing: 0.08em;
}

.text-viewer-body.page-forward {
  animation: pageSlideForward 0.22s ease;
}

.text-viewer-body.page-back {
  animation: pageSlideBack 0.22s ease;
}

@keyframes pageSlideForward {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pageSlideBack {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.text-viewer-close {
  display: none !important;
}

/* ===========================
   Header-Logo-Layout
   =========================== */

.site-header .logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  text-decoration: none;
  color: inherit;
}

.site-header .logo-text {
  font-weight: 800;
  letter-spacing: 0.3em;
  font-size: 1.5rem;
  text-transform: uppercase;
}

.site-header .logo-mark {
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 0.92rem;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.site-header {
  width: 100%;
}

.site-header .container.header-inner {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 1.3rem;
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 900px) {
  .section-texts .container {
    width: 94vw;
  }

  .texts-strip-wrapper {
    padding: 0.7rem 0.7rem 0.9rem;
  }

  .texts-strip-hint {
    display: flex;
  }

  .text-card {
    min-width: 190px;
  }

  .text-viewer {
    padding: 2.4rem 1.4rem 1.8rem;
  }

  .texts-controls-row {
    justify-content: center;
    margin-top: 0.6rem;
    margin-bottom: 0.3rem;
  }

  .text-viewer-inner {
    max-width: 100%;
  }

  .texts-sort {
    justify-content: center;
    text-align: center;
  }

  #texts-sort-select {
    text-align-last: center;
  }
}

@media (max-width: 600px) {
  .texts-controls-row {
    justify-content: flex-start;
  }

  .texts-sort {
    font-size: 0.75rem;
  }

  .text-viewer-title {
    font-size: 1.1rem;
  }

  .text-viewer-body {
    font-size: 0.94rem;
  }
}
