/* ==========================================================================
   Perspectives page - the article feed: filter bar + a fixed-height scrolling list of article cards, to the right of
   the illustration. The panel keeps the same height however many posts exist (100+ never lengthen the page); it scrolls
   inside, and js/perspectives-feed.js renders the cards in batches as you reach the end.
   The cards are the published posts of the blog (partials/articles.php).
   Loaded only by perspectives.php; scoped to body.thinking-page.
   ========================================================================== */
.psp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- filter bar */
.psp-filters {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 16px 18px 10px;
  flex: 0 0 auto;
  border: 1px solid #d9d9d9;
  background: #fff;
  box-sizing: border-box;
}

.psp-filters[hidden] {
  display: none;
}

.psp-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

.psp-filter-row + .psp-filter-row {
  margin-top: 16px;
}

.psp-search {
  position: relative;
  flex: 1 1 280px;
  min-width: 220px;
  display: block;
}

.psp-search svg {
  position: absolute;
  left: 14px;
  bottom: 13px;
  color: #6f6f6f;
  pointer-events: none;
}

.psp-search input,
.psp-select select {
  width: 100%;
  height: 46px;
  box-sizing: border-box;
  border: 1px solid #d9d9d9;
  border-radius: 0;
  background: #fff;
  font-family: "Urbanist", sans-serif;
  font-size: 15px;
  color: #121218;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.psp-search input {
  padding: 0 14px 0 42px;
}

.psp-select {
  flex: 0 1 170px;
  min-width: 140px;
  display: block;
}

.psp-select > span {
  display: block;
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6f6f6f;
}

.psp-select select {
  padding: 0 34px 0 14px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23121218' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='m1 1 5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.psp-search input:hover,
.psp-select select:hover {
  border-color: #a3a3a3;
}

.psp-search input:focus,
.psp-select select:focus {
  border-color: #ed1c24;
  box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.12);
}

/* topic chips */
.psp-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid #d9d9d9;
  background: #fff;
  font-family: "Urbanist", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #121218;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.psp-chip em {
  font-style: normal;
  font-size: 11px;
  color: #6f6f6f;
  transition: color 0.25s ease;
}

.psp-chip:hover {
  border-color: #121218;
}

.psp-chip.is-on {
  background: #111315;
  border-color: #111315;
  color: #fff;
}

.psp-chip.is-on em {
  color: #ffb0b4;
}

.psp-chip:focus-visible,
.psp-reset:focus-visible {
  outline: 2px solid #ed1c24;
  outline-offset: 2px;
}

.psp-filter-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #ececec;
}

.psp-filter-meta p {
  margin: 0;
  font-size: 14px;
  color: #5e5e5e;
}

.psp-reset {
  padding: 0;
  border: 0;
  background: none;
  font-family: "Urbanist", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #e01a22;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.psp-reset[hidden] {
  display: none;
}

/* ---------------------------------------------------------------- feed panel (right of the illustration) */
.psp-feed {
  --psp-h: min(78vh, 800px);                            /* = the illustration column */
  width: 50%;
  height: var(--psp-h);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  min-width: 0;
}

@media (min-width: 1201px) {
  body.thinking-page .psp-feed {
    position: sticky;
    top: 96px;
  }
}

/* the list + its "reading thread": a thin red line on the left of the list that fills as you read, with a dot and a
   "07 / 57" marker that travel down it - the same red line as on the spiral, which follows the list too */
.psp-scroll-wrap {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 14px;
}

.psp-thread {
  position: relative;
  flex: 0 0 2px;
  margin: 18px 6px 30px 0;
  background: #e6e6e6;
}

.psp-thread-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: var(--psp-p, 0%);
  background: #ed1c24;
}

.psp-thread-dot {
  position: absolute;
  left: 50%;
  top: var(--psp-p, 0%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ed1c24;
  box-shadow: 0 0 0 5px rgba(237, 28, 36, 0.14);
  transform: translate(-50%, -50%);
}

.psp-thread-label {
  position: absolute;
  right: 12px;
  top: var(--psp-p, 0%);
  transform: translateY(-50%);
  padding: 2px 6px;
  border: 1px solid #e6e6e6;
  background: #fff;
  font-family: "Urbanist", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: #121218;
  white-space: nowrap;
}

.psp-thread-label:empty,
.psp-thread.is-idle {
  display: none;
}

.psp-scroll {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
  padding: 14px 16px 18px 14px;                           /* room for the corner ticks that sit outside the cards */
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;                                    /* the thread replaces the scrollbar */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 26px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 26px), transparent 100%);
}

.psp-scroll::-webkit-scrollbar {
  display: none;
}

