/* Hallmark · component: Explore group filters · theme: incumbent Wiki · v2.0.0 */
/* One quiet scroll row keeps canonical group names readable and the feed in view. */
.explore-taxonomy {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 4px 2px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: none;
  touch-action: pan-x pinch-zoom;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
  scroll-padding-inline: 2px;
  user-select: none;
}
.explore-group-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 44px;
  max-width: calc(100% - 4px);
  min-height: 44px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-text);
  background: var(--color-bg);
  font: 600 13px/1.4 var(--font);
  white-space: nowrap;
  cursor: pointer;
}
.explore-group-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.explore-group-chip:hover {
  border-color: var(--color-text);
  background: var(--color-notice-bg);
}
.explore-group-chip[aria-pressed='true'] {
  border-color: var(--color-text);
  color: var(--color-bg);
  background: var(--color-text);
}
.explore-group-chip:active {
  opacity: 0.8;
}
.explore-group-chip:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -3px;
}
.explore-taxonomy.dragging,
.explore-taxonomy.dragging .explore-group-chip {
  cursor: grabbing;
}
.explore-group-chip:disabled {
  color: var(--color-muted);
  background: var(--color-notice-bg);
  cursor: default;
}
.reels-top .explore-find-row {
  display: flex;
  align-items: center;
  flex: 0 0 100%;
  gap: 4px;
  width: 100%;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  color: var(--color-text);
  background: var(--color-surface);
  text-shadow: none;
}
.reels-top .explore-find-row .explore-tabs {
  flex: 0 0 auto;
  min-width: 44px;
  gap: 0;
  margin: 0;
  padding: 0;
}
.reels-top .explore-find-row .explore-tab {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 4px;
  color: var(--color-text);
  border-bottom-color: var(--color-primary);
  text-shadow: none;
}
.reels-top .explore-find-row :is(.reels-new, .reels-close) {
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--color-text);
  background: transparent;
  box-shadow: none;
}
.reels-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
.reels-filter-row .segment {
  min-width: 0;
}
.reels-filter-row .segment button {
  min-width: 44px;
  min-height: 44px;
  padding-inline: 9px;
}
.explore-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 12px;
}
.explore-search-row .explore-search {
  flex: 1 1 120px;
  width: 0;
  min-width: 64px;
  min-height: 44px;
  margin: 0;
}
.explore-search-row .explore-taxonomy {
  flex: 1 1 160px;
  max-width: 360px;
}
.reels-feedback {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 16px;
  box-sizing: border-box;
  min-height: 100%;
  height: 100%;
  padding: 160px 20px 80px;
  color: var(--color-text);
  background: var(--color-surface);
  text-align: center;
}
.reels-feedback .reels-empty {
  margin: 0;
  padding: 0;
}
.reels-feedback button {
  min-width: 44px;
  min-height: 44px;
}
.reel-by .reel-account-avatar {
  --account-avatar-size: 36px;
  width: var(--account-avatar-size);
  height: var(--account-avatar-size);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  background: var(--color-surface);
  text-shadow: none;
}
.reel-by-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: calc(100% - 44px);
  overflow-wrap: anywhere;
}
.reels-side .reel-by .reel-account-avatar {
  --account-avatar-size: 40px;
}
.feed-post .byline .account-avatar {
  --account-avatar-size: 36px;
  width: var(--account-avatar-size);
  height: var(--account-avatar-size);
}
.feed-post .byline a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  overflow-wrap: anywhere;
}
.explore-cell-author {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 30px;
  display: flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: calc(100% - 12px);
  padding: 3px 6px 3px 3px;
  border-radius: 999px;
  color: var(--color-text);
  background: var(--color-surface);
  font-size: 11px;
  line-height: 1.3;
  pointer-events: none;
}
.explore-cell-author > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.explore-grid-avatar {
  --account-avatar-size: 24px;
  font-size: 10px;
}
@media (max-width: 359px) {
  .reels-top .explore-find-row {
    gap: 2px;
    padding: 2px;
  }
  .explore-group-chip {
    padding-inline: 12px;
  }
  .reels-filter-row .segment button {
    padding-inline: 7px;
    font-size: 12px;
  }
}

