/* Shared in-browser edit mode (?edit=1) — index + guide */
:root {
  --paper-2: #f3efe3;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

html.is-site-editing body { padding-bottom: 6.5rem; }

[data-edit].is-copy-editing {
  outline: 2px dashed rgba(176,141,79,0.5);
  outline-offset: 4px;
  border-radius: 4px;
  transition: outline-color .15s, background .15s;
  cursor: text;
}

[data-edit].is-copy-editing:hover {
  outline-color: var(--gold);
  background: rgba(176,141,79,0.07);
}

[data-edit].is-copy-focused {
  outline: 2px solid var(--gold);
  background: rgba(176,141,79,0.11);
}

/* ── typography inside editable fields ── */
[data-edit] .accent { color: var(--gold); font-style: italic; }
[data-edit] .cedars-green { color: var(--green); font-weight: 600; }
[data-edit] .cedars-serif {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
}
[data-edit] .cedars-label {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--green);
}
[data-edit] .cedars-muted { color: var(--grey); }
[data-edit] a { color: var(--green); text-decoration: underline; }
[data-edit] .cedars-ts-sm { font-size: 0.88em; }
[data-edit] .cedars-ts-md { font-size: 1em; }
[data-edit] .cedars-ts-lg { font-size: 1.18em; }
[data-edit] .cedars-ts-xl { font-size: 1.38em; }
[data-edit].cedars-block-sm { font-size: 0.92rem; line-height: 1.55; }
[data-edit].cedars-block-md { font-size: inherit; }
[data-edit].cedars-block-lg { font-size: 1.14rem; line-height: 1.65; }
[data-edit].cedars-block-xl { font-size: 1.32rem; line-height: 1.55; }
h2[data-edit].cedars-block-sm { font-size: clamp(1.35rem, 3vw, 1.75rem); }
h2[data-edit].cedars-block-lg { font-size: clamp(1.65rem, 3.6vw, 2.35rem); }
h2[data-edit].cedars-block-xl { font-size: clamp(1.85rem, 4vw, 2.75rem); }

[data-edit] h3,
[data-edit] h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  color: var(--green);
  margin: 0.55em 0 0.25em;
  line-height: 1.2;
}
[data-edit] h3 { font-size: 1.2em; }
[data-edit] h4 { font-size: 1.05em; }

[data-edit] blockquote {
  margin: 0.55em 0;
  padding: 0.35rem 0 0.35rem 0.75rem;
  border-left: 3px solid var(--gold);
  color: var(--grey);
  font-style: italic;
}

[data-edit] ul,
[data-edit] ol {
  margin: 0.35em 0;
  padding-left: 1.35rem;
}

[data-edit] li { margin-bottom: 0.2em; }

[data-edit] hr {
  border: none;
  border-top: 1px solid var(--hair);
  margin: 0.65em 0;
}

/* ── floating format toolbar ── */
.cedars-format-bar {
  position: fixed;
  z-index: 950;
  pointer-events: auto;
}

.cedars-format-panel {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.4rem 0.45rem;
  background: #fff;
  border: 1px solid var(--hair);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(13,26,16,0.18);
  max-width: min(96vw, 44rem);
}

.cedars-format-row {
  display: flex;
  align-items: center;
  gap: 0.18rem;
  flex-wrap: wrap;
}

.cedars-format-btn {
  border: none;
  background: transparent;
  color: var(--ink);
  min-width: 1.85rem;
  height: 1.85rem;
  border-radius: 6px;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.45rem;
}

.cedars-format-btn:hover { background: var(--paper-2); }

.cedars-format-btn.is-active {
  background: var(--green);
  color: #fff;
}

.cedars-format-btn .cedars-u { text-decoration: underline; }
.cedars-format-btn .cedars-accent-sample {
  color: var(--gold);
  font-style: italic;
  font-weight: 600;
}
.cedars-format-btn .cedars-green-sample { color: var(--green); font-weight: 700; }
.cedars-format-btn .cedars-serif-sample {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
}

.cedars-format-sep {
  width: 1px;
  height: 1.15rem;
  background: var(--hair);
  margin: 0 0.12rem;
  flex-shrink: 0;
}

.cedars-format-select {
  border: none;
  background: var(--paper-2);
  color: var(--ink);
  font: inherit;
  font-size: 0.68rem;
  padding: 0.22rem 0.4rem;
  border-radius: 6px;
  max-width: 6.5rem;
  cursor: pointer;
}

.cedars-format-label {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey);
  padding: 0 0.12rem;
  white-space: nowrap;
}

html.is-site-editing [data-edit-zone] { position: relative; }
html.is-site-editing [data-edit-zone] > [data-edit] { position: relative; }

/* ── bottom edit bar ── */
.cedars-edit-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 900;
  background: var(--green);
  color: #fff;
  box-shadow: 0 -8px 32px rgba(13,26,16,0.25);
}

.cedars-edit-bar-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.85rem 2rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cedars-edit-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
}

.cedars-edit-status {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.65);
  flex: 1;
  min-width: 6rem;
}

.cedars-edit-status.is-ok { color: #b8e6c8; }
.cedars-edit-status.is-err { color: #ffb4b4; }

.cedars-edit-key-inline input {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.1);
  color: #fff;
  width: 8.5rem;
}

.cedars-edit-key-inline input::placeholder { color: rgba(255,255,255,0.45); }

.cedars-edit-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.cedars-edit-btn {
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.cedars-edit-btn:hover { background: rgba(255,255,255,0.18); }

.cedars-edit-btn-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.cedars-edit-btn-primary:hover { filter: brightness(1.05); }

.cedars-edit-hint {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 2rem 0.75rem;
  font-size: 0.76rem;
  color: rgba(255,255,255,0.62);
}

@media (max-width: 720px) {
  .cedars-edit-bar-inner { padding: 0.75rem 1.25rem 0.45rem; }
  .cedars-edit-hint { padding: 0 1.25rem 0.65rem; }
  .cedars-format-panel { max-width: calc(100vw - 16px); }
}
