/* ── Project detail page ── */

.project-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 2.5rem;
  transition: color 0.15s;
}

.project-back:hover {
  color: var(--orange);
}

.project-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 4rem;
}

.project-hero-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-hero-img {
  width: 100%;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.project-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  padding-bottom: 0.1em;
  margin-bottom: 0.75rem;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.project-info p {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.8;
}

.project-section {
  margin-bottom: 4rem;
}

.project-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid var(--border);
}

.project-video video {
  width: 100%;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
  display: block;
}

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

.project-gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}

.project-gallery img:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-hover);
  border-color: var(--orange);
}

@media (max-width: 680px) {
  .project-hero {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .project-hero-left .project-buy .shop-btn {
    width: 100%;
  }
}

/* ── Lightbox ── */

.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.88);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox-overlay.lightbox-open {
  display: flex;
}

.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── Development Log list (on project page) ── */

.log-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.log-entry {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.log-entry:hover {
  border-color: var(--orange);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.log-entry-date {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 600;
  flex-shrink: 0;
}

.log-entry-title {
  font-size: 0.92rem;
  font-weight: 700;
}

.log-entry-arrow {
  margin-left: auto;
  color: var(--muted);
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}

.log-entry:hover .log-entry-arrow {
  color: var(--orange);
  transform: translateX(2px);
}

/* ── Instruction step page ── */

.instruction-content {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  margin-bottom: 3rem;
}

.instruction-content .log-body {
  flex: 1;
  margin-bottom: 0;
}

.instruction-content .log-media {
  flex: 0 0 40%;
  max-width: 40%;
  margin-bottom: 0;
}

@media (max-width: 680px) {
  .instruction-content {
    flex-direction: column;
  }

  .instruction-content .log-media {
    flex: none;
    max-width: 100%;
  }
}

/* ── Log entry page ── */

.log-media {
  margin-bottom: 2rem;
  max-width: 50%;
}

.log-header .log-media {
  flex: 0 0 42%;
  max-width: 42%;
  margin-bottom: 0;
}

.log-media img {
  width: 100%;
  display: block;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
}

.log-media-video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-md);
}

.log-media-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.log-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1.5px solid var(--border);
}

.log-header-text {
  flex: 1;
  min-width: 0;
}

.log-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  padding-bottom: 0.1em;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.log-date {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.log-body {
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.log-body p {
  font-size: 1rem;
  line-height: 1.85;
}

.log-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1.5px solid var(--border);
  gap: 1rem;
}

.log-nav-prev,
.log-nav-next {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  padding: 0.5rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  transition: color 0.15s, border-color 0.15s;
}

.log-nav-prev:hover,
.log-nav-next:hover {
  color: var(--orange);
  border-color: var(--orange);
}

/* ── Components + Links two-column grid (inside project info panel) ── */

.project-cl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: start;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.project-cl-col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.project-cl-col:first-child:not(:last-child) {
  border-right: 1.5px solid var(--border);
  padding-right: 1rem;
}

.project-cl-col:not(:first-child) {
  padding-left: 1rem;
}

.project-cl-grid .component-item {
  background: transparent;
  border-color: transparent;
  padding: 0.5rem 0.4rem;
  border-radius: 8px;
}

.project-cl-grid a.component-item-link:hover {
  border-color: transparent;
  box-shadow: none;
}

.component-list-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.component-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}

a.component-item-link {
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

a.component-item-link:hover {
  border-color: var(--orange);
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
}

.component-name {
  font-size: 0.88rem;
  font-weight: 600;
}

.component-arrow {
  color: var(--muted);
  flex-shrink: 0;
  font-size: 0.85rem;
  transition: color 0.15s, transform 0.15s;
}

a.component-item-link:hover .component-arrow {
  color: var(--orange);
  transform: translateX(2px);
}

/* ── Buy button under hero image ── */

.project-hero-left .project-buy {
  width: 100%;
}

.project-hero-left .project-buy .shop-btn {
  width: 100%;
  justify-content: center;
}

/* ── Named external links (in project info panel) ── */

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  transition: color 0.15s, border-color 0.15s;
}

.project-link:hover {
  color: var(--orange);
  border-color: var(--orange);
}