/* Place profiles keep the feed's snap navigation, with a readable wiki identity and
   native place actions. A contribution is never presented as a customer review. */
.reel-place {
  display: grid;
  grid-template-rows: minmax(64px, 1fr) minmax(0, auto) auto;
  gap: 12px;
  box-sizing: border-box;
  padding: calc(var(--reels-top-height, 176px) + 12px) 14px 14px;
  color: var(--color-text);
  background: var(--color-surface);
}
.reel-place .reel-place-media {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: auto;
  transform: none;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
  background: var(--color-notice-bg);
}
.reel-place-media > .reel-picture {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
}
.reel-place-placeholder {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 16px;
  color: var(--color-muted);
  text-align: center;
  font-size: 14px;
}
.reel-place-placeholder > .ios-icon {
  width: 44px;
  height: 44px;
}
.reel-place-info {
  position: static;
  min-height: 0;
  max-height: calc(100dvh - var(--reels-top-height, 176px) - 188px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
  color: var(--color-text);
  background: none;
  text-shadow: none;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
.reel-place-info a {
  color: var(--color-text);
}
.reel-place-name {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.reel-place-name > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
.reel-place-contributed {
  margin: 2px 0 10px;
  color: var(--color-muted);
  font-size: 13px;
}
.reel-place-address {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 6px;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.reel-place-address > .ios-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 20px;
}
.reel-place-by {
  gap: 2px 8px;
  font-size: 13px;
}
.reel-place-by .reel-when {
  flex-basis: 100%;
  color: var(--color-muted);
  opacity: 1;
}
.reel-place-info .reel-place-open,
.reels-side .reel-place-info .reel-place-open {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  box-sizing: border-box;
  margin-top: 12px;
  color: var(--color-bg);
  background: var(--color-text);
  text-decoration: none;
}
.reel-place-rail {
  position: static;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
}
.reel-place-rail :is(button, a) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--color-text);
  background: var(--color-notice-bg);
  text-shadow: none;
  font: 600 13px var(--font);
}
.reel-place-rail button:last-child {
  margin-left: auto;
}
.reel-place-rail .ios-icon {
  width: 22px;
  height: 22px;
}
.reel-place :is(a, button):focus-visible,
.reels-side :is(.reel-place-info, .reel-place-rail) :is(a, button):focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}
@media (min-width: 1024px) {
  .reels-screen .reel-place {
    display: block;
    padding: 0;
    background: var(--color-bg);
  }
  .reels-screen .reel-place .reel-place-media {
    position: absolute;
    inset: 12px auto auto;
    left: 50%;
    width: auto;
    max-width: calc(100% - 140px);
    height: calc(100% - 24px);
    aspect-ratio: 9 / 16;
    transform: translateX(-50%);
  }
  .reels-side .reel-place-info {
    flex: 0 1 auto;
    max-height: calc(100% - 80px);
    padding: 20px 16px;
  }
  .reels-side .reel-place-rail {
    flex: 0 0 auto;
    flex-wrap: wrap;
    padding: 8px 16px;
    border: 0;
  }
  .reels-side .reel-place-rail :is(button, a) {
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    background: var(--color-notice-bg);
  }
}

/* On a phone, the content is the stage. Filters, captions and actions sit over it. */
.reels-select,
.reel-place-name > a > .ios-icon {
  display: none;
}

