/* ============================================================
   Igreja Adventista do Sétimo Dia — folha de estilo principal
   Cores da marca: fundo verde #385843 · botões terracota #9a6e53
   ============================================================ */

:root {
  --green: #385843;
  --green-dark: #2b4434;
  --green-light: #4a6f57;
  --brown: #9a6e53;
  --brown-dark: #855c44;
  --cream: #faf8f4;
  --card: #ffffff;
  --ink: #23301f;
  --muted: #6b7568;
  --border: #e3ded4;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(35, 48, 31, 0.08);
  --font-display: "Fraunces", Georgia, serif;
  --font-sans: "DM Sans", system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section.tight { padding-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.72rem; color: var(--brown); font-weight: 700; }
.stack > * + * { margin-top: 16px; }
.center { text-align: center; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; cursor: pointer; font: inherit; font-weight: 600;
  padding: 12px 22px; border-radius: 999px; transition: 0.18s;
}
.btn-accent { background: var(--brown); color: #fff; }
.btn-accent:hover { background: var(--brown-dark); }
.btn-ghost { background: transparent; color: inherit; border: 1px solid currentColor; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn.full { width: 100%; justify-content: center; }

/* ---------- barra de administrador ---------- */
#adminbar:not(:empty) {
  position: sticky; top: 0; z-index: 60;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center;
  background: var(--brown); color: #fff; padding: 10px 16px; font-size: 0.86rem;
}
#adminbar .btn { background: rgba(255, 255, 255, 0.18); color: #fff; }

#lockBtn {
  position: fixed; bottom: 18px; left: 18px; z-index: 55;
  width: 44px; height: 44px; border-radius: 999px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 1rem;
}

/* ---------- cabeçalho / navegação ---------- */
#header { background: var(--green); color: #fff; position: relative; z-index: 50; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; background: var(--brown);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700;
}
.brand-name { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.15; }
.brand-tag { font-size: 0.72rem; opacity: 0.75; }
.brand-logo { height: 62px; width: auto; display: block; }
.edit-bar {
  position: absolute; z-index: 60; display: none; gap: 6px;
  background: #1f3328; padding: 6px; border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  max-width: calc(100vw - 16px); flex-wrap: wrap;
}
.edit-bar.show { display: flex; }
.edit-format { display: flex; gap: 4px; }
.edit-format[hidden] { display: none; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px);
  background: var(--brown); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 0.9rem; opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 80;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a, .nav-drop > button {
  color: rgba(255, 255, 255, 0.85); padding: 8px 12px; border-radius: 999px;
  font-size: 0.9rem; background: none; border: 0; cursor: pointer; font-family: inherit;
}
.nav-links a:hover, .nav-drop > button:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.nav-links a.active { background: rgba(255, 255, 255, 0.16); color: #fff; }
.nav-drop { position: relative; }
.nav-drop-menu {
  position: absolute; top: 100%; left: 0; min-width: 260px; max-height: 60vh; overflow: auto;
  background: var(--card); color: var(--ink); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; display: none;
}
.nav-drop:hover .nav-drop-menu, .nav-drop.open .nav-drop-menu { display: block; }
.nav-drop-menu a { display: block; color: var(--ink); padding: 8px 10px; border-radius: 10px; font-size: 0.88rem; }
.nav-drop-menu a:hover { background: #f2efe8; }
.nav-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 10px; padding: 6px 10px; cursor: pointer; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; background: var(--green-dark); padding: 12px;
    max-height: 75vh; overflow: auto;
  }
  .nav-links.open { display: flex; }
  .nav-drop-menu { position: static; display: none; background: transparent; border: 0; box-shadow: none; }
  .nav-links .nav-drop:not(.open) > .nav-drop-menu { display: none; }
  .nav-drop.open > .nav-drop-menu { display: block; }
  .nav-drop-menu a { color: rgba(255,255,255,.85); }
  .nav-drop-menu a:hover { background: rgba(255,255,255,.12); }
}

/* ---------- heróis ---------- */
.hero { background: var(--green); color: #fff; }
.hero-grid { display: grid; gap: 36px; align-items: center; padding: 64px 0; grid-template-columns: 1.05fr 0.95fr; }
.hero p.lead { font-size: 1.05rem; color: rgba(255, 255, 255, 0.8); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; padding: 44px 0; } }

