html,
body {
  background-color: #ffffff; /* #FFFCD7; */
  color: #000000; /* #A01F13; */
  font-family: "Open Sans", Helvetica, Arial, sans-serif;
  font-size: 1em;
  line-height: 1.5em;
  letter-spacing: 0.01mm;
  margin: 0;
  max-width: 100vw;
  padding: 0;
  width: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

html {
  height: 100%;
  overflow-y: scroll;
}

input[type="submit"] {
  color: #fff;
  text-decoration: none;
  background: #60a3bc;
  padding: 6px;
  border-radius: 45px 45px;
  display: inline-block;
  border: none;
}

input[type="submit"]:hover {
  text-shadow: 0px 0px 6px rgba(255, 255, 255, 1);
  -webkit-box-shadow: 0px 5px 40px -10px rgba(0, 0, 0, 0.57);
  -moz-box-shadow: 0px 5px 40px -10px rgba(0, 0, 0, 0.57);
  box-shadow: 0px 5px 40px -10px rgba(0, 0, 0, 0.57);
  transition: all 0.4s ease 0s;
}
/* links */
a:link {
  color: currentColor;
  text-decoration: none;
}

a:visited {
  color: currentColor;
}

a:hover {
  color: currentColor;
  text-decoration: underline;
}

a:active {
  color: currentColor;
}

.no-hover:hover {
  text-decoration: none;
}

.no-select {
  user-select: none;
}

/* animations */
.fadein {
  animation: fadein 1s;
}

@-moz-keyframes fadein {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@-webkit-keyframes fadein {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadein {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.fadeinup {
  animation: fadeInUp 1s both ease;
}

@-moz-keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@-webkit-keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 50px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* =================== container =============================== */
.container {
  width: 100%;
  position: relative;
  flex: 1;
}

@media screen and (orientation: landscape) {
  .container {
    min-height: 75vh;
  }
}

@media screen and (orientation: portrait) {
  .container {
    min-height: 75vh;
  }
}

ul {
  list-style-type: "\2022";
  margin: 0;
  padding-left: 10px;
}

/* ===================== library ============================= */
.library .latest {
  white-space: nowrap;
  width: 100%;
}

.library .latest::-webkit-scrollbar {
  height: 3px;
}

.library .latest::-webkit-scrollbar-track {
  background-color: #cccccc;
}

.library .latest::-webkit-scrollbar-thumb {
  background-color: #333333;
}

.library .latest a {
  display: inline-block;
  margin: 0;
  padding: 10px;
  vertical-align: top;
}

.library .latest a:hover {
  background-color: transparent;
}

.bookshelves {
  margin: 0 auto;
  padding: 0;
  column-count: 3;
  column-gap: 0px;
  cursor: default;
  width: 100%;
}

.bookshelves h2 {
    break-after: avoid-column;
}

.bookshelves ul {
    break-inside: avoid;
}

/* Ensure headings stay in the same column as the list */
.bookshelves .book-list {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}

.bookshelves > ul li::before {
  color: #a01f13;
  display: inline-block;
  width: 1em;
  margin-left: -1em;
}

.bookshelves h2:focus { outline: none; }

/* highlights the relevant header if a user arrives via a "main categories" link on the homepage */
@media only screen and (min-width: 751px) {
  .bookshelves h2:target,
  .bookshelves h2:focus {
    background: #C7DDE3;
    padding: 0.7em 0.5em;
    animation: flash 1.5s ease-in-out 3;
    font-size: 1.5em;
    width: 80%;
    display: inline-block;
    box-sizing: border-box;
  }
}

@keyframes flash {
  0%, 100% { background: #C7DDE3; }
  50%      { background:#F0F0F0}
}

.bookshelves h2 {
  scroll-margin-top: 10rem; /* keeps heading out from under fixed header */
}

@media (min-width: 1024px) {
  h1, h2, h3, h4, h5, h6 {
    scroll-margin-top: calc(60px + 0.5rem); /* keeps headings out from under fixed header */
  }
}

.page_content .bookshelves h2 {
  border-bottom: 0px none #ffffff;
}

.page_content.library .lib {
  margin-bottom: 50px;
}

/* ====================== book ============================ */
.book-container {
  align-items: center;
  justify-content: center;
  margin: 50px;
  max-width: 1000px;
}

@media only screen and (min-width: 1001px) {
  .book-container {
    display: flex;
  }
}

.book.page_content {
  background-color: #f5f5f5;
  box-shadow: none;
  padding: 50px;
  transition:
    box-shadow 0.2s ease-in-out,
    background-color 0.5s ease-in-out;
}

.book.page_content:hover {
  background-color: #ffffff;
  box-shadow: 0 25px 75px rgba(0, 0, 0, 0.1);
  transition:
    box-shadow 0.2s ease-in-out,
    background-color 0.5s ease-in-out;
}

.book .cover img {
  box-shadow: 0px 20px 50px rgba(0, 0, 0, 0.1);
  max-height: 200px;
  max-width: 150px;
  vertical-align: top;
}

.book .details .id {
  font-family: Consolas, Courier, monospace;
}

.book .bib_rec ul {
  list-style: square inside;
}

@media only screen and (min-width: 1001px) {
  .book .download {
    line-height: 25px;
    width: 130px;
  }

  .book .download a li {
    display: block;
  }

  .book .download ul {
    list-style: square inside;
  }

  .book .share {
    line-height: 25px;
    width: 20px;
    word-wrap: break-word;
  }

  .book .share a {
    display: block;
    margin: 10px 0;
  }
}

@media only screen and (max-width: 1000px) {
  .book .section {
    display: block;
    text-align: center;
  }

  .book h1 {
    text-align: center;
  }

  .book .download a {
    display: inline-block;
    text-align: center;
    width: 20%;
    max-width: 75px;
  }

  .book .share a {
    display: inline-block;
    margin: 5px;
  }
}

.share-icon img {
  height: 20px;
  width: 20px;
}

.page_content {
  margin-top: 160px;
  padding-bottom: 60px;
  padding-left: 5vw;
  padding-right: 5vw;

}

.page_content figure {
  border-radius: 5px;
  padding: 10px;
  max-width: 100%;
  height: auto;
  float: right;
  text-align: center;
}

.page_content figure img {
  width: 100%;
  vertical-align: baseline;
}

.box_shadow {
  margin-top: 1em;
  margin-bottom: 1em;
  padding: 1ex 1em;
  background-color: #d9eaef;
  border: 1px solid #b2c3c4;
}

.page_content h1::before {
  display: block;
  content: "";
  visibility: hidden;
  pointer-events: none;
}

.page_content h1 {
  font-size: 1.875em;
  font-weight: bold;
  width: 100%;
  line-height: 1em;
  color: black;
  margin-top: 3.5em;
  word-break: break-word;
  margin-bottom: 1em;
}

#slogan{
  color: #9a772b;
}

.page_content h2::before {
  display: block;
  content: "";
  visibility: hidden;
  pointer-events: none;
}

.page_content h2 {
  font-size: 1.5em;
  font-weight: bold;
  margin-top: 15px;
  margin-bottom: 15px;
  width: 100%;
  color: black;
}

.page_content h3::before {
  display: block;
  margin-top: -120px;
  height: 120px;
  visibility: hidden;
  pointer-events: none;
}

.page_content > ul li::before {
  color: #a01f13;
  display: inline-block;
  width: 1em;
}
@media only screen and (min-width: 750px) {
  .page_content > ul li::before {
    font-size: small;
  }
}

.page_content ul li {
  padding: 5px;
}

.page_content p {
  margin-top: 10px;
  margin-bottom: 10px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.page_content a:link {
  color: #003366;
  text-decoration: underline;
}

.page_content a:visited {
  color: #3e444d;
}

.page_content a:hover {
  color: currentColor;
  text-decoration: underline;
  background: #c7dde3;
}

.page_content a:active {
  color: brown;
}

.page-body {
  padding-top: 1px;
}

.anchor a {
  top: -80px;
}

.contents {
  background-color: #f9f9f9;
  border: 1px solid #a2a9b1;
  padding: 5px;
  display: inline-block;
}

.contents ol .inner_1 {
  list-style-type: lower-roman;
}

.contents ol .inner_2 {
  list-style-type: lower-alpha;
}

ol {
  margin: 0 2em;
}
ol .inner_1, ol .inner_2 {
  margin: 0 1.5em;
}

pre {
  border: 1px dashed #2f6fab;
  background-color: #f9f9f9;
  padding: 1em;
}

table {
  border-collapse: collapse;
}

table,
th,
td {
  background-color: #f8f9fa;
  color: #222;
  margin: 1em 0;
  border: 1px solid #a2a9b1;
}

.search_category li {
  display: inline-block;
}

.search_category a {
  font-weight: bold;
}

ul.icon-list {
  list-style-type: none;
}

ul.icon-list li {
  display: inline-block;
  padding: 30px;
  font-size: 1.3em;
}

/* ==================== footer ============================== */
.footer {
  position: inherit;
  left: 0;
  right: 0;
  bottom: -32px;
  text-align: center;
  font-size: 0.9em;
  width: 100%;
  background-color: #F0F0F0;
}

.footer ul li {
  display: inline-block;
  padding: 10px;
}

.footer img {
  vertical-align: baseline;
}

.cover_title h5 {
  white-space: break-spaces;
  overflow: hidden;
  height: 5em;
  text-decoration: none;
  text-align: center;
  width: 100px;
  background-color: #d9eaef;
}

.cover_title h5:hover {
  overflow-y: visible;
  height: auto;
}

.cover_image img {
  height: 150px;
  width: 100px;
  margin-left: auto;
  margin-right: auto;
  display: block;
}

.cover_image {
  height: 250px;
  width: 100px;
}

/*=====CLASS RULES IMPLEMENTED in pg-desktop-one.css========*/
ul.results li::before {
  content: unset;
}

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

  .page_content h2 {
    font-size: 1.5em;
    text-align: center;
  }

  body {
    font-size: 1em;
  }

  .bookshelves {
    column-count: 1;
    column-gap: 0px;
    cursor: default;
    width: 100%;
    height: unset;
  }

  .cover_title h5 {
    overflow-y: scroll;
    height: 100px;
  }
}

/* Bookshelf cards */
.booklink .link {
  display: flex!important
}

/*New Cover_image rules only applicable to test_index for latest covers from gutenberg1*/
.library .latest a:link {
  text-decoration: none;
}

.library .latest a:hover h5 {
  overflow-y: visible;
  height: auto;
}

/*Old Cover image rules orginally declated in CoverPages.py on autocat3. Keep them so it doesn't break anything if it is used somewhere else on autocat3.*/
.cover-thumb {
  display: inline-block;
  background-position: center;
  background-repeat: no-repeat;
}

.cover-thumb-small {
  width: 100px;
  height: 150px;
}

.cover-thumb-medium {
  width: 210px;
  height: 310px;
}

.box_announce {
  padding: 0em 1em;
  background-color: #f2dede;
  border: 1px solid #ebccd1;
}

/* Different HTML for mobile and Desktop display */
#standard {
  display: block;
}

#mobile {
  display: none;
}

@media screen and /*(orientation: portrait) */(max-width : 1024px) {
  #standard {
    display: none;
  }

  #mobile {
    display: block !important;
  }
}

/* BLUE THEME */
.library .latest h1 {
  color: #a01f13;
  border-bottom: 2px solid #a01f13;
}

.page_content h2.subtitle {
  color: black;
}

.footer a:link,
.footer a:visited,
.footer a:hover,
.footer a:active {
  color: #006479;
}

/* Hide the extended text by default */
.toggle-content {
  display: none;
}

.readmore {
  cursor: pointer;
}

/* Styling specific to the "Read More" text not the dots */
#read_more {
  text-decoration: underline;
  color: #003366;
}

