:root {
    --aw-base-font-size: 16px;
    --aw-primary-color: #113AAA;
    --aw-primary-color-hover: #113AAA;
    --aw-color-grey: lightgrey;
    --aw-color-img-hidden: #000;
    --aw-bg-img-hidden: lightgrey;
    --aw-button-gap: 16px;
    --aw-button-color: slategrey;

    --aw-radius: 10px;
    --aw-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    --aw-shadow-strong: 0 2px 14px #C7D9F8;
    --aw-font-family: Barlow, "Helvetica Neue", Helvetica, Arial, sans-serif;

    /* Mobile (default) */
    --aw-position-top-mobile: unset;
    --aw-position-bottom-mobile: 10px;
    --aw-position-left-mobile: 10px;
    --aw-position-right-mobile: 10px;

    /* Tablet */
    --aw-position-top-tablet: 10px;
    --aw-position-bottom-tablet: unset;
    --aw-position-left-tablet: 10px;
    --aw-position-right-tablet: 10px;

    /* Desktop */
    --aw-position-top-desktop: 10px;
    --aw-position-bottom-desktop: unset;
    --aw-position-left-desktop: 10px;
    --aw-position-right-desktop: 10px;

    --aw-position-top: var(--aw-position-top-mobile);
    --aw-position-bottom: var(--aw-position-bottom-mobile);
    --aw-position-left: var(--aw-position-left-mobile);
    --aw-position-right: var(--aw-position-right-mobile);

}

/* Tablet */
@media (min-width: 768px) {
    :root {
        --aw-position-top: var(--aw-position-top-tablet);
        --aw-position-bottom: var(--aw-position-bottom-tablet);
        --aw-position-left: var(--aw-position-left-tablet);
        --aw-position-right: var(--aw-position-right-tablet);
    }
}

/* Desktop */
@media (min-width: 1024px) {
    :root {
        --aw-position-top: var(--aw-position-top-desktop);
        --aw-position-bottom: var(--aw-position-bottom-desktop);
        --aw-position-left: var(--aw-position-left-desktop);
        --aw-position-right: var(--aw-position-right-desktop);
    }
}

.aw-button,
#pm-accessibility-widget,
#aw-chapter-menu {
    font-family: var(--aw-font-family) !important;
    font-size: var(--aw-base-font-size) !important;
    box-sizing: border-box !important;
}

#pm-accessibility-widget *,
#aw-chapter-menu * {
    box-sizing: border-box !important;
}

.aw-button {
    position: fixed;
    z-index: 9999;
    background: var(--aw-button-color);
    color: #fff;
    border: none;
    border-radius: var(--aw-radius);
    width: 50px;
    height: 50px;
    font-size: 1.6rem;
    cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
    .aw-button:hover {
        color: #fff;
    }
}

.aw-button:focus-visible {
    color: #fff;
}

.aw-button .tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: max-content;
    background-color: inherit;
    color: inherit;
    text-align: center;
    padding: 5px;
    border-radius: var(--aw-radius);
    position: absolute;
    z-index: 10;
    transition: opacity 0.2s;
    max-width: 200px;
    font-size: 0.8rem;
}


.aw-button:focus-visible .tooltip-text {
    visibility: visible;
    opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
    .aw-button:hover .tooltip-text {
        visibility: visible;
        opacity: 1;
    }
}


.aw-menu {
    position: fixed;
    z-index: 9999;
    background: white;
    border-radius: var(--aw-radius);
    display: none;
    width: 90vw;
    max-width: 350px;
    box-shadow: var(--aw-shadow);
    top: 10px;
    bottom: 10px;
    max-height: calc(100vh - 20px);
    overflow: hidden;
}

.aw-menu h2, .aw-menu .h2 {
    color: white;
    font-size: 1.7rem;
    line-height: 21px;
}

.aw-menu-header {
    width: 100%;
    height: fit-content;
    background-color: var(--aw-primary-color);
    display: flex;
    flex-direction: row;
    padding: 10px 10px;
    align-items: center;
    justify-content: space-between;
    column-gap: 10px;
}

.aw-menu-footer {
    width: 100%;
    height: fit-content;
    background-color: var(--aw-primary-color);
    display: block;
    padding: 10px;
    margin-top: auto;
    font-size: 1.5rem;
}

.aw-menu-footer a {
    color: white;
    font-size: 1.5rem;
}

.aw-menu-footer a:focus-visible {
    color: #fff;
    text-decoration: underline;
}


@media (hover: hover) and (pointer: fine) {
    .aw-menu-footer a:hover {
        color: #fff;
        text-decoration: underline;
    }
}

.aw-menu-main {
    height: 100%;
    background-color: var(--aw-color-grey);
    display: grid;
    grid-template-rows: 1fr auto;
    grid-template-columns: 1fr;
    overflow-y: auto;
}

