/* ==========================================================================
   MODAL.CSS — "Featured Works" project detail popup
   Reuses the .window component (titlebar + border + shadow) so it matches
   the rest of the site automatically. Only adds overlay + sizing + the
   tag/meta styles specific to project detail content.
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  z-index: 100;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-window {
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
}

/* Titlebar becomes a 3-column grid so the label stays centered even with
   a close button sitting on the right (matches the look of the other,
   button-less windows). */
.modal-window .window__titlebar {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  padding: 0 var(--space-xs);
}

.modal-window .window__titlebar span {
  grid-column: 2;
  justify-self: center;
}

.modal-close {
  grid-column: 3;
  justify-self: end;
}

.modal-close {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-panel-bg);
  border: 1px solid var(--color-border-soft);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1;
  color: var(--color-text);
  padding: 0;
}

.modal-close:hover {
  background: var(--color-button-bg-hover);
}

.modal-body {
  overflow-y: auto;
  max-height: calc(85vh - var(--titlebar-height));
}

/* ----- content inside the modal (cloned from each card's <template>) --- */

.modal-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 28px;
  margin-bottom: var(--space-md);
}

.modal-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.modal-meta__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.modal-meta__label {
  width: 130px;
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

.modal-meta__value {
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  color: var(--color-text);
}

.tag {
  display: inline-block;
  padding: 2px var(--space-xs);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  background: var(--color-panel-bg);
  border: 1px solid var(--color-border-soft);
  color: var(--color-text);
}

/* Tag color variants — edit or add more of these to match your tag system */
.tag--blue   { background: #cfe0ff; border-color: #9db8e8; color: #1a3d7c; }
.tag--orange { background: #ffd9b8; border-color: #e0a468; color: #7a3d0a; }
.tag--green  { background: #cdeecb; border-color: #92c98d; color: #235c1c; }

.modal-image {
  width: 100%;
  border: 1px solid var(--color-border-soft);
  margin-bottom: var(--space-md);
}

.modal-text {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  margin-bottom: var(--space-md);
}

.modal-bullets {
  margin: 0 0 var(--space-md) 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.modal-bullets li {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
}

.modal-bullets strong {
  font-weight: 700;
}

/* Make cards themselves look clickable */
.card {
  cursor: pointer;
}

.card:hover {
  outline: 2px solid var(--color-border);
  outline-offset: -1px;
}

.card:focus-visible {
  outline: 2px solid var(--color-accent-start);
  outline-offset: 2px;
}