/* Hide the 'Show Less' label by default */
.showless {
  display: none;
  cursor: pointer;
  text-decoration: underline;
  color: #003366;
}

/* When checkbox is checked, show the text and the 'Show Less' label */
#toggle:checked ~ .toggle-content {
  display: inline;
}

#toggle:checked ~ .showless {
  display: inline;
}

/* When checkbox is checked, hide 'Read More' */
#toggle:checked ~ .readmore {
  display: none;
}

/* Attempt to "fix" the mobile page */
@media (max-width: 768px) {
  h1 {
    padding-bottom: 8px;
  }

  .page-body {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #cover-social-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  #tabs-wrapper {
    margin: 50px 0 0 0;
  }

  #tabs {
    margin-left: 0;
  }

  .summary-text-container {
    text-align: center;
  }

  table.bibrec td {
    word-wrap: break-word;
    word-break: break-word;
  }
}

/* CUSTOM CSS FOR STYLE UPGRADE OF BIBREC.html */
/* Styling for the "read online" link */
.read_html {
  display: inline-block; /* Fallback for browsers that don't support clamp() */
  padding: 8px clamp(8px, 7vw, 50px);
  background-color: #c7dde3;
  color: black !important;
  border-radius: 8px;
  text-decoration: none !important;
  transition: all 0.3s ease;
  font-size: 16px;
  font-weight: bold;
  border: 1px solid #d6d3d1;
  max-width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
}

