/* ============================================================
   CANOPY — STUDENT ART
   Framed slots · full-page veil (menu wipe) · solid card stack
   ============================================================ */

:root {
  --art-credit: color-mix(in srgb, var(--espresso) 70%, transparent);
  --art-frame: color-mix(in srgb, var(--espresso) 32%, transparent);
  --art-frame-inner: color-mix(in srgb, var(--espresso) 16%, transparent);
  --art-panel: #ffffff;
  --art-page-bg: #fefaf0;
}

.student-art-frame {
  display: block;
  margin: 0;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: default;
}
.student-art-frame.is-clickable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.25s ease;
}
.student-art-frame.is-clickable:hover { transform: translateY(-2px); }
.student-art-frame.is-clickable:focus-visible {
  outline: 2px solid var(--terre);
  outline-offset: 3px;
}

.student-art-mat {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--art-panel);
  border: 1.5px solid var(--art-frame);
  box-sizing: border-box;
  box-shadow: inset 0 0 0 5px var(--art-panel), inset 0 0 0 6.5px var(--art-frame-inner);
  overflow: hidden;
}
.student-art-mat img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--art-panel);
  pointer-events: none;
}
.student-art-credit {
  display: block;
  margin: 0.4rem 0 0;
  font-family: 'Familjen Grotesk', system-ui, sans-serif;
  font-size: 0.7rem;
  line-height: 1.35;
  color: var(--art-credit);
}

/* Home strip */
.student-art-home-slot {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(18rem, 86vw);
  margin: 1.15rem auto 0;
  flex: none;
}
body.is-browsing .student-art-home-slot,
body.has-blobs .student-art-home-slot,
body.has-deck .student-art-home-slot,
body.has-art-page .student-art-home-slot,
body.has-strip .student-art-home-slot {
  display: none;
}

