/**
 * Fredericia intranet override for the shared flag sidebar
 * (bogmærker, smutveje, ulæste). Markup classes stay compatible
 * with bc_flag_extension/js/sidebar.js.
 */

.flag-sidebar-block {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 302;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.flag-sidebar-block .sidebar-block {
  position: relative;
  align-items: center;
  justify-content: flex-end;
  margin: 0;
}

.flag-sidebar-block .sidebar-block::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  width: 20px;
  height: 140%;
  transform: translateY(-50%);
}

.flag-sidebar-block .sidebar-bookmark-icon,
.flag-sidebar-block .sidebar-shortcut-icon,
.flag-sidebar-block .sidebar-unread-icon {
  position: relative;
  width: auto;
  height: auto;
  margin: 0;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid #e6e1d8;
  border-right-width: 0;
  border-radius: 16px 0 0 16px;
  background: #fff;
  color: #00335b;
  box-shadow: 0 10px 24px rgba(0, 51, 91, 0.14);
  cursor: pointer;
  z-index: 2;
}

.flag-sidebar-block .sidebar-bookmark-icon svg,
.flag-sidebar-block .sidebar-shortcut-icon svg,
.flag-sidebar-block .sidebar-unread-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  flex: 0 0 auto;
}

.flag-sidebar-block .sidebar-tab-label {
  writing-mode: vertical-rl;
  text-orientation: sideways;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.flag-sidebar-block .sidebar-block:hover .sidebar-bookmark-icon,
.flag-sidebar-block .sidebar-block:hover .sidebar-shortcut-icon,
.flag-sidebar-block .sidebar-block:hover .sidebar-unread-icon,
.flag-sidebar-block .sidebar-block.is-open .sidebar-bookmark-icon,
.flag-sidebar-block .sidebar-block.is-open .sidebar-shortcut-icon,
.flag-sidebar-block .sidebar-block.is-open .sidebar-unread-icon,
.flag-sidebar-block .sidebar-block.is-hover .sidebar-bookmark-icon,
.flag-sidebar-block .sidebar-block.is-hover .sidebar-shortcut-icon,
.flag-sidebar-block .sidebar-block.is-hover .sidebar-unread-icon,
.flag-sidebar-block .sidebar-bookmark-icon:focus-visible,
.flag-sidebar-block .sidebar-shortcut-icon:focus-visible,
.flag-sidebar-block .sidebar-unread-icon:focus-visible {
  background: #00335b;
  color: #fff;
  border-color: #00335b;
  outline: none;
}

.flag-sidebar-block .sidebar-unread-icon .unread-number {
  position: absolute;
  top: -6px;
  left: -6px;
  right: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #c30a32;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flag-sidebar-block .sidebar-bookmark-list,
.flag-sidebar-block .sidebar-shortcut-list,
.flag-sidebar-block .sidebar-unread-list {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  width: min(340px, calc(100vw - 96px));
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e6e1d8;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 51, 91, 0.16);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-50%) translateX(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.flag-sidebar-block .sidebar-block:hover .sidebar-bookmark-list,
.flag-sidebar-block .sidebar-block:hover .sidebar-shortcut-list,
.flag-sidebar-block .sidebar-block:hover .sidebar-unread-list,
.flag-sidebar-block .sidebar-block:focus-within .sidebar-bookmark-list,
.flag-sidebar-block .sidebar-block:focus-within .sidebar-shortcut-list,
.flag-sidebar-block .sidebar-block:focus-within .sidebar-unread-list,
.flag-sidebar-block .sidebar-block.is-open .sidebar-bookmark-list,
.flag-sidebar-block .sidebar-block.is-open .sidebar-shortcut-list,
.flag-sidebar-block .sidebar-block.is-open .sidebar-unread-list,
.flag-sidebar-block .sidebar-block.is-hover .sidebar-bookmark-list,
.flag-sidebar-block .sidebar-block.is-hover .sidebar-shortcut-list,
.flag-sidebar-block .sidebar-block.is-hover .sidebar-unread-list {
  max-height: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.flag-sidebar-block .headline {
  height: auto;
  margin: 0;
  padding: 16px 18px;
  background: #00335b;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.flag-sidebar-block .headline .unread-number {
  position: static;
  width: auto;
  height: auto;
  min-width: 0;
  margin: 0 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: inherit;
  font-weight: 700;
  line-height: inherit;
}

.flag-sidebar-block ul {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  max-height: min(360px, 60vh);
}

.flag-sidebar-block .bookmark-item-link,
.flag-sidebar-block .shortcut-item-link,
.flag-sidebar-block .unread-item-link,
.flag-sidebar-block .unread-read-all {
  display: block;
  margin: 0;
  padding: 12px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #00335b;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  text-decoration: none;
}

.flag-sidebar-block .unread-read-all {
  color: #c30a32;
  font-weight: 600;
  cursor: pointer;
}

.flag-sidebar-block .bookmark-item-link:hover,
.flag-sidebar-block .shortcut-item-link:hover,
.flag-sidebar-block .unread-item-link:hover,
.flag-sidebar-block .unread-read-all:hover,
.flag-sidebar-block .bookmark-item-link:focus-visible,
.flag-sidebar-block .shortcut-item-link:focus-visible,
.flag-sidebar-block .unread-item-link:focus-visible,
.flag-sidebar-block .unread-read-all:focus-visible {
  background: #f5f7f9;
  color: #00335b;
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
  outline: none;
}

.flag-sidebar-block .unread-read-all:hover,
.flag-sidebar-block .unread-read-all:focus-visible {
  color: #c30a32;
}

@media only screen and (max-width: 740px) {
  .flag-sidebar-block {
    right: 12px;
    gap: 8px;
  }

  .flag-sidebar-block .sidebar-bookmark-icon,
  .flag-sidebar-block .sidebar-shortcut-icon,
  .flag-sidebar-block .sidebar-unread-icon {
    width: auto;
    height: auto;
    padding: 12px 10px;
    border-right-width: 1px;
    border-radius: 14px;
  }

  .flag-sidebar-block .sidebar-tab-label {
    font-size: 12px;
  }
}

.flag-actions-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 24px);
  margin: 0;
  padding: 8px;
  background: #fff;
  border: 1px solid #e6e1d8;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(0, 51, 91, 0.14);
}

.flag-actions-bar .flag {
  margin: 0;
}

.flag-actions-bar .flag-bookmarks a,
.flag-actions-bar .flag-shortcut a,
.flag-actions-bar .flag-unread a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 14px !important;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #f5f7f9;
  box-shadow: none;
  color: #00335b;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.flag-actions-bar .flag-bookmarks a:before,
.flag-actions-bar .flag-shortcut a:before,
.flag-actions-bar .flag-unread a:before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  margin: 0;
  background-color: currentColor;
  font-family: inherit;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.flag-actions-bar .flag-bookmarks a:before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3.2l2.35 4.76 5.25.76-3.8 3.7.9 5.23L12 15.2l-4.7 2.45.9-5.23-3.8-3.7 5.25-.76L12 3.2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3.2l2.35 4.76 5.25.76-3.8 3.7.9 5.23L12 15.2l-4.7 2.45.9-5.23-3.8-3.7 5.25-.76L12 3.2z'/%3E%3C/svg%3E");
}