.read_html:hover {
  background-color: #e6e6e6;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* Increase font size for similar books links */
.similar-books-link {
  font-size: 1.1em;
  font-weight: 500;
  transition: font-size 0.2s ease;
}

.similar-books-link:hover {
  font-size: 1.15em;
}

/* Custom styles for tables and headers */
#download_options_table,
#about_book_table {
  background-color: white;
  border-collapse: collapse;
  border: none;
}

#download_options_table th,
#download_options_table td,
#about_book_table th,
#about_book_table td {
  border-color: #d6d3d1;
  padding: 8px 6px;
}

#download_options_table th,
#about_book_table th {
  background-color: #e7e5e4;
}

#download_options_table td,
#about_book_table td {
  background-color: #fafafa;
}

/* Headers styling */
#book_title {
  color: black;
  border-bottom: 1px solid black;
  padding-bottom: 0.75rem;
  margin: 2rem 0 2.25rem;
  font-size: 2rem;
  line-height: 1.2;
}

.header.middle_section_header,
#about_book_header,
#download_options_header {
  color: black;
  margin-top: 3.25rem;
  font-size: 1.5rem;
}

#content .breadcrumbs {
  margin-top: 0;
}

.breadcrumbs li a:link {
  color: black;
  text-decoration: none;
}

