/*
 * features-d: /consent-management/, /google-tag-manager-alternative/, /integrations/.
 * Block-markup fixes on top of theme.css. Every area stylesheet loads on every
 * page, so these rules are scoped to this group's section ids.
 * The GTM page's old inline <style> block is further down.
 */

/* ------------------------------------------------------------------
 * Pieces also used on other feature pages (features-a/b have the same
 * fixes; they could move to blocks.css as one shared copy).
 * ------------------------------------------------------------------ */

/* "Why it matters" icons: were inline heroicon <svg>s, now Image blocks (images/icons/). */

/* Logo grid cells: were <a class="logo-grid--logo"><img></a>, now Image blocks
   (a <figure>, with the link inside when there is one). */
:is(#cm-plugins, #consent) .logo-grid > .wp-block-image.logo-grid--logo { margin: 0; }
:is(#cm-plugins, #consent) .logo-grid--logo > a { display: flex; align-items: center; justify-content: center; max-width: 100%; }
/* features-a.css pads the link inside linked logo figures (its Query Loop cells); here the figure keeps the old padding. */
#consent .logo-grid figure.logo-grid--logo > a { flex: 0 1 auto; padding: 0; min-height: 0; }
:is(#cm-plugins, #consent) .logo-grid--logo img { vertical-align: baseline; }

/* Compare cards: the label and the X icon were <div>s (now <p>), the check icon an
   inline svg (now an empty Group with a CSS mask). */

/* Browser mockups: the title-bar dots were <span>s (now empty Groups), the URL a <span>. */

/* Settings toggles mockup: the row label was a <span>. */

/* Feature row image: was a bare inline <img> that had the corners and shadow itself. */
#cm-features .feature-row--visual > .wp-block-image { margin: 0; border-radius: 0; box-shadow: none; overflow: visible; }

/* ------------------------------------------------------------------
 * /google-tag-manager-alternative/
 * The old template's inline <style>, as it was. Changes for block markup:
 * - the spec table is a core Table: the Conversion Bridge column had the class
 *   gtm-spec--cb, now it is picked with :nth-child(2);
 * - the "yes" check was an inline svg, now <span class="gtm-spec--yes">Yes</span>
 *   (text for screen readers, the check is a CSS mask); the footnote
 *   asterisk was <sup class="gtm-spec--asterisk">, now a plain <sup>.
 * ------------------------------------------------------------------ */
#gtm-diagram .gtm-scenes { display: flex; flex-direction: column; gap: var(--space-10); margin-top: var(--space-9); }
#gtm-diagram .gtm-flow--head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; margin-bottom: var(--space-6); }
#gtm-diagram .gtm-flow--label { font-family: var(--font-mono); font-size: 22px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--medium); }
#gtm-diagram .gtm-scene:last-child .gtm-flow--label { color: var(--accent); }
#gtm-diagram .gtm-flow--time { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; line-height: 1.2; text-align: left; }
#gtm-diagram .gtm-flow--time small { display: block; font-size: 12px; font-weight: 400; color: var(--medium); letter-spacing: 0; }
#gtm-diagram .gtm-flow--clock { width: 20px; height: 20px; flex: 0 0 auto; }
#gtm-diagram .gtm-flow--time-fast { color: var(--accent-alt); }
#gtm-diagram .gtm-flow--time-slow { color: var(--medium); }

/* Stage + connector wires */
#gtm-diagram .gtm-stage { position: relative; height: 300px; }
#gtm-diagram .gtm-wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; z-index: 1; }
#gtm-diagram .gtm-wire { fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke; }
#gtm-diagram .gtm-wire--in { stroke: var(--medium-light); stroke-width: 3px; }
#gtm-diagram .gtm-wire--out { stroke: var(--medium-light); stroke-width: 3px; }
#gtm-diagram .gtm-wire--cb { stroke: var(--accent-alt); stroke-width: 5px; }

/* Events (left) */
#gtm-diagram .gtm-stage--events { position: absolute; left: 0; top: 0; bottom: 0; width: 22%; z-index: 2; }
#gtm-diagram .gtm-ev { position: absolute; right: 4px; transform: translateY(-50%); display: flex; align-items: center; gap: 8px; }
#gtm-diagram .gtm-ev--ic { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; background: var(--white); border: 1px solid var(--light); box-shadow: 0 2px 8px rgba(0,0,0,0.06); display: flex; align-items: center; justify-content: center; color: var(--accent); }
#gtm-diagram .gtm-ev--ic svg { width: 22px; height: 22px; }
#gtm-diagram .gtm-ev--lb { font-size: 13px; font-weight: 600; color: var(--strong); white-space: nowrap; }

/* Hub (center) */
#gtm-diagram .gtm-hub-wrap { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; }
#gtm-diagram .gtm-hub { position: relative; z-index: 2; width: 100px; height: 100px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
#gtm-diagram .gtm-hub--gtm { background: var(--white); border: 2px solid var(--medium-light); color: var(--medium); }
#gtm-diagram .gtm-hub--cb { background: linear-gradient(135deg, var(--accent), var(--accent-alt)); box-shadow: 0 10px 30px rgba(67,206,162,0.35); }
#gtm-diagram .gtm-hub--core { display: flex; align-items: center; justify-content: center; }
#gtm-diagram .gtm-hub--cb .gtm-hub--core img { width: 80px; height: auto; display: block; }
#gtm-diagram .gtm-hub--pulse { position: absolute; top: 50%; left: 50%; width: 100px; height: 100px; margin: -50px 0 0 -50px; border-radius: 50%; background: var(--accent-alt); opacity: 0.4; z-index: 1; animation: gtmPulse 2.6s ease-out infinite; }
#gtm-diagram .gtm-hub--pulse-b { animation-delay: 1.3s; }
#gtm-diagram .gtm-hub--name { position: absolute; left: 50%; top: calc(50% + 66px); transform: translateX(-50%); z-index: 3; font-size: 13px; font-weight: 600; color: var(--medium); white-space: nowrap; }
@keyframes gtmPulse { 0% { transform: scale(0.68); opacity: 0.45; } 100% { transform: scale(2.1); opacity: 0; } }

/* Platforms (right) */
#gtm-diagram .gtm-stage--out { position: absolute; right: 0; top: 0; bottom: 0; width: 24%; z-index: 2; }
#gtm-diagram .gtm-plat { position: absolute; left: 0; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--white); border: 1px solid var(--light); border-radius: var(--radius-lg); box-shadow: 0 3px 12px rgba(0,0,0,0.07); }
#gtm-diagram .gtm-plat--name { font-weight: 700; font-size: 14px; color: var(--strong); white-space: nowrap; }
#gtm-diagram .gtm-plat--tag { font-family: var(--font-mono); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #9a5b00; background: #fdf2dd; padding: 2px 7px; border-radius: var(--radius-full); }

/* Conversion Bridge unified scrolling stream */
#gtm-diagram .gtm-stage--out-stream { width: 36%; display: flex; flex-direction: column; justify-content: center; }
#gtm-diagram .gtm-stream { --scroll-speed: 48s; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--white); border: 1.5px solid var(--accent-alt); border-radius: var(--radius-xl); box-shadow: 0 8px 26px rgba(67,206,162,0.14); }
#gtm-diagram .gtm-stream .logo-scroll-tile { width: 100px; height: 58px; background: var(--white); border: 1px solid var(--light); border-radius: var(--radius-lg); }
#gtm-diagram .gtm-stream .logo-scroll-tile img { max-width: 74px; max-height: 40px; object-fit: contain; }
#gtm-diagram .gtm-stream--fade { position: absolute; top: 0; bottom: 0; width: 2rem; z-index: 2; pointer-events: none; }
#gtm-diagram .gtm-stream--fade-l { left: 0; background: linear-gradient(to right, var(--white), transparent); }
#gtm-diagram .gtm-stream--fade-r { right: 0; background: linear-gradient(to left, var(--white), transparent); }

/* Captions */
#gtm-diagram .gtm-stage--caption { text-align: center; font-size: 14px; color: var(--medium); margin-top: var(--space-4); }
#gtm-diagram .gtm-stage--caption-accent { color: var(--accent); font-weight: 600; }

/* Reuses the home page #transition-arrow styles; only override the arrow to solid (house style is no gradient on arrows). */
#gtm-diagram #transition-arrow .draw-arrow path { stroke: var(--accent-alt); }

/* Alternating section tint — --section-alt is too faint, use the brand's light mint. */
#gtm-compare, #gtm-spec { background: var(--lightest); }

/* Wires are always fully drawn (motion comes from the pulse + logo stream). */

/* GTM mapping mockup */
#gtm-still .gtm-map { padding: var(--space-5); font-family: var(--font-mono); font-size: 13px; }
#gtm-still .gtm-map--title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--medium); margin-bottom: var(--space-4); }
#gtm-still .gtm-map--row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--light); }
#gtm-still .gtm-map--row:last-child { border-bottom: 0; }
#gtm-still .gtm-map--key { flex: 0 0 38%; color: var(--strong); font-weight: 600; }
#gtm-still .gtm-map--arrow { color: var(--medium-light); }
#gtm-still .gtm-map--val { color: var(--accent); }
#gtm-still .gtm-map--row-missing .gtm-map--val { color: #c0392b; }

/* Side-by-side spec table */
#gtm-spec--table { max-width: 760px; margin: var(--space-9) auto 0; overflow-x: auto; }
#gtm-spec--table table { width: 100%; border-collapse: collapse; }
#gtm-spec--table th, #gtm-spec--table td { padding: 12px 16px; text-align: center; font-size: 15px; border-bottom: 1px solid var(--light); vertical-align: middle; }
#gtm-spec--table thead th { font-family: var(--font-mono); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; background: var(--light); }
#gtm-spec--table thead th:first-child { background: transparent; }
#gtm-spec--table tbody th { text-align: left; font-weight: 600; color: var(--strong); }
#gtm-spec--table td { color: var(--medium); }
#gtm-spec--table :is(th, td):nth-child(2) { background: var(--lightest); }
#gtm-spec--table thead th:nth-child(2) { background: var(--accent-alt); color: var(--white); }
#gtm-spec--table td:nth-child(2) { color: var(--strong); font-weight: 600; }
#gtm-spec--table tbody tr:last-child th, #gtm-spec--table tbody tr:last-child td { border-bottom: 0; }
#gtm-spec .gtm-spec--yes { display: inline-block; width: 20px; height: 20px; font-size: 0; vertical-align: middle; background-color: var(--accent-alt); -webkit-mask: url(../../../images/ui/check.svg) center / contain no-repeat; mask: url(../../../images/ui/check.svg) center / contain no-repeat; }
#gtm-spec .gtm-spec--no { color: var(--medium-light); font-size: 18px; }
#gtm-spec .gtm-spec--yes + sup { color: var(--accent); font-weight: 700; margin-left: 2px; }
#gtm-spec .gtm-spec--footnote { max-width: 760px; margin: var(--space-4) auto 0; text-align: center; font-size: 13px; color: var(--medium); }

@media (max-width: 768px) {
	#gtm-spec--table th, #gtm-spec--table td { padding: 10px; font-size: 13px; }
	#gtm-diagram .gtm-stage { height: 250px; }
	#gtm-diagram .gtm-ev--lb { display: none; }
	#gtm-diagram .gtm-ev--ic { width: 34px; height: 34px; }
	#gtm-diagram .gtm-ev--ic svg { width: 18px; height: 18px; }
	#gtm-diagram .gtm-hub { width: 80px; height: 80px; }
	#gtm-diagram .gtm-hub--pulse { width: 80px; height: 80px; margin: -40px 0 0 -40px; }
	#gtm-diagram .gtm-hub--cb .gtm-hub--core img { width: 62px; height: auto; }
	#gtm-diagram .gtm-hub--name { top: calc(50% + 52px); font-size: 12px; }
	#gtm-diagram .gtm-plat { padding: 5px 9px; }
	#gtm-diagram .gtm-plat--name { font-size: 12px; }
	#gtm-diagram .gtm-plat--tag { display: none; }
	#gtm-diagram .gtm-stream .logo-scroll-tile { width: 62px; height: 38px; }
	#gtm-diagram .gtm-stream .logo-scroll-tile img { max-width: 44px; max-height: 24px; }
	#gtm-still .gtm-map--key { flex-basis: 44%; }
}
@media (prefers-reduced-motion: reduce) {
	#gtm-diagram .gtm-hub--pulse { animation: none; opacity: 0.25; }
	#gtm-diagram .gtm-stream .logo-scroll-track { animation: none; }
}

/* Block-markup fixes for the GTM page */
/* Mapping mockup: the title and the key / arrow / value were a <div> and <span>s, now <p>s. */
#gtm-still .gtm-map p { margin: 0; font-size: inherit; line-height: inherit; }
#gtm-still .gtm-map p.gtm-map--title { font-size: 11px; margin-bottom: var(--space-4); }
/* Spec table is a core Table block: drop core's cell borders and heavy header rule. */
#gtm-spec--table table thead { border-bottom: 0; }
#gtm-spec--table table :is(th, td) { border: 0; border-bottom: 1px solid var(--light); }
#gtm-spec--table table tbody tr:last-child :is(th, td) { border-bottom: 0; }
#gtm-spec--table table { margin: 0 0 15px; }
/* "Get Conversion Bridge" under the table was <p class="section-footer-link"><a class="button">. */
#gtm-spec .wp-block-buttons.section-footer-link { margin-bottom: 15px; }
/* Arrow links: were <p><a class="link-arrow"> (the p kept its margins, the link had margin-top). */
#gtm-when p.section-footer-link { margin: var(--space-7) 0 15px; }
#gtm-still .feature-row--text p.is-style-link-arrow { margin: 0 0 var(--space-4); font-size: 1.125rem; line-height: 1.625; }
#gtm-still .feature-row--text p.is-style-link-arrow a { margin-top: var(--space-2); line-height: inherit; }

/* ------------------------------------------------------------------
 * /integrations/
 * ------------------------------------------------------------------ */
/* Hero circuit background: was a bare <img class="hero--circuit-bg">; the class is on the <figure> now. */
#integrations-hero figure.hero--circuit-bg { margin: 0; max-width: 100%; bottom: auto; } /* old img had the global img max-width: 100% */
#integrations-hero figure.hero--circuit-bg img { width: 100%; height: auto; display: block; }
