created: 20210719234124096
modified: 20210719235343017
tags: $:/tags/Stylesheet
title: $:/sib/styles/footnote
type: text/vnd.tiddlywiki

/*
Based on https://kookma.github.io/TW-Refnotes/.
Copyright (c) 2019--2021 Mohammad Rahmani.
Copyright (c) 2021 Soren Bjornstad.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/*

/* Automatic counter for fnote macro. The counter resets at the begining of each tiddler. */
.tc-tiddler-frame {
  counter-reset: fnote-count;
}
.refnotes-footnote {
  counter-increment: fnote-count;
}
.refnotes-footnote:after {
  content: counter(fnote-count);
  font-size:small;
  vertical-align: super;
  line-height: 1.5;
  margin-left: 0em;
  color: yellow;
}


/* tooltip class used for ref, fnote and other macros */
.refnotes-tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer; 
}

.refnotes-tooltip .refnotes-tooltiptext{
    font-size: 0.90em; /* change if it is too small */
}

.refnotes-tooltip .refnotes-tooltiptext {
    visibility: hidden;
    background-color: #fff;
    color: #222222; 
    text-align: left;
    border-radius: 2px;
    padding: 5px 10px;
    max-width: 30vw;
    max-height:20em;
    overflow-y: auto;
    cursor: auto;
    width: max-content;
    width: -moz-max-content;
    width: -webkit-max-content;
    width: -o-max-content;

    /* Position the tooltip */
    position: absolute;
    z-index: 1;
    bottom: 100%;
    left: 50%;
    margin-left: -40px;
    box-shadow:0 4px 10px 0 rgba(0,0,0,0.2),0 4px 20px 0 rgba(0,0,0,0.19);
}

.refnotes-tooltip:hover .refnotes-tooltiptext {
    visibility: visible;
    /*opacity: 0.9;*/
}

/* for small screens */

@media screen and (max-width: 960px) {
.refnotes-tooltip .refnotes-tooltiptext {
    /* Position the tooltip */
  	position:fixed;
    top:0;
    left: 0;
    margin-left: 0px;
    bottom: unset;
    width:100%;
    max-width: 100vw;
    z-index: 9999;
}  

.refnotes-tooltip:hover .refnotes-tooltiptext {
   opacity: 1;
}  
  
}

/* Footnote class*/

.fnote-list{
/* color:blue;*/
 font-size:90%;
}

.fnote-pretty{
 display: block;
  margin: 0.5em;
  margin-right: auto;
  width: 100% !important;
  border-collapse: collapse;
  padding: 15px 15px 15px 25px; /*left padding=25px*/
  border-width:  0px;
  border-style: solid;
  border-left-width: 1px;
  background-color:  rgb(255,248,220);
  color: rgb(91,49,7);
  line-height: 1.2em; 
  font-size:0.9em;
}