#aw-close-menu, .aw-chapter-menu-head > #aw-close-navigation {
    border-radius: var(--aw-radius);;
    width: 25px;
    height: 25px;
    font-size: 1rem;
    text-align: center;
    pointer-events: all;
    cursor: pointer;
    border: 1px solid #fff;
}
#aw-close-menu{
    position: relative;
    flex: 0 0 25px;
}

#aw-close-menu svg{
    height: 25px;
    width: 25px;
    position: absolute;
    top: -1px;
    left: -1px;
}
.aw-chapter-menu-head > #aw-close-navigation {
    border: 1px solid var(--aw-primary-color);
    color: var(--aw-primary-color);
}

@media (hover: hover) and (pointer: fine) {
    #aw-close-menu:hover, .aw-chapter-menu-head > #aw-close-navigation:hover {
        color: #fff;
    }

    .aw-chapter-menu-head > #aw-close-navigation {
        background: var(--color-primary-hover);
    }
}

#aw-close-menu:focus-visible, .aw-chapter-menu-head > #aw-close-navigation:focus-visible {
    color: #fff;
}

.aw-menu-options {
    display: flex;
    align-items: start;
    width: 100%;
    height: fit-content;
    gap: 8px;
    cursor: pointer;
    padding: 10px;
    pointer-events: all;
}

.aw-menu-options.icon {
    width: 60px;
    height: 50px;
    fill: var(--primary-color);
}

.aw-menu-options.label {
    width: 100%;
    text-align: center;
    display: inline;
}

.aw-menu-options.radio-options {
    flex-direction: column;
    padding: 10px 20px;
    margin-bottom: 20px;
    row-gap: 15px;
    cursor: pointer;
}

.aw-radio-label {
    width: 100%;
    border-bottom: 1px solid var(--primary-color);
    padding-bottom: 10px;
}

.aw-radio-option {
    margin-right: 15px
}

#aw-widget-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--aw-button-gap);
    align-content: baseline;
    padding: 10px;
}

.aw-menu-group {
    list-style-type: none;
}

.aw-menu-group:not(:first-child) {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid oklch(0.9437 0.015 257.20);
}

.aw-menu-group-title {
    font-size: 1.8rem;
    line-height: 22px;
    text-align: center;
    padding-bottom: 6px;
}

.aw-menu button {
    display: block;
    width: 100%;
    padding: 6px;
    font-size: 1.3rem;
    cursor: pointer;
    border: 1px solid var(--aw-primary-color-hover);
    border-radius: var(--aw-radius);
    background-color: white;

    &:disabled {
        cursor: not-allowed;
    }
}

@media (hover: hover) and (pointer: fine) {
    .aw-menu button:hover:not(:disabled) {
        background-color: var(--aw-primary-color-hover);
        color: white;
    }
}

button.aw-action-button {
    width: calc(50% - (var(--aw-button-gap) / 2)) !important;
    min-height: 150px;
    box-shadow: var(--aw-shadow-strong);
    border: 0;
    border-radius: var(--aw-radius);
    font-size: 1.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    word-break: break-word;
    justify-content: center;
}

button.aw-action-button.active {
    background-color: var(--aw-primary-color-hover);
    color: #fff;
}

.aw-action-label {
    margin-top: 10px;
    line-height: 1.2;
    font-size: 0.9rem !important;
}

button.aw-action-button svg {
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    margin-bottom: 5px;
}

@media (hover: hover) and (pointer: fine) {
    button.aw-action-button.active:hover {
        background-color: var(--aw-primary-color-hover);
        color: white;
    }
}

button.aw-action-button.active svg path,
button.aw-action-button:focus-visible svg path,
button.aw-action-button.active svg rect,
button.aw-action-button:focus-visible svg rect {
    stroke: #fff;
}

@media (hover: hover) and (pointer: fine) {
    button.aw-action-button:hover svg path,
    button.aw-action-button:hover svg rect {
        stroke: #fff;
    }
}

.aw-ul-wrapper {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.aw-position-controls {
    display: flex;
    gap: var(--aw-button-gap);
    padding: 0 10px 10px 10px;
}

.aw-font-wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto;
    column-gap: 6px;
    row-gap: 0;

    grid-template-areas:
    "left right"
    "bottom bottom";
}

.aw-font-wrapper li:nth-child(1) {
    grid-area: left;
}


.aw-font-wrapperli:nth-child(2) {
    grid-area: right;
}


.aw-font-wrapper li:nth-child(3) {
    grid-area: bottom;
}

.aw-visible {
    display: grid !important;
    grid-template-rows: auto 1fr auto; /* header auto, content fills, footer auto */
    grid-template-columns: 1fr;
    grid-template-areas:
        "header"
        "content"
        "footer";
    height: 100vh; /* fill the screen so content can expand */
}

