/* ============================================================
   Platin-Profilseite, Nachweise: Urkunden als Zeitleiste mit
   verkleinertem Bild, Jahr, Titel und Angaben, dazu der Dialog
   mit der großen Fassung (partials/expert-platin-credentials.php,
   js/expert-credentials.js). Präfix xp-cred.
   ============================================================ */

.xp-creds { margin-block: 1.6rem 0.4rem; }
.xp-creds-list { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 1rem; }
/* Die Zeitleiste: eine feine Linie hinter den Urkunden */
.xp-creds-list::before {
  content: "";
  position: absolute;
  inset-block: 1.5rem;
  left: calc(0.9rem + 3rem - 1px);
  width: 2px;
  background: color-mix(in oklch, var(--color-primary-900) 16%, transparent);
}

.xp-cred {
  position: relative;
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 0.9rem;
  border-radius: 0.9rem;
  background: var(--color-sand);
  border: 1px solid color-mix(in oklch, var(--color-primary-900) 8%, transparent);
}

/* Die Urkunde wie ein Blatt Papier: ganz sichtbar, nie beschnitten */
.xp-cred-shot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: stretch;
  text-decoration: none;
  color: var(--color-primary-800);
  border-radius: 0.4rem;
}
.xp-cred-shot:focus-visible { outline: 3px solid var(--color-accent-600); outline-offset: 3px; }
.xp-cred-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #fff;
  border-radius: 0.3rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 6px 16px -8px rgb(0 0 0 / 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.xp-cred-shot:hover .xp-cred-img { transform: translateY(-2px); box-shadow: 0 2px 4px rgb(0 0 0 / 0.14), 0 12px 24px -10px rgb(0 0 0 / 0.4); }
.xp-cred-zoom {
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.xp-cred-body { min-width: 0; padding-top: 0.1rem; }
.xp-cred-year {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  color: var(--color-accent-800);
}
.xp-cred-title {
  margin-top: 0.2rem;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.15rem);
  line-height: 1.3;
  color: var(--color-primary-950);
  /* Fachbegriffe wie „Immobiliengutachter“ nicht mitten im Wort trennen */
  -webkit-hyphens: manual;
          hyphens: manual;
  overflow-wrap: break-word;
}
.xp-cred-meta { margin: 0.55rem 0 0; display: grid; gap: 0.3rem; font-size: 0.9rem; line-height: 1.45; }
.xp-cred-meta div { display: grid; grid-template-columns: minmax(0, 1fr); }
.xp-cred-meta dt { font-size: 0.76rem; font-weight: 650; letter-spacing: 0.03em; color: var(--color-primary-700); }
.xp-cred-meta dd { margin: 0; color: var(--color-primary-950); overflow-wrap: anywhere; }
.xp-cred-note { margin-top: 0.55rem; font-size: 0.82rem; line-height: 1.45; color: var(--color-primary-700); }

@media (min-width: 30rem) {
  .xp-cred-meta div { grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.75rem; }
  .xp-cred-meta dt { font-size: 0.82rem; }
}
@media (min-width: 48rem) {
  .xp-cred { grid-template-columns: 8.5rem minmax(0, 1fr); gap: 1.4rem; padding: 1.1rem; }
  .xp-creds-list::before { left: calc(1.1rem + 4.25rem - 1px); }
}

/* ---------- Verweis im Profilkopf (partials/expert-platin-hero.php) ---------- */
.xp-badge--creds { padding: 0; }
.xp-badge--creds a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  padding: 0.38rem 0.9rem;
  border-radius: 999px;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.xp-badge--creds a:hover { background: color-mix(in oklch, #fff 10%, transparent); }
.xp-badge--creds a:focus-visible { outline: 3px solid var(--color-accent-400); outline-offset: 2px; }

/* ---------- Die große Fassung im Dialog ---------- */
.xp-cred-dialog {
  /* Die Grundstile setzen margin auf 0 — ohne auto stünde der Dialog oben links. */
  margin: auto;
  width: min(52rem, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  overflow: auto;
  padding: 0;
  border: 0;
  border-radius: 0.9rem;
  background: #fff;
  color: var(--color-primary-950);
  box-shadow: 0 24px 60px -20px rgb(0 0 0 / 0.55);
}
.xp-cred-dialog::backdrop { background: rgb(8 24 32 / 0.72); }
.xp-cred-dialog-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.75rem 0.75rem 1.1rem;
  background: #fff;
  border-bottom: 1px solid color-mix(in oklch, var(--color-primary-900) 10%, transparent);
}
.xp-cred-dialog-title { font-weight: 650; font-size: 0.95rem; line-height: 1.35; }
.xp-cred-dialog-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border: 1px solid color-mix(in oklch, var(--color-primary-900) 18%, transparent);
  border-radius: 999px;
  background: #fff;
  font-weight: 650;
  font-size: 0.9rem;
  color: var(--color-primary-900);
  cursor: pointer;
}
.xp-cred-dialog-close svg { width: 1.1rem; height: 1.1rem; }
.xp-cred-dialog-close:hover { background: var(--color-sand); }
.xp-cred-dialog-close:focus-visible { outline: 3px solid var(--color-accent-600); outline-offset: 2px; }
.xp-cred-dialog-img { display: block; width: 100%; height: auto; }

@media (prefers-reduced-motion: reduce) {
  .xp-cred-img { transition: none; }
  .xp-cred-shot:hover .xp-cred-img { transform: none; }
}
