/* ==========================================================
   BrickPi3 – Project Detail Page Styles
   ========================================================== */

/* ---------- Project Hero ---------- */
.project-page-hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark3) 100%);
  padding: 5rem 0 3.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.project-page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../assets/BrickPi3-How-it-Works.jpg') center/cover no-repeat;
  opacity: .05;
  pointer-events: none;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--red);
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}
.back-link:hover { color: #fff; }
.back-link::before { content: '←'; }

.project-page-hero .project-eyebrow {
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.project-page-hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  margin: .6rem 0 1rem;
  color: #fff;
  position: relative;
  z-index: 1;
}

.project-page-hero .project-lead {
  font-size: 1.08rem;
  color: rgba(255,255,255,.72);
  max-width: 680px;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

.hero-project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.3rem;
  position: relative;
  z-index: 1;
}
.hero-project-tags span {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff;
  border-radius: 2rem;
  padding: .25rem .85rem;
  font-size: .78rem;
  font-weight: 500;
}

/* ---------- Project Content Body ---------- */
.project-body-section {
  padding: 3.5rem 0 4rem;
  background: var(--white);
}

.project-article {
  max-width: 820px;
}

.project-article h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--dark);
  margin: 2.5rem 0 .8rem;
  padding-left: .9rem;
  border-left: 4px solid var(--red);
}

.project-article h2:first-child { margin-top: 0; }

.project-article h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark3);
  margin: 1.6rem 0 .5rem;
}

.project-article p {
  line-height: 1.78;
  color: #444;
  margin-bottom: .9rem;
}

.project-article ul,
.project-article ol {
  list-style: disc;
  padding-left: 1.6rem;
  margin-bottom: 1rem;
  color: #444;
  line-height: 1.85;
}

.project-article ol { list-style: decimal; }

.project-article a:not(.btn):not(.btn-outline-white) {
  color: var(--red);
  font-weight: 500;
}
.project-article a:not(.btn):not(.btn-outline-white):hover {
  color: var(--red-dark);
  text-decoration: underline;
}

.project-article code {
  background: #f0f0f6;
  border-radius: 4px;
  padding: .15em .45em;
  font-family: var(--mono);
  font-size: .86em;
  color: #c0392b;
}

.project-article pre {
  background: #1a1a2e;
  color: #e0e0e0;
  border-radius: 10px;
  padding: 1.3rem 1.5rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .87rem;
  line-height: 1.65;
  margin: 1rem 0 1.2rem;
  border: 1px solid rgba(255,255,255,.06);
}

/* ---------- Project Images ---------- */
.proj-img {
  width: 100%;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
  display: block;
}

.proj-img-sm {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius);
  margin: 1rem 0;
  box-shadow: var(--shadow);
  display: block;
}

/* ---------- Parts list ---------- */
.parts-list {
  background: var(--light);
  border-radius: var(--radius);
  padding: 1.3rem 1.6rem;
  margin: 1.2rem 0;
}

.parts-list li {
  list-style: none;
  padding: .4rem 0;
  border-bottom: 1px solid var(--light2);
  color: #333;
  font-size: .95rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}

.parts-list li:last-child { border-bottom: none; }

.parts-list li::before {
  content: '▸';
  color: var(--red);
  flex-shrink: 0;
  font-size: .75rem;
  margin-top: .25rem;
}

/* ---------- YouTube Consent Widget ---------- */
.yt-consent-wrapper {
  position: relative;
  max-width: 720px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 1.8rem 0;
  background: #000;
  aspect-ratio: 16 / 9;
  box-shadow: var(--shadow-lg);
}

.yt-consent-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  text-align: center;
  z-index: 2;
}

.yt-thumb-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(2px) brightness(.4);
  z-index: -1;
}

.yt-play-icon {
  width: 64px;
  height: 64px;
  background: rgba(255,0,0,.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(255,0,0,.5);
}

.yt-consent-text {
  color: #fff;
  font-size: .9rem;
  line-height: 1.5;
  max-width: 400px;
  margin: 0;
}

.yt-consent-text strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: .35rem;
}

.yt-accept-btn {
  background: var(--red);
  color: #fff;
  border: none;
  padding: .65rem 1.8rem;
  border-radius: 50px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  letter-spacing: .02em;
}
.yt-accept-btn:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
}
.yt-accept-btn:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 3px;
}

.yt-consent-wrapper iframe {
  display: none;
  width: 100%;
  height: 100%;
  border: none;
  position: absolute;
  inset: 0;
}

.yt-consent-wrapper.accepted .yt-consent-overlay { display: none; }
.yt-consent-wrapper.accepted iframe { display: block; }

/* ---------- Bottom CTA bar ---------- */
.project-cta-bar {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark3) 100%);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  margin-top: 3rem;
}

.project-cta-bar p {
  margin: 0;
  color: rgba(255,255,255,.7) !important;
  font-size: .92rem !important;
}

.project-cta-bar h3 {
  color: #fff !important;
  font-size: 1.15rem;
  margin: 0 0 .3rem !important;
  border: none !important;
  padding: 0 !important;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  flex-shrink: 0;
}

.btn-outline-white {
  border: 2px solid rgba(255,255,255,.6);
  color: #fff;
  background: transparent;
  padding: 10px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: .9rem;
  transition: all var(--transition);
  display: inline-block;
}
.btn-outline-white:hover {
  border-color: #fff;
  background: rgba(255,255,255,.1);
  color: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .project-page-hero { padding: 3.5rem 0 2.5rem; }
  .project-article h2 { font-size: 1.2rem; }
  .project-cta-bar { padding: 1.5rem; }
}
