/* Ideas: the Saved ideas page (.ixs) and the "Share an idea" composer (.ixn).
   Theme tokens only, so light and dark just work. Saved tiles use the always-dark idea look
   (photo, or the topic colour gradient of the feed's text cards) with white text. */

/* =====================================================================================
   Saved ideas
   ===================================================================================== */
@media (min-width: 1024px) {
  .ixs.narrow {
    max-width: 820px;
  }
}
.ixs__bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 14px;
}
.ixs__chips {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  /* room for the focus ring inside the scroller */
  padding: 4px 4px 6px;
  margin: -4px 0 -6px -4px;
  scrollbar-width: none;
}
.ixs__chips::-webkit-scrollbar {
  display: none;
}
.ixs__chip {
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  font-size: 14px;
  scroll-snap-align: start;
}
.ixs__chip:hover:not([aria-pressed='true']) {
  background: var(--surface-3);
}
.ixs__chip--new {
  gap: 4px;
  padding-left: 12px;
  background: transparent;
  border-style: dashed;
  border-color: var(--line-2);
  color: var(--text-2);
}
.ixs__opts {
  flex: none;
}

.ixs__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (min-width: 640px) {
  .ixs__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .ixs__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.ixs__grid > li {
  min-width: 0;
}
.ixs-skel {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-m);
}

.ixs-tile {
  --h: 300;
  position: relative;
  isolation: isolate;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius-m);
  color: #fff;
  text-decoration: none !important;
  background: #060609;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-1) var(--ease);
}
.ixs-tile--text {
  background:
    radial-gradient(120% 80% at 80% 0%, hsl(var(--h) 70% 30%), transparent 60%),
    linear-gradient(170deg, hsl(var(--h) 45% 16%), #060609 75%);
}
.ixs-tile:active {
  transform: scale(0.98);
}
.ixs-tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-m);
}
.ixs-tile__img {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-3) var(--ease);
}
@media (hover: hover) {
  .ixs-tile:hover .ixs-tile__img {
    transform: scale(1.04);
  }
}
.ixs-tile__mark {
  position: absolute;
  top: 12px;
  right: 10px;
  z-index: -1;
  opacity: 0.16;
  line-height: 0;
}
.ixs-tile__shade {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  justify-items: start;
  gap: 6px;
  padding: 36px 10px 11px;
  background: linear-gradient(rgb(0 0 0 / 0), rgb(0 0 0 / 0.55) 40%, rgb(0 0 0 / 0.86));
}
.ixs-tile--text .ixs-tile__shade {
  background: none;
}
.ixs-tile__topic {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.16);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.ixs-tile__topic > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ixs-tile__topic .icon {
  flex: none;
}
.ixs-tile__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);
}

.ixs__more {
  display: grid;
  justify-items: center;
  min-height: 1px;
  padding: 20px 0 0;
}
.ixs__more:empty {
  padding: 0;
}
.ixs__more .alert {
  justify-self: stretch;
}
.ixs__spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2.5px solid var(--line-2);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.ixs-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 48px 16px 32px;
  text-align: center;
}
.ixs-empty__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--accent);
}
.ixs-empty__title {
  margin: 0;
  font-size: 20px;
}
.ixs-empty p {
  max-width: 32ch;
  margin: 0 0 10px;
  color: var(--text-2);
}

.ixs-name {
  gap: 14px;
}
.ixs-confirm__text {
  margin: 0 0 18px;
  color: var(--text-2);
}
.ixs-confirm__actions {
  display: grid;
  gap: 10px;
}

/* =====================================================================================
   Share an idea
   ===================================================================================== */
.ixn__form {
  display: grid;
  gap: 28px;
  margin-top: 4px;
}
.ixn-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.ixn-group__legend,
.ixn-label {
  display: block;
  padding: 0;
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 750;
  color: var(--text);
}
.ixn-label {
  margin: 0;
}
.ixn-optional {
  font-weight: 500;
  color: var(--text-3);
}

/* Hidden native radios: the tile or chip after them shows the state (arrow keys still work). */
.ixn-radio {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

/* --- Trip tiles ------------------------------------------------------------------------ */
.ixn-trips {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
  margin-inline: calc(var(--gutter) * -1);
  padding: 4px var(--gutter) 8px;
  scrollbar-width: none;
}
.ixn-trips::-webkit-scrollbar {
  display: none;
}
.ixn-trips__group {
  display: flex;
  flex: none;
  gap: 10px;
}
.ixn-trip {
  position: relative;
  display: block;
  flex: none;
  width: 96px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
}
.ixn-trip__card {
  display: grid;
  gap: 3px;
}
.ixn-trip__media {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin-bottom: 4px;
  overflow: hidden;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  transition: transform var(--dur-1) var(--ease);
}
.ixn-trip__media--general {
  color: var(--accent);
}
.ixn-trip__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Selected ring, drawn above the photo. */
.ixn-trip__media::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2.5px var(--accent);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease);
}
.ixn-trip__flag {
  font-size: 34px;
  line-height: 1;
}
.ixn-trip__tick {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.35);
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity var(--dur-2) var(--ease),
    transform var(--dur-2) var(--ease-spring);
}
.ixn-trip__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
}
.ixn-trip__sub {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-3);
}
.ixn-trip:active .ixn-trip__media {
  transform: scale(0.97);
}
.ixn-radio:checked + .ixn-trip__card .ixn-trip__media::after,
.ixn-radio:checked + .ixn-trip__card .ixn-trip__tick {
  opacity: 1;
}
.ixn-radio:checked + .ixn-trip__card .ixn-trip__tick {
  transform: none;
}
.ixn-radio:focus-visible + .ixn-trip__card .ixn-trip__media {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ixn-trip--more .ixn-trip__media {
  border-style: dashed;
  border-color: var(--line-2);
  background: transparent;
}
.ixn-trip--more:focus-visible {
  outline: none;
}
.ixn-trip--more:focus-visible .ixn-trip__media {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ixn-trip--more:disabled {
  opacity: 0.55;
  cursor: progress;
}

.ixn-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-m);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}
.ixn-note .icon {
  flex: none;
  margin-top: 1px;
  color: var(--accent);
}

