/* =========================================================
   style.css — Sermon Notes (Orange/Cream/Gold)
   V1 UI (Design-first)
========================================================= */

:root{
  --orange:#E67E22;
  --cream:#F6F1E8;
  --gold:#C9A227;
  --ink:#3E2C23;

  --panel:#fff;
  --muted: rgba(62,44,35,.68);

  --r:16px;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
  --shadowSoft: 0 8px 18px rgba(0,0,0,.06);

  --maxW: 980px;
  --navH: 72px;
}

/* Base */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
}

.app{
  min-height:100%;
  display:flex;
  flex-direction:column;
}

/* Topbar */
.topbar{
  position:sticky;
  top:0;
  z-index:30;
  background: rgba(246,241,232,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(201,162,39,.25);
  padding: 14px 14px 10px;
}
.topbar-inner{
  max-width: var(--maxW);
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.brand{
  display:flex;
  flex-direction:column;
  gap:2px;
  line-height:1.1;
}
.brand .title{
  font-family: "Playfair Display", serif;
  font-weight:700;
  font-size: 22px;
  letter-spacing:.2px;
}
.brand .subtitle{
  font-size: 12px;
  color: var(--muted);
}
.top-actions{
  display:flex;
  gap:10px;
  align-items:center;
}
.iconbtn{
  border: 1px solid rgba(201,162,39,.35);
  background: rgba(255,255,255,.65);
  color: var(--ink);
  height: 38px;
  width: 38px;
  border-radius: 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow: 0 6px 14px rgba(0,0,0,.04);
}
.iconbtn:active{ transform: translateY(1px); }
.icon{ width:18px; height:18px; display:block; }

/* Main content */
main{
  flex:1;
  padding: 14px 14px calc(var(--navH) + 18px);
}
.wrap{
  max-width: var(--maxW);
  margin: 0 auto;
}

/* Pages */
.page{ display:none; }
.page.active{ display:block; }

/* Layout */
.grid{ display:grid; gap:12px; }
@media(min-width:720px){
  .grid.cols2{ grid-template-columns: 1.2fr .8fr; }
}

.card{
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(201,162,39,.25);
  border-radius: var(--r);
  box-shadow: var(--shadowSoft);
  padding: 14px;
}

/* Typography helpers */
.h2{
  font-family: "Playfair Display", serif;
  font-size: 18px;
  margin: 0 0 8px;
}
.muted{ color: var(--muted); }

.divider{
  height:1px;
  background: rgba(201,162,39,.22);
  margin: 12px 0;
}

/* Buttons */
.btn{
  border:0;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 600;
  cursor:pointer;
}
.btn.primary{
  background: var(--orange);
  color: #fff;
  box-shadow: 0 10px 20px rgba(230,126,34,.24);
}
.btn.ghost{
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(201,162,39,.35);
  color: var(--ink);
}
.btn:active{ transform: translateY(1px); }

/* Pills / Chips */
.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(201,162,39,.35);
  background: rgba(255,255,255,.66);
  font-size: 12px;
  color: var(--ink);
  cursor:pointer;
  user-select:none;
}
.pill.active{
  border-color: rgba(230,126,34,.45);
  color: var(--orange);
}

/* Lists */
.list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.item{
  display:flex;
  gap:12px;
  align-items:flex-start;
  justify-content:space-between;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(201,162,39,.22);
}
.item .meta{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}
.item .meta .t{
  font-weight: 650;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 62vw;
}
.item .meta .s{
  font-size: 12px;
  color: var(--muted);
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* Star */
.star{
  width: 18px; height: 18px;
  border-radius: 6px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border: 1px solid rgba(201,162,39,.35);
  background: rgba(255,255,255,.66);
  cursor:pointer;
}

/* Form fields */
.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom: 10px;
}
label{ font-size: 12px; color: var(--muted); }

input, textarea, select{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(201,162,39,.28);
  background: rgba(255,255,255,.78);
  color: var(--ink);
  outline:none;
  font: inherit;
}
textarea{ min-height: 160px; resize: vertical; }

/* Rows */
.row{ display:flex; gap:10px; }
.row > *{ flex:1; }
.spacer{ height: 10px; }

/* Scripture block */
.scripture-box{
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(201,162,39,.30);
  border-left: 6px solid var(--gold);
  border-radius: 14px;
  padding: 12px;
}
.scripture-ref{
  font-weight: 700;
  color: var(--orange);
  margin-bottom: 6px;
}
.scripture-text{
  color: var(--ink);
  line-height: 1.45;
}

/* Editor toolbar */
.toolbar{
  position:sticky;
  top: 76px;
  z-index: 10;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  padding: 10px 0;
}

/* Bottom nav */
.bottom-nav{
  position:fixed;
  left:0; right:0; bottom:0;
  height: var(--navH);
  background: rgba(255,255,255,.82);
  border-top: 1px solid rgba(201,162,39,.25);
  backdrop-filter: blur(10px);
  z-index: 40;
}
.nav-inner{
  max-width: var(--maxW);
  margin: 0 auto;
  height: 100%;
  display:flex;
  align-items:center;
  justify-content:space-around;
  padding: 8px 12px 10px;
  gap: 6px;
}
.tab{
  flex:1;
  height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 4px;
  color: rgba(62,44,35,.75);
  text-decoration:none;
  border-radius: 16px;
  position:relative;
  user-select:none;
  cursor:pointer;
  border: 1px solid transparent;
}
.tab .lbl{ font-size: 11px; }
.tab.active{
  color: var(--orange);
  border-color: rgba(201,162,39,.28);
  background: rgba(246,241,232,.75);
}
.tab.active::after{
  content:"";
  position:absolute;
  bottom: 6px;
  width: 26px;
  height: 3px;
  border-radius: 999px;
  background: var(--gold);
}

/* Modal */
.modal{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.35);
  display:none;
  align-items:flex-end;
  justify-content:center;
  z-index: 80;
  padding: 12px;
}
.modal.open{ display:flex; }

