/* Redaktionssystem */
@font-face { font-family: "Raleway"; font-weight: 500; font-display: swap; src: url(../../assets/fonts/raleway-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Raleway"; font-weight: 700; font-display: swap; src: url(../../assets/fonts/raleway-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 500; font-display: swap; src: url(../../assets/fonts/space-grotesk-latin-500-normal.woff2) format("woff2"); }

:root { --ink: #2D2D2A; --muted: #6B6A63; --line: #DEDAD0; --bg: #F5F3EE; --card: #fff; --yellow: #EDD286; --ok: #2F7D4F; --warn: #C2410C; --err: #A12A12; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 15px/1.5 Raleway, system-ui, sans-serif; }
a { color: var(--ink); }
h1, h2 { font-family: "Space Grotesk", system-ui, sans-serif; font-weight: 500; letter-spacing: -.03em; }
h1 { font-size: 2rem; margin: 0 0 4px; line-height: 1.1; }
h2 { font-size: 1.3rem; margin: 0 0 14px; }
code { background: #0000000d; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
input, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=file]), textarea { width: 100%; padding: 10px 12px; border: 1px solid #CFCAC0; border-radius: 8px; background: #fff; }
input:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px #2d2d2a1f; }
textarea { resize: vertical; }

.shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; background: var(--ink); color: #EAE6DD; padding: 22px 14px; }
.side a { color: inherit; text-decoration: none; }
.side__brand { display: block; padding: 0 10px 18px; font-family: "Space Grotesk"; font-size: 1.35rem; letter-spacing: -.03em; color: var(--yellow) !important; }
.side__brand span { display: block; font-family: Raleway; font-size: .8rem; letter-spacing: 0; color: #EAE6DDb3; }
.side__label { margin: 18px 10px 6px; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #EAE6DD99; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.side nav a:hover { background: #ffffff14; }
.side nav a[aria-current="page"] { background: var(--yellow); color: var(--ink); }
.side__add { color: var(--yellow) !important; }
.side nav a[aria-current="page"].side__add { color: var(--ink) !important; }
.dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #8A877E; }
.dot--on { background: #5BC48A; }
.side__foot { margin-top: auto; padding: 18px 10px 0; display: grid; gap: 8px; font-size: .9rem; }
.side__foot .linklike { color: #EAE6DDcc; }

.main { padding: 32px clamp(18px, 4vw, 48px) 80px; max-width: 1040px; }
.flash { margin-bottom: 20px; padding: 12px 16px; border-radius: 10px; background: #E5F3EA; color: #1D5235; border: 1px solid #BFE0CB; }
.flash--error { background: #FBEAE5; color: var(--err); border-color: #F0C3B6; }
.eyebrow { margin: 0 0 4px; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.edit__head { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 16px 0 18px; margin: -16px 0 18px; background: var(--bg); border-bottom: 1px solid var(--line); }
.edit__head a { font-size: .9rem; }
.edit__actions { display: flex; align-items: center; gap: 16px; }
.edit__foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.hint { color: var(--muted); font-size: .92rem; margin: 0 0 16px; }

.card { margin: 0 0 20px; padding: 22px 24px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
fieldset.card { padding-top: 10px; }
.card legend { padding: 0 6px; margin-left: -6px; font-family: "Space Grotesk"; font-size: 1.15rem; letter-spacing: -.02em; }
.narrow { max-width: 520px; }
.fld { display: grid; gap: 6px; margin: 16px 0; }
.fld label, .lbl { font-weight: 700; font-size: .9rem; }
.fld small { color: var(--muted); font-size: .82rem; }

.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; cursor: pointer; }
.btn:hover { background: #000; }
.btn--quiet { background: #ECE8DF; color: var(--ink); }
.btn--quiet:hover { background: #E1DCD0; }
.linklike { padding: 0; border: 0; background: none; color: var(--ink); text-decoration: underline; cursor: pointer; }
.linklike--danger { color: var(--err); }
.pill { padding: 4px 12px; border-radius: 999px; background: #ECE8DF; font-size: .85rem; color: var(--muted); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__ui { position: relative; width: 50px; height: 28px; border-radius: 999px; background: #C9C4B9; transition: background .15s; }
.switch__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003; transition: transform .15s; }
.switch input:checked + .switch__ui { background: var(--ok); }
.switch input:checked + .switch__ui::after { transform: translateX(22px); }
.switch input:focus-visible + .switch__ui { outline: 2px solid var(--ink); outline-offset: 2px; }
.switch [data-on] { display: none; color: var(--ok); }
.switch [data-off] { color: var(--warn); }
.switch input:checked ~ .switch__txt [data-on] { display: inline; }
.switch input:checked ~ .switch__txt [data-off] { display: none; }

.rte { border: 1px solid #CFCAC0; border-radius: 8px; background: #fff; overflow: hidden; }
.rte:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px #2d2d2a1f; }
.rte__bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: #F7F5F0; border-bottom: 1px solid var(--line); }
.rte__bar button { min-height: 32px; padding: 0 10px; border: 1px solid transparent; border-radius: 6px; background: none; cursor: pointer; font-size: .85rem; }
.rte__bar button:hover { background: #fff; border-color: var(--line); }
.rte__area { min-height: 110px; max-height: 460px; overflow-y: auto; padding: 12px 14px; line-height: 1.6; }
.rte__area:focus { outline: none; }
.rte__area p { margin: 0 0 .8em; }
.rte__area a { color: #1F5FA8; }

.imgbox { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; align-items: start; }
.imgbox__prev { aspect-ratio: 4 / 3; display: grid; place-items: center; background: #F2EFE8; border: 1px dashed #CFCAC0; border-radius: 8px; overflow: hidden; }
.imgbox__prev img { width: 100%; height: 100%; object-fit: cover; }
.noimg { color: var(--muted); font-size: .85rem; }
.imgbox__ctl { display: grid; gap: 8px; }
.imgbox__ctl label:not(.filebtn):not(.check) { font-weight: 700; font-size: .85rem; margin-top: 4px; }
@media (max-width: 640px) { .imgbox { grid-template-columns: 1fr; } }
.filebtn { position: relative; display: inline-flex; align-items: center; justify-self: start; min-height: 40px; padding: 0 16px; border-radius: 999px; background: #ECE8DF; font-weight: 700; font-size: .88rem; cursor: pointer; }
.filebtn:hover { background: #E1DCD0; }
.filebtn:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.filebtn.has-file { background: #E5F3EA; color: #1D5235; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 500 !important; cursor: pointer; }

.gal { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 4px 0 10px; padding: 0; }
.gal__item { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #FBFAF7; }
.gal__item img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; }
.gal__item input:not([type=checkbox]) { padding: 6px 8px; font-size: .85rem; }
.gal__ctl { display: flex; align-items: center; gap: 6px; }
.gal__ctl button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.gal__ctl .check { margin-left: auto; }
.gal__item:has(input[type=checkbox]:checked) { opacity: .45; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl td, .tbl th { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tbl td:last-child { text-align: right; }
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #F6E3D9; color: var(--warn); font-size: .8rem; font-weight: 700; }
.status--on { background: #E5F3EA; color: var(--ok); }
.versions { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.versions li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.danger { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .9rem; }
.danger form { display: inline; }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--yellow); }
.auth__card { width: min(420px, 100%); padding: 32px; background: #fff; border-radius: 18px; box-shadow: 0 20px 50px #0000001f; }
.auth__brand { margin: 0 0 8px; font-family: "Space Grotesk"; color: var(--muted); }
.auth form { display: grid; gap: 8px; margin-top: 16px; }
.auth label { font-weight: 700; font-size: .9rem; margin-top: 6px; }
.auth button { margin-top: 14px; min-height: 46px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; cursor: pointer; }
.err { color: var(--err); background: #FBEAE5; padding: 10px 12px; border-radius: 8px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .edit__head { position: static; }
}
.okmsg { color: var(--ok); background: #E5F3EA; padding: 10px 12px; border-radius: 8px; }
.revs { list-style: none; margin: 0; padding: 0; }
.revs li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
details.card summary { cursor: pointer; font-family: "Space Grotesk"; font-size: 1.1rem; }
