/* FrameWorthy — /u unlock gallery page.
 * Builds on the tokens + shared components in styles.css (loaded first).
 * The page sits on the dark forest ground, like the hero. */

.u-body {
  background: var(--shadow);
  color: var(--cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.u-main {
  flex: 1 0 auto;
  width: 100%;
  padding-top: clamp(32px, 7vw, 72px);
  padding-bottom: clamp(48px, 8vw, 96px);
}

/* --- States (loading / error / gallery) --- */
/* [hidden] must win over the display rules below (an id selector like
   #u-loading{display:flex} would otherwise defeat the attribute). */
[hidden] { display: none !important; }

.u-state {
  animation: u-fade 0.4s ease both;
}
@keyframes u-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.u-title {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--cream);
  font-size: clamp(30px, 6vw, 52px);
  line-height: 1.02;
  margin: 14px 0 10px;
}
.u-sub {
  font-family: var(--font-body);
  color: var(--sage-light);
  font-size: clamp(14px, 2.4vw, 17px);
  line-height: 1.5;
  max-width: 46ch;
}

/* Loading + error are centered, roomy. */
#u-loading, #u-error {
  text-align: center;
  max-width: 560px;
  margin: clamp(24px, 8vw, 96px) auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
#u-error .btn { margin-top: 22px; }

/* --- Gallery --- */
.u-gallery-head { margin-bottom: clamp(22px, 4vw, 40px); }

.u-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: clamp(12px, 2vw, 20px);
}
@media (min-width: 640px) {
  .u-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

/* Each frame is a print: cream card, photo inset, frame number in the border. */
.u-frame {
  position: relative;
  display: block;
  background: var(--cream);
  padding: 10px 10px 30px;
  border-radius: 3px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  text-decoration: none;
}
.u-frame:hover,
.u-frame:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.36);
  outline: none;
}
.u-frame-img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--cream-alt);
  border-radius: 1px;
}
.u-frame-num {
  position: absolute;
  left: 12px;
  bottom: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--olive-meta);
}

/* Closing nudge under the grid. */
.u-cta {
  margin-top: clamp(32px, 6vw, 64px);
  padding-top: clamp(24px, 4vw, 40px);
  border-top: 1px solid rgba(198, 220, 205, 0.18);
  text-align: center;
}
.u-cta p {
  font-family: var(--font-body);
  color: var(--sage-light);
  font-size: clamp(14px, 2.4vw, 17px);
  margin-bottom: 16px;
}

/* On the dark ground the header/footer already read fine; just ensure the
   header nav links use the on-dark treatment the rest of the site gives them. */
.u-body .site-header { background: transparent; }
