/*
 * Galerie-Sidebar
 * Einzige verbindliche Layoutquelle fuer die interne Galerie-Navigation.
 * Die gallery-* Klassen sind absichtlich vom globalen Sidebar-System getrennt.
 */
.snavio-photographer-page > .gallery-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.snavio-photographer-page > .gallery-layout--trash {
  display: block;
}

.gallery-sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  width: 240px;
  min-width: 0;
  max-height: calc(100vh - 36px);
  max-height: var(--gallery-sidebar-available-height, calc(100dvh - 36px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #c9c9cf transparent;
  scroll-padding-bottom: 18px;
  box-sizing: border-box;
  color: #242428;
}

.gallery-sidebar,
.gallery-sidebar * {
  box-sizing: border-box;
}

.gallery-sidebar-section,
.gallery-sidebar-action {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid #e2e4e9;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.gallery-sidebar-section:first-child {
  padding-top: 2px;
}

.gallery-sidebar-section:last-child {
  border-bottom: 0;
}

.gallery-sidebar-heading {
  margin: 0 0 8px;
  padding: 0;
  color: #68686f;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.gallery-tree {
  display: grid;
  gap: 3px;
  width: 100%;
  min-width: 0;
}

.gallery-tree-root,
.gallery-tree-child {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  color: #242428;
  text-decoration: none;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.gallery-tree-root {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 5px;
  align-items: center;
  padding: 6px 5px 6px 1px;
}

.gallery-tree-root-main {
  display: grid;
  grid-template-columns: 11px 18px minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.gallery-tree-child-row {
  position: relative;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border-radius: 10px;
}

.gallery-tree-child-row::before,
.gallery-tree-child-row::after {
  content: '';
  position: absolute;
  z-index: 0;
  left: calc(22px + var(--gallery-tree-indent, 4px));
  pointer-events: none;
  border-color: #d2d4dc;
}

.gallery-tree-child-row::before {
  top: -3px;
  bottom: -3px;
  border-left: 1px solid #d2d4dc;
}

.gallery-tree-child-row::after {
  top: 50%;
  width: 8px;
  border-top: 1px solid #d2d4dc;
}

.gallery-tree-child-row.is-last::before {
  bottom: 50%;
}

.gallery-tree-child {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 5px;
  align-items: center;
  padding: 6px 7px 6px calc(30px + var(--gallery-tree-indent, 4px));
}

.gallery-tree-child-main {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.gallery-tree-label-stack {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.gallery-tree-label-main {
  display: block;
  min-width: 0;
  color: #242428;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.22;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.gallery-tree-label-sub {
  min-width: 0;
  overflow: hidden;
  color: #777780;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-tree-caret {
  color: #9a9aa2;
  font-size: 11px;
  text-align: center;
}

.gallery-tree-folder-icon {
  width: 18px;
  font-size: 15px;
  line-height: 1;
  opacity: .84;
}

.gallery-tree-count {
  width: 28px;
  min-width: 28px;
  color: #8a8a92;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  text-align: right;
}

.gallery-tree-root:hover,
.gallery-tree-child-row:hover {
  background: #f4f4f7;
}

.gallery-tree-root.active,
.gallery-tree-child-row.active {
  background: #eeeeff;
}

.gallery-tree-system {
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px solid #ececf0;
}

.gallery-folder-actions {
  position: absolute;
  z-index: 8;
  top: 50%;
  right: 3px;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
}

.gallery-tree-child-row:hover .gallery-folder-actions,
.gallery-tree-child-row:focus-within .gallery-folder-actions,
.gallery-folder-actions[open] {
  opacity: 1;
  pointer-events: auto;
}

.gallery-tree-child-row:hover .gallery-tree-count,
.gallery-tree-child-row:focus-within .gallery-tree-count {
  opacity: 0;
}

.gallery-folder-actions > summary {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  color: #72727a;
  list-style: none;
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.gallery-folder-actions > summary > span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 0;
  line-height: 0;
}

.gallery-folder-actions > summary > span::before {
  content: '•••';
  display: block;
  color: currentColor;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 1px;
  transform: translateY(-1px);
}

.gallery-folder-actions > summary::-webkit-details-marker {
  display: none;
}

.gallery-folder-actions > summary:hover {
  background: #e8e8ed;
}

.gallery-folder-menu-panel {
  position: absolute;
  z-index: 2147482500;
  top: 32px;
  right: 0;
  display: grid;
  gap: 10px;
  width: 230px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .18);
}

.gallery-folder-menu-panel form {
  display: grid;
  gap: 7px;
  margin: 0;
}

.gallery-folder-menu-panel label {
  color: #6b7280;
  font-size: 11px;
  font-weight: 800;
}

.gallery-folder-menu-panel input,
.gallery-folder-menu-panel button {
  width: 100%;
  min-width: 0;
  height: 36px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  color: #111827;
  font-size: 12px;
}

.gallery-folder-menu-panel button {
  font-weight: 800;
  cursor: pointer;
}

.gallery-folder-menu-panel button:hover {
  background: #f8fafc;
}

.gallery-folder-menu-panel button.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.gallery-filter-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  margin: 0 0 10px;
  padding: 0 11px;
  border: 1px solid #c9c9cf;
  border-radius: 11px;
  background: #fff;
}

.gallery-filter-search-icon {
  flex: 0 0 auto;
  color: #55555d;
  font-size: 15px;
}

.gallery-filter-search-input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #242428;
  font: inherit;
  font-size: 13px;
}

.gallery-filter-icons {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 28px;
  padding: 2px 5px;
}

.gallery-filter-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0;
  color: #9ca3af;
  font-size: 16px;
  line-height: 1;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.gallery-filter-icon.red { color: #dc2626; }
.gallery-filter-icon.green { color: #16a34a; }
.gallery-filter-icon.black { color: #111827; }
.gallery-filter-icon.active { background: rgba(84, 87, 245, .09); }

.gallery-sidebar .snavio-gallery-sort-control {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 11px;
  border-top: 1px solid #ececf0;
}

.gallery-sidebar .snavio-gallery-sort-control label {
  color: #68686f;
  font-size: 11px;
  font-weight: 700;
}

.gallery-sidebar .snavio-gallery-sort-select,
.gallery-sidebar-input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 0 11px;
  color: #242428;
  font: inherit;
  font-size: 12px;
  border: 1px solid #d1d5db;
  border-radius: 11px;
  background: #fff;
}

.gallery-sidebar-action {
  padding: 10px 0;
}

.gallery-sidebar-action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
  text-align: center;
  white-space: normal;
}

.gallery-sidebar-action-button span {
  min-width: 0;
}

.gallery-sidebar-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.gallery-sidebar-form--create {
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  margin-top: 9px;
}

.gallery-subgallery-create > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin: 0;
  padding: 0 4px;
  color: #4f4f57;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  list-style: none;
  cursor: pointer;
  border-radius: 9px;
}

.gallery-subgallery-create > summary::-webkit-details-marker {
  display: none;
}

.gallery-subgallery-create > summary:hover {
  color: #4144d5;
  background: #f4f4f7;
}

.gallery-subgallery-create-icon {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  color: #55555d;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  border: 1px solid #d7d7dd;
  border-radius: 999px;
  background: #fff;
}

.gallery-subgallery-create[open] .gallery-subgallery-create-icon {
  color: #fff;
  border-color: #5457f5;
  background: #5457f5;
  transform: rotate(45deg);
}

.gallery-subgallery-add {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  height: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  border-radius: 11px;
}

.gallery-sidebar .trash-nav-button {
  width: 100%;
  min-width: 0;
}

@media (max-width: 900px) {
  .snavio-photographer-page > .gallery-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .gallery-sidebar {
    position: static;
    width: 100%;
    max-height: min(44vh, var(--gallery-sidebar-available-height, 44vh));
  }

  .gallery-folder-actions {
    opacity: 1;
    pointer-events: auto;
  }

  .gallery-folder-menu-panel {
    right: 0;
    max-width: calc(100vw - 32px);
  }
}
