:root {
    --font-sans: "Inter", inter, ui-sans-serif, system-ui, sans-serif;
}

.outside,
.outside .font-sans {
    font-family: "Inter", inter, ui-sans-serif, system-ui, sans-serif;
}

/* Statamic 6 login wraps the wordmark in .logo; replace it with the site mark. */
.outside .logo {
    width: 4.5rem !important;
    height: 4.5rem !important;
    max-width: 4.5rem !important;
    padding-top: 0 !important;
    background: url("/favicon.svg") center / contain no-repeat !important;
}

.outside .logo > *,
.outside .logo svg {
    display: none !important;
}

/* AuthCard subtitle: “Sign into your Statamic Control Panel” */
.outside header .text-center.mt-1\.5 {
    display: none !important;
}

/*
 * Authenticated CP header mark. In Statamic 6 `.site-logo` is the SVG root itself,
 * so child selectors never hid the Statamic paths (they painted with the orange accent).
 */
svg.site-logo,
.site-logo {
    width: 1.75rem !important;
    height: 1.75rem !important;
    background: url("/favicon.svg") center / contain no-repeat !important;
    color: transparent !important;
    fill: transparent !important;
}

svg.site-logo > *,
.site-logo > * {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Hide configure / blueprint kebab menus in page headers (listing + edit screens). */
[data-ui-header] button[aria-label="Open dropdown menu"] {
    display: none !important;
}

/*
 * Row / tree action menus should be a vertical list. Statamic uses a 2-col grid
 * with subgrid items; our term-status painter must not turn the menu into a
 * horizontal flex row (see cp-brand.js).
 */
[data-ui-dropdown-content] {
    min-width: 12rem !important;
}

[data-ui-dropdown-menu] {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    min-width: 12rem !important;
}

[data-ui-dropdown-menu] [data-ui-context-item],
[data-ui-dropdown-menu] [role="menuitem"] {
    display: flex !important;
    width: 100% !important;
    align-items: center !important;
    gap: 0.5rem !important;
    box-sizing: border-box !important;
    grid-column: auto !important;
    grid-template-columns: none !important;
}

[data-ui-dropdown-menu] [data-ui-context-item] > div:first-child,
[data-ui-dropdown-menu] [role="menuitem"] > div:first-child {
    flex-shrink: 0 !important;
}

[data-ui-dropdown-menu] [role="separator"] {
    width: 100% !important;
}

/* Stray published/draft dots must never appear inside row-action menus. */
[data-ui-dropdown-menu] .cp-term-status,
[data-ui-dropdown-content] .cp-term-status,
[role="menu"] .cp-term-status {
    display: none !important;
}

/*
 * Do not hardcode accent link colours here — Statamic’s `.text-ui-accent-text`
 * already uses `--theme-color-ui-accent-text`, which BrandColour sets from
 * settings.brand_colour.
 */

/*
 * Statamic 6 primary buttons are `from-primary/90 to-primary text-white`
 * (ui Button variant), not btn-primary / bg-ui-accent. Force black labels
 * on the brand fill for contrast.
 */
[class*="from-primary"],
[class*="from-primary"] *,
[class*="to-primary"]:not([class*="border-primary"]),
[class*="to-primary"]:not([class*="border-primary"]) *,
button[class*="bg-primary"],
a[class*="bg-primary"],
button[class*="bg-primary"] *,
a[class*="bg-primary"] *,
[class*="from-primary"].text-white,
[class*="to-primary"].text-white {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
}

[class*="from-primary"] svg,
[class*="to-primary"]:not([class*="border-primary"]) svg,
button[class*="bg-primary"] svg,
a[class*="bg-primary"] svg {
    color: #111827 !important;
    fill: currentColor !important;
    opacity: 1 !important;
}

/* Statamic CP CSS does not include the site Tailwind grid, so dashboard stats stay in one row here. */
.photo-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    width: 100%;
}

.photo-stats-value {
    margin-top: 0.5rem;
    font-size: 1.875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--theme-color-ui-accent-text, #fd9e02);
}

.term-usage {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    width: 100%;
}

@media (min-width: 1024px) {
    .term-usage {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.term-usage-heading {
    margin-bottom: 0.75rem;
}

.term-usage-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.term-usage-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.term-usage-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.term-usage-count {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--theme-color-ui-accent-text, #fd9e02);
    flex-shrink: 0;
}

.term-usage-empty {
    margin: 0;
}

/* Match Statamic StatusIndicator beside category titles. */
.cp-term-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cp-term-status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
}

.cp-term-status-dot.is-published {
    background: #4ade80;
}

.cp-term-status-dot.is-draft {
    background: #d1d5db;
}

:root.dark .cp-term-status-dot.is-draft {
    background: #e5e7eb;
}

.cp-term-title-cell {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
}

/* Never treat action menus as term title cells. */
[data-ui-dropdown-menu].cp-term-title-cell,
[data-ui-dropdown-content].cp-term-title-cell,
[role="menu"].cp-term-title-cell {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
}

/* Dashboard widgets are always full-width rows (stats, then latest, then oldest). */
[data-dashboard] > *,
.dashboard-widgets > *,
.dashboard .widget,
.dashboard [class*="widget"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
}

/* Caption (markdown) needs more vertical room than the default CodeMirror height. */
.publish-fields .markdown-fieldtype .CodeMirror {
    min-height: 18rem;
}
