﻿/* ==========================================
   Topic List Page (Topic.cshtml)
========================================== */
.brpro-topic-wrapper {
  padding: 30px 0 60px;
}

.brpro-topic-header {
  text-align: center;
  margin-bottom: 40px;
}

.brpro-topic-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--brpro-text);
  margin: 0 0 10px;
}

.brpro-topic-header p {
  font-size: 15px;
  color: var(--brpro-muted);
  margin: 0;
}

.brpro-topic-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

.brpro-topic-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  padding: 0; /* Override panel padding */
  border: 1px solid var(--brpro-border);
}

.brpro-topic-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--brpro-shadow-hover);
  border-color: var(--brpro-accent-50);
}

.brpro-topic-img {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.brpro-topic-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.brpro-topic-card:hover .brpro-topic-img img {
  transform: scale(1.05);
}

.brpro-topic-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.brpro-topic-card:hover .brpro-topic-overlay {
  opacity: 1;
}

.brpro-topic-btn {
  padding: 8px 24px;
  background: var(--brpro-accent);
  color: white;
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  transform: translateY(10px);
  transition: transform 0.2s;
}

.brpro-topic-card:hover .brpro-topic-btn {
  transform: translateY(0);
}

.brpro-topic-info {
  padding: 20px;
}

.brpro-topic-info h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--brpro-text);
  line-height: 1.4;
}

.brpro-topic-card:hover .brpro-topic-info h3 {
  color: var(--brpro-accent);
}

.brpro-topic-info p {
  margin: 0;
  font-size: 14px;
  color: var(--brpro-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================
   Topic Detail Page (TopicBook.cshtml)
========================================== */
.brpro-topic-detail-wrapper {
  padding: 20px 0 60px;
}

.brpro-topic-detail-card {
  padding: 0;
  overflow: hidden;
}

.brpro-topic-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  max-height: 400px;
}

.brpro-topic-banner .banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brpro-topic-banner .banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0) 100%);
  display: flex;
  align-items: flex-end;
  padding: 40px;
}

.brpro-topic-banner h1 {
  color: white;
  font-size: 32px;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.brpro-topic-intro {
  padding: 30px 40px;
  border-bottom: 1px solid var(--brpro-border);
  background: var(--brpro-bg);
}

.intro-content {
  font-size: 15px;
  line-height: 1.8;
  color: var(--brpro-text);
}

.intro-content.has-more {
  position: relative;
  max-height: 100px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.intro-content.has-more::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, var(--brpro-bg), transparent);
  pointer-events: none;
}

.intro-content.expanded {
  max-height: 2000px;
}

.intro-content.expanded::after {
  display: none;
}

.intro-toggle {
  margin-top: 16px;
  text-align: center;
}

.intro-toggle button {
  background: transparent;
  border: none;
  color: var(--brpro-accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  transition: background-color 0.2s;
}

.intro-toggle button:hover {
  background: var(--brpro-accent-10);
}

.intro-toggle button .show-less {
  display: none;
}

.intro-toggle button.active .show-more {
  display: none;
}

.intro-toggle button.active .show-less {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.intro-toggle button .show-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.brpro-topic-books {
  padding: 40px;
}

.section-title {
  margin-bottom: 30px;
}

.section-title h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--brpro-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title h2::before {
  content: "";
  display: block;
  width: 4px;
  height: 18px;
  background: var(--brpro-accent);
  border-radius: 2px;
}

/* Share grid from library */
.brpro-library-grid {
  width: 100%;
  overflow: hidden;
}

.brpro-library-grid .nlist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
}

.brpro-library-grid .nlist li {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.brpro-library-grid .nlist li a {
  min-width: 0;
}

.brpro-library-grid .cover {
  width: 100%;
  min-width: 0;
}

.brpro-library-grid .cover .imgbox {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.brpro-library-grid .cover .imgbox img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
}

/* Responsive */
@media (max-width: 1024px) {
  .brpro-library-grid .nlist {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .brpro-topic-list {
    grid-template-columns: 1fr;
  }
  
  .brpro-topic-header h1 {
    font-size: 24px;
  }
  
  .brpro-topic-banner {
    aspect-ratio: 16 / 9;
  }
  
  .brpro-topic-banner .banner-overlay {
    padding: 20px;
  }
  
  .brpro-topic-banner h1 {
    font-size: 22px;
  }
  
  .brpro-topic-intro {
    padding: 20px;
  }
  
  .brpro-topic-books {
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
  }
  
  .brpro-library-grid .nlist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}
