/* --Copyright (c) 2026 Robert A. Howell */

:root {
    font-size: 14px;
}

html {
    margin: 0;
}

*, *::before, *::after {
    box-sizing: border-box;
}

h1, h2, h3 {
    margin: 0;
    color: #333;
}

img {
    max-width: 100%;
    height: auto;
}

#domSearchOutput {
    display: none;
    position: absolute;
    width: 500px;
    overflow: hidden;
    background-color: steelblue;
    opacity: 0;
    z-index: 5;
    height: 0;
    left: calc(-250px + 50vw);
    top: 100px;
    scale: 1.25;
    min-height: 27em;
    max-height: 80dvh;
    transition: opacity 120ms ease-in-out;
    padding: .5rem 1rem;
    border-radius: 1rem;
    box-shadow: 5px 5px 115px black;

    & #SearchOutputContainer {
        overflow: scroll;
        overflow-x: hidden;
        height: 100%;
        scrollbar-width: thin;

        & div {
            padding-top: .5rem;
            
            & .finding-title-link {
                font-weight: bolder;
            }

            & .finding-title-link:hover, div[title]:hover {
                background-color: #468aaaaa;
                cursor: pointer;
            }

            & div[data-dialog-index]:not([data-dialog-index="-1"]) {
                padding: .1rem 1rem 1rem 2rem;
                border-bottom: 1px solid darkslategrey;
            }

            &:nth-last-child(1 of [data-dialog-index="-1"]) {
                border-bottom: 2px solid darkslategrey;
            }
        }

        & .outer-finding {
                padding: .25rem 1rem 1rem 1rem;
                border-bottom: 1px solid darkslategrey;
        }

        & div[data-dialog-index] + div[title][data-dialog-index] {
            padding: .5rem 2rem 1rem 2rem;
            border-bottom: 1px solid darkslategrey;
        }

        div[title][data-dialog-index]:hover {
            background-color: #468aaaaa;
            cursor: pointer;
        }
    
        & hr.middle-hr {
            width: 100%;
        }
    
        & hr {
            border-color: steelblue;
        }
    }
}

