@import url('https://fonts.googleapis.com/css2?family=Amaranth:ital,wght@0,400;0,700&family=Roboto+Flex:wght@100..900&display=swap');

/* ==========================================================================
   1. GLOBAL STYLES & RESETS
   ========================================================================== */
html {
    scroll-behavior: smooth;
    font-size: 100%;
} 

body {
    font-family: 'Roboto Flex', sans-serif;
    font-weight: 400;
    letter-spacing: -0.005em;
    color: #555;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Prevent background scrolling on mobile when the hamburger menu is open */
body:has(#layout.active) {
    overflow: hidden;
}

/* Global bold and header thickness override */
h1, h2, h3 {
    font-weight: 600 !important;
}
b, strong {
    font-weight: 700 !important;
}

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

iframe { 
    border: none; 
}

/* Hide the menu scrollbar specifically in Chrome, Safari and newer Opera/Edge/Firefox browsers */
#menu::-webkit-scrollbar,
#menu .pure-menu::-webkit-scrollbar {
    display: none;
}
#menu {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* ==========================================================================
   2. MAIN BODY CONTENT LAYOUT
   ========================================================================== */
.content {
    margin: 0 auto;
    padding: 0 2em;
    max-width: 800px;
    margin-bottom: 50px;
    line-height: 1.6em;
}

.header {
     margin: 0;
     color: #333;
     text-align: center;
     padding: 2.5em 2em 0;
     border-bottom: 1px solid #eee;
}
.header h1 {
    margin: 0.2em 0;
    font-size: 3em;
}
.header h2 {
    color: #ccc;
    padding: 0;
    margin-top: 0;
}

.content-subhead {
    margin: 50px 0 20px 0;
    font-weight: 400;
    color: #777;
}

.main-heading {
    margin: 12px 0 20px 0;
    padding-bottom: 12px;
    font-weight: 700;
    font-variation-settings: 'wght' 700, 'wdth' 85; 
    letter-spacing: -0.01em; 
    line-height: 1.3;
    font-size: 1.4em;
    color: #808080;
}

.course-subheading {
    color: #777;
    line-height: 1.6;
    font-weight: 700;
	margin-top: -10px;
}
 
.topic-logo {
     margin-bottom:0px;
     padding-bottom:0px;
     padding-top:20px;
}
 
.recommended {
     color: red;
     font-size: .7em;
     font-weight:bold;
}
.recommended.front-page {
      font-size:.55em;
}

.pure-menu-item hr {
	 border-top:1px solid black;
}

.mathsdotscot {
	 font-weight: bold;
	 white-space: nowrap;
}
 
.example {
	 text-decoration: none;
	 scroll-margin-top: -15px;
}

.bullets {
	 font-size: 1.3em;
	 line-height: 1.7;
	 font-weight: 750;
}

.subtopic { 
	 line-height: 1.2em;
	 margin-top: -10px;
	 color: #707070;
}

.content-subhead + .subtopic {
    margin-top: -14px; 
}

.worked-example {
	 color: #666;
	 border: 1px solid #d6d6d6 !important;
	 text-decoration: none;
	 font-size: 85%;
	 font-weight: bold;
	 width: 100%;
	 max-width: 120px; 
}

.coffee {
	 display: block;
	 width: 90px;
	 margin: 0 auto;
	 transform: translateX(-5px);
}

.footer {
	 margin-top: 28px;
	 text-align: left;
	 font-size: 0.75em;
	 padding-top: 4px;
	 line-height: 1.5em;
}

/* ==========================================================================
   3. WEB APP / PWA MODULES
   ========================================================================== */
.pwa-install-banner {
    margin: 24px 0 15px 0 !important;
    padding: 0 !important;
    display: none !important; /* Controlled by display-mode media query at bottom */
    width: 100%;
    max-width: 290px !important;
}

.pwa-banner-box {
    background-color: #f8f9fa;
    border: 1px solid #d6d6d6;
    border-radius: 8px;
    padding: 10px 7px;
    font-size: 102%;
    line-height: 0.95;
    width: 100%;
    max-width: 290px;
}

.pwa-banner-text {
    color: #666;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    display: inline !important;
}

.pwa-banner-alert {
    color: #d00;
}

.pwa-banner-action {
    white-space: nowrap;
}

.pure-menu-list {
    font-size: 0.92em;
    letter-spacing: 0.01em;
}

.top-menu-item {
  padding-top: 7px;
}

.active-menu-item {
  font-weight: bold;
  color: #fcda04 !important;
}

#openModal1 > div,
#openModal2 > div,
#openModal3 > div,
#openModal4 > div,
#openModal5 > div {
    width: 100% !important;
    max-width: 290px !important;
    margin-top: 6% !important;
}

/* ==========================================================================
   4. NAVIGATION MENU LAYOUT (MOBILE DEFAULT)
   ========================================================================== */
#layout,
#menu,
.menu-link {
    transition: left 0.2s ease-out;
}

#layout {
    position: relative;
    left: 0;
    padding-left: 0;
}

#layout.active #menu {
    left: 150px;
    width: 150px;
}

#layout.active .menu-link {
    left: 150px;
}

#menu {
    margin-left: -150px; 
    width: 150px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    background: #3c3c3c;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#menu a, 
