/* Styles for the shared partials added in the port. */

.action-button {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

.mini-molt-action.like.liked,
.mini-molt-action.like.liked .mini-molt-action-counter {
  color: var(--like);
  fill: var(--like);
}

/* Notifications */
.kb-nav-notifications {
  position: relative;
}

.kb-badge {
  position: absolute;
  top: 2px;
  left: 30px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.kb-notification-icon {
  width: 43px;
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
}

.kb-notification-like { fill: var(--like); }
.kb-notification-remolt { fill: var(--remolt); }
.kb-notification-reply { fill: var(--reply); }
.kb-notification-quote { fill: var(--remolt); }
.kb-notification-mention { fill: var(--primary); }
.kb-notification-follow { color: var(--primary); }

.kb-notification-snippet:hover {
  text-decoration: none;
  color: var(--light) !important;
}

/* The "…" menu on a molt. */
.mini-molt-credentials {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.trophy .mini-molt-credentials {
  display: block;
}

.kb-menu {
  position: relative;
}

.kb-menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  padding: 2px 6px;
  fill: var(--light-faded, #8899a6);
}

.kb-menu > summary::-webkit-details-marker {
  display: none;
}

.kb-menu-items {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 1050;
  min-width: 190px;
  padding: 4px 0;
  background: var(--dark-less, #15181c);
  border: 1px solid #2f3336;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.kb-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--light);
  fill: var(--light);
  text-align: left;
  font-size: 0.9rem;
}

.kb-menu-item:hover {
  background: var(--primary-faded);
  color: var(--light);
  text-decoration: none;
}

/* Crabmin. */
.kb-notification-warning { color: #f4a261; }

.kb-role {
  color: var(--primary);
  font-weight: 600;
  text-transform: capitalize;
}

.kb-crabmin-fields {
  display: grid;
  grid-template-columns: 7rem 1fr;
  row-gap: 4px;
}

.kb-crabmin-fields dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* The remolt button opens Crabber's Remolt / Quote Molt dropdown. */
.kb-remolt-menu > summary {
  display: block;
  padding: 10px;
  fill: var(--light-faded);
}

.kb-remolt-menu > summary.active-remolt,
.kb-remolt-menu > summary.active-remolt .mini-molt-action-counter {
  color: var(--remolt);
  fill: var(--remolt);
}

.kb-remolt-menu .kb-menu-items {
  left: 0;
  right: auto;
  min-width: 160px;
}

.kb-avatar-sm {
  width: 20px;
  height: 20px;
}

.kb-menu-danger,
.kb-menu-danger:hover {
  color: var(--primary);
  fill: var(--primary);
}

/* The nav items are links, not the buttons style.css was written for. */
#nav-panel .nav-link-btn {
  display: block;
  width: fit-content;
  background: none;
  border: none;
  color: var(--light);
}

#nav-panel .nav-link-btn:hover {
  background: var(--primary-faded);
  text-decoration: none;
}

#nav-panel .nav-link-btn#nav-active,
#nav-panel .nav-link-btn#nav-active strong {
  color: var(--primary);
}

#nav-panel .nav-link-btn#nav-active .btn-icon {
  fill: var(--primary);
}

/* The muted group under the Molt button (Crabmin, Settings, Log out). */
#nav-panel .extra-navs {
  display: block;
  width: fit-content;
  background: none;
  border: none;
  text-align: left;
  white-space: nowrap;
}

#nav-panel .extra-navs:hover {
  background: var(--primary-faded);
  text-decoration: none;
}

#nav-panel .extra-navs:not(#nav-active) strong {
  color: var(--light-faded);
}

#nav-panel .extra-navs:not(#nav-active) .btn-icon {
  fill: var(--light-faded);
}

#nav-panel .extra-navs#nav-active strong {
  color: var(--primary);
}

