.ke-projects__list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:50px 30px; }
.ke-projects__pagination { display:flex; justify-content:center; gap:20px; margin-top:40px; }
.ke-project-single { padding-top:55px; padding-bottom:75px; }
.ke-project-single__heading { text-align:center; max-width:900px; margin:0 auto 55px; padding:0 24px; }
.ke-project-single__heading h1 { font-size:clamp(2.8rem,6vw,5rem); line-height:1.05; }
.ke-project-single__heading .ke-lead { max-width:650px; margin:25px auto; }
.ke-project-content { max-width:1100px; margin:auto; padding:0 24px; }
.ke-project-content > p, .ke-project-content > h2, .ke-project-content > h3, .ke-project-content > blockquote, .ke-project-content > ul, .ke-project-content > ol { max-width:650px; margin-left:auto; margin-right:auto; }
.ke-project-content > p { line-height:1.8; margin-bottom:40px; }
.ke-project-content > h2 { margin-top:55px; font-size:clamp(2rem,4vw,3rem); }
.ke-project-content > figure { margin-top:35px; margin-bottom:35px; }
.ke-project-content img { height:auto; max-width:100%; }
.ke-project-content .wp-block-gallery { gap:20px; }
.ke-project-content .ke-lightbox-trigger { background:none; border:0; padding:0; display:block; width:100%; color:inherit; cursor:zoom-in; }
.ke-project-content .wp-block-gallery .ke-lightbox-trigger { height:100%; flex:1; }
.ke-project-content .wp-block-gallery .ke-lightbox-trigger img { width:100%; height:100%; object-fit:cover; }
.ke-project-back { text-align:center; margin:55px 0 0; }
.ke-lightbox { background:var(--wp--preset--color--canvas); color:var(--wp--preset--color--ink); border:0; padding:20px; width:min(1100px,94vw); max-height:94dvh; }
.ke-lightbox::backdrop { background:rgb(0 0 0 / 85%); }
.ke-lightbox > button { display:block; margin-left:auto; }
.ke-lightbox button { background:var(--wp--preset--color--ink); color:var(--wp--preset--color--canvas); padding:12px 16px; border:0; cursor:pointer; }
.ke-lightbox > img { display:block; width:100%; height:70dvh; object-fit:contain; margin:15px 0; }
.ke-lightbox__controls { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.ke-lightbox__controls p { margin:0; }
@media(max-width:700px) {
 .ke-projects__list { grid-template-columns:1fr; gap:40px; }
 .ke-lightbox { padding:12px; }
 .ke-lightbox button { padding:12px; }
}

.ke-project-content .wp-block-gallery.has-nested-images {
 display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; align-items:start;
}
.ke-project-content .wp-block-gallery.has-nested-images figure.wp-block-image {
 width:100% !important; flex:none; margin:0 !important; min-width:0; align-self:start;
}
.ke-project-content .wp-block-gallery.has-nested-images .ke-lightbox-trigger { height:clamp(260px,40vw,520px); flex:none; }
.ke-project-content .wp-block-gallery.has-nested-images .ke-lightbox-trigger img { height:100%; width:100%; object-fit:contain; }
.ke-project-content > .wp-block-image { text-align:center; }
.ke-project-content > .wp-block-image img { max-height:620px; width:auto; max-width:100%; object-fit:contain; margin:auto; }
@media(max-width:700px) {
 .ke-project-content .wp-block-gallery.has-nested-images { gap:12px; }
 .ke-project-content .wp-block-gallery.has-nested-images .ke-lightbox-trigger { height:min(64vw,320px); }
 .ke-project-content > .wp-block-image img { max-height:480px; }
}

.ke-project-single__heading .ke-lead { font-family:var(--wp--preset--font-family--body, sans-serif); font-size:clamp(1rem,1.6vw,1.2rem); line-height:1.7; max-width:60ch; overflow-wrap:anywhere; }
.ke-project-content > :is(p,h2,h3,h4,h5,h6,blockquote,ul,ol) { max-width:650px; margin-left:auto; margin-right:auto; text-align:left; overflow-wrap:anywhere; }
.ke-project-content > :is(h2,h3,h4,h5,h6) { margin-top:64px; margin-bottom:20px; line-height:1.2; }
.ke-project-content > p { margin-top:0; margin-bottom:28px; }
.ke-project-content > figure { margin-top:48px; margin-bottom:48px; }
@media(max-width:700px) {
 .ke-project-content > :is(h2,h3,h4,h5,h6) { margin-top:40px; }
 .ke-project-content > figure { margin-top:32px; margin-bottom:32px; }
}

/* Base card styling is retained for related projects on detail pages. */
.ke-project-archive-card { min-width:0; }
.ke-project-archive-card > a { color:inherit; text-decoration:none; display:block; }
.ke-project-archive-card .ke-project-cover { display:block; width:100%; height:auto; aspect-ratio:4/5; object-fit:cover; }
.ke-project-archive-card .ke-eyebrow { margin:24px 0 10px; }
.ke-project-archive-card h2 { font-size:clamp(1.7rem,3vw,2.5rem); line-height:1.15; margin:0; overflow-wrap:anywhere; }
.ke-project-archive-card a:hover h2 { text-decoration:underline; text-underline-offset:.2em; }
.ke-project-single :is(a,button):focus-visible, .ke-project-archive-card a:focus-visible, .ke-lightbox button:focus-visible { outline:2px solid currentColor; outline-offset:5px; }
.ke-project-hero, .ke-project-details, .ke-project-cta, .ke-project-related { max-width:1100px; margin:48px auto; padding:0 24px; box-sizing:border-box; }
.ke-project-hero .ke-project-cover { display:block; width:100%; height:auto; max-height:80svh; object-fit:contain; }
.ke-project-hero .ke-lightbox-trigger { display:block; width:100%; padding:0; border:0; background:none; cursor:zoom-in; }
.ke-project-details { display:grid; grid-template-columns:max-content minmax(0,1fr); gap:12px 24px; }
.ke-project-details dt { font-weight:600; }
.ke-project-details dd { margin:0; overflow-wrap:anywhere; }
.ke-project-cta { text-align:center; padding-top:32px; padding-bottom:32px; }
.ke-project-related > h2 { margin-bottom:32px; }
@media(max-width:700px) {
 .ke-project-details { grid-template-columns:1fr; gap:8px; }
 .ke-project-details dd { margin-bottom:16px; }
 .ke-lightbox__controls { flex-wrap:wrap; }
}

/* Follow the site palette in both system color schemes. */
.ke-projects {
  --ke-portfolio-background: var(--wp--preset--color--canvas);
  --ke-portfolio-text: var(--wp--preset--color--ink);
  --ke-portfolio-accent: var(--wp--preset--color--champagne);
  color-scheme: light dark;
  max-width: none;
  background: var(--ke-portfolio-background);
  color: var(--ke-portfolio-text);
}
.ke-projects :is(h1, h2, h3) { color: var(--ke-portfolio-text); }
.ke-projects > * {
  max-width: calc(1600px - (2 * var(--ke-gutter, 64px)));
  margin-inline: auto;
}
.ke-projects .ke-section-heading > p { color: color-mix(in srgb, var(--ke-portfolio-text) 72%, transparent); }
.ke-projects .ke-section-heading h1 {
  margin: 0;
  font-family: var(--wp--preset--font-family--heading);
  font-size: 4rem;
  font-weight: 500;
  line-height: .95;
}
.ke-projects .ke-eyebrow { color: var(--ke-portfolio-accent); }
.ke-projects > .ke-projects__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(48px, 6vw, 88px) clamp(24px, 3vw, 56px);
}
.ke-project-card { min-width: 0; }
.ke-project-card__photos {
  display: block;
  overflow: hidden;
  text-decoration: none;
}
.ke-project-card .ke-project-cover {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}
.ke-project-card--featured { grid-column: 1 / -1; }
.ke-project-card--featured .ke-project-card__photos .ke-project-cover { aspect-ratio: 16 / 10; max-height: none; object-fit: cover; }
.ke-project-card:not(.ke-project-card--featured) .ke-project-card__photos .ke-project-cover { aspect-ratio: 4 / 5; max-height: none; object-fit: cover; }
.ke-project-card__caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px 36px;
  padding-top: 24px;
}
.ke-project-card__caption > div { min-width: 0; }
.ke-project-card__caption .ke-eyebrow { margin: 0 0 12px; font-size: .68rem; }
.ke-project-card__caption h3 { margin: 0 0 12px; font-family: var(--wp--preset--font-family--heading); font-size: 2rem; font-weight: 500; line-height: 1.15; }
.ke-project-card--featured .ke-project-card__caption h3 { font-size: 2.65rem; }
.ke-project-card__caption h3 a,
.ke-projects .ke-project-archive-card h2 a { color: inherit; text-decoration: none; }
.ke-project-card__caption p:not(.ke-eyebrow),
.ke-projects__list--archive .ke-project-archive-card__intro {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: color-mix(in srgb, var(--ke-portfolio-text) 76%, transparent);
  font-size: .96rem;
  line-height: 1.7;
  margin: 0;
}
.ke-project-card__caption .ke-text-link,
.ke-projects__list--archive .ke-text-link { color: var(--ke-portfolio-text); white-space: nowrap; }
.ke-projects__more { display: flex; justify-content: center; margin-top: clamp(48px, 7vw, 88px); }
.ke-projects__cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ke-portfolio-accent);
  color: var(--ke-portfolio-text);
  font-size: .86rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-decoration: none;
}
.ke-projects__cta span,
.ke-projects .ke-text-link span { color: var(--ke-portfolio-accent); }
.ke-projects > .ke-projects__list--archive {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(48px, 6vw, 80px) clamp(24px, 3vw, 48px);
}
.ke-projects__list--archive .ke-project-archive-card,
.ke-projects__list--archive .ke-project-archive-card:nth-child(n) {
  width: auto;
  margin: 0;
  align-self: stretch;
}
.ke-projects__list--archive .ke-project-archive-card__image {
  display: block;
  overflow: hidden;
}
.ke-projects__list--archive .ke-project-archive-card .ke-project-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.ke-projects__list--archive .ke-project-archive-card .ke-eyebrow { margin: 22px 0 10px; font-size: .68rem; }
.ke-projects__list--archive .ke-project-archive-card h2 { margin: 0 0 12px; font-family: var(--wp--preset--font-family--heading); font-size: 2rem; font-weight: 500; line-height: 1.15; }
.ke-projects__list--archive .ke-project-archive-card__intro { margin-bottom: 18px; }
.ke-projects__list--archive .ke-project-archive-card .ke-text-link { margin-top: 18px; }
.ke-projects__related { margin-top: 72px; }
.ke-projects__related p { color: color-mix(in srgb, var(--ke-portfolio-text) 72%, transparent); line-height: 1.8; }
.ke-projects__related a { color: var(--ke-portfolio-text); text-decoration-color: var(--ke-portfolio-accent); text-underline-offset: .2em; }
.ke-projects__pagination a,
.ke-projects__pagination span { color: var(--ke-portfolio-text); }
.ke-projects :is(a, button):focus-visible { outline: 2px solid var(--ke-portfolio-accent); outline-offset: 5px; }
@media (min-width: 701px) and (max-width: 1100px) {
  .ke-projects > .ke-projects__list--archive { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .ke-projects .ke-section-heading { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .ke-projects .ke-section-heading h2,
  .ke-projects .ke-section-heading h1 { font-size: 3rem; }
  .ke-projects > .ke-projects__list,
  .ke-projects__list--archive { grid-template-columns: minmax(0, 1fr); gap: 56px; }
  .ke-projects__list--archive .ke-project-archive-card:nth-child(n) { width: 100%; margin: 0; }
  .ke-project-card--featured .ke-project-card__photos .ke-project-cover { aspect-ratio: 4 / 3; }
  .ke-project-card__caption,
  .ke-project-card--featured .ke-project-card__caption { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 18px; }
  .ke-project-card__caption h3,
  .ke-project-card--featured .ke-project-card__caption h3 { font-size: 2rem; }
  .ke-projects__list--archive .ke-project-archive-card h2 { font-size: 1.8rem; }
  .ke-projects__related { margin-top: 56px; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .ke-project-card__photos .ke-project-cover,
  .ke-projects__list--archive .ke-project-archive-card__image .ke-project-cover {
    transition: transform 650ms ease;
  }
  .ke-project-card__photos:hover .ke-project-cover,
  .ke-projects__list--archive .ke-project-archive-card__image:hover .ke-project-cover { transform: scale(1.015); }
  .ke-projects .ke-text-link span,
  .ke-projects__cta span { transition: transform 250ms ease; }
  .ke-projects .ke-text-link:hover span,
  .ke-projects__cta:hover span { transform: translateX(3px); }
}
