/* Base styles */
html {
    overflow-x: hidden;
    width: 100%;
}

body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #50596c;
    background: #fff;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Hyperlinks */
a {
    color: #E06F2D;
    font-weight: bold;
    text-decoration: none;
}

/* Logo scaling - ensure consistent sizing across all pages */
.desktop-nav img,
.section-white img[alt*="Logo"],
img[alt*="Mark Hammond Mastering Logo"] {
    max-width: 100%;
    width: auto;
    height: auto;
}

a:visited {
    color: #E06F2D;
    font-weight: bold;
}

a:hover {
    color: #E06F2D;
    font-weight: bold;
    text-decoration: underline;
}

/* Section colors */
.section-olive,
.section-light-olive,
.section-orange,
.section-black,
.section-white,
.section-grey {
    padding: 10px;
    box-sizing: border-box;
    min-height: 0;
    height: auto;
}

.section-olive {
    color: #FFFFFF;
    background-color: #5E6626;
}

.section-light-olive {
    color: #5E6626;
    background-color: #C4CE96;
}

.section-orange {
    color: #FFFFFF;
    background-color: #E06F2D;
}

.section-black {
    color: #FFFFFF;
    background-color: #000000;
}

.section-white {
    color: #5E6626;
    background-color: #FFFFFF;
}

.section-grey {
    color: #000000;
    background-color: #E0E0E0;
}

