:root {
  --ink: #1d1b2e;
  --muted: #6b6880;
  --paper: #fff8ec;
  --card: #fffdf7;
  --sun: #ffd23f;
  --coral: #ff5a5f;
  --teal: #2ec4b6;
  --violet: #7c5cff;
  --line: rgba(29, 27, 46, .14);
  --shadow: 0 14px 34px rgba(29, 27, 46, .1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% -4%, rgba(255, 210, 63, .5), transparent 24rem),
    radial-gradient(circle at 4% 40%, rgba(46, 196, 182, .14), transparent 22rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 20px;
}

/* ---------- nagłówek ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 74px;
  padding: 0 max(16px, calc((100% - 980px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 248, 236, .88);
  backdrop-filter: blur(6px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -.03em;
  font-size: 1.1rem;
  text-decoration: none;
}

.mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px 4px 11px 4px;
  background: var(--ink);
  color: var(--sun);
  font-size: .95rem;
  font-weight: 900;
  transform: rotate(-3deg);
}

nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: .92rem;
  font-weight: 700;
}

nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--ink); }

nav a.primary {
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
}

nav a.primary:hover { background: #2f2b4a; }

nav form { margin: 0; }

button.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button.link:hover { color: var(--coral); }

/* ---------- komunikaty ---------- */
.flashes { margin: 18px 0 0; }

.flash {
  margin: 0 0 8px;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: .92rem;
}

.flash.ok { background: rgba(46, 196, 182, .16); color: #16766d; }
.flash.error { background: rgba(255, 90, 95, .14); color: #b0272c; }

/* ---------- intro ---------- */
.intro { padding: 46px 0 26px; }

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1;
  letter-spacing: -.05em;
}

.intro p { margin: 14px 0 0; color: var(--muted); line-height: 1.6; }

.admin-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }

/* ---------- galeria ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding-bottom: 20px;
}

.post {
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px 8px 22px 8px;
  box-shadow: var(--shadow);
}

.shot { display: block; background: #efe7d8; }

.shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.post-body { padding: 16px 18px 18px; }

.date {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.post-body h2 { margin: 6px 0 0; font-size: 1.15rem; letter-spacing: -.02em; }

.text {
  margin: 8px 0 0;
  color: #4a4760;
  line-height: 1.6;
  white-space: pre-line;
}

.tools { margin: 12px 0 0; font-size: .85rem; }
.tools a { color: var(--violet); font-weight: 700; text-decoration: none; }

/* ---------- pusty stan ---------- */
.empty {
  margin: 10px 0 40px;
  padding: 44px 28px;
  border: 2px dashed var(--line);
  border-radius: 24px 8px 24px 8px;
  text-align: center;
  background: rgba(255, 255, 255, .5);
}

.empty-title { margin: 0 0 6px; font-size: 1.3rem; font-weight: 900; letter-spacing: -.02em; }
.empty p { margin: 0; color: var(--muted); }
.empty .btn { margin-top: 20px; }

/* ---------- formularze ---------- */
.panel {
  margin: 34px 0;
  padding: 30px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px 8px 26px 8px;
  box-shadow: var(--shadow);
}

.panel.narrow { max-width: 460px; margin-inline: auto; }
.panel h1 { font-size: clamp(1.7rem, 4vw, 2.2rem); }
.note { margin: 12px 0 0; color: var(--muted); line-height: 1.6; }
.note.small { font-size: .88rem; }
.note a { color: var(--violet); font-weight: 700; }

.form { display: grid; gap: 16px; margin-top: 20px; }

.form label { display: grid; gap: 7px; font-weight: 700; font-size: .95rem; }

.form input[type="text"],
.form input[type="password"],
.form textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.form input[type="file"] {
  width: 100%;
  padding: 12px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: #fffdf7;
  font: inherit;
}

.form textarea { resize: vertical; min-height: 130px; }

.form input:focus, .form textarea:focus { outline: 2px solid rgba(124, 92, 255, .45); outline-offset: 1px; }

.hint { color: var(--muted); font-size: .82rem; font-weight: 500; }

.preview {
  width: 180px;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* ---------- przyciski ---------- */
.btn {
  display: inline-block;
  padding: 12px 20px;
  border: 0;
  border-radius: 13px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { background: #2f2b4a; }
.btn:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

.btn.small { padding: 9px 14px; font-size: .88rem; border-radius: 11px; }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn.ghost:hover { background: rgba(29, 27, 46, .06); }
.btn.danger { background: var(--coral); }
.btn.danger:hover { background: #e2454a; }

/* ---------- lista wpisów (panel) ---------- */
.list { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }

.row {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px 6px 18px 6px;
}

.row-thumb {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 12px;
}

.row-main p { margin: 0; }
.row-title { margin: 4px 0 0 !important; font-weight: 800; }
.row-text { margin: 4px 0 0 !important; color: var(--muted); font-size: .88rem; line-height: 1.5; }

.row-actions { display: flex; gap: 8px; align-items: center; }
.row-actions form { margin: 0; }

/* ---------- stopka ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 40px;
  padding: 24px 0 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .86rem;
}

.foot a { color: var(--violet); font-weight: 700; text-decoration: none; }
.dim { opacity: .7; }

@media (max-width: 640px) {
  .top { min-height: 66px; padding: 0 16px; }
  nav { gap: 12px; font-size: .88rem; }
  nav a.primary { padding: 8px 12px; }
  .intro { padding: 32px 0 20px; }
  .panel { padding: 22px; }
  .row { grid-template-columns: 60px 1fr; }
  .row-thumb { width: 60px; height: 60px; }
  .row-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
