/* =====================================================================================
   Ideas: the swipe feed of travel tips (views/ideas.js, ideaKit.js)
   .ix  = the feed (always dark, like stories), .ixk = sheet contents (follow the app theme).
   Saved and the composer live in ideas-pages.css.
   ===================================================================================== */

/* The feed fills the screen between the sidebar and the tab bar, and scrolls on its own. */
body[data-route='ideas'] {
  overflow: hidden;
}
/* Opacity only: a transform on the page would break the fixed feed. */
body[data-route='ideas'] .page--enter {
  animation-name: fade-in;
}
body[data-route='ideas'] .verify-banner {
  display: none;
}
@media (max-width: 1023.98px) {
  body[data-route='ideas'] .topbar {
    display: none;
  }
}
html.ix-open,
html.ix-open body {
  overflow: hidden;
  overscroll-behavior: none;
}
/* Toasts float above the card's action bar. */
body[data-route='ideas'] .toasts {
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 76px);
}

.ix {
  /* Always dark: the dark theme's values, whatever theme the app is in. */
  --bg: #060609;
  --surface: #151011;
  --surface-2: #262021;
  --surface-3: #332b2d;
  --line: rgb(255 240 244 / 0.09);
  --line-2: rgb(255 240 244 / 0.15);
  --text: #f9f8f8;
  --text-2: #b6b3b4;
  --text-3: #8f8f8f;
  --accent: #d671ed;
  --gold-text: #f2c35b;
  --danger: #f94144;
  --danger-soft: rgb(249 65 68 / 0.12);
  --skel-base: #1c1618;
  --skel-shine: rgb(255 255 255 / 0.06);
  --shadow-brand: 0 10px 28px -10px rgb(173 26 201 / 0.75), 0 4px 12px -6px rgb(207 32 162 / 0.55);

  position: fixed;
  z-index: 1;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-b));
  background: #060609;
  color: #fff;
  color-scheme: dark;
}
.ix :focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.ix ::selection {
  background: rgb(214 113 237 / 0.4);
  color: #fff;
}

/* ---------- Header ---------- */
.ix__head {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  padding: calc(var(--safe-t) + 6px) calc(8px + var(--safe-r)) 16px calc(8px + var(--safe-l));
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  background: linear-gradient(rgb(0 0 0 / 0.55), transparent);
}
.ix__head > * {
  pointer-events: auto;
}
.ix__btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #fff;
  text-decoration: none !important;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.5));
  transition:
    background-color var(--dur-2) var(--ease),
    transform var(--dur-1) var(--ease);
}
.ix__btn:hover {
  background: rgb(255 255 255 / 0.12);
}
.ix__btn:active {
  transform: scale(0.92);
}
.ix__htitle {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font: 800 17px/1.2 var(--font-ui);
  letter-spacing: -0.015em;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgb(0 0 0 / 0.5);
}
.ix__follow {
  flex: none;
  height: 32px;
  padding: 0 14px;
  border: 1px solid rgb(255 255 255 / 0.7);
  border-radius: 999px;
  background: rgb(0 0 0 / 0.2);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  transition:
    background-color var(--dur-2) var(--ease),
    color var(--dur-2) var(--ease);
}
.ix__follow[aria-pressed='true'] {
  background: #fff;
  border-color: #fff;
  color: #111;
}
.ix__follow[hidden] {
  display: none;
}
.ix__tools {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

/* ---------- Feed and cards ---------- */
.ix__feed {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.ix__feed::-webkit-scrollbar {
  display: none;
}
.ix__card {
  flex: none;
  position: relative;
  height: 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  touch-action: manipulation;
  background: #060609;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.ix__card:focus-visible {
  outline: none;
}
/* Keyboard focus: a ring drawn over the whole card, photo included. */
.ix__card:focus-visible::after {
  content: '';
  position: absolute;
  z-index: 4;
  inset: 0;
  border: 2px solid rgb(255 255 255 / 0.75);
  border-radius: inherit;
  pointer-events: none;
}
.ix__card--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%);
  padding-top: calc(var(--safe-t) + 56px);
}
.ix__mark {
  position: absolute;
  top: calc(var(--safe-t) + 60px);
  right: 16px;
  opacity: 0.1;
  pointer-events: none;
}
.ix__media {
  flex: none;
  height: clamp(150px, 40%, 440px);
  position: relative;
  background: hsl(var(--h) 30% 12%);
}
.ix__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
}
.ix__media::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(transparent, #060609);
}
.ix__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px calc(18px + var(--safe-r)) 8px calc(18px + var(--safe-l));
}
.ix__card--text .ix__body {
  justify-content: center;
}