/* Container */
.container {
    width: 100%;
    max-width: 976px;
    margin-right: auto;
    margin-left: auto;
    padding-right: 1rem;
    padding-left: 1rem;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Section */
.section {
    position: relative;
    padding-right: 1rem;
    padding-left: 1rem;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Mobile menu styles - completely hidden */
.mobile-container {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.mobile-container .overlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.mobile-logo img,
.mobile-logo svg {
    height: 42px;
    margin-top: .7rem;
    margin-left: 1.4rem;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    visibility: hidden;
    width: 100%;
    max-width: 100vw;
    height: 0;
    transition: opacity .35s, visibility .35s, height .35s;
    opacity: 0;
    background: #000;
    box-sizing: border-box;
    overflow-x: hidden;
}

.overlay.open {
    visibility: visible;
    height: 100%;
    opacity: .95;
}

.overlay-menu {
    overflow-y: scroll;
    height: calc(100% - 90px);
}

.overlay-menu > .tree {
    text-align: left;
}

.treemenu.treemenu-root {
    margin: 1rem;
}

.treemenu li {
    line-height: 1.2rem;
    margin: 0 0 1px;
    padding: 5px 0;
    list-style: none;
    background: rgba(102, 113, 137, .1);
}

.treemenu li a {
    font-size: 1rem;
    display: block;
    margin-left: 1.2rem;
}

.treemenu li a.active,
.treemenu li a:focus,
.treemenu li a:hover {
    text-decoration: none;
    color: #3e8def !important;
}

.treemenu ul {
    margin: 0 0 0 1rem;
}

.treemenu .toggler {
    font-size: 1.1rem;
    line-height: 1rem;
    float: left;
    padding-left: 5px;
    cursor: pointer;
    vertical-align: top;
}

.treemenu .toggler:before {
    display: inline-block;
    margin-right: 2pt;
}

.treemenu li.tree-empty > .toggler {
    cursor: default;
    opacity: .3;
}

.treemenu li.tree-empty > .toggler:before {
    content: '\2022';
}

.treemenu li.tree-closed > .toggler:before {
    content: '+';
}

.treemenu li.tree-opened > .toggler:before {
    content: '\2212';
}

.mobile-nav-open {
    overflow-y: hidden;
}

/* Footer */
#footer {
    padding: 1rem 1rem 0;
    text-align: center;
    color: #acb3c2;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.bg-gray {
    background: #f8f9fa;
}

/* Table */
table {
    width: 100%;
    border-spacing: 0;
    border-collapse: collapse;
    text-align: left;
}

table th,
table td {
    padding: .6rem .4rem;
    border-bottom: .05rem solid #e7e9ed;
}

table th {
    border-bottom-width: .1rem;
}

/* Gist table fix */
.gist table {
    table-layout: auto;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    /* Prevent horizontal scrolling - apply box-sizing to all elements */
    *, *::before, *::after {
        box-sizing: border-box;
    }
    
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    #page-wrapper,
    #body-wrapper,
    #start {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }
    
    /* Ensure main containers don't overflow and are centered */
    .grid-lg {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0 auto;
        padding: 0;
    }
    
    /* Keep desktop navigation visible on mobile - ensure it shows on all browsers */
    .desktop-nav {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        width: 100% !important;
        height: auto !important;
    }
    
    /* Ensure the section-white containing desktop-nav is visible */
    .section-white.desktop-nav,
    div.section-white.desktop-nav {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Ensure logo in desktop-nav is visible */
    .desktop-nav img {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Ensure links in desktop-nav are visible */
    .desktop-nav a {
        display: inline !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Completely hide mobile container and menu */
    .mobile-container {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    .mobile-container .overlay {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* Hide mobile hamburger menu button */
    .mobile-menu-toggle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    .mobile-menu-toggle:active {
        background: #4a5220;
    }
    
    .mobile-menu-toggle span {
        display: block;
        width: 25px;
        height: 3px;
        background: #fff;
        margin: 5px 0;
        transition: 0.3s;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    /* Fix headshot image on mobile - make it smaller */
    .section-white img[alt="Head shot of Mark Hammond"] {
        float: none;
        display: block;
        margin: 0 auto 15px;
        width: 60%;
        max-width: 180px;
        box-sizing: border-box;
    }
    
    /* Make table responsive - allow horizontal scroll within container */
    .section-grey {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    table {
        min-width: 500px;
        font-size: 14px;
        width: 100%;
        box-sizing: border-box;
    }
    
    table th,
    table td {
        padding: 8px 4px;
    }
    
    /* Make iframe responsive */
    iframe {
        width: 100% !important;
        max-width: 100% !important;
        height: 300px !important;
        box-sizing: border-box;
        display: block;
    }
    
    /* Adjust container padding - ensure equal padding for centering */
    .container {
        padding-right: 1rem;
        padding-left: 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0 auto;
    }
    
    /* Ensure all sections don't overflow and are centered */
    .section-olive,
    .section-light-olive,
    .section-orange,
    .section-black,
    .section-white,
    .section-grey {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 15px 1rem;
        margin: 0;
        display: block !important;
        visibility: visible !important;
    }
    
    /* Specifically ensure first section-white (desktop-nav) is visible */
    .container .section-white:first-of-type,
    .container > .section-white:first-child {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Ensure section wrapper is centered */
    .section {
        padding-right: 0 !important;
        padding-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        margin: 0 !important;
    }
    
    /* Ensure body-wrapper has no extra padding/margin */
    #body-wrapper {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Improve text readability */
    body {
        font-size: 16px;
    }
    
    /* Adjust testimonial carousel height */
    #testimonial-item {
        height: auto;
        min-height: 150px;
        padding: 15px 20px;
    }
    
    /* Logo sizing on mobile - ensure it fits */
    .desktop-nav img,
    .section-white img[src*="logo"],
    .section-white img[alt*="Logo"],
    img[alt*="Mark Hammond Mastering Logo"] {
        max-width: 100%;
        width: auto;
        height: auto;
        display: block;
        margin: 0 auto;
    }
    
    /* Ensure logo in desktop-nav scales properly on all screen sizes */
    .desktop-nav img {
        max-width: 100%;
        width: auto;
        height: auto;
    }
    
    /* Ensure all images don't overflow */
    img {
        max-width: 100%;
        height: auto;
        box-sizing: border-box;
    }
    
    /* Improve touch targets for navigation */
    .overlay-menu a {
        min-height: 44px;
        display: block;
        padding: 12px 0;
    }
    
    .treemenu a {
        min-height: 44px;
        padding: 10px 0;
    }
    
    /* Make sure overlay menu is accessible */
    .overlay.open {
        z-index: 1000;
    }
    
    /* Improve paragraph spacing on mobile */
    p {
        margin-bottom: 1em;
        text-align: left;
    }
    
    /* Ensure text content is properly aligned */
    .section-white p,
    .section-grey p {
        text-align: left;
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Privacy policy page mobile styles */
    h2 {
        font-size: 1.5em;
        margin-top: 1em;
        margin-bottom: 0.5em;
        margin-left: 0;
        margin-right: 0;
        word-wrap: break-word;
        text-align: left;
    }
    
    h2 span {
        display: inline-block;
        margin: 0;
        padding: 0;
    }
    
    ul {
        padding-left: 1.5em;
        margin-bottom: 1em;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    li {
        margin-bottom: 0.5em;
        line-height: 1.6;
    }
    
    /* Ensure headings are properly aligned */
    h2, h3, h4 {
        margin-left: 0;
        margin-right: 0;
        text-align: left;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Privacy policy specific content alignment - ensure everything is properly aligned */
    .section-white {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        position: relative;
        left: 0 !important;
        right: 0 !important;
    }
    
    /* Force privacy policy container to be centered */
    .container.grid-lg {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .section-white h2,
    .section-white p {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Keep list padding for bullets, but ensure proper alignment */
    .section-white ul {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-right: 0 !important;
        width: 100%;
        box-sizing: border-box;
    }
}

/* Small mobile devices */
@media screen and (max-width: 480px) {
    body {
        font-size: 15px;
    }
    
    .section-olive,
    .section-light-olive,
    .section-orange,
    .section-black,
    .section-white,
    .section-grey {
        padding: 12px 8px;
    }
    
    table {
        font-size: 12px;
        min-width: 400px;
    }
    
    iframe {
        height: 250px !important;
    }
    
    /* Make headshot even smaller on very small screens */
    .section-white img[alt="Head shot of Mark Hammond"] {
        width: 50%;
        max-width: 150px;
    }
    
    /* Privacy policy page - smaller text on very small screens */
    h2 {
        font-size: 1.3em;
    }
    
    p, li {
        font-size: 14px;
    }
}

/* Hide mobile menu toggle on desktop */
.mobile-menu-toggle {
    display: none;
}


