/* Gast-Modus (Besucher ohne Konto): schlanke Beitragskarte (guestcard.js), Gast-Feed,
   Gast-Beitrag (/p/<id>) und öffentliches Profil (/<benutzername>).
   Optik wie die Karten in page-post.css (ohne Kacheln, Medien randlos), eigene Klassen,
   damit Änderungen am angemeldeten Feed hier nichts verschieben. Nur Farb-Token aus app.css. */

/* Elemente mit hidden-Attribut bleiben unsichtbar, auch wenn eine Klasse display setzt. */
.gc [hidden],
.gc-grid [hidden],
.gp-body [hidden],
.gf-body [hidden] { display: none !important; }

/* ---------- Karte ---------- */
.gc { position: relative; }
.gf-list .gc + .gc,
.gf-body .gc--skeleton + .gc--skeleton,
.pd-body .gc--skeleton + .gc--skeleton { margin-top: 26px; }

.gc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 4px 14px 10px 14px;
}
.gc-head__avatar {
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
}
.gc-head__who {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
}
.gc-head__who--sk { gap: 7px; }
.gc-head__name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-self: start;
  max-width: 100%;
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
}
.gc-head__user {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
a.gc-head__name:hover .gc-head__user { text-decoration: underline; }
.gc-verified { flex: none; width: 15px; height: 15px; }

/* Profilbild: 38 px in Karten, 86 px im Profilkopf; ohne Bild der Anfangsbuchstabe. */
.gc-avatar--sm { width: 38px; height: 38px; font-size: 16px; }
.gc-avatar--lg { width: 86px; height: 86px; font-size: 36px; }
.gc-avatar img { opacity: 0; transition: opacity .25s ease; }
.gc-avatar img.is-loaded { opacity: 1; }

/* ---------- Medien: volle Breite, Rahmen 4:5 … 1,91:1 ---------- */
.gc-media {
  position: relative;
  width: 100%;
  aspect-ratio: var(--gc-ar, 0.8);
  overflow: hidden;
  background: var(--placeholder);
  isolation: isolate;
}
@media (min-width: 768px) {
  .gc-media,
  .gc-sk-media { border-radius: 4px; }
}
.gc-media__track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  outline: none;
}
.gc-media__track::-webkit-scrollbar { display: none; }
.gc-media__track:focus-visible { box-shadow: inset 0 0 0 2px var(--focus-ring); }
.gc-media__slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.gc-media__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .25s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.gc-media__img.is-loaded { opacity: 1; }
/* Kein Vorschaubild oder Bild lädt nicht: ruhiger Platzhalter. */
.gc-media__ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-3);
}
.gc-media__ph .icon { width: 42px; height: 42px; opacity: .6; }
/* Video: nur das Vorschaubild; die Pille (oben, nie über den Punkten) öffnet den Login-Hinweis. */
.gc-media__video {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 12px 7px 9px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--media-pill);
  border: 1px solid var(--media-pill-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.gc-media__video .icon { width: 18px; height: 18px; }
.gc-media__dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  display: flex;
  gap: 5px;
  transform: translateX(-50%);
  pointer-events: none;
}
.gc-media__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .45);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .25);
  transition: background .2s ease, transform .2s ease;
}
.gc-media__dot.is-on { background: #fff; transform: scale(1.15); }
.gc-media__nav { display: none; }
@media (hover: hover) and (pointer: fine) {
  .gc-media__nav {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin-top: -16px;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, .42);
    border: 1px solid rgba(255, 255, 255, .2);
    opacity: 0;
    transition: opacity .15s ease;
  }
  .gc-media__nav .icon { width: 22px; height: 22px; }
  .gc-media__nav--prev { left: 10px; }
  .gc-media__nav--next { right: 10px; }
  .gc-media:hover .gc-media__nav,
  .gc-media__nav:focus-visible { opacity: 1; }
}

