/* ============================================================
DiveLog DS — Component: Drawer
v3.3 (2026-07-23): DDR-006 — X interna di chiusura,
trigger cambiato da hamburger a mobile-trigger (logo floating).
============================================================ */
.drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-sidebar);
  display: none;
  pointer-events: none;
}

.drawer--open {
  display: block;
  pointer-events: auto;
}

.drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.drawer__content {
  position: relative;
  width: 280px;
  height: 100%;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: var(--space-4) var(--space-2) var(--space-3);
  box-sizing: border-box;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--motion-medium) var(--ease-standard);
}

.drawer--open .drawer__content {
  transform: translateX(0);
}

/* ── X interna di chiusura (DDR-006) ── */
.drawer__close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--radius-medium);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-standard);
  z-index: 10;
}

.drawer__close:hover {
  background: var(--color-surface-container);
  color: var(--color-text-primary);
}

.drawer__close:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.drawer__close .material-symbols-outlined {
  font-size: 1.5rem;
}

/* ── Drawer Link (pillola) ── */
.drawer__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  margin: 0 var(--space-1) 2px;
  text-decoration: none;
  color: var(--color-text-secondary);
  font-size: var(--font-body-large);
  font-weight: var(--weight-medium);
  line-height: var(--line-height-normal);
  border-radius: var(--radius-pill);
  transition: background var(--motion-fast) var(--ease-standard),
              color var(--motion-fast) var(--ease-standard);
  cursor: pointer;
  background: none;
  border: none;
  width: calc(100% - (var(--space-1) * 2));
  text-align: left;
  font-family: var(--font-family-primary);
  min-height: 44px;
}

.drawer__link:hover {
  background: var(--color-surface-container);
  color: var(--color-text-primary);
}

.drawer__link:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.drawer__link--active {
  background: var(--color-primary-container);
  color: var(--color-primary);
  font-weight: var(--weight-bold);
}

.drawer__link--logout {
  color: var(--color-error);
  font-weight: var(--weight-bold);
}

.drawer__link--logout:hover {
  background: rgba(186, 26, 26, 0.08);
  color: var(--color-error);
}

.drawer__icon {
  font-size: 1.25rem;
  width: 1.5rem;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

.drawer__divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-2) var(--space-3);
  border: none;
}

.drawer__profile {
  padding: 0 var(--space-3) var(--space-3);
  margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border);
}

.drawer__profile-label {
  font-size: var(--font-label-large);
  color: var(--color-text-secondary);
}

.drawer__profile-name {
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  font-size: var(--font-body-large);
  margin-top: var(--space-1);
  word-break: break-all;
}

.drawer__theme-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  margin: 0 var(--space-1) 2px;
  background: none;
  border: none;
  border-radius: var(--radius-pill);
  width: calc(100% - (var(--space-1) * 2));
  text-align: left;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: var(--font-body-large);
  font-weight: var(--weight-medium);
  font-family: var(--font-family-primary);
  min-height: 44px;
  transition: background var(--motion-fast) var(--ease-standard),
              color var(--motion-fast) var(--ease-standard);
}

.drawer__theme-toggle:hover {
  background: var(--color-surface-container);
  color: var(--color-text-primary);
}

.drawer__theme-toggle:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.drawer__theme-toggle-badge {
  margin-left: auto;
  font-size: 1rem;
  line-height: 1;
}

@media (max-width: 599px) {
  .drawer__content {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drawer__content {
    transition: none;
  }
}