/* ==========================================================================
   openbq.io — News page
   Load after styles.css. Uses the brand tokens defined there.
   ========================================================================== */

/* ---------- Page intro (centred, pill tag) ---------- */
.news-intro { text-align: center; max-width: 720px; margin: 0 auto clamp(40px, 6vw, 64px); }
.news-intro h1 { font-size: clamp(2.4rem, 5vw, 3.75rem); color: var(--ink); margin-bottom: 14px; }
.news-intro .lead { margin: 0 auto; max-width: 52ch; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-accent); font-weight: 600; font-size: .78rem; letter-spacing: .04em;
  padding: 5px 12px; border-radius: 999px;
  background: var(--blue-10); color: var(--dark-blue); border: 1px solid var(--blue-35);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.pill--light { background: rgba(255,255,255,.9); border-color: rgba(255,255,255,.9); }
.pill--dark { background: var(--dark-blue); color: #fff; border-color: var(--dark-blue); }
.pill--dark::before { background: var(--blue-35); }

/* ---------- Thumbnails (brand tiles, no stock photos) ---------- */
.thumb {
  position: relative; overflow: hidden; isolation: isolate; border-radius: 14px;
  aspect-ratio: 16 / 10; display: grid; place-items: center;
  background: var(--gradient-diag);
}
.thumb::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("../img/brand/fingerprint-pattern.webp") center / cover no-repeat;
  mix-blend-mode: soft-light; opacity: .9;
}
.thumb img { width: 34%; max-width: 110px; height: auto; filter: drop-shadow(0 8px 18px rgba(8,16,48,.25)); }
.thumb .pill { position: absolute; top: 12px; left: 12px; }
.thumb--release { background: var(--black); }
.thumb--release::before { opacity: .35; }
.thumb--industry { background: linear-gradient(140deg, var(--blue-35), var(--blue-10)); }
.thumb--industry::before { mix-blend-mode: multiply; opacity: .18; }
.thumb--bqat { background: linear-gradient(140deg, var(--dark-blue) 0%, #16285c 100%); }
.thumb-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95rem;
  color: var(--blue-35); background: rgba(255,255,255,.08); padding: 10px 16px; border-radius: 10px;
}
.thumb-code b { color: #fff; font-weight: 500; }

/* ---------- Featured story + latest list ---------- */
.news-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: stretch; }

.feature {
  position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 460px; border-radius: 24px; padding: clamp(22px, 3vw, 34px);
  color: #fff; text-decoration: none; background: var(--gradient-diag); box-shadow: var(--shadow);
}
.feature::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: url("../img/brand/fingerprint-pattern.webp") center / cover no-repeat;
  mix-blend-mode: soft-light; opacity: .9;
}
.feature::after { /* readability fade */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(10,20,60,0) 35%, rgba(10,20,60,.7) 100%);
}
.feature__mark { position: absolute; top: 28px; right: 28px; width: 120px; height: 120px; opacity: .95; }
.feature__mark img { width: 100%; height: 100%; }
.feature h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin: 14px 0 10px; max-width: 22ch; }
.feature p { max-width: 56ch; color: var(--blue-10); margin-bottom: 12px; }
.feature:hover { color: #fff; }
.feature:hover h2 { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }

.news-meta { font-family: var(--font-accent); font-size: .85rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.news-meta span + span::before { content: "•"; margin-right: 8px; }
.feature .news-meta { color: var(--blue-10); }

.latest h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin-bottom: 18px; }
.latest ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.latest a {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center;
  text-decoration: none; color: var(--ink); padding: 8px; margin: -8px; border-radius: 16px;
  transition: background .2s ease;
}
.latest a:hover { background: var(--blue-10); color: var(--ink); }
.latest .thumb { aspect-ratio: 1; border-radius: 12px; }
.latest .thumb img { width: 52%; }
.latest h3 { font-size: 1.05rem; line-height: 1.3; margin: 0 0 4px; }

/* ---------- Interactive insight embed ---------- */
.insight-embed { --corner-offset: 16px; }
.insight-embed iframe {
  display: block; width: 100%; height: 1000px; /* fallback; script sizes it to content */
  border: 0; border-radius: 20px; background: #0d1b2a; box-shadow: var(--shadow);
}
@media (max-width: 880px) { .insight-embed iframe { height: 1700px; } }

/* ---------- Filters ---------- */
.news-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.news-toolbar h2 { margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  font-family: var(--font-accent); font-weight: 600; font-size: .92rem; cursor: pointer;
  min-height: 42px; padding: 8px 18px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; color: var(--dark-blue);
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.filter:hover { border-color: var(--blue); }
.filter[aria-pressed="true"] { background: var(--dark-blue); border-color: var(--dark-blue); color: #fff; }

/* ---------- Card grid ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 26px); }
.news-card {
  display: flex; flex-direction: column; gap: 14px; padding: 12px 12px 22px;
  border-radius: 22px; background: var(--blue-10); border: 1px solid transparent;
  text-decoration: none; color: var(--ink);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.news-card[hidden] { display: none; }
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--blue-35); color: var(--ink); }
.news-card h3 { font-size: 1.15rem; line-height: 1.3; margin: 0; padding: 0 8px; }
.news-card p { font-size: .95rem; color: var(--text-muted); margin: 0; padding: 0 8px; }
.news-card .news-meta { padding: 0 8px; margin-top: auto; }
.news-card .source { font-weight: 600; color: var(--dark-blue); }
.news-card--dark { background: var(--ink); }
.news-card--dark, .news-card--dark:hover { color: #fff; }
.news-card--dark p, .news-card--dark .news-meta { color: var(--grey-35); }
.news-card--dark .source { color: var(--blue-35); }

.news-empty { text-align: center; color: var(--text-muted); padding: 32px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .news-top { grid-template-columns: minmax(0, 1fr); }
  .feature { min-height: 380px; }
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .news-grid { grid-template-columns: minmax(0, 1fr); }
  .feature__mark { width: 80px; height: 80px; top: 20px; right: 20px; }
  .latest a { grid-template-columns: 76px minmax(0, 1fr); }
}

/* ---------- Data-driven additions ---------- */
.feature-slot { display: flex; }
.feature-slot > .feature { flex: 1; }
.feature--photo::after { background: linear-gradient(180deg, rgba(10,20,60,.05) 25%, rgba(10,20,60,.82) 100%); }
.feature__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.thumb--photo { background: var(--blue-10); }
.thumb--photo::before { display: none; }
.thumb--photo img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; filter: none; z-index: -1; }
.latest .thumb--photo img { width: 100%; }

/* ---------- Article page ---------- */
.article { max-width: 780px; margin: 0 auto; }
.article-head { margin-bottom: clamp(28px, 4vw, 44px); }
.article-head h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); margin: 16px 0 14px; }
.article-head .lead { margin-bottom: 18px; }
.text-link--back { display: flex; width: max-content; }
.text-link--back::after { content: none; }
.text-link--back::before { content: "←"; transition: transform .2s ease; }
.text-link--back:hover::before { transform: translateX(-4px); }
.article-hero { --corner-offset: 14px; margin: 0 0 clamp(28px, 4vw, 44px); }
.article-hero img { width: 100%; border-radius: 20px; }
.prose { font-size: 1.1rem; line-height: 1.75; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); margin: 1.6em 0 .5em; }
.prose h3 { font-size: 1.3rem; margin: 1.4em 0 .4em; }
.prose h4 { font-size: 1.1rem; margin: 1.2em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin-bottom: .35em; }
.prose img { width: 100%; height: auto; border-radius: 16px; margin: 1.2em 0; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--blue); font-family: var(--font-accent); font-size: 1.25rem; color: var(--dark-blue); }
.prose blockquote p { margin: 0; }
.prose code { background: var(--blue-10); padding: 2px 6px; border-radius: 6px; font-size: .92em; }

