/* Responsive Trauerkarten-Layout + Hover-Dock */
:root{
  --bg: #eaf1ee;
  --paper: rgba(255,255,255,.66);
  --ink: #2b2b2b;
  --muted: rgba(43,43,43,.65);
  --line: rgba(43,43,43,.12);
  --accent: #c7a07b;
  --shadow: 0 18px 60px rgba(0,0,0,.10);
  --radius: 18px;
  --max: 1040px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color:var(--ink);
  background:
    radial-gradient(1200px 600px at 50% 10%, rgba(255,255,255,.65), transparent 60%),
    linear-gradient(180deg, var(--bg), #edf3f0 40%, #e9efec 100%);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.page{
  min-height:100%;
  display:flex;
  justify-content:center;
  padding: clamp(14px, 3vw, 40px) 14px 56px;
}

.card{
  width:min(var(--max), 100%);
  background: linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.55));
  border: 1px solid rgba(255,255,255,.7);
  border-radius: calc(var(--radius) + 10px);
  box-shadow: var(--shadow);
  overflow:hidden;
  position:relative;
}

.hero{
  padding: clamp(20px, 3.5vw, 46px) 18px 14px;
  text-align:center;
  position:relative;
}

.portrait-wrap{
  width: clamp(180px, 26vw, 280px);
  height: clamp(180px, 26vw, 280px);
  margin: 0 auto 16px;
  position:relative;
}
.portrait{
  position:absolute;
  inset: 0;
  border-radius: 999px;
  overflow:hidden;
  background: #eee;
  border: 6px solid rgba(255,255,255,.92);
  box-shadow: 0 12px 30px rgba(0,0,0,.10);
}
.portrait img{ width:100%; height:100%; object-fit:cover; display:block; }

.subtitle{
  margin: 6px 0 6px;
  font-size: 14px;
  color: rgba(43,43,43,.58);
  letter-spacing:.2px;
}
.name{
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: clamp(34px, 5vw, 56px);
  color: var(--accent);
  letter-spacing:.5px;
}
.dates{
  margin: 10px 0 0;
  font-size: clamp(16px, 2.3vw, 20px);
}
.dates strong{
  font-weight: 800;
  letter-spacing:.2px;
}

.content{
  padding: 14px clamp(14px, 3.2vw, 26px) clamp(18px, 4vw, 28px);
}

.panels{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items:start;
  justify-items:stretch;
  max-width: 980px;
  margin: 0 auto;
}

.panel{
  background: rgba(245,247,243,.80);
  border: 1px solid rgba(43,43,43,.10);
  border-radius: var(--radius);
  padding: 14px 14px 16px;
}

.panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 8px;
}
.panel h2{
  margin:0;
  font-size: 18px;
}
.count{
  min-width: 46px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(43,43,43,.12);
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(255,255,255,.6);
  font-weight: 700;
}

.form{ display:grid; gap:10px; margin-top: 10px; }
label{ display:grid; gap:6px; font-size: 13px; color: rgba(43,43,43,.72); }
input, textarea{
  width:100%;
  font: inherit;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(43,43,43,.14);
  background: rgba(255,255,255,.8);
  outline: none;
}
input:focus, textarea:focus{
  border-color: rgba(47,109,92,.45);
  box-shadow: 0 0 0 4px rgba(47,109,92,.12);
}
.btn{
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  cursor:pointer;
  font-weight: 700;
  background: linear-gradient(180deg, rgba(47,109,92,.95), rgba(47,109,92,.82));
  color: white;
}
.btn:active{ transform: translateY(1px); }

.hint{ margin: 0; font-size: 13px; color: rgba(43,43,43,.65); min-height: 18px; }
.muted{ color: var(--muted); font-size: 13px; margin: 10px 0 0; }

.list{
  margin-top: 12px;
  display:grid;
  gap: 10px;
}
.entry{
  background: rgba(255,255,255,.70);
  border: 1px solid rgba(43,43,43,.10);
  border-radius: 14px;
  padding: 10px 12px;
}
.entry .who{ font-weight: 800; }
.entry .when{ color: rgba(43,43,43,.55); font-size: 12px; margin-left: 8px; }
.entry .msg{ margin: 6px 0 0; color: rgba(43,43,43,.80); white-space: pre-wrap; }

.footer{
  padding: 14px 18px 20px;
  text-align:center;
  border-top: 1px solid rgba(43,43,43,.08);
  color: rgba(43,43,43,.55);
}

