﻿:root {
    --clr-yellow: #FFD435;
    --clr-product-border: black /*#C7D7DB*/;
    --clr-logo-darkblue: #240E39;
    --clr-logo-lightblue: #6189B3;
    --product-corner-radius: 5px;
    --clr-product-title-bk: #598AB7;
    --clr-product-descr-bk: #F7FBFF;
    --main-font: Arial;
}

*,
*::after,
*::before {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
    font: inherit;
}

body {
    text-rendering: optimizeSpeed;
    line-height: 1.5;
    font-family: var(--main-font);
    background-image: url('images/bk.jpg');
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
}

img, picture, svg {
    max-width: 100%;
    display: block;
}

.container {
    --max-width: 1110px;
    --padding: 1rem;
    width: min( var(--max-width), 100% - (var(--padding) * 2));
    margin-inline: auto;
}


header {
    position: sticky;
    top: 0;
    z-index: 999;
    display: flex;
    background-color: white;
    box-shadow: 0 -6px 10px 5px rgba(0,0,0,0.5);
}

header div.container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .container img {
    height: 100px;
}


.hamburger-menu {
    display: none;
}


/* Nav bar*/

nav ul li {
    font-family: monospace;
    list-style: none;
    margin: 0;
    padding-left: 0;
    display: inline;
    padding: .3rem .3rem;
    position: relative;
    text-decoration: none;
    transition-duration: 0.5s;
}

li a {
    color: black;
    text-decoration: none;
}

li a:hover {
    cursor: pointer;
    color: var(--clr-logo-lightblue);
}

nav ul li ul {
    background: white;
    visibility: hidden;
    opacity: 0;
    position: absolute;
    transition: all 0.5s ease;
    left: 0;
    display: none;
}

nav ul li:hover > ul, nav ul li > ul:hover {
    visibility: visible;
    opacity: 1;
    display: grid;
    grid-template-columns: 1fr;
    background-color: var(--clr-yellow);
    right: 0;
    left: unset;
    margin: 0;
    box-shadow: 0 0 4px 0 #3f69a8;
    /* PP - for long menus (especially on mobile devices. Prevent from going off screen, show scroll bar when needed */
    width: max-content;
    max-width: 90vw;
    overflow-y: auto;
    overflow-x: auto;
    max-height: 100vw;
    z-index: 13;
}

nav ul li ul a:hover {
    color: white;
}

nav ul li ul li {
    clear: both;
    width: 100%;
}

nav ul li ul#objects{
    grid-template-columns: 1fr 1fr;
}

/* End of Nav bar */
#main {
    display: grid;
    grid-template-columns: 3fr 1fr;
}

#products {
    background-color: rgba(255, 255, 255);
    padding: 20px 20px;
    border-left: 1px solid black;
    border-right: 1px solid black;
    font-size: 14px;
}

#whatsnew {
    display: grid;
    padding: 20px 20px;
    border-right: 1px solid black;
    background-color: var(--clr-logo-lightblue);
    background-image: url('images/pentamino1946.webp');
    background-size: 800px;
    grid-gap: 20px;
    grid-auto-rows: min-content min-content min-content min-content;
    grid-template-areas:
        "header"
        "whatsnew1"
        "whatsnew2"
        "whatsnew3"
}

/* What's New Box*/
.whatsnew-box {
    display: grid;
    grid-auto-rows: auto 1fr;
}

.whatsnew-title {
    background-color: var(--clr-product-title-bk);
    border-top-left-radius: var(--product-corner-radius);
    border-top-right-radius: var(--product-corner-radius);
    border-bottom: 1px solid white;
    font-weight: 600;
    font-size: 14px;
    text-align: left;
    padding: 0 12px;
    text-shadow: 1px 1px 2px black;
}

.whatsnew-descr {
    background-color: var(--clr-logo-lightblue);
    border-bottom-left-radius: var(--product-corner-radius);
    border-bottom-right-radius: var(--product-corner-radius);
    color: white;
    line-height: 1.2;
    font-size: 12px;
    padding: 8px 12px;
    display: grid; /* this and following lines are to center text inside the box vertically */
    align-items: start;
}

div.whatsnew-box a:hover div.whatsnew-title {
    background-color: var(--clr-yellow);
    transition: background-color 0.3s;
}

.date {
    color: black;
    font-family: 'Courier New';
    font-weight: bold;
    background-color: var(--clr-yellow);
    padding: 0 5px;
    text-shadow: none;
    border: 1px solid black;
}

.newsheader {
    color: white;
}

.title1 {
    grid-area: header;
    background-color: var(--clr-logo-lightblue);
    color: var(--clr-yellow);
    text-align: center;
    font-weight: bold;
    font-size: 1.3rem;
    border-radius: var(--product-corner-radius);
    text-shadow: 1px 1px 2px black;
}

h2 {
    font-weight: bold;
    font-size: 18px;
    margin: 10px 0 10px 0;
    padding: 0 10px;
    color: white;
    display: inline-block;
    text-shadow: 1px 1px 2px black;
    background-color: var(--clr-logo-lightblue);
    border-radius: var(--product-corner-radius);
}

