
:root {
  --off-white: rgb(221, 221, 221);
  --light-off-white: rgb(241, 241, 241);
  --lighter-off-white: #f9f9f9;
  --white: #fff;
  --black: rgb(0, 0, 0);
  --dark-gray: #5a5a5a;
  --darker-gray: #181a1b;
  --charcoal: #333;
  --deep-anthracite: #131415;
  --dark-card-bg: #1c1e24;
  --dark-orange: #8B4000;
  --orange: #D55600;
  --light-orange: #FFAC1C;
  --orange-yellow: #BD970D;
  --orange-yellow-rgb: 189, 151, 13;
  --light-gray: #8f8f8f;
  --lighter-gray: #ababab;
  --dark-blue: #3344C3;
  --darker-blue: #1427B3;
  --dark-brown: #3F3234;
  --darker-brown: #201B1F;
  --red: #CC0000;
  --darker-red: #A70000;
  --gold: #c4a853;
  --dark-gold: #B49B56;
  --dark-gold-rgb: 180, 155, 86;
  --darker-gold: #947a35;
  --darker-gold-rgb: 148, 122, 53;
  --deep-bronze: #7a622b;
  --slate-gray: #444444;
  --card-bg: #fafbfc;

  --sidebar-background: #f0f0f0;
  --sidebar-border: #e0e0e0;
  --sidebar-title: gray;
  --sidebar-text: var(--dark-brown);
  --sidebar-text-hover: #e2e2e2;

  --modal-background-color: rgba(0, 0, 0, 0.5);
  --modal-shadow: rgba(0, 0, 0, 0.3);
  --modal-icon: var(--light-gray);
  --modal-icon-hover: black;

  --left-sidebar-width: 200px;
  --right-sidebar-width: 250px;
  --sidebar-toggle-width: 30px;
  --sidebar-padding: 1rem;
  --base-content-width: 45rem; /* Base width for the sutta text content */
}

html.light,
body.light {
  background-color: var(--lighter-off-white);
}

html.dark,
body.dark {
  background-color: var(--deep-anthracite);

  --sidebar-background: #0e0e0e;
  --sidebar-border: #1e1e1e;
  --sidebar-title: #e0e0e0;
  --sidebar-text: #bbbbbb;
  --sidebar-text-hover: #1e1e1e;

  --modal-background-color: rgba(255, 255, 255, 0.35);
  --modal-shadow: rgba(0, 0, 0, 0.6);
  --modal-icon: var(--light-gray);
  --modal-icon-hover: white;
}

@font-face {
  font-family: "Roboto";
  src: url("Roboto-Regular.ttf");
}

@font-face {
  font-family: "RobotoSerif";
  src: url("roboto-lightest.woff");
}

@font-face {
  font-family: "RobotoSerif Medium";
  src: url("RobotoSerif-Medium.ttf");
}

@font-face {
  font-family: "RobotoSerif Bold";
  src: url("RobotoSerif-Bold.ttf");
}

@font-face {
  font-family: "Roboto Medium";
  src: url("Roboto-Medium.ttf");
}

b {
  font-family: "RobotoSerif Medium";
  font-weight: normal;
}

body {
  margin: 0;
  font-family: "RobotoSerif", serif;

  @media only screen and (max-width: 1000px) {
    padding-top: 50px;
  }
}

/* For body padding on smaller screens, if needed */
@media only screen and (max-width: 1000px) {
  body {
    padding-top: 50px; /* This was the original rule, preserved */
  }
}

.hide {
  display: none !important;
}

.disabled {
  opacity: 0.25 !important;
  cursor: default !important;
}

#filter-form-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
}

#filter-form {
  display: flex;
  align-items: center;
  border: 2px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  background-color: var(--card-bg);
  border-radius: 5px;
  padding: 0.5em;
  width: 350px;
  cursor: pointer;
  transition: border 250ms ease, box-shadow 250ms ease, background-color 250ms ease;
}

#filter-form:hover,
#filter-form:focus-within {
  background: #ffffff;
  box-shadow: 0 1px 5px 0 #898787;
  border-color: transparent;
}

.dark #filter-form:hover,
.dark #filter-form:focus-within {
  background-color: var(--off-white);
  border-color: transparent;
}

.filter-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.5em;
}

.filter-icon svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: var(--black);
  transition: fill 250ms ease;
}

.dark .filter-icon svg {
  fill: var(--off-white);
}

.dark #filter-form:hover svg,
.dark #filter-form:focus-within svg {
  fill: var(--darker-brown);
}

#filter-bar {
  flex-grow: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--black);
  background-color: transparent;
  cursor: pointer;
  transition: color 250ms ease;
}

#filter-bar::placeholder {
  color: var(--dark-brown);
  transition: color 250ms ease;
}

.dark #filter-bar::placeholder {
  color: var(--off-white);
}

.dark #filter-form:hover #filter-bar::placeholder,
.dark #filter-form:focus-within #filter-bar::placeholder {
  color: var(--darker-brown);
}

