/* Base Styles & Typography */
html {
  box-sizing: border-box;
  font-size: 16px;
  line-height: 1.5;
  scroll-behavior: smooth;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
  background-color: #FBE9E7; /* Secondary color for background */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.2;
  color: #BF360C; /* Primary color for headings */
}

h1 {
  font-size: 2.5rem;
  text-align: center;
}

h2 {
  font-size: 2rem;
  border-bottom: 2px solid #BF360C;
  padding-bottom: 0.25em;
}

h3 {
  font-size: 1.75rem;
  color: #1565C0; /* Accent color for subheadings */
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1rem;
  text-transform: uppercase;
  color: #BF360C;
}

p {
  margin-bottom: 1em;
  line-height: 1.6;
}

a {
  color: #1565C0; /* Accent color for links */
  text-decoration: none;
  transition: color 0.3s ease, text-decoration 0.3s ease;
}

a:hover {
  color: #BF360C; /* Primary color on hover */
  text-decoration: underline;
}

/* Accessibility: Focus Styles */
:focus-visible {
  outline: 3px solid #1565C0; /* Accent color for focus */
  outline-offset: 2px;
  border-radius: 3px;
}

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

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

li {
  margin-bottom: 0.5em;
}

/* Layout Mode: Split */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-grow: 1;
  flex-wrap: wrap; /* Allows columns to stack on smaller screens */
  gap: 2rem;
}

main {
  flex: 3; /* Main content takes more space */
  min-width: 0; /* Prevent overflow with flex items */
  background-color: #ffffff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

aside {
  flex: 1; /* Sidebar takes less space */
  min-width: 250px; /* Minimum width for sidebar */
  background-color: #FBE9E7; /* Secondary color for aside */
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  align-self: flex-start; /* Keeps aside at the top */
}

/* Utility Bar Navigation Pattern */
.utility-bar {
  background-color: #BF360C; /* Primary color */
  color: #ffffff;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.utility-bar .site-title {
  font-weight: bold;
  font-size: 1.5rem;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
}

.utility-bar .site-title:hover {
  color: #FBE9E7; /* Secondary color on hover */
  text-decoration: none;
}

.utility-bar nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.utility-bar nav a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
  display: block;
  transition: color 0.3s ease;
}

.utility-bar nav a:hover,
.utility-bar nav a.active {
  color: #FBE9E7; /* Secondary color on hover/active */
  text-decoration: underline;
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  color: #ffffff;
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  z-index: 1000;
  font-size: 0.9rem;
  line-height: 1.4;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

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

.cookie-banner a {
  color: #1565C0;
  text-decoration: underline;
}

.cookie-banner a:hover {
  color: #BF360C;
}

.cookie-banner button {
  background-color: #BF360C; /* Primary color */
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
  white-space: nowrap;
}

.cookie-banner button:hover {
  background-color: #a32e0a; /* Darker primary color */
  transform: translateY(-1px);
}

/* Forms */
form {
  background-color: #FBE9E7; /* Secondary color */
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  margin-top: 2rem;
}

form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
  color: #333;
}

form input[type="text"],
form input[type="email"],
form input[type="tel"],
form textarea {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
  font-family: inherit;
  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: #1565C0; /* Accent color */
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.2); /* Accent color with transparency */
  outline: none;
}

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

form button[type="submit"] {
  background-color: #BF360C; /* Primary color */
  color: #ffffff;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
  display: block;
  width: 100%;
  max-width: 300px;
  margin-top: 1.5rem;
}

form button[type="submit"]:hover {
  background-color: #a32e0a; /* Darker primary color */
  transform: translateY(-1px);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  background-color: #ffffff;
  box-shadow: 0 2px 4px 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;
  font-weight: bold;
  margin-bottom: 0.5rem;
  font-size: 1.1em;
  color: #BF360C;
}

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

th {
  background-color: #BF360C; /* Primary color for table headers */
  color: #ffffff;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.9em;
}

tr:nth-child(even) {
  background-color: #FBE9E7; /* Secondary color for even rows */
}

tr:hover {
  background-color: #ffe0b2; /* Lighter primary on hover */
}

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

details summary {
  font-weight: bold;
  cursor: pointer;
  padding: 0.5rem 0;
  color: #BF360C; /* Primary color for summary */
  list-style: none; /* Removes default arrow */
  position: relative;
}

details summary::before {
  content: '▶'; /* Custom arrow */
  position: absolute;
  left: -1.25rem;
  font-size: 0.8em;
  transition: transform 0.2s ease;
}

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

details summary::-webkit-details-marker {
  display: none; /* For WebKit browsers */
}

details p {
  padding-top: 1rem;
  margin-bottom: 0;
  border-top: 1px solid #eee;
  margin-top: 1rem;
}

/* Aside specific styles (can also be general) */
aside h3 {
  color: #BF360C; /* Primary color */
  margin-top: 0;
  border-bottom: 1px solid #BF360C;
  padding-bottom: 0.5em;
  margin-bottom: 1em;
}

aside ul {
  list-style: none;
  padding: 0;
}

aside li {
  margin-bottom: 0.75em;
}

aside a {
  display: block;
  padding: 0.5rem 0.75rem;
  background-color: #ffe0b2; /* Lighter primary */
  border-radius: 5px;
  color: #333;
  transition: background-color 0.3s ease, color 0.3s ease;
}

aside a:hover {
  background-color: #BF360C; /* Primary color */
  color: #ffffff;
  text-decoration: none;
}

/* Blockquote */
blockquote {
  background-color: #FBE9E7; /* Secondary color */
  border-left: 5px solid #1565C0; /* Accent color */
  margin: 2em 0;
  padding: 1.5em 2em;
  font-style: italic;
  color: #555;
  border-radius: 0 8px 8px 0;
  line-height: 1.6;
}

blockquote p:last-child {
  margin-bottom: 0;
}

blockquote cite {
  display: block;
  margin-top: 1em;
  font-size: 0.9em;
  text-align: right;
  color: #777;
}

/* Definition List */
dl {
  margin-bottom: 1.5rem;
  background-color: #ffffff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

dt {
  font-weight: bold;
  color: #BF360C; /* Primary color */
  margin-top: 1em;
  margin-bottom: 0.5em;
  font-size: 1.1em;
}

dd {
  margin-left: 1.5em;
  margin-bottom: 1em;
  line-height: 1.6;
}

/* Footer */
footer {
  background-color: #333;
  color: #ffffff;
  padding: 2rem 1rem;
  text-align: center;
  margin-top: auto; /* Pushes footer to the bottom */
}

footer p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

footer a {
  color: #1565C0; /* Accent color for footer links */
  text-decoration: none;
}

footer a:hover {
  color: #FBE9E7; /* Secondary color on hover */
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .utility-bar {
    flex-direction: column;
    text-align: center;
  }

  .utility-bar nav ul {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  .utility-bar nav a {
    padding: 0.75rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }

  .utility-bar nav li:first-child a {
    border-top: none;
  }

  .container {
    flex-direction: column;
    padding: 0.75rem;
    gap: 1.5rem;
  }

  main, aside {
    min-width: unset;
    width: 100%;
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.5rem;
  }

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

  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    text-align: center;
  }

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

@media (max-width: 480px) {
  html {
    font-size: 15px;
  }

  .cookie-banner p {
    font-size: 0.85rem;
  }
}