/* ==========================================================================
   Pollab design kit - pulse.css
   Pulse news-shorts deck: full-viewport stage, cards, deck controls,
   fixed topbar with 3-dot dropdown + language flyout.
   Requires base.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Pulse (news shorts deck)
   -------------------------------------------------------------------------- */

/* Sticky-footer layout for the pulse page: on tall phones the capped
   deck height left empty space under the footer. The body becomes a
   full-height column, main absorbs the leftover space, and the footer
   pins to the viewport bottom. */
.page-pulse {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.page-pulse main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.page-pulse main .pulse-stage {
  flex: 1;
  min-height: 0;
}

.pulse-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 12px;
}

/* Pulse floating chrome (replaces the top navbar): brand top-left on
   desktop, 3-dot dropdown menu top-right. It rides the same .container as
   the site navbar and a 64px row height, so the logo lands in the exact
   same spot as every other page - no jump when navigating to/from Pulse. */
.pulse-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 45;
  pointer-events: none;
}

.pulse-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.pulse-topbar-inner .pulse-brand,
.pulse-topbar-inner .pulse-menu {
  pointer-events: auto;
}

.pulse-brand {
  display: none;
}

.pulse-brand .nav-logo-img {
  height: 32px;
  width: auto;
  display: block;
}

@media (min-width: 768px) {
  .pulse-brand {
    display: block;
  }
}

.pulse-menu {
  position: relative;
  margin-left: auto;
}

/* Transparent 3-dot trigger: no button chrome, softly faded dots. */
.pulse-menu-btn,
.pulse-menu-btn:hover {
  background-color: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--ink);
}

.pulse-menu-btn .icon {
  opacity: 0.8;
  /* Glow so the dots stay legible over any card background: a white halo in
     light mode, a dark halo in dark mode. */
  filter:
    drop-shadow(0 0 2px rgba(255, 255, 255, 0.9))
    drop-shadow(0 0 5px rgba(255, 255, 255, 0.6));
  transition: opacity var(--fast) var(--ease);
}

[data-theme="dark"] .pulse-menu-btn .icon {
  filter:
    drop-shadow(0 0 2px rgba(0, 0, 0, 0.9))
    drop-shadow(0 0 5px rgba(0, 0, 0, 0.6));
}

.pulse-menu-btn:hover .icon,
.pulse-menu.open .pulse-menu-btn .icon {
  opacity: 1;
}

.pulse-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 184px;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-1);
  padding: 8px;
  display: grid;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity var(--fast) var(--ease),
    visibility var(--fast) var(--ease),
    transform var(--fast) var(--ease);
}

.pulse-menu.open .pulse-menu-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.pulse-menu-panel a {
  display: block;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-2);
}

.pulse-menu-panel a:hover {
  background-color: var(--surface-alt);
  color: var(--ink);
}

/* Language sub-menu inside the dropdown. Sits in the bottom group above the
   theme toggle, after a separator. */
.pm-lang {
  position: relative;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--line-soft);
}

.pulse-menu-panel .pm-lang-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.pulse-menu-panel .pm-lang-toggle:hover,
.pm-lang.open .pm-lang-toggle {
  background-color: var(--surface-alt);
  color: var(--ink);
}

.pm-chev {
  width: 15px;
  height: 15px;
  transition: transform var(--fast) var(--ease);
}

.pm-lang.open .pm-chev {
  transform: rotate(180deg);
}

/* Nested sub-dropdown: a separate floating panel flying out to the left of
   the main menu (falls back to below it on narrow phones). */
.pm-lang-list {
  position: absolute;
  top: -8px;
  right: calc(100% + 10px);
  min-width: 156px;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-1);
  padding: 6px;
  display: grid;
  gap: 2px;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  transform: translateX(6px);
  transition:
    opacity var(--fast) var(--ease),
    visibility var(--fast) var(--ease),
    transform var(--fast) var(--ease);
}

.pm-lang.open .pm-lang-list {
  opacity: 1;
  visibility: visible;
  transform: none;
}

@media (max-width: 480px) {
  .pm-lang-list {
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    transform: translateY(-6px);
  }

  .pm-lang.open .pm-lang-list {
    transform: none;
  }
}

.pulse-menu-panel .pm-lang-opt {
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.pulse-menu-panel .pm-lang-opt:hover {
  background-color: var(--surface-alt);
  color: var(--ink);
}

.pulse-menu-panel .pm-lang-opt.is-active {
  color: var(--gold-text);
  font-weight: 600;
}

/* Theme toggle rendered as the last menu item. */
.pulse-menu-panel .pm-theme {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 0;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-2);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.pulse-menu-panel .pm-theme:hover {
  background-color: var(--surface-alt);
  color: var(--ink);
}

.pulse-menu-panel .pm-theme .icon {
  width: 17px;
  height: 17px;
  flex: none;
}

[data-theme="light"] .pm-theme .pm-theme-light {
  display: none;
}

[data-theme="dark"] .pm-theme .pm-theme-dark {
  display: none;
}

.pulse-deck {
  width: min(430px, 100%);
  height: 100%;
}

.pulse-swiper {
  height: 100%;
  border-radius: 18px;
}

.pulse-swiper .swiper-slide {
  height: 100%;
  display: flex;
}

.pulse-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background-color: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.pcard-img {
  width: 100%;
  height: 42%;
  object-fit: cover;
  flex: none;
}

/* Text-only card variant: solid navy accent header */
.pcard-accent {
  flex: none;
  height: 24%;
  background-color: var(--navy);
  color: var(--band-gold);
  display: flex;
  align-items: flex-end;
  padding: 18px 24px;
  font-family: "Lora", ui-serif, Georgia, serif;
  font-size: 1.5rem;
}

.pcard-body {
  flex: 1;
  min-height: 0;
  padding: 20px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.pcard-body::-webkit-scrollbar {
  width: 6px;
}

.pcard-body::-webkit-scrollbar-thumb {
  background-color: var(--line);
  border-radius: 999px;
}

.pcard-body::-webkit-scrollbar-track {
  background: transparent;
}

.pcard-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--ink-3);
}

.pcard-body h2 {
  font-size: 1.3rem;
  line-height: 1.35;
  margin: 0;
}

.pcard-body p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0;
}

.pcard-foot {
  flex: none;
  border-top: 1px solid var(--line-soft);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-3);
  font-size: 0.9rem;
}

.pcard-like {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pcard-like .icon {
  width: 17px;
  height: 17px;
  color: var(--gold-text);
}

.pcard-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.pcard-share:hover {
  border-color: var(--gold);
  color: var(--gold-text);
}

.pcard-share .icon {
  width: 15px;
  height: 15px;
}

.share-note {
  font-size: 0.78rem;
  color: var(--gold-text);
}

@media (max-width: 767px) {
  .pulse-stage {
    padding: 10px;
  }
}

/* --------------------------------------------------------------------------
   2. Pulse share + toolbar extras (F38)
   Pulse-specific placement for the shared primitives in base.css.
   -------------------------------------------------------------------------- */

/* The pulse pill is a button now (v4 styled it as an anchor) */
button.pcard-share {
  background: none;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

/* Pulse cards sit near the viewport bottom: open upward there */
.pcard-foot .share-menu {
  top: auto;
  bottom: calc(100% + 8px);
}

/* Deck toolbar variant (above the pulse deck) */
.pulse-toolbar {
  margin: 0 0 14px;
  justify-content: center;
}