.dark #filter-bar {
  color: var(--light-off-white);
}

.dark #filter-form:hover #filter-bar,
.dark #filter-form:focus-within #filter-bar {
  color: var(--darker-brown);
}

.dark #filter-form {
  border-color: var(--slate-gray);
  box-shadow: 0 2px 3px rgba(255, 255, 255, 0.1);
  background-color: var(--dark-card-bg);
}

#filter-bar:focus-visible {
  outline: none;
}

.dark .highlight,
.dark .comment-highlight {
  font-family: "RobotoSerif Medium";
  color: var(--white);
  /* White text for dark background */
  box-shadow: 0px 2px 3px rgba(255, 255, 255, 0.2);
  font-size: 1.1rem;
  display: inline;
}

/* Add margin-bottom to '.dark .comment-highlight' lost because of 'display: inline' above */
.dark .comment-highlight:after {
  content: '';
  margin-bottom: 1rem;
  display: block;
}

.light .highlight {
  font-family: "RobotoSerif Medium";
  box-shadow: 0px 2px 3px rgba(0, 0, 0, .2);
  font-size: 1.1rem;
}

.light .comment-highlight {
  font-family: "RobotoSerif Medium";
  font-size: 1.1rem;
}


.light .comment-highlight>span {
  display: inline;
  box-shadow: 0px 2px 3px rgba(0, 0, 0, .2);
}

.go-button {
  border-radius: 0;
  border: 1px solid var(--dark-gray);
  border-left: 0px;
}

.dark .go-button {
  border-color: var(--off-white);
  background-color: var(--dark-blue);
  color: var(--off-white);
}

.dark .go-button:hover {
  background-color: var(--light-gray);
}


.icon-button {
  color: var(--dark-brown);
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
}

.dark .icon-button {
  color: #AAA;
}

.icon-button:hover {
  color: #201B1F;
}

.dark .icon-button:hover {
  color: white;
}

.tooltip {
  visibility: hidden;
  position: absolute;
  top: 120%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--light-off-white);
  color: var(--darker-gray);
  border: 1px solid gray;
  text-align: center;
  border-radius: 3px;
  padding: 5px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
}

#filter-form:hover .tooltip {
  transition: none;
}

.dark .tooltip {
  background-color: var(--dark-gray);
  color: var(--off-white);
}

.icon-button:hover .tooltip,
#filter-form:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

p {
  margin-bottom: 1.5rem;
}

#home-controls {
  padding-bottom: 1rem;
}

/* START OF MODIFIED SECTION FOR APP-CONTENT PADDING */
#app-content {
  line-height: 1.5;
  /* Default padding for screens < 1000px or when JS is disabled */
  padding: 2rem; 
  transition: padding-left 0.3s ease, padding-right 0.3s ease, max-width 0.3s ease; /* Smooth transition */
}

@media only screen and (min-width: 1000px) {
  #app-content {
    /* Default padding when both sidebars are potentially visible */
    padding-top: 2rem; /* Keep top/bottom padding */
    padding-bottom: 2rem; /* Keep top/bottom padding */
    padding-left: calc(var(--left-sidebar-width) + 2rem); /* Base padding next to left sidebar */
    padding-right: calc(var(--right-sidebar-width) + 2rem); /* Base padding next to right sidebar */
    max-width: var(--base-content-width); /* Default max-width when both sidebars are open */
    margin-left: auto;
    margin-right: auto;
  }

  body.left-sidebar-is-collapsed #app-content {
    padding-left: 2rem; /* Collapse left padding when left sidebar is hidden */
    max-width: calc(var(--base-content-width) + var(--left-sidebar-width)); /* Expand by left sidebar width */
  }

  body.right-sidebar-is-collapsed #app-content {
    padding-right: 2rem; /* Collapse right padding when right sidebar is hidden */
    max-width: calc(var(--base-content-width) + var(--right-sidebar-width)); /* Expand by right sidebar width */
  }

  body.left-sidebar-is-collapsed.right-sidebar-is-collapsed #app-content {
    max-width: calc(var(--base-content-width) + var(--left-sidebar-width) + var(--right-sidebar-width)); /* Expand by both sidebar widths */
  }
}
/* END OF MODIFIED SECTION FOR APP-CONTENT PADDING */

#app-content ul {
  margin-top: 0rem;
  padding: 0rem;
  list-style-type: none;
}

#app-content ul li {
  line-height: 1.3;
}

.lists {
  display: flex;
  flex-direction: row;
  column-gap: 0rem;
  font-size: 85%;
}

.suttas {
  width: 11rem;
}

.vinaya {
  display: flex;
  flex-direction: row;
  gap: 1.2rem;
}

.abbr {
  font-family: monospace;
  background-color: rgb(220, 220, 231);
  padding: 1px 4px;
  border: solid 0px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 105%;
}

.dark .abbr {
  background-color: var(--dark-blue);
}

