/* Merking på artikkelkort og i artikkelen. */
.lks-sponsored-label {
  display: inline-block;
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: 4px;
  background-color: var(--color-5, #8a091c);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .03em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  max-width: 100%;
  box-sizing: border-box;
}

.lks-sponsored-bar {
  position: sticky;
  top: var(--wp-admin--admin-bar--height, 0px);
  z-index: 50;
  margin-bottom: 24px;
  background-color: var(--color-12, #fddaca);
}

/* Innholdet følger «Bred»-bredden til Bilder-blokken (1280px), samme som brødsmulestien. */
.lks-sponsored-bar .wrapper {
  box-sizing: border-box;
  width: min(calc(100% - 40px), 1280px);
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 0;
  min-height: 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-block: 8px;
}

.lks-sponsored-bar .lks-sponsored-label {
  align-self: center;
  max-width: 48%;
}

.lks-sponsored-by {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  gap: 10px;
  font-size: 14px;
}

.lks-sponsored-by a {
  color: inherit;
  display: inline-flex;
  align-items: center;
}

.lks-sponsored-by img {
  display: block;
  width: auto;
  max-width: 140px;
  height: 28px;
  object-fit: contain;
}

/* Samme venstrekant som artikkeltittelen (headeren har heller ikke sidepadding her). */


/* Admin bar er ikke fast på små skjermer, så linjen skal da ligge helt øverst. */
@media screen and (max-width: 600px) {
  .lks-sponsored-bar { top: 0; }
  .lks-sponsored-bar .wrapper { flex-wrap: nowrap; gap: 8px; }
  .lks-sponsored-bar .lks-sponsored-label {
    flex: 0 1 auto; min-width: 0; max-width: 60%; padding: 3px 6px; font-size: 10px;
  }
  .lks-sponsored-bar .lks-sponsored-by { flex: 1; gap: 6px; font-size: 11px; }
  .lks-sponsored-bar .lks-sponsored-intro { min-width: 0; font-size: 9px; line-height: 1.3; }
  .lks-sponsored-bar .lks-sponsored-by a { flex: 0 0 auto; min-width: 0; max-width: 100px; }
  .lks-sponsored-bar .lks-sponsored-by img { flex: 0 0 auto; min-width: 0; max-width: 100px; height: 32px; object-position: right center; }
  .lks-sponsored-bar .lks-sponsored-by strong { min-width: 0; }
}

/* På de smaleste telefonene får teksten ligge over logoen. */
@media screen and (max-width: 359px) {
  .lks-sponsored-bar .lks-sponsored-by { flex-direction: column; align-items: flex-end; gap: 3px; }
}

.tease-search .lks-sponsored-label {
  margin-top: 6px;
}

/* På artikkelkort ligger merkelappen oppå bildet, nederst til venstre. */
.tease.tease-post figure .lks-sponsored-label {
  position: absolute;
  bottom: 12px;
  top: auto;
  left: 12px;
  max-width: calc(100% - 24px);
  z-index: 1;
  /* Roligere enn i artikkelen: sidens bakgrunnsfarge og vanlig tekstfarge. */
  background-color: var(--background-color, #f7f6e4);
  color: var(--text-color, #000);
}
