/* Homepage sidebar: light glass panel, scoped to index.tpl only. */

html[data-theme-style="cream-red"] {
  --home-sidebar-glass: rgba(255, 253, 247, .82);
  --home-sidebar-line: rgba(148, 96, 55, .15);
  --home-sidebar-highlight: rgba(230, 0, 35, .10);
}

html[data-theme-style="black-gold"] {
  --home-sidebar-glass: rgba(18, 18, 18, .82);
  --home-sidebar-line: rgba(212, 175, 55, .18);
  --home-sidebar-highlight: rgba(212, 175, 55, .12);
}

html[data-theme-style="taupe-red"] {
  --home-sidebar-glass: rgba(222, 213, 204, .78);
  --home-sidebar-line: rgba(74, 58, 49, .16);
  --home-sidebar-highlight: rgba(230, 0, 35, .10);
}

html[data-theme-style] .home-main-content {
  position: relative;
  isolation: isolate;
}

html[data-theme-style] .sidebar-home.sticky {
  overflow: hidden;
  color: var(--palette-text);
  background-color: var(--home-sidebar-glass);
  background-image:
    radial-gradient(circle at 100% 0, var(--home-sidebar-highlight), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, .08), transparent 44%);
  border: 1px solid var(--home-sidebar-line);
  border-radius: 16px;
  box-shadow:
    0 18px 48px var(--palette-shadow),
    inset 0 1px 0 rgba(255, 255, 255, .18);
  backdrop-filter: blur(18px) saturate(1.16);
  -webkit-backdrop-filter: blur(18px) saturate(1.16);
}

html[data-theme-style="black-gold"] .sidebar-home.sticky {
  background-image:
    radial-gradient(circle at 100% 0, var(--home-sidebar-highlight), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, .035), transparent 44%);
  box-shadow:
    0 22px 54px rgba(0, 0, 0, .48),
    inset 0 1px 0 rgba(255, 255, 255, .07);
}

html[data-theme-style] .sidebar-home .sidebar-holder {
  height: 100%;
  padding: 22px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: color-mix(in srgb, var(--palette-accent) 42%, transparent) transparent;
  scrollbar-width: thin;
}

html[data-theme-style] .sidebar-home .sidebar-holder::-webkit-scrollbar {
  width: 6px;
}

html[data-theme-style] .sidebar-home .sidebar-holder::-webkit-scrollbar-track {
  background: transparent;
}

html[data-theme-style] .sidebar-home .sidebar-holder::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--palette-accent) 38%, transparent);
  border-radius: 999px;
}

/* Section headings */
html[data-theme-style] .sidebar-home .headline {
  min-height: 32px;
  margin: 0 0 10px;
  padding: 0;
}

html[data-theme-style] .sidebar-home .headline h2 {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--palette-text);
  font-size: 13px;
  font-weight: 750;
  line-height: 18px;
  letter-spacing: .035em;
}

html[data-theme-style] .sidebar-home .headline h2 > a {
  color: var(--palette-text);
  transition: color .18s ease;
}

html[data-theme-style] .sidebar-home .headline h2 > i.icon {
  display: inline-flex;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--palette-accent);
  background: color-mix(in srgb, var(--palette-accent) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--palette-accent) 18%, transparent);
  border-radius: 10px;
}

html[data-theme-style] .sidebar-home .headline h2 > i.icon::before {
  margin: 0;
  font-size: 15px;
}

/* Grouped categories put their icon on the link itself. */
html[data-theme-style] .sidebar-home .headline h2 > a.icon {
  display: flex;
  gap: 10px;
  align-items: center;
}

html[data-theme-style] .sidebar-home .headline h2 > a.icon::before {
  display: inline-flex;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--palette-accent);
  background: color-mix(in srgb, var(--palette-accent) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--palette-accent) 18%, transparent);
  border-radius: 10px;
}

html[data-theme-style] .no-touch .sidebar-home .headline h2 > a:hover {
  color: var(--palette-accent);
}

/* Lists */
html[data-theme-style] .sidebar-home .list {
  width: auto;
  margin: 0 0 20px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--home-sidebar-line);
}

html[data-theme-style] .sidebar-home .list:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

html[data-theme-style] .sidebar-home .list li {
  margin: 0 0 3px;
  padding: 0;
}

html[data-theme-style] .sidebar-home .list a {
  display: flex;
  min-height: 38px;
  align-items: center;
  margin: 0;
  padding: 8px 10px 8px 12px;
  color: var(--palette-text);
  font-size: 13px;
  font-weight: 550;
  line-height: 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease;
}