@media only screen and (max-width: 730px) {

  .lists,
  .vinaya {
    flex-direction: column;
  }
}

p.sc-link {
  text-align: center;
  margin-bottom: 0rem !important;
  margin-top: 1rem !important;
}

span.pli-lang,
span.eng-lang {
  display: block;
}

.highlight>span.eng-lang {
  display: inline;
}

.highlight>span.pli-lang {
  margin-top: .4rem;
}

.eng-lang .searchTerm,
.comment-highlight .searchTerm {
  color: var(--darker-gold);
  font-family: "RobotoSerif Bold";
}

.comment-highlight a .searchTerm {
  text-decoration: underline;
}

.dark .eng-lang .searchTerm,
.dark .comment-highlight .searchTerm {
  color: var(--gold);
}

.pli-lang .searchTerm {
  color: var(--orange);
  font-weight: bold;
  font-size: 1.1rem;
}

p,
dt,
li,
dd,
h1,
h2,
h3,
h4,
h5 {
  color: var(--black);
}

.dark p,
.dark dt,
.dark li,
.dark dd,
.dark h1,
.dark h2,
.dark h3,
.dark h4,
.dark h5 {
  color: var(--off-white);
}

p .pli-lang,
dt .pli-lang,
li .pli-lang,
dd .pli-lang,
h1 .pli-lang,
h2 .pli-lang,
h3 .pli-lang,
h4 .pli-lang,
h5 .pli-lang {
  font-family: 'Times New Roman', Times, serif;
  color: var(--dark-orange);
}

.dark p .pli-lang,
.dark dt .pli-lang,
.dark li .pli-lang,
.dark dd .pli-lang,
.dark h1 .pli-lang,
.dark h2 .pli-lang,
.dark h3 .pli-lang,
.dark h4 .pli-lang,
.dark h5 .pli-lang {
  color: var(--light-orange);
}

a {
  color: var(--dark-blue);
}

.dark a {
  color: rgb(122, 122, 249);
}

dt {
  font-weight: bold;
}

.button-area {
  position: fixed;
  right: 10px;
  top: 10px;
}

.hide-pali p .pli-lang,
.hide-pali h2 .pli-lang,
.hide-pali h3 .pli-lang,
.hide-pali h4 .pli-lang,
.hide-pali h5 .pli-lang,
.hide-pali li .pli-lang {
  display: none !important;
}

.pli-lang {
  transition: opacity 250ms ease, height 250ms ease;
}

.hide-pali .pli-lang {
  opacity: 0;
  height: 0;
  overflow: hidden;
}

#footer {
  text-align: center;
}

#footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.left-align {
  text-align: left;
}

#sutta h2,
#whats-new h2 {
  font-size: 1.5rem;
  line-height: 1;
  margin: 1.5rem 0;
}

#sutta.hide-pali p span.eng-lang {
  display: inline !important;
}

#sutta.hide-pali p {
  margin: 0px 0px 0.8rem 0rem;
}

#sutta.hide-pali blockquote.gatha p span.verse-line span.eng-lang {
  display: inline-block !important;
  margin-bottom: 0rem;
}

span.eng-lang {
  margin-bottom: 0.4rem;
}

header ul {
  list-style: none;
  padding: 0;
  margin-top: 0;
}

header ul li {
  text-align: center;
  color: #5a5a5a;
}

@media only screen and (max-width: 975px) {
  body {
    margin: 1rem 0.5rem;
  }

  .button-area {
    right: 1px;
    top: 1px;
  }
}

.byline {
  text-align: right;
  font-style: italic;
  font-size: 0.8rem;
}

br {
  line-height: 0px;
}

.links-area {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  justify-content: left;
  align-items: center;
  min-height: 45px;
}

.links-area a {
  display: flex;
  transition: all ease 0.5s;
}

.links-area a img {
  filter: opacity(60%);
}

.links-area a:hover img {
  filter: opacity(100%);
}

.dark .links-area a img {
  filter: invert(90%) opacity(100%);
}

.dark .info-btn {
  filter: invert(100%);
}

#buttonsContainer,
#epubButtonsContainer {
  display: flex;
}

#epubButtonsContainer {
  margin-top: .2rem;
}

#infoButton,
#epubInfoButton {
  border: none;
  cursor: pointer;
  outline: none;
  background-color: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
}

#infoButton img,
#epubInfoButton img {
  width: 14px;
}

.navigation {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

@media only screen and (max-width: 475px) {
  .navigation {
    flex-direction: column !important;
    row-gap: 1rem;
  }
}

.button-container {
  text-align: center;
  /* Center the contents horizontally */
}

.side-by-side .segment {
  display: flex;
  flex-direction: row;
  column-gap: 1rem;
}

.side-by-side .pli-lang,
.side-by-side .eng-lang {
  width: 48%;
}

.segment {
  word-break: break-word
}

.comment-text {
  position: absolute;
  z-index: 10;
  left: 50%;
  display: none;
  padding: 4px;
  box-sizing: border-box;
  width: 400px;
  margin-left: -150px;
  content: attr(data-tooltip);
  white-space: normal;
  border-radius: 8px;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  text-align: justify;
  font-size: 14px;
  font-weight: normal;
  /* Default light theme colors */
  color: #000000;
  background-color: #f5f4ef;
}

/* Override for dark theme */
.dark .comment-text {
  color: #FFFFFF;
  background-color: #413f3f;
}

.notification-box {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #28a745;
  /* Green background */
  color: white;
  padding: 10px;
  border-radius: 5px;
  display: none;
  /* Initially hidden */
  z-index: 1000;
  /* Ensure it appears above other content */
  text-align: center;
  min-width: 200px;
  /* Adjust as needed */
  opacity: 0;
  /* Start fully transparent */
  transition: opacity 0.5s ease-in-out;
  /* Smooth transition for the opacity */
}

#cacheButton,
.hide-button {
  position: relative;
  color: var(--charcoal);
  cursor: pointer;
  top: -10%;
  margin-left: auto;
  margin-right: 0em;
  padding: .1rem 0;
  font-size: .8rem;
  font-family: "Roboto";
  border: 1px solid gray;
  border-radius: 3px;
  width: 82px;
  transition: background-color 250ms ease, color 250ms ease;
}

#cacheButton:hover,
.hide-button:hover {
  background-color: #fff;
}

.dark #cacheButton {
  background-color: var(--dark-card-bg);
  color: var(--off-white);
  border-color: var(--off-white);
  transition: background-color 250ms ease, color 250ms ease;
}

.dark #cacheButton:hover {
  background-color: var(--light-off-white);
  color: var(--darker-brown);
}

.hide-button {
  padding: .2rem;
}

.dark .hide-button {
  background-color: var(--dark-card-bg);
  color: var(--off-white);
}

.dark .hide-button:hover {
  background-color: var(--light-off-white);
  color: var(--darker-brown);
}


#container {
  position: relative;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  max-width: 150px;
}

.info-notification-box {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background-color: grey;
  /* Green background */
  color: white;
  padding: 10px;
  border-radius: 5px;
  display: none;
  /* Initially hidden */
  z-index: 1000;
  /* Ensure it appears above other content */
  white-space: pre-line;
  /* min-width: 200px; */
  max-width: 400px;
  /* Adjust as needed */
}

.comment {
  display: inline-block;
  margin-right: 4px;
  color: #007bff;
  /* Link color */
  cursor: pointer;
  /* Indicates it's clickable */
  vertical-align: super;
  /* Makes the number a superscript */
  font-size: 0.75em;
  /* Adjusts the font size to match superscript style */
}

#suttanav {
  position: fixed;
  top: -50px;
  width: 100%;
  max-width: 45rem;
  /* Match the max-width of #sutta */
  background: #333;
  color: white;
  text-align: center;
  padding: 10px;
  transition: top 0.3s;
  box-sizing: border-box;
  /* Include padding and border in the element's width */
  left: 50%;
  /* Center the element */
  transform: translateX(-50%);
  /* Center the element */
}

.no-results {
  text-align: center;
  margin: 1rem 0 1rem 0;
}

#bookmarks>details> :not(:last-child) {
  margin-bottom: .5rem;
}

#bookmarks>* {
  margin: .5rem 0;
}

.bookmark-container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  box-shadow: 0 0 2px 0 rgba(0, 0, 0, .40);
  border-radius: 2px;
}

.bookmark-container p {
  margin: 0;
  flex-grow: 1;
  max-width: 70%;
}

.bookmark-buttons {
  display: flex;
  justify-content: right;
  align-items: center;
  flex-grow: 1;
  gap: 1rem;
}

.bookmark-buttons>* {
  max-width: 60%;
}

.bookmark-buttons>a {
  text-wrap: nowrap;
}

.label-checkbox-container {
  display: flex;
  flex-direction: column;
  margin-top: 5px;
  gap: .3rem;
  /* Add some space between each checkbox-label pair */
}

.label-checkbox-container div {
  display: flex;
  align-items: center;
  gap: .3rem;
}

.label-checkbox-container input[type="checkbox"] {
  margin-right: 5px;
  /* Add some space between the checkbox and the label */
}

.label-checkbox-container label {
  margin-left: 0;
  /* Remove any left margin */
}

.dark .bookmark-text {
  color: var(--off-white);
}

#commentsArea summary {
  font-size: 1.1em;
  font-weight: bold;
  padding: 4px;
}

.dark #commentsArea summary {
  color: var(--off-white);
}

.whats-new-container {
  display: flex;
  gap: 8px;
  padding: 8px;
  /* css hack to not hide .sutta-box's box-shadow because of hidden overflow */
  margin: -8px;
  /* css hack to not hide .sutta-box's box-shadow because of hidden overflow */
  overflow-x: auto;
}

.whats-new-container::-webkit-scrollbar {
  height: 10px;
  border-radius: 4px;
}

