/* Nekrologi Pabianic — style.css */
:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #2b2926;
  --muted: #7d766c;
  --line: #e5e0d6;
  --accent: #8b7355;
  --ph-male: #e8ecef;
  --ph-female: #f0e9e4;
  --ph-none: #eceae5;
}
* { box-sizing: border-box; }
html { overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* nagłówek + zakładki (wspólny sticky) */
.hdr {
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 6px rgba(0,0,0,.18);
}
.top {
  background: #26231f;
  color: #f4f1ea;
}
.tabs {
  background: #26231f;
  border-top: 1px solid rgba(255,255,255,.08);
}
.tabs-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 4px;
}
.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #b9b0a2;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px 9px;
  cursor: pointer;
  touch-action: manipulation;
}
.tab.active { color: #f4f1ea; border-bottom-color: #cbb593; }
.tab:active { color: #f4f1ea; }
.top-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.cross { width: 30px; height: 30px; fill: #cbb593; flex: 0 0 auto; }
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 600;
  margin: 0;
  letter-spacing: .2px;
}
.sub { margin: 1px 0 0; font-size: 12px; color: #b9b0a2; }
.install {
  background: #cbb593;
  color: #26231f;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* sterowanie */
.controls {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.controls-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  align-items: center;
}
#q {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font-size: 16px; /* >=16px: brak auto-zoomu na iOS */
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
}
#q:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
#mf {
  padding: 10px 8px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  max-width: 170px;
}
.count { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* lista */
.list {
  max-width: 860px;
  margin: 0 auto;
  padding: 14px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  gap: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.ph {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--ph-none);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.ph.male { background: var(--ph-male); }
.ph.female { background: var(--ph-female); }
.ph .mono {
  font-family: Georgia, serif;
  font-size: 26px;
  color: #8d8478;
  letter-spacing: 1px;
}
.ph img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.body { flex: 1; min-width: 0; }
.body h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 600;
  margin: 2px 0 4px;
  line-height: 1.25;
  overflow-wrap: break-word;
}
.maiden { font-size: 14px; color: var(--muted); font-weight: 400; }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.funeral { font-size: 13.5px; color: var(--ink); margin: 2px 0; }
.place {
  font-size: 13px;
  color: var(--muted);
  margin: 2px 0 6px;
}
.text {
  margin: 6px 0 0;
  font-size: 14.5px;
  color: #45413b;
  white-space: normal;
}
.text.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.more {
  background: none;
  border: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0 0;
  cursor: pointer;
  touch-action: manipulation;
}
.src { margin-top: 8px; font-size: 12.5px; }
.src a { color: var(--muted); text-decoration: none; }
.src a:hover { color: var(--accent); text-decoration: underline; }

/* plakietki NŻP */
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
}
.badge.zy { color: var(--accent); background: #f1ece3; border: 1px solid #e0d6c6; }
.badge.zy:hover { text-decoration: underline; }
.badge.only { color: var(--muted); background: #efece6; border: 1px solid var(--line); }

/* karta Zasłużeni */
.zasl-card { flex-direction: column; gap: 10px; }
.zphoto { width: 100%; }
.zphoto img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.zcap { font-size: 12px; color: var(--muted); margin-top: 5px; }
.ph.big { width: 96px; height: 96px; border-radius: 16px; align-self: flex-start; }
.ph.big .mono { font-size: 34px; }
.zcat {
  align-self: flex-start;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--accent);
  background: #f1ece3;
  border: 1px solid #e0d6c6;
  padding: 2px 9px;
  border-radius: 999px;
  margin-bottom: 4px;
}
.zsub { font-size: 14.5px; color: var(--ink); margin: 2px 0 6px; }
.zsrc { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }

/* toast (autoodświeżanie danych) */
.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(16px);
  background: #26231f;
  color: #f4f1ea;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 30;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty {
  max-width: 860px;
  margin: 30px auto;
  text-align: center;
  color: var(--muted);
}

.foot {
  border-top: 1px solid var(--line);
  padding: 18px 16px 28px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.foot a { color: var(--accent); }
.foot-sub { font-size: 12px; margin-top: 4px; color: #a49c90; }

/* mobile */
@media (max-width: 560px) {
  .top-inner { padding: 12px 12px 10px; }
  h1 { font-size: 18px; }
  .cross { width: 26px; height: 26px; }
  .controls-inner { padding: 8px 12px; flex-wrap: wrap; }
  .tabs-inner { padding: 0 12px; overflow-x: auto; }
  #mf { flex: 1; max-width: none; }
  .count { width: 100%; text-align: right; }
  .list { padding: 10px 12px 32px; gap: 10px; }
  .card { padding: 12px; gap: 12px; }
  .ph { width: 62px; height: 62px; }
  .ph .mono { font-size: 22px; }
  .body h2 { font-size: 17px; }
}