.flag-actions-bar .flag-shortcut a:before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M14 4h6v6h-2V7.4l-7.3 7.3-1.4-1.4L16.6 6H14V4zM6 6h6v2H8v8h8v-4h2v6H6V6z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M14 4h6v6h-2V7.4l-7.3 7.3-1.4-1.4L16.6 6H14V4zM6 6h6v2H8v8h8v-4h2v6H6V6z'/%3E%3C/svg%3E");
}

.flag-actions-bar .flag-unread a:before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3a6 6 0 00-6 6c0 4.2-1.4 5.5-1.4 5.5h14.8S18 13.2 18 9a6 6 0 00-6-6zm-2 15.2a2.2 2.2 0 004 0h-4z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3a6 6 0 00-6 6c0 4.2-1.4 5.5-1.4 5.5h14.8S18 13.2 18 9a6 6 0 00-6-6zm-2 15.2a2.2 2.2 0 004 0h-4z'/%3E%3C/svg%3E");
}

.flag-actions-bar .flag-bookmarks a:hover,
.flag-actions-bar .flag-shortcut a:hover,
.flag-actions-bar .flag-unread a:hover,
.flag-actions-bar .flag-bookmarks a:focus,
.flag-actions-bar .flag-shortcut a:focus,
.flag-actions-bar .flag-unread a:focus {
  background: #00335b;
  color: #fff;
}

.flag-actions-bar .action-unflag a {
  background: #00335b;
  color: #fff;
}

.flag-actions-bar .action-unflag a:hover,
.flag-actions-bar .action-unflag a:focus {
  background: #c30a32;
  color: #fff;
}

@media print {
  .flag-actions-bar {
    display: none;
  }
}
