/*
  Households (HW-3873): the household mark, the thin accent of the active household in the app bar and the entry field,
  "Deine Haushalte" and the household label of a notification. A household's colour is a key of the person palette
  (people.css), so light and dark come from the same tokens. The shell and the app bar carry data-household-color; a
  mark carries data-color for the household it stands for.
*/

:root {
  --hw-household: var(--bsft-color-primary);
  --hw-household-soft: var(--hw-accent-soft);
}

[data-household-color="green"],
.hw-household-mark[data-color="green"] { --hw-household: var(--hw-person-green); --hw-household-soft: var(--hw-person-green-soft); }

[data-household-color="blue"],
.hw-household-mark[data-color="blue"] { --hw-household: var(--hw-person-blue); --hw-household-soft: var(--hw-person-blue-soft); }

[data-household-color="orange"],
.hw-household-mark[data-color="orange"] { --hw-household: var(--hw-person-orange); --hw-household-soft: var(--hw-person-orange-soft); }

[data-household-color="purple"],
.hw-household-mark[data-color="purple"] { --hw-household: var(--hw-person-purple); --hw-household-soft: var(--hw-person-purple-soft); }

[data-household-color="red"],
.hw-household-mark[data-color="red"] { --hw-household: var(--hw-person-red); --hw-household-soft: var(--hw-person-red-soft); }

[data-household-color="teal"],
.hw-household-mark[data-color="teal"] { --hw-household: var(--hw-person-teal); --hw-household-soft: var(--hw-person-teal-soft); }

/* --- mark --------------------------------------------------------------------------- */

.hw-household-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 999px;
  border: 2px solid var(--hw-household);
  background: var(--hw-household-soft);
  color: var(--hw-household);
  font-family: var(--hw-font-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.hw-household-mark.hw-household-mark-dot {
  width: 9px;
  height: 9px;
  border: 0;
  background: var(--hw-household);
}

/* --- app bar and entry field: the active household at a glance ------------------------ */

.hw-appbar[data-household-color] {
  box-shadow: inset 0 -3px 0 var(--hw-household-soft);
}

.hw-household-switch {
  gap: 6px;
  color: var(--bsft-color-muted);
}

.hw-household-switch:hover {
  color: var(--bsft-color-text);
}

.hw-app[data-household-color] .hw-entry {
  padding-left: 18px;
}

.hw-app[data-household-color] .hw-entry::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 2px;
  background: var(--hw-household);
}

/* --- "Deine Haushalte" --------------------------------------------------------------- */

.hw-household-row[aria-current="true"] .hw-household-row-name {
  color: var(--bsft-color-primary);
}

.hw-household-row-name {
  display: block;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.hw-household-row-role {
  display: block;
  font-size: 13px;
  color: var(--bsft-color-muted);
}

.hw-household-open {
  flex: none;
  min-width: 28px;
  text-align: center;
  font-family: var(--hw-font-mono);
  background: var(--hw-household-soft);
  color: var(--bsft-color-text);
}

.hw-household-check {
  display: inline-flex;
  flex: none;
  color: var(--bsft-color-primary);
}

/* --- desktop navigation --------------------------------------------------------------- */

/* Scoped to the navigation so it outweighs the button.hw-link-row reset in skeleton.css. */
.hw-nav .hw-nav-household {
  display: none;
}

@container hw-viewport (min-width: 900px) {
  .hw-nav .hw-nav-household {
    display: flex;
    margin: 0 0 16px;
    padding: 6px 10px;
    border-radius: 12px;
    font-weight: 700;
  }

  .hw-nav .hw-nav-household:hover {
    background: var(--hw-surface-2);
  }
}

/* --- notification list ----------------------------------------------------------------- */

.hw-inbox-household {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--bsft-color-muted);
}

/* --- household modules ----------------------------------------------------------------- */

.hw-module-tile-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--hw-accent-soft);
  color: var(--bsft-color-primary);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.hw-module-tile.is-off .hw-module-tile-icon {
  background: var(--hw-surface-2);
  color: var(--bsft-color-muted);
}

.hw-switch-text small.hw-module-tile-needs {
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 600;
}

.hw-module-off .hw-card {
  width: 100%;
  max-width: 480px;
  margin: 16px auto 0;
  text-align: left;
}
