/* ==========================================================
   PROJECT DETAIL PAGE STYLES
   Loaded only on projects/*.html
   Max content width: 860px centered
   ========================================================== */

/* Override container width for detail pages */
main.container {
  max-width: 860px !important;
  padding: 0 24px;
}

.detail-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Back link */
.detail-back {
  padding-top: calc(60px + 28px);
  margin-bottom: 32px;
}

.detail-back__link {
  font-size: 0.82rem;
  color: #666666;
  text-decoration: none;
  transition: color 150ms ease;
}

.detail-back__link:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Hero image */
.detail-hero-image {
  width: 100%;
  margin-bottom: 48px;
  border-radius: 12px;
  overflow: hidden;
}

.detail-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---- Project Header ---- */
.detail-header {
  margin-bottom: 40px;
}

.detail-header__category {
  font-size: 0.72rem;
  font-weight: 500;
  color: #555555;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.detail-header__title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 10px;
}

.detail-header__summary {
  font-size: 1.05rem;
  color: #444444;
  line-height: 1.5;
  max-width: 680px;
  margin-bottom: 20px;
}

/* ---- Meta bar (pill chips) ---- */
.detail-header__meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}

.detail-header__meta span,
.detail-meta__chip {
  background: #f3f3f3;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.78rem;
  color: #333333;
  white-space: nowrap;
}

/* ---- Screenshot gallery ---- */
.detail-gallery {
  background: #f7f7f7;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 48px;
  overflow: hidden;
}

.detail-gallery__scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.detail-gallery__scroll::-webkit-scrollbar {
  display: none;
}

.detail-gallery__scroll img {
  height: 380px;
  width: auto;
  max-width: none;
  border-radius: 12px;
  object-fit: contain;
  flex-shrink: 0;
  background: white;
}

/* Screenshots wrapper (direct flex container for images) */
.detail-screenshots {
  background: #f7f7f7;
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 48px;
  overflow: hidden;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.detail-screenshots::-webkit-scrollbar {
  display: none;
}

.detail-screenshots img {
  height: 380px;
  width: auto;
  max-width: none;
  border-radius: 12px;
  object-fit: contain;
  flex-shrink: 0;
  background: white;
}

/* Few images: use grid instead */
.detail-gallery--grid {
  padding: 24px;
}

.detail-gallery--grid .detail-gallery__scroll {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  overflow: visible;
}

.detail-gallery--grid .detail-gallery__scroll img {
  width: 100%;
  height: auto;
  max-height: 420px;
}

.detail-screenshots--grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  overflow: visible;
}

.detail-screenshots--grid img {
  width: 100%;
  height: auto;
  max-height: 420px;
}

/* ---- Content sections ---- */
.detail-content {
  margin-bottom: 48px;
}

.detail-content section,
.detail-section {
  margin-bottom: 36px;
}

.detail-content section:last-child,
.detail-section:last-child {
  margin-bottom: 0;
}

.detail-content section h2,
.detail-section__heading {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.detail-content section p,
.detail-section__body {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #333333;
  max-width: 680px;
}

.detail-content section p {
  margin-bottom: 12px;
}

.detail-content section p:last-child {
  margin-bottom: 0;
}

.detail-section__body p {
  margin-bottom: 12px;
}

.detail-section__body p:last-child {
  margin-bottom: 0;
}

/* Feature list — clean, no default bullets */
.detail-content section ul,
.detail-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.detail-content section li,
.detail-features li {
  font-size: 0.9rem;
  line-height: 1.8;
  color: #222222;
  padding-left: 18px;
  position: relative;
  margin-bottom: 6px;
}

.detail-content section li:last-child,
.detail-features li:last-child {
  margin-bottom: 0;
}

.detail-content section li::before,
.detail-features li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: #888888;
}

/* ---- Tech stack tags (slightly larger than card tags) ---- */
.detail-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-tech .tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: #f3f3f3;
  color: #333333;
  padding: 4px 12px;
  border-radius: 4px;
  border: none;
}

/* ---- Store badge buttons ---- */
.detail-stores {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-stores a {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  text-decoration: none;
  transition:
    background 150ms ease,
    color 150ms ease;
}

.detail-stores a:hover {
  opacity: 0.85;
}

.detail-stores img {
  width: auto;
  height: 36px;
}

/* ---- Source code links ---- */
.detail-source {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-source a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--text);
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  text-decoration: none;
  transition:
    background 150ms ease,
    color 150ms ease;
  width: fit-content;
}