/* Hover-Dock (QR oben rechts + Icons rechts mittig) */
.dock{
  position:absolute;
  z-index: 5;
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.dock--top{ top: 14px; right: 14px; }
.dock--mid{ top: 50%; right: 14px; transform: translateY(-50%); }

.dock-item{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(43,43,43,.12);
  background: rgba(255,255,255,.74);
  color: var(--ink);
  text-decoration:none;
  box-shadow: 0 10px 28px rgba(0,0,0,.08);
  overflow:hidden;
  max-width: 56px; /* collapsed */
  transition: max-width .18s ease, transform .18s ease, background .18s ease;
}
.dock-emoji{
  font-size: 28px; /* bigger icons */
  line-height: 1;
}
.dock-label{
  white-space:nowrap;
  font-weight: 700;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity .18s ease, transform .18s ease;
}

.dock-item:hover{
  max-width: 260px; /* expanded */
  transform: translateX(-10px);
  background: rgba(255,255,255,.88);
}
.dock-item:hover .dock-label{
  opacity: 1;
  transform: translateX(0);
}

/* Modal */
.modal{ position:fixed; inset:0; display:none; z-index:20; }
.modal.is-open{ display:block; }
.modal-backdrop{
  position:absolute; inset:0;
  background: rgba(0,0,0,.35);
}
.modal-card{
  position:relative;
  width:min(520px, calc(100% - 28px));
  margin: 10vh auto 0;
  background: rgba(255,255,255,.92);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.65);
  box-shadow: 0 20px 70px rgba(0,0,0,.22);
  overflow:hidden;
}
.modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(43,43,43,.10);
}
.modal-head h3{ margin:0; font-size: 16px; }
.iconbtn{
  border:0;
  background: transparent;
  cursor:pointer;
  font-size: 18px;
  line-height: 1;
  padding: 6px 8px;
}
.modal-body{ padding: 14px; }
.qr{ width: 240px; height: 240px; object-fit: contain; display:block; margin: 6px auto 10px; }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size: 13px; }

/* Responsive rules */
@media (max-width: 920px){
  .panels{ grid-template-columns: 1fr; }
  .dock--mid{ top:auto; bottom: 14px; right: 50%; transform: translateX(50%); flex-direction:row; }
  .dock--mid .dock-item{ max-width: 56px; }
  .dock--mid .dock-item:hover{ transform: translateY(-8px); }
}

@media (max-width: 520px){
  .dock--top{ right: 10px; top: 10px; }
  .dock-emoji{ font-size: 30px; }
  .dock-item{ padding: 10px 10px; }
  .portrait-wrap{ margin-bottom: 12px; }
  .panel{ padding: 12px; }
}

/* === Floating Dock (QR / Diary / Gallery) – always visible === */
.fab-dock {
  position: fixed;
  right: 18px;
  top: 110px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 99999;
}

.fab {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
  overflow: visible;
}

.fab span {
  font-size: 26px; /* größer */
  line-height: 1;
}

.fab .label {
  position: absolute;
  right: 64px;
  white-space: nowrap;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  opacity: 0;
  transform: translateX(8px);
  transition: 180ms ease;
  pointer-events: none;
  font-size: 14px;
}

.fab:hover .label {
  opacity: 1;
  transform: translateX(0);
}

/* Mobile: Dock nach unten rechts */
@media (max-width: 720px) {
  .fab-dock {
    top: auto;
    bottom: 16px;
    right: 16px;
  }
  .fab .label {
    right: 0;
    bottom: 60px;
  }

/* === Floating Dock (QR / Diary / Gallery) – always visible === */
.fab-dock {
  position: fixed;
  right: 18px;
  top: 110px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 99999;
}

.fab {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
  overflow: visible;
}

.fab span {
  font-size: 26px; /* größer */
  line-height: 1;
}

.fab .label {
  position: absolute;
  right: 64px;
  white-space: nowrap;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  opacity: 0;
  transform: translateX(8px);
  transition: 180ms ease;
  pointer-events: none;
  font-size: 14px;
}

.fab:hover .label {
  opacity: 1;
  transform: translateX(0);
}

/* Mobile: Dock nach unten rechts */
@media (max-width: 720px) {
  .fab-dock {
    top: auto;
    bottom: 16px;
    right: 16px;
  }
  .fab .label {
    right: 0;
    bottom: 60px;
  }
}
}