/* Waiting companion */
.student-art-companion {
  position: absolute;
  right: max(0.75rem, env(safe-area-inset-right, 0px));
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 3;
  width: min(9.5rem, 38vw);
}
.blob-results { position: relative; }
.student-art-companion-fig .student-art-credit {
  text-align: right;
  font-size: 0.62rem;
}
body:not(.blobs-breathing):not(.blobs-thinking) .student-art-companion,
body.blobs-splitting .student-art-companion {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
body.blobs-breathing .student-art-companion,
body.blobs-thinking.blobs-breathing .student-art-companion {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
@media (max-width: 560px) {
  .student-art-companion {
    width: min(7.5rem, 34vw);
    bottom: calc(6.25rem + env(safe-area-inset-bottom, 0px));
  }
}

/* Empty */
.no-results { display: grid; gap: 1.1rem; justify-items: start; }
.student-art-empty { max-width: min(20rem, 100%); }

/* About gallery */
.student-art-gallery {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1.5px solid color-mix(in srgb, var(--espresso) 14%, transparent);
}
.student-art-gallery-sub {
  margin: 0 0 1rem !important;
  font-size: 0.92rem !important;
  color: var(--menu-muted, var(--espresso-60)) !important;
  font-weight: 500 !important;
}
.student-art-gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0 0 1rem;
}
.student-art-gallery-cap {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: 0.4rem;
}
.student-art-gallery-title {
  font-family: 'Josefin Sans', 'Familjen Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--menu-fg, var(--espresso));
}
.student-art-gallery-by {
  font-size: 0.68rem;
  color: var(--menu-muted, var(--espresso-60));
}
.student-art-more-btn {
  display: inline-flex;
  align-items: center;
  margin: 0.35rem 0 0;
  padding: 0.55rem 0.9rem;
  border: 1.5px solid color-mix(in srgb, var(--espresso) 22%, transparent);
  border-radius: var(--radius-ui, 0.75rem);
  background: var(--surface, #fff8f2);
  color: var(--espresso);
  font-family: 'Josefin Sans', 'Familjen Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}
.student-art-more-btn:hover {
  background: var(--espresso);
  color: var(--milk, #fefaf0);
}
.student-art-open-call { padding: 1.15rem 0 0.25rem; }
.student-art-open-call p { margin: 0 0 0.75rem; }
.student-art-open-cta {
  display: inline-block;
  font-family: 'Josefin Sans', 'Familjen Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--menu-accent, var(--terre));
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* ========== FULL PAGE (menu-style wipe) ========== */
.art-page-veil {
  position: fixed;
  inset: 0;
  z-index: 430;
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: transparent;
}
.art-page-veil[hidden] { display: none !important; }
.art-page-veil.on {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.art-page-wipe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.art-page {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--art-page-bg);
  color: var(--espresso);
  overflow: hidden;
}
body.has-gsap .art-page {
  background: transparent; /* wipe paints the surface */
}

.art-page-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: max(0.85rem, env(safe-area-inset-top)) 1.15rem 0.75rem;
  position: relative;
  z-index: 2;
}
.art-page-x {
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: var(--surface, #fff8f2);
  color: var(--espresso);
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 1px 8px rgba(84, 41, 22, 0.08);
}
.art-page-stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--art-page-bg);
}
.art-page-view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.art-page-view[hidden] { display: none !important; }

/* Piece view */
.art-page-piece {
  overflow: auto;
  padding: 0.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}
.art-page-mat {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: #fff;
  border: 1.5px solid var(--art-frame);
  box-shadow: inset 0 0 0 7px #fff, inset 0 0 0 8.5px var(--art-frame-inner);
  overflow: hidden;
}
.art-page-mat img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.art-page-copy {
  max-width: 40rem;
  margin: 1.25rem auto 0;
}
.art-page-copy h2 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  line-height: 1.12;
  text-transform: lowercase;
}
.art-page-meta {
  margin: 0 0 0.85rem;
  font-size: 0.84rem;
  color: var(--art-credit);
}
.art-page-blurb {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  line-height: 1.55;
}

/* Deck view — mirror resource deck geometry */
.art-page-deck {
  padding: 0 0 calc(1rem + env(safe-area-inset-bottom));
}
.art-deck-label {
  flex: none;
  margin: 0.25rem 1rem 0.75rem;
  text-align: center;
  font-family: 'Josefin Sans', 'Familjen Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--espresso-60, #8a6a55);
}
.art-deck-stage {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  touch-action: none;
  overflow: hidden;
}
.art-deck-cards {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: visible;
}
.art-deck-cards.is-dragging { cursor: grabbing; }

.art-deck-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--art-card-w, min(18rem, 86vw));
  height: var(--art-card-h, min(24rem, 58dvh));
  margin: 0;
  padding: 0;
  list-style: none;
  border: none;
  /* Solid fill on the card itself — color must never wash out */
  background: #fff8f2 !important;
  cursor: pointer;
  transform: translate(-50%, -50%);
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  pointer-events: none;
  opacity: 1 !important;
  isolation: isolate;
}
.art-deck-card.is-active {
  pointer-events: auto;
}
.art-deck-card-frame {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 0.85rem;
  border-radius: var(--radius-card, 0.9rem);
  background: #fff8f2 !important;
  border: 1.5px solid color-mix(in srgb, var(--espresso) 28%, transparent);
  box-shadow: 0 12px 32px rgba(84, 41, 22, 0.14);
  opacity: 1 !important;
}
.art-deck-card .student-art-mat {
  flex: 0 0 auto;
  background: #ffffff !important;
  opacity: 1 !important;
}
.art-deck-card .student-art-mat img {
  opacity: 1 !important;
  mix-blend-mode: normal !important;
}

/* Keep the whole art surface opaque after wipe (no post-anim fade-out) */
body.has-art-page .art-page-stage,
body.has-art-page .art-page-piece,
body.has-art-page .art-page-deck,
body.has-art-page .art-deck-stage,
body.has-art-page .art-deck-cards {
  opacity: 1 !important;
}

/* Cursor difference-blend was washing card color — hide it on art page */
body.has-art-page .sticky-cursor {
  display: none !important;
}
body.has-art-page.has-sticky-cursor,
body.has-art-page.has-sticky-cursor * {
  cursor: auto;
}
.art-deck-card .student-art-mat {
  flex: 0 0 auto;
}
.art-deck-card-copy {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.art-deck-card-copy h3 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  line-height: 1.2;
  text-transform: lowercase;
  color: var(--espresso);
}
.art-deck-card-by {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  color: var(--art-credit);
}
.art-deck-card-blurb {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--espresso);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.art-deck-nav {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.85rem 0 0.35rem;
}
.art-deck-nav-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--espresso) 22%, transparent);
  background: #fff8f2;
  color: var(--espresso);
  font-size: 1.25rem;
  cursor: pointer;
}
.art-deck-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.art-deck-dots {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.art-deck-dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--espresso) 25%, transparent);
  cursor: pointer;
}
.art-deck-dot.on {
  background: var(--espresso);
}

body.has-art-page .sos,
body.has-art-page .footer {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .student-art-frame.is-clickable { transition: none; }
}
