/* ============================================================
   DIVINITY | work.css — dynamic Work page: filters, loading /
   empty states, project dialog. Reuses the .work-card design
   from main.css; adds only what the dynamic pages need.
   ============================================================ */

/* Loading / empty / error messages inside a work grid */
.work-state {
  grid-column: 1 / -1;
  font-size: 15px;
  color: var(--text-light);
  opacity: 0.55;
  padding: 32px 4px;
  letter-spacing: -0.01em;
}

/* Placeholder when a project has no cover image */
.work-card-noimg {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8dfd2 0%, #f2cdc3 100%);
}

/* work-card-link rendered as a button must look identical to the anchor */
button.work-card-link {
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

/* ---- Sub-page hero spacing (Work / Start a Project) ---- */
.page-hero {
  max-width: 1400px;
  margin: 0 auto;
  padding: 140px 24px 20px;
}
.page-hero .eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-orange);
  margin-bottom: 14px;
}
.page-hero h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.page-hero p.lead {
  font-size: 16px;
  opacity: 0.6;
  max-width: 560px;
  margin-top: 16px;
  line-height: 1.6;
}

/* ---- Filters ---- */
.work-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto 28px;
  padding: 0 24px;
}
.work-filter {
  appearance: none;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-light);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  opacity: 0.65;
  transition: opacity .2s, background .2s, color .2s;
}
.work-filter:hover { opacity: 1; }
.work-filter.selected {
  opacity: 1;
  background: var(--accent-orange);
  color: var(--text-dark);
  border-color: transparent;
}

/* ---- Project detail dialog ---- */
.project-dialog {
  border: none;
  padding: 0;
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: calc(100% - 32px);
  background: var(--bg-cream);
  color: var(--text-dark);
}
.project-dialog::backdrop { background: rgba(10,8,7,0.6); }
.project-dialog .dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  appearance: none;
  border: none;
  background: rgba(26,22,20,0.08);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-dark);
}
.project-dialog [data-dialog-body] { padding: 24px; }
.dialog-media img { width: 100%; border-radius: var(--radius-md); margin-bottom: 18px; }
.dialog-title { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; }
.dialog-desc { font-size: 15px; line-height: 1.6; opacity: 0.75; margin: 16px 0; white-space: pre-wrap; }
.dialog-actions { margin-top: 10px; }

/* ============================================================
   ADDED: modal fits the viewport + scrolls internally, and the
   Work/Start-a-Project sub-hero stays comfortable on phones.
   Additive only — the rules above are untouched.
   ============================================================ */

/* Keep the project dialog inside the viewport on every device and
   let its content scroll internally instead of the page. */
.project-dialog {
  max-height: calc(100dvh - 32px);
  max-height: calc(100vh - 32px);
  overflow: hidden;
}
.project-dialog [data-dialog-body] {
  max-height: calc(100dvh - 32px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
/* Cover image inside the dialog keeps its aspect ratio, never stretched */
.dialog-media img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

/* Tablet / small-laptop sub-hero spacing */
@media (max-width: 1024px) {
  .page-hero {
    padding: 128px 24px 16px;
  }
}

/* Phones */
@media (max-width: 640px) {
  .page-hero {
    padding: 116px 20px 12px;
  }
  .page-hero p.lead {
    font-size: 15px;
  }
  .work-filters {
    padding: 0 20px;
    gap: 8px;
  }
  .project-dialog {
    width: calc(100% - 24px);
  }
  .project-dialog [data-dialog-body] {
    padding: 18px;
  }
  .dialog-title {
    font-size: 24px;
  }
}

/* Very small Android phones */
@media (max-width: 400px) {
  .page-hero {
    padding: 104px 16px 10px;
  }
  .work-filters {
    padding: 0 16px;
  }
  .work-filter {
    padding: 8px 14px;
    font-size: 12px;
  }
}