#products .paragraph, #products ul {
    padding: 0 20px 0 20px;
}

.paragraph p 
{
    padding: 5px 0 5px 0;
}

/* Contact Page */
.contact-table {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
    grid-gap: 20px;
    align-items: center;
    padding: 20px 0 0 0;
}

.contact-left img {
    width: 3rem;
}

.contact-right a {
    text-decoration: none;
    color: inherit;
}


.footer {
    display: grid;
    background-color: black;
    font-size: 14px;
    color: white;
    border-left: 1px solid black;
    border-right: 1px solid black;
    border-bottom: 1px solid black;
    padding: 5px 0 0 0;
}

.footer div {
    align-items: center;
    text-align: center;
}

.footer img {
    width: 220px;
    display: inline;
}

.footer a:hover img {
    box-shadow: 0 0 6px 0 lightgray;
    border-color: #3f69a8;
    outline: none;
    transition: all .3s;
}

/* Download and Buy Page */
.download-table {
    display: grid;
    grid-template-columns: 2fr 5fr;
    padding-left: 30px;
}

.download-table div:nth-child(odd) {
    font-weight: bold;
}

.purchase-table {
    display: grid;
    grid-template-columns: 2fr 1fr 3fr 1fr;
    padding-left: 30px;
    grid-gap: 20px;
}

.purchase-table  button {
    padding: 0 5px 0 5px;
}

.purchase-table .delim {
    grid-column-start: 1;
    grid-column-end: 8;
    border-top: 1px solid gray;
}

.purchase-table .purch {
    text-align: center;
}

#cc {
    padding: 10px 0 10px 30px;
}

#cc img {
    display: inline;
    width: 100px;
    padding-right: 10px;
}

.lic {
    font-weight: bold;
}

.lic div:last-child {
    font-size: 10px;
    padding-top: 5px;
}


.download-table div#requestkey-text {
    grid-column-start: 1;
    grid-column-end: 3;
    xpadding-bottom: 5px;
    font-weight: normal;
}

.download-table input#TheButton {
    font-weight: normal;
    padding: 2px 5px 2px 5px;
}
/* Code Samples (features.html) page */
.codesamples label {
    cursor: pointer;
    display: block;
    padding-left: 20px;
}

.codesamples input {
    appearance: none;
    display: none;
}

.code {
    font-family: Courier New, Courier, monospace;
    font-weight: bold;
    border: 1px solid black;
    border-radius: var(--product-corner-radius);
    padding: 10px;
    margin-left: 20px;
    background-color: rgb(255, 255, 0, 0.4);
}
.codesamples input:checked ~ .code {
    display: inline-block;
}

.codesamples input ~ .code {
    display: none;
}

.codesamples label .code-title:hover {
    color: var(--clr-logo-lightblue);
}

.code-title {
    display: block;
}

/* FAQ page */
span.error {
    color: red;
    font-family: Courier New, Courier, monospace;
}
.faq {
    display: grid;
    grid-template-columns: auto 1fr;
    padding: 20px;
    grid-row-gap: 10px;
}

.faq div:nth-child(2n+1) {
    display: grid;
    background-color: var(--clr-logo-darkblue);
    color: white;
    font-size: 30px;
    padding: 10px;
    justify-items: center;
    align-items: center;
}

.faq div:nth-child(4n+4) {
background-color: white;
padding: 10px;
}

.faq div:nth-child(4n+2) {
    background-color: lightgray;
    padding: 10px;
}

.faq blockquote {
    padding: 20px;
    font-family: Courier New, Courier, monospace;
}

/* Object Diagram */
.objectdiagram a {
    text-decoration: none;
    font-weight: bold;
    color: black;
}

.objectdiagram a:hover {
    color: var(--clr-logo-lightblue);
}



/* Call for Action button on the front page */
.callforaction {
    text-align: center;
}

.callforaction button {
    margin: 10px 0 0 0;
    padding: 3px 7px;
    border-radius: var(--product-corner-radius);
    border: 1px solid gray;
    cursor: pointer;
    background: var(--clr-yellow);
    color: black;
}

.callforaction button a {
    text-decoration: none;
    font-weight: bold;
    color: var(--clr-logo-darkblue);
    text-transform: uppercase;
}

.callforaction button:hover {
    text-decoration: none;
    color: gray;
    background-color: #F5F0e1;
    transition: background-color 0.3s;
}

/* search box on the index.html */
.search-this-site {
    text-align: center;
    padding: 15px 0 15px 0;
    background-color: var(--clr-logo-lightblue);
    border: 1px solid black;
}

.sidebar {
    display: grid;
    padding: 20px 20px;
    border-right: 1px solid black;
    background-image: url('images/pentamino1946.webp');
    background-size: 800px;
    grid-gap: 20px;
    grid-auto-rows: auto 1fr;
}

/* search box on other pages in a sidebar */
.sidebar .search-this-site {
    border-width: 0;
    border-radius: var(--product-corner-radius);
    border: 1px solid black;
}

