:root {
    --primary-color: #2E7D32;
    --secondary-color: #E8F5E9;
    --accent-color: #D84315;
    --text-color: #333;
    --light-text-color: #f4f4f4;
    --border-color: #ccc;
    --background-color: #fff;
    --sidebar-width: 250px;
    --header-height: 60px;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --line-height: 1.6;
    --padding-small: 1rem;
    --padding-medium: 1.5rem;
    --padding-large: 2rem;
    --max-width: 1200px;
}

/* Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 100%; /* Base font size for rem units */
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: var(--line-height);
    color: var(--text-color);
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Accessibility Focus States */
:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover, a:focus-visible {
    text-decoration: underline;
    color: var(--accent-color);
}

h1, h2, h3, h4, h5, h6 {
    margin-top: var(--padding-medium);
    margin-bottom: var(--padding-small);
    line-height: 1.2;
    color: #222;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--padding-small);
}

ul, ol {
    margin-left: var(--padding-medium);
    margin-bottom: var(--padding-small);
}

li {
    margin-bottom: 0.5rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout: Sidebar */
.page-wrapper {
    display: flex;
    flex: 1;
}

.main-content-area {
    flex: 1;
    padding: var(--padding-medium);
    margin-left: 0; /* Adjusted for mobile */
}

/* Header (Top Navigation) */
.header {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: var(--padding-small) var(--padding-medium);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    height: var(--header-height);
}

.header .logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--light-text-color);
    text-decoration: none;
}

.header .logo:hover, .header .logo:focus-visible {
    color: var(--secondary-color);
    text-decoration: none;
}

.header .mobile-nav-toggle {
    display: block; /* Show on mobile */
    background: none;
    border: none;
    color: var(--light-text-color);
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Sidebar Navigation (Tabs) */
.sidebar {
    background-color: var(--secondary-color);
    padding: var(--padding-medium) 0;
    width: var(--sidebar-width);
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    transform: translateX(-100%); /* Hidden by default on mobile */
    transition: transform 0.3s ease-in-out;
    z-index: 999;
}

.sidebar.is-open {
    transform: translateX(0);
}

.sidebar nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar nav li a {
    display: block;
    padding: var(--padding-small) var(--padding-medium);
    color: var(--text-color);
    text-decoration: none;
    border-left: 5px solid transparent; /* Tab indicator */
    transition: background-color 0.2s, border-left-color 0.2s;
    font-weight: 500;
}

.sidebar nav li a:hover,
.sidebar nav li a:focus-visible {
    background-color: rgba(0,0,0,0.05);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
}

.sidebar nav li a.active {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    border-left-color: var(--accent-color);
    font-weight: bold;
}

.sidebar nav li a.active:hover,
.sidebar nav li a.active:focus-visible {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    border-left-color: var(--accent-color);
}

/* Main Content Area adjustments for sidebar */
@media (min-width: 768px) {
    .header .mobile-nav-toggle {
        display: none; /* Hide on desktop */
    }

    .sidebar {
        transform: translateX(0); /* Always visible on desktop */
        position: sticky;
        top: var(--header-height);
        height: calc(100vh - var(--header-height));
    }

    .main-content-area {
        margin-left: var(--sidebar-width);
    }
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    color: var(--light-text-color);
    padding: var(--padding-small) var(--padding-medium);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    z-index: 2000;
    font-size: 0.9rem;
    gap: 1rem;
}

.cookie-banner p {
    margin: 0;
    flex: 1;
    min-width: 250px;
}

.cookie-banner a {
    color: var(--accent-color);
    text-decoration: underline;
}

.cookie-banner .button-group {
    display: flex;
    gap: 0.5rem;
}

.cookie-banner button {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    border: none;
    padding: 0.7rem 1.2rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background-color 0.2s, transform 0.1s;
}

.cookie-banner button:hover, .cookie-banner button:focus-visible {
    background-color: var(--accent-color);
    transform: translateY(-1px);
}

/* Forms */
form {
    margin-top: var(--padding-medium);
    padding: var(--padding-medium);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--secondary-color);
}

.form-group {
    margin-bottom: var(--padding-small);
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-family);
    font-size: 1rem;
    background-color: var(--background-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
    outline: none;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input[type="checkbox"] {
    margin-right: 0.5rem;
}

.form-group.checkbox-group label {
    display: inline-block;
    font-weight: normal;
}

.form-group .error-message {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-top: 0.4rem;
    display: block;
}

button[type="submit"] {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    border: none;
    padding: 0.9rem 1.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background-color 0.2s, transform 0.1s;
}

button[type="submit"]:hover,
button[type="submit"]:focus-visible {
    background-color: var(--accent-color);
    transform: translateY(-2px);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--padding-medium);
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden; /* For rounded corners */
}

