/* ============================================================
   PROJECT DETAIL — Shared styles for all project detail pages
   ============================================================ */

:root {
  --pd-bg: #f8f6f2;
  --pd-surface: rgba(255, 253, 250, 0.88);
  --pd-text: #1a1714;
  --pd-muted: #6b6054;
  --pd-accent: #8b6f4c;
  --pd-accent-deep: #6d5538;
  --pd-line: rgba(60, 50, 40, 0.10);
  --pd-shadow: 0 8px 32px rgba(60, 45, 25, 0.06);
  --pd-shadow-lg: 0 16px 48px rgba(60, 45, 25, 0.10);
  --pd-radius: 20px;
  --pd-radius-lg: 28px;
  --pd-container: min(1100px, calc(100vw - 48px));
  --pd-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --pd-display: "Playfair Display", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--pd-bg);
  color: var(--pd-text);
  font-family: var(--pd-font);
  font-size: 1.05rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================================
   HEADER
   ============================================================ */
.pd-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px 0;
  background: rgba(248, 246, 242, 0.88);
  backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--pd-line);
}

.pd-header-inner {
  width: var(--pd-container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pd-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--pd-line);
  color: var(--pd-text);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 200ms ease;
}

.pd-back:hover {
  background: var(--pd-accent);
  color: #fff;
  border-color: var(--pd-accent);
  transform: translateY(-2px);
}

.pd-title-small {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--pd-muted);
}

/* ============================================================
   HERO
   ============================================================ */
.pd-hero {
  width: var(--pd-container);
  margin: 0 auto;
  padding: 60px 0 40px;
  text-align: center;
}

.pd-hero h1 {
  margin: 0;
  font-family: var(--pd-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.pd-hero p {
  max-width: 600px;
  margin: 16px auto 0;
  color: var(--pd-muted);
  font-size: 1.1rem;
  line-height: 1.7;
}

.pd-hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.pd-hero-tags span {
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(139, 111, 76, 0.08);
  color: var(--pd-accent-deep);
  font-size: 0.82rem;
  font-weight: 600;
}

/* ============================================================
   SCREENSHOTS GALLERY
   ============================================================ */
.pd-gallery {
  width: var(--pd-container);
  margin: 0 auto;
  padding: 40px 0 60px;
}

.pd-gallery h2 {
  margin: 0 0 8px;
  font-family: var(--pd-display);
  font-size: 1.8rem;
  font-weight: 600;
}

.pd-gallery > p {
  margin: 0 0 28px;
  color: var(--pd-muted);
  font-size: 0.95rem;
}

.pd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.pd-screenshot {
  position: relative;
  border-radius: var(--pd-radius);
  overflow: hidden;
  cursor: pointer;
  background: #e8e2d8;
  box-shadow: var(--pd-shadow);
  transition: all 300ms ease;
  aspect-ratio: 0.46;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.pd-screenshot:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: var(--pd-shadow-lg);
  border-color: var(--pd-accent);
}

.pd-screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.pd-screenshot:hover img {
  transform: scale(1.08);
}

.pd-screenshot-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.5) 100%);
  opacity: 0;
  transition: opacity 300ms ease;
  display: flex;
  align-items: flex-end;
  padding: 14px;
}

.pd-screenshot:hover .pd-screenshot-overlay {
  opacity: 1;
}

.pd-screenshot-overlay span {
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ============================================================
   FEATURES
   ============================================================ */
.pd-features {
  width: var(--pd-container);
  margin: 0 auto;
  padding: 40px 0 60px;
}

.pd-features h2 {
  margin: 0 0 28px;
  font-family: var(--pd-display);
  font-size: 1.8rem;
  font-weight: 600;
}

.pd-features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.pd-feature {
  padding: 24px;
  border-radius: var(--pd-radius);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--pd-line);
  box-shadow: var(--pd-shadow);
  transition: all 250ms ease;
}

.pd-feature:hover {
  transform: translateY(-3px);
  box-shadow: var(--pd-shadow-lg);
}

.pd-feature h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
}

.pd-feature p {
  margin: 0;
  color: var(--pd-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.pd-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 350ms ease;
  padding: 24px;
}

.pd-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.pd-lightbox-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 90vw;
  max-height: 90vh;
}

.pd-lightbox-content img {
  max-height: 75vh;
  max-width: 100%;
  border-radius: var(--pd-radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  object-fit: contain;
}

.pd-lightbox-info {
  text-align: center;
  color: #fff;
}

.pd-lightbox-info h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.pd-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 200ms ease;
  z-index: 10;
  display: grid;
  place-items: center;
}

.pd-lightbox-close:hover {
  background: var(--pd-accent);
  transform: scale(1.1);
}

.pd-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  transition: all 200ms ease;
  z-index: 10;
  display: grid;
  place-items: center;
}

.pd-lightbox-nav:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-50%) scale(1.1);
}

.pd-lightbox-prev {
  left: 20px;
}

.pd-lightbox-next {
  right: 20px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.pd-footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--pd-line);
  background: rgba(248, 246, 242, 0.6);
}

.pd-footer p {
  margin: 0;
  color: var(--pd-muted);
  font-size: 0.85rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .pd-features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  :root {
    --pd-container: min(100vw - 28px, 100%);
  }

  .pd-header-inner {
    flex-direction: column;
    text-align: center;
  }

  .pd-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .pd-features-grid {
    grid-template-columns: 1fr;
  }

  .pd-lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
  }

  .pd-lightbox-prev { left: 8px; }
  .pd-lightbox-next { right: 8px; }

  .pd-lightbox-close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
