/* Home (src/pages/Home.tsx). Loaded only on the front page (slug `home`).
 * Text sizes/colors/margins inside cards come from each block's own
 * attributes; this file carries layout, hover states and pseudo-elements. */

/* Component groups space their children with explicit margins (block
 * attributes), not WP's 24px flow gap (WP already zeroes margin-block-end). */
.xq-home-hero > .xq-home-hero-grid,
.xq-home-hero-widget > *, .xq-dropzone > *,
.xq-scan-stats > * > *, .xq-scan-detail > *, .xq-ecosystem > *,
.xq-home-solutions > *, .xq-home-solution > * { margin-block-start: 0; }

/* ── S1 hero ── */
.xq-home-hero {
  position: relative; overflow: hidden; min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: var(--wp--preset--spacing--section-80); padding-bottom: var(--wp--preset--spacing--section-80);
}
.xq-home-hero > .xq-plus-grid, .xq-home-hero > .xq-canvas-fade {
  position: absolute; inset: 0; max-width: none !important; margin: 0 !important; pointer-events: none;
}
.xq-canvas-fade { background: linear-gradient(to bottom, transparent 60%, var(--wp--preset--color--bg-base) 100%); }
.xq-home-hero-grid {
  position: relative; z-index: 1; width: 100%;
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center;
}
.xq-home-hero-grid > * { margin: 0; }
.xq-home-hero-title {
  font-size: clamp(48px, 5vw, 74px); font-weight: 700; letter-spacing: -0.028em; line-height: 1.06;
  margin-bottom: 28px !important;
}
.xq-home-hero-sub { --xq-rise: 16px; animation: xq-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.48s both; }
.xq-home-hero-lede { max-width: 460px; margin-bottom: 32px !important; }
.xq-home-hero-ctas { gap: 12px; margin-bottom: 40px !important; }
.xq-home-hero-trust { border-top: 1px solid var(--wp--preset--color--border); padding-top: 24px; }
.xq-home-hero-badges { margin-top: 24px !important; }
.xq-home-hero-widget { animation: xq-fade 0.8s ease 0.38s both; }
/* Sits higher than centred: half the centred offset from the top of the copy (~207px → 104px at 1440). */
@media (min-width: 901px) { .xq-home-hero-widget { align-self: start; margin-top: 104px !important; } }

/* Scanner drop zone: a card whose title link is stretched over it
 * (xq-stretched); scanner-dropzone.js toggles .is-dragover. */
.xq-dropzone {
  border: 1.5px dashed var(--wp--preset--color--border-mid);
  border-radius: 6px; background: var(--wp--preset--color--bg-surface);
  padding: 44px 32px; text-align: center; cursor: pointer; transition: all 0.15s;
}
/* Like React, only a drag-over highlights it (hover doesn't). */
.xq-dropzone.is-dragover { border-color: var(--wp--preset--color--accent); background: var(--wp--preset--color--accent-dim); }
.xq-dropzone > .xq-icon { display: block; margin-left: auto; margin-right: auto; }
.xq-dropzone-browse { color: var(--wp--preset--color--accent-dark); text-decoration: underline; }
.xq-dropzone-quota { border-top: 1px solid var(--wp--preset--color--border); padding-top: 16px; }
/* Live scanner (assets/scanner-dropzone.js): the card's own content — and its
 * stretched link, which would cover the iframe — give way to the embedded app. */
