/* News-first homepage additions.
   Loaded after the existing site.css so the current avatar and theme styles remain available. */

.news-main {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 72px;
}

.news-header {
  margin-bottom: 24px;
}

.news-header h1 {
  margin: 4px 0 0;
  font-size: clamp(2rem, 5vw, 4.25rem);
  line-height: 1;
}

.avatar-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-links a {
  display: inline-flex;
  border-radius: 50%;
}

.project-feed {
  display: grid;
  gap: 24px;
}

.project-card {
  display: grid;

  /* Image receives the majority of the desktop width. */
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.8fr);

  overflow: hidden;
  border: 1px solid var(--border, rgba(8, 29, 79, 0.18));
  border-radius: 24px;
  background: var(--panel, rgba(255, 255, 255, 0.84));
}

.project-card--featured {
  min-height: 430px;
}

.project-image-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 100%;
  padding: 20px;
  background: var(--surface, #f6f6f4);
}

.project-image {
  display: block;
  border: 1px dashed var(--accent);
  width: 100%;
  height: 100%;
  min-height: 360px;

  /* Show the complete reference plate instead of cropping its sides. */
  object-fit: contain;
  object-position: center;
}

.project-body {
  align-self: center;
  min-width: 0;
  padding: clamp(24px, 3.5vw, 42px);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 18px;
  font-size: 0.82rem;
  opacity: 0.78;
}

.project-status {
  font-weight: 700;
}

.project-title-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.project-title-row h2,
.project-card h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 2.35rem);
  line-height: 1.08;
}

.project-badge {
  display: block;
  width: 3.75rem;
  height: 3.75rem;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
}

.engineering-statement {
  margin: 18px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.02rem, 1.4vw, 1.22rem);
  line-height: 1.45;
}

.engineering-statement a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.project-summary {
  max-width: 42ch;
  margin: 16px 0 0;
  font-size: 0.97rem;
  line-height: 1.6;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.feed-message {
  padding: 28px 0;
}

.site-footer .footer-inner {
  justify-content: center;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
}

body.dark-mode .project-card {
  background: rgba(15, 24, 43, 0.88);
  border-color: rgba(255, 255, 255, 0.14);
}

body.dark-mode .project-image-link {
  background: #111827;
}
body.dark-mode .project-image {
   border: none;
}

@media (max-width: 900px) {
  .project-card {
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.9fr);
  }

  .project-image-link {
    padding: 14px;
  }

  .project-body {
    padding: 28px;
  }
}

@media (max-width: 760px) {
  .project-card {
    grid-template-columns: 1fr;
  }

  .project-card--featured {
    min-height: 0;
  }

  .project-image-link {
    padding: 0;
  }

  .project-image {
    min-height: 0;
    aspect-ratio: 3 / 2;
    object-fit: cover;
  }

  .project-body {
    padding: 24px;
  }

  .project-title-row h2,
  .project-card h2 {
    font-size: clamp(1.7rem, 8vw, 2.4rem);
  }

  .project-summary {
    max-width: 62ch;
  }
}