input.search-box {
    width: 90%;
    max-width: 100%;
    height: 30px;
    border-radius: 15px;
    padding: 0 30px 0 30px;
    border: 1px solid black;
    background-image: url("images/Magnifying_glass_icon.svg");
    background-size: 20px;
    background-repeat: no-repeat;
    background-position-x: 5px;
    background-position-y: 5px;
    font-size: 14px;
}

input.search-box:hover, input.search-box:focus {
    box-shadow: 0 0 5px 0 #3f69a8;
    border-color: lightgray;
    outline: none;
    transition: all .3s;
}



/* Search Page */
.search-form {
    text-align: center;
    padding: 20px;
}

.search-results {
    width: 90%;
    max-width: 100%;
    margin: 10px 0 10px 0;
    text-align: left;
    display: inline-block;
}

.search-item {
    margin: 10px 0 0 0;
}

.search-title {
    font-weight: bold;
}

.search-fileinfo {
    font-size: 10px;
    font-style: italic;
}



    @media screen and (max-width: 900px) {
        #main {
        display: grid;
        grid-template-columns: 1fr;
    }


    #whatsnew {
        display: grid;
        padding: 20px 20px;
        border-top: 1px solid black;
        border-left: 1px solid black;
        grid-gap: 20px;
        grid-template-areas:
            "header header header"
            "whatsnew1 whatsnew2 whatsnew3"
    }

    .sidebar {
        grid-template-areas: "header";
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        border-top: 1px solid black;
        border-left: 1px solid black;
        border-right: 1px solid black;
    }
}

@media screen and (max-width: 500px) {
    /* Make menu vertical and hide it to the right of the screen */
    header ul li {
        display: block;
    }

    #whatsnew {
        display: grid;
        padding: 20px 20px;
        grid-gap: 20px;
        grid-template-columns: 1fr;
        grid-template-rows: unset;
        grid-auto-rows: unset;
        grid-template-areas:
            "header";
    }

    /* Hamburger parameters */
    :root {
        --bar-width: 45px;
        --bar-height: 6px;
        --hamburger-gap: 4px;
        --clr-foreground: var(--clr-logo-darkblue);
        --hamburger-margin: 8px;
        --animation-timing: 200ms ease-in-out;
        --hamburger-height: calc(var(--bar-height) * 3 + var(--hamburger-gap) * 2);
    }

    nav {
        background-color: var(--clr-logo-darkblue);
        display: block;
        position: fixed;
        height: 100vh;
        left: 100%;
        top: 0;
        width: 220px;
        padding-top: 5rem;
        padding-left: 18px;
        padding-right: 18px;
        transition: transform .5s ease-in-out;
        transform: translateX(0px);
    }

    nav > ul > li {
        font-size: 1.0rem;
        border-top: 1px solid white;
    }

    nav > ul > li:last-child {
        border-bottom: 1px solid white;
    }

    nav ul li a {
        color: white;
    }

    nav ul li ul li a {
        color: var(--clr-logo-darkblue);
    }

    nav ul li ul li a:hover {
        color: white;
    }

    ul li a:hover {
        color: var(--clr-yellow);
        text-shadow: none;
    }

    /* from here down -- Hamburger menu */
    .hamburger-menu {
        display: block;
    }

    .hamburger-menu {
        --x-width: calc(var(--hamburger-height) * 1.4142); /* tan 45 */
        display: flex;
        flex-direction: column;
        gap: var(--hamburger-gap);
        width: max-content;
        top: var(--hamburger-margin);
        left: var(--hamburger-margin);
        z-index: 3;
        cursor: pointer;
        transform: translateX(0px);
    }

    .hamburger-menu:has(input:checked) {
        --clr-foreground: white;
        --clr-background: #333;
    }

    .hamburger-menu::before,
    .hamburger-menu input,
    .hamburger-menu::after {
        content: "";
        width: var(--bar-width);
        height: var(--bar-height);
        background-color: var(--clr-foreground);
        border-radius: 9999px;
        transform-origin: left center;
        transition: opacity var(--animation-timing), width var(--animation-timing), rotate var(--animation-timing), translate var(--animation-timing), background-color var(--animation-timing);
    }

    .hamburger-menu input {
        appearance: none;
        padding: 0;
        margin: 0;
        outline: none;
        pointer-events: none;
    }

    .hamburger-menu:has(input:checked)::before {
        rotate: 45deg;
        width: var(--x-width);
        translate: 0 calc( var(--bar-height) / -2);
    }

    .hamburger-menu:has(input:checked)::after {
        rotate: -45deg;
        width: var(--x-width);
        translate: 0 calc( var(--bar-height) / 2);
    }

    .hamburger-menu input:checked {
        opacity: 0;
        width: 0;
    }

    .hamburger-menu:has(input:checked) ~ nav {
        transform: translateX(-220px);
    }

    /* This is to prevent small logo movements during hamburger animation */
    #logo {
        width: 70vw;
    }

    .purchase-table, .download-table, #cc {
        grid-template-columns: 1fr;
        padding-left: unset;
    }

        .download-table div#requestkey-text {
            grid-column-start: unset;
            grid-column-end: unset;
        }

    .purchase-table .delim {
        grid-column-end: 1;
    }

    #products .paragraph {
        padding: 0;
    }

}
