/* The notebook (notizen.html) and the quest journal (quests.html). Builds on style.css and on
   kampagne.css: the same parchment book, the same text styles (.k-view) and editor (.k-editor). */

body.journal[data-state="tor"] .j-tabs,
body.journal[data-state="laden"] .j-tabs,
body.journal[data-state="fehler"] .j-tabs { display: none; }

/* Karte · Notizen · Quests · Die Kampagne */
.j-tabs { display: flex; flex-wrap: wrap; gap: 6px; max-width: 1180px; margin: 0 auto 10px; }
.j-tabs a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
  border: 1px solid rgba(184,154,106,.55); border-radius: 3px; color: #e3d3b0; text-decoration: none;
  font: 400 17px/1 "IM Fell English SC", Georgia, serif; letter-spacing: .04em;
}
.j-tabs a:hover { color: #fff3da; border-color: var(--edge); }
.j-tabs a[aria-current="page"] { background: var(--paper); border-color: var(--edge); color: var(--ink); }

.j-book { padding: 0; overflow: hidden; }
.j-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); align-items: stretch; min-height: 70vh; }

/* The list on the left */
.j-side {
  display: flex; flex-direction: column; gap: 20px; padding: 22px 16px 26px 20px;
  background: rgba(233,217,180,.75); border-right: 1px solid rgba(109,82,53,.35);
}
.j-neu { min-height: 40px; font-size: 17px; }
.j-group { display: flex; flex-direction: column; min-width: 0; }
.j-grouphead {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px;
  padding: 0 0 4px 10px; border-bottom: 1px solid rgba(109,82,53,.3);
}
.j-grouphead h2 { margin: 0; font: 400 17px/1 "IM Fell English SC", Georgia, serif; letter-spacing: .06em; color: var(--sepia); }
.j-grouphead .link { margin: 0; font-size: 15.5px; }
.j-sort { flex: none; }
.j-sort button { padding: 3px 9px; border: 0; background: transparent; cursor: pointer; font-size: 14px; white-space: nowrap; }
.j-list { list-style: none; margin: 4px 0 0; padding: 0; }
.j-list a {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 10px;
  border: 1px solid transparent; border-radius: 3px; color: var(--ink); text-decoration: none; font-size: 18px; line-height: 1.2;
}
.j-list a:hover { background: rgba(251,244,226,.6); }
.j-list a[aria-current="page"] { background: var(--paper-3); border-color: var(--edge); }
.j-list .j-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.j-list .j-meta { font-style: italic; font-size: 14.5px; color: var(--sepia); white-space: nowrap; }
.j-list .j-leer { padding: 8px 10px; font-style: italic; font-size: 15.5px; color: var(--sepia); }
.j-hex { width: 15px; height: 15px; flex: none; fill: var(--paper-3); stroke: var(--sepia); stroke-width: 2; stroke-linejoin: round; }
.j-raute { width: 15px; height: 15px; flex: none; fill: var(--seal); stroke: none; }

/* The page on the right */
.j-page { padding: 30px 40px 36px; }
.j-zurueck { display: none; }
.j-kopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin-bottom: 18px; }
.j-titel { min-width: 0; }
.j-kicker { margin: 0 0 4px; font: 400 16.5px/1.2 "IM Fell English SC", Georgia, serif; letter-spacing: .06em; color: var(--sepia); }
.j-kopf h1 {
  margin: 0; font: 400 clamp(28px, 3.6vw, 38px)/1.1 "IM Fell English SC", Georgia, serif; letter-spacing: .03em;
  overflow-wrap: anywhere;
}
.j-kopfbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.j-kopfbtns .btn { display: inline-flex; align-items: center; min-height: 40px; text-decoration: none; }
.j-page .k-view > :first-child { margin-top: 0; }

/* [[1604]] reads "Feld 1604"; a link to a note that does not exist yet is dashed */
.wiki.feld {
  padding: 0 6px; border: 1px solid var(--edge); border-radius: 3px; background: var(--paper-3);
  font-size: .92em; white-space: nowrap; text-decoration: none !important;
}
.wiki.feld::before { content: "Feld "; }
.wiki.neu { text-decoration-style: dashed !important; }
/* A link into the quest journal carries the quest marker */
.wiki.quest::before, .j-vorschlag button.quest::before {
  content: ""; display: inline-block; width: .42em; height: .82em; margin: 0 .34em -.08em .05em;
  background: var(--seal); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}

.j-erwaehnt {
  display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 22px 0 0; padding-top: 12px; max-width: 70ch;
  border-top: 1px solid rgba(109,82,53,.3); font-size: 17px;
}
.j-erwaehnt span { color: var(--sepia); }
.j-erwaehnt a { color: var(--seal); text-underline-offset: 2px; }
.j-stand { margin: 10px 0 0; font-size: 14.5px; font-style: italic; color: var(--sepia); }
.j-leer-seite { max-width: 60ch; font-size: 18.5px; line-height: 1.55; }
.j-leer-seite p { margin: 0 0 .8em; }