.ix__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.ix__topic {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.14);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none !important;
}
.ix__topic:hover {
  background: rgb(255 255 255 / 0.2);
}
.ix__proof {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px 0 6px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 750;
}
.ix__proof--permanent {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2));
  color: #3a2500;
  border: 1px solid var(--gold-3);
}
.ix__proof--temporary {
  background: rgb(255 255 255 / 0.14);
  color: #fff;
  border: 1px dashed rgb(255 255 255 / 0.6);
}
.ix__coin {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex: none;
}
.ix__proof--permanent .ix__coin {
  background: radial-gradient(circle at 35% 30%, #fffbe8, var(--gold-2) 55%, var(--gold-3));
  box-shadow:
    inset 0 0 0 1.5px rgb(255 255 255 / 0.55),
    0 1px 2px rgb(58 37 0 / 0.4);
}
.ix__proof--temporary .ix__coin {
  background: radial-gradient(circle at 35% 30%, rgb(255 255 255 / 0.85), rgb(255 255 255 / 0.25) 60%, rgb(255 255 255 / 0.1));
  border: 1px dashed rgb(255 255 255 / 0.75);
}
.ix__read {
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
}

.ix__title {
  flex: none;
  font: 800 22px/1.25 var(--font-ui);
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.ix__card--text .ix__title {
  font-size: 28px;
}
.ix__text {
  flex: 0 1 auto;
  min-height: calc(3 * 1.55em);
  overflow: hidden;
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: rgb(255 255 255 / 0.88);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.ix__text.is-clamped {
  -webkit-mask-image: linear-gradient(#000 70%, transparent);
  mask-image: linear-gradient(#000 70%, transparent);
}
.ix__readall {
  align-self: flex-start;
  margin-top: -6px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ix__readall[hidden] {
  display: none;
}

/* Place and byline (also used in the Read all sheet, with the app's colours). */
.ix__place {
  display: block;
  align-self: flex-start;
  max-width: 100%;
  color: var(--text-2);
  font-size: 14px;
  text-decoration: none !important;
}
.ix__place .display {
  color: var(--text);
  font-size: 19px;
  line-height: 1.1;
  padding-right: 1px; /* room for the italic's overhang before the comma */
}
.ix__place:hover .display {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ix__flag {
  margin-right: 4px;
}
.ix__by {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  color: var(--text-2);
  font-size: 13.5px;
}
.ix__author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  min-width: 0;
  color: var(--text);
  font-weight: 700;
  text-decoration: none !important;
}
.ix__author:hover .ix__name {
  text-decoration: underline;
}
.ix__name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ix__team {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}
.ix__team img {
  width: 20px;
  height: 22px;
}

/* ---------- Action bar ---------- */
.ix__actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px calc(10px + var(--safe-r)) 8px calc(10px + var(--safe-l));
  border-top: 1px solid rgb(255 255 255 / 0.08);
}
.ix__act {
  position: relative;
  min-width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: #fff;
  transition:
    background-color var(--dur-2) var(--ease),
    transform var(--dur-1) var(--ease);
}
.ix__act:hover {
  background: rgb(255 255 255 / 0.08);
}
.ix__act:active {
  transform: scale(0.92);
}
.ix__act--more {
  margin-left: auto;
}
.ix__count {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ix__act .ix__on {
  display: none;
}
.ix__act[aria-pressed='true'] .ix__off {
  display: none;
}
.ix__act[aria-pressed='true'] .ix__on {
  display: block;
}
.ix__like .lk-icon.ix__on {
  color: inherit;
}
.ix__act.is-popping .ix__on {
  animation: ix-pop 520ms var(--ease-spring) both;
}
@keyframes ix-pop {
  0% {
    transform: scale(0.6);
  }
  55% {
    transform: scale(1.22);
  }
  100% {
    transform: scale(1);
  }
}

/* ---------- Notice cards ---------- */
.ix__note {
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: calc(var(--safe-t) + 24px) 24px 24px;
  gap: 12px;
  background:
    radial-gradient(90% 60% at 50% 30%, rgb(173 26 201 / 0.16), transparent 70%),
    #060609;
}
.ix__note-icon {
  display: grid;
  place-items: center;
  color: rgb(255 255 255 / 0.85);
}
.ix__note-title {
  margin: 0;
  max-width: 22ch;
  font: 800 22px/1.25 var(--font-ui);
  letter-spacing: -0.02em;
}
.ix__note-text {
  margin: 0;
  max-width: 32ch;
  color: var(--text-2);
  font-size: 15px;
}
.ix__note-actions {
  display: grid;
  gap: 10px;
  width: min(100%, 300px);
  margin-top: 8px;
}

/* ---------- Skeleton ---------- */
.ix__skel-media,
.ix__skel-line,
.ix__skel-dot {
  display: block;
  background-color: var(--skel-base);
  background-image: linear-gradient(100deg, transparent 20%, var(--skel-shine) 50%, transparent 80%);
  background-size: 200% 100%;
  background-repeat: no-repeat;
  animation: shimmer 1.5s linear infinite;
}
.ix__skel-media {
  flex: none;
  height: clamp(150px, 40%, 440px);
}
.ix__skel-line {
  height: 14px;
  border-radius: 7px;
}
.ix__skel-line--title {
  height: 26px;
  border-radius: 9px;
  margin-bottom: 6px;
}
.ix__skel .ix__actions {
  gap: 18px;
  padding-block: 14px 16px;
}
.ix__skel-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

/* ---------- Up/down buttons (desktop with a mouse) ---------- */
.ix__nav {
  display: none;
}

/* ---------- Snackbar ("Saved", Add to collection / Undo) ---------- */
.ix-snack {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 68px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
  min-height: 44px;
  padding: 0 6px 0 18px;
  border-radius: 999px;
  background: rgb(30 26 28 / 0.86);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgb(255 255 255 / 0.12);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.45);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}
.ix-snack[hidden] {
  display: none;
}
.ix-snack.is-in {
  animation: ix-snack-in 260ms var(--ease) both;
}
.ix-snack__text {
  overflow: hidden;
  text-overflow: ellipsis;
}
.ix-snack:not(:has(.ix-snack__btn)) {
  padding-right: 18px;
}
.ix-snack__btn {
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: #f49ad9;
  font-weight: 800;
}
.ix-snack__btn:hover {
  background: rgb(255 255 255 / 0.1);
}
@keyframes ix-snack-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

/* ---------- One-time swipe hint ---------- */
.ix-coach {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 14px 24px 16px;
  border-radius: 24px;
  background: rgb(0 0 0 / 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  text-align: center;
  pointer-events: none;
  animation: fade-in 300ms var(--ease) both;
}
.ix-coach strong {
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}
.ix-coach small {
  font-size: 13px;
  opacity: 0.8;
}
.ix-coach__icon {
  display: grid;
  animation: ix-bounce 1.4s ease-in-out infinite;
}
@keyframes ix-bounce {
  0%,
  100% {
    transform: translateY(4px);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* ---------- Desktop: a centred column of cards ---------- */
@media (min-width: 1024px) {
  .ix {
    bottom: 0;
  }
  .ix__card {
    width: min(100%, 460px);
    height: calc(100% - 32px);
    margin: 16px auto;
    scroll-margin-top: 16px;
    border-radius: 22px;
    box-shadow: 0 24px 80px rgb(0 0 0 / 0.5);
  }
  .ix__card--text,
  .ix__note {
    padding-top: 56px;
  }
  .ix__mark {
    top: 60px;
  }
  .ix__head {
    left: 50%;
    right: auto;
    width: min(100%, 460px);
    transform: translateX(-50%);
    top: 16px;
    padding: 6px 8px 16px;
    border-radius: 22px 22px 0 0;
  }
  .ix-snack {
    bottom: 84px;
  }
  body[data-route='ideas'] .toasts {
    bottom: 96px;
  }
}
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .ix__nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
  }
  .ix__nav button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgb(255 255 255 / 0.14);
    color: #fff;
    transition: background-color var(--dur-2) var(--ease);
  }
  .ix__nav button:hover {
    background: rgb(255 255 255 / 0.24);
  }
}

/* ---------- Sheets (app theme) ---------- */
.ixk-lead {
  margin: 0 0 14px;
  color: var(--text-2);
}
.ixk-sub {
  margin: 18px 0 8px;
  font-size: 15px;
}
.ixk-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.ixk-chips .chip {
  min-height: 44px;
  font-size: 14px;
  justify-content: flex-start;
  white-space: normal;
  text-align: left;
  cursor: pointer;
}
.ixk-chip__label {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ixk-chip__flag {
  font-size: 16px;
  line-height: 1;
}
.ixk-stack {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}
.ixk-topics .form__error {
  margin: 14px 0 0;
}
.ixk-topics .form__error[hidden],
.ixk-new .form__error[hidden] {
  display: none;
}

.ixk-coll .option[aria-busy='true'] {
  opacity: 0.6;
  pointer-events: none;
}
.ixk-new {
  margin-top: 16px;
}
.ixk-new__row {
  display: flex;
  gap: 8px;
}
.ixk-new__row .input {
  flex: 1 1 auto;
  min-width: 0;
}
.ixk-new .form__error {
  margin: 10px 0 0;
}

.ixk-proof {
  display: grid;
  gap: 14px;
}
.ixk-proof__tier {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: var(--radius-m);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.ixk-proof__tier p {
  margin: 0;
}
.ixk-proof__tier--permanent {
  border-color: color-mix(in srgb, var(--gold-2) 45%, transparent);
  background: color-mix(in srgb, var(--gold-2) 10%, var(--surface-2));
}
.ixk-proof__coin {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text);
}
.ixk-proof__tier--permanent .ixk-proof__coin {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2) 45%, var(--gold-3));
  color: #3a2500;
}
.ixk-proof__tier--temporary .ixk-proof__coin {
  border: 1.5px dashed var(--line-2);
}
.ixk-note {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}
.ixk-muted {
  margin: 0;
  color: var(--text-3);
  font-size: 13.5px;
}

.ixk-read {
  display: grid;
  gap: 14px;
}
.ixk-read__text {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.ixk-confirm p {
  margin: 0 0 18px;
  color: var(--text-2);
}
.ixk-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .ix-coach,
  .ix-coach *,
  .ix-snack,
  .ix__skel *,
  .ix__act .ix__on {
    animation: none !important;
    transition: none !important;
  }
}
