/* Global Styles */

/* @link https://utopia.fyi/type/calculator?c=320,18,1.2,1240,20,1.25,5,2,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12 */
:root {
    --step--2: clamp(0.6944rem, 0.6593rem + 0.1816vw, 0.8rem);
    --step--1: clamp(0.8333rem, 0.7778rem + 0.2867vw, 1rem);
    --step-0: clamp(1rem, 0.9167rem + 0.4301vw, 1.25rem);
    --step-1: clamp(1.2rem, 1.0792rem + 0.6237vw, 1.5625rem);
    --step-2: clamp(1.44rem, 1.269rem + 0.8828vw, 1.9531rem);
    --step-3: clamp(1.728rem, 1.4902rem + 1.2274vw, 2.4414rem);
    --step-4: clamp(2.0736rem, 1.7475rem + 1.6829vw, 3.0518rem);
    --step-5: clamp(2.4883rem, 2.0462rem + 2.2819vw, 3.8147rem);
}

/* @link https://utopia.fyi/space/calculator?c=320,18,1.2,1240,20,1.25,5,2,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12 */
:root {
    --space-3xs: clamp(0.3125rem, 0.3125rem + 0vw, 0.3125rem);
    --space-2xs: clamp(0.5625rem, 0.5408rem + 0.1087vw, 0.625rem);
    --space-xs: clamp(0.875rem, 0.8533rem + 0.1087vw, 0.9375rem);
    --space-s: clamp(1.125rem, 1.0815rem + 0.2174vw, 1.25rem);
    --space-m: clamp(1.6875rem, 1.6223rem + 0.3261vw, 1.875rem);
    --space-l: clamp(2.25rem, 2.163rem + 0.4348vw, 2.5rem);
    --space-xl: clamp(3.375rem, 3.2446rem + 0.6522vw, 3.75rem);
    --space-2xl: clamp(4.5rem, 4.3261rem + 0.8696vw, 5rem);
    --space-3xl: clamp(6.75rem, 6.4891rem + 1.3043vw, 7.5rem);
}

:root{
    --bg-color: white;
    --accent-color: grey;
    --main-colour: #1a4987
}

*,
*::before,
*::after {
    box-sizing: border-box;
    font-family: sans-serif;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 8rem;
    text-wrap: pretty;
}

html:focus-within {
    scroll-behavior: smooth;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body {

    text-rendering: optimizeSpeed;
}

/* Integrated type scale */
h1,
.h1 {
    font-size: var(--step-2);
}

h2,
h1 .small,
.h2 {
    font-size: var(--step-1);
}

h3,
.h3 {
    font-size: var(--step-0);
}

h4,
.h4 {
    font-size: var(--step--1);
}

h5,
.h5 {
    font-size: var(--step--2);
}

ul[role="list"],
ol[role="list"] {
    list-style: none;
    padding: 0;
}


a:not([class]) {
    text-decoration-skip-ink: auto;
}

img,
picture {
    max-width: 100%;
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
}


@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }
}

:focus {
    outline-offset: 0.25rem;
}

main:focus {
    outline: none;
}

/* Header Styles */
header {
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: grid;
}

header h1 {
    margin: 0;
    width: 100%;
}

header img.logo {
    width: 80px;
    height: auto;
}

header,
footer,
nav,
.menu-left {
    background-color: #1a4987;
    color: white;
}


.dropdown {
    margin: 2vh 0;
    background-color: #1a4986;
}

.dropdown>a {
    font-weight: bold;
}

.dropdown-content a {
    margin-bottom: -1vw;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px 0 20px;
    width: 100%;
}

.navbar a:hover {
    text-decoration: none;
    background-color: rgba(0, 0, 0, 0.3);
}

.menu-right,
.logo {
    display: flex;
}

.hamburger {
    display: flex;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    margin: auto;
    padding-left: 1vw;
}

.hamburger span {
    height: 3px;
    width: 100%;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-left {
    overflow-y: auto;
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 1;
    top: 0;
    left: 0;
    overflow-x: clip;
    transition: width 0.5s ease;
    padding-top: 60px;
}

.menu-left a:not(.closebtn) {
    padding: 1vh 0;
    font-size: 22px;
    display: block;
    width: 100%;
}

.menu-left .closebtn {
    position: absolute;
    top: 0;
    right: 25px;
    font-size: 36px;
    cursor: pointer;
}

.ticker {
    margin: 0 auto;
    white-space: nowrap;
    overflow: hidden;
    width: 100%;
    text-decoration: none;
}

.ticker span {
    display: inline-block;
    padding-left: 100%;
    padding-right: 5ps;
    animation: marquee 20s linear infinite;
}

.ticker2 {
    margin: -1.1rem auto;
}

.ticker2 span {
    animation-delay: 10s;
}

@keyframes marquee {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-100%, 0);
    }
}

