/* Shared by /admin and /write (the writers' page). */
:root { --paper: #F5F2EA; --ink: #1B2433; --head: #7F2A1F; --blue: #1F3F66; --rule: #C9C4B8; --muted: #55565E; --card: #fff; }
* { box-sizing: border-box; }
body { margin: 0; background: #2E3440; color: var(--ink); font-family: 'Old Standard TT', Georgia, serif; font-size: 16px; }
.sheet { max-width: 860px; margin: 0 auto; min-height: 100vh; background: var(--paper); padding: 20px 16px 60px; }
h1 { font-family: 'Abril Fatface', Georgia, serif; font-weight: 400; font-size: 34px; margin: 0; }
/* The page name goes to the homepage when clicked. */
.home-title { color: inherit; text-decoration: none; }
.home-title:hover { text-decoration: underline; }
h1 small { font-family: 'Old Standard TT', Georgia, serif; font-size: 16px; color: var(--head); margin-left: 8px; }
h2 { font-family: 'Abril Fatface', Georgia, serif; font-weight: 400; font-size: 30px; line-height: 1.1; letter-spacing: 0.3px; color: var(--head); border-bottom: 3px solid var(--ink); padding-bottom: 6px; margin: 0 0 14px; }
/* The admin is wider than the writers' page, for its sidebar. */
.sheet.wide { max-width: 1120px; }
/* The admin: a sidebar of its parts, each its own button, and the part picked beside it. */
.admin-app { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 20px; }
.side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px; }
.side a { display: block; padding: 14px 16px; border: 1px solid var(--rule); border-left: 5px solid var(--rule); border-radius: 4px; background: var(--card); color: var(--ink); font-weight: 700; font-size: 17px; text-decoration: none; }
.side a:hover { border-left-color: var(--head); }
.side a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); border-left-color: var(--head); }
.side a:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.block { padding: 0 0 24px; }
/* Phones and narrow windows: the parts as a row of buttons above, two to a line. */
@media (max-width: 760px) {
  .admin-app { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .side { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .side a { padding: 12px; font-size: 16px; text-align: center; border-left-width: 1px; border-bottom: 4px solid var(--rule); }
  .side a[aria-current="page"] { border-bottom-color: var(--head); }
}
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--ink); padding-bottom: 10px; }
label { display: block; font-weight: 700; margin: 10px 0 4px; }
input[type=text], input[type=url], input[type=password], select, textarea { width: 100%; font: inherit; padding: 10px; border: 1px solid var(--muted); border-radius: 4px; background: var(--card); color: var(--ink); }
textarea { min-height: 70px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 700; margin: 10px 0; }
.check input { width: 22px; height: 22px; }
button { font: inherit; font-weight: 700; padding: 10px 16px; min-height: 44px; border-radius: 4px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; }
button.light { background: var(--card); color: var(--ink); }
button.warn { background: var(--head); border-color: var(--head); }
button.small { padding: 6px 10px; min-height: 36px; font-size: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 200px; }
.row > button { flex: 0 0 auto; }
ul.list { list-style: none; margin: 0; padding: 0; }
ul.list li { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-bottom: 1px dotted var(--rule); }
ul.list li .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
ul.list li .t a { color: var(--ink); font-weight: 700; text-decoration: none; }
ul.list li .t small { display: block; color: var(--muted); }
ul.list li .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 3px; margin-right: 6px; color: var(--paper); background: var(--blue); }
.tag.mine { background: var(--head); }
.msg { min-height: 1.4em; margin: 10px 0; font-weight: 700; }
.msg.err { color: var(--head); }
.msg.ok { color: var(--blue); }
.preview { margin: 10px 0; padding: 10px 14px; background: var(--head); color: var(--paper); font-weight: 700; text-align: center; border-radius: 2px; overflow: hidden; }
.preview.scrolling { text-align: left; white-space: nowrap; }
.preview.scrolling span { display: inline-block; padding-left: 100%; animation: ann-preview 14s linear infinite; }
@keyframes ann-preview { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .preview.scrolling span { animation: none; padding-left: 0; } }
.emoji-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 8px 0 4px; }
.emoji-label { font-size: 14px; font-weight: 700; margin-right: 4px; }
#annEmoji { display: flex; flex-wrap: wrap; gap: 4px; }
button.emoji { min-height: 40px; min-width: 40px; padding: 4px; font-size: 22px; line-height: 1; background: var(--card); border-color: var(--muted); color: inherit; }
.ann-colors { border: 0; margin: 10px 0 0; padding: 0; }
.ann-colors legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
#annColors { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { display: inline-flex; margin: 0; font-weight: 700; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 4px; border: 3px solid transparent; }
.swatch input:checked + span { border-color: var(--ink); outline: 2px solid var(--card); outline-offset: -5px; }
.swatch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.hint { color: var(--muted); font-size: 14px; margin: 4px 0; }
.check input[type=radio] { width: 20px; height: 20px; }
.preview-head { margin: 8px 0; padding: 10px; background: var(--card); border: 1px solid var(--rule); border-radius: 4px; }
.preview-head small { color: var(--muted); }
.top-acts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.home { color: var(--blue); font-weight: 700; padding: 8px 0; }
#login { max-width: 380px; margin: 40px auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
ul.list li .t input { margin-bottom: 4px; }
/* Phones: the buttons go under the headline so it keeps the full width. */
@media (max-width: 600px) { ul.list li { flex-direction: column; gap: 6px; } ul.list li .acts { justify-content: flex-start; } }
[hidden] { display: none !important; }
/* Articles */
/* The article editor: shows the article as it will look. */
.ed-bar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; background: var(--paper); border: 1px solid var(--muted); border-bottom: 0; border-radius: 4px 4px 0 0; }
.ed-bar button { min-height: 40px; padding: 6px 12px; background: var(--card); color: var(--ink); border-color: var(--rule); font-size: 15px; }
.ed-bar button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ed-bar .b { font-weight: 900; } .ed-bar .i { font-style: italic; font-weight: 400; }
.ed { min-height: 380px; padding: 14px 16px; background: var(--card); border: 1px solid var(--muted); border-radius: 0 0 4px 4px; font-family: Georgia, serif; font-size: 18px; line-height: 1.6; outline: none; }
.ed:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(31,63,102,.25); }
.ed:empty::before { content: attr(data-placeholder); color: var(--muted); }
.ed p { margin: 0 0 1em; }
.ed h2 { margin: 1.2em 0 .4em; font-family: Georgia, serif; font-size: 1.2em; font-weight: 700; color: var(--ink); border: 0; padding: 0; }
.ed blockquote { margin: 1em 0; padding: 2px 0 2px 16px; border-left: 4px solid var(--head); font-style: italic; }
.ed a { color: var(--blue); }
.ed figure { margin: 1em 0; padding: 8px; border: 1px dashed var(--rule); border-radius: 4px; user-select: none; }
.ed figure img { display: block; max-width: 100%; height: auto; }
.ed figcaption { margin-top: 4px; font-size: 14px; color: var(--muted); font-family: Georgia, serif; }
.ed figcaption .credit { text-transform: uppercase; font-size: 12px; }
.ed .fig-acts { display: flex; gap: 6px; margin-top: 6px; }
.photo { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin: 6px 0; }
.photo img { width: 160px; height: auto; border: 1px solid var(--rule); border-radius: 3px; }
.photo .fields { flex: 1 1 260px; }
.tag.draft { background: var(--muted); }
.file-btn { display: inline-block; }
.editing { padding: 8px 12px; background: var(--card); border-left: 4px solid var(--head); font-weight: 700; }
/* Phones: the page name on one line, the links and Log out under it. */
@media (max-width: 600px) { .top { flex-direction: column; align-items: flex-start; } .top-acts { justify-content: flex-start; } h1 { font-size: 28px; } h2 { font-size: 26px; } }
/* Edition search (any edition by name or ZIP): the matches drop under the box. */
.ed-search { position: relative; }
.ed-results { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 2px); margin: 0; padding: 4px 0; list-style: none; background: var(--card); border: 1px solid var(--muted); border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.15); max-height: 320px; overflow-y: auto; }
.ed-results li { padding: 9px 12px; cursor: pointer; }
.ed-results li small { color: var(--muted); }
.ed-results li[aria-selected="true"], .ed-results li[data-i]:hover { background: var(--ink); color: var(--paper); }
.ed-results li[aria-selected="true"] small, .ed-results li[data-i]:hover small { color: var(--paper); }
.ed-results li.none { color: var(--muted); cursor: default; }
/* Red headlines and pictures (/look-picker.js). The red is the site's (the section-header marks). */
.tag.red { background: #C8102E; }
.tag.fire { background: #e8590c; }
.fire-btn img { height: 1.1em; width: auto; vertical-align: -0.2em; }
.look { margin: 8px 0; padding: 4px 14px 10px; background: var(--card); border: 1px solid var(--rule); border-radius: 4px; }
.look .red-word { color: #C8102E; }
.look-img { border: 0; margin: 4px 0 0; padding: 0; }
.look-img legend { font-weight: 700; padding: 0; margin: 6px 0 2px; }
.look-img .check { margin: 6px 0; font-weight: 400; }
.look-own { margin: 4px 0 0 32px; }
.look-own img { display: block; width: 240px; max-width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--rule); border-radius: 3px; margin-bottom: 6px; }
.look-head { margin: 16px 0 0; font-size: 16px; }
ul.list li.looking { flex-direction: column; }
ul.list li.looking .t { width: 100%; }