/* Responsive book title for small screens */
@media screen and (max-width: 768px) {
  #book_title {
    font-size: 1.5rem;
  }

  .breadcrumbs ul {
    line-height: 1;
  }

  #qr {
    display: none;
  }
}

/* Custom CSS for bibrec */
.bibrec_page div .page_content {
  padding-left: 5vw;
  padding-right: 5vw;
}

@media screen and (max-width: 1025px) {
  .bibrec_page div .page_content {
    margin-top: 30px;
  }
}

/* Custom CSS for results page of quick searches */
.search_results_page div .header {
  padding-top: 5px;
}

@media screen and (max-width: 750px) {
  .search_results_page div .header {
    padding-top: 1px;
  }
}

/*
* Remove sticky header at this breakpoint
*/
@media (max-width: 1024px) {
  body {
    padding-top: 0;
  }
  .container {
    min-height: 0;
    padding: 0;
    margin-top: 0;
  }
  .page_content {
    margin-top: 60px;
    margin-bottom: 30px;
    padding: 0 5vw;
  }
  .page_content h1 {
    margin-top: 0
  }
}

.visually-hidden {
    position: absolute !important;
    overflow: hidden;
    clip: rect(1px,1px,1px,1px);
    width: 1px;
    height: 1px;
    word-wrap: normal;
}

.visually-hidden.focusable:active,.visually-hidden.focusable:focus-within {
    position: static !important;
    overflow: visible;
    clip: auto;
    width: auto;
    height: auto;
}

/* =========== "SORT BY" DROPDOWN =========== */
.sort-dropdown {
  position: relative;
  display: inline-block;
  padding: 0.5em;
  width: 100%;
}

.body p {
  margin: 0;
  padding: 0 0.5em;
  font-weight: bold;
}

.sort-dropdown-toggle {
  background: #ffffff;
  color: #333;
  padding: 10px 16px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-style: italic;
}

.sort-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  z-index: 10;
}

.sort-dropdown-menu a {
  display: block;
  padding: 10px 14px;
  color: #333;
  text-decoration: none!important;
  border-radius: 2px;
}

.sort-dropdown:focus-within .sort-dropdown-menu {
  display: block;
}

.sort-dropdown:hover .sort-dropdown-menu {
  display: block;
}

.sort-dropdown-menu a:hover,
.sort-dropdown-menu a:focus {
  background-color: #c7dde3;
}

.sort-dropdown-menu a:active {
  color: black;
}

/* Ensure keyboard users can tab through items */
.sort-dropdown-toggle:focus,
.sort-dropdown-menu a:focus-visible {
  outline: 2px solid #7ebed0;
  outline-offset: 2px;
}
