/* Project cards (/projects/) and project detail pages (/projects/<slug>/). */

:root {
  --pj-text: var(--wp--preset--color--contrast, #000);
  --pj-muted: #5c5c5c;
  --pj-line: #e6e6e6;
  --pj-soft: #f6f6f4;
  --pj-accent: var(--wp--preset--color--primary, #ffa500);
  --pj-accent-ink: #9a5b00;
  --pj-radius: 14px;
}

.pj-wrap {
  box-sizing: border-box;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: var(--wp--style--root--padding-left, 40px);
}

.pj-wrap h1,
.pj-wrap h2,
.pj-wrap h3 {
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* ---------- Index ---------- */

.pj-intro {
  max-width: 640px;
  margin: 0 0 var(--wp--preset--spacing--50, 48px);
}

.pj-intro h1 {
  font-size: var(--wp--preset--font-size--xx-large, 36px);
  margin: 0 0 12px;
}

.pj-intro p {
  margin: 0;
  color: var(--pj-muted);
}

.pj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pj-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--pj-line);
  border-radius: var(--pj-radius);
  overflow: hidden;
  background: var(--wp--preset--color--base, #fff);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pj-card:hover,
.pj-card:focus-within {
  transform: translateY(-3px);
  border-color: #d4d4d4;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.18);
}

.pj-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--pj-line);
}

.pj-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px 22px;
}

.pj-meta {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pj-muted);
}

.pj-card h2 {
  margin: 0;
  font-size: 24px;
}

/* Whole card is the link target; keyboard focus lands on the title link. */
.pj-card h2 a {
  color: inherit;
  text-decoration: none;
}

.pj-card h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.pj-card h2 a:focus-visible {
  outline: none;
}

.pj-card:has(h2 a:focus-visible) {
  outline: 2px solid var(--pj-text);
  outline-offset: 2px;
}

.pj-card p.pj-tagline {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
}

.pj-card .pj-tags {
  margin-top: auto;
  padding-top: 6px;
}

.pj-more {
  font-size: 15px;
  font-weight: 500;
}

.pj-more span {
  display: inline-block;
  color: var(--pj-accent);
  transition: transform 0.2s ease;
}

.pj-card:hover .pj-more span {
  transform: translateX(4px);
}

.pj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pj-tags li {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--pj-soft);
  font-size: 13px;
  line-height: 1.5;
  color: #333;
}

/* ---------- Detail page ---------- */

.pj-back {
  display: inline-block;
  margin-bottom: var(--wp--preset--spacing--30, 28px);
  font-size: 15px;
  color: var(--pj-muted);
  text-decoration: none;
}

.pj-back:hover {
  color: var(--pj-text);
}

.pj-head {
  max-width: 760px;
}

.pj-head h1 {
  margin: 10px 0 14px;
  font-size: clamp(34px, 2rem + 2vw, 52px);
}

.pj-head .pj-tagline {
  margin: 0;
  font-size: var(--wp--preset--font-size--large, 22px);
  line-height: 1.5;
  color: #333;
}

.pj-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.pj-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--pj-text);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  color: var(--pj-text);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pj-links a:hover,
.pj-links li:first-child a {
  background: var(--pj-text);
  color: #fff;
}

.pj-links li:first-child a:hover {
  background: #333;
}

.pj-hero {
  margin: var(--wp--preset--spacing--50, 44px) 0 0;
}

.pj-hero img,
.pj-hero video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--pj-line);
  border-radius: var(--pj-radius);
}

.pj-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin: var(--wp--preset--spacing--50, 44px) 0 0;
  padding: 0;
  border: 1px solid var(--pj-line);
  border-radius: var(--pj-radius);
  overflow: hidden;
  background: var(--pj-line);
  list-style: none;
}

.pj-stats li {
  padding: 18px 20px;
  background: var(--wp--preset--color--base, #fff);
}

.pj-stats strong {
  display: block;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.pj-stats span {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--pj-muted);
}

.pj-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 56px;
  margin-top: var(--wp--preset--spacing--60, 56px);
}

.pj-prose {
  min-width: 0;
  max-width: 720px;
}

.pj-prose > :first-child {
  margin-top: 0;
}

.pj-prose h2 {
  margin: 2.2em 0 0.6em;
  font-size: var(--wp--preset--font-size--x-large, 28px);
}

.pj-prose h3 {
  margin: 1.8em 0 0.4em;
  font-size: var(--wp--preset--font-size--medium, 20px);
  font-weight: 600;
}

.pj-prose p,
.pj-prose ul {
  margin: 0 0 1em;
}

.pj-prose ul {
  padding-left: 1.2em;
}

.pj-prose ul.pj-features {
  padding-left: 0;
}

.pj-prose li {
  margin-bottom: 0.35em;
}

.pj-prose code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--pj-soft);
  font-size: 0.88em;
}

.pj-prose pre {
  margin: 0 0 1.4em;
  padding: 16px 18px;
  border: 1px solid var(--pj-line);
  border-radius: 10px;
  background: var(--pj-soft);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: auto;
}

.pj-prose pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.pj-figure {
  margin: 1.6em 0 2em;
}

.pj-figure img,
.pj-figure video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--pj-line);
  border-radius: 10px;
  background: #fff;
}

.pj-figure figcaption {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--pj-muted);
}

.pj-table {
  margin: 1.2em 0 1.8em;
  overflow-x: auto;
}

.pj-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.pj-table th,
.pj-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--pj-line);
  text-align: right;
  white-space: nowrap;
}

.pj-table th:first-child,
.pj-table td:first-child {
  text-align: left;
}

.pj-table thead th {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pj-muted);
  border-bottom-color: #cfcfcf;
}

.pj-table tfoot td {
  font-weight: 600;
  border-bottom: 0;
}

.pj-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 12px;
  margin: 1.2em 0 1.8em;
  padding: 0;
  list-style: none;
}

.pj-features li {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--pj-line);
  border-radius: 10px;
  font-size: 16px;
  line-height: 1.45;
}

.pj-features strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
}

.pj-features span {
  color: var(--pj-muted);
}

.pj-aside {
  align-self: start;
  position: sticky;
  top: 24px;
  font-size: 16px;
}

.pj-aside h2 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pj-muted);
}

.pj-aside section + section {
  margin-top: 28px;
}

.pj-aside dl {
  margin: 0;
}

.pj-aside dt {
  font-size: 14px;
  color: var(--pj-muted);
}

.pj-aside dd {
  margin: 0 0 12px;
}

.pj-aside code {
  white-space: nowrap;
  font-size: 0.9em;
}






@media (max-width: 860px) {
  .pj-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .pj-aside {
    position: static;
    padding: 18px 20px;
    border: 1px solid var(--pj-line);
    border-radius: var(--pj-radius);
  }
}

@media (max-width: 520px) {
  .pj-stats strong {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pj-card,
  .pj-more span {
    transition: none;
  }

  .pj-card:hover {
    transform: none;
  }
}
