/* Redaktionstool Glaubensjournal – Gestaltung nach Design-Sheet v1.4 */
@font-face { font-family: "Aleo"; src: url("../fonts/Aleo-Light.ttf"); font-weight: 300; }
@font-face { font-family: "Aleo"; src: url("../fonts/Aleo-Regular.ttf"); font-weight: 400; }
@font-face { font-family: "Aleo"; src: url("../fonts/Aleo-Italic.ttf"); font-weight: 400; font-style: italic; }
@font-face { font-family: "Aleo"; src: url("../fonts/Aleo-Bold.ttf"); font-weight: 700; }
@font-face { font-family: "Aleo"; src: url("../fonts/Aleo-BoldItalic.ttf"); font-weight: 700; font-style: italic; }
@font-face { font-family: "Yanone Kaffeesatz"; src: url("../fonts/YanoneKaffeesatz-Light.ttf"); font-weight: 300; }
@font-face { font-family: "Yanone Kaffeesatz"; src: url("../fonts/YanoneKaffeesatz-Regular.ttf"); font-weight: 400; }
@font-face { font-family: "Yanone Kaffeesatz"; src: url("../fonts/YanoneKaffeesatz-Bold.ttf"); font-weight: 700; }

:root {
  --gelb: #FAB20B; --gelb-hell: #FEF3D6;
  --text: #231F20; --meta: #636466; --linie: #DCDDDD;
  --kasten: #F1F2F2; --kasten-2: #F7F7F7;
  --gruen: #047131; --gruen-hell: #D2E9CE;
  --rot: #A3122A; --rot-hell: #FBE1E3;
  --st-open: #ECEDED; --st-progress: #FDEBB8; --st-done: #D2E9CE; --st-problem: #FBE1E3;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(35,31,32,.08), 0 4px 16px rgba(35,31,32,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Aleo", Georgia, serif; font-size: 15px; line-height: 1.5; color: var(--text); background: #fff; }
a { color: var(--text); text-decoration-color: var(--gelb); text-decoration-thickness: 2px; text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--text); }
h1, h2, h3, h4, .yk { font-family: "Yanone Kaffeesatz", "Arial Narrow", sans-serif; font-weight: 700; line-height: 1.05; margin: 0; }
h1 { font-size: 44px; } h2 { font-size: 28px; margin: 28px 0 12px; } h3 { font-size: 21px; margin: 20px 0 8px; } h4 { font-size: 17px; margin: 14px 0 6px; }
p { margin: 0 0 10px; }
.muted { color: var(--meta); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }

/* Kopf */
.topbar { height: 8px; background: var(--gelb); }
header.app { display: flex; align-items: center; gap: 28px; padding: 14px 28px; border-bottom: 1px solid var(--linie); background: #fff; position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand .t { font-family: "Yanone Kaffeesatz"; font-weight: 700; font-size: 30px; line-height: 1; }
.brand .s { font-family: "Yanone Kaffeesatz"; font-weight: 300; font-size: 20px; color: var(--meta); }
nav.main { display: flex; gap: 4px; flex-wrap: wrap; }
nav.main a { font-family: "Yanone Kaffeesatz"; font-size: 19px; text-decoration: none; padding: 4px 10px; border-radius: var(--radius); }
nav.main a:hover { background: var(--kasten); }
nav.main a.on { background: var(--gelb-hell); box-shadow: inset 0 -3px 0 var(--gelb); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--meta); }
.who form { margin: 0; }

main { padding: 26px 28px 60px; max-width: 1600px; margin: 0 auto; }
main.narrow { max-width: 760px; }
.pagehead { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead .sub { font-family: "Yanone Kaffeesatz"; font-weight: 700; font-size: 20px; color: var(--meta); margin-top: 4px; }
.pagehead .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.rubrikzeile { font-weight: 300; font-size: 13px; color: var(--text); margin-bottom: 6px; }
.rubrikzeile b { color: var(--gelb); font-weight: 400; }

/* Bausteine */
.btn { display: inline-flex; align-items: center; gap: 6px; font-family: "Yanone Kaffeesatz"; font-weight: 700; font-size: 18px; line-height: 1;
  padding: 8px 14px; border: 1.5px solid var(--text); border-radius: var(--radius); background: #fff; color: var(--text); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--kasten); }
.btn.primary { background: var(--gelb); border-color: var(--gelb); }
.btn.primary:hover { filter: brightness(.96); }
.btn.ghost { border-color: transparent; }
.btn.danger { border-color: var(--rot); color: var(--rot); }
.btn.sm { font-size: 16px; padding: 5px 10px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.card { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); padding: 18px 20px; }
.box { background: var(--kasten); padding: 14px 16px; border-radius: var(--radius); }
.box.green { background: var(--gruen-hell); }
.box.yellow { background: var(--gelb-hell); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } header.app { flex-wrap: wrap; padding: 12px 16px; } main { padding: 18px 16px 50px; } }

.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; background: var(--gruen-hell); }
.flash.error { background: var(--rot-hell); color: var(--rot); }
.flash.warn { background: var(--gelb-hell); }

