html {
    scroll-behavior: smooth;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    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;
    margin: 0;
    padding: 0;
    color: #333;
    background-color: #f8f8f8;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Accessibility Focus Styles */
:focus-visible {
    outline: 2px solid #00897B;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: #6A1B9A;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    line-height: 1.2;
}

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

p {
    margin-bottom: 1em;
}

a {
    color: #6A1B9A;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

strong {
    font-weight: bold;
}

em {
    font-style: italic;
}

ul, ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

li {
    margin-bottom: 0.5em;
}

/* Layout - Topnav (Overall Page Structure) */
.site-header {
    background-color: #6A1B9A;
    color: #F3E5F5;
    padding: 1em 1.5em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-title {
    margin: 0;
    font-size: 1.8em;
}

.site-title a {
    color: #F3E5F5;
    text-decoration: none;
}

.site-title a:hover {
    text-decoration: none;
    color: #F3E5F5; /* Ensure hover doesn't change color */
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
}

.main-nav a {
    color: #F3E5F5;
    padding: 0.5em 1em;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

.main-content {
    flex-grow: 1;
    padding: 2em 1.5em;
    max-width: 1200px; /* Constrain content width */
    margin: 0 auto;
    width: 100%;
}

.site-footer {
    background-color: #333;
    color: #F3E5F5;
    padding: 2em 1.5em;
    text-align: center;
    margin-top: auto;
}

.site-footer p {
    margin: 0.5em 0;
}

.site-footer a {
    color: #00897B;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Cookie Banner Styles */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #333;
    color: #F3E5F5;
    padding: 1em 1.5em;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1em;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
}

.cookie-banner p {
    margin: 0;
    flex-grow: 1;
    text-align: center;
}

.cookie-banner button {
    background-color: #00897B;
    color: #F3E5F5;
    border: none;
    padding: 0.8em 1.5em;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.cookie-banner button:hover {
    background-color: #00695C;
}

/* Form Styles */
form {
    background-color: #fff;
    padding: 2em;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    max-width: 600px;
    margin: 2em auto;
}

form div {
    margin-bottom: 1.5em;
}

form label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: bold;
    color: #6A1B9A;
}

form input[type="text"],
form input[type="email"],
form input[type="tel"],
form textarea {
    width: 100%;
    padding: 0.8em;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form input[type="tel"]:focus,
form textarea:focus {
    border-color: #6A1B9A;
    box-shadow: 0 0 0 3px rgba(106, 27, 154, 0.2);
    outline: none;
}

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

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

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

form button[type="submit"] {
    background-color: #6A1B9A;
    color: #F3E5F5;
    border: none;
    padding: 1em 2em;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s ease;
    width: auto;
    display: block;
    margin-top: 2em;
}

form button[type="submit"]:hover {
    background-color: #5A1485;
}

.form-error {
    color: #D32F2F; /* A strong red for errors */
    font-size: 0.9em;
    margin-top: 0.5em;
    display: block;
}

form input.error,
form textarea.error {
    border-color: #D32F2F;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden; /* Ensures rounded corners on table */
}

th, td {
    padding: 1em;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #F3E5F5;
    color: #6A1B9A;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
}

tr:nth-child(even) {
    background-color: #fafafa; /* Striped rows */
}

/* Responsive Table */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    table thead, table tbody, table th, table td, table tr {
        display: block;
    }

    table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    table tr {
        border: 1px solid #ddd;
        margin-bottom: 1em;
        border-radius: 8px;
    }

    table td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    table td:last-child {
        border-bottom: none;
    }

    table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-left: 1em;
        font-weight: bold;
        color: #6A1B9A;
        text-align: left;
    }
}

/* Details/Summary Styles */
details {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 1em;
    padding: 1em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

summary {
    display: block;
    cursor: pointer;
    font-weight: bold;
    color: #6A1B9A;
    padding-right: 1.5em; /* Space for custom arrow */
    position: relative;
    user-select: none; /* Prevent text selection on click */
}

summary::-webkit-details-marker {
    display: none;
}
summary::marker {
    display: none;
}

summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    transition: transform 0.2s ease;
}

details[open] summary::after {
    content: '-';
}

details[open] summary {
    margin-bottom: 0.5em; /* Add space between summary and content when open */
}

details p {
    padding-left: 1em; /* Indent content */
    border-left: 2px solid #F3E5F5;
    margin-top: 0.5em;
}

/* Aside Styles */
aside {
    background-color: #F3E5F5;
    border-left: 4px solid #00897B;
    padding: 1.5em;
    margin: 2em 0;
    border-radius: 4px;
    color: #333;
}

aside h3 {
    color: #6A1B9A;
    margin-top: 0;
    margin-bottom: 0.8em;
}

/* Blockquote Styles */
blockquote {
    border-left: 4px solid #6A1B9A;
    padding: 0.5em 1.5em;
    margin: 2em 0;
    font-style: italic;
    background-color: #fcfcfc;
    color: #555;
}

blockquote p {
    margin: 0;
}

/* Definition List Styles */
dl {
    margin-bottom: 2em;
}

dt {
    font-weight: bold;
    color: #6A1B9A;
    margin-top: 1em;
    margin-bottom: 0.5em;
}

dd {
    margin-left: 1.5em;
    margin-bottom: 0.5em;
    padding-left: 0.5em;
    border-left: 2px solid #F3E5F5;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.button {
    display: inline-block;
    background-color: #00897B;
    color: #F3E5F5;
    padding: 0.8em 1.8em;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
}

.button:hover {
    background-color: #00695C;
    transform: translateY(-2px);
    text-decoration: none;
}

.button.primary {
    background-color: #6A1B9A;
}

.button.primary:hover {
    background-color: #5A1485;
}

.section-title {
    text-align: center;
    margin-bottom: 2em;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 0.5em;
    }

    .site-title {
        width: 100%;
        text-align: center;
        margin-bottom: 1em;
    }

    .main-nav {
        width: 100%;
        justify-content: center;
    }

    .main-nav ul {
        flex-direction: column;
        width: 100%;
        gap: 0.5em;
    }

    .main-nav li {
        width: 100%;
        text-align: center;
    }

    .main-nav a {
        display: block;
        width: 100%;
    }

    .main-content {
        padding: 1.5em 1em;
    }

    h1 { font-size: 2em; }
    h2 { font-size: 1.75em; }
    h3 { font-size: 1.5em; }

    .cookie-banner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.5em;
    }

    .cookie-banner p {
        flex-grow: unset;
        width: 100%;
    }

    .cookie-banner button {
        width: 100%;
        max-width: 200px;
    }

    form {
        padding: 1.5em;
    }

    form button[type="submit"] {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    body {
        font-family: serif;
        background-color: #fff;
        color: #000;
    }

    .site-header, .main-nav, .site-footer, .cookie-banner, form, .button, aside {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 0;
        max-width: none;
        width: auto;
    }

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

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 90%;
        word-break: break-all;
    }

    h1, h2, h3, h4, h5, h6 {
        color: #000;
        page-break-after: avoid;
    }

    p, ul, ol, dl, blockquote, table {
        orphans: 3;
        widows: 3;
        page-break-inside: avoid;
    }

    table, pre {
        page-break-inside: avoid;
    }

    table {
        border: 1px solid #ccc;
    }

    th, td {
        border: 1px solid #ccc;
        background-color: #fff;
    }

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

    blockquote {
        border-color: #ccc;
    }
}