body {
    margin: 0;

    &:has(#domSearchOutput[style="opacity: 1; display: inline-block;"]) #main {
        opacity: .45;
    }

    &:has(#domSearchOutput[style="opacity: 1; display: inline-block;"]) main[role="main"] iframe {
        opacity: .25;
    }

    &#page-view {
        height: 100%;
        display: inline-block;
    }

    #main {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: stretch;
        align-content: stretch;

        & div.nav {
            position: relative;
            line-height: 1;
            width: min-content;

            & .nav-external {
                display: inherit;

                & #nav-external-links {
                    display: flex;
                    flex-direction: row;
                    flex-wrap: nowrap;
                    justify-content: flex-start;
                    align-items: stretch;
                    align-content: stretch;
                    height: 32px;
                    gap: 1rem;
                }

                & a {
                    & #GitHub-Invertocat {
                        border-radius: 100%;
                        height: 100%;
                        width: auto;
                    }

                    &#li-in-bug {
                        & svg {
                            height: 100%;
                            width: auto;
                        }

                        &:visited {
                            color: #0000ee;
                        }
                    }
                }
            }
        }

        & .page-view {
            width: calc(100dvw - 500px);
            height: auto;
            flex: 1 1 auto;
        }

        & main[role="main"] {
            display: inline-grid;
            height: calc(100dvh - 20px);
            width: calc(100dvw - 515px);
            flex: 1 1 auto;
            position: relative;
            color: transparent;

            & article {
                height: initial;
                width: clamp(400px, 100%, calc(100dvw - 255px));
                color: initial;

                &.tailored, .centered {
                    display: flex;
                    flex-direction: column;
                    justify-content: center;
                    align-items: center;
                    padding-inline: 4em;
                    margin: 2em auto;

                    @media (min-width: 1775px) {
                        flex-direction: row;
                        align-items: flex-start;

                        & img {
                            margin-top: 150px;
                        }
                    }
                }

                & img {
                    width: 450px;
                    border-radius: 8px;
                    box-shadow: 0 4px 8px black;
                }

                & .content {
                    display: flex !important;
                    flex-direction: column;
                    margin: 2em 5em !important;
                    box-shadow: 0 4px 8px black;
                    border-radius: 8px;
                    background: #fff;
                    text-align: left;
                    font-family: 'Segoe UI', Geneva, Verdana, sans-serif;
                    padding: 4em;
                    text-wrap: pretty;

                    & hgroup {
                        display: flex;
                        flex-direction: column;
                        justify-content: center;
                        align-items: center;
                        color: #0077cc;

                        & h1 {
                            color: #0077cc !important;
                        }
                    }
                }

                .toupper {
                    text-transform: uppercase;
                }

                & h2, h3, h4, h5 {
                    color: initial;
                }

                & h3 {
                    margin-top: 2rem;
                }

                & hgroup {
                    display: inline-block;
                }

                &#Status-Page {
                    table.subdomain {
                        border-collapse: collapse;
                    }

                    & .hidden-test-btn {
                        opacity: 0;
                        cursor: pointer;
                        margin-left: 0.5rem;
                    }

                    & .hide-domain-test-btn {
                        &:has(.hidden-test-btn:focus) .hidden-test-btn,
                        &:hover .hidden-test-btn {
                            opacity: 1;
                        }
                    }

                    & .hide-site-test-btn {
                        &:has(.open-hidden-btn:focus, .hidden-test-btn:focus) .hidden-test-btn,
                        &:hover .hidden-test-btn {
                            opacity: 1;
                        }
                    }

                    & .heading-height {
                        min-height: 2rem;
                    }

                    & .row-height {
                        height: 1.75rem;
                    }
                }
            }

            & div.content {
                display: none;
                margin: 0 0 2em 0;

                & table {
                    border-collapse: collapse;
                    width: 90%;
                    margin-top: 1rem;
                    margin-bottom: 1rem;
                    border: 1px solid #ccc;
                    border-radius: 8px;

                    & th, td {
                        padding: 8px;
                        text-align: left;
                        border-bottom: 1px solid #ccc;
                    }

                    & th {
                        background-color: #f2f2f2;
                    }
                }

                & ol.bullet-disc {
                    list-style-type: disc;
                    padding-inline: 1rem;
                }
            }

            & h2 {
                color: transparent;
            }

            & iframe {
                position: absolute;
            }

            & iframe.page-view {
                min-height: 100%;
                border: 0;
                outline: 0;
                display: block;
                transition: all 2s ease-in-out;
            }
        }

        & #menu-selection {
            width: 500px;
            position: relative;
            padding-block: .75em .5rem;
            border-bottom: 1px solid #ccc;
            box-shadow: -4px 4px 8px black;

            & h1 {
                font-size: 1.35em;
                margin-block: .75rem 1rem;
                text-align: center;
                display: inline-block;
            }

            & img {
                display: block;
            }

            & #Details-Panel-External {
                font-weight: bold;
                color: #257ea6;
                margin-right: .5rem;
            }

            & .page-frame-toggle {
                display: inline-block;
                cursor: pointer;
                margin-inline: 2rem;

                & .pill-toggle {
                    margin-inline: .5rem;
                    border: 1px solid black;
                    border-radius: .5rem;
                    background-color: antiquewhite;
                    display: flex;
                    width: 30px;
                    cursor: pointer;

                    & div {
                        display: inline-block;
                        width: 1rem;
                        aspect-ratio: 1;
                        background-color: green;
                        border-radius: 100%;
                        margin-inline: 1px;
                        transition: 400ms all ease-in-out;
                    }
                }

                & label {
                    cursor: pointer;
                }

                & input {
                    visibility: hidden;
                    display: none;
                }

                & #detailview {
                    display: none;
                }

                &:has(input:checked) {
                    & #frameview {
                        display: none;
                    }

                    & #detailview {
                        display: inline;
                    }

                    & #pill-display div {
                        transform: translateX(10px);
                    }
                }
            }

            & #Details-Panel-External.external::after {
                position: absolute;
                right: -4px;
                top: 0;
            }
        }

        & #domSearch {
            display: inline-block;
            position: relative;
            margin: 1em;

            & search {
                display: inline-block;
                border: 2px solid black;
                border-radius: 1rem;
                padding: 0 .5rem;

                &:has(button#searchSubmit:focus-visible, input#search:focus-visible) {
                    outline: 2px solid #2d95c5;
                }

                & input#search {
                    border: none;

                    &:focus-visible {
                        outline: none;
                    }
                }

                & #searchSubmit {
                    border: none;
                    background: inherit;
                    cursor: pointer;

                    &:focus-visible {
                        outline: none;
                    }
                }
            }
        }

        & #details-panel-toggle {
            padding: 10px;
            width: 5.5rem;
            background-color: lightseagreen;
            border: none;
            font-weight: bold;
            border-radius: 10px;
            box-shadow: 0 2px 2px 2px lightgray;
            margin-left: 1rem;
            cursor: pointer;

            &.disabled {
                background-color: lightgray;
            }

            &.greyed {
                opacity: .5;
            }

            &:not(.disabled):hover {
                background-color: cyan;
            }

            &.secondary {
                text-align: center;
                box-shadow: none;
            }
        }

        & aside[data-panel-index="0"] {
            width: 0;
            background-color: ghostwhite;
            opacity: .97;
            color: black;
            cursor: text;
            font-size: 1.4em;
            border: 2px solid black;
            height: calc(100vh - 20px);
            max-height: 100vh;
            overflow: auto;
            z-index: 2;
            visibility: hidden;
            transition: all 800ms ease-in;
            padding: 0 !important;
            border-right: 3px solid black;

            &.show-details {
                width: clamp(275px, 50vw, 500px);
                visibility: revert;

                &.unmatched {
                    border-color: darkorange;
                }
            }

            & ul, ol {
                padding: revert;
                margin-block: 1rem;
            }

            & p span {
                font-size: 16px;
                font-style: italic;
            }

            & ol li {
                list-style: decimal;
            }

            & ul li {
                list-style: circle;
            }

            & h4 {
                margin-bottom: .5rem;
            }

            & a {
                display: block;
            }

            & button {
                cursor: pointer;
            }

            & .mb0 {
                margin-block: 0;
            }

            & .mb1 {
                margin-block: 1rem;
            }

            & .mb2 {
                margin-block: 2rem;
            }

            & > *:not(h3) {
                text-align: left;
            }

            & .inline-link {
                color: inherit;
                display: initial;
            }
        }

        & #menu:not(.information-panel) {
            width: 500px;
            display: inline-block;
            overflow-y: scroll;
            overflow-x: clip;
            overflow-clip-margin: 0px;
            scrollbar-width: thin;
            height: calc(100vh - 214px);

            & h1 {
                margin: revert;
                font-size: 1.75em;
            }

            &.projects.no-menu-selection {
                height: calc(100vh - 57px);
            }

            & img {
                width: 45%;
                max-width: 140px;
            }

            & .page-view-link {
                height: 2em;
            }
        }

        &:has(.page-frame-toggle input:checked) main[role="main"] {
            & div.content {
                display: revert;

            }

            color: initial !important;

            & h2 {
                color: initial !important;
            }
        }

        &:has(.page-frame-toggle input:checked) main[role="main"] > iframe {
            transform: translateX(100%);
        }

        & .displaying:not(aside) {
            opacity: .5;
        }

        & ul:last-of-type li:last-of-type .information-panel {
            top: -275% !important;
        }

        & aside .page-view-detail.hidden-details {
            overflow: initial !important;
        }

        & .page-view-detail.hidden-details {
            display: inline-block !important; /* new selectors*/
            overflow: hidden;
            height: 0;
        }

        & .page-view-selection { /*correct inline position?*/
            width: 95%;
            max-width: 900px;
            margin: 0 auto;
            cursor: pointer;
            display: flex;
            flex-direction: row;

            & .page-view-selection-info {
                & div:first-child {
                    display: flex;
                    flex-direction: row;
                    justify-content: space-between;
                    align-items: center;
                    width: 100%;
                }

                & p {
                    margin: 3.5px 10.5px 3.5px 3.5px;
                }
            }

            & img {
                display: block;
                border-radius: 12px 12px 12px 12px;
            }

            & .details-panel-button {
                margin-top: 3.5px;
                margin-left: .5rem;
                padding: 5px;
                width: 5.5rem;
                background-color: lightseagreen;
                border: none;
                font-weight: bold;
                border-radius: 10px;
                box-shadow: 0 2px 2px 2px lightgray;
                cursor: pointer;

                &.slim {
                    width: revert;
                    background-color: lightgray;
                    text-decoration: none;
                    line-height: normal;
                    padding-bottom: 0;
                    color: darkslategrey;
                }

                &.disabled {
                    background-color: lightgray;
                }

                &.greyed {
                    opacity: .5;
                }

                &:not(.disabled):hover {
                    background-color: cyan;
                }

                &.secondary {
                    text-align: center;
                    box-shadow: none;
                }
            }

            & .page-view-selection-text {
                width: 100%;

                &:hover {
                    transition: all 2s ease-in;
                }

                & div.information-panel-toggle {
                    display: inline;
                }

                & .information-panel-toggle {
                    color: darkcyan;
                    position: relative;

                    & div {
                        display: inline-block;
                        width: fit-content;
                    }

                    & .information-panel {
                        position: absolute;
                        top: 100%;
                        left: -250px;
                        visibility: hidden;
                        color: black;
                        background-color: lightseagreen;
                        border: none;
                        border-radius: 12px 12px 12px 12px;
                        padding: 8px;
                        width: 385px;
                        cursor: text;
                    }

                    & svg:hover {
                        color: steelblue;
                    }
                }

                & .information-panel-toggle:hover .information-panel {
                    visibility: initial;
                    z-index: 5;
                }
            }

            & .page-view-link {
                font-weight: bold;
                font-size: 14px;
                width: 100%;
                background-color: #eee;
                text-decoration: underline;
                text-decoration-color: #0077cc;
                text-decoration-thickness: 2px;
                text-underline-offset: 2px;
                border-bottom: 1px solid #ccc;
                border-top: 1px solid #ccc;
                border-radius: 5px;
                cursor: pointer;
                padding-block: 7px;

                &:not([href]) {
                    border: 2px dotted gold;
                }

                &:hover {
                    background-color: #ddd;
                }
            }

        }
        & div.icon-tray {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: flex-start;
            position: relative;

            & > * {
                margin-inline: 4px;
            }

            & #alert-icon {
                fill: darkorange;

                & + span.alert-hover {
                    position: absolute;
                    top: 0;
                    left: 19px;
                    background-color: snow;
                    border: 1px dashed darkorange;
                    border-radius: 5px;
                    padding: 3px;
                    visibility: hidden;
                    font-size: 1rem;
                }

                &:hover + span.alert-hover {
                    visibility: initial;
                }

                &:hover {
                    cursor: pointer;
                }
            }
        }

        & a.app-internal-link.hyperlink {
            border: none;
            background: initial;
            color: #11557C;
            padding: 0;
            font-size: 1.2rem;
            display: block;
            font-family: serif;
            text-decoration-line: underline;
            text-decoration-style: dotted;

            &:hover {
                color: #2f4f4f;
            }
        }

        & a.app-internal-link {
            font-family: Arial, serif;

            &:active {
                background-color: lightcyan !important;
            }
        }

        & .page-view-detail {
            &[data-dialog-index] {
                display: inline; /* while in development */
            }

            padding-inline: 10px;

            &.external {
                position: relative;
            }
        }

        & a.external::after {
            content: "";
            display: inline-block;
            width: 12px;
            height: 12px;
            font-size: 0.8em;
            color: #0077cc;
            margin-bottom: 5px;
            background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="rgb(0, 119, 204)" class="bi bi-box-arrow-up-right" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5"/><path fill-rule="evenodd" d="M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0z"/></svg>');
            z-index: 1;

            &:hover {
                background-color: #ddd;
            }
        }

        & .page-view-link, .page-view-detail {
            text-align: center;
            display: inline-block;
        }

        & .copy-link {
            position: relative;
            background: none;
            border: none;
            cursor: copy;

            &.copied svg {
                background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard-fill" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M10 1.5a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5zm-5 0A1.5 1.5 0 0 1 6.5 0h3A1.5 1.5 0 0 1 11 1.5v1A1.5 1.5 0 0 1 9.5 4h-3A1.5 1.5 0 0 1 5 2.5zm-2 0h1v1A2.5 2.5 0 0 0 6.5 5h3A2.5 2.5 0 0 0 12 2.5v-1h1a2 2 0 0 1 2 2V14a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3.5a2 2 0 0 1 2-2"/></svg>');
            }

            &:hover svg {
                background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard-fill" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M10 1.5a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5zm-5 0A1.5 1.5 0 0 1 6.5 0h3A1.5 1.5 0 0 1 11 1.5v1A1.5 1.5 0 0 1 9.5 4h-3A1.5 1.5 0 0 1 5 2.5zm-2 0h1v1A2.5 2.5 0 0 0 6.5 5h3A2.5 2.5 0 0 0 12 2.5v-1h1a2 2 0 0 1 2 2V14a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3.5a2 2 0 0 1 2-2"/></svg>');
            }

            &:hover {
                background-color: #ddd;
            }
        }

        & .developer-attr {
            color: #2d95c5;
            margin-top: 0;
        }
    }


    ul, ol {
        padding: 0;
        list-style: none;
    }
}
