/* Look of the editor (Sveltia CMS) at /admin/edit/, matched to the Overview at /admin/ (overview.css):
   navy top bar with an orange edge, the Overview's sections and colours in the sidebar, cards on a soft
   background, and a button back to the Overview. Sveltia builds its own colours from --sui-base-hue.
   The sidebar items are matched by their labels in config.yml: rename a collection there, rename it here. */
:root {
  --sui-base-hue: 22 !important;
  --ed-navy: #0F172A; --ed-orange: #D96B27; --ed-rust: #C2410C;
  --ed-bg: #F6F7FB; --ed-panel: #FFFFFF; --ed-side: #FBFBFD; --ed-text2: #475569;
  --ed-rule: #E2E8F0; --ed-rule-strong: #CBD5E1; --ed-hover: #F1F5F9;
  --ed-sel-bg: #FFEDD5; --ed-sel-text: #9A3412;
  --ed-shadow: 0 1px 2px rgb(15 23 42 / .05), 0 4px 16px rgb(15 23 42 / .05);
  --c-research: #C2410C; --c-activities: #0F766E; --c-teaching: #4338CA;
  --c-cv: #B45309; --c-people: #BE185D; --c-website: #0369A1;
}
:root[data-theme='dark'] {
  --ed-bg: #0B1120; --ed-panel: #111A2E; --ed-side: #0E1627; --ed-text2: #94A3B8;
  --ed-rule: #1E293B; --ed-rule-strong: #334155; --ed-hover: #172238;
  --ed-sel-bg: #3B1D0B; --ed-sel-text: #FDBA74;
  --ed-shadow: 0 1px 2px rgb(0 0 0 / .3);
  --c-research: #FB923C; --c-activities: #2DD4BF; --c-teaching: #A5B4FC;
  --c-cv: #FBBF24; --c-people: #F472B6; --c-website: #7DD3FC;
}

