/* Projects page */
.pg-hero { position: relative; }
.pg-hero-in { max-width: 1350px; margin: 0 auto; min-height: 50px; display: flex; align-items: center; }
.pg-hero-col { width: 100%; padding: 10px 30px 90px; }
.pg-hero h1 {
  font-family: var(--font-head); font-size: 50px; font-weight: 700; line-height: 1;
  text-transform: uppercase; text-align: center; color: var(--white); margin-bottom: 30px;
}
.pg-dots { width: 10%; margin: 0 auto 10px; border-top: 5px dotted var(--white); }

.pg-main { background: #f5f5f5; padding: 50px 10px 80px; }
.pg-intro { max-width: 1320px; margin: 0 auto; padding-top: 10px; text-align: center; }
.pg-house { display: block; width: 101px; height: 101px; margin: 0 auto -81px; color: rgba(97, 206, 112, 0.1); }
.pg-h2 {
  position: relative; font-family: var(--font-head); font-size: 35px; font-weight: 600; line-height: 1;
  color: var(--ink); margin: 0 0 22px;
}
.pg-rule { width: 14%; margin: 0 auto 22px; border-top: 2px solid var(--teal); }
.pg-sub { font-family: var(--font-head); font-size: 28px; font-weight: 600; line-height: 1; color: var(--teal); margin: 0 0 30px; }

.pg-gallery {
  width: min(1280px, 100% - 20px); margin: 0 auto 20px; padding: 5px;
  background: rgba(255, 255, 255, 0.33); box-shadow: 0 0 1px rgba(0, 0, 0, 0.5);
}
.pg-filters { display: flex; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }
.pg-filters button {
  font-family: var(--font-head); font-size: 15px; font-weight: 500; line-height: 27px;
  letter-spacing: 1px; text-transform: uppercase; color: var(--ink);
  background: transparent; border: 0; border-radius: 0; padding: 3px; margin: 4px; cursor: pointer;
  transition: color 0.3s ease, background-color 0.3s ease;
}
.pg-filters button:hover { color: var(--teal); }
.pg-filters button[aria-pressed="true"] { color: var(--teal-dark); background: rgba(227, 227, 227, 0.57); }
.pg-filters button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.pg-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); align-items: start; }
.pg-grid > .pg-item { position: relative; overflow: hidden; margin: 1px; padding: 1px; animation: pg-in 0.5s ease; }
.pg-grid > .pg-item[hidden] { display: none; }
@keyframes pg-in { from { opacity: 0; } to { opacity: 1; } }
.pg-item > img { width: 100%; height: 410px; object-fit: cover; transition: transform 0.6s ease; }
@media (hover: hover) { .pg-item:hover > img { transform: scale(1.03); } }

/* hover overlay (caption slides in, text rises) */
.pg-caption {
  position: absolute; inset: 0; z-index: 10; padding: 15px;
  display: flex; align-items: center; opacity: 0;
  transition: opacity 0.5s ease;
}
.pg-caption::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(0, 0, 0, 0.574); }
.pg-item:hover .pg-caption, .pg-item:focus-within .pg-caption { opacity: 1; }
.pg-over { width: 100%; text-align: left; }
.pg-title { font-family: var(--font-head); font-size: 17px; font-weight: 500; line-height: 1.2; color: var(--white); margin: 8px 0 16px; }
.pg-title a { color: inherit; text-decoration: none; }
.pg-title a:hover, .pg-title a:focus-visible { text-decoration: underline; }
.pg-text { font-family: var(--font-head); font-size: 15px; line-height: 1.5; color: var(--white); }
.pg-text p { margin: 0 0 5px; transform: translateY(40px); transition: transform 0.6s ease; }
.pg-text ul { margin: 0; padding: 0 0 0 40px; }
.pg-item:hover .pg-text p, .pg-item:focus-within .pg-text p { transform: none; }
/* whole tile follows the title link; "Read more" is the visual cue */
.pg-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.pg-more {
  display: inline-block; margin-top: 14px; padding-bottom: 3px;
  font-family: var(--font-head); font-size: 14px; font-weight: 500; letter-spacing: 1px;
  text-transform: uppercase; color: var(--white); border-bottom: 2px solid var(--white);
  transform: translateY(40px); transition: transform 0.6s ease;
}
.pg-more::after { content: "\2192"; display: inline-block; margin-left: 8px; transition: transform 0.3s ease; }
.pg-item:hover .pg-more, .pg-item:focus-within .pg-more { transform: none; }
.pg-item:hover .pg-more::after { transform: translateX(4px); }

/* Touch + small screens: always-visible compact caption bar (name only) */
@media (hover: none), (max-width: 767px) {
  .pg-caption {
    inset: auto 0 0 0; padding: 36px 14px 12px; align-items: flex-end;
    opacity: 1; background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.65) 55%, rgba(0, 0, 0, 0) 100%);
  }
  .pg-caption::before { display: none; }
  .pg-title { margin: 0; font-size: 17px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
  .pg-title a::after { content: ""; position: absolute; inset: -500px 0; }
  .pg-title a:hover { text-decoration: none; }
  .pg-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pg-more { display: none; }
  .pg-item:hover > img { transform: none; }
}

@media (max-width: 1024px) {
  .pg-hero h1 { font-size: 48px; }
  .pg-h2 { font-size: 30px; }
  .pg-grid { grid-template-columns: repeat(2, 1fr); }
  .pg-title { font-size: 20px; line-height: 1.2; }
  .pg-text { font-size: 14px; }
}
@media (max-width: 767px) {
  .pg-hero { padding: 8px 20px 0; }
  .pg-hero-in { min-height: 0; }
  .pg-hero-col { padding: 10px 0 36px; }
  .pg-hero h1 { font-size: 32px; margin-bottom: 18px; }
  .pg-dots { width: 45%; margin-bottom: 2px; }
  .pg-main { padding: 32px 10px 48px; }
  .pg-h2 { font-size: 25px; }
  .pg-sub { font-size: 22px; line-height: 1.2; margin-bottom: 22px; }
  .pg-gallery { width: 100%; margin-bottom: 0; }
  .pg-grid { grid-template-columns: 1fr; }
  .pg-grid > .pg-item { margin: 0; }
  .pg-item > img { height: auto; aspect-ratio: 4 / 3; }

  /* filters: single scrollable row of 44px pills, faded at the right edge as a scroll hint */
  .pg-filters {
    flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; gap: 8px;
    margin: 0 -5px 14px; padding: 4px 5px 8px; scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
  .pg-filters::-webkit-scrollbar { display: none; }
  .pg-filters button {
    flex: none; min-height: 44px; margin: 0; padding: 0 16px; font-size: 13px; white-space: nowrap;
    border: 1px solid #cfd6d6; border-radius: 22px; background: #fff; scroll-snap-align: start;
  }
  .pg-filters button[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
}
/* forced-colors strips the tint, so mark the selected category with an underline as well */
@media (forced-colors: active) {
  .pg-filters button[aria-pressed="true"] { text-decoration: underline; text-underline-offset: 5px; }
}
@media (min-width: 560px) and (max-width: 767px) {
  .pg-grid { grid-template-columns: 1fr 1fr; }
  .pg-title { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .pg-text p, .pg-more { transform: none; }
  .pg-grid > .pg-item { animation: none; }
}