/* Formulare */
label { display: block; font-size: 13px; color: var(--meta); margin: 10px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=url], select, textarea {
  width: 100%; font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid #C9CACB; border-radius: var(--radius); background: #fff; color: var(--text); }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gelb); outline-offset: 0; border-color: var(--gelb); }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; }
.check input { width: auto; }
.formrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.form-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
fieldset { border: 0; padding: 0; margin: 0; }
.help { font-size: 12px; color: var(--meta); margin-top: 4px; }

/* Tabellen */
table.t { border-collapse: collapse; width: 100%; font-size: 14px; }
table.t th { font-family: "Yanone Kaffeesatz"; font-weight: 700; font-size: 16px; text-align: left; background: var(--gruen-hell); padding: 7px 10px; }
table.t td { padding: 7px 10px; border-bottom: 1px solid var(--linie); vertical-align: top; }
table.t tr.off td { color: var(--meta); }

/* Status & Marken */
.chip { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 11px; height: 11px; border-radius: 2px; display: inline-block; flex: none; }
.st { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12.5px; white-space: nowrap; background: var(--st-open); }
.st.progress { background: var(--st-progress); } .st.done { background: var(--st-done); } .st.problem { background: var(--st-problem); color: var(--rot); }
.st.overdue { background: var(--st-problem); color: var(--rot); font-weight: 700; } .st.soon { box-shadow: inset 0 0 0 1.5px var(--gelb); }
.bar { height: 6px; background: var(--kasten); border-radius: 3px; overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--gruen); }
.badge { display: inline-block; font-size: 12px; padding: 0 7px; border-radius: 9px; background: var(--kasten); }
.badge.red { background: var(--rot-hell); color: var(--rot); } .badge.green { background: var(--gruen-hell); } .badge.yellow { background: var(--gelb-hell); }