/* --- Topic chips ------------------------------------------------------------------------- */
.ixn-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ixn-chip {
  position: relative;
  display: block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ixn-chip__face {
  min-height: 44px;
  padding: 0 14px 0 12px;
  font-size: 14px;
  transition:
    background-color var(--dur-2) var(--ease),
    border-color var(--dur-2) var(--ease),
    color var(--dur-2) var(--ease),
    transform var(--dur-1) var(--ease);
}
.ixn-chip__face .icon {
  flex: none;
  color: var(--text-2);
}
.ixn-chip:hover .ixn-chip__face {
  background: var(--surface-3);
}
.ixn-chip:active .ixn-chip__face {
  transform: scale(0.97);
}
.ixn-radio:checked + .ixn-chip__face {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.ixn-radio:checked + .ixn-chip__face .icon {
  color: currentColor;
}
.ixn-radio:focus-visible + .ixn-chip__face {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Text fields ------------------------------------------------------------------------- */
.ixn-field {
  gap: 10px;
}
.ixn-body {
  min-height: 140px;
  line-height: 1.55;
}
.ixn-field__foot {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: -2px;
}
.ixn-count {
  margin: 0 0 0 auto;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ixn-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}
.ixn-group > .ixn-error {
  margin-top: 10px;
}
.ixn-field .input[aria-invalid='true'] {
  border-color: color-mix(in srgb, var(--danger) 60%, transparent);
}

/* --- Photo ------------------------------------------------------------------------------- */
.ixn-photos {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  overflow-x: auto;
  margin-inline: calc(var(--gutter) * -1);
  padding: 4px var(--gutter) 6px;
  scrollbar-width: none;
}
.ixn-photos::-webkit-scrollbar {
  display: none;
}
.ixn-photos__group {
  display: flex;
  flex: none;
  gap: 8px;
}
.ixn-ptile {
  position: relative;
  display: block;
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-2);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ixn-ptile__face {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  transition: transform var(--dur-1) var(--ease);
}
.ixn-ptile__face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ixn-ptile__face::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2.5px var(--accent);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease);
}
.ixn-ptile__face--icon {
  align-content: center;
  gap: 3px;
}
.ixn-ptile__face--icon small {
  font-size: 11px;
  font-weight: 650;
  line-height: 1.1;
}
.ixn-ptile:active .ixn-ptile__face {
  transform: scale(0.96);
}
.ixn-radio:checked + .ixn-ptile__face,
.ixn-ptile--upload.is-on .ixn-ptile__face {
  color: var(--text);
}
.ixn-radio:checked + .ixn-ptile__face::after,
.ixn-ptile--upload.is-on .ixn-ptile__face::after {
  opacity: 1;
}
.ixn-radio:focus-visible + .ixn-ptile__face,
.ixn-ptile--upload:focus-visible .ixn-ptile__face {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ixn-ptile--upload:focus-visible {
  outline: none;
}
.ixn-ptile--upload .ixn-ptile__face {
  border-style: dashed;
  border-color: var(--line-2);
  background: transparent;
}

.ixn-preview {
  position: relative;
  max-width: 460px;
  margin-top: 12px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-l);
  background: var(--surface-2);
  border: 1px solid var(--line);
  animation: fade-in var(--dur-3) var(--ease) both;
}
.ixn-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ixn-preview__remove {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgb(0 0 0 / 0.58);
  border-color: rgb(255 255 255 / 0.22);
  color: #fff;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.ixn-preview__remove:hover:not(:disabled) {
  background-color: rgb(0 0 0 / 0.72);
}

/* --- Team, rules and the share button ------------------------------------------------------ */
.ixn-team {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 14px;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
}
.ixn-team input {
  flex: none;
  width: 20px;
  height: 20px;
}
.ixn__submit {
  display: grid;
  gap: 12px;
}
.ixn-rules {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}
.ixn-rules .icon {
  flex: none;
  margin-top: 1px;
}
.ixn__submit .form__error {
  margin: 0;
}
.ixn-starter {
  margin: 4px 0 0;
  text-align: center;
}
.ixn-starter .btn--link {
  min-height: 44px;
}
.ixn-starter .btn--link[aria-busy='true']::after {
  border-color: var(--line-2);
  border-top-color: var(--accent);
}

/* --- Can't post yet ------------------------------------------------------------------------ */
.ixn-block {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 32px 22px;
  text-align: center;
}
.ixn-block__icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin-bottom: 4px;
  border-radius: 18px;
  background: var(--brand-soft), var(--surface-2);
  color: var(--accent);
}
.ixn-block__title {
  margin: 0;
  font-size: 20px;
}
.ixn-block__text {
  max-width: 40ch;
  margin: 0 0 6px;
  color: var(--text-2);
}

@media (prefers-reduced-motion: reduce) {
  .ixs-tile,
  .ixs-tile__img,
  .ixn-trip__media,
  .ixn-trip__tick,
  .ixn-chip__face,
  .ixn-ptile__face,
  .ixn-preview {
    transition: none !important;
    animation: none !important;
  }
  .ixs-tile:hover .ixs-tile__img {
    transform: none;
  }
}
