* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    max-width: 100%;
}

a {
    display: flex;
    text-decoration: none;
    color: var(--text-colour);
    transition: background-color 150ms ease;
}

a:visited {
    display: flex;
    text-decoration: none;
    color: var(--text-colour);
    transition: background-color 150ms ease;
}

a:hover {
    color: var(--primary-hover);
}


/* Variables */
:root {
    --Primary-background-colour: #eaeaea;
    --card-selection: #FFFFFF;
    --text-colour: #212529;
    --muted-text-colour: #6C757D;
    --text-hover: #bdbdbd;
    --primary-button: #007BFF;
    --primary-hover: #0056B3;
    --download-button: #0dc137;
    --download-hover: #28a745;
    --accent-colour: #20C997;
    /* For upgrade prompts or subtle alerts */
    --accent-hover: #138F75;
    --border-lines: #E0E0E0;
    /* to seperate the content */
    --row-odd: #ffffff;
    --row-even: #e3e3e3;

    --dp-bg: #ffffff;
    --dp-text: #2a2e37;
    --dp-muted: #8a909a;
    --dp-border: #e6e8ee;
    --dp-shadow: 0 10px 30px rgba(0, 0, 0, .12);
    --dp-accent: #1da1f2;
    --dp-accent-hover: #168cd3;
    --dp-today-ring: #1da1f2;

}

html[data-theme="dark"] {
    --Primary-background-colour: #1a1a1d;
    --card-selection: #262626;
    --text-colour: #E8E8EE;
    --muted-text-colour: #B0B0BC;
    --border-lines: #424242;
    --primary-button: #4CAFEB;
    --primary-hover: #7CCBFF;
    --download-button: #0dc137;
    --download-hover: #28a745;
    --accent-colour: #66D1B8;
    --accent-hover: #4FB79E;
    --row-odd: #303030;
    /* darker stripe */
    --row-even: #424242;
    /* lighter stripe */

    --dp-bg: #0f172a;
    --dp-text: #e5e7eb;
    --dp-muted: #94a3b8;
    --dp-border: #1f2937;
    --dp-shadow: 0 12px 36px rgba(0, 0, 0, .45);
    --dp-accent: #2563eb;
    --dp-accent-hover: #1e40af;
    --dp-today-ring: #60a5fa;
}

body {
    background-color: var(--Primary-background-colour);
    font-family: Helvetica, Arial, sans-serif;
}

/* Typography */
h1,
h2,
h3 {
    font-family: "Montserrat", "Inter", system-ui, sans-serif;
    font-weight: 600;
}

h1 {
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    line-height: 1.25;
}

h2 {
    font-size: clamp(1.15rem, 2.2vw, 1.35rem);
    margin-top: 1rem;
}

/* navbar details */

nav {
    display: flex;
    flex-direction: column;
    background-color: var(--card-selection);
    border-bottom: 1px solid var(--border-lines);
    padding-left: 20px;
    padding-right: 20px;
}

nav li {
    display: flex;
    align-items: center;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

nav .alwaysVisible {
    margin-right: auto;
}

nav a {
    display: flex;
    text-decoration: none;
    color: var(--text-colour);
    transition: background-color 150ms ease;
}

nav a:hover {
    color: var(--primary-hover);
}

#open-sidebar-button {
    display: none;
    background: none;
    border: none;
    padding: 1em;
    margin-left: auto;
    cursor: pointer;
}

#close-sidebar-button {
    display: none;
    background: none;
    border: none;
    padding: 1em;
    cursor: pointer;
}

.icon {
    width: 32px;
    height: 32px;
}

.hidden {
    display: none;
}

#toggle-menu-button {
    display: none;
    /* default = hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 1em;
    align-items: center;
}


.mobile-only {
    display: none;
}

/* Hide the label everywhere by default */
.mode-label {
    display: none;
}

@media screen and (max-width: 900px) {
    nav {
        position: relative;
        padding-right: 0;
    }

    nav ul {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 1em;
    }

    nav.show .mode-label {
        display: inline-block;
    }

    nav ul li {
        display: none;
    }

    nav ul li.alwaysVisible {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }

    nav.show ul li {
        display: flex;
        width: 100%;
        padding: 0.5em 0;
    }

    #toggle-menu-button {
        display: flex;
        /* visible only on small screens */
    }

    #open-sidebar-button,
    #close-sidebar-button {
        background: none;
        border: none;
        padding: 1em;
        cursor: pointer;
        display: block;
    }

    #open-sidebar-button {
        margin-left: auto;
    }

    #close-sidebar-button {
        margin-left: auto;
    }

    /* Menu closed: hide the whole toggle row and its label */
    #navbar .themeToggle-li {
        display: none !important;
    }

    #navbar .mode-label {
        display: none !important;
    }

    /* Menu OPEN (nav gets .show): reveal toggle and label inside the dropdown */
    #navbar.show .themeToggle-li {
        display: flex !important;
        align-items: center;
        gap: .6rem;
    }

    #navbar.show .mode-label {
        display: inline-block !important;

    }
}