/* ---------- Blog posts ---------- */
.thumb--blog { background: linear-gradient(140deg, var(--ink) 0%, var(--dark-blue) 100%); }
.thumb--blog::before { opacity: .5; }
.news-card .read-more { padding: 0 8px; font-size: .95rem; color: var(--dark-blue); }
.news-card--dark .read-more { color: var(--blue-35); }

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: clamp(28px, 4vw, 40px); padding-top: 22px; border-top: 1px solid var(--line); }
.pager[hidden] { display: none; }
.pager__pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pager__num, .pager__arrow {
  display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 999px;
  font-family: var(--font-accent); font-weight: 600; font-size: .95rem; cursor: pointer;
  border: 1.5px solid transparent; background: transparent; color: var(--ink);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.pager__arrow { border-color: var(--line); color: var(--dark-blue); }
.pager__arrow svg { width: 18px; height: 18px; }
.pager__num:hover, .pager__arrow:hover:not(:disabled) { border-color: var(--blue); color: var(--dark-blue); }
.pager__num[aria-current="page"] { background: var(--dark-blue); border-color: var(--dark-blue); color: #fff; }
.pager__arrow:disabled { opacity: .35; cursor: default; }


/* ---------- Merged latest news: featured story + scrolling list ---------- */
.news-top--merged { align-items: stretch; }

/* The list takes no height of its own (contain: size) and stretches to the
   height of the featured card, so its <ul> has to scroll. */
.news-top--merged > .latest--scroll {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 24px;
  padding: 22px 14px 0 22px;
}

.latest--scroll .latest__head { flex: none; margin-bottom: 14px; padding-right: 8px; }
.latest--scroll .latest__head h2 { margin-bottom: 12px; }
.latest--scroll .filters { gap: 6px; }
.latest--scroll .filter { font-size: .82rem; padding: 6px 12px; min-height: 34px; }

.latest--scroll ul {
  flex: 1 1 auto; min-height: 0;
  height: 380px; max-height: 380px;   /* fixed height: always scrolls */
  overflow-y: scroll; overscroll-behavior: contain;
  margin: 0; padding: 8px 10px 40px 8px;
}
/* Always-visible scrollbar (Chrome, Edge, Safari — incl. macOS overlay scrollbars) */
.latest--scroll ul::-webkit-scrollbar { width: 8px; }
.latest--scroll ul::-webkit-scrollbar-track { background: var(--blue-10); border-radius: 99px; margin: 6px 0 24px; }
.latest--scroll ul::-webkit-scrollbar-thumb { background: var(--blue); border-radius: 99px; }
.latest--scroll ul::-webkit-scrollbar-thumb:hover { background: var(--dark-blue); }
/* Firefox */
@supports not selector(::-webkit-scrollbar) {
  .latest--scroll ul { scrollbar-width: thin; scrollbar-color: var(--blue) var(--blue-10); }
}
.latest--scroll ul:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 12px; }
.latest--scroll li[hidden] { display: none; }

/* "Scroll for more" hint with a fade over the last item */
.latest__more {
  position: relative; flex: none; margin: -40px 0 0 -22px; padding: 30px 0 14px; z-index: 1;
  text-align: center; font-family: var(--font-accent); font-weight: 600; font-size: .85rem; color: var(--dark-blue);
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 55%); pointer-events: none;
  transition: opacity .2s ease;
}
.latest__more::after { content: " ↓"; }
.latest--scroll.is-end .latest__more { opacity: 0; }
.latest--scroll .news-empty { padding: 16px 0; }

