body,
h1,
h2,
p,
ul,
ol,
figure,
blockquote,
dl,
dd {
  margin: 0;
  padding: 0;
}
body {
  font-family: sans-serif;
  line-height: 1.6;
  padding: 20px;
  background-color: #fff;
  color: #333;
  display: grid;
  grid-template-areas: 'header header' 'nav main' 'sitetree main';
  grid-template-columns: 250px 1fr;
  grid-template-rows: auto auto 1fr;
  gap: 20px;
  min-height: 100vh;
}
body.dark-theme {
  background-color: #333;
  color: #f4f4f4;
}
body.dark-theme .results-title {
  color: #f0f0f0;
}
body.dark-theme #results-container p {
  color: #aaa;
}
body.dark-theme a {
  color: #79c0ff;
}
body.dark-theme .card {
  background-color: #444;
  border-color: #555;
}
body.dark-theme details summary {
  background-color: #3a3a3a;
  border-bottom: 1px solid #555;
}
body.dark-theme details summary:hover {
  background-color: #484848;
}
body.dark-theme input[type='text'] {
  background-color: #555;
  color: #f4f4f4;
  border: 1px solid #666;
}
body.dark-theme .breadcrumbs a {
  color: #99ddff;
}
body.dark-theme .breadcrumbs .active,
body.dark-theme .breadcrumb-item + .breadcrumb-item::before {
  color: #ccc;
}
body.dark-theme #main-nav-placeholder {
  background-color: #2c2c2c;
}
body.dark-theme #main-nav-placeholder a {
  color: #f0f0f0;
}
body.dark-theme #main-nav-placeholder a:hover {
  background-color: #505050;
}
body.dark-theme #sitetree-placeholder {
  border-color: #555;
}
body.dark-theme .copy-btn {
  background-color: #0056b3;
}
body.dark-theme .copy-btn:hover {
  background-color: #004085;
}
body.dark-theme *:focus-visible {
  outline-color: #79c0ff;
}
#page-header-placeholder {
  grid-area: header;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
#toggleTheme {
  order: 3;
  margin-left: auto;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}
#pageTitleH1 {
  order: 2;
  flex-grow: 1;
  text-align: center;
  margin: 0;
  padding: 0 10px;
}
#searchInput {
  order: 4;
  width: 100%;
  padding: 8px;
  margin-top: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}
#page-header-placeholder nav[aria-label='breadcrumb'] {
  order: 5;
  width: 100%;
  margin-top: 10px;
}
#main-nav-placeholder {
  grid-area: nav;
  padding: 10px;
  background-color: #f4f4f4;
  border-radius: 4px;
}
#main-nav-placeholder a {
  display: block;
  padding: 8px;
  text-decoration: none;
  color: #333;
  margin-bottom: 5px;
  border-radius: 3px;
}
#main-nav-placeholder a:hover {
  background-color: #e0e0e0;
}
#sitetree-placeholder {
  grid-area: sitetree;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.tree ul {
  list-style-type: none;
  padding-left: 20px;
}
.tree li {
  margin: 5px 0;
}
li.folder > ul {
  margin-left: 5px;
}
li.folder {
}
.tree .folder::before {
  content: '📁 ';
  margin-right: 5px;
}
.tree .file::before {
  content: '📄 ';
  margin-right: 5px;
}
.tree a {
  text-decoration: none;
  color: #007bff;
}
.tree a:hover {
  text-decoration: underline;
}
main {
  grid-area: main;
  padding: 10px;
}
details {
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
}
details summary {
  padding: 10px;
  background-color: #f9f9f9;
  cursor: pointer;
  font-weight: bold;
  border-bottom: 1px solid #ddd;
  border-radius: 4px 4px 0 0;
}
details summary:hover {
  background-color: #f0f0f0;
}
details[open] summary {
  border-bottom: 1px solid #ddd;
}
.section-content {
  padding: 15px;
}
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}
.card {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 10px;
  width: calc(33.333% - 10px);
  box-sizing: border-box;
  background-color: #fff;
  display: flex;
  flex-direction: column;
}
.card .image-container {
  width: 100%;
  max-height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
  overflow: hidden;
}
.card img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  width: auto;
  display: block;
  border-radius: 3px;
  object-fit: contain;
}
.card video {
  max-width: 100%;
  max-height: 200px;
  height: auto;
  display: block;
  margin-bottom: 10px;
  border-radius: 3px;
  object-fit: contain;
}
.card audio {
  height: 125px;
  max-width: 100%;
  margin-bottom: 0;
  
}
.filename {
  font-size: 0.9em;
  font-weight: bold;
  margin-bottom: 8px;
  word-break: break-all;
  text-align: center;
}
@media (max-width: 900px) {
  .card {
    width: calc(50% - 7.5px);
  }
}
@media (max-width: 600px) {
  body {
    grid-template-areas: 'header' 'nav' 'sitetree' 'main';
    grid-template-columns: 1fr;
  }
  .card {
    width: 100%;
  }
  #sitetree-placeholder {
    max-height: 300px;
  }
}
.copy-btn {
  padding: 5px 10px;
  font-size: 0.8em;
  cursor: pointer;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 3px;
}
.copy-btn:hover {
  background-color: #0056b3;
}
.breadcrumbs {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9em;
}
.section-breadcrumbs {
  margin-top: -5px;
  margin-bottom: 10px;
}
.breadcrumb-item {
  display: inline;
}
.breadcrumb-item + .breadcrumb-item::before {
  content: '/';
  padding: 0 8px;
  color: #6c757d;
}
.breadcrumb-item a {
  text-decoration: none;
  color: #007bff;
}
.breadcrumb-item a:hover {
  text-decoration: underline;
}
.breadcrumb-item.active {
  color: #333;
  font-weight: bold;
}
*:focus-visible {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}
#results-container {
  margin-top: 20px;
}
#results-container p {
  /* Styling for messages like "No results" or "Type to search" */
  text-align: center;
  font-style: italic;
  color: #777;
  padding: 20px;
}
.results-title {
  text-align: center;
  margin-top: 10px;
  margin-bottom: 20px;
  font-size: 1.5em;
  color: #333; 
}
