:root{
    --text:#0b0b0b;
    --muted:#555;
    --border:#ddd;
    --panel:#fafafa;
}

* {
    box-sizing:border-box;
}

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

main {
    margin: 20px;
    flex: 1;
}

/* TYPOGRAPHY */

h1 {
    text-align: center;
    font-family: Agreloyc Almond, fantasy;
    font-size: 100px;
}

h2 {
    text-align: center;
    font-size: calc(25px + 0.390625vw);
    padding: 50px 0px 50px 0px;
}

h3 {
    text-align: left;
    font-size: calc(20px + 0.390625vw);
}

.center {
    text-align: center;
}

@font-face { /*  Royalty free commercial use font attribution  */
    font-family: 'Agreloyc Almond';
    src: url('fonts/Agreloyc-Almond.ttf');
    font-style: normal;
}

/* COLUMNS */

.columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3em;
    width: 80vw;
    margin: 0 auto;
}

.leftcol {
    text-align: right;
    font-weight: bold;
    justify-items: start;
}

.rightcol {
    text-align: left;
    justify-items: start;
}

.rightcol img {
    display: block;
    margin: 0;
}

/* VIDEO */

iframe {
    aspect-ratio: 16 / 9;
    max-width: 100%;
    height: 15svh;
    width: auto;
    border: 0;
}

iframe.large {
  height: 25svh;
}

/* IMAGES */

img {
    max-width: calc(100% - 160px); /* 80px padding on each side equivalent */
    display: block;
    margin: 0 auto;
    border-radius: 25px;
    box-shadow: 0 10px 28px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.10);
    margin-bottom: 100px;
}

/* NAVIGATION STYLES */

nav {
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    color: #ffffff;
}

nav > div {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    gap: 50px;
}

nav h3 {
    font-size: 18px;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    position: relative;
}

nav ul {
    list-style: none;
    margin-left: -40px;
    background-color: #000000;
    border-radius: 5px;
    padding: 10px;
    min-width: 200px;
    position: relative;
    transition: all 0.3s ease;
}

nav li {
    position: relative;
    display: block;
}

nav li ul {
    position: absolute;
    top: -100%; /* Aligns the submenu to the top of the parent */
    left: 100%; /* Aligns the submenu to the right of the parent */
    width: 150px;
    display: none;
    padding-left: 20px;
    background-color: #000000;
    border: 1px solid #ccc;
    z-index: 1000;
}

nav li:hover ul {
    display: block;
    width: max-content;
    min-width: 0;
}

/* LINKS */

a, a:visited {
    text-decoration: none;
    color: #e49605;
    font-weight: 600;
    padding: 0px 20px;
    margin: 0px -20px;
}

a:hover {
    text-shadow: 1px 1px 2px #000000;
    font-weight: 1000;
}

a:active {
    text-decoration: none;
    font-weight: 1000;
    text-shadow: 1px 1px 2px #000000;
}

/* HEADER */

header {
    padding: 1rem 0;
    text-align: center;
    color: #000000;
    border-top: 5px solid #000000;
    border-bottom: 5px solid #000000;
    font-size: 50px;
    background-color: #e49605;
    margin: -8px -10px 50px -10px;
    font-family: fantasy;
}

/* FOOTER */

footer {
    padding: 1rem;
    text-align: center;
    color: #424242;
    border-top: 5px solid #000000;
    border-bottom: 5px solid #000000;
    background-color: #e49605;
    margin: 100px 0px 0px 0px;
    text-shadow: 1px 1px 2px #ffffff;
    font-family: Agreloyc Almond, fantasy;
    font-size: calc(10px + 0.390625vw);
}

footer p {
    font-family: fantasy;
}

/* PAGE: NAKSHATRA BASICS */

    /* WHEEL PIE GRAPH */

    /* SIGN RULERS */

        #sign-rulers .legend-item {
            align-items: center;
        }

        #sign-rulers .label {
            font-weight: 600;
        }

        #sign-rulers .sub {
            color: var(--muted, #555);
            font-weight: 400;
            margin-left: 6px;
        }

    /* NAKSHATRA RULERS */

        .wrap {
            display: grid;
            grid-template-columns: minmax(0, 1fr) 320px; /* limit the chart column to the same cap */
            gap: 24px;
            align-items: start;
        }

        .canvas-wrap {
            position: relative;
            width: 100%;
            max-width: 500px;
            margin: 0 auto;
            touch-action: none;
        }

        .canvas-wrap canvas {
            display:block;
            width:100%;
            height:auto;
            background:transparent;
        }

        canvas#pie {
            display: block;
            width: 100%;
            height: auto;
            background: transparent;
            cursor: default;
            touch-action: none;
            -webkit-tap-highlight-color: transparent;
        }

        .tooltip {
            position: absolute;
            padding: 8px 10px;
            background: var(--panel);
            border: 1px solid var(--border);
            border-radius: 10px;
            font-size: 13px;
            box-shadow: 0 6px 20px rgba(0,0,0,.12);
            pointer-events: none;
            display: none;
            white-space: nowrap;
            transform: none;
            z-index: 1000;
        }

        .tooltip strong { 
            font-weight: 600;
        }

        .legend {
            display: grid;
            grid-template-columns: 1fr;
            gap: 8px;
            padding: 5px 0px 5px 0px;
        }

        .legend-item {
            display:grid;
            grid-template-columns:16px auto;
            gap:10px;
            align-items:center;
        }

        .swatch {
            width:16px;
            height:16px;
            border-radius:4px;
            box-shadow:0 0 0 1px rgba(0,0,0,.1) inset;
        }

        .note {
            color:var(--muted);
            font-size:14px;
            line-height:1.4;
            padding: 5px 0px 5px 0px;
        }

        .notebold {
            color:var(--muted);
            font-size:14px;
            line-height:1.4;
            font-weight: 800;
            margin-left: 5px;
            padding: 5px 0px 5px 0px;
        }

        .noteitalicscenter {
            color:var(--muted);
            font-size:14px;
            line-height:1.4;
            text-align: center;
            padding: 5px 0px 5px 0px;
            font-style: italic;
        }

        .notecenter {
            color:var(--muted);
            font-size:14px;
            line-height:1.4;
            text-align: center;
            padding: 5px 0px 5px 0px;
        }

       .legend-stack {
            display: grid; gap: 12px;
        }
       
       .legend-stack details {
            border: 1px solid var(--border,#ddd);
            border-radius: 8px;
            padding: 6px 10px;
            background: var(--panel, #fafafa);
        }
       
       .legend-stack summary {
            cursor: pointer;
        }

/* MOBILE */

    @media (max-width: 900px){
        .wrap {
            grid-template-columns: 1fr;
        }

        main {
            margin: 10px;
        }

        /* TYPOGRAPHY */

        h3 {
            text-align: left;
            font-size: calc(25px + 0.390625vw);
        }

        /* HEADER */

        header {
            font-size: calc(25px + 0.390625vw);
        }

        /* FOOTER */

        footer {
            font-size: calc(10px + 0.390625vw);
            margin: 90px -10px -10px -10px;
        }

        /* NAVIGATION */

        nav > div {
            flex-direction: column;
            gap: 20px;
            align-items: center;
        }

        nav ul {
            width: 100%;
            max-width: 400px;
        }

        nav ul ul {
            position: static;
            transform: none;
            opacity: 1;
            visibility: visible;
            box-shadow: none;
            background-color: #666;
            margin: 0 10px;
            border-radius: 3px;
            padding: 5px;
        }
    }