/* Quill editor adjustments */
#editor { margin-bottom: 1.5rem; }
.ql-toolbar.ql-snow { margin-bottom: 0 !important; background: #fff; border-top-left-radius: 0.5rem; border-top-right-radius: 0.5rem; border-bottom: none !important; }
.ql-container.ql-snow { margin-bottom: 1rem; border-bottom-left-radius: 0.5rem; border-bottom-right-radius: 0.5rem; border-top: none !important; }
/* Ensure outer editor wrappers only round the bottom corners (works for #editor on Add page and editor-* on More page) */
#editor, [id^="editor-"] { border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; border-bottom-left-radius: 0.5rem !important; border-bottom-right-radius: 0.5rem !important; }


/* #editor .ql-container { height: auto !important; min-height: 200px; } */
/* #editor .ql-editor { min-height: 180px; } */

/* #notesWrap { margin-bottom: 4rem;} */


body { background-color: var(--color-background, #e9e5dc) }

.background-color { color: var(--color-primary, #e9e5dc); }
.accent-color { color: var(--color-primary, #0000a5); }
/* Theme helpers */
.text-primary { color: var(--color-primary, #0000a5) }
.link-primary { color: var(--color-primary, #0000a5); }
.link-primary:hover { filter: brightness(0.85); }
.badge-primary {
  background: var(--color-primary, #0000a5);
  color: #fff;
  border: 1px solid var(--color-primary, #0000a5);
}
input[type="checkbox"], input[type="radio"] {
  accent-color: var(--color-primary, #0000a5);
}

/* Default rounding for form controls so markup doesn't need rounded-lg */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="file"],
input[type="email"],
select,
textarea,
.input,
.select {
  border-radius: 0.5rem; /* same as Tailwind rounded-lg */
}

#accordion-list > * + * {
  margin-top: 1rem; /* 1rem = 16px, matches Tailwind's space-y-4 */
}

.accordion-item {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06); /* Tailwind shadow */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

span.accordion-item-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.accordion-header {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1.5rem 2rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 700;
  color: #0000a5;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgb(229, 231, 235);
  cursor: pointer;
  transition: background 0.15s;
}

.slug {
  color: #2949a8;
  border: 1px solid #ccc;
  padding: 4px 8px;
  /* min-width: 120px; */
}
.shortlink {
  color: #2949a8;
  text-decoration: underline;
  font-size: 1rem;
  line-height: 1.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 20rem;
  display: inline-block;
  vertical-align: middle;
  transition: color 0.15s;
}

.short-link:hover {
  color: #12204a;
}



.accordion-arrow {
  display: inline-block;
  width: 1.5rem;     /* 24px, matches Tailwind w-6 */
  height: 1.5rem;    /* 24px, matches Tailwind h-6 */
  background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 8L10 12L14 8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
  background-repeat: no-repeat;
  background-size: 100% 100%;
  vertical-align: middle;
  color: #2949a8; /* Use currentColor in SVG, can be overridden */
  transition: transform 0.3s;
}

/* Rotates arrow when accordion is open */
.accordion-header[aria-expanded="true"] .accordion-arrow {
  transform: rotate(180deg);
}
.accordion-arrow.expired { color: red; }


/* Shared button styles */
.button {
  color: #fff !important;
  font-weight: 500;
  padding: 0.25rem 0.8rem !important;
  font-size: 0.92rem !important;
  border-radius: 0.375rem !important;
  border: 1px solid transparent !important;
  transition: background 0.2s, border 0.2s;
  cursor: pointer;
}

.button-primary {
  background-color: var(--color-primary, #0000a5) !important;
  border-color: var(--color-primary, #0000a5) !important;
}
.button-primary:hover { filter: brightness(0.9); }

/* Secondary (green) button variant */
.button-secondary {
  background-color: var(--color-secondary, #249b3a) !important;
  border-color: var(--color-secondary, #18712b) !important;
}
.button-secondary:hover { filter: brightness(0.9); }

/* Align search input and button in dashboard subheader */
.subheader__wrap .dashboard-search {
  margin: 0; /* ensure no default margins from UA */
}
.subheader__wrap .dashboard-search input[type="text"] {
  height: 2.5rem; /* 40px */
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  line-height: 1.25rem;
  margin: 0;
}
.subheader__wrap .dashboard-search .button {
  height: 2.5rem; /* match input */
  padding-top: 0.5rem !important; /* override base .button */
  padding-bottom: 0.5rem !important; /* override base .button */
  line-height: 1.25rem;
  display: inline-flex;
  align-items: center;
  margin: 0;
}

/* Remove default UL margins/padding and align filter chips */
.subheader__wrap .subheader__list {
  margin: 0;
  padding-left: 0;
}
.subheader__wrap .subheader__list li { list-style: none; }
.subheader__wrap .subheader__list .subheader__link {
  display: inline-flex;
  align-items: center;
  height: 2.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Active admin nav item uses primary color */
.subheader__link.active {
  background: var(--color-primary, #0000a5) !important;
  color: #fff !important;
}

/* Align select and Add button heights to the row */
.subheader__wrap #sort-select {
  height: 2.5rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  padding-right: 2rem; /* reserve space for native arrow */
  width: auto;         /* fit content */
  white-space: nowrap; /* prevent wrapping overlapping the arrow */
}
.subheader__wrap .button-add {
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
}

/* Ensure Create button on Add page matches standard button height */
#btn-create {
  height: 2.5rem;
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

/* Baseline alignment helpers */
.subheader__wrap .dashboard-search input[type="text"],
.subheader__wrap .dashboard-search .button,
.subheader__wrap .subheader__list,
.subheader__wrap #sort-select,
.subheader__wrap .button-add {
  vertical-align: middle;
}

/* Specific color variants */
.button-add, .button-permanent {
  background-color: var(--color-secondary, #249b3a);
  border-color: var(--color-secondary, #18712b);
}
.button-add:hover, .button-permanent:hover {
  filter: brightness(0.9);
}

/* Split button styling for add dropdown */
#add-dropdown .btn-main {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.3) !important;
}
#add-dropdown .btn-caret {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  padding-left: 0.25rem !important;
  padding-right: 0.5rem !important;
}

.button-delete {
  background-color: #e12d39 !important;
  border-color: #b91c1c !important;
}
.button-delete:hover {
  background-color: #b91c1c !important;
  border-color: #991b1b !important;
}

/* Normalize Tailwind's rounded to behave like rounded-lg across the app */
.rounded { border-radius: 0.5rem !important; }
.subheader__link.rounded,
#sort-select.rounded,
input.rounded { border-radius: 0.25rem !important; }


/* Split button styling for header Add (main + caret) */
#nav-add-wrap .button-split .btn-main {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-right-width: 0 !important; /* avoid double border in the middle */
}
#nav-add-wrap .button-split .btn-caret {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  /* padding-left: 0.5rem !important; */
  padding-right: 0.5rem !important;
  border-left-width: 1px !important;
  border-left-color: rgba(0, 0, 0, 0.2) !important; /* subtle separator */
}
#nav-add-wrap .button-split .btn-caret svg {
  width: 1rem; /* 16px */
  height: 1rem;
}

/* Header Add dropdown menu styling */
#nav-add-menu {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  min-width: 7rem; /* fallback minimal width */
  width: 100%; /* match #nav-add-split width */
  box-sizing: border-box; /* include border in width */
  overflow: hidden; /* clip item separators to radius */
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  z-index: 1000; /* ensure above header */
}
#nav-add-menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: #1f2937; /* gray-800 */
  text-decoration: none;
  white-space: nowrap;
}
#nav-add-menu a + a { border-top: 1px solid #f3f4f6; }
/* #nav-add-menu a:hover { background: #f3f4f6; } */

/* Ensure file input has white background on Add/File */
#file-input {
  background-color: #fff !important;
}