#menu .pure-menu-link {
    font-family: 'Roboto Flex', sans-serif;
    font-weight: 400;
    letter-spacing: -0.005em;
    color: #ffffff !important;
    border: none;
    padding: 0.6em 0 0.6em 0.6em;
}

#menu .pure-menu,
#menu .pure-menu ul {
    border: none;
    background: transparent;
}

#menu .pure-menu ul,
#menu .pure-menu .menu-item-divided {
    border-top-width: 0;
}

#menu .pure-menu li a:hover,
#menu .pure-menu li a:focus,
#menu .pure-menu-link:hover,
#menu .pure-menu-link:focus {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.06) 100%) !important;
    text-decoration: none;
}

#menu .pure-menu-selected,
#menu .pure-menu-heading {
    background: linear-gradient(135deg, #1f8dd6 0%, #186fa9 100%) !important;
    box-shadow: none !important;
    transition: background 0.15s ease;
}

#menu .pure-menu-selected a {
    color: #fcda04 !important; 
}

#menu .pure-menu-heading {
    font-family: 'Amaranth', sans-serif !important;
    font-size: 130%;
    color: #fff;
    margin: 0;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    padding: 10px 8px 11px 8px;
    text-transform: none;
    display: flex;
    align-items: flex-end;
    justify-content: space-between; 
}

#menu .pure-menu-heading:hover,
#menu .pure-menu-heading:active {
    background: linear-gradient(135deg, #2595e0 0%, #1f8dd6 100%) !important;
    border-bottom: 1px solid #eee;
    box-shadow: none !important;
}

#menu .pure-menu-heading::after {
	 content: "";
	 display: inline-block;
	 width: 19px;
	 height: 19px;
	 margin-bottom: 2px;
	 background-color: #fff;
	 -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/></svg>") no-repeat center;
	 mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/></svg>") no-repeat center;
	 -webkit-mask-size: contain;
	 mask-size: contain;
}

#menu .pure-menu-item hr {
    border-top:1px black;
}

/* Hamburger trigger */
.menu-link {
    box-sizing: border-box; 
    position: fixed;
    display: flex;           
    align-items: center;
    top: 0;
    left: 0; 
    background: rgba(44, 44, 44, 0.75);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    font-size: 10px; 
    z-index: 10;
    width: 4.6em;
    height: 4.5em;
    padding-left: 1.25em; 
    border-bottom-right-radius: 8px;
}

.menu-link:hover,
.menu-link:focus {
    background: rgba(44, 44, 44, 0.75); 
}

.menu-link span {
    position: relative;
    display: block;
}

.menu-link span,
.menu-link span:before,
.menu-link span:after {
    background-color: #fff;
    width: 2em;            
    height: 0.2em;
    transition: transform 0.25s ease-in-out, opacity 0.25s ease-in-out, margin 0.25s ease-in-out;
}

.menu-link span:before,
.menu-link span:after {
    position: absolute;
    margin-top: -0.6em; 
    content: " ";
}

.menu-link span:after {
    margin-top: 0.6em;  
}

#layout.active .menu-link span {
    background-color: transparent;
}

#layout.active .menu-link span:before {
    margin-top: 0;
    transform: rotate(45deg);
}

#layout.active .menu-link span:after {
    margin-top: 0;
    transform: rotate(-45deg);
}

#layout.active .menu-link {
    border-left: 1px solid #eee;
}

/* ==========================================================================
   5. RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Mobile only interaction adjustments */
@media (max-width: 48em) {
    #layout.active {
        position: relative;
        left: 150px;
    }
}

/* Desktop only */
@media (min-width: 48em) {

    #layout {
        padding-left: 210px; 
        left: 0;
    }

    .header,
    .content {
        padding-left: 2em;
        padding-right: 2em;
        margin-left: 8% !important; 
        margin-right: auto !important;
        max-width: 800px;
    }
    
    #menu {
        margin-left: 0;      
        left: 21px;          
        top: 20px;           
        bottom: auto;        
        width: 190px;        
        max-height: calc(100vh - 20px);
        overflow-y: auto;
        background: transparent; 
    }

    #menu .pure-menu {
        background: #4a4a4a;        
        border-radius: 10px;
        padding-bottom: 20px;       
        box-sizing: border-box;
        width: 100%;
    }

    #menu .pure-menu-link:not(.pure-menu-heading) {
        font-family: 'Roboto Flex', sans-serif !important;
        font-size: 100% !important; 
        font-weight: 625 !important;
        letter-spacing: 0.01em !important;
        padding-left: calc(0.6em + 7px) !important; 
    }

    #menu .pure-menu-list .active-menu-item,
    #menu .pure-menu-selected a {
        font-weight: 625 !important;
    }

    #menu .pure-menu-heading,
    #menu .pure-menu-heading a {
        font-family: 'Amaranth', sans-serif !important;
        font-weight: normal !important;
        padding-left: calc(8px + 7px) !important; 
        border-radius: 10px 10px 0 0;
    }

    #menu .pure-menu-heading::after {
        margin-right: 7px;
    }

    .menu-link {
        position: fixed;
        left: 150px;
        display: none;
    }

    #layout.active .menu-link {
        left: 150px;
    }
}

/* PWA display scoping exception */
@media (display-mode: browser) {
  .pwa-install-banner {
    display: inline !important;
  }
}