/* =========================================================
   Tokens
   ========================================================= */
:root {
  --cream: #FBF7F0;
  --beige: #EFE4D2;
  --gold: #D4AF7A;
  --green: #5A6E58;
  --green-deep: #44543F;
  --ink: #3A3A36;
  --ink-soft: #6B6660;
  --white: #FFFFFF;

  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;

  --radius: 6px;
  --max-width: 1100px;
  --max-width-narrow: 720px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; border-radius: var(--radius); }

a { color: var(--green-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  margin: 0;
}

/* Visible keyboard focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* =========================================================
   Layout helpers
   ========================================================= */
.content-narrow {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  padding: 0 24px;
}
.content-wide {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  border-bottom: 1px solid rgba(58,58,54,0.08);
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.brand:hover { text-decoration: none; }
.brand-years {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  margin-left: 8px;
  vertical-align: middle;
}
.main-nav {
  display: flex;
  gap: 28px;
  align-items: center;
  font-size: 0.95rem;
}
.main-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--ink);
  border-bottom-color: var(--gold);
}
.nav-login {
  background: var(--green);
  color: var(--white) !important;
  padding: 8px 18px !important;
  border-radius: 100px;
  border-bottom: none !important;
}
.nav-login:hover { background: var(--green-deep); }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 24px 48px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 56px;
  align-items: center;
}
.portrait-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/5;
  box-shadow: 0 20px 50px -20px rgba(90,110,88,0.35);
  border: 6px solid var(--white);
  outline: 1px solid rgba(58,58,54,0.06);
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green-deep);
  margin: 0 0 8px;
  font-weight: 600;
}
.hero h1 {
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 1;
  margin-bottom: 12px;
}
.dates {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0 0 24px;
  font-style: italic;
  font-family: var(--font-display);
}
.lead {
  font-size: 1.1rem;
  max-width: 540px;
  margin: 0 0 32px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--green);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--green-deep);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(58,58,54,0.25);
}
.btn-ghost:hover {
  border-color: var(--ink);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-center { display: block; width: fit-content; margin: 32px auto 0; }

/* =========================================================
   Lichterband (signature element)
   ========================================================= */
.lichterband {
  background: linear-gradient(180deg, var(--beige) 0%, #E5D6BC 100%);
  padding: 56px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.lichter-inner { max-width: var(--max-width); margin: 0 auto; position: relative; }
.lichter-label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--green-deep);
  margin: 0 0 24px;
}
.lichter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  min-height: 28px;
  margin-bottom: 28px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.licht {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFF6DD, var(--gold) 70%);
  box-shadow: 0 0 8px 2px rgba(212,175,122,0.55);
  animation: flicker 2.4s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes flicker {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.9); }
}
.btn-light {
  background: var(--gold);
  color: var(--ink);
  border: none;
}
.btn-light:hover { background: #C49E66; transform: translateY(-1px); }
.lichter-count {
  margin: 18px 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

@media (prefers-reduced-motion: reduce) {
  .licht { animation: none; }
  html { scroll-behavior: auto; }
}

/* =========================================================
   Lebensgeschichte
   ========================================================= */
.lebensgeschichte {
  padding: 80px 24px;
}
.lebensgeschichte h2 {
  font-size: 2.4rem;
  margin-bottom: 24px;
}
.lebensgeschichte p {
  font-size: 1.05rem;
  margin: 0 0 20px;
  color: var(--ink);
}
.lebensgeschichte p:last-child { margin-bottom: 0; }

/* =========================================================
   Section heads / previews
   ========================================================= */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-head h2 { font-size: 2.2rem; }
.link-more {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--green-deep);
  white-space: nowrap;
}

.preview-section { padding: 40px 24px 80px; }
.preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 160px);
  gap: 16px;
}
.preview-item { overflow: hidden; border-radius: var(--radius); }
.preview-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.preview-item:hover img { transform: scale(1.05); }
.preview-item.large { grid-column: span 2; grid-row: span 2; }

@media (max-width: 760px) {
  .preview-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 140px); }
  .preview-item.large { grid-column: span 2; grid-row: span 1; height: auto; }
}

/* =========================================================
   Memories preview
   ========================================================= */
