/* Pagoria — start page editor (/strona/edycja) */
:root {
  --bg: #12201e; --panel: #1a2d2a; --panel-2: #213833; --line: rgba(247, 237, 209, .14);
  --text: #f1e8cf; --muted: rgba(241, 232, 207, .62); --gold: #e3b04b; --danger: #c45050;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
a { color: var(--gold); }

.ed-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: #0d1715; border-bottom: 1px solid var(--line); }
.ed-spacer { flex: 1; }
.ed-status { color: var(--muted); font-size: 14px; }
.ed-status.ok { color: #8fd18f; }
.ed-status.err { color: #ff9a8a; }

.ed-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; border: 0;
  background: linear-gradient(180deg, #f2c463, #b9822a); color: #2b1d07; font: 600 14px/1.2 inherit;
  text-decoration: none; cursor: pointer;
}
.ed-btn-ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.ed-btn-danger { background: var(--danger); color: #fff; }
.ed-btn-small { padding: 4px 9px; font-size: 13px; }
.ed-btn:disabled { opacity: .5; cursor: wait; }

.ed-locked { max-width: 520px; margin: 12vh auto; text-align: center; padding: 30px; background: var(--panel); border-radius: 14px; }

.ed-layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 52px); }
.ed-tabs { display: flex; flex-direction: column; gap: 4px; padding: 16px 10px; background: #0f1b19; border-right: 1px solid var(--line); }
.ed-tabs button { text-align: left; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.ed-tabs button:hover { background: var(--panel); }
.ed-tabs button.active { background: var(--panel-2); color: var(--gold); font-weight: 600; }

.ed-main { padding: 22px clamp(14px, 3vw, 34px) 60px; max-width: 1100px; }
.ed-pane { display: none; }
.ed-pane.active { display: block; }
.ed-pane h2 { margin: 0 0 4px; font-size: 24px; }
.ed-hint { margin: 0 0 18px; color: var(--muted); }

label { display: block; margin-bottom: 14px; color: var(--muted); font-size: 13px; font-weight: 600; }
.ed-field-label { margin: 4px 0 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
input:not([type="checkbox"]):not([type="file"]), textarea {
  display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border-radius: 8px;
  border: 1px solid var(--line); background: #0f1b19; color: var(--text); font: 15px/1.45 inherit;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid rgba(227, 176, 75, .5); border-color: transparent; }
.ed-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.ed-row label { flex: 0 0 200px; }
.ed-check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }
.ed-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

/* picture field */
.ed-image { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; padding: 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.ed-image-preview { width: 180px; height: 110px; flex: 0 0 auto; border-radius: 8px; background: #0b1412 center / contain no-repeat; border: 1px dashed var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.ed-image-tools { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ed-image-tools input { margin-top: 0 !important; font-size: 13px !important; }
.ed-image-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.ed-file { position: relative; overflow: hidden; }
.ed-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* lists */
.ed-list { display: flex; flex-direction: column; gap: 14px; }
.ed-card { padding: 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.ed-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ed-card-head strong { flex: 1; color: var(--gold); }
.ed-card .ed-image { background: var(--panel-2); }

.ed-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-top: 16px; }
.ed-gallery-item { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ed-gallery-item img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.ed-gallery-item .ed-gallery-tools { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.ed-gallery-item .ed-gallery-tools div { display: flex; gap: 6px; }

.ed-posts { display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: start; }
.ed-post-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.ed-post-list button { text-align: left; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; font: inherit; }
.ed-post-list button.active { border-color: var(--gold); }
.ed-post-list small { display: block; color: var(--muted); }
.ed-post-list .draft { color: #ff9a8a; }
.ed-post-form { padding: 18px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.ed-post-form h3 { margin: 0 0 14px; }

@media (max-width: 860px) {
  .ed-layout { grid-template-columns: 1fr; }
  .ed-tabs { flex-direction: row; overflow-x: auto; }
  .ed-tabs button { white-space: nowrap; }
  .ed-posts { grid-template-columns: 1fr; }
  .ed-image { flex-direction: column; }
}
