/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */
* {
  box-sizing: border-box;
}

:root {
  --paper: #fbfaf7;
  --ink: #20211f;
  --muted: #696d65;
  --line: #d8d6cc;
  --soft: #f1efe6;
  --accent: #2d6a4f;
  --accent-strong: #1b4332;
  --gold: #b98932;
  --danger: #a23b3b;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 20px 18px 32px;
}

.home-hero {
  padding: 18px 0 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 18px;
  font-size: 2.4rem;
  line-height: 1.02;
  letter-spacing: 0;
}

.primary-action,
.edit-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--accent-strong);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.home-search {
  margin: 8px 0 14px;
}

.search-form {
  display: block;
}

.search-input,
.title-input,
.speaker-input,
.detail-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fffefb;
  outline: none;
}

.search-input:focus,
.title-input:focus,
.speaker-input:focus,
.detail-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.16);
}

.search-input {
  min-height: 46px;
  padding: 0 14px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0 18px;
}

.tab-link {
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.tab-link.is-active {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: #eef5ef;
}

.note-list {
  display: grid;
  gap: 10px;
}

.note-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.note-row-link {
  display: grid;
  gap: 5px;
  min-width: 0;
  text-decoration: none;
}

.note-title {
  overflow: hidden;
  font-size: 1.08rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-meta,
.note-tags,
.reading-meta,
.save-status,
.quiet-link {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.88rem;
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.note-tags span {
  padding: 3px 7px;
  border-radius: 8px;
  background: var(--soft);
}

.favorite-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.favorite-button.is-favorite {
  border-color: var(--gold);
  color: var(--ink);
  background: #fff3d6;
}

.empty-state {
  margin: 28px 0;
  color: var(--muted);
}

.series-group {
  border-bottom: 1px solid var(--line);
}

.series-group summary {
  cursor: pointer;
  padding: 14px 0;
}

.series-group summary span {
  display: grid;
  gap: 4px;
}

.series-group small {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.series-notes {
  padding: 0 0 10px 16px;
}

.editor-shell {
  padding-bottom: 96px;
}

.top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  margin-bottom: 8px;
}

.quiet-link {
  text-decoration: none;
}

.sermon-form {
  display: grid;
  gap: 12px;
}

.title-input {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 0 12px;
  background: transparent;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.08;
}

.speaker-input {
  min-height: 46px;
  padding: 0 12px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
}

.detail-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.detail-input {
  min-height: 42px;
  padding: 0 12px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.quiet-details {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

.quiet-details summary {
  cursor: pointer;
  padding: 6px 0;
}

.quiet-details .detail-grid {
  margin-top: 8px;
}

.editor-surface {
  min-height: 56vh;
  padding: 14px 0 80px;
  font-size: 1.08rem;
  line-height: 1.55;
}

.editor-surface .ProseMirror {
  min-height: 48vh;
  outline: none;
}

.editor-surface .ProseMirror p.is-editor-empty:first-child::before {
  float: left;
  height: 0;
  color: #9a9c94;
  content: attr(data-placeholder);
  pointer-events: none;
}

.editor-surface h2,
.editor-surface h3 {
  margin: 1.4em 0 0.45em;
  line-height: 1.15;
}

.editor-surface blockquote {
  margin: 1em 0;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  color: #3e423c;
}

.editor-surface ul,
.editor-surface ol {
  padding-left: 1.35em;
}

.editor-surface ul[data-type="taskList"] {
  list-style: none;
  padding-left: 0;
}

.editor-surface ul[data-type="taskList"] li {
  display: flex;
  gap: 8px;
}

.editor-surface ul[data-type="taskList"] label {
  flex: 0 0 auto;
}

.toolbar-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--accent-strong);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
  cursor: pointer;
}

.format-toolbar {
  position: fixed;
  right: 12px;
  bottom: 76px;
  left: 12px;
  z-index: 19;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 720px;
  margin: 0 auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
  box-shadow: 0 16px 38px rgba(32, 33, 31, 0.18);
}

.format-toolbar[hidden] {
  display: none;
}

.format-toolbar button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--soft);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
}

.reading-header {
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--line);
}

.reading-header p {
  margin: 5px 0;
}

.reading-body .editor-surface {
  min-height: auto;
}

@media (min-width: 620px) {
  .app-shell {
    padding-top: 34px;
  }

  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}
