/* Art Design — projects categories grid.
   Shares the hero's palette and typography so the two sections read as one
   page. Front-end only; no JavaScript. */

.artp-projects {
  --ink: var(--wp--preset--color--ink, #131110);
  --bone: var(--wp--preset--color--bone, #EDE8E0);
  --mute: var(--wp--preset--color--mute, #9A9289);
  --line: var(--wp--preset--color--line, #2B2724);
  --oxide-lift: var(--wp--preset--color--oxide-lift, #CC5C3D);
  --display: var(--wp--preset--font-family--display, Italiana, Didot, serif);
  --sans: var(--wp--preset--font-family--sans, Jost, system-ui, sans-serif);
  --gut: var(--wp--preset--spacing--gutter, clamp(1.25rem, 4.2vw, 5rem));
  --ease: cubic-bezier(.16, 1, .3, 1);

  /* break out of the theme's content column, the same way the hero does */
  /* 100vw includes the scrollbar, which gave the page a horizontal scroll
     and stole 15px of height from the hero above. The script measures
     clientWidth instead; these are the no-JS fallbacks. */
  width: var(--artp-vw, 100vw);
  max-width: var(--artp-vw, 100vw);
  margin-left: var(--artp-pull, calc(50% - 50vw));
  margin-right: var(--artp-pull, calc(50% - 50vw));

  /* A full-bleed band carries no flow gap. The block editor's layout rules
     hand every sibling in .entry-content a block-gap margin, which showed as a
     strip of page background between this section and the hero above it.
     !important because those rules are printed inline after this stylesheet. */
  margin-top: 0 !important;
  margin-bottom: 0 !important;

  box-sizing: border-box;
  padding: clamp(3.5rem, 8vw, 7rem) var(--gut) clamp(3.5rem, 8vw, 7rem);
  background: var(--ink);
  color: var(--bone);
}
.artp-projects *,
.artp-projects *::before,
.artp-projects *::after { box-sizing: border-box; }

.artp-projects__heading {
  margin: 0 0 clamp(2rem, 4.5vw, 3.5rem);
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.6vw, 3.2rem);
  letter-spacing: .22em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.1;
  color: var(--bone);
  /* the tracking adds a trailing gap; pull it back so it reads centred */
  text-indent: .22em;
}

.artp-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--artp-cols, 3), minmax(0, 1fr));
  gap: clamp(.75rem, 1.6vw, 1.5rem);
}

.artp-card { margin: 0; min-width: 0; }

.artp-card__inner {
  position: relative;
  display: block;
  overflow: hidden;
  text-decoration: none;
  color: var(--bone);
  background: #0F0D0C;
}
.artp-card__inner:hover { color: var(--bone); }
.artp-card__inner:focus-visible {
  outline: 2px solid var(--oxide-lift);
  outline-offset: 3px;
}

/* a fixed ratio keeps the row even whatever shape the uploads are */
.artp-card__frame {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.artp-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.001);
  transition: transform 1.1s var(--ease), filter 1.1s var(--ease);
  filter: saturate(.92) brightness(.86);
}
a.artp-card__inner:hover .artp-card__img {
  transform: scale(1.055);
  filter: saturate(1) brightness(1);
}

/* stand-in when a category has no image yet */
.artp-card__empty {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(104deg, transparent 26%, rgba(246, 242, 236, .07) 34%, transparent 52%),
    linear-gradient(160deg, #231F1B, #15120F 70%, #0D0B0A);
}

/* the label sits on the image, lifted off it by a gradient rather than a box */
.artp-card__inner::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 58%;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(10, 9, 8, .82) 0%, rgba(10, 9, 8, .34) 46%, transparent 100%);
}
.artp-card__label {
  position: absolute;
  left: clamp(1rem, 2vw, 1.6rem);
  bottom: clamp(.9rem, 1.9vw, 1.5rem);
  z-index: 2;
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.9vw, 1.5rem);
  letter-spacing: .1em;
  color: #F6F2EC;
  text-shadow: 0 2px 22px rgba(10, 9, 8, .6);
  transition: transform .6s var(--ease), color .4s var(--ease);
}
a.artp-card__inner:hover .artp-card__label {
  transform: translateX(6px);
  color: var(--oxide-lift);
}

@media (max-width: 820px) {
  .artp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .artp-grid { grid-template-columns: 1fr; }
  .artp-card__frame { aspect-ratio: 16 / 10; }
}

@media (prefers-reduced-motion: reduce) {
  .artp-card__img,
  .artp-card__label { transition: none; }
  a.artp-card__inner:hover .artp-card__img { transform: none; }
  a.artp-card__inner:hover .artp-card__label { transform: none; }
}
