:root {
  --color-bg: #F6F3EA;
  --color-surface: #FFFFFF;
  --color-text: #1A1E22;
  --color-muted: #4E5A63;
  --color-border: #D7D2C4;
  --color-primary: #1F6B4E;
  --color-secondary: #2B3A67;
  --color-accent: #C86B2B;
  --radius: 0.375rem;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --space: 1rem;
  --maxw: 1200px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  background-image: 
    linear-gradient(45deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.1) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.1) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--color-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: var(--radius);
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}

body {
  display: grid;
  grid-template-areas:
    "header"
    "breadcrumbs"
    "main"
    "aside"
    "footer";
  grid-template-rows: auto auto 1fr auto auto;
  min-height: 100vh;
}

header {
  grid-area: header;
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
  padding: var(--space);
  box-shadow: var(--shadow);
}

header h1 {
  margin: 0 0 var(--space) 0;
  color: var(--color-primary);
  font-size: 1.75rem;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space);
  flex-wrap: wrap;
}

nav a {
  color: var(--color-secondary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: color 0.2s, background-color 0.2s;
  text-underline-offset: 0.2em;
}

nav a:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}

nav a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

nav a[aria-current="page"] {
  background: var(--color-primary);
  color: white;
}

.breadcrumbs {
  grid-area: breadcrumbs;
  padding: 0.5rem var(--space);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.875rem;
  color: var(--color-muted);
}

.breadcrumbs a {
  color: var(--color-primary);
  text-decoration: none;
  text-underline-offset: 0.2em;
}

.breadcrumbs a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

main {
  grid-area: main;
  padding: var(--space);
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}

aside {
  grid-area: aside;
  padding: var(--space);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin: var(--space);
  box-shadow: var(--shadow);
}

footer {
  grid-area: footer;
  background: var(--color-secondary);
  color: white;
  padding: var(--space);
  text-align: center;
}

footer nav ul {
  justify-content: center;
  margin-bottom: var(--space);
}

footer nav a {
  color: white;
}

footer nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

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

h1 {
  color: var(--color-primary);
  font-size: 2rem;
  margin: 0 0 1.5rem 0;
  line-height: 1.2;
}

h2 {
  color: var(--color-secondary);
  font-size: 1.5rem;
  margin: 2rem 0 1rem 0;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.5rem;
}

h3 {
  color: var(--color-secondary);
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem 0;
}

p {
  margin: 0 0 1rem 0;
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: text-decoration-thickness 0.2s, color 0.2s;
}

a:hover {
  color: var(--color-accent);
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

caption {
  background: var(--color-primary);
  color: white;
  padding: 0.75rem;
  font-weight: bold;
  text-align: left;
  font-size: 1.1rem;
}

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

th {
  background: var(--color-bg);
  font-weight: bold;
  color: var(--color-secondary);
}

tbody tr:nth-child(even) {
  background: rgba(246, 243, 234, 0.3);
}

tbody tr:hover {
  background: rgba(31, 107, 78, 0.05);
}

details {
  margin: 1rem 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow);
}

summary {
  padding: 1rem;
  cursor: pointer;
  font-weight: bold;
  color: var(--color-secondary);
  background: var(--color-bg);
  border-radius: var(--radius) var(--radius) 0 0;
  transition: background-color 0.2s, color 0.2s;
  list-style: none;
  position: relative;
}

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

summary::before {
  content: '+';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--color-primary);
  transition: transform 0.2s;
}

details[open] summary::before {
  content: '−';
  transform: translateY(-50%) rotate(0deg);
}

summary:hover {
  background: var(--color-primary);
  color: white;
}

summary:hover::before {
  color: white;
}

summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

details[open] summary {
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--color-border);
}

details p {
  padding: 1rem;
  margin: 0;
}

blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: var(--color-surface);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--color-muted);
  box-shadow: var(--shadow);
}

blockquote p {
  margin: 0;
}

dl {
  margin: 1rem 0;
}

dt {
  font-weight: bold;
  color: var(--color-secondary);
  margin-top: 0.5rem;
}

dd {
  margin: 0.25rem 0 0.5rem 1rem;
  color: var(--color-muted);
}

@media (min-width: 768px) {
  body {
    grid-template-areas:
      "header header"
      "breadcrumbs breadcrumbs"
      "main aside"
      "footer footer";
    grid-template-columns: 1fr 300px;
    grid-template-rows: auto auto 1fr auto;
  }
  
  main {
    padding: 2rem;
  }
  
  aside {
    margin: 2rem 1rem 1rem 0;
  }
  
  h1 {
    font-size: 2.25rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
}

@media (min-width: 1024px) {
  body {
    grid-template-columns: 1fr 350px;
  }
  
  main {
    max-width: none;
  }
  
  header, .breadcrumbs {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  
  h1 {
    font-size: 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 767px) {
  table {
    font-size: 0.875rem;
  }
  
  th, td {
    padding: 0.5rem;
  }
  
  nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  nav a {
    display: block;
    text-align: center;
  }
}