/* Hidden Admin CMS UI. Editing controls are injected only after authentication. */
/* Keep section-level edit badges anchored inside the section they edit. */
#home, #about, #practice, #collaboration, #cmsCustomSections, #testimonials, .cta, footer#contact,
.hero-profiles, .service, .testimonials .card { position: relative; }


.cms-edit-button,
.cms-card-edit,
.cms-add-card,
#an-cms-toolbar,
.an-cms-modal,
.an-cms-status { display: none; }

.cms-edit-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 30;
  border: 1px solid #b28a42;
  border-radius: 5px;
  background: #292b26;
  color: #fff;
  padding: 7px 10px;
  font: 600 10px/1.2 Arial, sans-serif;
  box-shadow: 0 2px 9px #00000018;
}
.cms-edit-button:hover,
.cms-card-edit:hover,
.cms-add-card:hover { background: #b28a42; color: #fff; }
.cms-section-edit { top: 9px; right: 10px; }
.cms-advocate-edit { position: relative; display: inline-block; top: auto; right: auto; margin: 8px auto 0; }
.cms-card-edit {
  display: none;
  border: 1px solid #b28a42;
  background: #292b26;
  color: #fff;
  border-radius: 4px;
  padding: 6px 8px;
  font: 600 10px Arial, sans-serif;
  margin-top: 8px;
}
.cms-add-card {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 130px;
  width: 100%;
  border: 1px dashed #b28a42;
  border-radius: 7px;
  color: #86652d;
  background: #fffdf8;
  padding: 18px;
  font: 600 12px Arial, sans-serif;
}
.cms-edit-mode .cms-edit-button,
.cms-edit-mode .cms-section-edit,
.cms-edit-mode .cms-advocate-edit,
.cms-edit-mode .cms-card-edit,
.cms-edit-mode .cms-add-card { display: inline-flex; }
.cms-edit-mode .cms-section-edit { display: inline-flex; }
.cms-edit-mode .hero,
.cms-edit-mode .stats,
.cms-edit-mode .services,
.cms-edit-mode .collaboration,
.cms-edit-mode .testimonials,
.cms-edit-mode .cta,
.cms-edit-mode footer#contact {
  outline: 1px dashed #d0b16e;
  outline-offset: -3px;
}
.cms-edit-mode .service,
.cms-edit-mode .card { border-color: #d3b87f; }
#an-cms-toolbar {
  position: sticky;
  top: 0;
  z-index: 9990;
  padding: 10px clamp(12px, 3vw, 32px);
  background: #262722;
  color: #f7f1e6;
  box-shadow: 0 4px 14px #0002;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  font-family: Arial, sans-serif;
}
#an-cms-toolbar:not([hidden]) { display: flex; }
.an-cms-toolbar-brand { display: flex; flex-direction: column; gap: 4px; }
.an-cms-toolbar-brand strong { font-size: 10px; letter-spacing: .1em; color: #e2c382; }
.an-cms-toolbar-brand span { font-size: 10px; color: #d3cbbb; }
.an-cms-toolbar-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.an-cms-toolbar-actions button {
  padding: 8px 10px;
  border: 1px solid #806c45;
  border-radius: 4px;
  background: transparent;
  color: #f7f0e0;
  font: 600 10px Arial, sans-serif;
}
.an-cms-toolbar-actions #an-cms-publish { background: #b28a42; border-color: #b28a42; }
.an-cms-toolbar-actions button:hover { background: #51452e; }
.an-cms-toolbar-actions #an-cms-publish:hover { background: #97712f; }
.an-cms-toolbar-actions button:disabled { opacity: .55; cursor: wait; }
.an-cms-status {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border-radius: 4px;
  background: #2f4938;
  color: #fff;
  font: 11px/1.5 Arial, sans-serif;
}
.an-cms-status.an-cms-error { background: #7a302b; }
.an-cms-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  padding: 18px;
  background: rgba(17, 16, 13, .72);
  align-items: center;
  justify-content: center;
  font-family: Arial, sans-serif;
}
.an-cms-modal.is-open { display: flex; }
.an-cms-dialog {
  width: min(100%, 410px);
  max-height: min(92vh, 900px);
  overflow-y: auto;
  background: #fffdf8;
  border: 1px solid #dfcfad;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 18px 65px #0004;
  color: #282620;
}
.an-cms-editor-dialog { width: min(100%, 760px); }
.an-cms-kicker { font: 700 9px Arial, sans-serif; letter-spacing: .14em; color: #9b7532; text-transform: uppercase; }
.an-cms-dialog h2 { font: 500 27px/1.2 Georgia, serif; margin: 9px 0 9px; color: #24231e; }
.an-cms-dialog > p { color: #70695d; font: 11px/1.65 Arial, sans-serif; }
.an-cms-dialog form { margin-top: 17px; }
.an-cms-dialog form > label,
.an-cms-field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; color: #514a3e; font: 700 10px Arial, sans-serif; }
.an-cms-field input,
.an-cms-field textarea,
.an-cms-dialog form input {
  width: 100%;
  min-width: 0;
  border: 1px solid #dcd4c6;
  border-radius: 5px;
  padding: 10px 11px;
  background: #fff;
  color: #282622;
  font: 11px/1.5 Arial, sans-serif;
}
.an-cms-field textarea { min-height: 68px; resize: vertical; }
.an-cms-field input:focus,
.an-cms-field textarea:focus,
.an-cms-dialog form input:focus { outline: 2px solid #e5d0a4; border-color: #b28a42; }
.an-cms-field small { font: 10px/1.55 Arial, sans-serif; color: #837969; }
.an-cms-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 17px; }
.an-cms-primary,
.an-cms-secondary {
  padding: 10px 13px;
  border: 1px solid #b28a42;
  border-radius: 5px;
  background: #b28a42;
  color: #fff;
  font: 700 11px Arial, sans-serif;
}
.an-cms-secondary { background: #fff; color: #76592e; border-color: #d8c7a5; }
.an-cms-primary:hover { background: #96702f; }
.an-cms-smallnote { font: 9px/1.6 Arial, sans-serif; color: #8b816e; margin-top: 13px !important; }
#an-cms-login-error { margin-top: 10px; color: #923b34; font: 11px/1.6 Arial, sans-serif; }
.an-cms-collection { margin: 16px 0; border-top: 1px solid #e8dfcf; }
.an-cms-collection-head { display: flex; justify-content: space-between; align-items: center; gap: 9px; padding: 12px 0; }
.an-cms-collection-head h3 { font: 500 18px Georgia, serif; margin: 0; color: #312b20; }
.an-cms-item { padding: 13px; margin: 9px 0; border: 1px solid #e6ddcb; border-radius: 7px; background: #fff; }
.an-cms-item-head { display: flex; justify-content: space-between; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 8px; }
.an-cms-item-head strong { font: 600 12px Arial, sans-serif; overflow-wrap: anywhere; }
.an-cms-item-tools { display: flex; gap: 5px; }
.an-cms-item-tools button,
.an-cms-collection-head button {
  border: 1px solid #ddd0b7;
  background: #fffdf8;
  border-radius: 4px;
  color: #755a2d;
  padding: 6px 8px;
  font: 600 10px Arial, sans-serif;
}
.an-cms-item-tools button.is-delete { color: #994740; border-color: #e5c8c4; }
.an-cms-item-tools button:disabled { opacity: .35; cursor: not-allowed; }
.an-cms-formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 13px; }
.an-cms-check { display: inline-flex; align-items: center; gap: 8px; margin: 7px 0 13px; font: 600 10px Arial, sans-serif; color: #514a3e; }
.an-cms-check input { width: auto; }
.an-cms-warning { padding: 10px; border-left: 3px solid #c2a05e; background: #f8f1df; color: #6f5a31 !important; }
.an-cms-help { font: 11px/1.6 Arial, sans-serif; color: #71695d; }
.an-cms-section-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.an-cms-section-row > div:first-child { flex: 1; min-width: 0; }
.an-cms-section-row strong { font: 600 11px Arial, sans-serif; }
.an-cms-section-row .an-cms-check { margin-bottom: 0; }
.an-cms-section-row .an-cms-check span { display: none; }
.an-cms-section-row .an-cms-check { float: right; margin-left: 10px; }
.an-cms-section-row .an-cms-field { display: inline-flex; margin: 6px 0 0; }
.an-cms-empty { font: 11px/1.6 Arial, sans-serif; color: #867b66; }
.cms-custom-section { position: relative; padding: 40px clamp(20px, 5vw, 70px); background: #faf8f4; border-top: 1px solid #eee9df; }
.cms-custom-section .title { text-align: center; margin-bottom: 22px; }
.cms-custom-section .title h2 { font: 500 26px Georgia, serif; margin-bottom: 12px; }
.cms-custom-section .line { width: 52px; height: 2px; background: #b28a42; margin: auto; }
.cms-custom-body { max-width: 900px; margin: auto; font: 13px/1.85 Arial, sans-serif; color: #635e55; }
@media(max-width:650px) {
  #an-cms-toolbar:not([hidden]) { align-items: flex-start; }
  .an-cms-toolbar-actions { width: 100%; }
  .an-cms-toolbar-actions button { flex: 1 1 auto; }
  .an-cms-dialog { padding: 18px; }
  .an-cms-formgrid { grid-template-columns: minmax(0, 1fr); }
  .an-cms-section-row { align-items: flex-start; }
}
@media(prefers-reduced-motion:reduce){.cms-edit-button{transition:none}}


/* In-site Login/Register mode switch */
.an-cms-auth-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e8dfcf;
  margin: 15px 0 17px;
  padding-bottom: 8px;
}
.an-cms-auth-tabs button {
  border: 1px solid #dfd2b8;
  border-radius: 5px;
  padding: 8px 13px;
  background: #fff;
  color: #6d5837;
  font: 700 11px Arial, sans-serif;
  cursor: pointer;
}
.an-cms-auth-tabs button.is-active {
  background: #b28a42;
  border-color: #b28a42;
  color: #fff;
}
#an-cms-register-form[hidden],
#an-cms-login-form[hidden] { display: none !important; }


/* Distinct, easy-to-recognize admin actions */
.an-cms-toolbar-actions #an-cms-publish {
  background: #c18e35;
  border-color: #c18e35;
  color: #fff;
  font-weight: 700;
}
.an-cms-toolbar-actions #an-cms-publish:hover {
  background: #a97725;
  border-color: #a97725;
}
.an-cms-toolbar-actions #an-cms-logout {
  background: #984b40;
  border-color: #984b40;
  color: #fff;
  font-weight: 700;
}
.an-cms-toolbar-actions #an-cms-logout:hover {
  background: #7e392f;
  border-color: #7e392f;
}

/* Inline admin edit control beside footer legal links */
.cms-legal-edit { position: relative; display: none; top: auto; right: auto; margin-right: 12px; white-space: nowrap; }
.cms-edit-mode .cms-legal-edit { display: inline-block; }
.cms-legal-edit[hidden] { display: none !important; }
@media (max-width: 700px) { .cms-legal-edit { margin: 8px 0; } }
