/*Elements exclusive to the front-page*/
#indexWrapper {
  width: 80%;
  margin: 2em auto;
}

#logoBox {
  width: 100%;
  margin: 0 auto 1em auto;
  text-align: center;
}

#infoBox {
  text-align: center;
  width: 100%;
  padding: 0.5em;
  margin: 1em auto 2em;
  font-size: 120%;
}

#links {
  display: none !important;
}

#divStats {
  padding: 0.5em;
  font-size: 75%;
  text-align: center;
}

#links a {
  text-decoration: none;
}

#linkGlobalLogs:before {
  content: "\e069";
}

#linkArchives:before {
  content: "\e021";
}

#linkGraphs:before {
  content: "\e018";
}

#linkAccount:before {
  content: "\e081";
}

#linkGlobalRules:before {
  content: "\e06f";
}

#linkAbout:before {
  content: "\e0b0";
}

#linkEngine:before {
  content: "\e064";
}

#linkLinks:before {
  content: "\e086";
}

#linkContact:before {
  content: "\e05c";
}

.topBoards {
  width: 100%;
  text-align: center;
  margin: 1em 0px;
}

.topBoards a {
  padding: 0.25em 0.5em;
  text-decoration: none;
  margin: 0.5em 0.25em;
  display: inline-block;
  font-size: 90%;
}

#frontpageColumns {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  max-width: 860px; /* 280px posts + 540px active threads + 20px gap + borders = 860px */
  width: 100%;
  margin: 1.5em auto;
}

.frontpageSection {
  display: flex;
  flex-direction: column;
}

#divActiveThreads {
  width: 540px;
  flex: none;
  min-width: 0;
}

#divLatestPosts {
  width: 280px;
  flex: none;
  min-width: 0;
}

#divLatestImages {
  margin: 2em auto;
  display: table;
  box-sizing: border-box;
}

#divLatestImages .sectionHeader {
  box-sizing: border-box;
}

.sectionHeader {
  background: #1e1035;
  border: 1px solid #4c1d95; /* aligned to match sectionContent border color */
  border-bottom: none;
  border-radius: 5px 5px 0 0;
  color: #c084fc;
  padding: 0.5em 1em;
  margin: 0;
  font-size: 95%;
  font-weight: bold;
  text-align: left;
}

.sectionContent {
  background: transparent;
  border: 1px solid #4c1d95;
  border-radius: 0 0 5px 5px;
  padding: 1em;
  box-sizing: border-box;
}

/* Active Threads Grid */
#divActiveThreads .sectionContent {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 12px;
  overflow: hidden;
}

.activeThreadCell {
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  text-align: center;
  min-width: 0;
  overflow: hidden;
  justify-content: flex-start;
}

.activeThreadBoard {
  font-size: 80%;
  font-weight: bold;
  color: #c084fc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 6px;
  text-align: center;
}

.activeThreadBoard a {
  color: #c084fc;
  text-decoration: none;
}

.activeThreadBoard a:hover {
  text-decoration: underline;
}

.activeThreadThumb {
  width: 100%;
  height: auto;
  display: block;
  background: transparent;
  margin-bottom: 6px;
}

.activeThreadThumb img {
  max-width: 100%;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border: 1px solid #4c1d95;
  border-radius: 4px;
  box-sizing: border-box;
  transition: none !important;
  margin: 0 auto;
}

.activeThreadCell:hover .activeThreadThumb img {
  border-color: #c084fc;
}

.activeThreadThumb.noThumb {
  width: 100%;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #1e1035;
  border: 1px solid #4c1d95;
  border-radius: 4px;
  box-sizing: border-box;
  transition: none !important;
}

.activeThreadCell:hover .activeThreadThumb.noThumb {
  border-color: #c084fc;
}

.activeThreadThumb.noThumb a {
  font-size: 75%;
  color: #ccd6f6;
  text-decoration: none;
  font-weight: bold;
}

.activeThreadContent {
  display: block;
  text-align: center;
  font-size: 75%;
  line-height: 1.3;
  margin-top: 4px;
  overflow: hidden;
  word-break: break-word;
}

.activeThreadContent strong {
  font-weight: bold;
  color: #ccd6f6;
  display: inline;
}

.activeThreadPreview {
  color: #ccd6f6;
}

/* Latest Posts List */
#divLatestPosts .sectionContent {
  display: flex;
  flex-direction: column;
  gap: 0;
}

#divLatestPosts .latestPostCell {
  display: block;
  max-width: 100%;
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid #4c1d95;
  border-radius: 0 !important;
  padding: 0.5em 0;
  margin: 0;
  font-size: 75%;
  text-align: left;
  box-sizing: border-box;
}

.latestPostCell a {
  display: block;
  font-weight: bold;
  margin-bottom: 2px;
}

.latestPostCell .labelPreview {
  color: #ccd6f6;
  word-break: break-word;
}

/* Latest Images Grid (6x4 ratio box layout) */
#divLatestImages .sectionContent {
  display: grid;
  grid-template-columns: repeat(6, 80px);
  gap: 8px;
}

.latestImageCell {
  position: relative;
  border: 1px solid #4c1d95;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 80px;
  height: 80px;
  box-sizing: border-box;
  transition: none !important;
}

.latestImageCell:hover {
  border-color: #c084fc;
}

.latestImageCell a {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.latestImageLabel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(16, 10, 28, 0.85);
  color: #c084fc;
  font-size: 65%;
  padding: 4px 2px;
  text-align: center;
  border-bottom: 1px solid #4c1d95;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: bold;
  box-sizing: border-box;
  height: 23px;
  opacity: 0;
  transition: none !important;
  pointer-events: none;
}

.latestImageCell:hover .latestImageLabel {
  opacity: 1;
}

.latestImageCell img {
  width: 100% !important;
  height: 80px !important;
  object-fit: cover !important;
  display: block !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  transition: none !important;
  transform: none !important;
}

.theme_cyber .topBoards a, .theme_cyber .latestImageCell {
  border: none;
}

@media only screen and (max-width: 812px) {
  #indexWrapper {
    width: 95% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 1em auto !important;
    overflow-x: hidden !important;
  }

  #frontpageColumns {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #divActiveThreads,
  #divLatestPosts,
  #divLatestImages {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #divActiveThreads .sectionContent {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .topBoards {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0;
  }

  #links a, #divStats {
    font-size: 153%;
  }

  #linkEngine {
    display: none;
  }

  #divLatestImages {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #divLatestImages .sectionContent {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    justify-content: center;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

@media only screen and (max-width: 480px) {
  #divActiveThreads .sectionContent {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 8px;
  }
}
