/* aeo-audit: aeo-dashboard-hero — compact "score strip" layout (Round 12 D-093).
 * Round 12 reframed this from a full-width hero (gauge + 2x2 stat tiles) to a
 * single horizontal strip ~140-160px tall. The score gauge is supporting
 * context; the upsell hero now owns visual dominance.
 *
 * Round 14 — also added the .aeo-dashboard__header-strip layout rules (the
 * 3-button action row at the top of the dashboard). The selectors had no CSS
 * before Round 14, leaving the meta + actions divs stacking and the secondary
 * anchors stretching full-width as block-level elements.
 *
 * D-088 mobile rule: stacks vertically (gauge → overall caption → stats grid).
 */

/* Round 14 — header strip layout (Section 1 of the dashboard, inline markup
 * in index.php). Two columns on desktop (meta left, actions right); stacks
 * vertically below 768px with actions wrapping to a row of equal-flex buttons. */
.aeo-dashboard__header-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
}
.aeo-dashboard__header-strip-meta {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}
.aeo-dashboard__header-strip-url {
    font-size: 0.9375rem;
    font-weight: 600;
    color: rgb(31 41 55);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dark .aeo-dashboard__header-strip-url { color: #ffffff; }
.aeo-dashboard__header-strip-last {
    font-size: 0.75rem;
    color: rgb(107 114 128);
}
.dark .aeo-dashboard__header-strip-last { color: rgb(156 163 175); }

.aeo-dashboard__header-strip-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
}
/* Ensure the form wrapper doesn't push the Re-scan button into a different
 * baseline than the sibling anchors. */
.aeo-dashboard__header-strip-actions form { display: inline-flex; }
/* Equal padding/height across all 3 buttons regardless of <button> vs <a>. */
.aeo-dashboard__header-strip-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .aeo-dashboard__header-strip {
        flex-direction: column;
        align-items: stretch;
    }
    .aeo-dashboard__header-strip-actions {
        justify-content: stretch;
    }
    .aeo-dashboard__header-strip-actions form,
    .aeo-dashboard__header-strip-actions > .btn {
        flex: 1 1 0;
    }
    .aeo-dashboard__header-strip-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

.aeo-dashboard__strip {
    /* Card chrome supplied by the wrapping classes (border-gray-200 etc.) */
}

.aeo-dashboard__strip-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 1.75rem;       /* Round 15 — bumped from 1.25/1.5 for breathing room */
}

/* Compact gauge column — hosts the AIV ring at 110px (vs the legacy 180px).
 * The AIV score's Round 11 bump to 2.5rem is reverted in compact context
 * because the strip is no longer the headline metric.
 * Round 15 — added subtle drop shadow under the ring to lift it from the
 * card surface; gauge is the strip's primary visual anchor. */
.aeo-dashboard__strip-gauge {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 10px rgb(0 0 0 / 0.08));
}
.dark .aeo-dashboard__strip-gauge {
    filter: drop-shadow(0 4px 10px rgb(0 0 0 / 0.30));
}
@media (prefers-reduced-motion: reduce) {
    .aeo-dashboard__strip-gauge { filter: none; }
}
.aeo-dashboard__strip .aeo-gauge__score { font-size: 1.5rem; }
.aeo-dashboard__strip .aeo-gauge__label {
    font-size: 0.6875rem;
    margin-top: 0.125rem;
}

