/* Forum Archive Styles */

.forum-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 7rem 1.5rem 4rem;
}

/* Top bar: breadcrumb + search */
.forum-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Breadcrumb */
.forum-breadcrumb {
  font-size: 0.82rem;
  color: var(--gray);
  min-width: 0;
}
.forum-breadcrumb a {
  color: var(--gold);
}
.forum-breadcrumb span {
  color: var(--charcoal);
}

/* Inline search */
.forum-search-inline {
  position: relative;
  flex-shrink: 0;
}
.forum-search-inline input {
  font-family: var(--font-body);
  font-size: 0.82rem;
  padding: 0.4rem 0.6rem 0.4rem 1.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 180px;
  background: var(--white);
  color: var(--charcoal);
  transition: border-color 0.2s, width 0.2s;
}
.forum-search-inline input:focus {
  outline: none;
  border-color: var(--gold);
  width: 240px;
}
.forum-search-inline input::placeholder {
  color: var(--gray-light);
}
.forum-search-inline::before {
  content: '\1F50D';
  position: absolute;
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  color: var(--gray);
  pointer-events: none;
}

/* Search widget */
.forum-search-widget {
  position: relative;
}

.search-scope-toggle {
  display: inline;
  font-size: 0.72rem;
  color: var(--gray);
  margin-left: 0.5rem;
  white-space: nowrap;
}
.scope-btn {
  font-family: var(--font-body);
  font-size: 0.72rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  transition: color 0.15s;
}
.scope-btn.active {
  color: var(--charcoal);
  font-weight: 600;
}
.scope-btn:not(.active) {
  color: var(--gray-light);
}
.scope-btn:hover:not(.active) {
  color: var(--gold);
}
.scope-separator {
  color: var(--gray-light);
  margin: 0 0.2rem;
}

.search-results {
  position: absolute;
  top: 100%;
  right: 0;
  width: 380px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 100;
  margin-top: 0.3rem;
}

.search-result {
  display: block;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  transition: background 0.1s;
}
.search-result:hover {
  background: var(--cream);
}
.search-result:last-child {
  border-bottom: none;
}

.search-result-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--charcoal);
  margin-bottom: 0.2rem;
}
.search-result:hover .search-result-title {
  color: var(--gold);
}

.search-result-excerpt {
  display: block;
  font-size: 0.75rem;
  color: var(--gray);
  line-height: 1.5;
}
.search-result-excerpt mark {
  background: rgba(192, 154, 5, 0.15);
  color: var(--charcoal);
  padding: 0 1px;
  border-radius: 2px;
}

.search-no-results {
  padding: 1rem;
  font-size: 0.82rem;
  color: var(--gray);
  text-align: center;
}

.search-more {
  padding: 0.6rem 0.9rem;
  font-size: 0.75rem;
  color: var(--gray);
  text-align: center;
  border-top: 1px solid #f0f0f0;
}

.search-loading {
  padding: 1rem;
  font-size: 0.82rem;
  color: var(--gray);
  text-align: center;
}

/* Page title (inside content, not dark banner) */
.forum-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--charcoal);
  margin: 0 0 0.3rem;
  line-height: 1.2;
}

.forum-description {
  font-size: 0.88rem;
  color: var(--gray);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.forum-title-group {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gold);
}

/* --- Thread Pages --- */

.thread-posts {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.post-card {
  background: var(--white);
  border-bottom: 1px solid #e8e8e8;
  padding: 1.5rem 0;
}
.post-card:first-child {
  padding-top: 0;
}
.post-card:last-child {
  border-bottom: none;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
  gap: 1rem;
}

.post-author {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--charcoal);
}

.post-date {
  font-size: 0.78rem;
  color: var(--gray);
  white-space: nowrap;
}

/* Yoda (Lynn Blake) posts */
.post-card--yoda {
  border-left: 3px solid var(--gold);
  margin-left: -1rem;
  padding-left: calc(1rem - 3px);
  border-bottom: none;
  position: relative;
}
.post-card--yoda::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 0;
  height: 1px;
  background: #e8e8e8;
}
.post-card--yoda:last-child::after {
  display: none;
}
.post-card--yoda .post-author {
  color: var(--gold);
}
.post-author-badge {
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-right: 6px;
  vertical-align: middle;
  position: relative;
  top: -7px;
  background-color: var(--gold);
  -webkit-mask: url('/assets/images/yoda-icon.svg') center/contain no-repeat;
  mask: url('/assets/images/yoda-icon.svg') center/contain no-repeat;
  font-size: 0;
  overflow: hidden;
}

.post-body {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--charcoal);
  overflow-wrap: break-word;
}
.post-body img {
  max-width: 100%;
  height: auto;
}
.post-body a {
  word-break: break-all;
}

/* Quoted replies */
.forum-quote {
  border-left: 3px solid var(--gold);
  background: var(--cream);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  font-size: 0.88rem;
}
.forum-quote cite {
  display: block;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 600;
  color: var(--gray);
  margin-bottom: 0.5rem;
}

/* Attachment placeholder */
.attachment-unavailable {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--gray);
  background: var(--cream);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-style: italic;
}

/* --- Forum Listing Pages --- */

.thread-list {
  overflow-x: auto;
}

.forum-threads {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.forum-threads thead th {
  text-align: left;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray);
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--gold);
}

.forum-threads tbody tr {
  border-bottom: 1px solid #eee;
}
.forum-threads tbody tr:hover {
  background: var(--cream);
}

.forum-threads td {
  padding: 0.6rem 0.75rem;
  vertical-align: top;
}

.forum-threads .thread-title {
  font-weight: 400;
}
.forum-threads .thread-title a {
  color: var(--charcoal);
}
.forum-threads .thread-title a:hover {
  color: var(--gold);
}

.sticky-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  margin-right: 0.3rem;
}

.forum-threads .thread-starter {
  color: var(--gray);
  font-size: 0.85rem;
  white-space: nowrap;
}

.forum-threads .thread-replies,
.forum-threads .thread-lastpost {
  color: var(--gray);
  font-size: 0.82rem;
  white-space: nowrap;
  text-align: center;
}

/* --- Lightbox for forum images --- */
.forum-lightbox {
  cursor: zoom-in;
}
.forum-lightbox img {
  transition: opacity 0.15s;
}
.forum-lightbox:hover img {
  opacity: 0.85;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.2s;
  padding: 2rem;
}
.lightbox-overlay.active {
  opacity: 1;
}
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
  .forum-content {
    padding: 6rem 1rem 3rem;
  }

  .forum-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .forum-search-inline input {
    width: 100%;
  }
  .forum-search-inline {
    width: 100%;
  }
  .forum-search-inline input:focus {
    width: 100%;
  }
  .forum-title {
    font-size: 1.4rem;
  }
  .search-results {
    width: calc(100vw - 2rem);
    right: auto;
    left: 0;
  }

  .post-header {
    flex-direction: column;
    gap: 0.2rem;
  }

  .forum-threads thead {
    display: none;
  }
  .forum-threads tbody tr {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
  }
  .forum-threads td {
    display: block;
    padding: 0.15rem 0;
  }
  .forum-threads .thread-title {
    font-size: 0.95rem;
  }
  .forum-threads .thread-starter {
    font-size: 0.78rem;
  }
  .forum-threads .thread-replies,
  .forum-threads .thread-lastpost {
    display: inline-block;
    text-align: left;
    font-size: 0.78rem;
  }
  .forum-threads .thread-replies::after {
    content: ' replies';
  }
  .forum-threads .thread-lastpost::before {
    content: ' \00b7  ';
    color: var(--gray-light);
  }
}
