/* Basic reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Page layout */
body {
  font-family: "Georgia", "Times New Roman", serif;
  background: #1b0e07;
  color: #2b1b10;
  line-height: 1.6;
}

.page-frame {
  max-width: 900px;
  margin: 2rem auto;
  background: #f5f0de;
  border: 3px solid #4b2513;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.7);
  padding: 2rem;
  position: relative;
}

.page-frame::before {
  content: "";
  position: absolute;
  inset: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.15);
  pointer-events: none;
}

/* Header */
.page-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 2rem;
  letter-spacing: 0.06em;
  color: #5a0a0a;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-style: italic;
  font-size: 0.95rem;
  color: #4a3320;
}

/* Table of Contents */
.toc {
  margin: 1rem 0 2rem;
  padding: 1rem;
  border: 2px solid #c2a772;
  background: rgba(255, 248, 225, 0.9);
}

.toc h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: #5a0a0a;
}

.toc ol {
  margin-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.toc a {
  text-decoration: none;
  color: #3a1f0f;
}

.toc a:hover {
  text-decoration: underline;
}

/* Sections */
.rule-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-left: 4px solid #c28a4b;
  background: rgba(255, 252, 240, 0.9);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.section-header h2 {
  font-size: 1.15rem;
  color: #5a0a0a;
}

.section-body.collapsed {
  display: none;
}

/* Text formatting */
p {
  margin-bottom: 0.5rem;
}

ul, ol {
  margin: 0.4rem 0 0.8rem 1.5rem;
}

strong {
  color: #3b1616;
}

/* Callout */
.callout {
  padding: 0.4rem 0.6rem;
  border-left: 4px solid #a7361e;
  background: rgba(255, 239, 210, 0.9);
  margin: 0.4rem 0 0.8rem;
  font-style: italic;
}

/* Buttons */
.btn,
.toggle-section,
.btn-small {
  cursor: pointer;
  border: 1px solid #4b2513;
  background: linear-gradient(#d6b47c, #b4894c);
  color: #2b1b10;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset,
              0 2px 0 rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
}

.btn:hover,
.toggle-section:hover,
.btn-small:hover {
  background: linear-gradient(#e3c58f, #c59454);
}

.toggle-section {
  min-width: 2.2rem;
}

/* Footer */
.page-footer {
  border-top: 1px solid rgba(0,0,0,0.2);
  margin-top: 2rem;
  padding-top: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: #4a3320;
}

#back-to-top {
  margin-bottom: 0.5rem;
}

/* Links */
a {
  color: #7a1f10;
}

a:hover {
  color: #b32b1b;
}

/* Responsive tweaks */
@media (max-width: 600px) {
  .page-frame {
    margin: 1rem;
    padding: 1.2rem;
  }

  .section-header {
    flex-direction: row;
    align-items: flex-start;
  }

  .page-header h1 {
    font-size: 1.6rem;
  }
}