/*
 * MoEngage Cards inbox: the bell next to the header search and its panel.
 * See inc/cards.php. Everything is scoped to .tl-cards.
 */

.tl-cards {
  --tlc-ink: #0e1a2f;
  --tlc-navy: #0a2c44;
  --tlc-text: #263f52;
  --tlc-muted: rgba(10, 44, 68, 0.64);
  --tlc-blue: #008dc8;
  --tlc-header: #0c417f;
  --tlc-light: #eff3fa;
  --tlc-tint: #e5f3f9;
  --tlc-line: rgba(14, 26, 47, 0.14);
  --tlc-red: #d0342c;
  --tlc-font: FSAlbert, "FS Albert", "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  display: contents;
  font-family: var(--tlc-font);
}

.tl-cards__sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.tl-cards[hidden],
.tl-cards [hidden] {
  display: none !important;
}

/* The bell sits just left of the search icon, outside the header grid, so the menu never moves. */
.tl-cards__bell {
  position: absolute;
  top: 0;
  right: calc(100% + 12px);
  width: 48px;
  height: 48px;
  border-color: rgba(10, 44, 68, 0.32);
  background-color: #fff;
  color: var(--tlc-header);
  cursor: pointer;
  animation: tl-cards-in 0.3s ease-out;
}

.tl-cards__bell:focus-visible {
  outline: 2px solid var(--tlc-blue);
  outline-offset: 2px;
}

.tl-cards__bell[aria-expanded="true"] {
  border-color: var(--tlc-blue);
  background-color: var(--tlc-blue);
  color: #fff;
}

.tl-cards__bell-icon {
  display: block;
  width: 22px;
  height: 22px;
}

.tl-cards__badge {
  position: absolute;
  top: -4px;
  right: -5px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background-color: var(--tlc-red);
  box-shadow: 0 0 0 2px #fff;
  color: #fff;
  font-family: var(--tlc-font);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* Desktop: once the bell shows, the centred menu makes room for it, so they never touch. */
@media (min-width: 1024px) {
  .header__inner .menu-container {
    transition: margin-right 0.3s ease-out, opacity 0.35s cubic-bezier(0.3, 0.86, 0.36, 0.95), visibility 0.35s cubic-bezier(0.3, 0.86, 0.36, 0.95);
  }

  .header__inner:has(> .search > .tl-cards:not([hidden])) .menu-container {
    margin-right: 60px;
  }
}

/* The search drop opens over this space, so the bell steps aside while it's open. */
.search--active .tl-cards__bell {
  visibility: hidden;
  opacity: 0;
}

/* Panel: a dropdown under the bell on tablets and desktops. */
.tl-cards__panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 24px);
  right: 0;
  display: flex;
  flex-direction: column;
  width: 400px;
  max-height: min(640px, calc(100vh - 120px));
  border-radius: 20px;
  background-color: #fff;
  box-shadow: 0 18px 48px rgba(10, 44, 68, 0.22), 0 0 0 1px rgba(14, 26, 47, 0.06);
  color: var(--tlc-text);
  font-family: var(--tlc-font);
  font-size: 16px;
  line-height: 1.4;
  text-align: left;
  animation: tl-cards-drop 0.2s ease-out;
}

.tl-cards__panel:focus {
  outline: none;
}

.tl-cards__head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 14px 12px 10px 20px;
}

.tl-cards__title {
  flex: 1;
  margin: 0;
  color: var(--tlc-navy);
  font-family: var(--tlc-font);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.tl-cards__readall {
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--tlc-blue);
  font-family: var(--tlc-font);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.tl-cards__readall:hover {
  background-color: var(--tlc-light);
}

.tl-cards__close {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--tlc-navy);
  cursor: pointer;
}

.tl-cards__close:hover {
  background-color: var(--tlc-light);
}

.tl-cards__readall:focus-visible,
.tl-cards__close:focus-visible,
.tl-cards__chip:focus-visible,
.tl-cards__retry:focus-visible {
  outline: 2px solid var(--tlc-blue);
  outline-offset: 2px;
}

.tl-card__del:focus-visible,
.tl-card__main:focus-visible {
  outline: 2px solid var(--tlc-blue);
  outline-offset: -2px;
}

/* Category chips */
.tl-cards__filters {
  display: flex;
  flex: none;
  gap: 8px;
  padding: 0 20px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tl-cards__filters::-webkit-scrollbar {
  display: none;
}

.tl-cards__chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 34px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--tlc-line);
  border-radius: 100px;
  background-color: #fff;
  color: var(--tlc-navy);
  font-family: var(--tlc-font);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.tl-cards__chip span {
  color: var(--tlc-muted);
  font-weight: 400;
}