/* Main Content Styles */
main {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

section,
aside {
    margin-bottom: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

section {
    width: 100%;
}


/* Spot the Difference Styles */
.spot-difference {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
    width: 98vw;
    margin-left: calc(-49vw + 50%);
}

.spot-difference p {
    width: 100%;
}

.spot-difference picture {
    flex: 1 1 300px;
    min-width: 0;
    transition: transform 0.3s ease;
}

.spot-difference picture:hover {
    transform: scale(1.1);
    z-index: 1;
}

.spot-difference img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 2 / 1;
    object-position: bottom;
}

#wordsearchlabs {
    max-width: 100%;
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 1rem 0;
    width: 100%;
}

footer p {
    margin: 0;
}

/* Dark Mode Toggle Styles */
dark-mode-toggle {
    --dark-mode-toggle-dark-icon: url('img/icons/dark.svg');
    --dark-mode-toggle-light-icon: url('img/icons/light.svg');
    --dark-mode-toggle-system-icon: url('img/icons/sun-moon.svg');
    --dark-mode-toggle-remember-icon-unchecked: url('img/icons/unchecked.svg');
    --dark-mode-toggle-remember-icon-checked: url('img/icons/checked.svg');
}

dark-mode-toggle::part(aside) {
    display: inline;
    padding-left: 3px;
    visibility: visible;
}

#dark-mode-toggle-side {
    --dark-mode-toggle-icon-size: 2rem;
    height: auto;
}

/* Section Navigator Styles */
.section-navigator {
    width: fit-content;
    background-color: lightgray;
    padding: 10px;
    border-radius: 5px;
}

.section-navigator ul:before {
    content: attr(aria-label);
    font-size: 120%;
    font-weight: bold;
}

.section-navigator ul,
.section-navigator ul:before {
    list-style: none;
    padding: 5px 20px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-navigator li {
    margin: 0;
    align-self: center;
}

.section-navigator a {
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    vertical-align: middle;
    white-space: nowrap;
}

.section-navigator a:hover {
    background-color: #e2e6ea;
}

/* Google Maps Styles */
.google-maps {
    position: relative;
    padding-bottom: 75%;
    height: 0;
    overflow: hidden;
}

.google-maps iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Audio Styles */
audio {
    width: 100%;
    margin: 10px 0;
}

figcaption {
    font-weight: bold;
    margin-bottom: 5px;
}

/* Audio Gallery Styles */
.audio-gallery {
    overflow-y: auto;
    padding-right: 10px;
}

.audio-gallery figure {
    margin: 0;
    padding: 10px;
    border-radius: 5px;
}

.audio-gallery figcaption {
    font-weight: bold;
    margin-bottom: 5px;
}

/* Media Queries */
@media screen and (min-width: 768px) {

    .menu-left {
        overflow-y: unset;
    }

    .menu-right {
        display: none;
    }

    .dropdown {
        display: flex;
        position: relative;
        align-items: center;
    }

    .dropdown::after {
        content: "▼";
        font-size: 0.8em;
        margin-left: -1em;
        color: white;
    }

    .navbar a:not(.logo>a) {
        padding: 10px 15px;
        margin: 0 5px;
        font-size: calc(100% + 0.5vw);
    }

    .logo {
        position: relative;
        bottom: 30px;
        width: 80px;
    }

    .logo a {
        position: fixed;
    }

    .dropdown,
    .dropdown-content {
        margin: unset;
        background-color: #1a4987;
    }

    .dropdown>a {
        font-weight: unset;
    }

    .navbar .dropdown-content {
        display: none;
        position: absolute;
        min-width: 160px;
        box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
        top: 100%;
        z-index: 1;
    }

    .menu-left {
        width: 100%;
        position: unset;
        padding-top: unset;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .menu-left a:not(.closebtn) {
        display: unset;
        width: unset;
    }

    .navbar .dropdown-content a {
        padding: 12px 16px;
        display: block;
    }

    .navbar .dropdown {
        position: relative;
    }

    .navbar .dropdown:hover .dropdown-content {
        display: block;
    }

    .menu-left .closebtn {
        display: none;
    }

    h1 {
        order: 0;
    }

    .navbar {
        order: 1;
    }

    .ticker {
        order: 2;
    }

    .section-navigator ul {
        flex-direction: row;
        justify-content: center;
        margin: 0;
    }

    h1 .small {
        font-size: unset;
    }
}

.audio-gallery {
    --sb-track-color: #232e33;
    --sb-thumb-color: #44697a;
    --sb-size: 6px;
}

.audio-gallery::-webkit-scrollbar {
    width: var(--sb-size);
}

.audio-gallery::-webkit-scrollbar-track {
    background: var(--sb-track-color);
    border-radius: 3px;
}

.audio-gallery::-webkit-scrollbar-thumb {
    background: var(--sb-thumb-color);
    border-radius: 3px;
}

@supports not selector(::-webkit-scrollbar) {
    .audio-gallery {
        scrollbar-color: var(--sb-thumb-color) var(--sb-track-color);
    }
}

iframe{
    width: 100% ; border: none;
}