/* cards rise into the list as they reach it */
.psp-grid.is-animated .psp-card {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.psp-grid.is-animated .psp-card.is-in {
  opacity: 1;
  transform: none;
}

/* the row being read is in focus: the other rows step back a little, its frames close in like on hover */
.psp-grid.has-focus .psp-card.is-in:not(.is-focus):not(:hover) {
  opacity: 0.55;
}

.psp-card.is-focus .psp-card-link {
  border-color: #cfcfcf;
}

.psp-card.is-focus .psp-card-media img {
  transform: scale(1);
}

.psp-card.is-focus .card-edge-tick.edge-tl { top: -1px !important; left: -1px !important; }
.psp-card.is-focus .card-edge-tick.edge-tr { top: -1px !important; right: -1px !important; }
.psp-card.is-focus .card-edge-tick.edge-bl { bottom: -1px !important; left: -1px !important; }
.psp-card.is-focus .card-edge-tick.edge-br { bottom: -1px !important; right: -1px !important; }

.psp-scroll:focus-visible {
  outline: 2px solid #ed1c24;
  outline-offset: 2px;
}

.psp-sentinel {
  height: 1px;
}

/* ---------------------------------------------------------------- article cards: the blog-card design */
/* two columns; when the last row holds a single card it is centred (js/perspectives-feed.js adds .psp-center) */
.psp-grid {
  --psp-gap: 36px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px var(--psp-gap);
  align-items: stretch;
  width: 100%;
}

.psp-card.psp-center {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc((100% - var(--psp-gap)) / 2);
}

.psp-card {
  display: flex;
  margin: 0;
}

.psp-card[hidden] {
  display: none;
}

/* framed card: thin frame with corner ticks, the picture sits 4px inside it */
.psp-card-link {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 4px 4px 0;
  border: 1px solid #e6e6e6;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-sizing: border-box;
}

.psp-card-media {
  overflow: hidden;
  aspect-ratio: 583 / 415;
  background: #f0f0f0;
}

/* inside the feed panel: a slightly shorter picture and a tighter text block, so more of each row fits */
.psp-feed .psp-card-media {
  aspect-ratio: 16 / 10;
}

.psp-feed .psp-card-body {
  padding: 16px 16px 14px;
}

.psp-feed .psp-title {
  margin: 12px 0 6px;
  font-size: 19px;
}

.psp-feed .psp-excerpt {
  -webkit-line-clamp: 3;
  margin-bottom: 12px;
}

/* the picture's frame never changes size and is always full; the picture is a little enlarged at rest and settles on hover */
.psp-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.12);
  transform-origin: 50% 50%;
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.psp-card-link:hover .psp-card-media img,
.psp-card-link:focus-visible .psp-card-media img {
  transform: scale(1);
}

.psp-card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 20px 16px 18px;
}

/* label chips: "STRATEGY - OPERATING MODEL - 12 October 2026" in one outlined, tinted pill */
.psp-chips {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  padding: 1px 8px;
  border: 1px solid rgba(26, 26, 26, 0.16);
  background: rgba(26, 26, 26, 0.06);
  font-family: "Urbanist", sans-serif;
  font-size: 14px;
  line-height: 22px;
  letter-spacing: -0.03em;
  color: #1a1a1a;
}

.psp-chip-dot {
  font-size: 9px;
  opacity: 0.7;
}

.psp-title {
  margin: 16px 0 8px;
  font-family: "Urbanist", sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: #0a281f;
  transition: color 0.25s ease;
}

.psp-card-link:hover .psp-title {
  color: #ed1c24;
}

.psp-excerpt {
  margin: 0 0 16px;
  font-family: "Urbanist", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #666;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.psp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #ececec;
  font-family: "Urbanist", sans-serif;
}

.psp-read {
  font-size: 13px;
  color: #5e5e5e;
}

