/* Paid Acquisition (/panel/paid-acquisition) + Partner Feed Funnel
   (/panel/partner-feed-funnel) — page-scoped EDS bridge layer. Loads after
   eds-panel.css; scoped to `.fi-eds--paid` / `.fi-eds--pff` so nothing here
   leaks onto other panel surfaces. See docs/design-system.md § "Laravel/
   Filament EDS bridge" for the shared-primitive rules this file must not
   duplicate (fi-eds-cc, fi-eds-table, fi-eds-kv, fi-eds-badge, …).
*/

/* ── Non-interactive info cards ───────────────────────────────────────
   Both pages reuse the shared `.fi-eds-cc` shell (built for the clickable
   candidate-card grid) purely as a bordered info tile — nothing on either
   page navigates on click. The shared hover-lift + pointer cursor implies
   an affordance that isn't there, so it's turned off here; the shared
   `content-visibility:auto` optimization (tuned for long infinite-scroll
   candidate feeds) is also turned off, since on these short static pages
   it only costs a scroll-triggered pop-in with no rendering benefit. */
.fi-eds--paid .fi-eds-cc,
.fi-eds--pff .fi-eds-cc {
    content-visibility: visible;
    cursor: default;
}
.fi-eds--paid .fi-eds-cc:hover,
.fi-eds--pff .fi-eds-cc:hover {
    transform: none;
    box-shadow: var(--fi-eds-shadow);
}

/* ── Table rows are read-only here (no row click-through) ────────────── */
.fi-eds--paid .fi-eds-table tbody tr,
.fi-eds--pff .fi-eds-table tbody tr {
    cursor: default;
}
/* The Partner Feed Funnel weekly table carries 14 columns of long headers
   ("Partner enquiries received", "Other feed shown in a list", …). The
   shared `.fi-eds-table` primitive's `min-width:1040px` + `thead th
   {white-space:nowrap}` (eds-panel.css) is tuned for shorter native-fi
   tables and forces this one to 2558px, slicing the 7th column at the card
   edge with no visible scroll cue. Release both constraints here so headers
   wrap to two lines and all 14 columns fit the 1600px viewport; the wrap's
   own overflow-x still covers genuinely narrow viewports. */
.fi-eds--pff .fi-eds-table {
    /* Default (auto) table layout, not fixed: it shrinks each column from its
       nowrap max-content width down toward its wrappable min-content width
       as space gets tighter, and refuses to shrink narrower than the widest
       min-content (a `.text-right` nowrap numeric floors its own column) —
       which is exactly what lets the 14 columns wrap into and fit the
       ~1412px desktop wrap, while still overflowing into the wrap's native
       horizontal scroll on a narrow (mobile) viewport instead of crushing
       every column to illegibility. `table-layout:fixed` would instead force
       the table to always equal 100% of the wrap's width — actively
       defeating that mobile scroll fallback. */
    min-width: 0;
}
.fi-eds--pff .fi-eds-table thead th {
    white-space: normal;
}
/* `th.text-right` (below) sets `white-space:nowrap` for numeric alignment,
   and its class+class+class selector outranks the plain `thead th` rule
   above — so header cells still refused to wrap without this. Headers stay
   right-aligned over their numeric columns but get their wrap back. */
.fi-eds--pff .fi-eds-table thead th.text-right {
    white-space: normal;
}
.fi-eds--pff .fi-eds-table thead th,
.fi-eds--pff .fi-eds-table tbody td {
    padding-left: 10px;
    padding-right: 10px;
}
.fi-eds--paid .fi-eds-table td,
.fi-eds--paid .fi-eds-table th,
.fi-eds--pff .fi-eds-table td,
.fi-eds--pff .fi-eds-table th {
    font-variant-numeric: tabular-nums;
}
/* `.text-right` isn't a real utility in the panel stylesheets — define it
   here, scoped to our tables. The thead selector needs th.text-right's
   type+class specificity to beat the shared `.fi-eds-table thead th`. */
.fi-eds--paid .fi-eds-table th.text-right,
.fi-eds--paid .fi-eds-table td.text-right,
.fi-eds--pff .fi-eds-table th.text-right,
.fi-eds--pff .fi-eds-table td.text-right {
    text-align: right;
    white-space: nowrap;
}
/* The row's identity column (a date, a campaign name) shouldn't wrap just
   because sibling numeric columns are squeezing it. */
