:root {
  --header-bg: #f3f1ee;
  --panel-bg: #e9eeee;
  --bar-bg: #dce5e3;
  --border: #c9cfcd;
  --accent: #007d78;
  --accent-dark: #005f5b;
  --nav-accent: #4169a1;
  --nav-accent-hover: #003f8f;
  --term-color: #52666d;
  --text: #171717;
  --muted: #626a68;
  --page-width: 88rem;
  --sidebar-width: 24rem;
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html { color-scheme: light; }

body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.site {
  width: min(100%, var(--page-width));
  min-height: 100vh;
  margin-inline: auto;
  background: #fff;
}

.site-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  min-height: 4.5rem;
  padding: .45rem .75rem;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.menu-button,
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  padding: 0;
  color: var(--accent-dark);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: .45rem;
}

.brand {
  min-width: 0;
  line-height: 1.1;
}

.brand-title {
  display: block;
  overflow: hidden;
  font-size: clamp(1.1rem, 5vw, 1.75rem);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-subtitle {
  display: block;
  margin-top: .2rem;
  color: var(--muted);
  /*font-family: Georgia, "Times New Roman", serif;*/
  font-family: "Noto Serif", Georgia, serif;
  font-size: 1rem;
  font-style: italic;
}

.portrait {
  display: none;
  width: 5rem;
  height: 5rem;
  object-fit: cover;
  background: #dedbd5;
  border: 1px solid var(--border);
}

.search {
  grid-column: 1 / -1;
  display: flex;
  min-width: 0;
  height: 2.55rem;
  background: #fff;
  border: 2px solid #b8bfd0;
  border-radius: .7rem;
  overflow: hidden;
}

.search select {
  max-width: 8rem;
  padding-inline: .55rem;
  background: #f8f8f8;
  border: 0;
  border-right: 1px solid var(--border);
}

.search input {
  min-width: 0;
  flex: 1;
  padding: .4rem .65rem;
  border: 0;
  outline: 0;
}

.search button {
  display: grid;
  place-items: center;
  width: 2.7rem;
  padding: 0;
  color: #111;
  background: transparent;
  border: 0;
}

.layout { min-height: calc(100vh - 7.05rem); }

.menu-panel {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  width: min(88vw, var(--sidebar-width));
  padding: .8rem .6rem 2rem;
  overflow-y: auto;
  background: var(--panel-bg);
  border-right: 1px solid var(--border);
  box-shadow: .4rem 0 1.2rem rgb(0 0 0 / .18);
  transform: translateX(-105%);
  transition: transform .2s ease;
}

.menu-panel.open { transform: translateX(0); }

.menu-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 .65rem;
  padding: 0 .25rem;
  font-size: 1rem;
}

.menu-tree,
.menu-tree ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-tree ul { padding-left: 1.35rem; }
.menu-tree li { margin: .08rem 0; }

.tree-row {
  display: flex;
  align-items: flex-start;
  gap: .4rem;
  min-height: 1.8rem;
}

.tree-toggle {
  flex: 0 0 1.25rem;
  width: 1.25rem;
  height: 1.65rem;
  padding: 0;
  color: #315c9c;
  background: transparent;
  border: 0;
}

.tree-toggle::before {
  display: inline-block;
  content: "▶";
  font-size: .72rem;
  transition: transform .15s ease;
}

.tree-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }

.tree-link {
  padding: .12rem 0;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.tree-link:hover,
.tree-link:focus-visible { color: var(--accent-dark); text-decoration: underline; }

.leaf::before {
  flex: 0 0 1.25rem;
  color: #2b57bd;
  content: "▧";
  text-align: center;
}

[hidden] { display: none !important; }

.overlay {
  position: fixed;
  z-index: 10;
  inset: 0;
  background: rgb(0 0 0 / .35);
}

.content { min-width: 0; }

.reader-bar {
  display: flex;
  align-items: center;
  min-height: 2.45rem;
  background: var(--bar-bg);
  border-bottom: 1px solid var(--border);
}

.reader-nav {
    display: flex;
    flex: 0 0 auto;
    gap: 0;
    padding-inline: 0.35rem;
}

.reader-nav button {
  display: grid;
  place-items: center;
  padding: 0.15rem 0.1rem;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.reader-nav button:hover {
  color: red;
}

.reader-nav svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: var(--nav-accent);
  stroke-width: 3.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.15s ease;
}

.reader-nav button:hover svg {
  stroke: var(--nav-accent-hover);
}

.breadcrumb {
  min-width: 0;
  padding: .45rem .65rem;
  overflow: hidden;
  font-size: .82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader {
  max-width: 60rem;      /* 960px */
  padding: 1rem clamp(1rem, 4vw, 2.6rem) 3rem;
}

.reader h1 {
  margin: 0 0 .65rem;
  /*font-family: Georgia, "Times New Roman", serif;*/
  font-family: "Noto Serif", Georgia, serif;
  font-size: clamp(1.7rem, 7vw, 2.55rem);
  line-height: 1.15;
}

.reader h2 {
    margin: 1.5rem 0 0.35rem;
    font-size: 1.15rem;
}

.verse-number {
  color: var(--accent-dark);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.synonyms strong { 
  color: var(--term-color);
}

.purport {
  /*font-family: Georgia, "Times New Roman", serif;*/
  font-family: "Noto Serif", Georgia, serif;
  font-size: 1.06rem;
  text-align: justify;
}

.bottom-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.bottom-nav a { color: var(--accent-dark); font-weight: 700; text-decoration: none; }

@media (min-width: 60rem) {
  .site {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .site-header,
  .construction-notice {
    flex: 0 0 auto;
  }

  .site-header {
    grid-template-columns: auto minmax(15rem, 1fr) minmax(18rem, 25rem);
    padding: .25rem .55rem;
  }

  .menu-button { display: none; }
  .portrait { display: block; }
  .search { grid-column: auto; }

  .layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .menu-panel {
    position: static;
    width: auto;
    min-height: 0;
    overflow-y: auto;
    box-shadow: none;
    transform: none;
  }

  .content {
    min-height: 0;
    overflow-y: auto;
  }

  .reader-bar {
    position: sticky;
    z-index: 5;
    top: 0;
  }

  .menu-heading,
  .overlay {
    display: none !important;
  }

  .reader {
    padding-top: 1.35rem;
  }
}

/* check later */

.reader h1.verse-heading {
  margin-bottom: 0.5rem;
  font-size: 1.65rem;
  line-height: 1.25;
}

.verse-reference {
  color: var(--nav-accent);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: normal;
}

.chapter-reference {
  font-size: 0.75em;
  font-weight: normal;
  color: dimgrey;
}

.original {
  margin-top: 0.75rem;
  margin-bottom: 0;
  font-size: 1.2rem;
  font-weight: bold;
  line-height: 1.8;
  text-align: center;
  white-space: pre-line;
}

.transliteration {
  margin-top: 0.5rem;
  margin-bottom: 1.2rem;
  /*font-family: Georgia, "Times New Roman", serif;*/
  font-family: "Noto Serif", Georgia, serif;
  font-style: italic;
  text-align: center;
  white-space: pre-line;
  line-height: normal;
}

.translation {
  margin: 0 0 1.2rem;
  /*font-family: Georgia, "Times New Roman", serif;*/
  font-family: "Noto Serif", Georgia, serif;
  font-size: 1.06rem;
  text-align: left;
}

.synonyms {
  margin-top: 0;
}

.construction-notice {
  padding: .3rem .75rem;
  color: #6b4d00;
  background: #fff3c4;
  border-bottom: 1px solid #dccb89;
  font-size: .9rem;
  font-weight: 700;
  text-align: center;
}

article h2 {
  color: #315f9b;
}

/***/
.portal-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.portal-list li {
  margin: .15rem 0;
}

.portal-list a {
  display: block;
  padding: .45rem .5rem;
  color: var(--nav-accent);
  font-weight: 700;
  text-decoration: none;
  border-radius: .25rem;
}

.portal-list a:hover,
.portal-list a:focus-visible {
  color: var(--nav-accent-hover);
  background: var(--bar-bg);
}

.reader h1.portal-heading {
  color: var(--nav-accent);
  font-size: 1.65rem;
  line-height: 1.25;
}
/***/

.chapter-header {
  margin-bottom: 2rem;
  color: var(--nav-accent);
  text-align: center;
}

.chapter-number {
  margin-bottom: .4rem;
  font-family: "Noto Serif", Georgia, serif;
  font-size: 1.5rem;
}

.reader h1.chapter-title {
  margin: 0;
  color: inherit;
  font-size: 2rem;
  line-height: 1.25;
}

.chapter-text {
  margin-bottom: 1.6rem;
  font-family: "Noto Serif", Georgia, serif;
  font-size: 1.06rem;
  line-height: 1.8;
}

.chapter-text a {
  font-weight: 700;
  text-decoration: none;
}

.chapter-text a:hover,
.chapter-text a:focus-visible {
  text-decoration: underline;
}

.chapter-translation {
  margin-left: .25rem;
}