.page-hero { background: var(--green); color: #fff; padding: 72px 0; }
.page-hero p { color: rgba(255, 255, 255, 0.78); max-width: 60ch; margin-top: 14px; }

/* ---------- slideshow ---------- */
.slideshow { position: relative; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); background: var(--green-dark); }
.slideshow .slide { display: none; position: relative; }
.slideshow .slide.on { display: block; }
.slideshow img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.slide-caption {
  position: absolute; inset: auto 0 0 0; padding: 26px 20px 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6)); color: #fff; font-size: 0.95rem;
}
.slide-dots { position: absolute; bottom: 12px; right: 14px; display: flex; gap: 6px; }
.slide-dots button { width: 9px; height: 9px; border-radius: 999px; border: 0; cursor: pointer; background: rgba(255, 255, 255, 0.45); }
.slide-dots button.on { background: #fff; width: 22px; }
.slide-admin { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- cartões / grades ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 24px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 8px; }
.card-link:hover { border-color: var(--brown); }
.badge {
  display: inline-block; background: #eee9e0; color: var(--brown-dark);
  border-radius: 999px; padding: 3px 10px; font-size: 0.72rem; font-weight: 700;
}
.split { display: grid; gap: 32px; grid-template-columns: 1fr 1fr; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.rounded { border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.ratio-16-10 img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.bullets { list-style: none; margin: 0; padding: 0; }
.bullets li { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; }
.bullets li::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--brown); margin-top: 11px; flex: none; }
.video-frame { position: relative; padding-top: 56.25%; border-radius: 18px; overflow: hidden; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- formulários ---------- */
label.field { display: block; font-size: 0.875rem; margin-bottom: 14px; }
label.field span { color: var(--muted); }
input, select, textarea {
  width: 100%; margin-top: 5px; padding: 10px 12px; font: inherit; color: inherit;
  background: var(--cream); border: 1px solid var(--border); border-radius: 10px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brown); }
.error { color: #b3261e; font-size: 0.85rem; }

/* ---------- rodapé ---------- */
#footer { background: var(--green-dark); color: rgba(255, 255, 255, 0.82); margin-top: 40px; }
#footer .grid { padding: 48px 0; }
#footer h4 { color: #fff; margin-bottom: 10px; font-family: var(--font-display); }
#footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.15); padding: 16px 0; font-size: 0.8rem; }

/* ---------- modo de edição ---------- */
[data-path].edit {
  outline: 1px dashed rgba(154, 110, 83, 0.7); outline-offset: 4px;
  border-radius: 4px; cursor: text; min-width: 40px; min-height: 1em;
}
[data-path].edit:focus { outline: 2px solid var(--brown); background: rgba(154, 110, 83, 0.06); }
[data-path][data-multiline="1"] { white-space: pre-wrap; }
[data-path][data-multiline="1"] p, [data-path][data-multiline="1"] div { margin: 0 0 .75em; }
[data-path][data-multiline="1"] ul, [data-path][data-multiline="1"] ol { margin: .5em 0 .75em 1.4em; }
[data-path].edit:empty::before { content: attr(data-placeholder); color: var(--muted); font-style: italic; }
.img-edit { position: relative; }
.img-edit .img-tools { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.img-empty { display: grid; place-items: center; min-height: 180px; background: #eee9e0; color: var(--muted); font-size: 0.85rem; }
.admin-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.admin-tools .btn { background: #eee9e0; color: var(--brown-dark); }
.admin-tools .btn:hover { background: #e4ddd0; }
.danger { background: #fbeae8 !important; color: #b3261e !important; }
.block-row { position: relative; padding-right: 34px; }
.block-del {
  position: absolute; top: 0; right: 0; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-size: 1rem;
}
.block-del:hover { color: #b3261e; }
.custom-section { border: 1px solid var(--border); background: var(--card); border-radius: 22px; padding: 32px; box-shadow: var(--shadow); }
.custom-section > * + * { margin-top: 22px; }

/* ---------- modal ---------- */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(35, 48, 31, 0.6); padding: 20px; }
.modal-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.modal-head button { background: none; border: 0; font-size: 1rem; cursor: pointer; color: var(--muted); }
.modal-card form { margin-top: 16px; }
.modal-card form > * + * { margin-top: 10px; }
