/*
 * luv77 shared top bar
 *
 * The page-specific files own their content, but every header uses this file
 * for the same three-column geometry, control sizing, language affordance,
 * and responsive rhythm.
 */

:root {
  --luv-topbar-height: 72px;
  --luv-workspace-topbar-height: var(--luv-topbar-height);
  --luv-topbar-gutter: clamp(16px, 3.2vw, 48px);
  --luv-topbar-gap: clamp(12px, 2vw, 28px);
  --luv-topbar-line: rgba(67, 53, 46, 0.13);
  --luv-topbar-paper: #fffdf8;
  --luv-topbar-ink: #302b29;
  --luv-topbar-muted: #82766e;
  --luv-topbar-accent: #a45f58;
}

.luv-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: var(--luv-topbar-gap);
  width: 100%;
  min-height: var(--luv-topbar-height);
  padding-inline: var(--luv-topbar-gutter);
  border-bottom: 1px solid var(--luv-topbar-line);
  color: var(--luv-topbar-ink);
}

.luv-topbar--light {
  --luv-topbar-line: var(
    --landing-line,
    var(--workspace-line, var(--line, rgba(67, 53, 46, 0.13)))
  );
  --luv-topbar-paper: var(
    --landing-paper,
    var(--workspace-paper, var(--paper-color, #fffdf8))
  );
  --luv-topbar-ink: var(
    --landing-ink,
    var(--workspace-ink, var(--ink, #302b29))
  );
  --luv-topbar-muted: var(
    --landing-muted,
    var(--workspace-muted, var(--muted, #82766e))
  );
  --luv-topbar-accent: var(
    --landing-accent,
    var(--workspace-accent, var(--accent, #a45f58))
  );
  background: rgba(245, 240, 233, 0.9);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

/* The first, second, and third header slots stay centered independently of
   how wide the content on either side happens to be. */

.luv-topbar > .luv-topbar-brand,
.luv-topbar > .brand,
.luv-topbar > .workspace-brand {
  grid-column: 1;
  justify-self: start;
  min-width: 0;
}

.luv-topbar > .luv-topbar-actions,
.luv-topbar > .header-actions,
.luv-topbar > .topbar-actions,
.luv-topbar > .workspace-topbar-actions,
.luv-topbar > .top-right {
  grid-column: 3;
  justify-self: end;
  min-width: 0;
}

.luv-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 0;
  color: var(--luv-topbar-ink);
  font-family: var(
    --landing-serif,
    var(--workspace-serif, var(--serif, Georgia, serif))
  );
  font-size: 25px;
  font-weight: 400;
  letter-spacing: -0.065em;
  line-height: 1;
  white-space: nowrap;
}

.luv-topbar .brand-mark {
  display: inline-block;
  width: 25px;
  height: 22px;
  flex: 0 0 25px;
  background: url("/assets/logo.svg") no-repeat center / contain;
  transform: rotate(-6deg);
}

.luv-topbar .brand-mark::before,
.luv-topbar .brand-mark::after,
.luv-topbar .brand-mark span {
  content: none;
}

.luv-topbar-actions,
.header-actions,
.topbar-actions,
.workspace-topbar-actions,
.top-right {
  display: flex;
  align-items: center;
  gap: var(--luv-space-3, 12px);
}

/* Primary and quiet actions share one compact pill treatment in every desk. */

.luv-topbar .button-small,
.luv-topbar .topbar-create,
.luv-topbar .ghost-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.luv-topbar .button-small,
.luv-topbar .topbar-create {
  border: 1px solid var(--luv-topbar-accent);
  background: var(--luv-topbar-accent);
  color: #fffaf4;
  box-shadow: 0 8px 18px rgba(132, 72, 64, 0.15);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.luv-topbar .button-small:hover,
.luv-topbar .topbar-create:hover {
  border-color: var(
    --landing-accent-dark,
    var(--workspace-accent-dark, var(--luv-topbar-accent))
  );
  background: var(
    --landing-accent-dark,
    var(--workspace-accent-dark, var(--luv-topbar-accent))
  );
  box-shadow: 0 11px 22px rgba(132, 72, 64, 0.2);
  transform: translateY(-1px);
}

/* Shared icon-first language control. The native select remains keyboard and
   screen-reader accessible, then opens as a compact menu on hover/focus. */

.language-picker-label,
.workspace-language-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.luv-topbar-language {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
}

.luv-topbar-language::after {
  position: absolute;
  top: 100%;
  right: -8px;
  width: 154px;
  height: 8px;
  content: "";
}

.luv-topbar-language-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--luv-topbar-line);
  border-radius: 50%;
  color: var(--luv-topbar-accent);
  font-family: Georgia, serif;
  font-size: 14px;
  line-height: 1;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.luv-topbar-language:hover .luv-topbar-language-icon,
.luv-topbar-language:focus-within .luv-topbar-language-icon {
  border-color: var(--luv-topbar-accent);
  background: color-mix(in srgb, var(--luv-topbar-accent) 8%, transparent);
  transform: translateY(-1px);
}

.luv-topbar-language select {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  outline: none;
  background: transparent;
  color: transparent;
  cursor: pointer;
  opacity: 0;
  appearance: none;
}

.luv-topbar-language:hover select,
.luv-topbar-language:focus-within select {
  top: calc(100% + 8px);
  width: 136px;
  min-width: 136px;
  height: 36px;
  padding: 0 28px 0 12px;
  border: 1px solid var(--luv-topbar-line);
  border-radius: 10px;
  background: var(--luv-topbar-paper);
  color: var(--luv-topbar-ink);
  box-shadow: 0 12px 24px rgba(66, 47, 37, 0.12);
  opacity: 1;
  pointer-events: auto;
  appearance: auto;
}

.luv-topbar-language select option {
  color: var(--luv-topbar-ink);
  background: var(--luv-topbar-paper);
}

.luv-topbar :is(a, button, select):focus-visible {
  outline: 3px solid
    color-mix(in srgb, var(--luv-topbar-accent) 38%, transparent);
  outline-offset: 3px;
}

@media (max-width: 780px) {
  :root {
    --luv-topbar-height: 64px;
    --luv-workspace-topbar-height: var(--luv-topbar-height);
    --luv-topbar-gutter: 16px;
    --luv-topbar-gap: 12px;
  }

  .luv-topbar {
    min-height: var(--luv-topbar-height);
  }

  .mobile-menu {
    top: var(--luv-topbar-height);
  }

  .luv-topbar > .luv-topbar-nav,
  .luv-topbar > .header-actions {
    display: none;
  }

  .luv-topbar > .menu-toggle {
    display: grid;
    grid-column: 2;
    justify-self: end;
    width: 38px;
    height: 38px;
    padding: 7px;
    place-content: center;
    border-radius: 50%;
    background: transparent;
  }

  .luv-topbar > .menu-toggle span {
    display: block;
    width: 20px;
    height: 1px;
    margin: 4px auto;
    background: var(--luv-topbar-ink);
  }

  .luv-topbar .luv-topbar-brand,
  .luv-topbar .workspace-brand {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .luv-topbar * {
    transition-duration: 0.01ms !important;
  }
}
