/* Portfolio gallery (custom/portfolio-gallery.js): sits on each section's cream card panel, in the page's own
   typefaces and colours, so it reads as part of the original design. */
.cc-pf {
  --pf-ink: #1d1d19;
  --pf-mute: rgba(29, 29, 25, .58);
  --pf-line: rgba(29, 29, 25, .12);
  --pf-sans: NeueMontreal, Helvetica, Arial, sans-serif;
  --pf-serif: HWCigars, Georgia, "Times New Roman", serif;
  padding: 44px clamp(16px, 2.2vw, 32px) 56px;
  color: var(--pf-ink);
  font-family: var(--pf-sans);
  border-bottom: 1px solid var(--pf-line);
}
.cc-pf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.cc-pf-heading { margin: 0; font-size: clamp(30px, 3.2vw, 46px); line-height: 1; font-weight: 700; letter-spacing: -.03em; }
.cc-pf-heading i { font-family: var(--pf-serif); font-weight: 400; letter-spacing: -.01em; }
.cc-pf-count { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--pf-mute); white-space: nowrap; }

.cc-pf-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 24px; }
.cc-pf-grid.is-collapsed .cc-pf-more { display: none; }
.cc-pf-item { min-width: 0; }

.cc-pf-card {
  display: block; width: 100%; padding: 0; margin: 0; border: 0; background: none; text-align: left;
  color: inherit; font: inherit; cursor: zoom-in;
}
.cc-pf-frame {
  display: block; position: relative; overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  background: #e8e6dc;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 0 0 1px var(--pf-line);
}
.cc-pf-frame img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  transition: scale .6s cubic-bezier(.2, .7, .2, 1), filter .3s;
}
.cc-pf-card:hover .cc-pf-frame img, .cc-pf-card:focus-visible .cc-pf-frame img { scale: 1.045; }
.cc-pf-card:focus-visible { outline: none; }
.cc-pf-card:focus-visible .cc-pf-frame { box-shadow: 0 0 0 2px var(--pf-ink); }

.cc-pf-meta { display: flex; flex-direction: column; gap: 4px; padding-top: 14px; }
.cc-pf-tag {
  align-self: flex-start; margin-bottom: 4px; padding: 3px 8px; border-radius: 999px;
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--pf-mute);
  box-shadow: inset 0 0 0 1px var(--pf-line);
}
.cc-pf-title { font-size: 19px; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
.cc-pf-desc { font-size: 15px; line-height: 1.35; color: var(--pf-mute); }

.cc-pf-foot { display: flex; justify-content: center; margin-top: 40px; }
.cc-pf-all {
  padding: 12px 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--pf-ink); color: #f7f7ee; font: inherit; font-size: 15px; font-weight: 500;
}
.cc-pf-all:hover { opacity: .88; }

@media (max-width: 1023px) { .cc-pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) {
  .cc-pf { padding: 32px 16px 40px; }
  .cc-pf-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- viewer ---------- */
html.cc-pfv-open { overflow: hidden; }
.cc-pfv {
  position: fixed; inset: 0; z-index: 2147483000;   /* above the page header and sidebar */
  display: flex; flex-direction: column;
  background: rgba(11, 11, 11, .94);
  color: #f7f7ee; font-family: NeueMontreal, Helvetica, Arial, sans-serif;
  animation: cc-pfv-in .25s ease-out;
}
.cc-pfv[hidden] { display: none; }
@keyframes cc-pfv-in { from { opacity: 0; } to { opacity: 1; } }
.cc-pfv-bar {
  display: flex; align-items: center; gap: 20px;
  padding: 16px clamp(16px, 3vw, 40px);
  border-bottom: 1px solid rgba(247, 247, 238, .12);
}
.cc-pfv-text { flex: 1; min-width: 0; }
.cc-pfv-tag { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(247, 247, 238, .55); }
.cc-pfv-title { margin: 2px 0 0; font-size: 22px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.cc-pfv-desc { margin: 2px 0 0; font-size: 14px; color: rgba(247, 247, 238, .65); }
.cc-pfv-link {
  padding: 9px 16px; border-radius: 999px; background: #f7f7ee; color: #141414 !important;
  font-size: 14px; font-weight: 500; text-decoration: none !important; white-space: nowrap;
}
.cc-pfv-link[hidden] { display: none; }
.cc-pfv-pos { font-size: 13px; color: rgba(247, 247, 238, .55); white-space: nowrap; }
.cc-pfv-close {
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(247, 247, 238, .1); color: #f7f7ee; font-size: 26px; line-height: 1;
}
.cc-pfv-close:hover { background: rgba(247, 247, 238, .2); }
.cc-pfv-stage {
  flex: 1; overflow: auto; overscroll-behavior: contain;
  display: flex; justify-content: center; align-items: flex-start;
  padding: clamp(16px, 3vw, 40px) clamp(16px, 7vw, 96px);
}
.cc-pfv-img { max-width: min(1400px, 100%); height: auto; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.cc-pfv-nav {
  position: absolute; top: 55%; translate: 0 -50%;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(247, 247, 238, .12); color: #f7f7ee; font-size: 22px;
}
.cc-pfv-nav:hover { background: rgba(247, 247, 238, .24); }
.cc-pfv-nav[hidden] { display: none; }
.cc-pfv-prev { left: clamp(8px, 2vw, 28px); }
.cc-pfv-next { right: clamp(8px, 2vw, 28px); }
@media (max-width: 599px) {
  .cc-pfv-bar { flex-wrap: wrap; gap: 10px 14px; }
  .cc-pfv-nav { top: auto; bottom: 16px; translate: none; }
  .cc-pfv-pos { order: 3; }
}