/* Stacked layout on smaller screens: the list gets its own scroll height */
@media (max-width: 1020px) {
  .latest--scroll ul { height: 360px; max-height: 360px; }
}

/* ---------- Featured card: chart as background, text overlaid at the bottom ---------- */
.feature--embed { justify-content: flex-end; background: #0d1b2a; }
.feature--embed::before { display: none; }              /* no fingerprint pattern over the chart */
.feature--embed::after {                                /* dark fade so the text stays readable */
  z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(10,20,60,0) 30%, rgba(10,20,60,.75) 65%, rgba(10,20,60,.95) 100%);
}

/* Chart fills the card. Rendered at 2x size and scaled down so more of it fits. */
.feature__preview { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: inherit; transition: transform .4s ease; }
.feature__preview iframe {
  position: absolute; top: 0; left: 0; border: 0;
  width: 200%; height: 200%; transform: scale(.5); transform-origin: 0 0;
  pointer-events: none;                                 /* clicks go to the card link */
}

/* Overlay text sits above the fade */
.feature--embed > .pill, .feature--embed > h2, .feature--embed > p, .feature--embed > .feature__cta { position: relative; z-index: 1; }
.feature--embed h2 { margin: 12px 0 6px; }
.feature--embed p { margin-bottom: 10px; color: var(--blue-10); }