/* transition: none — the card's `transition: all` otherwise animates its padding away when the frame mounts. */
.xq-dropzone.is-embedded { padding: 0 !important; border-style: solid; overflow: hidden; background: #f5f6fa; transition: none; }
.xq-dropzone.is-embedded > :not(.xq-dropzone-frame) { display: none !important; }
.xq-dropzone-frame { display: block; width: 100%; height: 400px; border: 0; margin: 0 !important; }
@media (max-width: 600px) {
  .xq-dropzone-frame { height: 380px; }
  /* Phones: 16px hero gutters instead of the site-wide 40px, so the scanner frame gets ~90% of the screen.
   * Padding only — the root-padding variable also drives the full-bleed negative margin. */
  .xq-home-hero.has-global-padding { padding-left: 16px; padding-right: 16px; }
}
/* React: a 12px inline-block button (with its own 16px top margin) on the
 * wrapper's 15px/1.6 line. */
.xq-hero-widget-technical-link a {
  display: inline-block; margin-top: 16px; font-family: var(--wp--preset--font-family--display); font-size: var(--wp--preset--font-size--caption);
  color: var(--wp--preset--color--text-2); text-decoration: underline;
}

/* ── S2 sample scan output ── */
.xq-scan-stats { --xq-cols: 3; margin-bottom: 24px !important; }
.xq-scan-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
/* React keeps every bar's 12px bottom margin, the last one included. */
.xq-scan-detail .xq-meter { margin-bottom: 12px; }

/* ── S3 social proof: logo ticker (page-home.js appends the looping copy) ── */
.xq-sec > .xq-logo-ticker { position: relative; overflow: hidden; }
.xq-logo-ticker::before, .xq-logo-ticker::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 120px; z-index: 2; pointer-events: none;
}
.xq-logo-ticker::before { left: 0; background: linear-gradient(to right, var(--wp--preset--color--bg-base), transparent); }
.xq-logo-ticker::after { right: 0; background: linear-gradient(to left, var(--wp--preset--color--bg-base), transparent); }
.xq-logo-ticker-track { display: flex; width: max-content; margin: 0; }
.xq-logo-ticker-track.is-looped { animation: xq-ticker 28s linear infinite; }
.xq-logo-ticker-track:hover { animation-play-state: paused; }
.xq-logo-ticker-track > li {
  display: flex; align-items: center; gap: 8px; padding: 0 40px; flex-shrink: 0; margin: 0;
  font-family: var(--wp--preset--font-family--display); font-size: var(--wp--preset--font-size--body);
  font-weight: 600; color: var(--wp--preset--color--text-2); white-space: nowrap;
}
.xq-logo-ticker-track > li::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--wp--preset--color--accent); opacity: 0.4;
}

/* ── S4 platform ecosystem: cards joined by → (pseudo-element, 50px lane) ── */
/* 49.67px = React's arrow cell: 16px padding each side + the 20px '→' glyph. */
.xq-ecosystem { display: flex; align-items: stretch; flex-wrap: wrap; column-gap: 49.67px; }
.xq-ecosystem-node { flex: 1 1 240px; display: flex; flex-direction: column; justify-content: center; }
.xq-ecosystem-node + .xq-ecosystem-node::before {
  content: '→' / ''; position: absolute; top: 0; bottom: 0; right: calc(100% + 1px); width: 49.67px;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
  color: var(--wp--preset--color--text-3); font-size: var(--wp--preset--font-size--title-md); line-height: 1.6;
}

/* ── S5 product demo: 1fr 2fr split heading ── */
.xq-split-head { display: grid; grid-template-columns: 1fr 2fr; gap: 80px; align-items: end; margin-bottom: 64px !important; }
.xq-split-head > .xq-t-body-lg { max-width: 500px; }

/* ── S6 solutions ── */
.xq-home-solutions {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--wp--preset--color--border); border-bottom: 1px solid var(--wp--preset--color--border);
}
.xq-home-solution { padding: 40px; cursor: pointer; transition: background 0.15s; }
.xq-home-solution:not(:last-child) { border-right: 1px solid var(--wp--preset--color--border); }
.xq-home-solution:hover { background: rgba(17, 24, 39, 0.03); }
.xq-home-solution-tag { color: var(--xq-c); opacity: 0.8; }
/* React's 13px span sat in the card's 15px/1.6 line box: keep that 24px line. */
.xq-home-solution-more { color: var(--xq-c); line-height: 24px; }
.xq-home-solution-more::after { content: ' →'; }
.xq-home-solution:hover .xq-home-solution-more::after { content: ' ——›'; }

/* ── S7 final CTA ── */
.xq-home-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.xq-home-cta .xq-t-h2 { margin-bottom: 20px; }
.xq-home-cta .xq-t-body-lg { max-width: 480px; }
.xq-home-cta-actions { gap: 16px; align-items: flex-start; }

