/* ══════════════════════════════════════════════ */
/* PCRR Custom CSS                               */
/* ══════════════════════════════════════════════ */


/* ── Globals ── */

html {
  /* clip statt hidden: beschneidet den 100vw-Overflow
     ohne position: sticky zu brechen */
  overflow-x: clip;
  font-size: 18px !important;
}

body {
  overflow-x: clip;
}


/* ── Sticky Header ── */

.wp-site-blocks > header,
header.wp-block-template-part {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #FAF7F4;
  box-shadow: 0 1px 4px rgba(44, 42, 53, 0.08);
  border-bottom: 1px solid #e6e2de;
  /* 100vw + neg. Margin bricht aus dem WP-Container aus */
  width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  margin-right: calc(-50vw + 50%) !important;
  padding: 0.6rem 2rem !important;
  box-sizing: border-box !important;
}

.alignfull,
.wp-block-group.alignfull {
  max-width: 100vw;
  overflow-x: clip;
}


/* ── Navigation ── */

.wp-block-navigation a {
  color: #2C2A35;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
}

.wp-block-navigation a:hover {
  color: #D17B48;
  background-color: rgba(209, 123, 72, 0.08);
}

/* Aktive Seite: Mehrere Selektoren nötig, da WP
   je nach Kontext unterschiedliche Klassen setzt */
.wp-block-navigation-item.current-menu-item > a,
.wp-block-navigation-item.current-menu-ancestor > a,
.wp-block-navigation a[aria-current="page"],
.wp-block-navigation-item.is-active > a {
  color: #D17B48 !important;
  font-weight: 600;
  text-decoration: underline !important;
  text-underline-offset: 6px !important;
  text-decoration-thickness: 2px !important;
  text-decoration-color: #D17B48 !important;
}

.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
  color: #2C2A35;
}

.wp-block-navigation__responsive-container.is-menu-open {
  background-color: rgba(250, 247, 244, 0.98);
  backdrop-filter: blur(12px);
}


/* ── Textgroessen ──
   WP-Editor setzt Inline-Styles mit leicht variierenden
   font-size-Werten (1.02/1.05/1.08rem). Diese Regeln
   normalisieren sie auf einheitliche Stufen. */

.wp-block-group p,
.entry-content p {
  font-size: 1rem !important;
  line-height: 1.7 !important;
}

p.has-text-color[style*="font-size:1.02rem"],
p.has-text-color[style*="font-size:1.05rem"],
p.has-text-color[style*="font-size:1.08rem"],
p.has-text-color[style*="font-size: 1.02rem"],
p.has-text-color[style*="font-size: 1.05rem"],
p.has-text-color[style*="font-size: 1.08rem"] {
  font-size: 1.05rem !important;
}

p.has-text-color[style*="font-size:1.1rem"],
p.has-text-color[style*="font-size:1.15rem"] {
  font-size: 1.1rem !important;
  line-height: 1.65 !important;
}

/* PCRR-Komponenten haben eigene Groessen –
   globale p-Regel oben darf sie nicht ueberschreiben */
.pcrr-pub-journal,
.pcrr-pub-year,
.pcrr-pub-license,
.pcrr-pub-cite-label,
.pcrr-team-title,
.pcrr-team-role,
.pcrr-team-link {
  font-size: revert !important;
  line-height: revert !important;
}


/* ── Footer ── */

.wp-block-template-part[data-type="footer"],
footer.wp-block-template-part {
  margin-top: 0;
}

/* A11Y FIX: Footer Copyright Kontrast
   #6e6a78 auf #2C2A35 war nur 2.68:1,
   #9b96a5 auf #2C2A35 ergibt 4.90:1 */
.wp-block-group[style*="background-color:#2C2A35"] > p[style*="font-size:0.8rem"] {
  color: #9b96a5 !important;
}


/* ── Home Hero: subtile Hintergrund-Radials ── */

.pcrr-home-hero {
  position: relative;
  overflow: hidden;
}

.pcrr-home-hero::before,
.pcrr-home-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.pcrr-home-hero::before {
  top: -20%;
  right: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(209, 123, 72, 0.06) 0%, transparent 65%);
}

.pcrr-home-hero::after {
  bottom: -15%;
  left: 10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(104, 120, 171, 0.04) 0%, transparent 60%);
}


/* ── SVG Cycle (Home): Ring + Nodes ── */

.pcrr-cycle-visual svg {
  overflow: visible;
}

