/* ==========================================================================
   FLOWW Media — event cards, gallery page, lightbox
   Loaded on /events and /g/{slug}. Extends app.css; does not replace it.
   ========================================================================== */

/* -- org badge ------------------------------------------------------------- */
.org-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--bg-sunken);
  flex-shrink: 0;
}

.org-badge-lg { width: 46px; height: 46px; border-radius: 12px; }

.org-badge-empty {
  display: grid;
  place-items: center;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted);
  border: 1px solid var(--border);
}
.org-badge-lg.org-badge-empty { font-size: 1rem; }

/* -- event card ------------------------------------------------------------ */
.event-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .2s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
}

.event-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.event-card.is-owned { border-color: var(--accent); }

.event-card-media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--bg-sunken);
  overflow: hidden;
}

.event-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.event-card:hover .event-card-media img { transform: scale(1.035); }

.event-card-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--muted-light);
}

.event-card-count,
.event-card-presale,
.event-card-owned {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: rgba(18, 16, 14, .62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: .73rem;
  font-weight: 500;
}

.event-card-owned {
  left: auto;
  right: 10px;
  background: var(--accent);
}

.event-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 20px 20px;
}

.event-card-org { display: flex; align-items: center; gap: 10px; }

.event-card-orgname {
  font-size: .84rem;
  font-weight: 500;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-card-title {
  margin: 12px 0 10px;
  font-size: 1.22rem;
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.25;
}
.event-card-title a { color: var(--ink); }
.event-card-title a:hover { color: var(--accent); text-decoration: none; }

.event-card-meta {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .84rem;
  color: var(--muted);
}
.event-card-meta li { display: flex; align-items: center; gap: 7px; }
.event-card-meta svg { flex-shrink: 0; opacity: .7; }

/* Actions pin to the bottom so cards of differing text length still line up. */
.event-card-actions { margin-top: auto; }

.event-card-secondary {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}
.event-card-secondary .btn { flex: 1; padding-inline: 10px; }

.event-card-note {
  margin: 10px 0 0;
  font-size: .78rem;
  color: var(--muted);
  text-align: center;
}

/* "/ athlete" trailing a price — present but not competing with the figure. */
.btn-unit {
  font-weight: 400;
  opacity: .78;
  font-size: .92em;
}

/* -- pre-sale -------------------------------------------------------------- */
/* A gallery sold before its photos exist. Amber rather than the accent brown so
   "taking pre-orders" never reads as "you own this". */
.event-card-presale {
  left: auto;
  right: 10px;
  background: #d97706;
  font-size: .68rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* Stands in for the primary button when a card is owned but undelivered —
   there is nothing to open, so it states the position instead of offering an
   action that would go nowhere. */
.event-card-status {
  margin: 0;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid rgba(180, 83, 9, .18);
  color: var(--accent);
  font-size: .88rem;
  font-weight: 500;
  text-align: center;
}

/* Replaces the photo wall on a pre-sale gallery page. Same shape as .peek-more
   so the page keeps its rhythm where the wall would have been. */
.presale-panel {
  padding: 44px 24px 48px;
  text-align: center;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.presale-panel h2 {
  margin: 0 0 .45em;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -.02em;
}

.presale-panel-icon {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  color: var(--accent);
}

.presale-panel-lede {
  max-width: 46ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: .95rem;
}

/* The includes list is centred as a block but stays left-aligned inside it, so
   the tick marks line up. */
.presale-panel-list {
  max-width: 40ch;
  margin: 24px auto 0;
  text-align: left;
}

/* -- events search --------------------------------------------------------- */
.event-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  margin-top: 26px;
}

.event-search-field {
  position: relative;
  display: block;
  flex: 1;
  min-width: 0;
}

.event-search-field svg {
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  color: var(--muted-light);
  pointer-events: none;
}

.event-search .input { padding-left: 42px; }

/* -- gallery header -------------------------------------------------------- */
.gallery-head { padding-block: 30px 34px; }

.gallery-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 20px;
  font-size: .85rem;
  color: var(--muted);
}
.gallery-back:hover { color: var(--accent); text-decoration: none; }

.gallery-head-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 44px;
  align-items: start;
}