/* ── Responsive (React used fixed desktop grids; stack below 900px) ── */
@media (max-width: 900px) {
  .xq-home-hero { min-height: 0; }
  .xq-home-hero-grid, .xq-split-head, .xq-home-cta, .xq-scan-detail { grid-template-columns: 1fr; gap: 40px; }
  .xq-scan-stats { grid-template-columns: repeat(3, 1fr); }
  .xq-scan-stats > * { border-bottom: 0; }
  .xq-home-solutions { grid-template-columns: 1fr; }
  .xq-home-solution { padding: 32px 0; }
  .xq-home-solution:first-child { padding-left: 0; }
  .xq-home-solution:not(:last-child) { border-right: 0; border-bottom: 1px solid var(--wp--preset--color--border); }
  .xq-ecosystem { row-gap: 48px; }
  .xq-ecosystem-node { flex-basis: 100%; }
  .xq-ecosystem-node + .xq-ecosystem-node::before { top: auto; left: 0; right: 0; bottom: calc(100% + 1px); width: auto; height: 48px; transform: rotate(90deg); }
}
@media (max-width: 600px) {
  .xq-scan-stats { grid-template-columns: 1fr; }
  .xq-scan-stats > * { border-right: 0; }
  .xq-scan-stats > * + * { border-top: 1px solid var(--wp--preset--color--border); }
}

/* Linked compliance badges (social-proof row): the whole badge is the target. */
.xq-badge-link { transition: border-color 0.2s, color 0.2s; }
.xq-badge-link a { color: inherit; }
.xq-badge-link:hover, .xq-badge-link:focus-within { border-color: var(--wp--preset--color--border-mid); color: var(--wp--preset--color--text-0); }
.xq-badge-link a:focus-visible { outline: none; }
.xq-badge-link:focus-within { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }

/* Once the live scanner is embedded, "Technical overview →" sits 12px under it. */
.xq-home-hero-widget:has(.xq-dropzone.is-embedded) > .xq-hero-widget-technical-link { margin: 12px 0 0 !important; }
.xq-home-hero-widget:has(.xq-dropzone.is-embedded) > .xq-hero-widget-technical-link a { margin-top: 0; }

/* ── Zero Trust AI pillars (patterns/home-zero-trust-ai.php) ── */
.xq-zta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.xq-zta-grid > * { margin: 0 !important; }
.xq-zta-card > * { margin: 0; }
.xq-zta-num { font-family: var(--wp--preset--font-family--mono); font-size: var(--wp--preset--font-size--micro); letter-spacing: 0.08em; text-transform: uppercase; color: var(--wp--preset--color--accent-dark); margin-bottom: 14px !important; }
.xq-zta-h { font-size: 20px; line-height: 1.3; margin-bottom: 10px !important; }
.xq-zta-body { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--text-2); line-height: 1.65; }
.xq-zta-more { margin-top: 28px !important; font-family: var(--wp--preset--font-family--display); font-size: var(--wp--preset--font-size--small); font-weight: 600; }
.xq-zta-more a { color: var(--wp--preset--color--text-0); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 900px) { .xq-zta-grid { grid-template-columns: 1fr; } }

/* Phones and tablets (stacked hero): the scanner sits right after the headline.
 * The copy column drops its box (display: contents) so its children and the
 * scanner widget can be ordered in one flex column. */
@media (max-width: 900px) {
  .xq-home-hero-grid { display: flex !important; flex-direction: column; align-items: stretch !important; gap: 0 !important; }
  .xq-home-hero-copy { display: contents; }
  .xq-home-hero-copy > .xq-status-pill { align-self: flex-start; }
  .xq-home-hero-widget { order: 1; margin: 0 0 32px !important; }
  .xq-home-hero-copy > .xq-home-hero-sub { order: 2; }
  /* Less space around the stacked hero (80px on desktop): none on top, 20px below. */
  .xq-home-hero { padding-top: 0 !important; padding-bottom: 20px !important; }
}