.whats-new-container::-webkit-scrollbar-track {
  background: #ddd;
  border-radius: 4px;
  height: 10px;
}

.whats-new-container::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 4px;
  height: 10px;
}

.whats-new-container::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

.sutta-box {
  flex: 1 0 auto;
  width: 180px;
  padding: 8px;
  text-align: left;
  border-radius: 8px;
  transition: background-color 250ms ease, color 250ms ease;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  background-color: var(--card-bg);
  transition: box-shadow 250ms ease, color 250ms ease, background-color 250ms ease;
  text-decoration: none !important;
}

.sutta-box:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
  background-color: #ffffff;
}

.dark .sutta-box {
  background-color: var(--dark-card-bg);
  border-color: var(--slate-gray);
}

.dark .sutta-box:hover {
  background-color: var(--light-off-white);
  transform: initial;
}

.dark .sutta-box:hover .sutta-card-title {
  color: var(--darker-brown);
}

.dark .sutta-box .sutta-pali-title {
  color: var(--orange-yellow);
}

.dark .sutta-box:hover .sutta-pali-title {
  color: var(--deep-bronze);
}

.sutta-card-title {
  margin: 0;
  font-size: 1.1em;
  color: var(--darker-blue);
  transition: color 250ms ease;
  font-family: "RobotoSerif Medium";
  font-weight: 500;
}

.sutta-pali-title {
  margin-top: 5px;
  font-size: 0.9em;
  color: var(--darker-gold);
  transition: color 250ms ease;
  font-family: "RobotoSerif Medium";
  font-weight: 500;
}

.sutta-group-label {
  font-style: italic;
  color: #555;
  font-size: 0.95em;
  margin: 1em 0 0.5em 0;
  padding-left: 0.5em;
}

.sutta-date-added {
  margin-top: 8px;
  font-size: 0.8em;
  color: #888;
  transition: color 250ms ease;
}

.dark .sutta-date-added {
  color: var(--off-white);
}

.dark .sutta-box:hover .sutta-date-added {
  color: var(--darker-brown);
}

/* Additional tweaks for spacing and compactness */
.sutta-box h3,
.sutta-pali-title {
  margin-bottom: 5px;
}

.sutta-card {
  background-color: var(--card-bg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: box-shadow 250ms ease, color 250ms ease, background-color 250ms ease;
}

.sutta-card:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
  background-color: #ffffff;
}

.dark .sutta-card {
  background-color: var(--dark-card-bg);
  border-color: var(--slate-gray);
}

.dark .sutta-card:hover {
  background-color: var(--off-white);
  transform: initial;
  box-shadow: initial;
}

.sutta-card>a {
  text-decoration: none;
  display: block;
  padding: 10px;
}

.sutta-card-content {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  flex-direction: column;
}

.sutta-card-top,
.sutta-card-bottom {
  flex: 1;
  display: flex;
  gap: 10px;
  align-items: start;
}

.sutta-card-description {
  color: black;
  font-size: .8rem;
  transition: color 250ms ease;
  line-height: 1.2;
}

.sutta-card-description.description {
  line-height: 1.2;
}

.sutta-card-description.heading {
  line-height: 1;
}

.sutta-card-heading {
  font-size: 0.9rem;
  line-height: 1;
  font-weight: 500;
  color: var(--deep-bronze);
  background: rgba(var(--orange-yellow-rgb), 0.15);
  border-radius: 3px;
  padding: 4px 7px 4px 6px;
  margin-top: 2px;
  transition: background 250ms ease, color 250ms ease;
  max-width: 50%;
  text-align: center;
  white-space: nowrap;
  font-style: italic;
}

.sutta-card:hover .sutta-card-heading {
  background: rgba(var(--orange-yellow-rgb), 0.25);
}

.dark .sutta-card-heading {
  background: rgba(var(--orange-yellow-rgb), 0.50);
  color: rgb(240, 240, 240);
}

.dark .sutta-card:hover .sutta-card-heading {
  background: rgba(var(--darker-gold-rgb), 1);
  color: white;
}

.dark .sutta-card-description {
  color: var(--off-white);
}

.dark .sutta-card:hover .sutta-card-description {
  color: var(--darker-brown);
}

.sutta-card-divider {
  border: none;
  border-top: 1px solid #d8d8d8;
  margin: 4px 0;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  transition: border 250ms ease;
}

.dark .sutta-card-divider {
  border-color: var(--slate-gray);
}

.dark .sutta-card:hover .sutta-card-divider {
  border-top: 1px solid var(--dark-brown);
}

.sutta-card .sutta-pali-title {
  font-size: .9rem;
  line-height: .9rem;
  color: var(--darker-gold);
  margin: 0;
  transition: color 250ms ease;
  font-family: "RobotoSerif Medium";
}

.dark .sutta-pali-title {
  color: var(--orange-yellow);
}

