/*
Theme Name: nD::StudioLab
Theme URI: https://ndstudiolab.com/
Author: Mark-David Hosale / WordPress conversion
Description: A WordPress adaptation of the original nD::StudioLab Joomla template, preserving its hypercube identity, compact navigation, and research-project layout.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: ndstudiolab
*/

:root {
    --nds-blue: #336699;
    --nds-deep-blue: #003366;
    --nds-grey: #666;

    --nds-sidebar-width: 250px;
    --nds-content-offset: 355px;
    --nds-content-width: 700px;
    --nds-shell-width: 1055px;
}

html {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

body {
    margin: 0;
    background: #fff;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--nds-blue);
    text-decoration: none;
    font-weight: 700;
}

a:hover,
a:focus {
    color: var(--nds-grey);
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.screen-reader-text:focus {
    clip: auto !important;
    width: auto;
    height: auto;
    padding: .75rem 1rem;
    left: 1rem;
    top: 1rem;
    background: #fff;
    z-index: 100000;
}

/* Overall desktop layout */

.site-shell {
    position: relative;
    width: var(--nds-shell-width);
    min-height: 800px;
    padding-bottom: 5rem;
    background: none;
}

/* Animation remains unchanged */

.site-branding-canvas {
    width: 350px;
    height: 250px;
    overflow: hidden;
}

#hypercube-canvas {
    display: block;
    width: 300px;
    height: 300px;
    margin-left:2em;
}

/* Text-based site identity and header */

.site-header {
    position: absolute;
    top: 30px;
    left: var(--nds-content-offset);
    width: var(--nds-content-width);
}

.site-identity {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    color: #000;
    font-weight: 400;
    text-decoration: none;
}

.site-identity:hover,
.site-identity:focus {
    color: #000;
}

.site-title-text {
    display: block;
    font-family:
        Baskerville,
        "Baskerville Old Face",
        serif;
    font-size: 100px;
    font-style: italic;
    font-weight: 400;
    line-height: .95;
    white-space: nowrap;
}

.site-nd,
.site-dots,
.site-studio {
    color: #000;
}

.site-dots {
    padding: 0 .12em;
}

.site-lab {
    color: var(--nds-blue);
}

.site-affiliation,
.site-location {
    display: block;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: .1em;
}

.site-affiliation {
    margin-top: 8px;
}

/* Header and top navigation */

.top-menu {
    margin-top: .5rem;
}

.top-menu ul,
.sidebar-menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.top-menu > ul {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem 1rem;
}

.top-menu li {
    font-size: 15px;
}

/* Left navigation */

.site-sidebar {
    position: absolute;
    top: 250px;
    left: 15px;
    width: var(--nds-sidebar-width);
    line-height: 1.4;
}

.sidebar-menu li {
    margin: 0 0 1.5rem;
}

.sidebar-menu > ul > li > a {
    font-size: 16px;
}

.sidebar-menu .sub-menu {
    margin: .4rem 0 0 .8rem;
}

.sidebar-menu .sub-menu li {
    margin-bottom: 1.5rem;
}

.sidebar-menu .sub-menu a {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
}

.sidebar-menu li > a {
    display: block;
}

.menu-description {
    display: block;
    margin: 1px 0 8px;
    color: #666;
    font-family: Arial, Helvetica, sans-serif;

    font-style: italic;
    font-weight: 400;
    line-height: 1.15;
}


.sidebar-menu .menu-divider {
    display: block;
    width: 100%;
    height: 0;
    margin: 18px 0;
    padding: 0;
    border: 0;
    border-top: 3px dotted #999;
}

/* Main content */

.site-main {
    position: relative;
    margin-left: var(--nds-content-offset);
    margin-top: 0px;
    width: var(--nds-content-width);
    min-height: 500px;
    line-height: 1.6;
}

/* Hide automatically generated WordPress page and post titles */

.entry-header,
.page-title,
.entry-title {
    display: none;
}

.entry-content > :first-child {
    margin-top: 0;
}

.entry-content table {
    max-width: 100%;
    border-collapse: collapse;
}

.entry-content iframe {
    max-width: 100%;
}

.entry-meta {
    color: #999;
    font-size: 13px;
    margin-bottom: 1rem;
}

.post-navigation {
    margin-top: 2rem;
}

/* Headings entered manually within page content remain visible */

.entry-content h1 {
    font-size: 2rem;
    line-height: 1.25;
}

.entry-content h2 {
    font-size: 1.65rem;
    line-height: 1.3;
}

.entry-content h3 {
    font-size: 1.35rem;
    line-height: 1.35;
}

/* Footer */

.site-footer {
    margin-top: 3rem;
    text-align: center;
    color: #666;
    font-size: 14px;
    line-height: 1.45;
}

.site-footer .copyright {
    color: #999;
}

/* Mobile menu button */

.mobile-menu-toggle {
    display: none;
    border: 1px solid #ccc;
    background: #fff;
    padding: .5rem .65rem;
    font: inherit;
    color: var(--nds-deep-blue);
}

/* WordPress alignment helpers */

.alignleft {
    float: left;
    margin: 0 1rem 1rem 0;
}

.alignright {
    float: right;
    margin: 0 0 1rem 1rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.wp-caption {
    max-width: 100%;
}
/* Desktop top-level accordion navigation */

@media (min-width: 1001px) {

    .sidebar-menu > ul > li.menu-item-has-children {
        position: relative;
    }

    /* Hide only the direct top-level submenu */
    .sidebar-menu > ul > li.menu-item-has-children > .sub-menu {
        display: none;
    }

    /* Open the full section */
    .sidebar-menu > ul > li.menu-item-has-children.accordion-open > .sub-menu {
        display: block;
    }

    /* Keep children and grandchildren visible */
    .sidebar-menu > ul > li.accordion-open .sub-menu .sub-menu {
        display: block;
    }

    /*
     * The top-level link should not occupy the entire sidebar width.
     */
    .sidebar-menu > ul > li.menu-item-has-children > a {
        display: inline;
        padding: 0;
    }

    /*
     * Descriptions remain on a new line but only occupy
     * the width of their text.
     */
    .sidebar-menu > ul > li.menu-item-has-children .menu-description {
        display: inline-block;
        width: auto;
    }

    /*
     * Force the description onto its own line.
     */
    .sidebar-menu > ul > li.menu-item-has-children .menu-description::before {
        content: "";
        display: block;
    }

    /* Arrow follows the title or description */
    .sidebar-menu > ul > li > .accordion-toggle,
    .sidebar-menu > ul > li a > .accordion-toggle {
        position: static;
        display: inline-block;

        width: auto;
        height: auto;
        margin: 0 0 0 4px;
        padding: 0;

        border: 0;
        background: transparent;
        color: var(--nds-blue);
        cursor: pointer;

        font-family: inherit;
        font-size: 12px;
        line-height: 1;
        vertical-align: baseline;
    }

    .sidebar-menu .accordion-toggle:hover,
    .sidebar-menu .accordion-toggle:focus {
        color: var(--nds-grey);
    }

    .sidebar-menu .accordion-toggle span {
        display: inline-block;
        transition: transform .2s ease;
    }

    .sidebar-menu > ul > li.accordion-open .accordion-toggle span {
        transform: rotate(90deg);
    }
}
/* Tablet and mobile layout */

@media (max-width: 1000px) {

    body {
        padding: 0 18px;
    }

    .site-shell {
        width: 100%;
        min-height: 0;
    }

    .site-branding-canvas,
    #hypercube-canvas {
        width: 150px;
        height: 150px;
        margin-left: .15em;
    }

    .site-header {
        position: static;
        width: auto;
        margin: -115px 0 0 175px;
        min-height: 115px;
    }

 .site-title-text {
    font-size: 60px;
}

.site-affiliation {
    font-size: 12px;
}

.site-location {
    font-size: 12px;
}

    /* Menu button */

    .mobile-menu-toggle {
        display: block;
    }

    /* Responsive menu container */

    .site-sidebar {
        position: static;
        width: auto;
        margin: 1.25rem 0;
        padding: .75rem 0;
        border-top: 1px solid #ddd;
        border-bottom: 1px solid #ddd;
    }

    /* Menu hidden until the button is clicked */

    .sidebar-menu {
        display: none;
        margin-top: .75rem;
    }

    .sidebar-menu.is-open {
        display: block;
    }

    /* Menu layout */

    .sidebar-menu > ul {
        display: block;
        margin: 0;
        padding: 0;
    }

    .sidebar-menu > ul > li {
        margin: 0 0 1.5rem;
    }

    .sidebar-menu .sub-menu {
        display: block;
        margin: .4rem 0 0 .8rem;
    }

    .sidebar-menu .sub-menu li {
        margin-bottom: .65rem;
    }

    /* Main content */

    .site-main {
        width: 100%;
        min-height: 0;
        margin: 1.5rem 0 0;
    }
}

@media (max-width: 500px) {
    body {
        padding: 0 12px;
    }

    .site-branding-canvas {
        width: 155px;
        height: 155px;
    }

    #hypercube-canvas {
        width: 120px;
        height: 120px;
    }

    .site-header {
        margin: -120px 0 0 135px;
        min-height: 95px;
    }

    .site-title-text {
        font-size: 2.8em;
    }

    .site-affiliation,
    .site-location {
        font-size: .68em;
        letter-spacing: .04em;
    }
}
