:root {
  --bg-page: #faf8f5;
  --bg-sidebar: #f0ece3;
  --text-main: #2b2927;
  --text-muted: #5c5752;
  --accent: #6b2d2d;       /* Deep liturgical burgundy */
  --accent-hover: #8f3d3d;
  --border: #dcd5c9;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.75;
  font-size: 18px;
}

/* Modern replacement for HTML Frames: Sidebar + Main Reading Pane */
.layout-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Left Navigation Frame */
.sidebar {
  width: 320px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 2rem 1.5rem;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar h2 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.sidebar h2:first-child {
  margin-top: 0;
}

.sidebar ol {
  padding-left: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.sidebar li {
  margin-bottom: 0.45rem;
}

.sidebar a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.15s ease;
}

.sidebar a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Main Content Frame */
.content-pane {
  flex: 1;
  padding: 3.5rem 4rem;
  max-width: 860px;
  margin: 0 auto;
}

header {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 1.5rem;
  margin-bottom: 2.5rem;
}

.subtitle {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

h1 {
  font-size: 2.35rem;
  line-height: 1.2;
  color: var(--accent);
  font-weight: normal;
}

article p {
  margin-bottom: 1.5rem;
}

article a {
  color: var(--accent);
}

/* Clergy Contact Footer */
.clergy-contact {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.clergy-contact h3 {
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-weight: normal;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.contact-card {
  background: var(--bg-sidebar);
  padding: 1.25rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1.6;
}

.contact-card strong {
  display: block;
  color: var(--accent);
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

/* Responsive Layout for Phones & Tablets */
@media (max-width: 850px) {
  .layout-wrapper {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .content-pane {
    padding: 2rem 1.5rem;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* Seamless Reading Frame */
.reading-frame-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#essay-frame {
  width: 100%;
  flex: 1;
  border: none;
  background-color: var(--bg-page);
  min-height: 100vh;
}

.sidebar-home-link {
  display: block;
  font-weight: bold;
  color: var(--accent) !important;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}

.sidebar a.active-essay {
  font-weight: bold;
  color: var(--accent);
}

/* Collapsible Submenu Folders in Sidebar */
.sidebar details {
  margin: 0.25rem 0;
}

.sidebar summary {
  cursor: pointer;
  color: var(--text-main);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.15rem 0;
}

.sidebar summary::-webkit-details-marker {
  display: none;
}

.sidebar summary::after {
  content: "+";
  font-weight: bold;
  color: var(--accent);
  margin-left: 0.5rem;
}

.sidebar details[open] summary::after {
  content: "\2212";
}

.sidebar summary:hover {
  color: var(--accent);
  text-decoration: underline;
}

.sidebar details ul {
  list-style-type: disc;
  padding-left: 1.25rem;
  margin-top: 0.35rem;
  margin-bottom: 0.5rem;
  border-left: 2px solid var(--border);
}