.dark .sutta-card:hover .sutta-pali-title {
  color: var(--deep-bronze);
}

.sutta-card .sutta-title {
  font-size: 1.1rem;
  color: var(--darker-blue);
  transition: color 250ms ease;
  margin-right: auto;
  font-family: "RobotoSerif Medium";
  font-weight: 500;
}

.dark .sutta-card .sutta-title {
  color: var(--off-white);
}

.dark .sutta-card:hover .sutta-title {
  color: var(--darker-brown);
}

#back-arrow {
  margin-left: 8px;
  /* Adjust as needed */
  cursor: pointer;
  font-size: 14px;
}

#copyButton,
bookmarkButton {
  width: 76px;
}

.box-button {
  display: block;
  margin: 5px;
  text-align: center;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  text-decoration: none !important;
}

.box-button:hover {
  background-image: linear-gradient(rgb(0 0 0/20%) 0 0);
}

.box-button.red {
  background-color: #f44336;
}

.box-button.orange {
  background-color: orange;
}

.box-button.green {
  background-color: #348e40;
}

.box-button.blue {
  background-color: var(--dark-blue);
}

.box-button.dark-blue {
  background-color: #093461;
}

.box-button.gold {
  background-color: var(--gold);
}

.glossary-item {
  margin-bottom: 20px;
}

.glossary-item h2 {
  margin-bottom: 10px;
}

.definition {
  padding-left: 20px;
}

.hidden {
  display: none;
}

.suttaNavigation {
  display: flex;
  justify-content: space-between;
  gap: 0.5em;
}

.suttaNavigation a {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 48px;
  padding: 15px;
  width: 50%;
  background-color: var(--orange-yellow);
  text-decoration: none;
  color: white;
}

.suttaNavigation a span:nth-child(2) {
  font-size: 1rem;
}

.suttaNavigation a:hover {
  filter: brightness(85%);
}

.suttaNavigation .rightAlign {
  align-items: flex-end;
  text-align: right;
}

#top-buttons.button-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: 15px;
  margin-top: -37px;
  gap: 1rem;
  justify-content: center;
  align-items: flex-end;
}

#top-buttons .icon-button {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  color: var(--black);
  font-family: "RobotoSerif Medium", serif;
  transition: background-color 250ms ease, color 250ms ease;
  border-radius: 5px;
  text-decoration: none;
}

#top-buttons .icon-button.active {
  background-color: var(--off-white);
  color: var(--darker-brown);
}

.dark #top-buttons .icon-button {
  color: var(--off-white);
}

@media (hover: hover) {

  /* Only on screen supporting hover */
  #top-buttons .icon-button:hover {
    background-color: var(--off-white);
    color: var(--darker-brown);
  }

  .dark #top-buttons .icon-button:hover {
    color: var(--darker-brown);
  }
}

#home-button svg,
#search-button svg,
#bookmarks-button svg,
#comments-button svg,
#glossary-button svg,
#theme-button svg {
  width: 1.4rem;
  height: 1.4rem;
}

#home-button-mobile svg,
#settings-open-button svg,
#hamburger-menu-open-button svg {
  width: 1.8rem;
  height: 1.8rem;
}

.icon-title {
  font-size: 1rem;
  margin-top: 4px;
  line-height: 1.2;
  white-space: nowrap;
  font-family: "Roboto Medium";
}

@media only screen and (max-width: 1000px) {
  #top-buttons.button-container {
    margin-top: initial;
  }

}


@media only screen and (max-width: 768px) {

  /* CSS rules for screens smaller than 768px */
  .comment-text {
    width: 300px;
    text-align: center;
  }

  .bookmark-container p {
    max-width: 60%;
  }

  .links-area {
    margin: 1rem;
  }

  .tooltip {
    display: none;
  }

  #top-buttons.button-container {
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0 !important;
  }

  #top-buttons.button-container .icon-title {
    font-size: 0.85rem;
    margin-top: 2px;
  }

  .links-area a {
    padding: 0.3rem;
  }

  #buttonsContainer button,
  #epubButtonsContainer button {
    margin: 0.2rem;
    padding: 0.2rem 0.4rem;
    font-size: 10px;
  }

  #sutta h2,
  #whats-new h2 {
    font-size: 1.2rem;
  }

  .sutta-box .sutta-card-title,
  .sutta-card .sutta-title {
    font-size: .9rem;
  }

  .sutta-box .sutta-pali-title,
  .sutta-card .sutta-pali-title {
    font-size: .85rem;
  }

  .sutta-card-description {
    font-size: .8rem;
  }

  .sutta-card>a {
    padding: 12px;
  }

  .sutta-title {
    font-size: 1.1rem;
  }

  .sutta-card-heading {
    margin-top: 0px;
    font-size: 0.85rem;
    white-space: normal;
    padding: 3px 6px 3px 7px
  }

  .dark .sutta-card .sutta-card-heading {
    background: rgba(var(--darker-gold-rgb), .80);
    color: white;
  }

  .sutta-card-top {
    gap: 8px;
  }

  .sutta-card-bottom {
    padding-top: 2px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }


  #top-buttons.hidden~.mobile-search-panel-button {
    top: 5px !important;
  }

}

