:root {
    --primary-color: #28a745;
    --secondary-color: #6c757d;
    --background-color: #f8f9fa;
    --text-color: #212529;
    --header-bg: #e9ecef;
    --footer-bg: #343a40;
    --footer-text: #ffffff;
    --link-color: #007bff;
    --link-visited: #6610f2;
    --font-family-sans: 'Arial', 'Helvetica', sans-serif;
    --font-family-serif: 'Georgia', 'Times New Roman', serif;
    --border-radius: 0.25rem;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-sans);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    z-index: 1050;
    text-decoration: none;
}

header {
    background-color: var(--header-bg);
    padding: 1rem 0;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.navbar {
    background-color: var(--header-bg);
}

.navbar-nav .nav-link {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    margin-right: 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    background-color: #dc3545;
}

.navbar-nav .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

h2, h3, h4, h5, h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-family: var(--font-family-serif);
    color: var(--primary-color);
}

h2 {
    font-size: 2rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

a {
    color: var(--link-color);
    text-decoration: underline;
    transition: color 0.3s ease;
}

a:visited {
    color: var(--link-visited);
}

a:hover, a:focus {
    color: darken(var(--link-color), 15%);
}

nav a {
    text-decoration: none;
}

nav a:visited {
    color: var(--link-color);
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

figure {
    margin: 1.5rem 0;
}

figcaption {
    font-size: 0.9rem;
    color: var(--secondary-color);
    text-align: center;
    margin-top: 0.5rem;
}

.thumbnail {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.thumbnail:hover {
    transform: scale(1.05);
}

.table-responsive {
    margin-bottom: 1.5rem;
}

table caption {
    caption-side: top;
    color: var(--text-color);
    font-weight: bold;
    padding: 0.5rem;
}

form {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #ffffff;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-label {
    font-weight: 500;
}

footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

footer a {
    color: #9ec5fe;
}

footer a:hover {
    color: #ffffff;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    h4 {
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 0.95rem;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    header h1 {
        font-size: 1.75rem;
    }
}

.high-contrast {
    --background-color: #000000;
    --text-color: #ffffff;
    --header-bg: #000000;
    --primary-color: #ffff00;
    --link-color: #ffff00;
    --link-visited: #00ffff;
}

.high-contrast body {
    background-color: var(--background-color);
    color: var(--text-color);
}

.high-contrast header {
    background-color: var(--header-bg);
    border-bottom: 2px solid var(--primary-color);
}

.high-contrast a {
    color: var(--link-color);
}

.high-contrast a:visited {
    color: var(--link-visited);
}

.high-contrast .navbar {
    background-color: var(--header-bg);
}

.high-contrast .navbar-nav .nav-link {
    color: var(--text-color);
}

.high-contrast .btn-primary {
    background-color: var(--primary-color);
    color: #000000;
    border-color: var(--primary-color);
}

.high-contrast img {
    filter: grayscale(100%) contrast(120%);
}

.contrast-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.bold {
    font-weight: bold;
}

.italic {
    font-style: italic;
}
