/* BulletinCreate — the application, not the bulletin.
   The bulletin brings its own stylesheet and is rendered inside an iframe, so
   nothing here can reach it. That separation is the point: a rule added to
   tidy up the editor must not be able to change what comes out of the
   printer. */

:root {
    --ink:      #1c2024;
    --ink-soft: #5a6472;
    --line:     #dfe3e8;
    --bg:       #f4f6f8;
    --card:     #ffffff;
    --accent:   #1f4e79;
    --accent-d: #163a5a;
    --warn:     #9a5b00;
    --warn-bg:  #fff5e2;
    --bad:      #a32020;
    --bad-bg:   #fdeaea;
    --ok:       #1d6a3a;
    --ok-bg:    #e8f5ec;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

a { color: var(--accent); }

/* ── THE BAR ────────────────────────────────────────────────────────────── */

.bar {
    display: flex; align-items: center; gap: 22px;
    padding: 0 20px; height: 52px;
    background: var(--card); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 700; text-decoration: none; color: var(--ink); letter-spacing: -.2px; }
.brand span { color: var(--accent); }
.bar nav { display: flex; gap: 4px; margin-left: 8px; }
.bar nav a {
    padding: 6px 11px; border-radius: 6px; text-decoration: none;
    color: var(--ink-soft); font-size: 14px;
}
.bar nav a:hover { background: var(--bg); color: var(--ink); }
.bar nav a.on { background: var(--accent); color: #fff; }
.who { margin-left: auto; display: flex; align-items: center; gap: 14px;
       font-size: 13px; color: var(--ink-soft); }

main { padding: 20px; }

/* ── THE EDITOR: FIELDS ON THE LEFT, THE PAGE ON THE RIGHT ─────────────── */

/* Two columns, because the whole promise of the thing is that you see what
   you are making while you make it. Below 1000px they stack — the preview
   first, so a phone still opens on the bulletin rather than on a form. */
.editor { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.05fr);
          gap: 20px; align-items: start; max-width: 1500px; margin: 0 auto; }
@media (max-width: 1000px) {
    .editor { grid-template-columns: 1fr; }
    .editor .paper { order: -1; }
}

.card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 10px; padding: 16px 18px; margin-bottom: 16px;
}
.card > h2 { margin: 0 0 2px; font-size: 15px; }
.card > .hint { margin: 0 0 14px; font-size: 13px; color: var(--ink-soft); }

.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

label { display: block; font-size: 12px; font-weight: 600;
        color: var(--ink-soft); margin: 0 0 4px; }
label .note { font-weight: 400; text-transform: none; }

input[type=text], input[type=email], input[type=password],
input[type=date], input[type=time], input[type=datetime-local],
input[type=url], select, textarea {
    width: 100%; padding: 8px 10px; font: inherit; font-size: 14px;
    border: 1px solid var(--line); border-radius: 7px; background: #fff;
    color: var(--ink);
}
textarea { resize: vertical; min-height: 68px; line-height: 1.45; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(31,78,121,.13);
}
.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }

.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: 16px; height: 16px; margin: 0; }
.check label { margin: 0; font-size: 14px; font-weight: 400; color: var(--ink); }

/* ── BUTTONS ───────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 500;
    border: 1px solid var(--line); border-radius: 7px;
    background: #fff; color: var(--ink); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-d); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.small { padding: 5px 10px; font-size: 13px; }

/* ── THE PAPER ─────────────────────────────────────────────────────────── */

/* Sticky, so the page stays in view while the form is scrolled. */
.paper { position: sticky; top: 72px; }
.paper .tools {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.paper .tools .spacer { margin-left: auto; }
.paper iframe {
    width: 100%; height: 78vh; border: 1px solid var(--line);
    border-radius: 10px; background: #8b9199; display: block;
}
.saving { font-size: 12px; color: var(--ink-soft); }

/* When a page holds more than will fit, the PDF spills onto another sheet.
   The browser clips instead, so without this the office would never know. */
.toofull {
    margin-top: 10px; padding: 9px 12px; border-radius: 8px;
    background: var(--warn-bg); color: var(--warn); font-size: 13px;
    border: 1px solid #f0dcae;
}

/* ── MESSAGES ──────────────────────────────────────────────────────────── */

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.flash.ok   { background: var(--ok-bg);   color: var(--ok);   border: 1px solid #bfe3cc; }
.flash.bad  { background: var(--bad-bg);  color: var(--bad);  border: 1px solid #f0c2c2; }
.flash.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #f0dcae; }

/* ── SIGNING IN ────────────────────────────────────────────────────────── */

.gate { max-width: 400px; margin: 8vh auto; }
.gate .card { padding: 26px; }
.gate h1 { margin: 0 0 4px; font-size: 21px; }
.gate .hint { margin: 0 0 20px; color: var(--ink-soft); font-size: 14px; }
.gate .btn { width: 100%; justify-content: center; margin-top: 6px; }
.gate .alt { text-align: center; margin-top: 16px; font-size: 13px; color: var(--ink-soft); }

/* ── LISTS (events, announcements) ─────────────────────────────────────── */

.item {
    border: 1px solid var(--line); border-radius: 8px;
    padding: 11px 13px; margin-bottom: 9px; background: #fff;
}
.item .top { display: flex; align-items: baseline; gap: 10px; }
.item .top strong { font-size: 14px; }
.item .top .when { font-size: 12px; color: var(--ink-soft); margin-left: auto; }
.item .blurb { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }
.empty { color: var(--ink-soft); font-size: 14px; padding: 10px 0; }

/* ── STOCK PHOTOGRAPH RESULTS ──────────────────────────────────────────── */

.stock { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 9px; }
.stock:empty { margin-top: 0; }
.stock button {
    padding: 0; border: 1px solid var(--line); border-radius: 6px;
    overflow: hidden; cursor: pointer; background: #fff; line-height: 0;
}
.stock button:hover { border-color: var(--accent); }
.stock img { width: 100%; height: 62px; object-fit: cover; display: block; }
.stock .by { display: block; font-size: 9px; color: var(--ink-soft);
             padding: 2px 3px; line-height: 1.25; text-align: left;
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stock-msg { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }
