/* ============================================
   Wissen / Publikationen
   - Liste: Hero im Team-Stil + Cards mit Border-Radius / Fill
   - Detail: Embedded PDF-Viewer + Download
   ============================================ */

/* --- Page container --- */
.wissen-page,
.publikation-page {
  margin: 0 auto;
  padding: 0 0 4rem;
  position: relative;
}

.wissen-page.main-content,
.publikation-page.main-content {
  position: relative;
  overflow-x: clip;
}

/* Plants like the default template, just thinned out:
   keep the 4 main plants, hide repeated extras + the footer-minze duplicate. */
body[data-template="wissen"] .parallax-plant--extra,
body[data-template="wissen"] .parallax-plant--footer-minze,
body[data-template="publikation"] .parallax-plant--extra,
body[data-template="publikation"] .parallax-plant--footer-minze {
  display: none !important;
}

body[data-template="wissen"] main.wissen-page,
body[data-template="publikation"] main.publikation-page {
  position: relative;
  z-index: 1;
  background-color: transparent;
}

/* --- Hero (shared between Wissen-Liste + Publikation-Detail) --- */
/* Padding/sizing identical to Herbarium hero so the yellow circle stays
   tucked behind the header without clipping into the content below. */
.wissen-header,
.publikation-header {
  position: relative;
  text-align: left;
  padding: var(--page-header-padding);
  margin-bottom: clamp(2rem, 5vw, 4rem);
  overflow: hidden;
}

.wissen-header__inner,
.publikation-header__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--page-header-gap);
  padding-left: clamp(1.25rem, 4vw, 3rem) !important;
  padding-right: clamp(1.25rem, 4vw, 3rem) !important;
}

.wissen-label,
.publikation-category {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-heading);
  font-size: var(--page-label-size);
  font-weight: normal;
  letter-spacing: var(--page-label-tracking);
  text-transform: uppercase;
  color: var(--page-label-color);
}

.wissen-title,
.publikation-title {
  margin: 0;
  max-width: 14ch;
  font-family: var(--font-heading);
  font-size: var(--page-title-size);
  font-weight: normal;
  line-height: var(--page-title-leading);
  letter-spacing: var(--page-title-tracking);
  text-transform: uppercase;
}

.wissen-header__rule,
.publikation-header__rule {
  display: block;
  width: var(--page-rule-width);
  height: 2px;
  background: var(--fill-0, #000);
}

.wissen-intro,
.publikation-description {
  max-width: 60ch;
  margin: 0;
  font-family: var(--font-text);
  font-size: var(--text-body);
  line-height: 1.7;
  color: rgba(0, 0, 0, 0.78);
}

/* Yellow circle behind hero — identical placement to Team page */
.wissen-header__circle,
.publikation-header__circle {
  position: absolute;
  top: clamp(-9rem, -9vw, -4rem);
  left: clamp(-14rem, -12vw, -6rem);
  width: clamp(18rem, 34vw, 32rem);
  height: clamp(18rem, 34vw, 32rem);
  background: #d6df70;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}

@media (max-width: 720px) {
  .wissen-header,
  .publikation-header {
    padding-top: clamp(2rem, 7vw, 3.5rem);
    padding-bottom: clamp(2rem, 5vw, 3.5rem);
  }
  .wissen-title,
  .publikation-title {
    font-size: var(--page-title-size-sm);
    max-width: 100%;
    line-height: 1;
  }
}

/* --- Wissen Liste: card grid --- */
.wissen-grid-section {
  width: 95%;
  max-width: clamp(1100px, 75vw, 1800px);
  margin: 0 auto;
  padding-left: clamp(1.25rem, 4vw, 3rem);
  padding-right: clamp(1.25rem, 4vw, 3rem);
}

.wissen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(1.25rem, 2vw, 2rem);
}

.wissen-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: var(--color-black);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 220ms ease,
              border-color 220ms ease;
}

.wissen-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.18);
}

.wissen-card-image {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #f5f0e6;
  overflow: hidden;
}

.wissen-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wissen-card-image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 2.6rem;
  letter-spacing: 0.1em;
  color: rgba(0, 0, 0, 0.18);
  background: linear-gradient(135deg, #f5f0e6 0%, #e8dfc9 100%);
}

/* PDF.js-rendered first-page preview — fades in once rendered */
.wissen-card-pdf-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #fff;
  opacity: 0;
  transition: opacity 240ms ease;
  object-fit: cover;
  z-index: 1;
}

.wissen-card-pdf-canvas.is-rendered {
  opacity: 1;
}

.wissen-card-body {
  padding: 1.25rem 1.5rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.wissen-card-category {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.55);
}

.wissen-card-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  line-height: 1.15;
  text-transform: uppercase;
  margin: 0;
  letter-spacing: -0.01em;
}

.wissen-card-date {
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.5);
}

.wissen-card-desc {
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0.3rem 0 0;
  color: rgba(0, 0, 0, 0.7);
}

.wissen-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 1rem;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.wissen-card-cta svg {
  transition: transform 200ms ease;
}

.wissen-card:hover .wissen-card-cta svg {
  transform: translateX(3px);
}

/* --- Publikation-Detail --- */
.publikation-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  font-size: 0.85rem;
  text-decoration: none;
  color: rgba(0, 0, 0, 0.7);
  padding-bottom: 0.5rem;
  transition: color 150ms ease;
}

.publikation-back:hover {
  color: var(--color-black);
}

.publikation-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.publikation-date {
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.55);
}

.publikation-author {
  margin: 0;
  font-size: 0.95rem;
  font-style: italic;
  color: rgba(0, 0, 0, 0.7);
}

.publikation-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  align-self: flex-start;
  margin-top: 0.5rem;
  padding: 0.75rem 1.4rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  background: var(--color-black);
  border-radius: 999px;
  transition: background 180ms ease, transform 180ms ease;
}

.publikation-download-btn:hover {
  background: #1f3a1f;
  transform: translateY(-1px);
}

/* --- Embedded PDF viewer --- */
.publikation-viewer-section {
  width: 95%;
  max-width: clamp(1000px, 70vw, 1600px);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
}

.publikation-viewer {
  position: relative;
  width: 100%;
  height: clamp(600px, 80vh, 1100px);
  background: #2a2a2a;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.publikation-viewer-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.publikation-viewer-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  background: #fff;
  text-align: center;
}

.publikation-viewer-fallback img {
  max-width: 220px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.publikation-viewer-fallback p {
  margin: 0;
  max-width: 32ch;
  color: rgba(0, 0, 0, 0.7);
  line-height: 1.5;
}

@media (max-width: 720px) {
  .publikation-viewer {
    height: 75vh;
    min-height: 480px;
    border-radius: 12px;
  }
}