.molt-text,
.molt-text:hover {
  text-decoration: none;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.mini-molt-timestamp time,
.mini-molt-timestamp:hover {
  text-decoration: none;
}

.kb-avatar {
  width: 43px;
  height: 43px;
  border-radius: 50%;
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
}

.kb-avatar-lg {
  width: 96px;
  height: 96px;
  margin-top: -48px;
  border: 4px solid #0e1014;
  position: relative;
  z-index: 1;
}

.kb-profile-header {
  position: relative;
}

.kb-settings .kb-avatar-lg {
  margin-top: -36px;
  border-width: 2px;
}

.kb-settings-banner {
  height: 0;
  padding-top: 28%;
  overflow: hidden;
  position: relative;
  z-index: 0;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #12355b;
}

.kb-settings-banner img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kb-nav-avatar {
  width: 28px;
  height: 28px;
  object-fit: cover;
  background: #000;
}

.kb-avatar-link:hover {
  text-decoration: none;
}

.kb-bio {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.kb-profile-meta svg {
    fill: currentColor;
    vertical-align: -2px;
}

.kb-profile-meta a {
    color: var(--primary);
    overflow-wrap: anywhere;
}

.kb-settings label {
    font-weight: 600;
}

.kb-profile-banner {
  height: 0;
  padding-top: 33.333%;
  overflow: hidden;
  position: relative;
  z-index: 0;
  background: #1b4b7a;
  border-bottom: 1px solid #2f3336;
}

.kb-profile-banner img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kb-nsfw {
  border: 1px solid var(--nsfw-faded-less, #2f3336);
  background: var(--nsfw-faded, rgba(230, 57, 70, 0.08));
  border-radius: 8px;
  padding: 8px 12px;
}

.kb-nsfw-summary {
  cursor: pointer;
  list-style: none;
  color: var(--light-faded, #8899a6);
}

.kb-nsfw-summary::-webkit-details-marker {
  display: none;
}

.kb-nsfw[open] .kb-nsfw-summary {
  display: none;
}

.kb-nsfw[open] > p {
  margin-top: 0 !important;
}

.molt-nsfw-toggle .custom-control-label {
  cursor: pointer;
}

.kb-youtube {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border-dark-less, #2f3336);
  background: #000;
  overflow: hidden;
}

.kb-youtube-play {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--light);
}

.kb-youtube-play:hover {
  text-decoration: none;
  color: var(--light);
  background: var(--dark-lesser, #16181c);
}

.kb-youtube-play svg {
  fill: var(--primary);
}

.kb-youtube-label {
  font-weight: 600;
}

.kb-youtube iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Crabber's card is sized around an image; Krabber's cards are text only. */
.link-card {
  height: auto;
  color: var(--light);
}

.link-card:hover {
  text-decoration: none;
  color: var(--light);
}

.link-card .card-content {
  padding: 0.6rem 0.9rem;
  gap: 2px;
  min-width: 0;
}

.link-card .card-title,
.link-card .card-address {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-card .card-description {
  -webkit-mask-image: none;
  mask-image: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.9em;
}

.link-card .card-address {
  font-size: 0.85em;
}

.link-card .card-address svg {
  fill: currentColor;
  vertical-align: -2px;
}

.kb-full-bio > summary {
  list-style: none;
  cursor: pointer;
  color: var(--light);
}

.kb-full-bio > summary::-webkit-details-marker {
  display: none;
}

.kb-full-bio-chevron {
  fill: currentColor;
  vertical-align: -5px;
  transition: transform 0.15s;
}

.kb-full-bio[open] .kb-full-bio-chevron {
  transform: rotate(90deg);
}

.kb-fun-facts th {
  padding: 2px 16px 2px 0;
  white-space: nowrap;
  vertical-align: top;
  color: var(--light-faded, #8899a6);
  font-weight: 600;
}

.kb-fun-facts td {
  padding: 2px 0;
  overflow-wrap: anywhere;
}

.kb-fun-label {
  min-width: 9.5rem;
}

.kb-profile-stats a:hover {
  text-decoration: none;
}

.kb-crab-toolbar .kb-filter {
  background: #16181c;
  border-color: #2f3336;
  color: #fff;
}

.kb-crab-toolbar .kb-filter:focus {
  background: #16181c;
  border-color: var(--primary);
  color: #fff;
  box-shadow: none;
}

.crab-row:hover {
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
}

.follow-btn {
  min-width: 96px;
}

.follow-btn.following:hover {
  background: var(--primary-dark);
  border-color: var(--primary-darker);
}

.nav-link-btn {
  text-align: left;
  white-space: nowrap;
}

.flash {
  margin-bottom: 0;
}

#add-panel .crab-row {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

#add-panel .panel {
  padding-left: 0;
  padding-right: 0;
}

#add-panel .panel-title {
  padding-left: 1rem;
  padding-right: 1rem;
}

.kb-legal h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 1.5rem;
}

.kb-legal ul {
  padding-left: 1.25rem;
}

.kb-error {
  max-width: 36rem;
}

.kb-replying-to {
  margin-top: -0.1rem;
  margin-bottom: 0.25rem;
}

.kb-tab {
  color: var(--gray, #8899a6);
  font-weight: 700;
  border-bottom: 3px solid transparent;
}

.kb-tab:hover {
  color: var(--light, #f8f9fa);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
}

.kb-tab.active {
  color: var(--light, #f8f9fa);
  border-bottom-color: var(--primary);
}

/* Modals are native <dialog>s dressed as Crabber's Bootstrap modals. */
.kb-modal {
  width: calc(100% - 1rem);
  max-width: 600px;
  margin: 1.75rem auto auto;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  overflow: visible;
}

.kb-modal::backdrop {
  background: linear-gradient(#cfe6ff21, #cfe6ff21), rgba(0, 0, 0, 0.5);
}

.kb-modal .close {
  margin: -1rem auto -1rem -1rem;
  opacity: 1;
}

.kb-modal .close span {
  text-shadow: none;
}

.kb-modal textarea {
  background: none;
  color: inherit;
  border: none;
  resize: none;
}

/* On the three-column pages the page itself does not grow with the feed.
   The middle column is a fixed-height flex box and #content-body is the
   scroll box, as in Crabber. Other pages (welcome, login, signup) scroll
   normally. */
body.kb-shell,
.master-container {
  overflow: hidden;
  height: 100vh;
}

#main-panel {
  height: 100vh;
  max-height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#content-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--dark-lesserest) var(--dark-less);
}

#content-body::-webkit-scrollbar {
  width: 7px;
  background-color: var(--dark-lesserest);
}

#content-body::-webkit-scrollbar-track {
  background-color: var(--dark-less);
}

#content-body::-webkit-scrollbar-thumb {
  background-color: var(--dark-lesserest);
}

.kb-new-molts-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.kb-new-molts-link:hover {
  color: inherit;
  text-decoration: none;
}

#content-body > #content-heading {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: var(--dark);
}