html[data-theme-style] .sidebar-home .list a::before {
  display: none;
}

html[data-theme-style] .sidebar-home .list .rating {
  display: inline-flex;
  min-width: 30px;
  height: 22px;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  padding: 0 7px;
  color: var(--palette-muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  background: color-mix(in srgb, var(--palette-control) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--palette-border) 48%, transparent);
  border-radius: 999px;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

html[data-theme-style] .no-touch .sidebar-home .list a:hover {
  color: var(--palette-accent);
  background: color-mix(in srgb, var(--palette-accent) 9%, transparent);
  border-color: color-mix(in srgb, var(--palette-accent) 15%, transparent);
  transform: translateX(2px);
}

html[data-theme-style] .no-touch .sidebar-home .list a:hover .rating {
  color: var(--palette-accent);
  background: color-mix(in srgb, var(--palette-accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--palette-accent) 20%, transparent);
}

html[data-theme-style] .sidebar-home .list > li.active > a,
html[data-theme-style] .sidebar-home .list > li.active > a:hover {
  color: var(--palette-on-accent);
  background: var(--palette-accent);
  border-color: var(--palette-accent);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--palette-accent) 22%, transparent);
}

html[data-theme-style] .sidebar-home .list > li.active > a .rating,
html[data-theme-style] .sidebar-home .list > li.active > a:hover .rating {
  color: var(--palette-on-accent);
  background: color-mix(in srgb, var(--palette-on-accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--palette-on-accent) 24%, transparent);
}

/* Desktop: restore the home sidebar as a real, sticky glass column. */
@media screen and (min-width: 1257px) {
  html[data-theme-style] .home-main-content {
    column-gap: 40px;
  }

  html[data-theme-style] .sidebar-home.sticky {
    position: sticky;
    top: 24px;
    right: auto;
    left: auto;
    z-index: 20;
    flex: 0 0 272px;
    width: 272px;
    height: auto;
    max-height: calc(100vh - 48px);
    margin: 30px 0 0;
    padding: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  html[data-theme-style] .sidebar-home + .main-container {
    width: calc(100% - 312px);
  }

  html[data-theme-style] .sidebar-home .list {
    display: block;
  }

  html[data-theme-style] .sidebar-home .list li {
    width: 100%;
  }
}

/* Tablet/mobile: keep the existing dropdown behaviour, with a floating panel. */
@media screen and (max-width: 1256px) {
  html[data-theme-style] .sidebar-home.sticky {
    top: 82px;
    right: 14px;
    left: 14px;
    width: auto;
    max-height: min(72vh, 680px);
    margin: 0;
    padding: 0;
    border-radius: 16px;
  }

  html[data-theme-style] body.drop .sidebar-home.sticky {
    box-shadow:
      0 24px 60px var(--palette-shadow),
      inset 0 1px 0 rgba(255, 255, 255, .16);
  }

  html[data-theme-style] .sidebar-home .list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 8px;
    margin-right: 0;
    margin-left: 0;
  }

  html[data-theme-style] .sidebar-home .list li {
    width: auto;
    margin: 0;
    padding: 0;
  }
}

@media screen and (max-width: 785px) {
  html[data-theme-style] .sidebar-home.sticky {
    top: 72px;
    right: 8px;
    left: 8px;
    max-height: 74vh;
    border-radius: 14px;
  }

  html[data-theme-style] .sidebar-home .sidebar-holder {
    padding: 18px;
  }
}

@media screen and (max-width: 560px) {
  html[data-theme-style] .sidebar-home .list {
    display: block;
  }

  html[data-theme-style] .sidebar-home .list a {
    min-height: 36px;
  }
}

@supports not (backdrop-filter: blur(1px)) {
  html[data-theme-style] .sidebar-home.sticky {
    background-color: var(--palette-surface);
  }
}

@supports not (color: color-mix(in srgb, white, black)) {
  html[data-theme-style] .sidebar-home .headline h2 > i.icon,
  html[data-theme-style] .sidebar-home .headline h2 > a.icon::before,
  html[data-theme-style] .no-touch .sidebar-home .list a:hover {
    background-color: var(--palette-control);
  }

  html[data-theme-style] .sidebar-home .list .rating {
    background-color: var(--palette-control);
    border-color: var(--palette-border);
  }
}