.pcrr-ring-anim {
  animation: pcrr-ring-draw 2s ease-out 0.3s forwards;
}

@keyframes pcrr-ring-draw {
  to { stroke-dashoffset: 0; }
}

.pcrr-node {
  opacity: 0;
  animation: pcrr-node-appear 0.5s ease-out forwards;
}

.pcrr-node-1 { animation-delay: 0.6s; }
.pcrr-node-2 { animation-delay: 0.9s; }
.pcrr-node-3 { animation-delay: 1.2s; }
.pcrr-node-4 { animation-delay: 1.5s; }

@keyframes pcrr-node-appear {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.pcrr-node-group {
  cursor: default;
  transition: filter 0.3s ease;
}

.pcrr-node-group circle {
  transition: r 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

.pcrr-node-group:hover circle {
  r: 35;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
}

.pcrr-node-group text {
  transition: font-size 0.3s ease;
}

.pcrr-node-group:hover text:first-of-type { font-size: 15px; }
.pcrr-node-group:hover text:last-of-type  { font-size: 10px; }


/* ── Phase Cards (Home) + Link Cards ── */

.pcrr-phase-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pcrr-phase-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  transform: scaleX(0.3);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pcrr-phase-plan::before    { background: #D17B48; }
.pcrr-phase-create::before  { background: #4A9B7F; }
.pcrr-phase-review::before  { background: #C4574B; }
.pcrr-phase-reflect::before { background: #6878AB; }

.pcrr-phase-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(44, 42, 53, 0.1), 0 2px 6px rgba(44, 42, 53, 0.05);
}

.pcrr-phase-card:hover::before {
  transform: scaleX(1);
}

.pcrr-link-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pcrr-link-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(44, 42, 53, 0.08), 0 2px 6px rgba(44, 42, 53, 0.04);
}


/* ── Team Cards (Ueber uns) ──
   overflow: visible noetig, weil hidden die Card-Bodys
   bei schmalem 2-Spalten-Grid abschneidet.
   border-radius kommt stattdessen direkt aufs Foto. */

.pcrr-team-card {
  overflow: visible !important;
}

.pcrr-team-photo {
  border-radius: 14px 14px 0 0;
}

.pcrr-team-link {
  word-break: break-all !important;
  overflow-wrap: break-word !important;
}

@media (max-width: 900px) and (min-width: 561px) {
  .pcrr-team-body {
    padding: 1.2rem 1rem 1.5rem !important;
  }
  .pcrr-team-name {
    font-size: 1.1rem !important;
  }
  .pcrr-team-inst,
  .pcrr-team-role {
    font-size: 0.78rem !important;
  }
}


/* ── Publikationen: Lizenz-Badge ── */

.pcrr-pub-license {
  font-size: 0.68rem !important;
  padding: 0.15rem 0.5rem !important;
  margin-bottom: 0.8rem !important;
}

.pcrr-pub-license svg {
  width: 11px !important;
  height: 11px !important;
}

/* ── Publikationen: klappbarer Zitiervorschlag ── */

.pcrr-pub-cite-toggle {
  background: #FAF7F4;
  border: 1px solid #e6e2de;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.pcrr-pub-cite-toggle summary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #706b7a; /* A11Y FIX: war #9b96a5, auf #FAF7F4 nur 2.70:1 – jetzt 4.83:1 */
  padding: 0.7rem 1.1rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.2s;
}

.pcrr-pub-cite-toggle summary::-webkit-details-marker {
  display: none;
}

.pcrr-pub-cite-toggle summary::after {
  content: '▸';
  margin-left: auto;
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.pcrr-pub-cite-toggle[open] summary::after {
  transform: rotate(90deg);
}

.pcrr-pub-cite-toggle summary:hover {
  background: #F2EEEA;
}

.pcrr-pub-cite-toggle .pcrr-pub-cite-content {
  padding: 0 1.1rem 0.9rem;
  border-top: 1px solid #e6e2de;
}

.pcrr-pub-cite-toggle .pcrr-pub-cite-text {
  font-size: 0.85rem;
  color: #2C2A35;
  line-height: 1.6;
  word-break: break-word;
  padding-top: 0.7rem;
}

.pcrr-pub-cite-toggle .pcrr-pub-cite-text em {
  font-style: italic;
}

.pcrr-pub-cite-toggle .pcrr-pub-cite-text a {
  color: #a0612e; /* A11Y FIX: war #D17B48, auf #FAF7F4 nur 2.96:1 – jetzt 4.64:1 */
  text-decoration: none;
  border-bottom: 1px solid rgba(160, 97, 46, 0.3);
  transition: border-color 0.2s, color 0.2s;
}

.pcrr-pub-cite-toggle .pcrr-pub-cite-text a:hover {
  color: #8b4e22; /* A11Y FIX: angepasster Hover-Wert */
  border-bottom-color: #8b4e22;
}

.pcrr-pub-cite-toggle .pcrr-cite-copy {
  position: relative;
  top: auto;
  right: auto;
  margin-top: 0.6rem;
  width: fit-content;
  background: #ffffff;
  border: 1px solid #e6e2de;
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: #706b7a; /* A11Y FIX: war #9b96a5, auf #fff nur 2.70:1 – jetzt 5.16:1 */
  transition: all 0.2s;
}

.pcrr-pub-cite-toggle .pcrr-cite-copy:hover {
  background: #F2EEEA;
  color: #6e6a78;
  border-color: #9b96a5;
}

.pcrr-pub-cite-toggle .pcrr-cite-copy svg {
  width: 12px;
  height: 12px;
}

@media (max-width: 640px) {
  .pcrr-pub-cite-toggle summary {
    padding: 0.6rem 0.9rem;
  }
  .pcrr-pub-cite-toggle .pcrr-pub-cite-content {
    padding: 0 0.9rem 0.7rem;
  }
}


/* ── Footer Newsletter (Brevo) ──
   Selektoren via [style*=] noetig, weil der Brevo-Block
   im dunklen Footer-Wrapper sitzt und WP keine eigene
   Klasse dafuer vergibt. */

.wp-block-group[style*="background-color:#2C2A35"] .sib-form,
.wp-block-group[style*="background-color:#2C2A35"] .sib-form-container,
.wp-block-group[style*="background-color:#2C2A35"] form,
.wp-block-group[style*="background-color:#2C2A35"] form > div {
  margin: 0 auto !important;
  padding: 0 !important;
  max-width: 600px !important;
  text-align: center !important;
}

.wp-block-group[style*="background-color:#2C2A35"] .sib-form p {
  margin: 6px 0 0 !important;
  text-align: center !important;
}

.wp-block-group[style*="background-color:#2C2A35"] .sib-email-area {
  color: rgba(250, 247, 244, 0.8) !important;
  font-size: 0.85rem !important;
}

.wp-block-group[style*="background-color:#2C2A35"] p[style*="font-size:0.85em"],
.wp-block-group[style*="background-color:#2C2A35"] p[style*="font-size: 0.85em"] {
  color: #9b96a5 !important; /* A11Y FIX: war rgba(250, 247, 244, 0.4), nur 3.41:1 – jetzt 4.90:1 */
  font-size: 0.72rem !important;
  line-height: 1.5 !important;
}

.wp-block-group[style*="background-color:#2C2A35"] p[style*="font-size:0.85em"] a,
.wp-block-group[style*="background-color:#2C2A35"] p[style*="font-size: 0.85em"] a {
  color: rgba(250, 247, 244, 0.7) !important; /* A11Y FIX: war 0.55, nur ~3.8:1 – jetzt ~6.5:1 */
}

.wp-block-group[style*="background-color:#2C2A35"] .sib-form-message-panel {
  color: #4A9B7F !important;
  font-size: 0.85rem !important;
}

.wp-block-group[style*="background-color:#2C2A35"] a[style*="color:#9b96a5"]:hover {
  color: #FAF7F4 !important;
}


/* ── Globale Overflow-Sicherheit ──
   Verhindert, dass lange Woerter oder URLs
   aus ihren Containern herausragen. */

.wp-block-group,
.wp-block-column,
.wp-block-cover__inner-container {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

a {
  overflow-wrap: break-word;
}

/* Nav-Links sollen nicht umbrechen */
.wp-block-navigation a {
  word-break: normal;
  overflow-wrap: normal;
}


/* ══════════════════════════════════════════════ */
/* RESPONSIVE                                    */
/* ══════════════════════════════════════════════ */

/* ── Ab 1024px: Hamburger statt horizontale Nav ──
   WP zeigt den Hamburger standardmaessig erst bei ~600px.
   Hier erzwingen wir ihn frueher, damit die Nav bei
   schmaleren Fenstern nicht umbricht.
   is-menu-open wird von WP auf __responsive-container gesetzt. */

@media (max-width: 1024px) {

  .site-header .wp-block-site-tagline {
    display: none !important;
  }

  .site-header .wp-block-site-title {
    font-size: 1.1rem !important;
    line-height: 1.3 !important;
  }

  .wp-site-blocks > header,
  header.wp-block-template-part {
    padding: 0.5rem 1.2rem !important;
  }

  /* Nav-Items verstecken wenn Overlay geschlossen */
  .wp-block-navigation__responsive-container:not(.is-menu-open)
  .wp-block-navigation__container {
    display: none !important;
  }

  .wp-block-navigation__responsive-container-open {
    display: flex !important;
    align-items: center;
    padding: 0.25rem;
    color: #2C2A35 !important;
  }

  /* Overlay: Fullscreen mit Blur */
  .wp-block-navigation__responsive-container.is-menu-open {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
    display: flex !important;
    background-color: rgba(250, 247, 244, 0.98) !important;
    backdrop-filter: blur(12px) !important;
  }

  .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation__responsive-container-close {
    display: flex !important;
    position: absolute !important;
    top: 1rem !important;
    right: 1.5rem !important;
    color: #2C2A35 !important;
    z-index: 10000 !important;
  }

  .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation__responsive-container-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    padding: 3rem 2rem !important;
  }

  .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation__container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.5rem !important;
  }

  .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation__container a {
    font-size: 1.15rem !important;
    padding: 0.7rem 1.5rem !important;
  }
}

@media (min-width: 782px) and (max-width: 1024px) {
  .pcrr-cycle-visual svg {
    max-width: 240px;
  }
}


/* ── Mobile (< 782px) ── */

@media (max-width: 781px) {

  .wp-site-blocks > header,
  header.wp-block-template-part {
    position: sticky !important;
    top: 0 !important;
    z-index: 1100 !important;
    padding: 0.4rem 1rem !important;
    background-color: #FAF7F4 !important;
  }

  .site-header .wp-block-site-title {
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
  }

  .site-header .wp-block-site-logo img {
    max-width: 40px !important;
    height: auto !important;
  }

  .pcrr-cycle-visual {
    display: none;
  }

  .pcrr-home-hero .wp-block-columns {
    flex-direction: column;
  }

  .pcrr-home-hero .wp-block-column[style*="flex-basis:58%"] {
    flex-basis: 100% !important;
  }

  .pcrr-home-hero h1 {
    font-size: 2rem !important;
  }

  /* Hero-Banner Unterseiten */
  .wp-block-group.alignfull[style*="background-color:#2C2A35"] {
    padding-top: 2.5rem !important;
    padding-bottom: 2rem !important;
    padding-left: 1.2rem !important;
    padding-right: 1.2rem !important;
  }

  .wp-block-group.alignfull[style*="background-color:#2C2A35"] h1 {
    font-size: 1.6rem !important;
    word-break: break-word !important;
    hyphens: auto !important;
  }

  .wp-block-columns {
    flex-direction: column !important;
  }

  .wp-block-column {
    flex-basis: 100% !important;
    width: 100% !important;
  }

  /* Padding reduzieren – Selektoren via [style*=] noetig,
     weil WP Inline-Styles setzt die sonst gewinnen */
  .wp-block-group[style*="padding-left:2.5rem"],
  .wp-block-group[style*="padding-left: 2.5rem"] {
    padding-left: 1.2rem !important;
    padding-right: 1.2rem !important;
  }

  .wp-block-group[style*="padding-left:1.5rem"],
  .wp-block-group[style*="padding-left: 1.5rem"] {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .wp-block-group.alignfull[style*="padding-left:2rem"],
  .wp-block-group.alignfull[style*="padding-left: 2rem"] {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .wp-block-group h2,
  .wp-block-group h3,
  .wp-block-cover__inner-container h2,
  .wp-block-cover__inner-container h3 {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }

  .wp-block-group[style*="background-color:#2C2A35"] h2 {
    font-size: 1.4rem !important;
  }

  .wp-block-cover {
    min-height: auto !important;
    overflow: visible !important;
  }

  .wp-block-cover__inner-container {
    padding: 1.5rem 1.2rem !important;
  }

  .wp-block-group[style*="background-color:#2C2A35"] .wp-block-button__link {
    width: 100%;
    text-align: center;
  }
}