/* Ausgabe-Karten */
.issuecard { display: block; text-decoration: none; position: relative; overflow: hidden; }
.issuecard:before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--gelb); }
.issuecard h3 { margin: 0 0 4px; font-size: 26px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13.5px; margin-top: 10px; }
.kv dt { color: var(--meta); } .kv dd { margin: 0; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--text); margin: 6px 0 16px; flex-wrap: wrap; }
.tabs a { font-family: "Yanone Kaffeesatz"; font-weight: 700; font-size: 20px; padding: 6px 16px 5px; text-decoration: none; border-radius: var(--radius) var(--radius) 0 0; color: var(--meta); }
.tabs a.on { background: var(--text); color: #fff; }
.tabs a:hover:not(.on) { background: var(--kasten); color: var(--text); }

/* Seitenplan-Tabelle */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.toolbar input[type=search] { width: 260px; font: inherit; padding: 7px 10px; border: 1px solid #C9CACB; border-radius: var(--radius); }
.toolbar .sp { flex: 1; }
#grid { height: calc(100vh - 290px); min-height: 420px; width: 100%; }
.ag-theme-quartz { --ag-font-family: "Aleo", Georgia, serif; --ag-font-size: 13.5px; --ag-header-background-color: var(--gruen-hell);
  --ag-header-foreground-color: var(--text); --ag-row-hover-color: #FFF8E6; --ag-selected-row-background-color: #FFF1CC;
  --ag-border-radius: 4px; --ag-wrapper-border-radius: 4px; --ag-row-height: 40px; --ag-header-height: 38px; --ag-active-color: var(--gelb);
  --ag-range-selection-border-color: var(--gelb); --ag-input-focus-border-color: var(--gelb); }
.ag-theme-quartz .ag-header-cell-text { font-family: "Yanone Kaffeesatz"; font-weight: 700; font-size: 16px; }
.cell-rubrik { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; }
.cell-rubrik:hover { text-decoration-color: var(--gelb); }
.cell-open { cursor: pointer; font-family: "Yanone Kaffeesatz"; font-weight: 700; font-size: 16px; }
.ag-cell.stc { padding-left: 6px; padding-right: 6px; }
.ag-cell .st { line-height: 20px; vertical-align: middle; }
.ag-theme-quartz .ag-cell { font-family: "Aleo", Georgia, serif; }

/* Seitenfenster */
.drawer-bg { position: fixed; inset: 0; background: rgba(35,31,32,.25); z-index: 40; display: none; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: #fff; z-index: 41; box-shadow: -8px 0 30px rgba(0,0,0,.15);
  transform: translateX(105%); transition: transform .18s ease; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-bg.open { display: block; }
.drawer .dh { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--linie); border-top: 6px solid var(--gelb); }
.drawer .dh .x { margin-left: auto; }
.drawer .db { overflow: auto; padding: 16px 20px 40px; flex: 1; }
.drawer h2 { margin-top: 22px; font-size: 24px; }
.drawer h2:first-child { margin-top: 0; }
.statusgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.statusgrid .s { background: var(--kasten-2); padding: 8px 10px; border-radius: var(--radius); }
.statusgrid .s.overdue, .statusgrid .s.problem { background: var(--rot-hell); }
.statusgrid .s.soon { background: var(--gelb-hell); }
.statusgrid .s .yk { font-size: 16px; display: block; margin-bottom: 3px; }
.statusgrid select { padding: 5px 8px; font-size: 14px; }
.statusgrid input[type=date] { padding: 4px 6px; font-size: 13px; margin-top: 5px; }
.files { list-style: none; padding: 0; margin: 0; }
.files li { border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.files .row1 { display: flex; gap: 10px; align-items: center; }
.files img.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 3px; background: var(--kasten); }
.check-ok { color: var(--gruen); } .check-bad { color: var(--rot); }
.comment { border-left: 3px solid var(--gelb); padding: 4px 0 4px 10px; margin-bottom: 10px; }
.comment .meta { font-size: 12px; color: var(--meta); }
.hist { font-size: 12.5px; color: var(--meta); }
.hist li { margin-bottom: 3px; }
.copybox { position: relative; }
.copybox pre, .copybox textarea { white-space: pre-wrap; background: var(--kasten); padding: 12px 14px; border-radius: var(--radius); font-family: "Aleo"; font-size: 13.5px; margin: 0; border: 0; width: 100%; }
.copybox .btn { position: absolute; top: 6px; right: 6px; background: #fff; }
.docs { display: flex; flex-direction: column; gap: 6px; }
.docs a.doc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--linie); border-radius: var(--radius); text-decoration: none; }
.docs a.doc:hover { border-color: var(--gelb); background: #FFFBF0; }
.docs .kind { font-family: "Yanone Kaffeesatz"; font-weight: 700; font-size: 16px; min-width: 110px; }
.preview { width: 100%; border: 1px solid var(--linie); border-radius: var(--radius); display: block; }

/* Zeitplan */
.timeline { width: 100%; overflow-x: auto; }
.timeline svg { min-width: 900px; width: 100%; height: auto; display: block; }
.ms-list .ms { border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; display: grid; grid-template-columns: 26px 1fr 170px; gap: 10px; align-items: start; }
.ms-list .ms.done { background: var(--kasten-2); }
.ms-list .ms.overdue { border-color: var(--rot); }
.ms-list .ms .name { font-family: "Yanone Kaffeesatz"; font-weight: 700; font-size: 20px; }
.ms-list .ms ul { list-style: none; padding: 0; margin: 6px 0 0; }
.ms-list .ms li { font-size: 13.5px; }

/* Ideen */
.idea { border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px 14px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.idea h4 { margin: 0; font-size: 20px; }
.idea .foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: auto; }
.idea .foot form { margin: 0; display: flex; gap: 6px; }
.idea .foot select { padding: 4px 6px; font-size: 13px; width: auto; }

/* Rubriken */
.rubcard { border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; background: #fff; }
.rubcard .img { height: 150px; background: var(--kasten) center/cover no-repeat; border-bottom: 4px solid var(--c, var(--gelb)); }
.rubcard .b { padding: 10px 14px; }
.rubcard h3 { margin: 0 0 4px; font-size: 22px; }
.rubcard.off { opacity: .55; }

/* Login */
.auth { max-width: 420px; margin: 8vh auto; }
.auth h1 { font-size: 52px; }
.auth .sub { font-family: "Yanone Kaffeesatz"; font-size: 22px; color: var(--meta); margin-bottom: 20px; }

.empty { color: var(--meta); padding: 20px; text-align: center; background: var(--kasten-2); border-radius: var(--radius); }

/* Vorschau aus Nextcloud */
.pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.pv-item { text-decoration: none; display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--linie); border-radius: var(--radius); background: #fff; }
.pv-item:hover { border-color: var(--gelb); background: #FFFBF0; }
.pv-thumb { width: 100%; aspect-ratio: 148 / 210; object-fit: contain; background: var(--kasten); border-radius: 3px; display: block; }
.pv-thumb.big { width: 170px; }
.pv-none { display: flex; align-items: center; justify-content: center; font-family: "Yanone Kaffeesatz"; font-weight: 700; font-size: 26px; color: var(--meta); }
.pv-name { font-size: 13px; word-break: break-word; line-height: 1.3; }

/* Status-Auswahl per Einzelklick */
.st-pop { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.st-pop button { border: 0; text-align: left; cursor: pointer; font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 12px; }
.st-pop button.cur { box-shadow: inset 0 0 0 2px var(--text); }
.st-pop button:hover { filter: brightness(.95); }
.ag-cell[col-id^="status."] { cursor: pointer; }
.frist-cell { display: inline-flex; align-items: center; gap: 6px; }
.remind { border: 1px solid var(--rot); color: var(--rot); background: #fff; border-radius: 10px; cursor: pointer; font: inherit; font-size: 12px; line-height: 18px; padding: 0 8px; position: relative; z-index: 1; }
.remind:hover { background: var(--rot-hell); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: var(--radius); z-index: 60; font-size: 14px; box-shadow: var(--shadow); }
.toast.error { background: var(--rot); }
