/* General Styles */
:root {
    --primary-color: #263238;
    --secondary-color: #ECEFF1;
    --accent-color: #FFB300;
    --text-color: #333;
    --light-text-color: #666;
    --white: #FFF;
    --dark-grey: #455A64;
    --border-color: #CFD8DC;
    --font-family-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    --line-height-body: 1.6;
    --line-height-heading: 1.2;
    --spacing-unit: 1rem;
}

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

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

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

/* Docstyle Layout */
body > header {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: var(--spacing-unit) calc(2 * var(--spacing-unit));
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body > header h1 {
    margin: 0;
    font-size: 2.5rem;
    line-height: var(--line-height-heading);
    color: var(--accent-color);
}

body > header p {
    margin-top: 0.5rem;
    font-size: 1.1rem;
    color: var(--secondary-color);
}

main {
    flex: 1; /* Allows main content to grow and push footer down */
    max-width: 800px; /* Docstyle content width */
    margin: 2rem auto;
    padding: 0 var(--spacing-unit);
    background-color: var(--white);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 2rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-sans);
    line-height: var(--line-height-heading);
    margin-top: 2em;
    margin-bottom: 1em;
    color: var(--dark-grey);
}

h1 { font-size: 2.2rem; color: var(--primary-color); }
h2 { font-size: 1.8rem; border-bottom: 2px solid var(--border-color); padding-bottom: 0.5em; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1em;
    line-height: var(--line-height-body);
}

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

a:hover {
    text-decoration: underline;
    color: #E6A200; /* Slightly darker accent for hover */
}

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

li {
    margin-bottom: 0.5em;
}

strong {
    font-weight: bold;
    color: var(--dark-grey);
}

em {
    font-style: italic;
}

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

/* Navigation (Footer-Heavy) */
footer {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 2rem var(--spacing-unit);
    text-align: center;
    margin-top: 3rem;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

footer .footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem 3rem; /* Row gap, column gap */
    margin-bottom: 2rem;
}

footer .footer-nav div {
    min-width: 150px; /* Ensure columns don't get too narrow */
    text-align: left;
}

footer .footer-nav h4 {
    color: var(--accent-color);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--dark-grey);
    padding-bottom: 0.5rem;
}

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

footer .footer-nav ul li {
    margin-bottom: 0.75rem;
}

footer .footer-nav a {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease-in-out;
}

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

footer .footer-bottom {
    border-top: 1px solid var(--dark-grey);
    padding-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--light-text-color);
}

footer .footer-bottom p {
    margin: 0.5rem 0;
}

/* Cookie Banner Styles */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--dark-grey);
    color: var(--secondary-color);
    padding: 1rem 2rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    font-size: 0.9rem;
}

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

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

.cookie-banner .button {
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out;
    white-space: nowrap; /* Prevent button text from wrapping */
}

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

/* Form Styles */
form {
    background-color: var(--secondary-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-top: 2rem;
}

form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--dark-grey);
}

form input[type="text"],
form input[type="email"],
form input[type="tel"],
form textarea {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: var(--font-family-sans);
    transition: border-color 0.2s ease-in-out;
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form input[type="tel"]:focus,
form textarea:focus {
    border-color: var(--accent-color);
    outline: none;
}

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

form button[type="submit"] {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background-color 0.2s ease-in-out;
}

form button[type="submit"]:hover {
    background-color: var(--dark-grey);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    background-color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden; /* Ensures rounded corners apply to content */
}

table caption {
    caption-side: top;
    text-align: left;
    margin-bottom: 1rem;
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--dark-grey);
}

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

th {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
}

tr:nth-child(even) {
    background-color: var(--secondary-color);
}

tr:hover {
    background-color: #E0E0E0; /* Lighter grey on hover */
}

/* Details/Summary Styles */
details {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-bottom: 1rem;
    padding: 1rem;
}

summary {
    font-weight: bold;
    cursor: pointer;
    color: var(--dark-grey);
    padding: 0.5rem 0;
    list-style: none; /* Remove default marker */
}

summary::-webkit-details-marker {
    display: none; /* Hide for Webkit browsers */
}

summary::before {
    content: "▶"; /* Custom triangle icon */
    margin-right: 0.75rem;
    transition: transform 0.2s ease-in-out;
    display: inline-block;
}

details[open] summary::before {
    transform: rotate(90deg);
}

details[open] {
    padding-bottom: 1rem;
}

details p {
    margin-top: 1rem;
    margin-bottom: 0;
    padding-left: 1.5rem; /* Indent content */
    border-left: 3px solid var(--accent-color);
}

/* Aside Styles */
aside {
    background-color: var(--secondary-color);
    border-left: 5px solid var(--accent-color);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
    color: var(--dark-grey);
    font-size: 0.95rem;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.05);
}

aside h3 {
    color: var(--primary-color);
    margin-top: 0;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* Blockquote Styles */
blockquote {
    border-left: 5px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background-color: var(--secondary-color);
    font-style: italic;
    color: var(--dark-grey);
    position: relative;
    border-radius: 0 8px 8px 0;
}

blockquote::before {
    content: "“";
    font-size: 4em;
    color: var(--accent-color);
    position: absolute;
    left: 0.5rem;
    top: 0.5rem;
    line-height: 1;
    opacity: 0.2;
}

blockquote p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.5;
    padding-left: 2rem; /* Make space for quote mark */
}

blockquote cite {
    display: block;
    text-align: right;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--light-text-color);
}

/* Definition List Styles */
dl {
    margin-bottom: 2rem;
    background-color: var(--secondary-color);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

dt {
    font-weight: bold;
    color: var(--dark-grey);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    border-bottom: 1px dotted var(--border-color);
    padding-bottom: 0.25rem;
}

dd {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    line-height: var(--line-height-body);
    color: var(--text-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    body > header {
        padding: var(--spacing-unit);
    }

    body > header h1 {
        font-size: 2rem;
    }

    main {
        margin: 1rem auto;
        padding: 1.5rem;
        border-radius: 0; /* Remove rounded corners on small screens */
        box-shadow: none; /* Remove box shadow on small screens */
    }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.3rem; }

    .cookie-banner {
        flex-direction: column;
        padding: 1rem;
    }

    .cookie-banner p {
        text-align: left;
    }

    .cookie-banner .button {
        width: 100%;
        text-align: center;
    }

    footer .footer-nav {
        flex-direction: column;
        gap: 2rem;
    }

    footer .footer-nav div {
        text-align: center;
    }

    footer .footer-nav h4 {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0.5rem;
    }

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

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

    tr {
        border: 1px solid var(--border-color);
        margin-bottom: 1rem;
        border-radius: 8px;
        overflow: hidden;
    }

    td {
        border: none;
        border-bottom: 1px solid var(--border-color);
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-left: 1rem;
        font-weight: bold;
        text-align: left;
        color: var(--dark-grey);
    }

    td:last-child {
        border-bottom: 0;
    }
}