/* === Globale variabler === */
:root {
  --brand: #e74829;
  --brand-dark: #c93d21;
  --header-bg: #E9E9E9;
  --bg: #ffffff;
  --light-bg: #FFF0DC;
  --important-bg: #FAC7A3;
  --text: #1a1a1a;
  --text-muted: #575757;
  --border: #999999;
  --error: #c0392b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Satoshi', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === Header (universell) === */
.site-header {
  background: var(--header-bg);
  padding: 0 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  height: 56px;
  border-bottom: 1px solid #d4d4d4;
}

.site-header__logo {
  height: 32px;
  width: auto;
}
.site-header__emblem {
  display: none;
  height: 32px;
  width: 32px;
}

.site-header__title {
  font-weight: 900;
  font-size: 16.8px;
  color: var(--text);
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Høyre-seksjon: hamburgermeny ELLER bruker+utlogging */
.site-header__right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.site-header__user {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-logout {
  background: none;
  border: 1px solid var(--text-muted);
  border-radius: 6px;
  padding: 5px 12px;
  font-family: 'Satoshi', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text);
}
.btn-logout:hover { border-color: var(--brand); color: var(--brand); }

.site-header__menu {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.site-header__menu span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* === Navigasjons-dropdown (admin/superadmin) === */
.nav-dropdown-wrapper {
  position: relative;
}
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 200px;
  z-index: 100;
  overflow: hidden;
}
.nav-dropdown--open { display: flex; flex-direction: column; }

.nav-dropdown__item {
  display: block;
  padding: 12px 18px;
  font-family: 'Satoshi', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}
.nav-dropdown__item:last-child { border-bottom: none; }
.nav-dropdown__item:hover { background: var(--light-bg); }
.nav-dropdown__logout { color: var(--brand); }
.nav-dropdown__logout:hover { background: #fef0ef; }

/* === Knapper (gjenbrukbare) === */
.btn-primary {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  font-family: 'Satoshi', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary:hover { background: var(--brand-dark); }

.btn-secondary {
  display: inline-block;
  background: #fff;
  color: var(--brand);
  font-family: 'Satoshi', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 24px;
  border-radius: 8px;
  border: 2px solid var(--brand);
  cursor: pointer;
  text-decoration: none;
}
.btn-secondary:hover { background: var(--brand); color: #fff; }

/* === Responsivt === */

/* Mobil: tittel alltid skjult */
@media (max-width: 520px) {
  .site-header__title { display: none; }
  .site-header { grid-template-columns: auto 1fr; }
  .site-header__right { justify-self: end; }

  /* Innlogget: emblem i stedet for full logo */
  .site-header--auth .site-header__logo { display: none; }
  .site-header--auth .site-header__emblem { display: block; }
}

/* Mellomstørrelse: kort tittel */
@media (min-width: 521px) and (max-width: 768px) {
  .site-header__title { font-size: 14px; }
}