.psp-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #121218;
  background: linear-gradient(#ed1c24, #ed1c24) left bottom / 0 1.5px no-repeat;
  transition: background-size 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.psp-card-link:hover .psp-more {
  background-size: 100% 1.5px;
}

.psp-more svg {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.psp-card-link:hover .psp-more svg {
  transform: translateX(5px);
}

.psp-empty {
  margin: 8px 0 0;
  padding: 28px 24px;
  border: 1px dashed #cfcfcf;
  font-size: 17px;
  color: #5e5e5e;
}

.psp-empty[hidden] {
  display: none;
}

/* corner ticks: grey, 8px outside the card at rest, closing in onto its border on hover */
.psp-card-link .card-edge-tick,
.psp-filters > .card-edge-tick {
  border-color: rgb(163, 163, 163) !important;
}

.psp-card-link .card-edge-tick {
  transition: top 0.55s cubic-bezier(0.22, 1, 0.36, 1), right 0.55s cubic-bezier(0.22, 1, 0.36, 1), bottom 0.55s cubic-bezier(0.22, 1, 0.36, 1), left 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.psp-card-link .card-edge-tick.edge-tl { top: -9px !important; left: -9px !important; }
.psp-card-link .card-edge-tick.edge-tr { top: -9px !important; right: -9px !important; }
.psp-card-link .card-edge-tick.edge-bl { bottom: -9px !important; left: -9px !important; }
.psp-card-link .card-edge-tick.edge-br { bottom: -9px !important; right: -9px !important; }

.psp-card-link:hover .card-edge-tick.edge-tl,
.psp-card-link:focus-visible .card-edge-tick.edge-tl { top: -1px !important; left: -1px !important; }
.psp-card-link:hover .card-edge-tick.edge-tr,
.psp-card-link:focus-visible .card-edge-tick.edge-tr { top: -1px !important; right: -1px !important; }
.psp-card-link:hover .card-edge-tick.edge-bl,
.psp-card-link:focus-visible .card-edge-tick.edge-bl { bottom: -1px !important; left: -1px !important; }
.psp-card-link:hover .card-edge-tick.edge-br,
.psp-card-link:focus-visible .card-edge-tick.edge-br { bottom: -1px !important; right: -1px !important; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1200px) {
  .psp-thread-label {
    display: none;
  }

  .psp-feed {
    --psp-h: min(80vh, 760px);
    width: 100%;
  }
}

@media (max-width: 720px) {
  .psp-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .psp-card.psp-center {
    grid-column: auto;
    width: auto;
    justify-self: stretch;
  }

  .psp-filters {
    padding: 16px 14px 12px;
  }

  .psp-select {
    flex: 1 1 calc(50% - 7px);
  }

  .psp-card-body {
    padding: 16px 12px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .psp-grid.is-animated .psp-card {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .psp-card-media img {
    transform: none;
    transition: none;
  }

  .psp-more,
  .psp-more svg,
  .psp-card-link .card-edge-tick {
    transition: none;
  }
}

/* ---------------------------------------------------------------- compact filter bar inside the feed panel */
.psp-intro .psp-filters {
  padding: 14px 16px 8px;
}

.psp-intro .psp-filter-row {
  gap: 10px;
}

.psp-intro .psp-search {
  flex: 3 1 220px;
  min-width: 0;
}

.psp-intro .psp-select {
  flex: 1 1 130px;
  min-width: 0;
}

.psp-intro .psp-search input,
.psp-intro .psp-select select {
  height: 40px;
  font-size: 14px;
}

.psp-intro .psp-search svg {
  bottom: 11px;
}

.psp-intro .psp-select > span {
  margin-bottom: 4px;
  font-size: 10px;
}

.psp-intro .psp-filter-meta {
  margin-top: 10px;
  padding-top: 8px;
}

.psp-intro .psp-filter-meta p {
  font-size: 13px;
}

/* ---------------------------------------------------------------- wide screens: use the whole frame
   The illustration sits at the left edge of the frame; the filter bar and the two-column list fill the rest. */
@media (min-width: 1201px) {
  body.thinking-page .thinking-hero-inner,
  body.thinking-page .thinking-topics-container.psp-split {
    max-width: none;
  }

  body.thinking-page .psp-split {
    gap: 56px;
  }

  body.thinking-page .psp-split .thinking-topics-header-col {
    flex: 0 0 auto;
    max-width: none;
  }

  body.thinking-page .psp-feed {
    flex: 1 1 0;
    width: auto;
  }
}

/* ---------------------------------------------------------------- heading + filter bar above both columns */
.psp-intro .psp-filters {
  margin-top: 22px;
}

.psp-intro .psp-search {
  flex: 4 1 280px;
}

.psp-intro .psp-select {
  flex: 1 1 170px;
}

/* ---------------------------------------------------------------- pages */
.psp-pager {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 12px;
  padding: 12px 0 0;
  border-top: 1px solid #ececec;
  font-family: "Urbanist", sans-serif;
  font-size: 14px;
  color: #3a3a3a;
}

.psp-pager[hidden] {
  display: none;
}

.psp-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.psp-page,
.psp-page-step {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d9d9d9;
  background: #fff;
  font: inherit;
  font-weight: 600;
  color: #121218;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.psp-page:hover,
.psp-page-step:hover:not(:disabled) {
  border-color: #121218;
}

.psp-page[aria-current="page"] {
  background: #111315;
  border-color: #111315;
  color: #fff;
}

.psp-page-step:disabled {
  opacity: 0.4;
  cursor: default;
}

.psp-page-gap {
  padding: 0 4px;
  color: #8a8a8a;
}

.psp-pager-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.psp-pager-tools label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #5e5e5e;
}

.psp-pager-tools select,
.psp-pager-tools input {
  height: 36px;
  box-sizing: border-box;
  border: 1px solid #d9d9d9;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: #121218;
  padding: 0 10px;
}

.psp-pager-tools input {
  width: 64px;
}

.psp-pager-tools button {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #111315;
  background: #111315;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.psp-page:focus-visible,
.psp-page-step:focus-visible,
.psp-pager-tools select:focus-visible,
.psp-pager-tools input:focus-visible,
.psp-pager-tools button:focus-visible {
  outline: 2px solid #ed1c24;
  outline-offset: 2px;
}

/* the filter bar sits right above the two columns */
body.thinking-page .thinking-hero-inner {
  gap: 28px;
}

body.thinking-page .thinking-topics-container.psp-split {
  margin-top: 0;
}

.psp-page-now {
  padding: 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #3a3a3a;
  white-space: nowrap;
}