.tl-cards__chip:hover {
  background-color: var(--tlc-light);
}

.tl-cards__chip[aria-pressed="true"] {
  border-color: var(--tlc-navy);
  background-color: var(--tlc-navy);
  color: #fff;
}

.tl-cards__chip[aria-pressed="true"] span {
  color: rgba(255, 255, 255, 0.75);
}

.tl-cards__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 12px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.tl-cards__group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 8px 8px;
  color: var(--tlc-muted);
  font-family: var(--tlc-font);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.tl-cards__group svg {
  width: 14px;
  height: 14px;
}

.tl-cards__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* One card. The delete layer sits behind it for the phone swipe. */
.tl-card {
  position: relative;
  margin: 0 0 8px;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  transition: height 0.25s ease-out, margin 0.25s ease-out, opacity 0.25s ease-out;
}

.tl-card::before,
.tl-card::after {
  content: none;
}

.tl-card.is-gone {
  opacity: 0;
  margin-bottom: 0;
}

.tl-card__swipe {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding-right: 22px;
  border-radius: 16px;
  background-color: var(--tlc-red);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  visibility: hidden;
}

.tl-card.is-dragging .tl-card__swipe,
.tl-card.is-gone .tl-card__swipe {
  visibility: visible;
}

.tl-card__swipe svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}

.tl-card.is-armed .tl-card__swipe svg {
  transform: scale(1.25);
}

.tl-card__inner {
  position: relative;
  border-radius: 16px;
  background-color: #fff;
  box-shadow: inset 0 0 0 1px var(--tlc-line);
  transition: transform 0.25s ease-out, background-color 0.15s;
  touch-action: pan-y;
}

.tl-card.is-dragging .tl-card__inner {
  transition: none;
}

.tl-card__inner:hover {
  background-color: #f7f9fc;
}

.tl-card__main {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 44px 14px 14px;
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
}

.tl-card__main:hover,
.tl-card__main:focus {
  color: inherit;
  text-decoration: none;
}

div.tl-card__main {
  cursor: default;
}

.tl-card__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 12px;
  background-color: var(--tlc-tint);
  color: var(--tlc-blue);
}

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

.tl-card__thumb svg {
  width: 24px;
  height: 24px;
}

.tl-card__text {
  display: block;
  min-width: 0;
}

.tl-card__title {
  display: block;
  margin: 0;
  color: var(--tlc-navy);
  font-family: var(--tlc-font);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.tl-card.is-read .tl-card__title {
  font-weight: 600;
}

.tl-card__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 7px 2px 0;
  border-radius: 50%;
  background-color: var(--tlc-blue);
  vertical-align: middle;
}

.tl-card__body {
  display: -webkit-box;
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--tlc-text);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-line;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.tl-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  margin-top: 6px;
  color: var(--tlc-muted);
  font-size: 12px;
  line-height: 1.4;
}

.tl-card__meta .tl-card__ends {
  color: var(--tlc-navy);
  font-weight: 700;
}

.tl-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--tlc-blue);
  font-size: 14px;
  font-weight: 700;
}

.tl-card__cta svg {
  width: 14px;
  height: 14px;
  transition: transform 0.15s;
}

.tl-card__main:hover .tl-card__cta svg {
  transform: translateX(2px);
}

.tl-card__del {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--tlc-muted);
  cursor: pointer;
}

.tl-card__del:hover {
  background-color: var(--tlc-light);
  color: var(--tlc-navy);
}

.tl-card__del svg {
  width: 16px;
  height: 16px;
}

/* Loading, empty and error states */
.tl-cards__skel {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  margin: 0 0 8px;
  padding: 14px;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--tlc-line);
}

.tl-cards__skel i {
  display: block;
  height: 12px;
  margin: 4px 0 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef3f6 0%, #f7f9fb 50%, #eef3f6 100%);
  background-size: 200% 100%;
  animation: tl-cards-shimmer 1.2s linear infinite;
}

.tl-cards__skel i:first-child {
  width: 56px;
  height: 56px;
  margin: 0;
  border-radius: 12px;
}

.tl-cards__state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 20px 28px;
  text-align: center;
}

.tl-cards__state-art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background-color: var(--tlc-tint);
  color: var(--tlc-blue);
}

.tl-cards__state-art svg {
  width: 32px;
  height: 32px;
}

