/*****************************************************************************
  W I D G E T S
*****************************************************************************/
.pp-busy-animation {
    display: flex;
    gap: 0.2em;
    justify-content: flex-start;
    height: 0.5em;
}

.pp-busy-dot {
    width: 0.5em;
    height: 0.5em;
    border-radius: 50%;
    background-color: var(--colour-more-subdued-fg);
    opacity: 0;
    animation: fade 1s infinite;
}

.pp-busy-dot-0 {
    animation-delay: 0s;
}

.pp-busy-dot-1 {
    animation-delay: 0.3s;
}

.pp-busy-dot-2 {
    animation-delay: 0.7s;
}

@keyframes fade {
    0% { opacity: 0; }
    10% { opacity: 1; }
    60% { opacity: 0; }
    100% { opacity: 0; }
}

button.pp-button-empty {
    border: none;
    margin: 0;
    padding: 0;
    background-color: rgba(0, 0, 0, 0);
}

button.pp-button, button.pp-hero-button {
    border: 1px solid var(--colour-subdued-secondary-fg);
    color: var(--colour-primary-bg);
    background-color: var(--colour-subdued-secondary-fg);
    border-radius: var(--border-radius-s);
    display: inline-block;
    width: auto;
    font-family: 'Assistant', Tahoma, sans-serif;
    font-size: 1rem;
    font-weight: bold;
    padding: 0.3em 1em;
    transition: all 0.3s ease;
    cursor: pointer;
}

button.pp-hero-button {
    border: 2px solid var(--colour-grey-90);
    color: white;
    font-size: 1.2rem;
    opacity: 0.9;
}

button.pp-button:hover {
    background-color: var(--colour-secondary-fg);
}

button.pp-button:disabled {
    background-color: var(--colour-more-subdued-fg);
    border-color: var(--colour-more-subdued-fg);
    cursor: not-allowed;
}

button.pp-navigation {
    display: flex;
    align-items: center;
}

button.pp-navigation > div.pp-previous, button.pp-navigation > div.pp-next {
    background-color: var(--colour-primary-bg);
    background-repeat: no-repeat;
    background-size: cover;
    height: 1em;
    width: 1em;
    flex-shrink: 0;
    flex-grow: 0;
}

button.pp-navigation > div.pp-previous {
    -webkit-mask-image: url('/assets/icons/prev.svg');
    mask-image: url('/assets/icons/prev.svg');
    background-position: left center;
}

button.pp-navigation > div.pp-next {
    -webkit-mask-image: url('/assets/icons/next.svg');
    mask-image: url('/assets/icons/next.svg');
    background-position: right center;
}

button.pp-navigation > div.pp-button-label {
    flex: 1;
    text-wrap: balance;
}

button.pp-hero-button:hover {
    background-color: var(--colour-secondary-fg);
    opacity: 1;
    color: var(--colour-primary-bg);
}

button.pp-share {
    -webkit-mask-image: url('/assets/icons/share.svg');
    mask-image: url('/assets/icons/share.svg');
    background-color: var(--colour-subdued-secondary-fg);
    background-repeat: no-repeat;
    background-size: cover;
    transition: all 0.3s ease;
    height: 1em;
    width: 1em;
}

button.pp-share:hover {
    background-color: var(--colour-secondary-fg);
    cursor: pointer;
}

button.pp-scroll-down-btn {
    background-color: var(--colour-subdued-secondary-fg);
    border: 2px solid var(--colour-grey-90);
    border-radius: 50%;
    color: var(--colour-grey-90);
    display: none;
    font-family: 'Assistant', Tahoma, sans-serif;
    font-size: 3rem;
    font-weight: bold;
    width: 1.5em;
    height: 1.5em;
    transition: all 0.3s ease;
    cursor: pointer;
    opacity: 0.4;
    position: fixed;
    bottom: 1em;
    right: 1em;
    z-index: 1;
}

button.pp-scroll-down-btn:hover {
    background-color: var(--colour-secondary-fg);
    opacity: 1;
    color: var(--colour-primary-bg);
}

.pp-swatch {
    -webkit-mask-image: url('/assets/icons/swatch.svg');
    mask-image: url('/assets/icons/swatch.svg');
    background-color: var(--colour-subdued-secondary-fg);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

.pp-swatch:hover {
    cursor: pointer;
}

div.pp-swatch {
    aspect-ratio: 1 / 1;
    width: 100%;
}

@container pp-main-container (max-width: 500px) {
    div.pp-swatch {
        width: 50%;
        margin: 0 auto;
    }
}

.pp-swatch-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* we remove the margin (see below) but set line-height to make the text more loose */
    line-height: 1.4;
}