/* ---------- Aktionsleiste (alles öffnet den Login-Hinweis) ---------- */
.gc-actions {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 2px 8px 0 4px;
  color: var(--text);
}
.gc-act {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  color: var(--text);
}
.gc-act .icon { width: 24px; height: 24px; }
.gc-act--like .icon { width: 25px; height: 25px; }
.gc-count {
  margin-left: 6px;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.gc-actions__spacer { flex: 1 1 auto; }

/* ---------- Text + Zeit ---------- */
.gc-caption {
  padding: 2px 14px 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.gc-caption__name { font-weight: 800; color: var(--text); }
a.gc-caption__name:hover { text-decoration: underline; }
.gc-caption__more {
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}
.gc-time-row { padding: 6px 14px 0; }
.gc-time {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
}
.gc-time-link { display: inline-block; padding: 4px 0; }
.gc-time-link:hover .gc-time { text-decoration: underline; }

/* ---------- Platzhalter in Kartenform ---------- */
.gc-sk-media { display: block; width: 100%; aspect-ratio: 4 / 5; border-radius: 0; }
.gc-sk-lines { display: grid; gap: 8px; padding: 14px 14px 0; }

/* ---------- Raster (Profil): 3 Spalten, 4:5, 2-px-Fugen ---------- */
.gc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
}
.gc-tile,
.gc-tile__sk {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--placeholder);
  border-radius: 0;
}
.gc-tile__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .25s ease;
}
.gc-tile__img.is-loaded { opacity: 1; }
.gc-tile__ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-3);
}
.gc-tile__ph .icon { width: 26px; height: 26px; opacity: .6; }
.gc-tile__badge {
  position: absolute;
  top: 6px;
  right: 6px;
  color: #fff;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, .55));
}
.gc-tile__badge .icon { width: 16px; height: 16px; }
.gc-tile--text {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px;
  background: var(--surface-soft);
}
.gc-tile--text .icon { width: 18px; height: 18px; }
.gc-tile__text {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.gc-tile:focus-visible { outline-offset: -2px; }

/* ---------- Gast-Feed ---------- */
.gf-body { padding-top: 4px; }
.gf-end {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 34px;
  padding: 0 24px 8px;
  text-align: center;
}
.gf-end__text {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.feed-error .gf-error__sub {
  max-width: 300px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
}
.gf-age-actions {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 18px;
}
.empty .gf-age-actions .btn { margin-top: 0; }

/* ---------- Gast-Beitrag (/p/<id>) ---------- */
.gpd-note {
  max-width: 340px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-2);
}
.page--post-guest .pd-comments--locked .btn { margin-top: 6px; }

/* „Beitrag melden“ / „Profil melden“ */
.g-report {
  display: flex;
  justify-content: center;
  margin-top: var(--section-gap);
  padding: 0 16px;
}
.g-report__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.g-report__link .icon { width: 16px; height: 16px; }
.g-report__link:hover { color: var(--text); text-decoration: underline; }

/* ---------- Öffentliches Profil (/<benutzername>) ---------- */
.gp-body { padding-top: 4px; }
.gp-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px var(--gutter) 0;
  text-align: center;
}
.gp-head .gc-avatar--lg { margin-bottom: 8px; }
.gp-head__sk-avatar { width: 86px; height: 86px; margin-bottom: 8px; }
.gp-head__name {
  max-width: 100%;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -.3px;
  overflow-wrap: anywhere;
}
.gp-head__user {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.gp-head__user--main {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
}
.gp-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 22px var(--gutter) 0;
}
.gp-actions .btn {
  min-height: 46px;
  height: 46px;
  padding: 0 12px;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
}
.gp-actions .btn .icon { width: 20px; height: 20px; }
.gp-posts { margin-top: var(--section-gap); }
.gp-posts__title {
  padding: 0 var(--gutter) 10px;
  font-size: 17px;
  font-weight: 800;
}
.gp-posts__empty {
  padding: 24px var(--gutter);
  font-size: 14.5px;
  color: var(--text-2);
  text-align: center;
}
.gp-skeleton .gp-head { gap: 10px; }
.gp-skeleton .gc-grid { margin-top: var(--section-gap); }

@media (prefers-reduced-motion: reduce) {
  .gc-media__track { scroll-behavior: auto; }
  .gc-media__img,
  .gc-tile__img,
  .gc-avatar img,
  .gc-media__dot { transition: none; }
}