.tl-cards__state h3 {
  margin: 8px 0 0;
  color: var(--tlc-navy);
  font-family: var(--tlc-font);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.tl-cards__state p {
  max-width: 280px;
  margin: 0;
  color: var(--tlc-text);
  font-size: 14px;
  line-height: 1.5;
}

.tl-cards__retry {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin: 8px 0 0;
  padding: 0 18px;
  border: 1.5px solid var(--tlc-line);
  border-radius: 100px;
  background-color: #fff;
  color: var(--tlc-navy);
  font-family: var(--tlc-font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.tl-cards__retry:hover {
  background-color: var(--tlc-light);
}

/* Email sign-up in the empty inbox, the same Typeform as the footer sign-up */
.tl-cards__signup {
  width: 100%;
  max-width: 320px;
  margin: 20px 0 0;
}

.tl-cards__signup-title {
  margin: 0 0 10px;
  color: var(--tlc-navy);
  font-family: var(--tlc-font);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.tl-cards__signup-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1.5px solid var(--tlc-line);
  border-radius: 100px;
  background-color: #fff;
}

.tl-cards__signup-row:focus-within {
  border-color: var(--tlc-blue);
}

.tl-cards__signup-row input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 0 4px 0 14px;
  border: 0;
  border-radius: 100px;
  background: transparent;
  box-shadow: none;
  color: var(--tlc-navy);
  font-family: var(--tlc-font);
  font-size: 16px;
  line-height: 1.2;
  outline: none;
}

.tl-cards__signup-row input::placeholder {
  color: var(--tlc-muted);
  opacity: 1;
}

.tl-cards__signup-btn {
  flex: 0 0 auto;
  min-height: 40px;
  margin: 0;
  padding: 0 18px;
  border: 0;
  border-radius: 100px;
  background-color: var(--tlc-blue);
  color: #fff;
  font-family: var(--tlc-font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.tl-cards__signup-btn:hover {
  background-color: var(--tlc-header);
}

.tl-cards__signup-btn:focus-visible {
  outline: 2px solid var(--tlc-navy);
  outline-offset: 2px;
}

.tl-cards__state .tl-cards__signup-legal p {
  max-width: none;
  margin: 8px 0 0;
  color: var(--tlc-muted);
  font-size: 12px;
  line-height: 1.5;
}

.tl-cards__signup-legal a {
  color: inherit;
  text-decoration: underline;
}

.tl-cards__state .tl-cards__signup-done {
  margin: 16px 0 0;
  color: var(--tlc-navy);
  font-weight: 700;
}

.tl-cards__signup-done:focus {
  outline: none;
}

.tl-cards__hint {
  margin: 12px 0 0;
  color: var(--tlc-muted);
  font-size: 12px;
  text-align: center;
}

html.tl-cards-lock,
html.tl-cards-lock body {
  overflow: hidden;
}

/* Tablets: the header controls are 32px. */
@media (max-width: 1023px) {
  .tl-cards__bell {
    right: calc(100% + 8px);
    width: 32px;
    height: 32px;
  }

  .tl-cards__bell-icon {
    width: 18px;
    height: 18px;
  }

  .tl-cards__badge {
    top: -6px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .tl-cards__panel {
    top: calc(100% + 20px);
  }
}

/* Phones: the inbox opens as a sheet from the bottom of the screen. */
@media (max-width: 767px) {
  html.tl-cards-open .header {
    z-index: 10000;
  }

  .tl-cards__scrim {
    position: fixed;
    z-index: 1;
    inset: 0;
    background-color: rgba(10, 44, 68, 0.55);
    animation: tl-cards-fade 0.2s ease-out;
  }

  .tl-cards__panel {
    position: fixed;
    z-index: 2;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    max-height: calc(100% - 56px);
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 20px 20px 0 0;
    box-shadow: none;
    animation: tl-cards-sheet 0.25s ease-out;
  }

  .tl-cards__head {
    padding: 12px 12px 10px 16px;
    border-bottom: 1px solid var(--tlc-line);
  }

  .tl-cards__head::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    width: 36px;
    height: 4px;
    margin-left: -18px;
    border-radius: 2px;
    background-color: rgba(14, 26, 47, 0.18);
  }

  .tl-cards__filters {
    padding: 12px 16px 4px;
  }

  .tl-cards__body {
    padding: 4px 16px 20px;
  }
}

@media (min-width: 768px) {
  .tl-cards__scrim {
    display: none !important;
  }

  .tl-cards__hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tl-cards__bell,
  .tl-cards__panel,
  .tl-cards__scrim,
  .tl-card,
  .tl-card__inner {
    animation: none;
    transition: none;
  }
}

@keyframes tl-cards-in {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes tl-cards-drop {
  from { transform: translateY(-6px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes tl-cards-sheet {
  from { transform: translateY(32px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes tl-cards-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tl-cards-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
