/* ---------------------------------------------------------
   Grundlagen & Design-Tokens
--------------------------------------------------------- */
:root {
  color-scheme: light;

  --color-bg: #faf8f5;
  --color-surface: #ffffff;
  --color-text: #21201e;
  --color-text-muted: #6b6660;
  --color-border: #e8e3dc;
  --color-accent: #d1436b;
  --color-accent-contrast: #ffffff;
  --color-focus: #1a6fd6;
  --color-placeholder-bg: #efece6;
  --color-placeholder-text: #9a948b;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;

  --content-max-width: 460px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --shadow-sm: 0 1px 2px rgba(33, 32, 30, 0.06);
  --shadow-md: 0 8px 24px rgba(33, 32, 30, 0.10);
  --shadow-lg: 0 -4px 16px rgba(33, 32, 30, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------------------------------------------------
   Layout-Container
--------------------------------------------------------- */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

main {
  flex: 1;
}

/* ---------------------------------------------------------
   Profil-Header (above the fold)
--------------------------------------------------------- */
.profile {
  padding-top: clamp(var(--space-5), 6vh, var(--space-7));
  padding-bottom: var(--space-6);
  text-align: center;
}

.avatar {
  position: relative;
  width: 104px;
  height: 104px;
  margin: 0 auto var(--space-4);
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--color-placeholder-bg);
  box-shadow: var(--shadow-sm);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar::after {
  content: "Profilbild fehlt\A profile-vicky.webp";
  white-space: pre;
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 9px;
  line-height: 1.3;
  color: var(--color-placeholder-text);
  padding: var(--space-2);
}

.avatar.img-missing img {
  visibility: hidden;
}

.avatar.img-missing::after {
  display: flex;
}

.profile__handle {
  margin: 0 0 var(--space-1);
  font-size: 1.05rem;
  font-weight: 600;
}

.profile__name {
  margin: 0 0 var(--space-3);
  font-size: 0.95rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

.profile__bio {
  margin: 0 auto var(--space-4);
  max-width: 360px;
  font-size: 0.95rem;
  color: var(--color-text);
}

.profile__bio p {
  margin: 0 0 var(--space-1);
}

.profile__bio p:last-child {
  margin-bottom: 0;
}

.follower-count {
  margin: 0 0 var(--space-5);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.follower-count strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ---------------------------------------------------------
   CTA-Buttons
--------------------------------------------------------- */
.cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  max-width: 320px;
  padding: 14px var(--space-5);
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cta-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(33, 32, 30, 0.14);
}

.cta-primary:active {
  transform: translateY(0);
}

.cta-primary svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.cta-secondary {
  display: inline-block;
  margin-top: var(--space-3);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cta-secondary:hover {
  color: var(--color-text);
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------------------------------------------------------
   Beitragsraster
--------------------------------------------------------- */
.post-grid-section {
  padding-bottom: var(--space-7);
}

.post-grid-section__title {
  margin: 0 0 var(--space-3);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-align: center;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 3px 0;
}

.post-tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  background: var(--color-placeholder-bg);
  overflow: hidden;
  border-radius: 3px;
}

.post-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-tile__placeholder-label {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  text-align: center;
  font-size: 10px;
  line-height: 1.4;
  color: var(--color-placeholder-text);
  word-break: break-all;
}

.post-tile.img-missing img {
  visibility: hidden;
}

.post-tile.img-missing .post-tile__placeholder-label {
  display: flex;
}

.post-tile:focus-visible {
  outline-offset: -3px;
}

/* ---------------------------------------------------------
   Footer
--------------------------------------------------------- */
.site-footer {
  padding: var(--space-5) var(--space-4) var(--space-7);
  text-align: center;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.site-footer__legal {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 0 var(--space-2);
  padding: 0;
  list-style: none;
}

.site-footer__legal a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer__legal a:hover {
  color: var(--color-text);
}

.site-footer__copy {
  margin: 0;
}

/* ---------------------------------------------------------
   Sticky Bottom-CTA
--------------------------------------------------------- */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--color-bg) 60%, rgba(250, 248, 245, 0));
  transform: translateY(100%);
  transition: transform 0.25s ease;
  pointer-events: none;
}

.sticky-cta.is-visible {
  transform: translateY(0);
  pointer-events: auto;
}

.sticky-cta .cta-primary {
  box-shadow: var(--shadow-lg), var(--shadow-md);
}

@media (prefers-reduced-motion: reduce) {
  .cta-primary,
  .sticky-cta {
    transition: none;
  }
}

/* ---------------------------------------------------------
   Größere Bildschirme
--------------------------------------------------------- */
@media (min-width: 640px) {
  :root {
    --content-max-width: 520px;
  }

  .profile {
    padding-top: var(--space-7);
  }

  .avatar {
    width: 128px;
    height: 128px;
  }

  .post-grid {
    gap: 4px;
  }

  .sticky-cta {
    display: none;
  }
}