/* Overall caption sits to the right of the gauge, not below. */
.aeo-dashboard__strip-overall {
    display: flex;
    gap: 0.125rem;
    flex: 0 0 auto;
    flex-direction: column;
}
.aeo-dashboard__strip-overall-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgb(107 114 128);
}
.dark .aeo-dashboard__strip-overall-label { color: rgb(156 163 175); }
.aeo-dashboard__strip-overall-value {
    gap: 0.5rem;
    display: flex;
    line-height: 1;
    align-items: baseline;
    flex-direction: column;
}
.aeo-dashboard__strip-overall-num {
    font-size: 1.875rem;
    font-weight: 800;
    color: rgb(31 41 55);
    font-variant-numeric: tabular-nums;
}
.dark .aeo-dashboard__strip-overall-num { color: #ffffff; }
.aeo-dashboard__strip-overall-grade {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(107 114 128);
}
.dark .aeo-dashboard__strip-overall-grade { color: rgb(209 213 219); }

/* 4 inline stat blocks. Each is a vertical mini-stack (head / value / sub).
 * Round 15 — head row is icon + label horizontally; vertical dividers between
 * tiles + a left divider on the wrapper to separate stats from the Overall
 * caption. Stat tiles get optional --alert / --ok modifier for contextual
 * icon color (driven by tile key + value in hero.php). */
.aeo-dashboard__strip-stats {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;          /* Round 15 — column gap handled by per-tile dividers */
    min-width: 0;
    padding-left: 1rem;
    /* border-left: 1px solid var(--border-base); */
}
.aeo-dashboard__strip-stat {
    min-width: 0;
    padding: 0 1rem;
    border-left: 1px solid var(--border-base);
}
/* Round 15 — vertical dividers between stat-to-stat (skip the first tile
 * because the wrapper's left border already separates it from Overall). */
/* .aeo-dashboard__strip-stat + .aeo-dashboard__strip-stat {
    border-left: 1px solid var(--border-base);
} */

.aeo-dashboard__strip-stat-head {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.25rem;
}
.aeo-dashboard__strip-stat-icon {
    font-size: 1rem;
    color: rgb(107 114 128);
    flex: 0 0 auto;
    line-height: 1;
}
.dark .aeo-dashboard__strip-stat-icon { color: rgb(156 163 175); }

/* Round 15 — contextual icon coloring. Reuses existing band hex values
 * (matches .aeo-band--bad / .aeo-band--great in the dashboard token system).
 * No new color tokens introduced. */
.aeo-dashboard__strip-stat--alert .aeo-dashboard__strip-stat-icon { color: #dc2626; }
.dark .aeo-dashboard__strip-stat--alert .aeo-dashboard__strip-stat-icon { color: #f87171; }
.aeo-dashboard__strip-stat--ok    .aeo-dashboard__strip-stat-icon { color: #16a34a; }
.dark .aeo-dashboard__strip-stat--ok    .aeo-dashboard__strip-stat-icon { color: #4ade80; }

.aeo-dashboard__strip-stat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgb(107 114 128);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dark .aeo-dashboard__strip-stat-label { color: rgb(156 163 175); }
.aeo-dashboard__strip-stat-value {
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.1;
    color: rgb(31 41 55);
    font-variant-numeric: tabular-nums;
}
.dark .aeo-dashboard__strip-stat-value { color: #ffffff; }
.aeo-dashboard__strip-stat-sub {
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: rgb(107 114 128);
}
.dark .aeo-dashboard__strip-stat-sub { color: rgb(156 163 175); }

.aeo-dashboard__strip-stat-delta--up   { color: #16a34a; }
.aeo-dashboard__strip-stat-delta--down { color: #dc2626; }
.aeo-dashboard__strip-stat-delta--flat { color: rgb(107 114 128); }

/* Round 15 — NEW tablet breakpoint (768-1023px): gauge + Overall sit on row 1,
 * 4 stats wrap to a 2x2 grid on row 2. Dividers between gauge|Overall stay;
 * the wrapper-left divider on stats moves to a top divider in the new row. */
@media (min-width: 768px) and (max-width: 1023px) {
    .aeo-dashboard__strip-inner {
        flex-wrap: wrap;
    }
    .aeo-dashboard__strip-stats {
        flex-basis: 100%;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.875rem 0;
        padding-left: 0;
        padding-top: 0.875rem;
        margin-top: 0.25rem;
        border-left: 0;
        border-top: 1px solid var(--border-base);
    }
    /* On 2x2 grid, every other stat starts a new row — drop their left border. */
    .aeo-dashboard__strip-stat:nth-child(2n+1) {
        border-left: 0;
    }
}

/* D-088 — mobile / narrow viewports. Stack vertically: gauge (centered),
 * overall caption (centered, no right border), stats grid (2x2). All
 * dividers hide because the layout is no longer side-by-side. */
@media (max-width: 767px) {
    .aeo-dashboard__strip-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    .aeo-dashboard__strip-gauge { justify-content: center; }
    .aeo-dashboard__strip-overall {
        align-items: center;
        text-align: center;
        padding-right: 0;
        border-right: 0;
        border-bottom: 1px solid var(--border-base);
        padding-bottom: 0.75rem;
    }
    .aeo-dashboard__strip-overall-value { justify-content: center; }
    .aeo-dashboard__strip-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.875rem 0.75rem;       /* Round 15 — restore column gap on mobile (no dividers) */
        padding-left: 0;
        border-left: 0;
    }
    .aeo-dashboard__strip-stat,
    .aeo-dashboard__strip-stat + .aeo-dashboard__strip-stat {
        border-left: 0;
        padding: 0;
    }
}
