:root {
  --project-gold: #C9A84C;
  --project-border: rgba(180, 150, 60, 0.2);
}

.projects-page-hero {
  padding: 48px 0 36px;
  background: var(--bg3, #ececef);
}

.projects-page-hero h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  margin: 12px 0 14px;
  line-height: 1.05;
}

.projects-page-hero .lead {
  max-width: 720px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted, #666);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding: 24px 0 64px;
}

.projects-featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 8px;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--bg2, #fff);
  border: 1px solid var(--project-border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  min-height: 100%;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--project-gold);
  box-shadow: 0 14px 40px rgba(0,0,0,0.08);
}

.project-card-media {
  aspect-ratio: 16 / 10;
  background: var(--bg3, #ececef);
  overflow: hidden;
  position: relative;
}

.project-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .project-card-media img {
  transform: scale(1.04);
}

.project-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  opacity: 0.35;
}

.project-card-body {
  padding: 20px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.project-card-meta {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--project-gold);
}

.project-card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
}

.project-card-sub {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #1a1a1a);
  margin: 0;
  line-height: 1.45;
}

.project-card-summary {
  font-size: 13px;
  color: var(--muted, #666);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.project-card-link {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--project-gold);
}

.project-card--featured .project-card-media {
  aspect-ratio: 4 / 3;
}

.projects-empty {
  text-align: center;
  padding: 64px 20px;
  color: var(--muted, #666);
  font-size: 15px;
}

/* ── Detail page ── */
.project-detail-hero {
  position: relative;
  height: clamp(220px, 32vh, 360px);
  background: var(--bg3, #17171e);
  overflow: hidden;
  border-radius: 0;
}

.project-detail-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  cursor: zoom-in;
  transition: transform 0.35s ease;
}

body.live-mode .project-detail-hero img {
  cursor: crosshair;
}

body.live-mode .project-detail-hero img:hover {
  transform: none;
}

.project-detail-hero img:hover {
  transform: scale(1.015);
}

.project-detail-hero img.project-lightbox-trigger {
  z-index: 0;
}

/* Заглавие над снимката */
.project-detail-head {
  background: var(--bg2, #fff);
  border-bottom: 1px solid var(--project-border);
  padding: 36px 0 40px;
}

body.dark .project-detail-head {
  background: var(--bg2, #111116);
}

.project-detail-head-inner {
  max-width: 880px;
}

.project-detail-head .tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--project-gold);
  margin: 0 0 14px;
}

.project-detail-head h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(2.25rem, 5.5vw, 3.75rem);
  font-weight: 800;
  color: var(--text, #1a1a1a);
  margin: 0 0 18px;
  line-height: 1.06;
  letter-spacing: -0.02em;
  max-width: 16ch;
}

.project-detail-lead {
  font-size: clamp(1.0625rem, 2.2vw, 1.3125rem);
  line-height: 1.55;
  color: var(--muted, #666);
  max-width: 42rem;
  margin: 0 0 28px;
  font-weight: 400;
}

.project-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.project-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1a1a1a);
  background: var(--bg3, #ececef);
  border: 1px solid var(--project-border);
  border-radius: 999px;
  padding: 8px 14px;
}

body.dark .project-meta-pill {
  background: var(--bg3, #17171e);
}

.project-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 56px;
  padding: 64px 0 80px;
  align-items: start;
}

.project-detail-content {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text, #1a1a1a);
  max-width: 42rem;
}

.project-detail-content p {
  margin: 0 0 1.35em;
}

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

.project-detail-aside {
  position: sticky;
  top: 96px;
  background: var(--bg2, #fff);
  border: 1px solid var(--project-border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.04);
}

.project-detail-aside h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0 0 14px;
}

.project-detail-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
}

.project-detail-facts li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--project-border);
}

.project-detail-facts li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.project-detail-facts span:first-child {
  color: var(--muted, #666);
  font-weight: 600;
}

.project-gallery {
  padding: 0 0 64px;
}

.project-gallery h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 20px;
}

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

.project-gallery-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--project-border);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.project-gallery-grid img:hover {
  transform: scale(1.02);
}

/* ── Lightbox popup ── */
.project-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.project-lightbox.open {
  opacity: 1;
  pointer-events: all;
}

body.project-lightbox-open {
  overflow: hidden;
}

.project-lightbox-stage {
  max-width: min(1200px, 96vw);
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-lightbox-img {
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  user-select: none;
}

.project-lightbox-close,
.project-lightbox-prev,
.project-lightbox-next {
  position: absolute;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.project-lightbox-close:hover,
.project-lightbox-prev:hover,
.project-lightbox-next:hover {
  background: rgba(201, 168, 76, 0.85);
  color: #000;
}

.project-lightbox-close {
  top: 16px;
  right: 16px;
  font-size: 32px;
}

.project-lightbox-prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.project-lightbox-next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.project-lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

@media (max-width: 640px) {
  .project-lightbox-prev,
  .project-lightbox-next {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  .project-lightbox-close {
    top: 10px;
    right: 10px;
  }
}

.breadcrumb {
  padding-top: 20px;
  padding-bottom: 4px;
  font-size: 13px;
  color: var(--muted, #666);
}
.container.breadcrumb {
  padding-top: 20px;
  padding-bottom: 4px;
}

.breadcrumb a {
  color: var(--muted, #666);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--project-gold);
}

.breadcrumb span {
  margin: 0 8px;
  opacity: 0.5;
}

#featured-projects {
  padding: 48px 0;
  background: var(--bg2, #fff);
}

body.dark #featured-projects {
  background: var(--bg2, #111116);
}

@media (max-width: 960px) {
  .projects-featured-grid {
    grid-template-columns: 1fr;
  }

  .project-detail-hero {
    height: clamp(200px, 28vh, 300px);
  }

  .project-detail-head {
    padding: 28px 0 32px;
  }

  .project-detail-head h1 {
    max-width: none;
  }

  .project-detail-layout {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 48px 0 64px;
  }

  .project-detail-content {
    max-width: none;
    font-size: 16px;
  }

  .project-detail-aside {
    position: static;
  }
}

@media (max-width: 640px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-detail-head {
    padding: 32px 0 40px;
  }

  .project-detail-lead {
    margin-bottom: 22px;
  }
}