/* Editor additions */
.j-felder { display: flex; gap: 10px; align-items: flex-end; }
.j-feld-titel { flex: 1; min-width: 0; }
.j-felder .field input { font-size: 18px; }
.j-hinweis { margin: 0; }
.j-werkzeug { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.j-werkzeug .btn { min-height: 40px; min-width: 40px; font-size: 16px; }
.j-trenner { width: 1px; height: 24px; margin: 0 6px; background: var(--edge); }
.j-vorschlag {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 6px 8px;
  background: var(--paper-3); border: 1px solid var(--edge); border-radius: 3px; font-size: 16px;
}
.j-vorschlag span { color: var(--sepia); font-style: italic; margin-right: 4px; }
.j-vorschlag button {
  padding: 3px 10px; border: 1px solid var(--edge); border-radius: 3px; background: var(--paper); cursor: pointer; font-size: 16px;
}
.j-vorschlag button:hover, .j-vorschlag button.erster { background: var(--paper-2); }
/* The preview is for reading: its links must not leave the editor. */
.journal .k-preview a { pointer-events: none; }
.journal .k-editor textarea { min-height: 46vh; }
.journal .k-editbar { margin: 0 0 4px; }

/* ---------- Quest journal ---------- */

/* Reading is the default; "Bearbeiten" brings out the forms (quests.js). On wide screens the
   button sits above the list, on phones also above an open goal. */
.q-modus { min-height: 40px; font-size: 17px; }
.q-seitenkopf { display: none; }

.q-neu { display: flex; gap: 6px; }
.q-neu > input, .q-zielneu > input, .q-um > input {
  flex: 1; min-width: 0; min-height: 40px; padding: 4px 10px; border: 1px solid var(--edge); border-radius: 2px;
  background: var(--paper-3); font-size: 17px;
}
.q-schalter { display: flex; flex-direction: column; gap: 2px; }
.q-schalter .check { margin: 0; min-height: 32px; align-items: center; font-size: 16px; }
.q-schalter .check input { margin-top: 0; width: 17px; height: 17px; }
.q-quest { display: flex; flex-direction: column; min-width: 0; }
.q-quest + .q-quest { margin-top: 16px; }
.q-quest h2 {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0; padding: 0 4px 4px 10px;
  border-bottom: 1px solid rgba(109,82,53,.3); font: 400 19px/1.2 "IM Fell English SC", Georgia, serif; letter-spacing: .03em;
  overflow-wrap: anywhere;
}
.q-quest h2 > span { flex: 1; min-width: 0; }
.q-quest h2 small { font: italic 14.5px/1 "EB Garamond", Georgia, serif; letter-spacing: 0; color: var(--sepia); white-space: nowrap; }
.q-quest.erledigt h2 > span { color: var(--sepia); }
.j-list a.erledigt .j-name { color: var(--sepia); text-decoration: line-through; }
.q-mehr { display: flex; flex-wrap: wrap; gap: 2px 14px; padding: 2px 10px 0; }
.q-mehr .link { margin: 0; font-size: 15.5px; min-height: 32px; }
.q-zielneu { display: flex; gap: 6px; padding: 4px 0 0 10px; }

/* The SL's important note: a seal in the list, a band with a pointing hand on the goal page */
.q-siegel {
  flex: none; align-self: center; display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%;
  background: var(--rose); color: #fbf4e2; font: 600 12px/1 "EB Garamond", Georgia, serif; font-style: normal; letter-spacing: 0; cursor: help;
}
.q-hinweis {
  display: flex; align-items: center; gap: 10px; margin: -4px 0 18px; padding: 9px 14px; max-width: 620px;
  border-left: 4px solid var(--rose); border-radius: 0 3px 3px 0; background: var(--rose-bg); font-size: 18px; line-height: 1.35;
}
.q-finger { flex: none; color: var(--rose-dunkel); font-size: 22px; line-height: 1; transform: translateY(1px); }

/* Hidden quests and goals: prepared by the SL, unlocked at the table (only the SL sees them) */
.q-neu, .q-zielneu { flex-wrap: wrap; }
.check.q-versteckt-neu { flex-basis: 100%; margin: 0; min-height: 30px; align-items: center; font-size: 15px; color: var(--sepia); }
.check.q-versteckt-neu input { margin-top: 0; width: 17px; height: 17px; }
.q-quest.versteckt h2 > span, .j-list a.versteckt .j-name { color: var(--sepia); font-style: italic; }
.q-quest.versteckt h2 { border-bottom-style: dashed; }
.j-list li.q-zu { display: flex; align-items: center; gap: 6px; }
.j-list li.q-zu a { flex: 1; min-width: 0; }
.btn.q-frei { flex: none; min-height: 34px; padding: 2px 12px; font-size: 15.5px; color: var(--ok); border-color: var(--ok); }
.q-mehr .btn.q-frei { margin: 4px 0 2px; }
.q-chip.versteckt { background: transparent; border: 1px dashed var(--sepia); color: var(--sepia); }
.q-versteckt {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 18px; padding: 8px 8px 8px 14px; max-width: 620px;
  border: 1px dashed var(--sepia); border-radius: 3px; font-size: 17px; font-style: italic; color: var(--sepia);
}
.q-versteckt span { flex: 1 1 200px; }
.q-versteckt .btn.q-frei { font-style: normal; min-height: 40px; }

.q-ort {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 18px; padding: 8px 8px 8px 14px; max-width: 620px;
  border: 1px dashed var(--edge); border-radius: 3px; background: var(--paper-3); font-size: 17px;
}
.q-ort .q-orttext { flex: 1 1 200px; }
.q-ort .link { margin: 0; font-size: 15.5px; }
.q-ort .btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; text-decoration: none; }
.q-ort .btn .j-raute { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.q-ohneort { margin: 0 0 18px; font-size: 17px; color: var(--sepia); }
.q-ohneort .link { margin-left: 4px; font-size: inherit; }
.q-chip {
  display: inline-block; margin-left: 10px; padding: 2px 9px; vertical-align: middle; border: 1px solid #6a1d14; border-radius: 3px;
  background: var(--seal); color: #fbf4e2; font: 400 15px/1.3 "EB Garamond", Georgia, serif; letter-spacing: 0; white-space: nowrap;
}
.q-chip.erledigt { background: transparent; border-color: var(--ok); color: var(--ok); }

.q-eintraege { list-style: none; margin: 0 0 16px; padding: 0; max-width: 620px; font-size: 18.5px; line-height: 1.5; }
.q-eintraege li { display: flex; align-items: baseline; gap: 12px; padding: 5px 0; }
.q-eintraege li::before {
  content: ""; flex: none; width: 7px; height: 7px; background: var(--sepia); transform: translateY(-2px) rotate(45deg);
}
.q-eintraege .q-text { flex: 1; min-width: 0; overflow-wrap: break-word; }
.q-eintraege cite { font-style: italic; font-size: 16px; color: var(--sepia); white-space: nowrap; }
.q-eintraege a { color: var(--seal); text-underline-offset: 2px; }
.q-eintraege button {
  flex: none; min-width: 32px; min-height: 32px; padding: 0 6px; border: 0; background: none; color: var(--sepia); cursor: pointer; font-size: 18px;
}
.q-eintraege button:hover, .q-eintraege button.armed { color: var(--seal); }
.q-eintraege button.armed { font-size: 15px; font-style: italic; }
.q-keine { margin: 0 0 16px; font-style: italic; color: var(--sepia); }

.q-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; max-width: 620px; }
.q-form input {
  min-width: 0; min-height: 42px; padding: 4px 10px; border: 1px solid var(--edge); border-radius: 2px; background: var(--paper-3); font-size: 18px;
}
.q-form .q-wer { grid-column: 1 / -1; max-width: 260px; font-size: 16px; min-height: 36px; }
.q-form .btn { min-height: 42px; }
.q-zaehler { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; color: var(--sepia); }
.q-zaehler i { font-style: italic; }
.q-zaehler span { flex: none; white-space: nowrap; }
.q-zaehler .voll { color: var(--seal); }

