/* PROTOTYP — zahodit. Pico.css (vendor/) styluje části s třídou .pico, tady jsou jeho
   barvy přepnuté na styl Aplikace a vlastní vzhled Článku. */

:root {
  --bg: #1b1b1b;
  --panel: #242424;
  --line: #323232;
  --text: #d9d9d5;
  --head: #f2f2ef;
  --muted: #8f948c;
  --accent: #c9e3a4;
  --accent-soft: rgba(201, 227, 164, .12);
  --warn: #e3c06a;
  --danger: #f0a090;

  /* Článek ve stylu Aplikace */
  --art-bg: #2b2b2b;
  --art-text: #d6d6d3;
  --art-head: #f2f2ef;
  --art-accent: #c9e3a4;
  --art-muted: #8b8f88;
  --art-line: #6d6f6a;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 17px/1.55 Manrope, system-ui, sans-serif; }
.spacer { flex: 1; }

/* --- Pico v barvách Aplikace --- */

.a[data-theme=dark] {
  --pico-font-family: Manrope, system-ui, sans-serif;
  --pico-font-size: 106.25%;
  --pico-background-color: var(--bg);
  --pico-color: var(--text);
  --pico-h1-color: var(--head);
  --pico-muted-color: var(--muted);
  --pico-muted-border-color: var(--line);
  --pico-border-radius: .55rem;
  --pico-primary: var(--accent);
  --pico-primary-background: var(--accent);
  --pico-primary-border: var(--accent);
  --pico-primary-underline: rgba(201, 227, 164, .5);
  --pico-primary-hover: #dcefc2;
  --pico-primary-hover-background: #dcefc2;
  --pico-primary-hover-border: #dcefc2;
  --pico-primary-focus: rgba(201, 227, 164, .3);
  --pico-primary-inverse: #1a1f15;
  --pico-secondary: #b9bdb5;
  --pico-secondary-border: #474a45;
  --pico-secondary-hover: var(--head);
  --pico-secondary-hover-border: #6a6e66;
  --pico-form-element-background-color: #262626;
  --pico-form-element-border-color: #3a3a3a;
  --pico-form-element-focus-color: var(--accent);
  --pico-code-background-color: #2b2b2b;
  --pico-code-color: #a9b3a0;
  --pico-table-border-color: var(--line);
  min-height: 100vh;
  background: var(--bg);
}

/* --- Horní lišta --- */

.a .a-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 14px 32px; background: rgba(27, 27, 27, .88); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.a .a-brand { display: flex; align-items: center; gap: 10px; font: 500 21px Lora, Georgia, serif; color: var(--head); text-decoration: none; }
.a-logo { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: #1a1f15; font: 600 17px Lora, Georgia, serif; }
.a-proj { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 2px 11px; }
.a .a-top a.secondary { color: var(--muted); text-decoration: none; font-size: 15px; }
.a .a-top a.secondary:hover { color: var(--head); }

/* --- Seznam POI --- */

.a .a-list { max-width: 1140px; margin: 44px auto; padding: 0 32px 140px; }
.a .a-list-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.a .a-list-head h1 { font: 500 38px/1.15 Lora, Georgia, serif; margin: 0; }
.a .a-list-head button { width: auto; margin: 0; padding: .65rem 1.3rem; font-weight: 600; }
.a .a-list table { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.a .a-list :is(th, td) { background: transparent; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.a .a-list th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.a .a-list tbody tr:last-child td { border-bottom: 0; }
.a .a-list tbody tr { cursor: pointer; transition: background .12s; }
.a .a-list tbody tr:hover { background: #2b2b2b; }
.a .a-list code { font-size: 13px; padding: .15rem .45rem; }
.a .a-poiname { color: var(--head); font-weight: 500; }
.a-muted { color: var(--muted); font-size: 15px; white-space: nowrap; }
.a-tag { display: inline-block; font-size: 12.5px; line-height: 1.6; padding: 1px 10px; margin: 2px 2px 2px 0; border-radius: 99px; border: 1px solid #3c3c3c; color: #c3c7bf; white-space: nowrap; }
.a-go { color: var(--accent); font-size: 14px; text-align: right; white-space: nowrap; opacity: 0; transition: opacity .12s; }
.a .a-list tbody tr:hover .a-go { opacity: 1; }

/* --- Editor: vlastnosti POI --- */

.a .a-doc { max-width: 880px; margin: 36px auto; padding: 0 32px 170px; }
.a .a-meta { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px 28px 26px; }
.a .a-meta > code { font-size: 13px; }
.a .a-name { font: 500 32px/1.2 Lora, Georgia, serif; color: var(--head); background: transparent; border: 0; border-bottom: 1px dashed #3d3d3d; border-radius: 0; box-shadow: none; padding: .3rem 0; height: auto; margin: 8px 0 22px; }
.a .a-name:focus { border-bottom-color: var(--accent); box-shadow: none; }
.a-props { display: grid; grid-template-columns: 110px 1fr; gap: 20px 12px; align-items: center; }
.a-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.a .a-type { width: auto; margin: 0; }
.a .a-type button { padding: .45rem 1.1rem; font-size: 15px; }
.a-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.a .a-pill { width: auto; margin: 0; padding: .3rem .95rem; font-size: 14.5px; font-weight: 500; border-radius: 99px; background: transparent; border: 1px solid #3c3c3c; color: #c3c7bf; box-shadow: none; }
.a .a-pill:hover { border-color: #6a6e66; color: var(--head); background: transparent; }
.a .a-pill.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* --- Editor: Článek --- */

.art { background: var(--art-bg); color: var(--art-text); font: 15px/1.65 Manrope, system-ui, sans-serif; }
.art figure img, .art .img-placeholder { width: 100%; display: block; aspect-ratio: 3 / 2; object-fit: cover; }
.art .img-placeholder { display: grid; place-items: center; background: repeating-linear-gradient(45deg, #353535 0 12px, #303030 12px 24px); color: var(--art-muted); font-size: 13px; }
.art .ph { color: var(--art-muted); font-style: italic; }

.a-article { margin-top: 28px; border-radius: 16px; padding: 46px 64px 54px 156px; }
.a-article .a-empty { text-align: center; margin: 0; }
.a-el, .a-line { position: relative; }
.a-gutter { position: absolute; left: -146px; top: 7px; width: 132px; text-align: right; font: 11px/1.3 ui-monospace, Menlo, monospace; color: #6f736c; word-break: break-all; transition: color .12s; }
.a-el:hover .a-gutter, .a-el:focus-within .a-gutter { color: var(--art-accent); }
.a-article :is(input, textarea) { display: block; width: 100%; margin: 0; background: transparent; border: 1px solid transparent; border-radius: 6px; color: inherit; font: inherit; text-align: inherit; padding: 4px 8px; resize: none; field-sizing: content; min-height: 0; }
.a-article :is(input, textarea):hover { border-color: #444; }
.a-article :is(input, textarea):focus { outline: none; border-color: var(--art-accent); background: #313131; }
.a-article ::placeholder { color: var(--art-muted); font-style: italic; }
.a-article .a-title { font: 500 30px/1.25 Lora, Georgia, serif; color: var(--art-head); text-align: center; border-bottom: 1px solid var(--art-line); border-radius: 0; width: 72%; margin: 0 auto 18px; }
.a-article .a-subtitle { color: var(--art-accent); text-align: center; width: 84%; margin: 0 auto 22px; }
.a-article .a-desc { width: 86%; margin: 10px auto; hyphens: auto; }
.a-el-image { margin: 30px 0; }
.a-figure { display: block; position: relative; cursor: pointer; }
.a-upload { position: absolute; right: 10px; bottom: 10px; font-size: 12px; background: rgba(0, 0, 0, .7); color: #fff; padding: 4px 10px; border-radius: 6px; opacity: 0; transition: opacity .12s; }
.a-figure:hover .a-upload, .a-figure .img-placeholder + .a-upload { opacity: 1; }
.a-article .a-caption { color: var(--art-accent); text-align: center; font-size: 13.5px; margin-top: 10px; }
.a-article .a-source { color: var(--art-muted); text-align: center; font-size: 12px; }
.a-tools { position: absolute; right: -52px; top: 0; display: flex; flex-direction: column; gap: 4px; opacity: 0; transition: opacity .12s; }
.a-el:hover .a-tools, .a-el:focus-within .a-tools { opacity: 1; }
.a-tools button { width: 30px; height: 28px; padding: 0; border-radius: 7px; background: #3a3a3a; border: 1px solid #4a4a4a; color: var(--art-text); font: 13px system-ui; cursor: pointer; }
.a-tools button:hover { background: #474747; color: #fff; }

.a .a-add { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.a .a-add button { width: auto; margin: 0; padding: .45rem 1.1rem; font-size: 15px; }

/* --- Ukládací lišta --- */

.a .a-savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 12px 32px; background: rgba(27, 27, 27, .9); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.a .a-savebar button { width: auto; margin: 0; padding: .55rem 1.3rem; }
.msg { font-size: 14px; padding: 5px 12px; border-radius: 8px; }
.msg-ok { background: var(--accent-soft); color: var(--accent); }
.msg-error { background: rgba(220, 90, 70, .15); color: var(--danger); }
.status { font-size: 14px; color: var(--muted); }
.status.is-dirty { color: var(--warn); font-weight: 600; }
.status.is-dirty::before { content: "● "; }

/* --- Panel se stavem (není součást návrhu) --- */

#state-toggle { position: fixed; right: 16px; bottom: 76px; z-index: 50; background: #f2f2ef; color: #111; border: 0; border-radius: 99px; padding: 6px 14px; font: 13px system-ui, sans-serif; cursor: pointer; box-shadow: 0 6px 24px rgba(0, 0, 0, .5); }
#state-toggle.on { background: #f0c040; }
#state-panel { position: fixed; right: 16px; bottom: 124px; width: 420px; max-height: 60vh; overflow: auto; background: #0d0d0d; color: #c9f0b0; font-size: 11px; padding: 12px; border-radius: 10px; z-index: 50; margin: 0; border: 1px solid #333; }

/* opravy po prvním náhledu */
.a-figure img, .a-figure .img-placeholder { width: 100%; max-width: 100%; display: block; aspect-ratio: 3 / 2; object-fit: cover; }
.a .a-meta .a-type { justify-self: start; width: auto; }
.a-article input[type=file] { display: none; }
.a-article { padding-left: 178px; }
.a-gutter { left: -168px; width: 156px; word-break: normal; overflow-wrap: anywhere; }

/* filtr podle Kategorií */
.a .a-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.a .a-filter .a-pill { font-size: 14px; }
.a-count { font-size: 12px; opacity: .6; margin-left: 2px; }
.a-tag.on { border-color: var(--accent); color: var(--accent); }
.a .a-list tbody tr.a-norows { cursor: default; }
.a .a-list tbody tr.a-norows:hover { background: transparent; }
.a .a-list .a-norows td { text-align: center; color: var(--muted); padding: 2rem; }

/* prázdná pole: čárkovaný rámeček a tlumený „Doplň …“, vyplněná pole bez rámečku */
.a .a-name:placeholder-shown { border: 1px dashed #4a4d47; border-radius: 10px; padding: .45rem .8rem; background: rgba(255, 255, 255, .02); }
.a .a-name::placeholder { color: #6c7069; font-size: 24px; font-style: italic; }
.a-article :is(input, textarea):placeholder-shown { border: 1px dashed #4a4d47; background: rgba(255, 255, 255, .02); }
.a-article :is(input, textarea):placeholder-shown:focus { border-style: solid; }
.a-article ::placeholder { color: #6c7069; }
.a-article .a-title:placeholder-shown { border-radius: 8px; border-bottom: 1px dashed #4a4d47; font-size: 20px; }
.a-el:not(.a-el-image):has(:placeholder-shown) .a-gutter::after { content: "prázdné"; display: block; margin-top: 3px; color: var(--warn); font: 10.5px/1.3 Manrope, system-ui, sans-serif; }
.a-figure .img-placeholder { display: grid; place-items: center; aspect-ratio: 5 / 2; border: 1px dashed #4a4d47; background: rgba(255, 255, 255, .02); color: #6c7069; }

/* hledání v seznamu */
.a .a-list-head input[type=search] { flex: 0 1 340px; margin: 0 0 0 auto; height: auto; padding-top: .55rem; padding-bottom: .55rem; font-size: 15px; }

/* ID Elementů dál od obsahu: u levého okraje karty, zarovnané doleva a tlumenější */
.a-article { padding-left: 240px; }
.a-gutter { left: -216px; width: 176px; text-align: left; font-size: 9.5px; color: #5d615a; }

/* otevřené POI v horní liště */
.a-crumb { display: flex; align-items: baseline; gap: 10px; min-width: 0; color: var(--head); font-size: 15px; }
.a-crumb-sep { color: var(--muted); }
.a .a-crumb code { font-size: 12px; padding: .1rem .4rem; }
.a-crumb-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* větší písmo v horní liště */
.a .a-top { padding-top: 16px; padding-bottom: 16px; }
.a .a-brand { font-size: 23px; }
.a-proj { font-size: 14.5px; padding: 3px 12px; }
.a-crumb { font-size: 18px; gap: 12px; }
.a .a-crumb code { font-size: 14px; }
.a .a-top a.secondary { font-size: 17px; }

/* --- Přihlášení a chybové stránky --- */

.a .a-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.a .a-login > * { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px 30px; }
.a .a-login .a-brand { display: flex; align-items: center; gap: 10px; font: 500 23px Lora, Georgia, serif; color: var(--head); margin-bottom: 22px; }
.a .a-login h2 { font: 500 24px Lora, Georgia, serif; margin: 0 0 8px; }
.a .a-login button { width: 100%; margin-top: 6px; }
.a .a-login .msg { margin: 0 0 14px; }

/* --- Odhlášení v horní liště --- */

.a .a-logout { margin: 0; }
.a .a-logout button { width: auto; margin: 0; padding: .4rem 1rem; font-size: 15px; }

/* --- Seznam POI v ostrém Adminu --- */

.a .a-list-head form { margin: 0; }
.a .a-poiname a { color: inherit; text-decoration: none; }
.a .a-poiname a:hover { text-decoration: underline; }

/* Výsledek uložení přímo na tlačítku */
.a .a-savebar #a-save { min-width: 9.5rem; transition: background-color .2s, border-color .2s; }
.a .a-savebar #a-save.a-save-saved { background: #7fc47a; border-color: #7fc47a; color: #10200f; }
.a .a-savebar #a-save.a-save-error { background: #d9634f; border-color: #d9634f; color: #fff; }
.a .msg-error { font-weight: 600; }

/* Nástroje Elementu (↑ ↓ ✕) v řádku, ne pod sebou: sloupec byl vyšší než krátký
   odstavec, přečníval do dalšího a myš cestou na ✕ přeskočila na jeho nástroje. */
.a-article { padding-right: 132px; }
.a-tools { flex-direction: row; right: -122px; top: 2px; }

/* Editor širší: vpravo místo pro nástroje Elementu v řádku, vlevo pro ID jako
   POI123/Image12Description na jednom řádku. */
.a .a-doc { max-width: 1020px; }

/* Element „patří“ celá šířka Článku včetně okrajů s ID a s nástroji: najetí kamkoli
   vedle odstavce ukáže jeho nástroje. Neviditelné pruhy jsou pod nástroji. */
.a-el::before, .a-el::after { content: ""; position: absolute; top: 0; bottom: 0; }
.a-el::before { left: -240px; width: 240px; }
.a-el::after { right: -132px; width: 132px; }
.a-tools { z-index: 1; }

/* Obsah patičky zarovnaný s prostředním sloupcem editoru (.a-doc: 1020 px včetně
   32px okrajů): hláška a stav na jeho levém, Uložit na jeho pravém okraji. */
.a .a-savebar { padding-left: max(32px, calc((100% - 1020px) / 2 + 32px)); padding-right: max(32px, calc((100% - 1020px) / 2 + 32px)); }

/* Patička menší a zřetelně oddělená od obsahu: plné pozadí, linka a stín nahoru. */
.a .a-savebar { padding-top: 9px; padding-bottom: 9px; gap: 12px; background: #161616; backdrop-filter: none; border-top: 1px solid #3a3a3a; box-shadow: 0 -10px 28px rgba(0, 0, 0, .55); }
.a .a-savebar button, .a .a-savebar #a-save { padding: .38rem 1.05rem; font-size: 15px; min-width: 0; }
.a .a-savebar #a-save { min-width: 8.5rem; }
.a .a-doc { padding-bottom: 120px; }

/* Archivace v seznamu: nenápadný koš na konci řádku */
.a .a-list .a-actions { width: 1%; text-align: right; }
.a .a-list .a-archive { width: auto; margin: 0; padding: .3rem .45rem; background: transparent; border: 1px solid transparent; color: #6f736c; line-height: 0; }
.a .a-list tr:hover .a-archive { color: var(--muted); }
.a .a-list .a-archive:hover { color: var(--danger); border-color: rgba(240, 160, 144, .4); background: rgba(220, 90, 70, .1); }
.a .a-list-message { margin: 0 0 14px; }

/* Hlavička stejně vysoká jako patička */
.a .a-top { padding-top: 9px; padding-bottom: 9px; }
.a .a-top .a-brand { font-size: 20px; }
.a .a-top .a-logo { width: 27px; height: 27px; font-size: 15px; }
.a .a-logout button { padding: .38rem 1.05rem; font-size: 15px; }
