/* --Copyright (c) 2026 Robert A. Howell */

:root {

}

html {
    font-size: 14px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

h1, h2, h3 {
    margin: 0;
    color: #333;
}

img {
    max-width: 100%;
    height: auto;
}

body {
    margin: 0;

    &#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;
        }

        & > * {
            flex: 0 0 auto;
        }

        & .page-view {
            width: calc(100dvw - 500px);
            height: auto;
            flex: 1 1 auto;
        }

        & main[role="main"] {
            display: inline-grid;
            height: 100dvh;
            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;
                }
            }

            & 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;
                    }
                }
            }
            & 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: #2d95c5;
                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;
                    
                    & 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);
                    }
                }
            }

            & #domSearch {
                display: inline-block;
                position: relative;

                & 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;
                        }
                    }
                };
                
                & #domSearchOutput {
                    display: inline-block;
                    position: absolute;
                    width: 500px;
                    overflow: scroll;
                    background-color: steelblue;
                    opacity: 0;
                    z-index: 1;
                    height: 0;
                    max-height: 80dvh;
                    transition: opacity 120ms ease-in-out;

                    & div[data-dialog-index] {
                    padding: 0 1em;

                    &:hover {
                        background-color: #468aaaaa;
                        cursor: pointer;
                    }
                }
                }
            }
            
            & #Details-Panel-External.external::after {
                position: absolute;
                right: -4px;
                top: 0;
            }
        }

        & #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"] {
            position: absolute;
            top: 0;
            left: 100%;
            bottom: 25vh;
            width: clamp( 275px, 50vw, 800px);
            height: min-content;
            background-color: lightseagreen;
            opacity: .97;
            color: black;
            cursor: text;
            font-size: 1.2em;
            border-radius: 10px;
            border: 2px solid black;
            max-height: calc(100vh - 15px);
            overflow: auto;
            z-index: 2;

            & 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;
            }

        }

        & #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 - 173px);

            & h1 {
                margin: revert;
                font-size: 1.75em;
            }

            & li {
                /*padding-bottom: 1rem;*/
            }

            &.projects.no-menu-selection {
                height: calc(100vh - 57px);
            }

            & img {
                width: 45%;
            }

            & .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: dimgray;
                }

                &.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;
                }

                & .information-panel-toggle {
                    color: darkcyan;
                    position: relative;

                    & .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: 1.2em;
                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;
                }
            }

        }

        
        & button.app-internal-link {
            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;
            }
        }
        
        & .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;
    }
}

@media (min-width: 768px) {
    html {
        /*font-size: 16px;*/
    }
}
