/* Force pure-black background across Hugo Book theme containers.
   Hugo Book uses CSS variables like --body-background and --gray-100 for panels.
*/

:root {
  --body-background: #000 !important;
  --body-background-tint: none !important;
  --gray-100: #000 !important;
  --gray-200: #000 !important;

  /* Link colors */
  --color-link: #dd0000 !important;
  --color-visited-link: #dd0000 !important;
}

html,
body {
  background: #000 !important;
}

.book-page,
.book-menu,
.book-toc,
.book-header,
.book-footer,
.book-menu-content,
.book-toc-content {
  background: #000 !important;
}

.book-page,
.markdown {
  color: #eaeaea;
}

a {
  color: #dd0000 !important;
}

a:hover {
  color: #ff2b2b !important;
}

a:visited {
  color: #dd0000 !important;
}

pre,
code {
  background: #111;
}

/* Make sure the layout columns fill the viewport height so vertical borders reach the bottom */
main.container.flex {
  min-height: 100vh;
}

.book-menu,
.book-page,
.book-toc {
  min-height: 100vh;
}

/* Vertical separator between menu and content */
.book-menu .book-menu-content {
  box-sizing: border-box;
  border-right: 2px solid #dd0000 !important;
}

/* Right-align sidebar menu content close to the separator */
.book-menu .book-menu-content {
  text-align: right;
  padding-right: 15px !important;
}

.book-menu nav ul a,
.book-menu nav ul label {
  justify-content: flex-end;
}

/* Dropdown (collapsible) menu items */
.book-menu details.book-menu-details > summary {
  list-style: none;
  display: flex;
  justify-content: flex-end;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

.book-menu details.book-menu-details > summary::-webkit-details-marker {
  display: none;
}

.book-menu details.book-menu-details > summary .book-menu-parent {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  color: #dd0000 !important;
  font: inherit;
  line-height: inherit;
  padding: 0.5em 0;
}

.book-menu details.book-menu-details > summary:hover .book-menu-parent {
  color: #ff2b2b !important;
}

/* Reduce font size for three legal links in the menu (Privacy, Legal, Cookies) */
.book-menu a[href="/privacy-policy"],
.book-menu a[href="/legal-notice"],
.book-menu a[href="/cookies-policy"] {
  font-size: 0.6rem !important;
  line-height: 1.2 !important;
  display: inline-block !important;
}

/* Separator between legal links */
.book-menu .menu-sep {
  color: #dd0000 !important;
  font-size: 0.6rem !important;
  margin: 0 0.4rem !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* Keep the three legal links on a single line in the menu; allow wrapping on very small screens */
.book-menu .book-menu-content p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ensure the three legal links use 0.6rem even when inside a paragraph */
.book-menu .book-menu-content p a[href="/privacy-policy"],
.book-menu .book-menu-content p a[href="/legal-notice"],
.book-menu .book-menu-content p a[href="/cookies-policy"] {
  font-size: 0.6rem !important;
  line-height: 1.2 !important;
  display: inline-block !important;
}

/* Mobile: allow wrapping so links remain readable on narrow screens */
@media (max-width: 560px) {
  .book-menu .book-menu-content p {
    white-space: normal;
  }
  .book-menu .book-menu-content p a[href="/privacy-policy"],
  .book-menu .book-menu-content p a[href="/legal-notice"],
  .book-menu .book-menu-content p a[href="/cookies-policy"] {
    font-size: 0.6rem !important;
  }
}

/* Caret just before the label (e.g., ▸ ABOUT) */
.book-menu details.book-menu-details > summary .book-menu-parent::before {
  content: "▸";
  margin-right: 0.4rem;
  color: #dd0000;
}

.book-menu details.book-menu-details[open] > summary .book-menu-parent::before {
  content: "▾";
}

/* Keep nested items aligned to the right; indent from the right side */
.book-menu nav ul ul {
  padding-inline-start: 0 !important;
  padding-inline-end: 15px;
}

/* Brand (site title) aligned to the right */
.book-brand {
  text-align: right;
  margin-top: 25px !important;
  margin-bottom: 50px !important;
  color: #ffffff !important;
}

.book-brand .book-brand-inner {
  width: 100%;
  justify-content: flex-end;
  color: #ffffff !important;
}

.book-brand .book-brand-inner span {
  color: #ffffff !important;
}

/* Instagram link below brand title (homepage) */
.brand-social {
  margin-top: 0.25rem;
  font-size: 0.95rem;
}

/* Small helper for inline brand Instagram link (if used) */
.book-brand img {
  vertical-align: middle;
}

/* Search box visibility on pure black */
.book-menu .book-search {
  margin-top: 50px !important;
}

.book-search input#book-search-input {
  width: 100%;
  background: #000 !important;
  color: #eaeaea !important;
  border: 1px solid #dd0000 !important;
  border-radius: 0.25rem;
  padding: 0.4rem 0.5rem;
}

.book-search input#book-search-input::placeholder {
  color: rgba(234, 234, 234, 0.7);
}

.book-search input#book-search-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(221, 0, 0, 0.35);
}

/* Headings (override theme defaults without editing the theme) */
.markdown h1 {
  font-size: 1.3rem;
  font-weight: bold;
}
.markdown h2 {
  font-size: 1rem;
  line-height: 1.2;
  font-weight: bold;
}
.markdown h3 { font-size: 0.8rem; }
.markdown h4 {
  font-size: 0.8rem;
  margin-top: 0em;
  margin-bottom: 2em;
}