@media only screen and (max-width: 600px) {
  #suttanav {
    padding: 5px;
    /* Reduced padding on smaller screens */
    font-size: 14px;
    /* Adjusted font size for smaller screens */
  }

  .bookmark-container {
    flex-wrap: wrap;
    flex-direction: column-reverse;
  }

  .bookmark-container p {
    max-width: initial;
  }

  .bookmark-buttons {
    justify-content: space-evenly;
    width: 100%;
  }

  .bookmark-buttons>* {
    max-width: 30%;
  }
}

@media (max-width: 400px) {
  .sutta-card-top {
    flex-wrap: wrap;
    gap: 0;
  }

  .sutta-card-heading {
    max-width: 100%;
    padding: 2px;
  }

  .dark .sutta-card-heading {
    padding: 2px 4px;
  }
}

.mobile-header {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2.5px 0px;
  background-color: var(--card-bg);
  box-shadow: 0 4px 2px -2px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease-in-out;
}

.mobile-header.hidden {
  transform: translateY(-100%);
}

.dark .mobile-header {
  background-color: var(--dark-brown);
}

.popup-menu {
  z-index: 9999;
  /* NOTE: Only NOTIFICATIONS should have a higher zIndex than this */
  display: none;
  position: fixed;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
  background-color: var(--light-off-white);
  overflow-y: auto;
}

.popup-menu ul {
  display: flex;
  flex-direction: column;
  list-style: none;
  padding: 0;
  margin: 0;
}

.popup-menu .title {
  font-size: 18px;
  font-weight: normal;
}

.popup-menu .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ddd;
  padding: 20px;
}

.popup-menu .header ul li {
  padding: 10px 20px;
  margin-bottom: 5px;
  border-radius: 5px;
}

.popup-menu .header span {
  margin: 0 auto;
}

.popup-menu .header button {
  position: absolute;
  right: 15px;
  top: 17px;
  border: none;
  background-color: transparent;
}

.popup-menu .links-area {
  display: flex;
  justify-content: center;
}

.popup-menu .links-area a img {
  filter: none;
  max-width: 30px;
  max-height: 30px;
}

.popup-menu .items {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #ddd;
  padding: 15px;
}

.popup-menu .items :first-child {
  margin-top: 0px !important;
}

.popup-menu .items .item-title {
  display: block;
  font-weight: bold;
  font-size: 22px;
  margin: 12px 0px;
}

.popup-menu .items div {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0px;
  width: 215px;
}

.popup-menu .items li {
  display: flex;
  justify-content: center;
  width: 100%;
}

.popup-menu .items * {
  font-size: 18px;
}

.popup-menu .items * a {
  display: flex;
  justify-content: center;
  width: 100%;
  color: inherit;
  text-decoration: none;
  padding: 15px 20px;
  font-size: 22px;
  font-weight: bold;
}

.popup-menu .downloads {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-bottom: 1px solid #ddd;
}

.popup-menu .downloads span {
  display: block;
  margin-top: 20px;
}

.popup-menu .box-button {
  width: calc(100% - 40px);
  margin: 15px auto;
  font-size: 16px;
  font-family: "RobotoSerif", serif;
}

.popup-menu .a {
  width: 350px;
}

.dark .popup-menu {
  background-color: var(--deep-anthracite);
  color: var(--off-white);
}

.dark .popup-menu .header button {
  color: var(--off-white);
}

.dark .popup-menu .links-area a {
  color: var(--off-white);
}

#suttasTabSwitcherContainer {
  margin-bottom: 15px;
}

.dark .tab-switch {
  background: var(--dark-card-bg);
  border: 1px solid var(--slate-gray);
}

.dark .tab-switch input[type="checkbox"]+label::before {
  background-color: var(--deep-bronze);
}

.dark .tab-switch input[type="checkbox"]+label span:nth-of-type(1) {
  color: white;
}

.dark .tab-switch input[type="checkbox"]:checked+label span:nth-of-type(2) {
  color: white;
}

.tab-switch {
  --offset: 2px;
  --radius: 4px;
  position: relative;
  width: 260px;
  height: 40px;
  padding: var(--offset);
  background: rgba(213, 214, 217, 0.5);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  line-height: normal;
  font-style: normal;
}

.tab-switch input[type="checkbox"] {
  appearance: none;
  position: absolute;
  inset: 0;
  cursor: pointer;
  z-index: 2;
}

.tab-switch input[type="checkbox"]+label {
  position: absolute;
  inset: var(--offset, 0);
  padding: 10px 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  place-items: center;
  user-select: none;
}

.tab-switch input[type="checkbox"]+label::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 50%;
  background: #fff;
  border-radius: calc(var(--radius) - var(--offset));
  translate: 0 0;
  transition: translate 250ms cubic-bezier(0.93, 0.26, 0.07, 0.69);
}