@media (max-width: 1023px) {
  .reels-screen.reels-browse > .reels-top {
    gap: 4px;
    padding: 4px 12px 8px;
    pointer-events: none;
    background: linear-gradient(
      color-mix(in srgb, var(--reel-stage) 78%, transparent),
      transparent
    );
  }
  .reels-browse .reels-top .explore-find-row {
    gap: 4px;
    padding: 0;
    border: 0;
    color: var(--reel-ink);
    background: none;
  }
  .reels-browse .reels-top .explore-find-row :is(.explore-tab, .reels-new, .reels-close) {
    color: var(--reel-ink);
    border-bottom-color: currentColor;
    pointer-events: auto;
    text-shadow: 0 1px 4px var(--reel-stage);
  }
  .reels-browse .explore-find-row > .explore-taxonomy,
  .reels-browse .reels-filter-row > .segment {
    display: none;
  }
  .reels-browse .reels-filter-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }
  .reels-browse .reels-select {
    position: relative;
    display: block;
    flex: 1 1 0;
    min-width: 0;
    color: var(--reel-ink);
    pointer-events: auto;
  }
  .reels-browse .reels-top .reels-select select {
    display: block;
    appearance: none;
    width: 100%;
    min-height: 44px;
    padding: 4px 32px 4px 10px;
    border: 1px solid color-mix(in srgb, var(--reel-ink) 38%, transparent);
    border-radius: 8px;
    color-scheme: dark;
    color: var(--reel-ink);
    background: color-mix(in srgb, var(--reel-stage) 78%, transparent);
    font: 600 1rem/1.3 var(--font);
    text-overflow: ellipsis;
  }
  .reels-select select:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
  }
  .reels-select > .ios-icon {
    position: absolute;
    inset: 50% 10px auto auto;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    pointer-events: none;
  }
  .reels-browse .reel {
    --reel-controls-space: 0px;
    --reel-overlay-bottom: calc(8px + var(--reel-controls-space));
    --reel-thumbs-top: calc(var(--reels-top-height, 104px) + 4px);
    display: block;
    padding: 0;
    color: var(--reel-ink);
    background: var(--reel-stage);
  }
  .reels-browse .reel:has(> [data-selected-video]) {
    --reel-controls-space: 56px;
  }
  .reels-screen.reels-browse .reel > .reel-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border-radius: 0;
    transform: none;
    color: var(--reel-ink);
    background: var(--reel-stage);
  }
  .reels-browse .reel-media :is(.reel-photos, video) {
    min-width: 0;
    min-height: 0;
  }
  .reels-browse .reel-media,
  .reels-browse .reel-media .reel-photo {
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  }
  .reels-screen.reels-browse .reel-media .reel-picture {
    object-fit: contain;
  }
  /* Landscape clips retain their full composition; the video stage itself fills the feed. */
  .reels-screen.reels-browse .reel-media video[data-portrait] {
    object-fit: cover;
  }
  .reels-screen.reels-browse .reel > .reel-thumbs {
    inset: var(--reel-thumbs-top) 10px auto auto;
    box-sizing: border-box;
    max-height: min(
      176px,
      max(56px, calc(100% - var(--reel-thumbs-top) - 260px - var(--reel-controls-space)))
    );
    padding: 6px;
    color: var(--reel-ink);
    background: color-mix(in srgb, var(--reel-stage) 62%, transparent);
    backdrop-filter: none;
    overscroll-behavior: contain;
  }
  .reels-browse .reel-thumbs .reel-thumb {
    width: 44px;
    height: 44px;
    color: var(--reel-ink);
    background: color-mix(in srgb, var(--reel-ink) 20%, var(--reel-stage));
  }
  .reels-browse .reel-thumbs .reel-thumb.on {
    opacity: 1;
    box-shadow: 0 0 0 2px var(--reel-ink);
  }
  .reels-screen.reels-browse .reel:has(> .reel-thumbs:not([hidden])) .reel-dots {
    display: none;
  }
  .reels-screen.reels-browse .reel:has(> .reel-thumbs:not([hidden])) .reel-arrow {
    display: none;
  }
  .reels-browse .reel-arrow:disabled {
    visibility: hidden;
  }
  .reels-browse .reel > .reel-info {
    position: absolute;
    z-index: 1;
    inset: auto 0 var(--reel-overlay-bottom);
    box-sizing: border-box;
    max-height: min(44%, 300px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 12px 78px 8px 14px;
    color: var(--reel-ink);
    background: none;
    text-shadow: 0 1px 4px var(--reel-stage);
    overflow-wrap: anywhere;
  }
  .reels-browse .reel::after {
    position: absolute;
    inset: auto 0 var(--reel-controls-space);
    height: min(58%, 360px);
    background: linear-gradient(
      transparent,
      color-mix(in srgb, var(--reel-stage) 92%, transparent) 84%
    );
    pointer-events: none;
    content: '';
  }
  .reels-browse .reel-info a {
    color: inherit;
  }
  .reels-browse .reel-info .reel-caption {
    font-size: 14px;
    line-height: 1.45;
  }
  .reels-browse .reel-place-name {
    font-size: 21px;
  }
  .reels-browse .reel-place-name > a {
    gap: 4px;
  }
  .reels-browse .reel-place-name > a > .ios-icon {
    display: block;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    color: inherit;
  }
  .reels-browse .reel-place-info .reel-place-open {
    display: none;
  }
  .reels-browse .reel-place-contributed,
  .reels-browse .reel-place-address {
    margin: 0 0 4px;
    color: inherit;
  }
  .reels-browse .reel-by {
    margin: 0 0 4px;
    gap: 0 6px;
  }
  .reels-browse .reel-place-by .reel-when {
    flex-basis: auto;
    padding-block-end: 4px;
    color: inherit;
  }
  .reels-browse .reel-by .reel-account-avatar {
    --account-avatar-size: 28px;
  }
  .reels-browse .reel-by-link {
    font-size: 13px;
  }
  .reels-browse .reel-chip {
    max-width: 100%;
    box-sizing: border-box;
    padding-block: 0;
    background: color-mix(in srgb, var(--reel-stage) 72%, transparent);
  }
  .reels-browse :is(.reel-chip a, .reel-time, .reel-original) {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .reels-browse .reel > .reel-rail {
    position: absolute;
    inset: auto 8px var(--reel-overlay-bottom) auto;
    display: grid;
    gap: 4px;
  }
  .reels-browse .reel-rail :is(button, a) {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 52px;
    min-height: 44px;
    padding: 2px 0;
    border: 0;
    border-radius: 8px;
    color: var(--reel-ink);
    background: color-mix(in srgb, var(--reel-stage) 52%, transparent);
    text-shadow: 0 1px 4px var(--reel-stage);
    font-size: 11px;
  }
  .reels-browse .reel-rail button:last-child {
    margin-inline-start: auto;
  }
  .reels-browse .reel-rail .ios-icon {
    width: 24px;
    height: 24px;
  }
  .reels-browse .reel-rail .rail-like[aria-pressed='true'] .rail-icon {
    color: var(--brand-red);
  }
  .reels-browse .reel-unmute {
    top: calc(var(--reels-top-height, 104px) + 12px);
    min-height: 44px;
  }
  .reels-browse .reels-feedback,
  .reels-browse .reels > .loading-view--post {
    padding-top: calc(var(--reels-top-height, 104px) + 12px);
  }
}

@media (min-width: 1024px) {
  .reels-screen.reels-browse .reel {
    --reel-frame-top: calc(var(--reels-top-height, 128px) + 4px);
    /* Leave room for the stage arrows and the 82px thumbnail column. */
    --reel-frame-width: min(
      calc((100cqh - var(--reel-frame-top) - 12px) * 9 / 16),
      calc(100cqw - 256px)
    );
    --reel-frame-center: min(50%, calc(100% - 176px - var(--reel-frame-width) / 2));
    --reel-frame-height: calc(var(--reel-frame-width) * 16 / 9);
  }
  .reels-screen.reels-browse .reel > .reel-media {
    top: var(--reel-frame-top);
    left: var(--reel-frame-center);
    width: var(--reel-frame-width);
    height: var(--reel-frame-height);
  }
  .reels-screen.reels-browse .reel > .reel-thumbs {
    top: var(--reel-frame-top);
    left: calc(var(--reel-frame-center) + var(--reel-frame-width) / 2 + 14px);
    max-height: var(--reel-frame-height);
  }
}