/* Thin white horizontal line helper
   Usage in content: <hr class="hr-white"> */
.markdown hr.hr-white {
  border: 0;
  height: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.50);
  margin: 2rem 0;
}

/* PhotoSwipe tweaks */
.photoswipe-gallery img {
  max-width: 100%;
  height: auto;
  display: inline-block;
  cursor: zoom-in;
}

/* Small thumbnail variant for galleries (square 100x100 without distortion) */
.photoswipe-gallery.is-small a.photoswipe-item {
  width: 100px;
  height: 100px;
  margin: 6px;
  display: inline-block;
  overflow: hidden;
}
.photoswipe-gallery.is-small a.photoswipe-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* 120px wide thumbnail variant for galleries (width 120px, auto height, keep aspect ratio) */
.photoswipe-gallery.is-120w a.photoswipe-item {
  width: 120px;
  height: auto;
  margin: 0px;
  display: inline-block;
  overflow: hidden;
}
.photoswipe-gallery.is-120w a.photoswipe-item img {
  width: 120px;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* 250px wide thumbnail variant for galleries (width 250px, auto height, keep aspect ratio) */
.photoswipe-gallery.is-250w a.photoswipe-item {
  width: 250px;
  height: auto;
  margin: 0px;
  display: inline-block;
  overflow: hidden;
}
.photoswipe-gallery.is-250w a.photoswipe-item img {
  width: 250px;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* 300px wide thumbnail variant for galleries (width 300px, auto height, keep aspect ratio) */
.photoswipe-gallery.is-300w a.photoswipe-item {
  width: 300px;
  height: auto;
  margin: 6px;
  display: inline-block;
  overflow: hidden;
}
.photoswipe-gallery.is-300w a.photoswipe-item img {
  width: 300px;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* 250px wide thumbnail variant for galleries (width 250px, auto height, keep aspect ratio) */
.photoswipe-gallery.is-250w a.photoswipe-item {
  width: 250px;
  height: auto;
  margin: 6px;
  display: inline-block;
  overflow: hidden;
}
.photoswipe-gallery.is-250w a.photoswipe-item img {
  width: 250px;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* Ensure PhotoSwipe UI overlays above theme elements */
.pswp {
  z-index: 999999 !important;
}

/* Make photo anchor contents inline-block to avoid layout shifts */
a.photoswipe-item { display: inline-block; }

/* Keep PhotoSwipe child layers at their default stacking; only root gets high z-index */
.pswp__top-bar {
  display: flex !important;
}
.pswp__button,
.pswp__button--arrow,
.pswp__button--close {
  display: block !important;
  opacity: 1 !important;
}
.pswp__button .pswp__icn,
.pswp__button .pswp__icn-shadow {
  fill: var(--pswp-icon-color, #fff) !important;
}

/* Ensure UI is above theme, but keep correct pointer-events behavior */
.pswp {
  z-index: 2147483647 !important;
}
.pswp__bg { pointer-events: auto !important; }
/* Top bar should not capture events itself; its children (buttons) will */
.pswp__top-bar { pointer-events: none !important; z-index: 1000000 !important; }
.pswp__top-bar > * { pointer-events: auto !important; }
.pswp__button,
.pswp__button--arrow,
.pswp__button--close { pointer-events: auto !important; }

/* Red separator for amplifier specifications */
.separator {
  color: #dd0000 !important;
}

/* Force black background for markdown tables and header rows (override theme) */
.markdown table {
  background: #000 !important;
  color: #eaeaea !important;
  border-collapse: collapse !important;
}
.markdown table tr th,
.markdown table tr td {
  background: #000 !important;
  color: #eaeaea !important;
  border: 1px solid #222 !important;
}
.markdown table thead tr th {
  background: #000 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}
.markdown table tr:nth-child(2n) {
  background: #000 !important;
}

/* If tables are inside an iframe or special container, increase specificity */
iframe .markdown table,
.book-page .markdown table {
  background: #000 !important;
}

/* Tables without lines (use only by adding class "no-lines" to the table in the content)
   These rules are intentionally specific and use !important so they override the
   site-wide table rules above, and therefore affect only tables with the class. */
.book-page .markdown table.no-lines {
  background: transparent !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}
.book-page .markdown table.no-lines,
.book-page .markdown table.no-lines tbody,
.book-page .markdown table.no-lines tr,
.book-page .markdown table.no-lines th,
.book-page .markdown table.no-lines td {
  border: none !important;
  background: transparent !important;
  color: inherit !important;
  box-shadow: none !important;
  outline: none !important;
}
.book-page .markdown table.no-lines tr:nth-child(2n) {
  background: transparent !important;
}
.book-page .markdown table.no-lines img {
  max-width: 100% !important;
  height: auto !important;
}
/* In case theme injects pseudo elements for lines, remove them too */
.book-page .markdown table.no-lines th::before,
.book-page .markdown table.no-lines td::before,
.book-page .markdown table.no-lines th::after,
.book-page .markdown table.no-lines td::after {
  content: none !important;
  display: none !important;
}

/* Make the middle bullet column red for .no-lines tables only */
.book-page .markdown table.no-lines td:nth-child(2) {
  color: #dd0000 !important;
}
