:root {
  --bg: #fbfaf8;
  --fg: #1d1b19;
  --muted: #6b655f;
  --accent: #6d3fd1;
  --line: #e4e0da;
  --ok: #1f7a4d;
  --bad: #b3261e;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161514;
    --fg: #f1eee9;
    --muted: #a39d96;
    --accent: #b39aff;
    --line: #33302c;
    --ok: #6fd3a0;
    --bad: #ff8a80;
  }
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font:
    16px / 1.5 system-ui,
    sans-serif;
}
header {
  padding: 0.5rem 1rem 0;
  border-bottom: 1px solid var(--line);
}
/* The brand and who is signed in on one line; the links to each part of the Site on the next. */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
}
header form {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  color: var(--muted);
  min-width: 0;
}
.client-name {
  overflow-wrap: anywhere;
}
/* The Operator acting for a Client: on every screen, and never mistaken for an Editor's view (ADR 0030). */
.operator-banner {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: 0.6rem 1rem;
  background: #8a1c1c;
  color: #fff;
  font-weight: 600;
  text-align: center;
  border-bottom: 3px solid #f2c94c;
}
.publisher-support,
.publisher-upgrade {
  font-weight: 600;
  color: var(--bad);
}
.brand {
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
}
main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}
a {
  color: var(--accent);
}
/* One row that scrolls sideways on a narrow phone rather than wrapping into a jumble; each link a 44px tap target. */
.site-nav {
  display: flex;
  gap: 0 1rem;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}
