/* Key takeaway + FAQ blocks added to CXO Dossier articles (Authentic theme), plus the styles for
   the features this backend adds (video badges and clips, as-you-type search). Black and white,
   matching the theme. CXO Dossier's Authentic theme is always dark (#232323 page, no light/dark toggle),
   so the dark colours (the `html …` rules) always apply over the light defaults. Nothing here restyles
   the copied theme itself. */

/* Key takeaway: an outlined box in black, with a black "Key takeaway" tag sitting on its top
   border. Dark scheme: a white outline and tag, white text. */
.entry-content > .cxo-aeo-summary {
  position: relative;
  margin: 2.5rem 0 2.25rem;
  padding: 2rem 2rem 1.6rem;
  background: transparent;
  border: 2px solid #111;
  border-radius: 0;
}
html .entry-content > .cxo-aeo-summary { border-color: #fff; }
.cxo-aeo-summary .cxo-aeo-label {
  position: absolute;
  top: 0;
  left: 1.5rem;
  transform: translateY(-50%);
  margin: 0;
  padding: .25rem .6rem;
  background: #111;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1.4;
  text-transform: uppercase;
}
html .cxo-aeo-summary .cxo-aeo-label { background: #fff; color: #111; }
.entry-content > .cxo-aeo-summary .cxo-aeo-text {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: #111;
}
html .entry-content > .cxo-aeo-summary .cxo-aeo-text { color: #fff; }
@media (max-width: 599px) {
  .entry-content > .cxo-aeo-summary { padding: 1.75rem 1.25rem 1.35rem; }
  .cxo-aeo-summary .cxo-aeo-label { left: 1rem; }
}

.entry-content > .cxo-aeo-faq {
  margin: 3rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--tp-line-strong);
}
/* the title keeps the theme's own article h2 style; only spacing is set */
.entry-content > .cxo-aeo-faq .cxo-aeo-faq-title { margin: 0 0 1.25rem; }
.cxo-aeo-faq .cxo-aeo-item {
  margin: 0;
  border-bottom: 1px solid var(--tp-line);
}
.cxo-aeo-faq .cxo-aeo-item:first-of-type {
  border-top: 1px solid var(--tp-line);
}
.cxo-aeo-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  cursor: pointer;
  list-style: none;
}
.cxo-aeo-faq summary::-webkit-details-marker { display: none; }
.cxo-aeo-faq summary:focus-visible {
  outline: 2px solid var(--tp-brand);
  outline-offset: 4px;
  border-radius: 2px;
}
.entry-content > .cxo-aeo-faq .cxo-aeo-q {
  margin: 0;
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
}
.cxo-aeo-faq .cxo-aeo-icon {
  position: relative;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--tp-line-strong);
  transition: background-color .2s, border-color .2s;
}
.cxo-aeo-faq .cxo-aeo-icon::before,
.cxo-aeo-faq .cxo-aeo-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: .75rem;
  height: 1.5px;
  background: var(--tp-brand);
  transform: translate(-50%, -50%);
  transition: transform .2s, background-color .2s;
}
.cxo-aeo-faq .cxo-aeo-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.cxo-aeo-faq details[open] .cxo-aeo-icon {
  background: var(--tp-brand);
  border-color: var(--tp-brand);
}
.cxo-aeo-faq details[open] .cxo-aeo-icon::before,
.cxo-aeo-faq details[open] .cxo-aeo-icon::after { background: var(--tp-brand-contrast); }
.cxo-aeo-faq details[open] .cxo-aeo-icon::after { transform: translate(-50%, -50%) rotate(0deg); }
.cxo-aeo-faq summary:hover .cxo-aeo-icon { border-color: var(--tp-brand); }
.entry-content > .cxo-aeo-faq .cxo-aeo-a p {
  margin: 0 0 1.25rem;
  padding-right: 3rem;
  line-height: 1.65;
  color: var(--tp-muted);
}