.pp-swatch-text p {
    /* need to remove margin so that the browser doesn't overflow the li.pp-block-list-item parent */
    margin: 0;
}

span.pp-swatch {
    height: 0.85em;
    width: 0.85em;
    display: inline-block;
    margin-left: 0.5em;
    margin-right: 3px;
}

ul.pp-tags, ul.pp-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    list-style: none;
    gap: 0.5em;
    font-family: 'Assistant', Tahoma, sans-serif;
    font-size: 0.85rem;
    color: var(--colour-primary-bg);
    margin: 0;
    padding: 0;
}

ul.pp-tags > li, ul.pp-categories > li {
    flex-shrink: 0;
    flex-grow: 0;
    border: 1px solid var(--colour-more-subdued-fg);
    background-color: var(--colour-more-subdued-fg);
    border-radius: var(--border-radius-s);
    padding: 0 0.5em 0 0.5em;
    transition: all 0.3s ease;
}

ul.pp-tags > li:hover, ul.pp-categories > li:hover {
    border: 1px solid var(--colour-subdued-fg);
    background-color: var(--colour-subdued-fg);
    cursor: pointer;
}

ul.pp-tags-post::before {
    content: "";
    flex-shrink: 1;
    flex-grow: 0;
    -webkit-mask-image: url('/assets/icons/tag.svg');
    mask-image: url('/assets/icons/tag.svg');
    background-color: var(--colour-subdued-secondary-fg);
    background-repeat: no-repeat;
    background-size: cover;
    height: 1.5em;
    width: 1.5em;
}

ul.pp-tags-post a, ul.pp-categories-post a {
    color: var(--colour-primary-bg);
}

ul.pp-tags-post a:hover, ul.pp-categories-post a:hover {
    color: var(--colour-primary-bg);
    text-decoration: none;
}

.pp-category-list-container {
    margin: 0 0.5em 1em 0.5em;
}

ul.pp-categories-post::before {
    content: "";
    flex-shrink: 1;
    flex-grow: 0;
    -webkit-mask-image: url('/assets/icons/categories.svg');
    mask-image: url('/assets/icons/categories.svg');
    mask-size: 1.5em 1.5em;
    background-color: var(--colour-subdued-secondary-fg);
    background-repeat: no-repeat;
    background-size: cover;
    height: 1.5em;
    width: 1.5em;
}


.pp-popup {
    position: fixed;
    z-index: 2;
    left: calc(50vw - 140px);
    top: calc(50vh - 2em);
    width: 280px;
    height: 5em;
    background-color: var(--colour-primary-bg);  /* solid colour fallback */
    background-color: var(--colour-primary-bg-opq);  /* slightly opaque */
    border-radius: var(--border-radius-m);
    border: 3px solid var(--colour-secondary-bg);
    font-family: 'Assistant', Tahoma, sans-serif;
    font-size: 1rem;
    padding: 0 0.5em;
    text-wrap: balance;
    display: flex;
    align-items: center;
    gap: 1em;
    justify-content: space-between;
    transition: all 0.6s ease;
}

.pp-popup-glyph {
    flex-grow: 0;
    flex-shrink: 0;
    height: 3em;
    width: 3em;
    background-color: var(--colour-subdued-secondary-fg);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

.pp-popup-message {
    flex: 1;
}

table.pp-barchart {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    text-align: center;
    margin: 1rem 0;
    padding: 0.5rem;
    max-width: 100%;
    height: 100px;
}

tr.pp-barchart-data {
    vertical-align: bottom;
}

td > .pp-barchart-bar {
    background-color: var(--colour-more-subdued-fg);
    margin: 0 auto;
    width: 80%;
    transition: all 0.3s ease;
}

tr.pp-barchart-data > td:hover {
    color: var(--colour-subdued-fg);
}

td > .pp-barchart-bar:hover {
    background-color: var(--colour-subdued-fg);
}

tr.pp-barchart-divider {
    background-color: var(--colour-more-subdued-fg);
    height: 2px;
}


tr.pp-barchart-label {
    vertical-align: top;
    height: 2em;
}

/* End of WIDGETS ***********************************************************/

