/* ===== PROSJEKTER PAGE (prosjekter.html only) =====
   Every bit of text on this page switches to Inter (matching the newer design language),
   set once on body so it covers the projects grid AND the footer — no cross-fade trick
   needed since this is its own page load now rather than a same-document anchor jump. */

body {
  font-family: 'Inter', Georgia, sans-serif;
}

.projects {
  background: #ffffff;
  padding: 4rem 3rem;
  /* Keep the white area at least a screen tall, so a category with only one or two
     projects doesn't leave the page's dark body color showing below the footer. */
  min-height: 100vh;
}

.projects-heading {
  font-size: 1.8rem;
  font-weight: 700;
  color: #4F3232;
  margin-bottom: 1.5rem;
}

/* ===== CATEGORY FILTER (tabs) =====
   Plain text tabs with an underline on the active one — one click to switch, and every
   category stays visible so visitors see there's more than UX. Behavior: prosjekter.js. */
.project-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  border-bottom: 1px solid #e7e4df;
  margin-bottom: 2.5rem;
}

.project-filter button {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px; /* sit the active underline on top of the row's divider */
  padding: 0.6rem 0;
  font: inherit;
  font-size: 0.9rem;
  color: #8a7f79;
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.project-filter button:hover {
  color: #4F3232;
}

.project-filter button[aria-selected="true"] {
  color: #4F3232;
  font-weight: 600;
  border-bottom-color: #4F3232;
}

.project-filter button:focus-visible {
  outline: 2px solid #4F3232;
  outline-offset: 4px;
  border-radius: 2px;
}

.project-filter__count {
  margin-left: 0.4rem;
  font-size: 0.7rem;
  font-weight: 400;
  color: #b3aaa4;
}

.project-card[hidden] {
  display: none;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  max-width: 100%;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur) var(--ease);
}

.project-card:hover {
  transform: translateY(-5px);
}

/* For cards with no detail page to link to yet — same look, but no click affordance. */
.project-card--static {
  cursor: default;
}

.project-card--static:hover {
  transform: none;
}

.project-card--static:hover .project-img {
  transform: none;
}

/* Neutral frame: every preview sits inset on the same light gray, so the images' own
   (very different) background colors read as framed pictures rather than a patchwork. */
.project-img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 4 / 3;
  background: #f4f3f1;
  padding: 1.5rem;
  /* Center the image in the frame: wider/taller previews (e.g. 16:10) get gray space
     around them instead of having their edges cropped off. */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sized to fit whole inside the frame at its own aspect ratio (never cropped), so the
   rounded corners land on the actual picture rather than on letterboxing. */
.project-img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 3px;
  transition: transform 0.45s var(--ease);
}

.project-card:hover .project-img {
  transform: scale(1.03);
}

/* Stand-in for projects without a preview image yet (e.g. Busken). */
.project-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #d6d1ca;
  border-radius: 3px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.8rem;
  color: #a39891;
}

.project-img.light {
  background: #faf9f7;
}

.project-img.pink-bg {
  background: #e8d5f0;
}


.project-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.project-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #4F3232;
  line-height: 1.4;
  transition: color var(--dur) var(--ease);
}

.project-card:hover .project-title {
  color: #4F3232;
}

.project-title small {
  font-weight: 400;
  font-size: 0.8rem;
  color: #db921c;
}

.project-year {
  font-size: 0.8rem;
  color: #7a6d5a;
  white-space: nowrap;
  margin-top: 2px;
}

.project-desc {
  font-size: 0.8rem;
  color: var(--text-mid);
  line-height: 1.6;
  transition: color var(--dur) var(--ease);
}

.project-card:hover .project-desc {
  color: #4F3232;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  .projects {
    padding: 3rem 1.5rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-img-wrap {
    padding: 1rem;
  }
}