/* Whole card clickable via the heading link */
.feature__link { color: #fff; text-decoration: none; }
.feature__link::after { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: 24px; }
.feature__link:hover { color: #fff; }
.feature--embed:hover .feature__link { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.feature--embed:hover .feature__preview { transform: scale(1.03); }
.feature__link:focus-visible { outline: none; }
.feature__link:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 3px; }
.feature__cta { color: #fff; }

/* ==========================================================================
   v6 layout: LinkedIn carousel (2 cols) + news list (1 col), chart below
   ========================================================================== */
.news-row {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 32px); align-items: stretch;
  --row-h: 640px;
}

/* Social panel */
.social-panel {
  display: flex; flex-direction: column; min-width: 0; height: var(--row-h);
  background: var(--blue-10); border-radius: 24px; padding: 22px 22px 18px;
}
.social-panel__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.social-panel__head h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin: 0; }
.social-panel__actions { display: flex; align-items: center; gap: 8px; }
.social-panel .li-follow { margin-right: 6px; }
.social-panel .pager__arrow { background: #fff; }

.social-track {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 16px) / 2); column-gap: 16px;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.social-track::-webkit-scrollbar { display: none; }
.social-track:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 16px; }
.social-slide { scroll-snap-align: start; min-width: 0; height: 100%; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 6px 20px rgba(8,16,48,.08); }
.social-slide iframe { display: block; width: 100%; height: 100%; border: 0; }

.social-dots { display: flex; justify-content: center; gap: 8px; padding-top: 14px; }
.social-dots[hidden] { display: none; }
.social-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-35); transition: width .2s ease, background .2s ease; }
.social-dots span.is-on { width: 22px; border-radius: 99px; background: var(--dark-blue); }

/* News list in the third column: same height as the carousel, list scrolls */
.news-row > .latest--scroll {
  display: flex; flex-direction: column; overflow: hidden; min-width: 0; height: var(--row-h);
  background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 22px 14px 0 22px;
}
.news-row .latest--scroll ul { flex: 1 1 0; height: auto; max-height: none; min-height: 0; }

/* Thumbnail icons (assets/img/news/*.svg) */
.thumb--icon img { width: 60%; max-width: 120px; filter: none; }
.latest .thumb--icon img { width: 62%; }

/* Responsive */
@media (max-width: 1020px) {
  .news-row { grid-template-columns: minmax(0, 1fr); --row-h: auto; }
  .social-panel { height: 600px; }
  .news-row > .latest--scroll { height: 560px; }
}
@media (max-width: 680px) {
  .social-track { grid-auto-columns: 100%; }
  .social-panel { height: 640px; padding: 18px 14px 14px; }
  .social-panel .li-follow span { display: none; }
}

/* ---------- Digital ID shortfall: compact card with a full-page snapshot ---------- */
#digital-id { padding: clamp(40px, 6vw, 64px) 0; }
.did-card {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: stretch;
  height: clamp(320px, 32vw, 400px); overflow: hidden; border-radius: 24px;
  background: var(--gradient-diag); color: #fff; text-decoration: none; box-shadow: var(--shadow);
}
.did-card:hover { color: #fff; }
.did-card__text { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 10px; padding: clamp(24px, 3.5vw, 44px); }
.did-card__title { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.15; }
.did-card__sub { color: var(--blue-10); max-width: 40ch; }
.did-card__btn { margin-top: 8px; pointer-events: none; }
.did-card__btn svg { width: 18px; height: 18px; }

.did-card__shot { position: relative; display: grid; place-items: center; background: rgba(8,16,48,.35); }
.did-card__page {
  position: relative; overflow: hidden; border-radius: 10px; background: #0d1b2a;
  box-shadow: 0 18px 40px rgba(8,16,48,.45); transition: transform .35s ease;
}
.did-card__page iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; pointer-events: none; }
.did-card__hover {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-accent); font-weight: 600; font-size: 1.05rem;
  background: rgba(10,20,60,.55); opacity: 0; transition: opacity .25s ease;
}
.did-card__hover svg { width: 20px; height: 20px; }
.did-card:hover .did-card__hover, .did-card:focus-visible .did-card__hover { opacity: 1; }
.did-card:hover .did-card__page { transform: scale(1.03); }
.did-card:hover .did-card__title { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.did-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }

@media (max-width: 880px) {
  .did-card { grid-template-columns: minmax(0, 1fr); height: auto; }
  .did-card__shot { height: 300px; order: -1; }
}
