/* ==========================================================================
   TTPA — Portfolio (posts page) styles, templates/home.html only
   Requires css/base.css to be loaded first.
   ========================================================================== */

/* PORTFOLIO HERO — from ttpa/css/portfolio.css */
.portfolio-hero{
  padding-top:20px;
  padding-bottom:20px;
}
/* the page's main heading, so an h1 — styled like base.css h2.section-title */
h1.section-title{font-size:clamp(40px,6vw,50px);font-weight:600;max-width:16ch;}

/* PROJECT GRID — capped at 1250px wide and centred; below that it runs
   to the header/footer gutters. 3 across, 2 on tablets, 1 on mobile. */
.ttpa-portfolio{
  max-width:1250px;
  box-sizing:content-box; /* the cap is the cards' width, not counting the gutters */
  margin-inline:auto;
  padding:0 30px 80px;
}
.ttpa-portfolio .wp-block-post-template{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:48px 30px;
}
@media (max-width:900px){
  .ttpa-portfolio .wp-block-post-template{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:600px){
  .ttpa-portfolio{padding:0 20px 60px;}
  .ttpa-portfolio .wp-block-post-template{grid-template-columns:1fr;gap:40px;}
}

/* featured image, with the post title revealed as a caption on hover */
.ttpa-card-media{
  position:relative;
  overflow:hidden;
  background:var(--ink);
}
.ttpa-card-media .wp-block-post-featured-image img{
  display:block;width:100%;
  transition:transform .6s ease;
}
.ttpa-card-media:hover .wp-block-post-featured-image img{transform:scale(1.04);}
.ttpa-card-caption{
  position:absolute;left:0;right:0;bottom:0;
  padding:48px 20px 18px;
  background:linear-gradient(to top, rgba(14,14,18,0.75), transparent);
  color:var(--white);
  font-size:15px;font-weight:600;letter-spacing:-0.01em;line-height:1.3;
  opacity:0;transform:translateY(8px);
  transition:opacity .3s ease, transform .3s ease;
  pointer-events:none; /* clicks go through to the image link */
}
.ttpa-card-media:hover .ttpa-card-caption,
.ttpa-card-media:focus-within .ttpa-card-caption{opacity:1;transform:none;}
/* no hover on touch screens, so always show the caption there */
@media (hover:none){
  .ttpa-card-caption{opacity:1;transform:none;}
}
/* posts without a featured image: show the title as plain text instead */
.ttpa-card-media:not(:has(img)){background:none;}
.ttpa-card-media:not(:has(img)) .ttpa-card-caption{
  position:static;opacity:1;transform:none;
  padding:0;background:none;color:var(--ink);
}

/* excerpt + read more, below the image */
.ttpa-card-excerpt{
  margin-top:18px;
  font-size:16px;line-height:1.6;color:var(--ink-soft);
}
.ttpa-card-excerpt .wp-block-post-excerpt__more-text{margin-top:12px;}
.ttpa-card-excerpt .wp-block-post-excerpt__more-link{
  font-size:13px;text-transform:uppercase;letter-spacing:0.04em;
  color:var(--ink);transition:color .2s ease;
}
.ttpa-card-excerpt .wp-block-post-excerpt__more-link:hover{color:var(--blue);}

/* shown in place of the grid when there are no posts — centred, at the
   same size and weight as the page title (h1.section-title) */
.ttpa-no-results{
  font-family:var(--wp--preset--font-family--inter);
  font-size:40px;
  font-weight:600;
  letter-spacing:-0.02em;
  line-height:1.02;
  text-align:center;
  padding:60px 0;
}

/* pagination, only shown when there are more posts than fit on a page */
.ttpa-portfolio .wp-block-query-pagination{margin-top:64px;font-size:14px;}
.ttpa-portfolio .wp-block-query-pagination a:hover{color:var(--blue);}