.q-fuss {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 22px; padding-top: 14px; max-width: 620px;
  border-top: 1px solid rgba(109,82,53,.3);
}
.q-fuss .btn { min-height: 40px; }
.q-fuss .btn.fertig { color: var(--ok); border-color: var(--ok); }
.q-verwalten { flex-basis: 100%; font-size: 16px; }
.q-verwalten summary { cursor: pointer; font-style: italic; color: var(--sepia); }
.q-um { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.q-um label { flex-basis: 100%; font-size: 14px; font-style: italic; color: var(--sepia); }

/* Phones and narrow windows: the list or the page, not both */
@media (max-width: 760px) {
  .j-tabs { gap: 4px; }
  .j-tabs a { flex: 1 1 auto; justify-content: center; min-height: 42px; padding: 0 8px; font-size: 16px; }
  .j-layout { grid-template-columns: 1fr; min-height: 0; }
  .j-side { border-right: 0; padding: 16px 14px 20px; }
  .j-page { padding: 14px 16px 24px; }
  body[data-seite="liste"] .j-page { display: none; }
  body[data-seite="seite"] .j-side { display: none; }
  .q-seitenkopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
  .q-seitenkopf .j-zurueck { margin-bottom: 0; }
  body[data-seite="liste"] .q-seitenkopf { display: none; }
  .j-zurueck {
    display: inline-flex; align-items: center; gap: 5px; min-height: 40px; margin-bottom: 4px;
    color: var(--seal); font-style: italic; font-size: 16.5px; text-decoration: none;
  }
  .j-zurueck::before { content: "‹"; }
  .q-ort .q-orttext { flex-basis: 100%; }
  .j-list a { min-height: 46px; }
  /* The list alone: no note or goal is open, so none is marked. */
  body[data-seite="liste"] .j-list a[aria-current="page"] { background: none; border-color: transparent; }
  .j-felder { flex-direction: column; align-items: stretch; }
  .j-trenner { display: none; }
  .j-kopfbtns { width: 100%; }
  .journal .k-editor textarea { min-height: 40vh; }
}
