/* =========================================================================
   ON3 — studio category views (js/category.js)
   A sheet over the page: the asset large, then the rest of its category.
   The category bar keeps the studio's name and Book button in reach.
   ========================================================================= */

/* ------------------------------------------------------------- shared bar */

.cv-bar {
  display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap;
  padding: 10px max(14px, 1.2vw); padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(27, 19, 16, 0.94); border-bottom: 1px solid rgba(243, 234, 217, 0.14);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.cv-bar__title { flex: 1; min-width: 0; }
.cv-bar__name { font-family: var(--f-display); font-size: clamp(0.875rem, 0.8rem + 0.4vw, 1.125rem); letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.3; }
.cv-bar__sub { font-size: 0.8125rem; color: var(--on-dark-dim); line-height: 1.3; }
.cv-bar__book { min-height: 44px; flex: none; }
.cv-close {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 10px;
  border: 1px solid rgba(243, 234, 217, 0.3); border-radius: var(--r-pill); background: none; cursor: pointer;
  font-family: var(--f-display); font-size: 0.5625rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-dark);
}
.cv-close::before { content: "←"; font-family: var(--f-body); font-size: 0.9rem; letter-spacing: 0; }
.cv-close:hover { border-color: var(--on-dark-dim); }
@media (max-width: 560px) {
  .cv-bar { gap: 8px 10px; }
  .cv-bar__title { order: 2; flex-basis: calc(100% - 140px); }
  .cv-close { order: 1; }
  .cv-bar__book { order: 3; width: 100%; }
}
.cv-more__h { font-family: var(--f-display); font-weight: 400; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-dark-dim); padding: var(--s5) max(14px, 1.2vw) var(--s3); }

.cv-media { display: block; max-width: 100%; height: auto; border-radius: 10px; background: var(--espresso-2); }

/* ------------------------------------------------------------- the sheet */

.cv {
  margin: 0; padding: 0; border: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%;
  background: var(--espresso); color: var(--on-dark); overflow: hidden;
}
.cv[open] { display: flex; flex-direction: column; }
.cv::backdrop { background: rgba(0, 0, 0, 0.6); }
@media (prefers-reduced-motion: no-preference) {
  .cv[open] { animation: cv-in var(--t-mid) var(--ease); }
  @keyframes cv-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
}
.cv-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.cv-stage { display: grid; place-items: center; padding: var(--s4) max(10px, 1.2vw) 0; }
.cv-stage .cv-media { max-height: min(72vh, 900px); width: auto; }
/* The category's assets as a pin board, in order, read across then down. */
.cv-grid { columns: 2 160px; column-gap: 8px; padding: 0 max(10px, 1.2vw); }
@media (min-width: 800px) { .cv-grid { columns: 4 200px; } }
@media (min-width: 1300px) { .cv-grid { columns: 6 200px; } }
.cv-thumb {
  position: relative; display: block; width: 100%; margin: 0 0 8px; padding: 0; border: 1.5px solid #fbf7f0; border-radius: 10px;
  overflow: hidden; background: var(--espresso-2); cursor: pointer; break-inside: avoid; aspect-ratio: var(--ar);
}
.cv-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); }
.cv-thumb.is-current { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber); }
@media (hover: hover) { .cv-thumb:hover img { transform: scale(1.03); } }
.cv-thumb__play { position: absolute; left: 8px; bottom: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(27, 19, 16, 0.72); }
.cv-thumb__play::before { content: ""; position: absolute; left: 10px; top: 8px; border-left: 8px solid var(--on-dark); border-block: 5px solid transparent; }

/* ------------------------------------------------------------- brands
   The Brands button sits beside the gallery title; it opens a sheet of brand
   cards (a cover photo, the name, how many items), each opening that brand. */

.gal-brands {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px 0 13px;
  border: 1px solid rgba(243, 234, 217, 0.3); border-radius: var(--r-pill); background: none; cursor: pointer; color: var(--on-dark);
  font-family: var(--f-display); font-size: 0.625rem; letter-spacing: 0.14em; text-transform: uppercase;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.gal-brands:hover { border-color: var(--on-dark-dim); background: rgba(243, 234, 217, 0.06); }
.gal-brands svg { width: 13px; height: 13px; fill: var(--amber); }

.cv-brands { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: var(--s4) max(10px, 1.2vw); }
@media (min-width: 700px) { .cv-brands { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .cv-brands { grid-template-columns: repeat(5, 1fr); } }
.cv-brand {
  position: relative; display: block; aspect-ratio: 4 / 5; padding: 0; overflow: hidden; cursor: pointer;
  border: 1.5px solid #fbf7f0; border-radius: 12px; background: var(--espresso-2); color: var(--on-dark); text-align: left;
}
.cv-brand img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); }
.cv-brand::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(18, 12, 10, 0.88), rgba(18, 12, 10, 0) 55%); }
.cv-brand__label { position: absolute; z-index: 1; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.cv-brand__name { font-family: var(--f-display); font-size: clamp(0.75rem, 0.7rem + 0.3vw, 0.9375rem); letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.25; }
.cv-brand__count { flex: none; min-width: 26px; height: 26px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 999px; background: rgba(243, 234, 217, 0.16); font: 600 0.75rem/1 var(--f-body); }
@media (hover: hover) { .cv-brand:hover img { transform: scale(1.04); } .cv-brand:hover { border-color: var(--amber-soft); } }
.cv-brand:focus-visible { box-shadow: var(--focus); }

/* The copy in the top bar (js/category.js adds .has-brands to the bar): its
   slot opens, the links beside it glide over, and the button rises in. */
.hdr__brands {
  display: inline-flex; flex: none; width: 0; margin-left: auto; margin-right: calc(-1 * var(--s3));
  transition: width 600ms var(--ease), margin-right 600ms var(--ease);
}
.hdr__brands[hidden] { display: none; }
.hdr__brands[hidden] + .hdr__book { margin-left: auto; }
.hdr__brands .gal-brands {
  min-height: 38px; white-space: nowrap; opacity: 0; visibility: hidden; transform: translateY(18px);
  transition: opacity 420ms var(--ease), transform 600ms var(--ease), visibility 0s linear 600ms, border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.hdr.has-brands .hdr__brands { width: var(--w, 7.5rem); margin-right: 0; }
.hdr.has-brands .hdr__brands .gal-brands { opacity: 1; visibility: visible; transform: none; transition-delay: 120ms, 0s, 0s, 0s, 0s; }
.hdr__logo img { transition: width 600ms var(--ease); }
@media (max-width: 560px) {
  .hdr__brands .gal-brands { min-height: 36px; padding: 0 11px; font-size: 0.5625rem; letter-spacing: 0.1em; }
  .hdr__brands .gal-brands svg { display: none; }
  .hdr.has-brands .hdr__logo img { width: 96px; }
  .hdr.has-brands .hdr__book { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .hdr__brands, .hdr__brands .gal-brands, .hdr__logo img { transition: none; }
}
