@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #fafafa;
  --surface: #ffffff;
  --border:  #dbdbdb;
  --text:    #1a1a1a;
  --muted:   #737373;
  --accent:  #c13584;
  --accent2: #e1306c;
  --link:    #003569;
  --danger:  #e53e3e;
  --success: #38a169;
  --radius:  12px;
  --shadow:  0 1px 3px rgba(0,0,0,.12);
}

html { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; }
body { min-height: 100vh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }

/* ═══════════════════════════════════════
   PUBLIC FRONTEND
═══════════════════════════════════════ */

/* ─── Nav ─── */
.navbar { position: sticky; top: 0; z-index: 100; background: var(--surface); border-bottom: 1px solid var(--border); }
.navbar-inner { max-width: 935px; margin: 0 auto; padding: 0 20px; height: 54px; display: flex; align-items: center; justify-content: space-between; }
.navbar-logo { font-size: 1.4rem; font-weight: 700; letter-spacing: -.5px; background: linear-gradient(135deg,var(--accent2),var(--accent),#833ab4); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.navbar-admin { font-size: .85rem; font-weight: 500; color: var(--muted); border: 1px solid var(--border); padding: 6px 14px; border-radius: 8px; transition: all .2s; }
.navbar-admin:hover { background: var(--bg); color: var(--text); }

/* ─── Profil ─── */
.profile-section { max-width: 1100px; margin: 0 auto; padding: 36px 20px 24px; }
.profile-header { display: flex; align-items: center; gap: 40px; }
.profile-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); flex-shrink: 0; }
.profile-avatar-placeholder { width: 96px; height: 96px; border-radius: 50%; background: linear-gradient(135deg,var(--accent2),#833ab4); display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #fff; font-weight: 700; flex-shrink: 0; }
.profile-info { flex: 1; }
.profile-username { font-size: 1.5rem; font-weight: 300; letter-spacing: -.2px; margin-bottom: 12px; }
.profile-stats { display: flex; gap: 28px; margin-bottom: 14px; }
.profile-stat { display: flex; flex-direction: column; align-items: center; }
.profile-stat-num { font-size: 1rem; font-weight: 600; }
.profile-stat-label { font-size: .8rem; color: var(--muted); }
.profile-bio { font-size: .9rem; line-height: 1.5; white-space: pre-line; }
.profile-website { font-size: .9rem; color: var(--link); font-weight: 500; margin-top: 4px; display: inline-block; }
.profile-website:hover { text-decoration: underline; }

/* ─── Feed Layout (sidebar + main) ─── */
.feed-layout {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
}

/* Left: Tag Sidebar */
.tag-sidebar {
  width: 160px;
  flex-shrink: 0;
  position: sticky;
  top: 60px;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding-bottom: 24px;
}
.tag-sidebar-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface, #fff);
  z-index: 1;
}
.tag-sidebar-label {
  flex: 1;
  font-size: .7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.tag-sort-btn, .tag-clear-btn {
  display: flex;
  align-items: center;
  color: var(--muted);
  opacity: .55;
  transition: opacity .15s;
}
.tag-sort-btn:hover, .tag-clear-btn:hover { opacity: 1; color: var(--text); }
.tag-clear-btn:hover { color: #c33; }

.tag-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}
.tag-sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  font-size: .8rem;
  color: var(--text);
  border-left: 2px solid transparent;
  transition: background .12s, border-color .12s;
  text-decoration: none;
}
.tag-sidebar-item:hover {
  background: var(--bg);
  border-left-color: var(--border);
}
.tag-sidebar-item.active {
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.tag-sidebar-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-sidebar-count {
  font-size: .7rem;
  color: var(--muted);
  margin-left: 4px;
  flex-shrink: 0;
}

/* Right: Feed main */
.feed-main { flex: 1; min-width: 0; }

/* Mobile tag toggle – hidden on desktop */
.tag-sidebar-toggle { display: none; }

/* ─── Filter-Tabs ─── */
.filter-bar { border-top: 1px solid var(--border); display: flex; justify-content: center; gap: 40px; margin-bottom: 2px; }
.filter-tab { display: flex; align-items: center; gap: 6px; padding: 14px 4px; font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; border-top: 2px solid transparent; margin-top: -1px; transition: color .2s, border-color .2s; }
.filter-tab:hover { color: var(--text); }
.filter-tab.active { color: var(--text); border-top-color: var(--text); }
.filter-tab svg { width: 14px; height: 14px; }

/* ─── Grid ─── */
.grid-section { padding: 0 0 40px; }
.posts-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 3px; }
.post-tile { position: relative; aspect-ratio: 1/1; overflow: hidden; background: var(--border); cursor: pointer; display: block; }
.post-tile img, .post-tile video { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.post-tile:hover img, .post-tile:hover video { transform: scale(1.04); }
.post-tile-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; gap: 20px; opacity: 0; transition: opacity .2s; color: #fff; font-weight: 600; font-size: .95rem; z-index: 1; }
.post-tile:hover .post-tile-overlay { opacity: 1; }
.post-tile-overlay span { display: flex; align-items: center; gap: 5px; }
.post-tile-overlay svg { width: 18px; height: 18px; fill: #fff; }
.post-tile-text { background: linear-gradient(135deg,#1a1a2e 0%,#16213e 50%,#0f3460 100%); display: flex; align-items: center; justify-content: center; padding: 16px; }
.post-tile-text-content { color: #fff; font-size: .85rem; line-height: 1.5; text-align: center; font-style: italic; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.post-tile-play { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.5); border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }
.post-tile-play svg { width: 14px; height: 14px; fill: #fff; margin-left: 2px; }
.empty-state { grid-column: 1/-1; text-align: center; padding: 80px 20px; color: var(--muted); }
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; }

/* ─── Post-Detail ─── */
.post-detail-wrap { max-width: 935px; margin: 0 auto; padding: 20px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .9rem; margin-bottom: 20px; }
.back-link:hover { color: var(--text); }
.back-link svg { width: 18px; height: 18px; }
.post-detail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; }
.post-detail-media { position: relative; background: #000; display: flex; align-items: center; justify-content: center; min-height: 400px; overflow: hidden; }

/* ── Überschrift in der Info-Spalte ──────────────────────────────────── */
.post-detail-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.post-detail-media img { width: 100%; max-height: 600px; object-fit: contain; }
.post-detail-media video { width: 100%; max-height: 600px; }
.post-detail-media-text { width: 100%; padding: 60px 40px; background: linear-gradient(135deg,#1a1a2e,#0f3460); display: flex; align-items: center; justify-content: center; }
.post-detail-media-text p { color: #fff; font-size: 1.4rem; font-style: italic; line-height: 1.6; text-align: center; }
.post-detail-info { padding: 24px; display: flex; flex-direction: column; }
.post-detail-author { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.post-detail-author img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.post-detail-author-name { font-weight: 600; font-size: .9rem; }
.post-detail-caption { font-size: .9rem; line-height: 1.6; flex: 1; }
.post-detail-caption strong { font-weight: 600; margin-right: 6px; }
.post-detail-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.post-detail-tag { font-size: .8rem; color: var(--link); }
.post-detail-date { font-size: .75rem; color: var(--muted); margin-top: 10px; }
.post-detail-actions { padding-top: 14px; border-top: 1px solid var(--border); margin-top: 16px; }
.like-btn { background: none; border: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 500; padding: 0; transition: transform .15s; }
.like-btn:hover { transform: scale(1.1); }
.like-btn svg { width: 24px; height: 24px; stroke: var(--text); fill: none; stroke-width: 2; transition: fill .2s, stroke .2s; }
.like-btn.liked svg { fill: var(--accent2); stroke: var(--accent2); }

/* ═══════════════════════════════════════
   ADMIN
═══════════════════════════════════════ */

/* ─── Layout ─── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-logo { font-size: 1.3rem; font-weight: 700; letter-spacing: -.5px; background: linear-gradient(135deg,var(--accent2),var(--accent),#833ab4); -webkit-background-clip: text; -webkit-text-fill-color: transparent; padding: 0 20px 20px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.admin-logo span { font-size: .7rem; font-weight: 500; color: var(--muted); display: block; -webkit-text-fill-color: var(--muted); margin-top: 2px; }
.admin-nav { padding: 0 10px; display: flex; flex-direction: column; gap: 2px; }
.admin-nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--muted); font-size: .9rem; font-weight: 500; transition: all .15s; }
.admin-nav-link:hover { background: var(--bg); color: var(--text); }
.admin-nav-link.active { background: #fce4ec; color: var(--accent); }
.admin-nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.admin-nav-sep { padding: 0 12px; margin: 10px 0 6px; font-size: .7rem; font-weight: 600; color: var(--border); text-transform: uppercase; letter-spacing: 1px; }
.admin-sidebar-footer { margin-top: auto; padding: 16px 20px 0; border-top: 1px solid var(--border); }
.admin-sidebar-footer a { font-size: .8rem; color: var(--muted); }
.admin-sidebar-footer a:hover { color: var(--text); }
.admin-main { flex: 1; padding: 32px; overflow-x: hidden; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.admin-header h1 { font-size: 1.6rem; font-weight: 700; }
.admin-header p { font-size: .9rem; color: var(--muted); margin-top: 2px; }

/* ─── Karten ─── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stat-card-label { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.stat-card-icon { width: 18px; height: 18px; color: var(--muted); }
.stat-card-num { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-card-sub { font-size: .75rem; color: var(--muted); margin-top: 4px; }

/* ─── Tabelle ─── */
.privacy-toggle-card { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 20px; border-radius:var(--radius); border:1px solid; margin-bottom:20px; flex-wrap:wrap; }
.privacy-toggle-card--public  { background:#f0fdf4; border-color:#bbf7d0; }
.privacy-toggle-card--private { background:#fff7ed; border-color:#fed7aa; }
.privacy-toggle-info { display:flex; align-items:center; gap:12px; }
.privacy-toggle-info svg { width:22px; height:22px; flex-shrink:0; }
.privacy-toggle-card--public  .privacy-toggle-info svg { color:#16a34a; }
.privacy-toggle-card--private .privacy-toggle-info svg { color:#ea580c; }
.privacy-toggle-info strong { display:block; font-size:.9rem; font-weight:700; margin-bottom:2px; }
.privacy-toggle-info span { font-size:.8rem; color:var(--muted); }
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.table-card-header h2 { font-size: 1rem; font-weight: 600; }
.table-scroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
thead { background: var(--bg); }
th { padding: 10px 16px; text-align: left; font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: .85rem; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }
.post-thumb { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; }
.post-thumb-text { width: 48px; height: 48px; border-radius: 6px; background: linear-gradient(135deg,#1a1a2e,#0f3460); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.badge-image { background: #e3f2fd; color: #1565c0; }
.badge-video { background: #f3e5f5; color: #6a1b9a; }
.badge-text  { background: #e8f5e9; color: #2e7d32; }
.actions-cell { display: flex; gap: 8px; }

/* ─── Buttons ─── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; border: none; font-size: .85rem; font-weight: 500; cursor: pointer; transition: all .15s; line-height: 1; }
.btn svg { width: 14px; height: 14px; }
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #a02b6e; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e9e9e9; }
.btn-danger    { background: #fff5f5; color: var(--danger); border: 1px solid #fed7d7; }
.btn-danger:hover { background: #fed7d7; }
.btn-sm { padding: 5px 10px; font-size: .8rem; }

/* ─── Formulare ─── */
.form-group { margin-bottom: 18px; }
label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: 6px; }
input[type=text], input[type=url], textarea, select { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: .9rem; transition: border-color .15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.form-optional { font-size: .72rem; font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; margin-left: 4px; }
.type-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.type-option { position: relative; }
.type-option input { position: absolute; opacity: 0; }
.type-option label { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: all .15s; text-align: center; font-weight: 500; color: var(--muted); }
.type-option label svg { width: 24px; height: 24px; }
.type-option input:checked + label { border-color: var(--accent); color: var(--accent); background: #fce4ec; }
.upload-area { border: 2px dashed var(--border); border-radius: var(--radius); padding: 32px; text-align: center; cursor: pointer; transition: all .2s; position: relative; }
.upload-area:hover, .upload-area.dragover { border-color: var(--accent); background: #fce4ec22; }
.upload-area svg { width: 36px; height: 36px; color: var(--muted); margin: 0 auto 8px; }
.upload-area p { font-size: .9rem; color: var(--muted); }
.upload-area input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-preview { margin-top: 12px; }
.upload-preview img { max-height: 180px; border-radius: 8px; object-fit: cover; margin: 0 auto; }
.upload-progress { margin-top: 8px; }
.progress-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--accent); transition: width .3s; }

/* ─── Alerts ─── */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: .875rem; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.profile-avatar-preview { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin-bottom: 10px; border: 2px solid var(--border); }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 1000px) { .stats-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 700px) {
  .profile-header { gap: 20px; }
  .post-detail { grid-template-columns: 1fr; }
  .post-detail-media { min-height: 280px; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; }
  .admin-nav { flex-direction: row; overflow-x: auto; }
  .admin-main { padding: 20px; }
}
@media (max-width: 400px) {
  .profile-stats { gap: 14px; }
}

/* ═══════════════════════════════════════
   LOGIN
═══════════════════════════════════════ */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.login-wrap { width: 100%; max-width: 380px; padding: 20px; }
.login-logo { font-size: 2rem; font-weight: 700; text-align: center; margin-bottom: 24px; background: linear-gradient(135deg,var(--accent2),var(--accent),#833ab4); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.login-card h1 { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.login-card > p { font-size: .875rem; color: var(--muted); margin-bottom: 20px; }

/* ═══════════════════════════════════════
   GALERIE-FORMULAR (Admin)
═══════════════════════════════════════ */
.gallery-input-row { display: flex; gap: 8px; margin-bottom: 8px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 8px; }
.gallery-thumb-wrap { position: relative; aspect-ratio: 1/1; border-radius: 8px; overflow: hidden; border: 2px solid var(--border); cursor: pointer; }
.gallery-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb-wrap.is-cover { border-color: var(--accent); }
.gallery-thumb-actions { position: absolute; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; gap: 8px; opacity: 0; transition: opacity .15s; }
.gallery-thumb-wrap:hover .gallery-thumb-actions { opacity: 1; }
.gallery-btn { background: rgba(255,255,255,.9); border: none; border-radius: 50%; width: 30px; height: 30px; font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
.cover-btn { color: var(--accent); }
.remove-btn { color: var(--danger); font-size: 1.2rem; }
.gallery-cover-badge { position: absolute; bottom: 4px; left: 4px; background: var(--accent); color: #fff; font-size: .65rem; font-weight: 700; padding: 2px 6px; border-radius: 3px; text-transform: uppercase; letter-spacing: .5px; }

/* ═══════════════════════════════════════
   GALERIE-VIEWER (Post-Detail)
═══════════════════════════════════════ */
.post-detail--gallery { grid-template-columns: 3fr 2fr; }
.gallery-viewer { display: flex; flex-direction: column; height: 100%; background: #000; }
.gallery-main-wrap { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 340px; }
.gallery-main-img { max-width: 100%; max-height: 560px; object-fit: contain; pointer-events: none; display: block; }
.gallery-img-link { display: flex; align-items: center; justify-content: center; cursor: zoom-in; position: relative; z-index: 1; }
.post-detail-img-link { display: block; position: relative; cursor: zoom-in; }
.post-detail-img-link:hover .img-zoom-hint { opacity: 1; }
.img-zoom-hint { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.55); color: #fff; border-radius: 6px; padding: 4px 8px; font-size: .72rem; display: flex; align-items: center; gap: 4px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 3; }
.img-zoom-hint svg { width: 13px; height: 13px; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.55); border: none; border-radius: 50%; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; transition: background .15s; z-index: 2; }
.gallery-nav:hover { background: rgba(0,0,0,.8); }
.gallery-nav svg { width: 20px; height: 20px; }
.gallery-prev { left: 8px; }
.gallery-next { right: 8px; }
.gallery-counter { position: absolute; bottom: 8px; right: 10px; font-size: .75rem; color: #fff; background: rgba(0,0,0,.5); padding: 2px 8px; border-radius: 10px; }
.gallery-thumbs { display: flex; gap: 4px; padding: 6px; background: #111; overflow-x: auto; flex-shrink: 0; }
.gallery-thumb { flex-shrink: 0; width: 52px; height: 52px; border-radius: 4px; overflow: hidden; border: 2px solid transparent; cursor: pointer; padding: 0; background: none; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { border-color: var(--accent); }

/* Grid-Anzeige im Feed: Galerie-Icon-Overlay */
.post-tile-gallery-icon { position: absolute; top: 8px; right: 8px; }
.post-tile-gallery-icon svg { width: 20px; height: 20px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }

/* ── Überschrift-Overlay auf der Kachel ────────────────────────────────── */
.post-tile-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(50,50,50,.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.3;
  padding: 8px 10px;
  text-shadow: 0 1px 4px rgba(0,0,0,.55);
  pointer-events: none;
  /* immer über dem Hover-Overlay sichtbar */
  z-index: 2;
}

@media (max-width: 700px) {
  .post-detail--gallery { grid-template-columns: 1fr; }
  .gallery-main-wrap { min-height: 240px; }
  .gallery-input-row { flex-wrap: wrap; }
}

/* ─── OTP-Eingabe ─── */
.otp-input-wrap { display: flex; justify-content: center; }
.otp-input {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: .35em;
  text-align: center;
  width: 200px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  transition: border-color .15s;
}
.otp-input:focus { border-color: var(--accent); outline: none; }

/* ─── Einladungs-Bar im Feed ─── */
.invite-bar {
  margin: 0 0 12px;
  padding: 0 4px;
  display: flex;
  justify-content: flex-end;
}
.invite-bar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: color .15s, border-color .15s, background .15s;
}
.invite-bar-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(var(--accent-rgb, 0,149,246), .05);
}

/* ─── Profil-Editor Layout ─── */
.profile-edit-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  max-width: 800px;
}
@media (max-width: 640px) {
  .profile-edit-grid {
    grid-template-columns: 1fr;
  }
  /* Preview-Karte: kompakter horizontaler Streifen auf Mobile */
  .profile-edit-grid > .card:first-child {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    text-align: left;
  }
  /* "Vorschau"-Label und Bio/Website in der Preview ausblenden */
  .profile-edit-grid > .card:first-child > div:first-child,
  .profile-preview-bio,
  .profile-preview-website {
    display: none;
  }
  /* Avatar-Wrap kleiner */
  .profile-edit-grid > .card:first-child #avatar-preview-wrap,
  .profile-edit-grid > .card:first-child #avatar-preview-wrap img,
  .profile-edit-grid > .card:first-child #avatar-preview-wrap .profile-avatar-preview {
    width: 52px !important;
    height: 52px !important;
    margin: 0 !important;
  }
  /* Upload-Button bleibt erreichbar */
  .profile-edit-grid > .card:first-child > div:nth-child(2) {
    flex-shrink: 0;
  }
}

/* ─── Profilbild Crop-Modal ─── */
.crop-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.crop-modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.crop-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.crop-modal-title { font-weight: 600; font-size: .95rem; }
.crop-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 6px;
}
.crop-modal-close:hover { background: var(--bg); color: var(--text); }
.crop-modal-body { padding: 16px 18px; }
.crop-canvas-wrap {
  background: #111;
  border-radius: 8px;
  overflow: hidden;
  max-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.crop-canvas-wrap img { max-height: 360px; width: 100%; object-fit: contain; }
.crop-hint { font-size: .78rem; color: var(--muted); margin-top: 8px; text-align: center; }
.crop-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

/* ─── Zugangssperre ─── */
.access-denied-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}
.access-denied-box {
  text-align: center;
  max-width: 380px;
}
.access-denied-icon svg {
  width: 56px;
  height: 56px;
  stroke: var(--accent);
  margin: 0 auto 20px;
}
.access-denied-box h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.access-denied-box p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 8px;
}
.access-denied-sub { font-size: .875rem; }

/* ─── Admin Zugangslinks ─── */
.token-list { display: flex; flex-direction: column; gap: 12px; }
.token-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.token-row.token-used { background: #fafafa; opacity: .8; }
.token-row-info { flex: 1; min-width: 0; }
.token-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 4px;
}
.token-status-badge {
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-unused { background: #e6f4ea; color: #1a6b35; }
.badge-used   { background: #f0f0f0; color: #666; }
.token-meta   { font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.token-url-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.token-url-input {
  flex: 1;
  font-size: .8rem;
  font-family: monospace;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  color: var(--text);
  min-width: 0;
}

/* ── Kachel-Datum (unterhalb jeder Kachel) ─────────────────────────────── */
.post-tile-wrap {
  display: flex;
  flex-direction: column;
}
.post-tile-time {
  font-size: 10.5px;
  color: var(--muted);
  padding: 3px 2px 0;
  text-align: right;
  line-height: 1.3;
}

/* ── Zeitungsdesign für Textbeiträge ──────────────────────────────────── */
.post-tile-newspaper {
  width: 100%;
  height: 100%;
  background: #f4f0e8;
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-tile-newspaper svg { width: 88%; height: 88%; }
.post-detail-newspaper {
  width: 100%;
  background: #f4f0e8;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.post-detail-newspaper svg { max-width: 340px; width: 90%; }

/* ── Link-Beitragstyp ─────────────────────────────────────────────────── */
.post-tile-link-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  background: rgba(0,0,0,.45);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.post-tile-link-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .85;
}
.post-detail-link-empty {
  width: 100%;
  min-height: 200px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: .8;
}
.post-detail-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: 14px;
  transition: background .15s;
}
.post-detail-link-btn:hover { background: #0080db; }

/* ── Textartikel-Detail: kein schwarzer Hintergrund, kleines Bild oben links ── */
.post-detail-media--text {
  background: var(--surface);
  min-height: 0;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 28px 28px 20px;
}
.post-detail-text-img {
  width: auto;
  max-width: 260px;
  max-height: 280px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 3px 14px rgba(0,0,0,.18);
  display: block;
}
.post-detail-media--text .post-detail-newspaper {
  background: transparent;
  padding: 0;
  border-radius: 0;
}
.post-detail-media--text .post-detail-newspaper svg {
  max-width: 200px;
  width: 100%;
}
@media (max-width: 600px) {
  .post-detail-text-img { max-width: 160px; max-height: 180px; }
}

/* ── Text-Beitrag Detail: 2/3 Breite für den Textbereich ──────────────── */
.post-detail--text { grid-template-columns: 1fr 2fr; }
@media (max-width: 700px) { .post-detail--text { grid-template-columns: 1fr; } }

.post-detail-text-content { font-size: .95rem; line-height: 1.8; }
.post-detail-text-content p { margin-bottom: .85em; }
.post-detail-text-content ul,
.post-detail-text-content ol { margin: .4em 0 .85em 1.5em; }
.post-detail-text-content li { margin-bottom: .3em; }
.post-detail-text-content h1,
.post-detail-text-content h2 { font-size: 1.15rem; font-weight: 700; margin: 1em 0 .4em; }
.post-detail-text-content h3 { font-size: 1rem; font-weight: 600; margin: .8em 0 .3em; }
.post-detail-text-content a { color: var(--link); text-decoration: underline; }
.post-detail-text-content img { max-width: 100%; border-radius: 6px; margin: .5em 0; }
.post-detail-text-content table { border-collapse: collapse; width: 100%; margin: .8em 0; font-size: .9rem; }
.post-detail-text-content th,
.post-detail-text-content td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.post-detail-text-content blockquote { border-left: 3px solid var(--accent); padding-left: 14px; color: var(--muted); font-style: italic; margin: .8em 0; }

/* Rich-Text-Beschreibung für Foto / Video / Galerie / Link */
.post-detail-rich-caption { font-size: .9rem; line-height: 1.65; }
.post-detail-rich-caption p { margin-bottom: .6em; }
.post-detail-rich-caption p:last-child { margin-bottom: 0; }
.post-detail-rich-caption ul,
.post-detail-rich-caption ol { margin: .3em 0 .6em 1.4em; }
.post-detail-rich-caption a { color: var(--link); text-decoration: underline; }
.post-detail-rich-caption strong { font-weight: 600; }
.post-detail-rich-caption em { font-style: italic; }

/* ── Tag-Sidebar: Responsive (mobile collapsible) ─────────────────── */
@media (max-width: 767px) {
  .feed-layout { flex-direction: column; }

  /* Tag sidebar: hidden by default, becomes collapsible block */
  .tag-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: none;
    padding-bottom: 8px;
  }
  .tag-sidebar.open { display: block; }
  .tag-sidebar-head { position: static; }

  /* Tag list: 2-column grid in mobile dropdown */
  .tag-sidebar-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px 8px;
  }
  .tag-sidebar-item {
    padding: 6px 8px;
    border-left: none;
    border-radius: 6px;
  }
  .tag-sidebar-item:hover { border-left: none; }
  .tag-sidebar-item.active { background: rgba(0,149,246,.07); border-left: none; }

  /* Mobile toggle button: visible on small screens */
  .tag-sidebar-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 10px 16px;
    background: var(--surface, #fff);
    border: none;
    border-bottom: 1px solid var(--border);
    font-size: .82rem;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
  }
  .tag-sidebar-toggle:hover { background: var(--bg); }
  .toggle-chevron { margin-left: auto; transition: transform .2s; }

  .filter-bar { gap: 0; }
  .filter-tab { font-size: .72rem; padding: 12px 6px; letter-spacing: .5px; }
  .posts-grid { grid-template-columns: repeat(2,1fr); }
  .profile-section { padding: 20px 16px 16px; }
  .profile-header { gap: 14px; }
  .profile-avatar, .profile-avatar-placeholder { width: 72px; height: 72px; }
  .profile-username { font-size: 1.1rem; }
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
/* ─── Theme-Banner ─── */
.theme-banner { width: 100%; background-size: cover; background-position: center; background-repeat: no-repeat; }
.theme-banner--header { }
.theme-banner--footer { margin-top: 48px; }
.theme-banner--footer + .site-footer { margin-top: 0; border-top: none; }

/* ─── Admin: Theme-Picker ─── */
.themes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.theme-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s; }
.theme-card:hover { border-color: var(--accent); }
.theme-card--active { border-color: var(--accent); }
.theme-card-preview { height: 140px; overflow: hidden; border-bottom: 1px solid var(--border); }
.theme-card-body { padding: 14px 16px 10px; flex: 1; }
.theme-card-title { font-size: .95rem; font-weight: 700; margin-bottom: 3px; display: flex; align-items: center; gap: 8px; }
.theme-active-badge { font-size: .7rem; font-weight: 600; background: var(--accent); color: #fff; padding: 2px 8px; border-radius: 20px; }
.theme-card-desc { font-size: .8rem; color: var(--muted); margin-bottom: 10px; }
.theme-swatches { display: flex; gap: 5px; }
.theme-swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,.1); display: inline-block; }
.theme-card-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
.theme-card-footer--active { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--accent); }

.site-footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 20px 0 28px; }
.site-footer-inner { max-width: 1100px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 12px; font-size: .8rem; color: var(--muted); }
.site-footer-inner a { color: var(--muted); text-decoration: none; }
.site-footer-inner a:hover { color: var(--text); }

/* ── Impressum / Datenschutz ─────────────────────────────────────────────── */
.legal-page { max-width: 760px; margin: 24px 0 48px; }
.legal-page h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 8px; }
.legal-page h2 { font-size: 1.05rem; font-weight: 600; margin: 24px 0 8px; color: var(--text); }
.legal-page p, .legal-page li { font-size: .9rem; line-height: 1.7; margin-bottom: 10px; }
.legal-page ul { padding-left: 20px; margin-bottom: 10px; }
.legal-page a { color: var(--accent); }
.legal-note { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; font-size: .82rem !important; color: var(--muted); margin-top: 24px; }

/* ── Öffentlich / Privat Badges ───────────────────────────────────────── */
.badge-public  { background: #d4edda; color: #155724; }
.badge-private { background: #e9ecef; color: #6c757d; }

/* ── GPX Streckenkarte ───────────────────────────────────────────────────── */
.gpx-map-section { margin-top: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.gpx-map-header { display: flex; align-items: center; gap: 8px; padding: 14px 20px 12px; border-bottom: 1px solid var(--border); }
.gpx-map-header svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.gpx-map-header h3 { font-size: .95rem; font-weight: 600; margin: 0; }
.gpx-map-stats { margin-left: auto; display: flex; gap: 16px; font-size: .8rem; color: var(--muted); }
.gpx-map-stats span { display: flex; align-items: center; gap: 4px; }
.gpx-map-container { height: 400px; }
@media (max-width: 700px) { .gpx-map-container { height: 260px; } }