.sheet{
  width: 100%;
  max-width: 640px;
  background: rgba(255,255,255,.92);
  border-radius: 20px;
  border: 1px solid rgba(201,162,39,.25);
  box-shadow: var(--shadow);
  padding: 14px;
}
.sheet-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 10px;
}
.sheet-title{
  font-family:"Playfair Display", serif;
  font-size: 18px;
  font-weight:700;
  margin:0;
}

/* Bible Insert Slide-up Panel */
.panel{
  position:fixed;
  left:0; right:0; bottom:-100%;
  background: rgba(255,255,255,.92);
  border-top: 1px solid rgba(201,162,39,.25);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow);
  z-index: 90;
  transition: bottom .22s ease;
  padding: 12px 14px 18px;
  max-height: 82vh;
  overflow:auto;
}
.panel.open{ bottom:0; }

.panel-handle{
  width: 44px;
  height: 5px;
  background: rgba(62,44,35,.20);
  border-radius: 999px;
  margin: 6px auto 10px;
}
.panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 10px;
}

/* a11y */
@media (prefers-reduced-motion: reduce){
  *{ scroll-behavior:auto !important; }
  .panel{ transition:none; }
  .iconbtn:active,.btn:active{ transform:none; }
}
/* Toast */
.toast{
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--navH) + 12px + env(safe-area-inset-bottom));
  z-index: 200;
  display: none;
}
.toast.show{ display:block; }

.toast-inner{
  max-width: var(--maxW);
  margin: 0 auto;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(201,162,39,.35);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  backdrop-filter: blur(10px);
}
.toast-title{
  font-weight: 700;
  color: var(--ink);
}
.toast-sub{
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.toast-btn{
  border: 0;
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 700;
  background: var(--orange);
  color: #fff;
  cursor: pointer;
}
.toast-btn:active{ transform: translateY(1px); }