.fi-eds--paid .fi-eds-table td .is-name,
.fi-eds--pff .fi-eds-table td .is-name {
    white-space: nowrap;
}
/* Card headings are single-line prose, not a URL — let them wrap onto a
   second line instead of ellipsis-truncating mid-word. */
.fi-eds--paid .fi-eds-pc__title,
.fi-eds--pff .fi-eds-pc__title {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}
/* `.fi-eds-cc` is a column flexbox with the default stretch alignment, so a
   status badge child is stretched into a full-width band. Pin it to its
   own content width like a real chip. */
.fi-eds--paid .fi-eds-cc > .fi-eds-badge,
.fi-eds--pff .fi-eds-cc > .fi-eds-badge {
    align-self: flex-start;
}

/* ── "Connection & safety boundary" row (Paid Acquisition only) ───────
   The first card ("Read-only Google Ads API") carries no status badge,
   while its two siblings each open with one — a badge is 20px tall
   (line-height 12px + 4px top/bottom padding) sitting above the title's
   own .75rem/12px margin-top, so badge-less card's <h3> starts 32px
   higher than the other two and the 3-up row's headings don't align.
   Push this card's title down by that same badge+gap amount. */
.fi-eds--paid section[aria-labelledby="paid-connection"] .fi-eds-cc:first-child > .fi-eds-pc__title {
    margin-top: 32px;
}

/* ── Daily spend pacing meter (Paid Acquisition only) ─────────────────
   Replaces a hardcoded cool-gray track (rgba(148,163,184,…) — slate, not
   an EDS token) with the warm sunken well, and the fill with a rationed
   purple accent instead of an ambiguous currentColor. */
.fi-eds--paid .fi-eds-pace__track {
    flex: 1 1 auto;
    min-width: 0;
    height: 10px;
    border-radius: 6px;
    background: var(--cream2);
    border: 1px solid var(--line);
    overflow: hidden;
}
.fi-eds--paid .fi-eds-pace__fill {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: var(--purple);
    opacity: 0.55;
}

/* ── 320/375px hardening, in one place rather than per-card inline styles.

   Every card on this page is a grid item, and a grid item's default
   `min-width:auto` is its MIN-CONTENT width — so one unbreakable string (a
   campaign name, a landing-page URL, a search term typed as one long token)
   pushes its track wider than the track's own `minmax(min(100%,…),1fr)` cap
   and the whole PAGE scrolls sideways rather than the card wrapping. The
   `fi-eds-kv` label column is a fixed 104px, which at 320px leaves a value
   column too narrow to read; below 380 it stacks instead. The fi-eds-table
   wrappers keep their own horizontal scroll — those are meant to scroll,
   and only they are. ── */
.fi-eds--paid .fi-eds-cc,
.fi-eds--pff .fi-eds-cc {
    min-width: 0;
    overflow-wrap: anywhere;
}
/* fi-eds-pc__url is nowrap + ellipsis, which is right for a URL and wrong
   for a sentence: inside a card with overflow:hidden the tail is silently
   cut off. This is the sentence variant — used wherever fi-eds-pc__url
   carries prose rather than a single short token. */
.fi-eds--paid .fi-eds-pc__url--wrap,
.fi-eds--pff .fi-eds-pc__url--wrap {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    display: block;
    overflow-wrap: anywhere;
}
.fi-eds--paid .fi-eds-kpi,
.fi-eds--pff .fi-eds-kpi {
    min-width: 0;
    overflow-wrap: anywhere;
}
@media (max-width: 640px) {
    .fi-eds--paid .fi-eds-kpi__n,
    .fi-eds--pff .fi-eds-kpi__n {
        font-size: 22px;
    }
}
@media (max-width: 380px) {
    .fi-eds--paid .fi-eds-kv,
    .fi-eds--pff .fi-eds-kv {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px 0;
    }
    .fi-eds--paid .fi-eds-kv dd,
    .fi-eds--pff .fi-eds-kv dd {
        margin-bottom: 6px;
    }
    /* The pacing row is three fixed-ish columns; at 320px the two text
       ends have to give the bar something to draw in, and the date drops
       its month rather than ellipsing away the day it names. */
    .fi-eds--paid .fi-eds-pace__d { flex-basis: 3.25rem !important; }
    .fi-eds--paid .fi-eds-pace__v { flex-basis: 4.25rem !important; }
    .fi-eds--paid .fi-eds-pace__m { display: none; }
}