.gallery-head-main h1 {
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  margin-bottom: .3em;
}

.gallery-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: .9rem;
  color: var(--muted);
}
.gallery-meta li { display: flex; align-items: center; gap: 8px; }
.gallery-meta li + li::before {
  content: '';
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-strong);
}

/* -- buy box --------------------------------------------------------------- */
.gallery-buybox {
  position: sticky;
  top: calc(var(--nav-h) + 18px);
  padding: 26px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.gallery-price { display: flex; align-items: baseline; gap: 9px; margin-bottom: 18px; flex-wrap: wrap; }
.gallery-price-figure { font-size: 2.6rem; font-weight: 300; letter-spacing: -.03em; }
.gallery-price-label  { font-size: .82rem; color: var(--muted); }

/* The full price, struck through, beside the discounted pre-sale figure. */
.gallery-price-was {
  font-size: 1.2rem;
  color: var(--muted-light);
  text-decoration: line-through;
}

/* The pre-sale saving line under the price. */
.presale-save {
  margin: -6px 0 18px;
  padding: 9px 13px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .85rem;
  font-weight: 500;
  line-height: 1.5;
}

/* "Save $5" emphasis inside a card note. */
.save-flag { color: var(--accent); font-weight: 600; }

.gallery-includes {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: .88rem;
}

.gallery-includes li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink-soft);
}

.gallery-includes li::before {
  content: '';
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--accent-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b45309' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 11px;
  background-position: center;
  background-repeat: no-repeat;
}

/* -- sneak peek banner ----------------------------------------------------- */
.peek-banner {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 18px;
  margin-bottom: 22px;
  background: var(--accent-soft);
  border: 1px solid rgba(180, 83, 9, .18);
  border-radius: var(--radius);
  font-size: .88rem;
  color: var(--ink-soft);
}
.peek-banner svg { flex-shrink: 0; margin-top: 2px; color: var(--accent); }
.peek-banner strong { color: var(--accent); font-weight: 600; }

/* -- photo wall ------------------------------------------------------------ */
/* Masonry-ish columns keep portrait and landscape frames uncropped, which
   matters when the photos are the product. */
.photo-wall {
  columns: 4 260px;
  column-gap: 14px;
}

.wall-tile {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--bg-sunken);
  overflow: hidden;
  cursor: zoom-in;
  break-inside: avoid;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}

.wall-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }

.wall-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.wall-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* -- locked remainder ------------------------------------------------------ */
.peek-more {
  margin-top: 34px;
  padding: 44px 24px 48px;
  text-align: center;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.peek-more h3 { margin-bottom: .4em; font-weight: 400; }

/* Three stacked cards hinting at the photos still behind the paywall. */
.peek-more-stack {
  position: relative;
  height: 54px;
  margin-bottom: 20px;
}
.peek-more-stack span {
  position: absolute;
  left: 50%;
  top: 0;
  width: 54px;
  height: 42px;
  border-radius: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
}
.peek-more-stack span:nth-child(1) { transform: translateX(-50%) translateX(-26px) rotate(-8deg); opacity: .55; }
.peek-more-stack span:nth-child(2) { transform: translateX(-50%) translateX(26px) rotate(8deg); opacity: .55; }
.peek-more-stack span:nth-child(3) { transform: translateX(-50%); box-shadow: var(--shadow); }

/* -- lightbox -------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 70px 92px;
  background: rgba(10, 9, 8, .93);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: lightbox-in .18s var(--ease);
}

@keyframes lightbox-in { from { opacity: 0; } to { opacity: 1; } }

.lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  width: 100%;
  height: 100%;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  transition: opacity .2s var(--ease);
}

.lightbox-spinner {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, .22);
  border-top-color: #fff;
  border-radius: 50%;
  animation: lightbox-spin .7s linear infinite;
}

@keyframes lightbox-spin { to { transform: rotate(360deg); } }

.lightbox-close,
.lightbox-nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .10);
  color: #fff;
  cursor: pointer;
  transition: background .18s var(--ease);
}

.lightbox-close:hover,
.lightbox-nav:hover { background: rgba(255, 255, 255, .22); }

.lightbox-close { top: 18px; right: 18px; }
.lightbox-prev  { left: 14px; }
.lightbox-next  { right: 14px; }

.lightbox-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 9px 9px 20px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lightbox-count {
  color: rgba(255, 255, 255, .8);
  font-size: .84rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* -- responsive ------------------------------------------------------------ */
@media (max-width: 900px) {
  .gallery-head-inner { grid-template-columns: 1fr; gap: 28px; }
  .gallery-buybox { position: static; }
  .photo-wall { columns: 3 200px; }
}

@media (max-width: 640px) {
  .photo-wall { columns: 2 140px; column-gap: 10px; }
  .wall-tile { margin-bottom: 10px; }

  .lightbox { padding: 56px 12px 92px; }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
  .lightbox-bar { left: 12px; right: 12px; transform: none; justify-content: space-between; }

  .event-card-secondary { flex-direction: column; }
  .event-search { flex-wrap: wrap; }

  /* Both maxima are already caps, so only the padding needs easing on a phone. */
  .presale-panel { padding: 32px 18px 36px; }
  .presale-panel h2 { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .event-card:hover { transform: none; }
  .event-card:hover .event-card-media img { transform: none; }
  .wall-tile:hover { transform: none; }
  .lightbox { animation: none; }
  .lightbox-spinner { animation-duration: 2s; }
}

/* -- photographer attribution --------------------------------------------- */

/* "Photos by A & B" credit — inline avatars + names, wraps on narrow cards. */
.photo-credit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 4px;
  margin: 10px 0 0;
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.3;
}
.photo-credit-label { font-weight: 500; }
.photo-credit-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.photo-credit-name { color: var(--text); font-weight: 500; }
.photo-credit-sep { color: var(--muted); }
.photo-credit-more { color: var(--muted); font-style: italic; }

/* Credit avatars are smaller than the org badge they reuse. */
.photo-credit .org-badge {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}
.photo-credit .org-badge-empty { font-size: .6rem; }

/* The gallery-header credit sits a touch larger, under the title. */
.gallery-head-main .photo-credit { margin-top: 12px; font-size: .92rem; }
.gallery-head-main .photo-credit .org-badge { width: 26px; height: 26px; }

/* -- grouped photographer sections + jump sidebar ------------------------- */
.photo-grouped {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.photog-jump {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.photog-jump-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  font-size: .88rem;
  line-height: 1.2;
}
.photog-jump-btn:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.photog-jump-btn .org-badge { width: 28px; height: 28px; border-radius: 7px; }
.photog-jump-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.photog-jump-count {
  flex-shrink: 0;
  font-size: .78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.photo-section { scroll-margin-top: 84px; }
.photo-section + .photo-section { margin-top: 34px; }

.photo-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 1.15rem;
  font-weight: 500;
}
.photo-section-head .org-badge { width: 30px; height: 30px; }
.photo-section-name { min-width: 0; }
.photo-section-count {
  margin-left: auto;
  flex-shrink: 0;
  font-size: .82rem;
  font-weight: 400;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 860px) {
  .photo-grouped { grid-template-columns: 1fr; gap: 18px; }

  /* Sidebar collapses to a sticky, horizontally scrollable jump bar. */
  .photog-jump {
    position: sticky;
    top: 0;
    z-index: 5;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0;
    margin: 0 -4px;
    background: var(--bg);
    scrollbar-width: none;
  }
  .photog-jump::-webkit-scrollbar { display: none; }
  .photog-jump-btn { flex: 0 0 auto; }
  .photog-jump-name { max-width: 34vw; }
}

@media (max-width: 390px) {
  .photo-section-head { font-size: 1.05rem; }
  .photo-section-count { margin-left: 8px; }
}
