/* ============ HackAD page — overrides & layout ============ */

/* Hero image card */
.project-hero-figure {
  margin: 0 auto;                       /* center the figure horizontally */
  max-width: 900px;                     /* limit the width to make it smaller */
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}
.project-hero-figure img {
  width: 100%;
  height: clamp(300px, 40vw, 500px);    /* smaller height than before */
  object-fit: contain;
  display: block;
}

/* Hero section spacing */
.project-hero {
  padding-top: .5rem;
  padding-bottom: 0;                    /* no extra bottom space */
}

/* Title + subtitle centered and tight */
.project-hero-headings {
  text-align: center;
  max-width: 900px;
  margin: 1rem auto 0;                  /* center block */
  padding: 0;
}
.project-hero-headings h1 {
  margin: 0;
  font-size: clamp(2.4rem, 3.2vw + 1rem, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.project-hero-headings .project-subtitle {
  margin: .35rem 0 0;
  font-size: clamp(1.05rem, .5vw + 1rem, 1.35rem);
  color: var(--muted);
}

/* Minimize gap between hero and the next section */
.project-hero + .section {
  padding-top: .5rem;                   /* override base .section padding */
}

/* Main content + sticky meta */
.project-layout {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;           /* mobile */
}
@media (min-width: 900px) {
  .project-layout { grid-template-columns: 2fr 1fr; } /* desktop */
}

/* --- Two-column label/content grid for the article --- */
.project-body{
  display:grid;
  grid-template-columns: minmax(170px, 240px) 1fr; /* left label / right content */
  column-gap: 1.25rem;
  row-gap: .9rem;
  align-items:start;
}

/* Intro paragraph spans full width */
.project-body > p:first-child{
  grid-column: 1 / -1;
  margin-top: 0;
}

/* Put each H2 in the left column */
.project-body > h2{
  grid-column: 1;
  margin: 0;                 /* remove default heading top margin */
  line-height: 1.25;
}

/* Put the element right after each H2 in the right column
   (your paragraph, list, etc.) */
.project-body > h2 + *{
  grid-column: 2;
  margin: 0;                 /* tighten spacing */
}

/* Tidy lists in the right column */
.project-body ul{
  margin: 0;
  padding-left: 1.1rem;
}

/* Mobile: stack to one column */
@media (max-width: 700px){
  .project-body{
    grid-template-columns: 1fr;
  }
  .project-body > h2,
  .project-body > h2 + *{
    grid-column: 1;
  }
  .project-body > h2{ margin-top: .35rem; }
}


/* Gallery */
.project-gallery { margin-top: .75rem; }
.project-gallery h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
.gallery-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: 1fr;            /* mobile */
}
@media (min-width: 700px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); } /* desktop */
}
.gallery-item {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}
.gallery-item img { width: 100%; height: auto; display: block; }

/* Util */
.nowrap { white-space: nowrap; }

/* Project meta card styling */
.project-meta {
  position: sticky;
  top: 80px;                  /* stick below header when scrolling */
}

.project-meta h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text);
}

/* Enhanced facts styling */
.facts {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;                  /* space between fact items */
}

.facts dt {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand);        /* highlight the labels */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.facts dd {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

.facts dd a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}

.facts dd a:hover {
  text-decoration: underline;
}


/* ===== Lightbox (image overlay) ===== */
.lightbox[hidden] { display: none; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.lightbox-inner {
  position: relative;
  width: 100%;
  max-width: min(1200px, 92vw);
}

.lightbox-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 82vh;
  border-radius: 12px;
  box-shadow: var(--shadow);
  background: #000; /* avoids flash on slow loads */
}

.lightbox-caption {
  margin-top: .5rem;
  text-align: center;
  color: #e5e7eb;
  font-size: .95rem;
}

.lightbox-close {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-close:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }