/* ========================================
   SIDEBAR (ASIDE) COMPONENT STYLES
======================================== */

aside {
  position: fixed;
  top: 0;
  left: 0;
  transform: translateX(-100%);
  width: 17rem;
  height: 100vh;
  background: var(--surface-1);
  backdrop-filter: blur(calc(var(--surface-blur) * 1.5)) saturate(180%);
  -webkit-backdrop-filter: blur(calc(var(--surface-blur) * 1.5)) saturate(180%);
  border-right: 0.0625rem solid var(--surface-border);
  box-shadow: var(--elevation-surface);
  z-index: 99;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease, border-color 0.2s ease;
  will-change: transform;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

aside.open {
  transform: translateX(0);
}

aside button {
  outline: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-appearance: none;
  appearance: none;
}

aside button:focus {
  outline: none;
}

aside button:focus-visible {
  outline: 0.125rem solid var(--text-color);
  outline-offset: 0.125rem;
  border-radius: 0.125rem;
}

.sidebar-links {
  flex: 1;
  padding: 3.75rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
  justify-content: center;
  transition: justify-content 0.28s ease;
}

.sidebar-link {
  font-size: var(--font-size-h3);
  font-weight: 500;
  color: var(--text-color);
  text-decoration: none;
  padding: 1rem 1.5rem;
  border-radius: 0;
  transition: color 0.2s ease, transform 0.18s ease;
  font-family: var(--font-heading);
  cursor: pointer;
  text-align: left;
  width: 100%;
  position: relative;
  outline: none;
  will-change: transform;
}

.sidebar-link:focus-visible {
  outline: 0.125rem solid var(--text-color);
  outline-offset: -0.125rem;
  border-radius: 0.25rem;
}

.sidebar-link:focus:not(:focus-visible) {
  outline: none;
}

.sidebar-link:hover {
  color: var(--text-color);
  transform: translateX(0.5rem);
}

.sidebar-link.active {
  color: var(--text-color);
  font-weight: 600;
  transform: translateX(0.5rem);
}

.sidebar-link.active::before {
  height: 60%;
}

.sidebar-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0.125rem;
  height: 0;
  background-color: var(--selection-color);
  transition: height 0.2s ease;
}

.sidebar-link:hover::before {
  height: 60%;
}

.sidebar-footer {
  padding: 1.25rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  margin-top: auto;
  flex-shrink: 0;
  background: var(--surface-1);
  border-top: 0.0625rem solid var(--surface-border);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.controls-toggle {
  background: var(--surface-2);
  border: 0.0625rem solid var(--surface-border);
  outline: none;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: transform 0.24s ease, background-color 0.2s ease, border-color 0.2s ease;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--elevation-surface);
  will-change: transform;
}

.controls-toggle:hover {
  background-color: var(--surface-2);
  transform: scale(1.1);
  border-color: var(--surface-border);
}

.controls-toggle.active,
.controls-toggle.active:hover,
.controls-toggle.active:focus-visible {
  background-color: var(--surface-2);
  border-color: var(--surface-border);
}

.controls-toggle:focus-visible {
  box-shadow: 0 0 0 0.125rem var(--text-color);
}

.controls-toggle:focus:not(:focus-visible) {
  box-shadow: none;
  outline: none;
}

.toggle-dots {
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  transform-origin: center;
  transition: transform 0.22s ease;
}

.toggle-dots svg {
  width: 100%;
  height: 100%;
  display: block;
}

.toggle-dots svg path {
  fill: none !important;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.controls-toggle.active .toggle-dots {
  transform: rotate(180deg);
}

.sidebar-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
  max-height: 15rem;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.22s ease, gap 0.22s ease;
  width: 100%;
}

.sidebar-controls.collapsed {
  max-height: 0;
  opacity: 0;
  gap: 0;
}

.control-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  gap: 0.25rem;
}

.control-label {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-color);
  letter-spacing: 0.03em;
  min-width: 4rem;
}

.lang-toggle-menu,
.theme-toggle-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.lang-option,
.theme-option {
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-color);
  transition: color 0.2s ease;
  cursor: pointer;
  padding: 0.25rem 0;
  border-radius: 0;
  background: transparent;
  border: none;
}

html[data-theme="light"] .lang-option,
html[data-theme="light"] .theme-option {
  color: #000000;
}

.lang-option.active,
.theme-option.active {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.lang-divider,
.theme-divider {
  color: var(--border-color);
  font-weight: 200;
  opacity: 0.5;
  margin: 0 0.125rem;
}