/* =====================================================
   Project Detail Page - Additional Styles
   Base: ../reports/report.css (loaded first)
   ===================================================== */

/* --- Hero Image --- */
.project-hero {
  margin-bottom: 1.5rem;
}

.project-hero__image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.5rem;
}

/* --- Tags wrap (override report.css single-line) --- */
.report-article__tags {
  flex-wrap: wrap;
}

/* --- Sidebar TOC h4 level --- */
.report-toc__link--h4 {
  padding-left: 1.75rem;
  font-size: 0.65rem;
}

/* --- Project Meta --- */
.project-meta {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.project-meta__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-meta__item i {
  color: var(--color-primary-light);
}

/* --- Disclaimer --- */
.project-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 0.5rem;
  border-left: 4px solid #f59e0b;
}

.project-disclaimer i {
  color: #f59e0b;
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.project-disclaimer p {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0;
}

/* --- Inline Table of Contents --- */
.project-toc {
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 2rem;
}

.project-toc__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.project-toc__list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.8;
}

.project-toc__list ol {
  padding-left: 1.25rem;
  margin: 0.125rem 0 0.25rem;
}

.project-toc__list li {
  margin-bottom: 0.125rem;
}

.project-toc__list a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 150ms ease;
}

.project-toc__list a:hover {
  color: var(--color-primary);
}

/* --- Image Gallery --- */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.project-gallery__item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.project-gallery__item img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background-color: var(--color-surface);
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-gallery__item img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.project-gallery__item span {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-top: 0.5rem;
  text-align: center;
}

/* --- Subsection Gallery (2-column) --- */
.project-gallery--sub {
  grid-template-columns: repeat(2, 1fr);
}

.project-gallery--sub img {
  height: 280px;
  object-fit: cover;
}

/* --- Video --- */
.project-video {
  margin: 1.5rem 0;
}

.project-video video {
  width: 100%;
  max-height: 500px;
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
  background: #000;
}

.project-video__caption {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-align: center;
  margin-top: 0.5rem;
}

/* --- Tags --- */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.project-tags__item {
  padding: 0.25rem 0.5rem;
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-primary-light);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.25rem;
}

/* --- Highlight Section --- */
.section--highlight {
  background: rgba(37, 99, 235, 0.08);
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  border-left: 4px solid var(--color-primary);
  margin: 1.5rem 0;
}

.section--highlight h2 {
  color: var(--color-primary);
  font-size: 1.05rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.section--highlight p {
  color: var(--color-text);
  margin: 0;
}

.section--highlight a {
  color: var(--color-primary);
  font-weight: 600;
}

.section--highlight a:hover {
  color: var(--color-primary-light);
  text-decoration: underline;
}

.section--highlight h3 {
  color: var(--color-primary);
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.section--highlight ul {
  margin: 0;
  padding-left: 1.25rem;
}

.section--highlight li {
  margin-bottom: 0.25rem;
  line-height: 1.6;
}

/* --- Benchmark Table --- */
.benchmark-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  margin: 12px 0;
}

.benchmark-table caption {
  caption-side: top;
  text-align: left;
  font-size: 0.85em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.benchmark-table th {
  padding: 8px;
  text-align: center;
}

.benchmark-table th:first-child {
  text-align: left;
}

.benchmark-table thead tr {
  border-bottom: 2px solid var(--color-border);
}

.benchmark-table td {
  padding: 8px;
  text-align: center;
}

.benchmark-table td:first-child {
  text-align: left;
}

.benchmark-table tbody tr {
  border-bottom: 1px solid var(--color-border);
}

.benchmark-table .tr--highlight {
  background: rgba(37, 99, 235, 0.06);
  font-weight: 600;
}

/* --- Z-Pattern Screenshot Flow --- */
.z-flow {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 1.5rem 0;
}

.z-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.z-row--reverse {
  flex-direction: row-reverse;
}

.z-image {
  flex: 0 0 40%;
  max-width: 40%;
}

.z-image img {
  width: 100%;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.z-text {
  flex: 1;
}

.z-text h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.z-text p {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

.z-step {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  margin-bottom: 0.4rem;
}

/* --- Demo Button --- */
.project-demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #ffffff;
  font-weight: 600;
  border-radius: 0.5rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  text-decoration: none;
}

.project-demo-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
  color: #ffffff;
}

.project-demo-btn i {
  font-size: 1rem;
}

/* --- Clickable Images --- */
.report-content img {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.report-content img:hover {
  transform: scale(1.01);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* --- Image Lightbox Modal --- */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 2000;
  cursor: zoom-out;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox.active {
  display: flex;
}

.lightbox__image {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 0.5rem;
  cursor: default;
  animation: lightboxIn 0.2s ease;
}

@keyframes lightboxIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox__caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  text-align: center;
  max-width: 80vw;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 640px) {
  .z-row,
  .z-row--reverse {
    flex-direction: column;
  }

  .z-image {
    flex: none;
    max-width: 70%;
    margin: 0 auto;
  }
}

@media (max-width: 600px) {
  .project-gallery--sub {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .project-hero__image {
    height: 180px;
  }

  .project-meta {
    gap: 0.5rem;
    font-size: 0.8rem;
  }

  .report-article__tags {
    flex-wrap: wrap;
  }
}