@media (max-width: 599px) {
  .entry-content > .cxo-aeo-faq .cxo-aeo-a p { padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cxo-aeo-faq .cxo-aeo-icon,
  .cxo-aeo-faq .cxo-aeo-icon::before,
  .cxo-aeo-faq .cxo-aeo-icon::after { transition: none; }
}

/* links to a section (#heading) land below the sticky menu bar */
.entry-content h2[id], .entry-content h3[id] { scroll-margin-top: 100px; }

/* the theme's muted background clips fade out while they jump back to their start (theme scripts.js) */
.cs-video-wrapper iframe { transition: opacity .25s; }
.cs-video-wrapper.cxo-hold iframe { opacity: 0; }

/* The theme's background clips (article hero, home page and archive cards) play muted on a loop, so
   their sound and pause buttons are hidden; the "Watch" icon stays and opens the video popup. */
.cs-video-controls .cs-player-volume,
.cs-video-controls .cs-player-state { display: none !important; }

/* FAQ accents (+/− buttons, focus ring) in black; white on the dark scheme */
.cxo-aeo-faq { --tp-brand: #000; --tp-brand-contrast: #fff; --tp-line: #eee; --tp-line-strong: #c9c9c9; --tp-muted: #777; }
html .cxo-aeo-faq { --tp-brand: #fff; --tp-brand-contrast: #232323; --tp-line: #2b2b2b; --tp-line-strong: #444; --tp-muted: #ccc; }

/* "Watch" badge on every preview of an article with a video (server.js addVideoBadges): a black
   pill with a white play triangle and WATCH, top right of the image. On the small sidebar
   thumbnails it is the triangle only. The theme's own grey camera square is replaced by it. */
.post-thumbnail .post-format { display: none !important; }
.post-thumbnail, .overlay-media { position: relative; }
.gr-video-badge {
  position: absolute; z-index: 3; top: .75rem; right: .75rem; pointer-events: none;
  display: inline-flex; align-items: center; gap: .4rem; height: 28px; padding: 0 .75rem 0 .6rem;
  background: #0b0b0b; color: #fff; border-radius: 14px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .18);
  font-size: .68rem !important; font-weight: 700; letter-spacing: .12em; line-height: 1; text-transform: uppercase;
}
.gr-video-badge::before { content: ""; width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent #fff; }
.widget .gr-video-badge { top: .35rem; right: .35rem; width: 24px; height: 24px; padding: 0; gap: 0; justify-content: center; border-radius: 50%; }
.widget .gr-video-badge::before { margin-left: 2px; }
.widget .gr-video-badge-text { display: none; }

/* muted preview clips in cards (theme player): the photo is the poster until the clip plays */
.gr-clip { position: relative; overflow: hidden; width: 100%; display: block; }
.gr-clip > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gr-clip iframe, .gr-clip [id^="jarallax-container"] { pointer-events: none; }

/* Muted background clips: the photo stays underneath and the clip fades in only once it is playing
   (site/assets/clip-quiet.js), so YouTube's own play/pause symbol is never seen. */
.parallax-video [id^="jarallax-container"] > img { display: block !important; }
.parallax-video [id^="jarallax-container"] > iframe { opacity: 0; transition: none; z-index: 0 !important; } /* hidden at once, so YouTube's pause symbol never shows */ /* above the photo (the player gives the photo -1, the video -2) */
.parallax-video [id^="jarallax-container"] > iframe.gr-playing { opacity: 1; transition: opacity .45s ease; } /* fades in */

/* As-you-type results (site/assets/live-search.js) */
.gr-live { position: relative; z-index: 5; max-width: 760px; margin: 1rem auto 0; text-align: left; background: #fff; border: 1px solid #eee; box-shadow: 0 12px 32px rgba(0, 0, 0, .1); max-height: min(60vh, 520px); overflow-y: auto; }
.gr-live.is-loading { opacity: .6; transition: opacity .15s; }
.gr-live-item { display: flex; gap: 1rem; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid #f0f0f0; color: #111 !important; text-decoration: none !important; }
.gr-live-item:hover, .gr-live-item.is-active { background: #f5f5f5; }
.gr-live-img { position: relative; flex: none; width: 80px; height: 60px; background: #eee; overflow: hidden; }
.gr-live-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gr-live-play { position: absolute; right: 4px; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: #0b0b0b; }
.gr-live-play::before { content: ""; position: absolute; left: 7px; top: 5px; border-style: solid; border-width: 4px 0 4px 6px; border-color: transparent transparent transparent #fff; }
.gr-live-text { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.gr-live-cat { align-self: flex-start; padding: .1rem .4rem; background: #111; color: #fff; font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1.4; }
.gr-live-title { font-size: 1rem; font-weight: 600; line-height: 1.3; }
.gr-live-title mark { background: none; color: inherit; box-shadow: inset 0 -.35em 0 rgba(0, 0, 0, .12); }
.gr-live-date { font-size: .78rem; color: #777; }
.gr-live-all { display: block; padding: .8rem 1rem; font-size: .85rem; font-weight: 600; color: #111 !important; text-decoration: none !important; background: #fafafa; }
.gr-live-all:hover { background: #eee; }
.gr-live-empty { margin: 0; padding: 1rem; color: #777; font-size: .95rem; }
.widget .gr-live { margin-top: .5rem; max-width: none; box-shadow: 0 8px 20px rgba(0, 0, 0, .08); }
.widget .gr-live-img { width: 56px; height: 42px; }
.widget .gr-live-title { font-size: .85rem; }
html .gr-live { background: #2b2b2b; border-color: #3a3a3a; }
html .gr-live-item { color: #fff !important; border-bottom-color: #3a3a3a; }
html .gr-live-item:hover, html .gr-live-item.is-active { background: #333; }
html .gr-live-date, html .gr-live-empty { color: #ccc; }
html .gr-live-all { background: #232323; color: #fff !important; }
html .gr-live-all:hover { background: #3a3a3a; color: #fff !important; }
/* the theme styles <mark> like a small capitals label; in the live results it only highlights the typed word */
.gr-live-title mark { padding: 0 !important; font-size: inherit !important; text-transform: none !important; letter-spacing: inherit !important; font-weight: inherit; color: inherit !important; background: none !important; box-shadow: inset 0 -.35em 0 rgba(0, 0, 0, .12); }

/* the Watch badge is a button that opens the video popup */
button.gr-video-badge { pointer-events: auto; cursor: pointer; border: 0; font-family: inherit; }
button.gr-video-badge:hover, button.gr-video-badge:focus-visible { background: #fff; color: #111; outline: none; }
button.gr-video-badge:hover::before, button.gr-video-badge:focus-visible::before { border-left-color: #111; }