.memories-preview {
  background: var(--beige);
  padding: 80px 24px;
}
.memory-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 12px 30px -18px rgba(58,58,54,0.25);
  border-left: 4px solid var(--gold);
}
.memory-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  margin: 0 0 16px;
  color: var(--ink);
}
.memory-author {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0;
  letter-spacing: 0.03em;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  text-align: center;
  padding: 48px 24px 64px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.site-footer p { margin: 4px 0; }
.footer-sub { font-size: 0.8rem; opacity: 0.8; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 40px;
    text-align: left;
  }
  .portrait-frame { max-width: 280px; }
  .main-nav { gap: 16px; font-size: 0.85rem; }
}

/* =========================================================
   Shared form styles (login/register/erinnerungen/galerie)
   ========================================================= */
.page-header {
  padding: 56px 24px 32px;
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  text-align: center;
}
.page-header h1 { font-size: 2.8rem; margin-bottom: 12px; }
.page-header p { color: var(--ink-soft); font-size: 1.05rem; max-width: 520px; margin: 0 auto; }

.form-wrap {
  max-width: 440px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: 0 12px 30px -18px rgba(58,58,54,0.2);
}
.form-field { margin-bottom: 20px; }
.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(58,58,54,0.18);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--cream);
  color: var(--ink);
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--green);
  background: var(--white);
}
.form-hint { font-size: 0.8rem; color: var(--ink-soft); margin-top: 6px; }
.form-submit { width: 100%; text-align: center; border: none; font-family: var(--font-body); }
.form-footer-link {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.form-note {
  background: var(--beige);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* Memory book */
.memory-list { display: flex; flex-direction: column; gap: 20px; margin-bottom: 48px; }
.memory-list .memory-card { border-left: 4px solid var(--gold); }
.memory-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.memory-light-btn {
  background: none;
  border: 1px solid rgba(58,58,54,0.15);
  border-radius: 100px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--ink);
  transition: background 0.2s, border-color 0.2s;
}
.memory-light-btn:hover { background: var(--beige); border-color: var(--gold); }

/* Gallery */
.gallery-tabs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 0 0 40px;
}
.gallery-tab {
  padding: 10px 24px;
  border-radius: 100px;
  border: 1px solid rgba(58,58,54,0.15);
  background: var(--white);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink-soft);
  transition: all 0.2s;
}
.gallery-tab.active {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 80px;
}
.gallery-item { overflow: hidden; border-radius: var(--radius); position: relative; aspect-ratio: 4/3; }
.gallery-item img, .gallery-item video { width: 100%; height: 100%; object-fit: cover; }
.gallery-item .play-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 2.5rem;
  background: rgba(58,58,54,0.15);
}
.gallery-item video { background: var(--ink); }
.gallery-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--white);
  background: linear-gradient(180deg, rgba(58,58,54,0) 0%, rgba(58,58,54,0.75) 100%);
}
@media (max-width: 760px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

.upload-dropzone {
  border: 2px dashed rgba(90,110,88,0.35);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-soft);
  margin-bottom: 24px;
  background: var(--beige);
}

/* Admin */
.admin-section { margin-bottom: 48px; }
.admin-section h2 {
  font-size: 1.6rem;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(58,58,54,0.12);
}
.pending-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 8px 20px -14px rgba(58,58,54,0.25);
  border-left: 4px solid var(--gold);
}
.pending-card .pending-meta {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.pending-card .pending-content {
  margin-bottom: 16px;
  font-size: 1rem;
}
.pending-card img, .pending-card video {
  max-width: 280px;
  max-height: 200px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.pending-actions { display: flex; gap: 10px; }
.btn-approve, .btn-reject {
  padding: 9px 20px;
  border-radius: 100px;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
.btn-approve { background: var(--green); color: var(--white); }
.btn-approve:hover { background: var(--green-deep); }
.btn-reject { background: transparent; color: #a33; border: 1px solid rgba(170,51,51,0.3); }
.btn-reject:hover { background: rgba(170,51,51,0.08); }
.pending-badge {
  display: inline-block;
  font-size: 0.7rem;
  background: var(--gold);
  color: var(--ink);
  padding: 2px 10px;
  border-radius: 100px;
  margin-left: 8px;
  font-weight: 600;
  vertical-align: middle;
}