.aw-hidden {
    display: none !important;
}

.aw-opacity-hidden {
    opacity: 0;
    visibility: hidden;
}

.aw-chapter-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 9999;
    background: white;
    border: 1px solid oklch(0.9437 0.015 257.20);
    overflow-y: auto;
    height: 100%;
    min-width: 200px;
    max-width: 350px;
    font-size: 1.4rem;
    padding: 10px;

    box-shadow: var(--aw-shadow);
}


.aw-chapter-menu-position-top-left {
    right: 0;
    left: auto;
}

.aw-chapter-menu-position-top-right {
    left: 0;
    right: auto;
}

.aw-chapter-menu-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1.8rem;
    line-height: 21px;
    align-items: center;
}

@media (hover: hover) and (pointer: fine) {
    #aw-close-navigation, #aw-close-menu:hover {
        color: white;
        background-color: var(--aw-primary-color-hover);
    }

    #aw-close-navigation, #aw-close-menu:hover svg path {
        fill: white;
    }
}


#aw-reset-widget {
    box-shadow: var(--aw-shadow-strong);
    border: 0;
    font-size: 1.6rem;
    padding: 10px 6px;
}


@media (hover: hover) and (pointer: fine) {
    #aw-reset-widget:hover, #text-control-lg:hover, #text-control-sm:hover {

        background-color: var(--aw-primary-color-hover);
        color: white;

    }
}


.aw-chapter-link {
    text-decoration: none;
    color: #333;
    cursor: pointer;
    display: inline-block;
}

.aw-chapter-menu > ul {
    list-style-type: none;
    padding-left: 0;

    li:first-child {
        margin-top: 10px;
    }
}

.aw-chapter-menu li {
    margin-bottom: 5px;
    border-bottom: 1px solid var(--aw-primary-color-hover);
    padding-bottom: 5px;
}

.aw-chapter-submenu {
    list-style: none;
    padding-left: 15px;
    display: none;
}

.aw-chapter-submenu > .aw-chapter-sublink {
    a {
        text-decoration: none;
        color: #333;
    }
}

.aw-chapter-submenu li.aw-chapter-sublink:last-of-type {
    border-bottom: none;
}

.aw-chapter-toggle {
    margin-right: 2px;
    padding: 0 5px;
    cursor: pointer;
    font-size: 1.3rem;
    border: none;
    background-color: white;
}

.aw-hide-images img {
    opacity: 0 !important;
}

.aw-hide-images picture img {
    opacity: 0 !important;
}

.aw-hide-images > .aw-alt-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5rem;
    z-index: 10;
    font-size: 1em;
    pointer-events: none;
    background: var(--aw-bg-img-hidden);
    color: var(--aw-color-img-hidden);
    min-width: fit-content;
    width: 100%;
}

.aw-rotate {
    transform: rotate(90deg);
}

.aw-reading-focus {
    position: fixed;
    width: 100vw;
    height: 120px;
    left: 0;
    top: 0;
    pointer-events: none;
    z-index: 999999;
    border: 3px solid #2626A3;
    border-radius: var(--aw-radius);;
    background: transparent;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.42);
}

/* Positions */
.aw-position-top-left {
    top: var(--aw-position-top);
    bottom: var(--aw-position-bottom);
    left: var(--aw-position-left);
    right: unset;
}

.aw-position-top-right {
    top: var(--aw-position-top);
    bottom: var(--aw-position-bottom);
    right: var(--aw-position-right);
    left: unset;
}

/****************/
/*** Tooltip ****/
/****************/
.aw-tooltip-position-top-left {
    top: 105%;
    left: 0;
}

.aw-tooltip-position-top-right {
    top: 105%;
    right: 0;
}

.aw-tooltip-position-bottom-left {
    bottom: 105%;
    left: 0;
}

.aw-tooltip-position-bottom-right {
    bottom: 105%;
    right: 0;
}

.aw-tooltip-position-middle-left {
    bottom: 105%;
    left: 0;
}

.aw-tooltip-position-middle-right {
    bottom: 105%;
    right: 0;
}

/************/
/*** Menu ***/
/************/
.aw-menu-position-top-left {
    left: 0;
}

.aw-menu-position-top-right {
    right: 0;
}

.aw-menu-position-bottom-left {
    left: 0;
}

.aw-menu-position-bottom-right {
    right: 0;
}

.aw-menu-position-middle-left {
    left: 0;
}

.aw-menu-position-middle-right {
    right: 0;
}

/** Links */
.aw-highlight-links a {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px !important;
}

.aw-highlight-links a:focus,
.aw-highlight-links a:hover {
    outline: 3px solid currentColor !important;
    outline-offset: 3px !important;
}

/** eof */