/* Checkbox */

.item-checkbox {
    display: flex;
    justify-content: center;
    align-items: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* The clickable “button” */
.theme-toggle {
    inline-size: 44px;
    block-size: 44px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--card-selection);
    cursor: pointer;
    user-select: none;
}

.theme-toggle:active {
    transform: scale(.96);
}

/* Icons */
.theme-toggle .icon {
    width: 22px;
    height: 22px;
    stroke: var(--text-colour);
    fill: none;
    stroke-width: 1.6;
    position: absolute;
    opacity: 0;
    transform: scale(.7) rotate(-10deg);
    transition: opacity .18s ease, transform .18s ease, stroke .2s ease, fill .2s ease;
}

.theme-toggle .sun circle {
    fill: currentColor;
    opacity: .7;
}

.theme-toggle .moon {
    fill: currentColor;
    stroke: none;
}

/* Show sun when unchecked, moon when checked */
#colour-toggle+.theme-toggle .sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

#colour-toggle+.theme-toggle .moon {
    opacity: 0;
}

#colour-toggle:checked+.theme-toggle .sun {
    opacity: 0;
    transform: scale(.7) rotate(10deg);
}

#colour-toggle:checked+.theme-toggle .moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Focus ring for keyboard users */
#colour-toggle:focus-visible+.theme-toggle {
    outline: 2px solid var(--primary-hover);
    outline-offset: 2px;
}

/* Feed currentColor to the icons */
.theme-toggle {
    color: var(--text-colour);
}

/* In dark mode, make the moon white (and sun strokes lighten too) */
.dark-mode .theme-toggle {
    color: #fff;
}

/* or keep using var(--text-colour) if it's light */

body {
    background-color: var(--Primary-background-colour);
    color: var(--text-colour);
}

.wrapper {
    display: grid;
    margin-top: 5rem;
    margin-left: 12rem;
    margin-right: 12rem;
    margin-bottom: 5rem;
}

@media (max-width: 940px) {
    .wrapper {
        margin-right: auto;
        margin-left: auto;
    }
}

.mode-label {
    display: none;
}

.themeToggle-li {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.mode-label {
    font-size: .95rem;
    color: var(--text-colour);
    cursor: pointer;
    user-select: none;
}

.dark-mode .mode-label {
    color: #fff;
}

.guideTemplate {
    border-radius: 15px;
    background-color: var(--card-selection);
}

.guideTitles {
    display: grid;
    font-size: larger;
    font-weight: 500;
    grid-template-columns: 1fr 1fr 1fr;
    text-align: center;
    height: 60px;
    justify-content: center;
}

.guide {
    margin: 30px;
}

.headerArticle {
    display: grid;
    gap: 20px;
}

.wrapper ul {
    margin-left: 20px;
}

.mainBodyArticle {
    display: grid;
    margin-top: 25px;
    gap: 25px;
}

.bulletpoints {
    margin-left: 20px;
}


/* footer */


.site-footer {
    background: var(--card-selection);
    color: var(--text-colour);
    border-top: 1px solid var(--border-lines);
    padding: 1.25rem clamp(1rem, 3vw, 2rem);
}

.footer-inner {
    max-width: clamp(1000px, 100vw, 1440px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 0.3fr auto;
    gap: 1rem;
    align-items: center;
}

.footer-links {
    display: flex;
    width: fit-content;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-colour);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary-hover);
}

.footer-social {
    display: flex;
    justify-content: flex-end;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--text-colour);
    text-decoration: none;
}

.social-link:hover {
    color: var(--primary-hover);
}

.footer-bottom {
    max-width: clamp(1000px, 100vw, 1440px);
    margin: .5rem auto 0;
    padding-top: .75rem;
    border-top: 1px solid var(--border-lines);
    color: var(--muted-text-colour);
    font-size: .9rem;
}

@media (max-width: 768px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: .75rem;
    }

    .footer-social {
        justify-content: flex-start;
    }
}