.detail-source a:hover {
  background: var(--text);
  color: var(--surface);
}

/* ---- Bottom navigation ---- */
.detail-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 48px;
  border-top: 1px solid var(--border);
  margin-top: 48px;
  margin-bottom: 40px;
}

.detail-nav__link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: color 150ms ease;
}

.detail-nav__link:hover {
  color: #666666;
}

.detail-nav__link--disabled {
  visibility: hidden;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .detail-back {
    padding-top: calc(60px + 20px);
  }

  .detail-header__title {
    font-size: 1.65rem;
  }

  .detail-gallery__scroll img,
  .detail-screenshots img {
    height: 280px;
  }

  .detail-gallery--grid .detail-gallery__scroll,
  .detail-screenshots--grid .detail-screenshots {
    grid-template-columns: 1fr;
  }

  .detail-nav {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}

/* ==========================================================
   DETAIL PAGE — ANIMATED SECTION HEADING UNDERLINE
   ========================================================== */
.detail-content section h2,
.detail-section__heading {
  position: relative;
  padding-bottom: 8px;
}

.detail-content section h2::after,
.detail-section__heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent-blue, #0066ff);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.detail-content section h2.heading-visible::after,
.detail-section__heading.heading-visible::after {
  width: 100%;
}

/* ==========================================================
   SCREENSHOTS — HOVER ZOOM + CAPTION OVERLAY
   ========================================================== */
.detail-screenshots,
.detail-gallery__scroll {
  padding: 20px 24px;
}

.detail-screenshots img,
.detail-gallery__scroll img {
  position: relative;
  transition: transform 350ms cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 350ms ease;
  cursor: zoom-in;
}

.detail-screenshots img:hover,
.detail-gallery__scroll img:hover {
  transform: scale(1.04) translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
  z-index: 2;
}

/* Screenshot scroll fade-in cascade */
.detail-screenshots img {
  opacity: 0;
  animation: screenshot-fadein 0.5s ease forwards;
}

.detail-screenshots img:nth-child(1) { animation-delay: 0.1s; }
.detail-screenshots img:nth-child(2) { animation-delay: 0.2s; }
.detail-screenshots img:nth-child(3) { animation-delay: 0.3s; }
.detail-screenshots img:nth-child(4) { animation-delay: 0.4s; }
.detail-screenshots img:nth-child(5) { animation-delay: 0.5s; }

@keyframes screenshot-fadein {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ==========================================================
   BACK LINK — ARROW SLIDE
   ========================================================== */
.detail-back__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 150ms ease, gap 0.2s ease;
}

.detail-back__link:hover {
  color: var(--text);
  text-decoration: none;
  gap: 10px;
}

/* ==========================================================
   FEATURE BULLETS — HOVER HIGHLIGHT
   ========================================================== */
.detail-content section li,
.detail-features li {
  transition: color 0.15s ease, padding-left 0.2s ease;
}

.detail-content section li:hover,
.detail-features li:hover {
  color: var(--text, #111111);
  padding-left: 24px;
}

.detail-content section li::before,
.detail-features li::before {
  transition: color 0.15s ease;
}

.detail-content section li:hover::before,
.detail-features li:hover::before {
  color: var(--accent-blue, #0066ff);
}

/* ==========================================================
   DETAIL HERO IMAGE — REVEAL
   ========================================================== */
.detail-hero-image {
  opacity: 0;
  transform: translateY(16px);
  animation: detail-hero-reveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

@keyframes detail-hero-reveal {
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   PREV/NEXT NAV — ARROW SLIDE
   ========================================================== */
.detail-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 150ms ease, gap 0.2s ease;
}

.detail-nav__link:not(.detail-nav__link--disabled):hover {
  color: var(--text, #111111);
  gap: 10px;
}

/* ==========================================================
   DETAIL HEADER — STAGGER IN
   ========================================================== */
.detail-header.fade-in {
  animation: detail-fadein 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

@keyframes detail-fadein {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   DETAIL CONTENT SECTIONS — STAGGER REVEAL
   ========================================================== */
.detail-content section {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.detail-content section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Tech tag hover on detail pages */
.detail-tech .tag {
  transition: background 0.15s ease, color 0.15s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.detail-tech .tag:hover {
  background: #111111;
  color: #ffffff;
  transform: translateY(-2px) scale(1.04);
}

