/* Root variables */
:root {
    --primary-color: #2c6adb;
    --secondary-color: #4a90e2;
    --background-color: #f5f7fa;
    --text-color: #333;
    --light-text: #555;
    --max-width: 900px;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --border-radius: 8px;
    --transition-speed: 0.3s;
}

/* Reset & basics */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    scroll-behavior: smooth;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: border-color var(--transition-speed) ease;
    border-bottom: 2px solid transparent;
}

a:hover,
a:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Header */
header {
    background-color: var(--secondary-color);
    padding: 20px 40px;
    color: white;
    text-align: center;
    user-select: none;
}

header h1 {
    margin: 0;
    font-size: 2.8rem;
    line-height: 1.1;
}

header p {
    margin: 8px 0 0 0;
    font-size: 1.2rem;
    font-weight: 500;
}



/* Sticky navigation bar */
nav {
    position: sticky;
    top: 0;
    background-color: var(--primary-color);
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 12px 0;
    flex-wrap: wrap;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: background-color var(--transition-speed);
}

nav a {
    color: white;
    font-weight: 600;
    font-size: 16px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background-color var(--transition-speed);
    user-select: none;
}

nav a:hover,
nav a:focus {
    background-color: #1a3dbb;
    outline: none;
}

nav a.active {
    background-color: #1a3dbb;
    user-select: text;
}

/* Main content container */
main {
    max-width: var(--max-width);
    margin: 40px auto;
    padding: 0 20px;
}

.hero-banner {
    background: url('banner-bg.svg') no-repeat center center;
    background-size: cover;
    color: white;
    padding: 4rem 1rem;
    text-align: center;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    /* dark overlay for readability */
}

.hero-content {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    z-index: 1;
}

.hero-banner h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.hero-banner p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Sections with tips or content */
section.tip,
section.intro,
section.content-section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 20px 30px;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);
    margin-bottom: 25px;
    transition: box-shadow var(--transition-speed);
}

section.tip:hover,
section.tip:focus-within,
section.content-section:hover,
section.content-section:focus-within {
    box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
    outline: none;
}

.faq {
    padding: 2rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.faq h2 {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.faq details {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.faq summary {
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
}

.faq p {
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* Headings */
h2 {
    color: var(--primary-color);
    margin-top: 0;
}

/* Intro section */
section.intro {
    font-size: 1.2rem;
    color: var(--light-text);
}

/* Lists on homepage or elsewhere */
.topic-list {
    margin-top: 20px;
    list-style: none;
    padding-left: 0;
    font-size: 1.2rem;
}

.topic-list li {
    margin-bottom: 12px;
}

.topic-list a {
    font-weight: 600;
}

.latest-articles {
    padding: 2rem 1rem;
    max-width: 800px;
    margin: auto;
}

.latest-articles h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-align: center;
}

.latest-articles ul {
    list-style: none;
    padding: 0;
}

.latest-articles li {
    margin: 1rem 0;
    font-size: 1.1rem;
}

.latest-articles a {
    text-decoration: none;
    color: #2c6adb;
    font-weight: 500;
}

.latest-articles a:hover,
.latest-articles a:focus {
    text-decoration: underline;
    outline: none;
}


/* SVG diagrams */
svg {
    display: block;
    margin: 20px 0;
    max-width: 100%;
    height: auto;
}

/* Video embeds */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius);
    border: none;
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 60px;
    font-size: 14px;
    user-select: none;
}

/* Accessibility focus outlines */
a:focus-visible,
button:focus-visible,
section:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}


.learning-levels {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    user-select: none;
}

.step {
    flex: 1;
    text-align: center;
    padding: 0.8rem 0;
    position: relative;
    font-weight: 600;
    color: #999;
    border-bottom: 4px solid #ccc;
    cursor: default;
}

.step.completed {
    color: #2c6adb;
    border-bottom-color: #2c6adb;
}

.step.completed::after {
    content: "✔";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #2c6adb;
    font-weight: bold;
}

/* Add arrows between steps */
.step:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    width: 30px;
    height: 4px;
    background: #ccc;
    transform: translateY(-50%);
    z-index: -1;
}

.step.completed:not(:last-child)::before {
    background: #2c6adb;
}

.level-examples .level {
    margin-bottom: 2rem;
}

.level-examples h3 {
    color: #2c6adb;
    margin-bottom: 0.5rem;
}

.level-examples ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    color: #333;
}
/* Responsive design */

@media (max-width: 768px) {
    nav {
        gap: 15px;
    }

    main {
        margin: 20px 15px;
    }

    header h1 {
        font-size: 2.2rem;
    }

    section.tip,
    section.intro,
    section.content-section {
        padding: 15px 20px;
    }
}

@media (max-width: 480px) {
    nav {
        flex-direction: column;
        gap: 12px;
        padding: 15px 0;
    }

    nav a {
        font-size: 18px;
        padding: 8px 15px;
    }

    main {
        margin: 15px 10px;
        padding: 0 10px;
    }
}

ol {
    padding-left: 1.4rem;
    margin-top: 10px;
}

ol li {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

table {
    border-collapse: collapse;
    margin-top: 15px;
    width: 100%;
    max-width: 500px;
    font-size: 1rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);
}

thead {
    background-color: var(--primary-color);
    color: white;
}

th,
td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Hamburger Styles */
.menu-toggle {
    display: none;
    background: var(--primary-color);
    color: white;
    font-size: 1.2rem;
    border: none;
    padding: 0.7rem 1rem;
    cursor: pointer;
}

/* Container to center and add max width */
.container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    line-height: 1.6;
}

/* Primary button style */
.btn-primary {
    display: inline-block;
    background-color: #4a90e2;
    color: #fff;
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
    margin-bottom: 2rem;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #357abd;
    outline: none;
}

/* Navigation styles (optional if not already styled) */
header nav a {
    color: white;
    margin-left: 1rem;
    text-decoration: none;
    font-weight: 600;
}

header nav a:hover,
header nav a:focus {
    text-decoration: underline;
    outline: none;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        width: 100%;
        text-align: left;
    }

    nav .nav-links {
        display: none;
        flex-direction: column;
        background-color: var(--primary-color);
        padding: 0;
    }

    nav .nav-links a {
        padding: 1rem;
        border-top: 1px solid #ffffff22;
        color: white;
    }

    nav .nav-links.show {
        display: flex;
    }
}