table thead {
    background-color: var(--primary-color);
    color: var(--light-text-color);
}

table th,
table td {
    padding: var(--padding-small);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    font-weight: 600;
}

table tbody tr:nth-child(odd) {
    background-color: var(--secondary-color); /* Striped rows */
}

table tbody tr:hover {
    background-color: rgba(46, 125, 50, 0.1);
}

/* Responsive Tables */
@media screen and (max-width: 600px) {
    table {
        border: 0;
    }
    table thead {
        display: none;
    }
    table tr {
        display: block;
        margin-bottom: 0.8rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
    }
    table td {
        display: block;
        text-align: right;
        border-bottom: 1px dotted var(--border-color);
    }
    table td:last-child {
        border-bottom: 0;
    }
    table td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        text-transform: uppercase;
        margin-right: 1rem;
    }
}

/* Details/Summary */
details {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: var(--padding-small);
    overflow: hidden;
}

summary {
    display: block;
    padding: var(--padding-small) var(--padding-medium);
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-color);
    list-style: none; /* Hide default marker */
    position: relative;
    transition: background-color 0.2s;
}

summary:hover, summary:focus-visible {
    background-color: rgba(46, 125, 50, 0.1);
    outline: none;
}

summary::before {
    content: '+'; /* Custom open/close arrow */
    position: absolute;
    right: var(--padding-small);
    font-size: 1.2rem;
    line-height: 1;
    transition: transform 0.2s;
}

details[open] > summary::before {
    content: '-';
    transform: rotate(0deg);
}

details[open] > summary {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--padding-small);
}

details p {
    padding: 0 var(--padding-medium) var(--padding-small);
}

/* Aside */
aside {
    background-color: var(--secondary-color);
    border-left: 5px solid var(--accent-color);
    padding: var(--padding-small) var(--padding-medium);
    margin: var(--padding-medium) 0;
    border-radius: 4px;
}

aside h3 {
    color: var(--primary-color);
    margin-top: 0;
}

/* Blockquote */
blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: var(--padding-small);
    margin: var(--padding-medium) 0;
    font-style: italic;
    color: #555;
}

blockquote cite {
    display: block;
    margin-top: 0.5rem;
    font-style: normal;
    text-align: right;
    color: #777;
    font-size: 0.9rem;
}

/* Definition List */
dl {
    margin-bottom: var(--padding-medium);
}

dt {
    font-weight: bold;
    margin-top: var(--padding-small);
    color: var(--primary-color);
}

dd {
    margin-left: var(--padding-medium);
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    background-color: #333;
    color: var(--light-text-color);
    padding: var(--padding-medium);
    text-align: center;
    margin-top: auto; /* Pushes footer to the bottom */
    font-size: 0.9rem;
}

.footer p {
    margin: 0;
}

.footer a {
    color: var(--accent-color);
    text-decoration: underline;
}

.footer a:hover, .footer a:focus-visible {
    color: var(--light-text-color);
}

/* Utility Classes */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--padding-small);
}

.text-center {
    text-align: 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;
}

/* Print Styles */
@media print {
    body {
        background-color: #fff;
        color: #000;
        font-size: 12pt;
    }

    .header, .sidebar, .cookie-banner, .footer, .mobile-nav-toggle,
    button[type="submit"], input[type="text"], input[type="email"], textarea {
        display: none !important;
    }

    .page-wrapper {
        display: block;
    }

    .main-content-area {
        margin-left: 0;
        padding: 0;
        width: 100%;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    /* Print specific adjustments for tables */
    table, table tr, table td {
        border: 1px solid #999 !important;
        background-color: #fff !important;
        display: table-cell !important; /* Override responsive table styles */
        width: auto !important;
        text-align: left !important;
        padding: 0.5rem !important;
    }
    table th, table td {
        border-bottom: 1px solid #999 !important;
    }
    table thead {
        display: table-header-group !important;
        background-color: #eee !important;
        color: #000 !important;
    }
    table td::before {
        display: none !important;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    p, blockquote, ul, ol, dl {
        page-break-inside: avoid;
    }
}