/* ===== Page and top bar ===== */
.app-shell { background: var(--ed-bg) !important; }
.app-shell > .outer > .main > .toolbar-wrapper > .toolbar {
  background: var(--ed-navy) !important; border-bottom: 3px solid var(--ed-orange); color: #F8FAFC;
  --sui-primary-foreground-color: #F8FAFC; --sui-secondary-foreground-color: #CBD5E1;
}
/* the bar above an entry being edited gets the same look */
.content-editor > .toolbar.primary {
  background: var(--ed-navy) !important; border-bottom: 3px solid var(--ed-orange); color: #F8FAFC;
  --sui-primary-foreground-color: #F8FAFC; --sui-secondary-foreground-color: #CBD5E1;
}
:is(.toolbar-wrapper > .toolbar, .content-editor > .toolbar.primary) .button:not(.primary) { color: #F8FAFC; }
:is(.toolbar-wrapper > .toolbar, .content-editor > .toolbar.primary) .button:not(.primary):hover { background: rgb(255 255 255 / .1); }
.toolbar-wrapper > .toolbar .button[aria-checked='true'] { background: rgb(255 255 255 / .16); }
.content-editor > .toolbar.primary .button.primary[aria-disabled='true'] { opacity: .45; }

/* the edit and preview panes: cards on the soft background */
.content-editor { background: var(--ed-bg); }
.content-editor .pane-wrapper { padding: 12px 8px; }
.content-editor .group.pane {
  border-radius: 12px; overflow: hidden; background: var(--ed-panel);
  border: 1px solid var(--ed-rule); box-shadow: var(--ed-shadow);
}
.content-editor #first-pane-header { border-top: 3px solid var(--ed-orange); }
.toolbar-wrapper .search-bar .text-input { background: rgb(255 255 255 / .1) !important; border-color: rgb(255 255 255 / .18) !important; border-radius: 8px; }
.toolbar-wrapper .search-bar, .toolbar-wrapper .search-bar input { color: #F8FAFC; }
.toolbar-wrapper .search-bar input::placeholder { color: #94A3B8; }

/* ===== Sidebar: the Overview's sections, in its colours ===== */
.primary-sidebar { background: var(--ed-side); min-height: 100%; border-right: 1px solid var(--ed-rule); padding-bottom: 56px; /* room for the Overview button */ }
.resizable-pane:has(> .primary-sidebar) { min-width: 265px; }
.primary-sidebar .treeitem .row { border-radius: 8px; }
.primary-sidebar .treeitem:hover > .row { background: var(--ed-hover); }
.primary-sidebar .treeitem[aria-selected='true'] > .row { background: var(--ed-sel-bg); color: var(--ed-sel-text); font-weight: 600; }
.primary-sidebar .treeitem .icon { color: var(--c, inherit); }
.primary-sidebar .treeitem .count {
  min-width: 22px; padding: 0 4px; border: 1px solid var(--ed-rule-strong); border-radius: 6px;
  font-size: 12px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; background: var(--ed-panel);
}
.primary-sidebar .divider { margin: 8px 0 2px !important; background: var(--ed-rule) !important; }
/* section heading above the first item of each section */
.primary-sidebar .treeitem:is(
  [data-label='Research outputs'], [data-label='Conference papers'], [data-label='Courses'],
  [data-label='Prizes and honours'], [data-label='Research groups'], [data-label='About me'])::before {
  display: block; padding: 8px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--c);
}
.primary-sidebar .treeitem[data-label='Research outputs']::before { content: 'Research'; }
.primary-sidebar .treeitem[data-label='Conference papers']::before { content: 'Activities'; }
.primary-sidebar .treeitem[data-label='Courses']::before { content: 'Teaching'; }
.primary-sidebar .treeitem[data-label='Prizes and honours']::before { content: 'Recognition and CV'; }
.primary-sidebar .treeitem[data-label='Research groups']::before { content: 'Groups and people'; }
.primary-sidebar .treeitem[data-label='About me']::before { content: 'Website'; }
.primary-sidebar .treeitem:is([data-label='Research outputs'], [data-label='Projects'], [data-label='Grants and funding']) { --c: var(--c-research); }
.primary-sidebar .treeitem:is([data-label='Conference papers'], [data-label='Invited lectures'], [data-label='Professional service']) { --c: var(--c-activities); }
.primary-sidebar .treeitem:is([data-label='Courses'], [data-label='Student theses'], [data-label='Institutions and settings']) { --c: var(--c-teaching); }
.primary-sidebar .treeitem:is([data-label='Prizes and honours'], [data-label='Curricula vitae']) { --c: var(--c-cv); }
.primary-sidebar .treeitem:is([data-label='Research groups'], [data-label='People']) { --c: var(--c-people); }
.primary-sidebar .treeitem:is([data-label='About me'], [data-label='News'], [data-label='Extra pages']) { --c: var(--c-website); }

/* ===== Lists of entries: a card, as the Overview's tiles ===== */
#collection-container > .toolbar h2 { font-size: 20px; font-weight: 700; }
#collection-container .main-inner-main {
  margin: 0 16px 16px; border-radius: 12px; overflow: hidden;
  background: var(--ed-panel); border: 1px solid var(--ed-rule); border-top: 3px solid var(--ed-orange); box-shadow: var(--ed-shadow);
}
#collection-container .grid-body > [role='row']:hover { background: var(--ed-hover); }

/* ===== Buttons ===== */
.button.primary { background: linear-gradient(135deg, var(--ed-orange), var(--ed-rust)) !important; border-color: transparent !important; color: #fff !important; }
.button.primary:hover { filter: brightness(1.08); }

/* ===== Back to the Overview ===== */
.back-to-overview {
  position: fixed; left: 12px; bottom: 12px; z-index: 1000;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--ed-navy); color: #F8FAFC !important; text-decoration: none !important;
  font: 600 14px/1 'Source Sans 3 Variable', system-ui, sans-serif !important;
  box-shadow: 0 4px 14px rgb(15 23 42 / .25);
}
.back-to-overview:hover, :root[data-theme='dark'] .back-to-overview { background: var(--ed-rust); }
:root[data-theme='dark'] .back-to-overview:hover { background: var(--ed-orange); }
.back-to-overview:focus-visible { outline: 2px solid var(--ed-orange); outline-offset: 3px; }
