/* Closing sections shared by Studio News portfolio projects. */
.portfolio-ending {
  --ending-paper: #f5f5f0;
  --ending-ink: #1a1a18;
  --banner-ink: #fff;
  background: var(--ending-paper);
  color: var(--ending-ink);
  font: 400 16px/1.5 Inter, "Segoe UI", sans-serif;
}
.portfolio-ending *, .portfolio-footer * { box-sizing: border-box; }
.portfolio-ending__inner {
  width: min(94%, 1170px);
  margin-inline: auto;
  padding-inline: 16px;
}
.portfolio-ending__related { padding-block: clamp(42px, 6vw, 80px); }
.portfolio-ending .portfolio-ending__label {
  margin: 0 0 24px;
  color: #565651;
  font: 600 12px/1.4 Inter, "Segoe UI", sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.portfolio-ending__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.portfolio-ending__card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 4px;
  background: #e7e7e1;
}
.portfolio-ending__card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.portfolio-ending__card span {
  position: absolute;
  inset: auto 0 0;
  padding: 9px 12px;
  background: rgb(18 18 18 / 88%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
@media (hover: hover) and (pointer: fine) {
  .portfolio-ending__card span { opacity: 0; }
  .portfolio-ending__card:hover span, .portfolio-ending__card:focus span { opacity: 1; }
}
.portfolio-ending__nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  border-top: 1px solid #d5d5cf;
  padding: 20px 0;
}
.portfolio-ending__nav a, .portfolio-ending__actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  line-height: 1.4;
}
.portfolio-ending__nav a { font-size: 13px; color: var(--ending-ink); }
.portfolio-ending__nav [rel="prev"] { grid-column: 1; justify-self: start; border: 1px solid #ccccc4; }
.portfolio-ending__nav .portfolio-ending__news { grid-column: 2; grid-row: 1; color: #50504d; }
.portfolio-ending__nav [rel="next"] { grid-column: 3; justify-self: end; background: #006d72; color: #fff; }
.portfolio-ending__banner {
  background: var(--banner-background);
  color: var(--banner-ink);
  padding: clamp(56px, 7vw, 96px) 20px;
  text-align: center;
}
.portfolio-ending__banner h2 {
  max-width: 32ch;
  margin: 0 auto 16px;
  color: inherit;
  font: 700 clamp(28px, 3.2vw, 46px)/1.13 Georgia, "Times New Roman", serif;
  text-wrap: balance;
  letter-spacing: -.025em;
  text-transform: none;
}
.portfolio-ending__banner p { max-width: 62ch; margin: 0 auto 24px; color: inherit; font: inherit; text-wrap: pretty; }
.portfolio-ending__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.portfolio-ending__actions a { padding: 13px 22px; border: 1px solid var(--banner-ink); color: var(--banner-ink); font-size: 15px; }
.portfolio-ending__actions a:first-child { background: #fff; border-color: #fff; color: #161616; }
.portfolio-ending__actions a:hover, .portfolio-ending__nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* The base theme suppresses outlines with !important, including keyboard focus. */
.portfolio-ending a:focus-visible,
.portfolio-ending ~ .jq-recent :focus-visible,
.portfolio-footer a:focus-visible {
  outline: 3px solid #121212 !important;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px #fff;
}
.portfolio-story-link {
  display: block;
  width: min(90%, 1138px);
  margin: 0 auto;
  padding-block: 20px;
  font: 600 15px/1.5 Inter, "Segoe UI", sans-serif;
}
.portfolio-story-link a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* These footer rules work independently of the Studio News theme. */
footer.portfolio-footer {
  padding: clamp(48px, 7vw, 80px) 0 0;
  background: #1a1a18;
  color: #fff;
  font: 400 15px/1.65 Inter, "Segoe UI", sans-serif;
}
.portfolio-footer .container { width: min(94%, 1170px); max-width: 1170px; margin: 0 auto; padding: 0 16px; }
.portfolio-footer .jq-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 48px);
  padding-bottom: 40px;
  border-bottom: 1px solid #444440;
}
.portfolio-footer .jq-footer__brand img { max-width: 160px; height: auto; margin-bottom: 16px; filter: brightness(0) invert(1); }
.portfolio-footer .jq-footer__brand p, .portfolio-footer .jq-footer__links a, .portfolio-footer .jq-footer__links span {
  font: inherit;
  color: #c1c1bb;
  overflow-wrap: anywhere;
}
.portfolio-footer .jq-footer__brand p { margin: 0 0 14px; }
.portfolio-footer .jq-footer__quote { font-style: italic; }
.portfolio-footer .jq-footer__quote span { display: block; color: #aaa9a1; font-size: 13px; }
.portfolio-footer .jq-footer__heading { margin: 0 0 16px; color: #aaa9a1; font: 600 12px/1.4 Inter, "Segoe UI", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.portfolio-footer .jq-footer__links { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.portfolio-footer a { text-decoration: none; }
.portfolio-footer a:hover { color: #fff; text-decoration: underline; }
.portfolio-footer .jq-footer__links .jq-footer__cta { font-weight: 600; color: #80dcd5; }
.portfolio-footer .jq-footer__bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0; padding: 24px 0; }
.portfolio-footer .jq-footer__bottom span { color: #aaa9a1; font-size: 13px; }
.portfolio-footer .jq-social-links { display: flex; flex-wrap: wrap; gap: 6px; }
.portfolio-footer .jq-social-links a { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #53534e; border-radius: 50%; color: #d3d3cc; font: 600 12px/1 Inter, "Segoe UI", sans-serif; }
@media (max-width: 991px) {
  .portfolio-footer .jq-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .portfolio-ending__inner, .portfolio-footer .container { width: 100%; padding-inline: 20px; }
  .portfolio-ending__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .portfolio-ending__card span { opacity: 1; }
  .portfolio-ending__nav { grid-template-columns: 1fr 1fr; }
  .portfolio-ending__nav [rel="next"] { grid-column: 2; grid-row: 1; }
  .portfolio-ending__nav .portfolio-ending__news { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .portfolio-footer .jq-footer__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .portfolio-footer .jq-footer__bottom { flex-wrap: wrap; justify-content: flex-start; }
}
