/* ==========================================================================
   Our Work — gallery index + project detail + lightbox
   Reuses design tokens from styles.css (colors, spacing, type).
   ========================================================================== */

/* ---- Shared intro band (index + detail) ---- */
.work-hero {
  padding-block: calc(var(--space-7) + 3rem) clamp(1.5rem, 4vw, 2.5rem);
}
.work-hero .container {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.work-hero .section-title { max-width: 20ch; }
.work-back-link {
  align-self: flex-start;
  padding: 0.6rem 1.1rem;
}
.work-back-link svg { flex-shrink: 0; transition: transform var(--duration) var(--ease); }
.work-back-link:hover svg { transform: translateX(-3px); }
.work-back-link-bottom { margin-top: var(--space-5); }

/* ---- Index grid ---- */
.work-index-section { padding-top: 0; }
.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  padding-block: 0 var(--space-7);
}
@media (min-width: 640px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .work-grid { grid-template-columns: repeat(3, 1fr); }
}
.work-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.work-card:hover { border-color: var(--color-steel-light); transform: translateY(-2px); }
.work-card-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--color-bg-alt); }
.work-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--duration) var(--ease); }
.work-card:hover .work-card-media img { transform: scale(1.05); }
.work-card-body { padding: var(--space-3); }
.work-card-body h3 {
  font-size: 1.3rem;
  line-height: 1.15;
  margin-bottom: var(--space-1);
}
.work-card-body p {
  font-family: var(--font-body);
  color: var(--color-text-muted);
  font-size: 0.95rem;
  text-transform: none;
}
.work-empty {
  padding-block: var(--space-6);
  color: var(--color-text-muted);
  font-family: var(--font-body);
}

/* ---- Homepage "See full gallery" CTA on the #work teaser section ---- */
.gallery-cta { display: flex; justify-content: center; padding-top: var(--space-4); }

/* ---- Project detail ---- */
.project-detail { padding-top: 0; padding-bottom: var(--space-7); }
.project-summary {
  font-family: var(--font-body);
  color: var(--color-text-muted);
  font-size: 1.125rem;
  max-width: 70ch;
  text-transform: none;
}

.project-hero-media {
  margin-block: 0 var(--space-5);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.project-hero-media img {
  width: 100%;
  max-height: 640px;
  object-fit: cover;
  cursor: zoom-in;
}

/* Description + CTA sit side by side on desktop; the CTA drops below the text on
   narrow screens. The description keeps its ~70ch readable measure and the freed
   space on the right becomes the CTA column rather than dead margin. */
.project-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
@media (min-width: 900px) {
  .project-body { grid-template-columns: minmax(0, 70ch) minmax(260px, 1fr); gap: var(--space-6); }
}

.project-description {
  font-family: var(--font-body);
  color: var(--color-text);
  font-size: 1.05rem;
  line-height: 1.7;
  text-transform: none;
  white-space: pre-line;
}

.project-cta-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3);
}
@media (min-width: 900px) {
  /* Follows the reader down the description instead of sitting at the top. */
  .project-cta-card { position: sticky; top: calc(var(--space-7) + 1rem); }
}
.project-cta-card h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-2);
}
.project-cta-card p {
  font-family: var(--font-body);
  color: var(--color-text-muted);
  font-size: 0.95rem;
  text-transform: none;
  margin-bottom: var(--space-3);
}
.project-cta-card .btn { width: 100%; justify-content: center; }
.project-cta-phone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: var(--space-2);
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--color-text);
}
.project-cta-phone svg { width: 18px; height: 18px; color: var(--color-accent); }
.project-cta-phone:hover { color: var(--color-accent); }

.project-photos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}
@media (min-width: 640px) {
  .project-photos-grid { grid-template-columns: repeat(3, 1fr); }
}
.project-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  cursor: zoom-in;
}
.project-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--duration) var(--ease); }
.project-photo:hover img { transform: scale(1.05); }

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 6, 0.94);
  padding: var(--space-3);
}
.lightbox.is-open { display: flex; }
.lightbox-figure {
  position: relative;
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.lightbox-img {
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  object-fit: contain;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
}
.lightbox-caption {
  font-family: var(--font-body);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  text-align: center;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  color: var(--color-text);
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { background: var(--color-surface-2); border-color: var(--color-steel-light); }
.lightbox-close { top: -18px; right: -18px; }
.lightbox-prev { left: -10px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: -10px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .lightbox-close { top: 0; right: 0; }
  .lightbox-prev { left: 0; }
  .lightbox-next { right: 0; }
}