.tab-switch input[type="checkbox"]+label span {
  position: relative;
  transition: 200ms linear;
}

.tab-switch input[type="checkbox"]+label span:nth-child(1) {
  color: #1a1a1a;
}

.tab-switch input[type="checkbox"]+label span:nth-child(2) {
  color: gray;
}

.tab-switch input[type="checkbox"]:checked+label::before {
  translate: 100% 0;
}

.tab-switch input[type="checkbox"]:checked+label span:nth-child(1) {
  color: gray;
}

.tab-switch input[type="checkbox"]:checked+label span:nth-child(2) {
  color: #1a1a1a;
}


.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.switch input {
  display: none;
}

.slider {
  position: relative;
  width: 50px;
  height: 24px;
  background-color: gray;
  border-radius: 12px;
  transition: background-color 0.3s;
}

.slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

.tick {
  position: absolute;
  left: 8px;
  top: 3px;
  font-size: 16px !important;
  font-family: "RobotoSerif", serif;
  color: white;
  display: none;
}

.switch input:checked+.slider {
  background-color: green;
}

.switch input:checked+.slider::before {
  transform: translate(26px, -50%);
}

.switch input:checked+.slider .tick {
  display: block;

}

.sidebar {
  padding: var(--sidebar-padding);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  background-color: var(--sidebar-background);
  position: fixed;
  top: 0;
  height: 100vh;
}

.sidebar .section {
  display: flex;
  flex-direction: column;
  font-family: "RobotoSerif Medium", serif;
}

.sidebar .section a {
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 10px;
  text-decoration: none;
  padding: 0.75rem;
  color: var(--sidebar-text);
}

.sidebar .section a:hover {
  background-color: var(--sidebar-text-hover);
}

.sidebar .section .title {
  padding: 0.75rem;
  padding-bottom: calc(0.75rem / 2);
  margin: 0;
  color: var(--sidebar-title);
}

.sidebar .section span {
  margin-top: 2px;
}

.sidebar .sidebar-toggle {
  height: var(--sidebar-toggle-width);
  width: var(--sidebar-toggle-width);
  top: 25px;
  position: absolute;
  color: var(--sidebar-title);
  background: var(--sidebar-background);
  border: 1px solid var(--sidebar-border);
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  font-size: 1rem;
}

.sidebar .sidebar-toggle.left {
  right: calc(var(--sidebar-toggle-width) / -2);
  transform: rotate(270deg);
}

.sidebar .sidebar-toggle.right {
  left: calc(var(--sidebar-toggle-width) / -2);
  transform: rotate(90deg);
}

.sidebar .sidebar-toggle:hover {
  background-color: var(--sidebar-text-hover);
}

.left-sidebar {
  width: var(--left-sidebar-width);
  border-right: 1px solid var(--sidebar-border);
  gap: 1.5rem;
  left: 0;
}

.left-sidebar.collapsed {
  left: calc((var(--left-sidebar-width) + var(--sidebar-padding)) * -1);
}

.left-sidebar.collapsed .sidebar-toggle {
  transform: rotate(90deg);
}

.left-sidebar .bottom-section {
  width: var(--left-sidebar-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: fixed;
  bottom: 0;
}

.left-sidebar .bottom-section a {
  cursor: pointer;
  color: var(--sidebar-text);
}

.left-sidebar .bottom-section .actions {
  display: flex;
  flex-direction: column;
  padding-bottom: 0.5rem;
  gap: 0.5rem;
}

.right-sidebar {
  width: var(--right-sidebar-width);
  border-left: 1px solid var(--sidebar-border);
  right: 0;
}

.right-sidebar.collapsed {
  right: calc((var(--right-sidebar-width) + var(--sidebar-padding)) * -1);
}

.right-sidebar.collapsed .sidebar-toggle {
  transform: rotate(270deg);
}

.right-sidebar .switch {
  padding-left: 0.75rem;
  padding-bottom: 0.25rem;
}

.right-sidebar .settings {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 1rem;
  color: var(--sidebar-text);
}

#shortcuts-title {
  margin-top: 0;
}

.shortcuts-btn {
  background: #eee;
  border: none;
  padding: 0.6em 1em;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5em;
  border-radius: 6px;
}

.modal {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background-color: var(--modal-background-color);
}

.modal-content {
  background: var(--sidebar-background);
  padding: 2rem;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 0 30px var(--modal-shadow); 
}

.shortcuts-list {
  padding-left: 0;
  list-style-type: none;
}

.shortcuts-list li {
  margin: 0.4em 0;
  font-size: 1rem;
}

kbd {
  background: var(--sidebar-border);
  color: var(--sidebar-text);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.9rem;
  font-family: monospace;
}

.close-btn {
  padding-top: 0;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--modal-icon);
  transition: color 0.2s ease;
}

.close-btn:hover {
  color: var(--modal-icon-hover);
}