button {
  font: inherit;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 0.5rem;
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
  min-height: 44px;
}
button.link {
  background: none;
  color: var(--accent);
  padding: 0;
  min-height: 0;
  text-decoration: underline;
}
[role="status"] {
  color: var(--ok);
}
[role="alert"] {
  color: var(--bad);
}
.pages {
  list-style: none;
  padding: 0;
}
.pages li {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.badge {
  font-size: 0.8rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.muted {
  color: var(--muted);
}
.publish {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}
.site-status {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}
.site-status[data-live="yes"] {
  border-color: var(--ok);
}
.passkeys {
  list-style: none;
  padding: 0;
}
.passkeys li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.passkeys li div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.or {
  margin: 1.5rem 0 1rem;
  color: var(--muted);
}
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}
textarea {
  resize: vertical;
}
select {
  margin-bottom: 0.75rem;
}
[aria-invalid="true"] {
  border-color: var(--bad);
}
button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
}
button.danger {
  background: var(--bad);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
/* Rendered (so Enter in a field saves) but out of sight and out of reach. */
.default-action {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.section {
  margin: 0 0 1.25rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  min-width: 0;
}
.section legend {
  font-weight: 600;
  padding: 0 0.25rem;
}
.field {
  margin-bottom: 0.75rem;
}
.field input {
  margin-bottom: 0.25rem;
}
.hint {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.photo-preview {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 12rem;
  width: auto;
  margin-bottom: 0.5rem;
  border-radius: 0.25rem;
}
input[type="file"] {
  padding: 0.5rem;
}
.field-problem {
  margin: 0.25rem 0 0;
  color: var(--bad);
}
.problems ul {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}
.section-actions,
.menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.add-section {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 0.5rem;
}
.pages li {
  flex-wrap: wrap;
  justify-content: space-between;
}
.page-name {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  min-width: 0;
  overflow-wrap: anywhere;
}
.remove {
  margin-top: 2rem;
}
.warnings {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 0.5rem;
}
.warnings p {
  margin: 0;
}
.warnings ul {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}
.theme-settings fieldset {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
}
.theme-settings legend {
  font-weight: 600;
}
/* The link to choose the logo is a 44px tap target. */
.theme-logo a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.logo-now {
  margin-bottom: 1rem;
}
.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.25rem 0;
  border-top: 1px solid var(--line);
}
.choice input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.75rem 0 0;
  flex-shrink: 0;
}
/* The whole label, preview included, is the tap target: at least 44px tall. */
.choice label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 44px;
  padding: 0.5rem 0;
  margin: 0;
  flex: 1;
  cursor: pointer;
}
.choice-name {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.choice .hint {
  font-weight: normal;
  margin: 0;
}
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.swatch {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.swatch svg {
  flex-shrink: 0;
}
.font-samples {
  display: flex;
  flex-direction: column;
  font-weight: normal;
}
.headings-sample {
  font-size: 1.4rem;
  line-height: 1.2;
}
.upload-status {
  margin: 0.5rem 0 0;
  font-weight: 600;
}
.history {
  list-style: none;
  padding: 0;
}
.history > li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.history ul {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}
.history form {
  margin-top: 0.5rem;
}
/* Read by screen readers, never shown: such as where a dragged Photo went. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.galleries {
  list-style: none;
  padding: 0;
}
.galleries li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
/* Posts: each row's link is the tap target, at least 44px tall. */
.posts {
  list-style: none;
  padding: 0;
}
.posts li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  align-items: center;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.post-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 14rem;
  min-height: 44px;
  padding: 0.5rem 0;
  min-width: 0;
}
.post-title {
  font-weight: 600;
}
.post-state {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.post-editor input[type="date"] {
  min-height: 44px;
}
.badge-live {
  border-color: var(--ok);
  color: var(--ok);
}
.gallery-photos {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}
.gallery-photo fieldset {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1rem;
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--bg);
  min-width: 0;
}
.gallery-photo legend {
  font-weight: 600;
  padding: 0 0.25rem;
}
.gallery-photo .photo-preview {
  max-height: 8rem;
}
.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.photo-chooser {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}
.chooser-photo {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
  min-width: 0;
}
.chooser-photo img {
  display: block;
  width: 100%;
  height: 6rem;
  object-fit: cover;
  border-radius: 0.25rem;
}
/* Added by gallery-drag.js. Only the handle starts a drag, so the rest of the page still scrolls under a finger. */
.drag-handle {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: grab;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
  font-size: 1.25rem;
  line-height: 1;
}
.chooser-photo .drag-handle {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  background: var(--bg);
}
.dragging fieldset,
.chooser-photo.dragging {
  outline: 2px solid var(--accent);
  opacity: 0.75;
}
.dragging .drag-handle {
  cursor: grabbing;
}
.drop-marker {
  margin: 0 0 0.75rem;
  padding: 1rem;
  border: 2px dashed var(--accent);
  border-radius: 0.5rem;
  color: var(--accent);
  text-align: center;
}
.drag-adding .gallery-photos {
  min-height: 5rem;
  outline: 2px dashed var(--line);
  border-radius: 0.5rem;
}
.order-changed {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  margin: 0 0 0.75rem;
}
.order-changed p {
  margin: 0;
  font-weight: 600;
}
.removed {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}
@media (min-width: 40rem) {
  .gallery-photo fieldset {
    grid-template-columns: 8rem 1fr;
  }
  .gallery-photo legend,
  .gallery-photo .drag-handle,
  .gallery-photo .photo-actions {
    grid-column: 1 / -1;
  }
  .gallery-photo .photo-preview {
    grid-row: span 2;
    width: 100%;
    object-fit: cover;
  }
}
header form button.link {
  min-height: 44px;
}
/* Preview (ADR 0037): the link to open, as a button, and the links still working. */
a.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
}
.preview-ready input[readonly] {
  width: 100%;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.85rem;
}
.previews {
  list-style: none;
  padding: 0;
}
.previews li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
/* The form-level preview: a chosen Photo shown whole, as the Theme shows it, before it is sent. */
.form-preview {
  margin: 0.5rem 0;
}
.form-preview img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 12rem;
  width: auto;
}
.form-preview figcaption {
  font-size: 0.9rem;
  color: var(--muted);
}
/* The Media library: one Photo per row, its picture beside what is known about it. */
.media-library {
  list-style: none;
  padding: 0;
}
.library-photo {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.library-photo img {
  width: 100%;
  height: 6rem;
  object-fit: cover;
  border-radius: 0.25rem;
}
.library-details {
  min-width: 0;
}
.library-details p,
.library-details ul {
  margin: 0 0 0.25rem;
}
.library-label {
  font-weight: 600;
}
/* Links that act as buttons or paging: each a 44px tap target. */
.tap,
.pager a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}
.section-chooser {
  margin: 0.5rem 0 1rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}
.section-chooser h3 {
  margin: 0;
}

.font-sample-sample-fonts-classic-headings {
  font-family: Georgia, "Times New Roman", serif;
}
.font-sample-sample-fonts-classic-text {
  font-family: Georgia, "Times New Roman", serif;
}
.font-sample-sample-fonts-modern-headings {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.font-sample-sample-fonts-modern-text {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.font-sample-sample-fonts-elegant-headings {
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", serif;
}
.font-sample-sample-fonts-elegant-text {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
