/*
 * The tailwind scaffold theme's own stylesheet.
 *
 * Plain CSS on purpose: a scaffolded project has no build step, so this file is
 * served as written. Everything that needs a colour reads a **daisyUI token**
 * (`--color-base-100`, `--color-base-content`, `--color-primary`, …) rather than
 * a literal, because daisyUI redefines those per theme — a hardcoded `#fff` is
 * invisible under `data-theme="dark"`, and that is how it is usually found.
 */

/* The framework's components — the search box, the bell, flash messages, tiles, … — in a file of
   their own, so an application with its own Tailwind build can import them without these page
   rules. Before every rule, as CSS requires of an @import. */
@import "components.css";

html, body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* The page ground. daisyUI paints tokens, not elements. */
body {
    background-color: var(--color-base-200, #f3f4f6);
    color: var(--color-base-content, #1f2937);
}

/*
 * Tailwind v4 defaults a bare `border` to currentColor; v3 (which some of this
 * markup was written for) defaulted to gray-200. The theme uses bare `border`
 * utilities, so restore a sensible default — as a token, so it follows the
 * theme instead of staying light in the dark one.
 *
 * `@layer base` is the whole of the fix, and specificity is a red herring.
 *
 * The rule below is (0,0,1) and `.btn-ghost` is (0,1,0), so the obvious reading
 * is that the component wins. It did not: **an unlayered rule beats every
 * layered one, whatever the specificity**, and daisyUI 5 ships entirely inside
 * `@layer base / daisyui / utilities`. So this sat above all of it and drew a
 * border on every component that had asked for none — a `btn-ghost` setting
 * `--btn-border: #0000` still showed an outline, and so did inputs and cards.
 *
 * The way it was found is worth recording: a SPA does not load this file, so the
 * same markup with the same classes looked different on the two halves of one
 * application, and no amount of comparing class lists explained it.
 *
 * Inside `base` the intent still holds. Tailwind's Preflight `*` rule (0,0,0) is
 * in the same layer, where specificity does decide, so this still beats it; and
 * `base` is declared before `daisyui`, so a component's own border wins as it
 * always should have.
 */
@layer base {
    html *,
    html ::before,
    html ::after,
    html ::backdrop,
    html ::file-selector-button {
        border-color: var(--color-base-300, #e5e7eb);
    }
}

/*
 * Basic typography for the starter home page's bare semantic HTML. Tailwind's
 * Preflight strips heading sizes and list markers, so restore them — scoped to
 * .pf-home so the nav, cards and other utility-styled markup are untouched.
 */
.pf-home h1 { font-size: 1.875rem; line-height: 2.25rem; font-weight: 700; margin-bottom: .5rem; }
.pf-home h2 { font-size: 1.25rem; line-height: 1.75rem; font-weight: 600; margin: 1.5rem 0 .5rem; }
.pf-home p  { margin-bottom: 1rem; }
.pf-home ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.pf-home li { margin: .15rem 0; }
.pf-home a  { color: var(--color-primary, #2563eb); text-decoration: underline; }
.pf-home code {
    background: var(--color-base-200, #f3f4f6);
    padding: .1rem .35rem;
    border-radius: .25rem;
    font-size: .875rem;
}

/* ── Breadcrumbs (Pramnos\Html\Breadcrumb markup) ───────────────────────────
   That helper emits its own class names, not daisyUI's, so the two are bridged
   here rather than by rewriting the helper's markup in every view. */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    font-size: 0.85rem;
    color: var(--color-base-content, #6b7280);
    opacity: 0.7;
}
.breadcrumb-item h1, .breadcrumb-item h2, .breadcrumb-item h3,
.breadcrumb-item h4, .breadcrumb-item h5, .breadcrumb-item h6 {
    display: inline;
    margin: 0;
    padding: 0;
    font-size: inherit;
    font-weight: 400;
    line-height: inherit;
}
.breadcrumb-item { display: inline-flex; align-items: center; }
.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    margin-right: 0.35rem;
    opacity: 0.4;
}
.breadcrumb-item a { color: var(--color-primary, #2563eb); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { opacity: 0.7; }

/*
 * `form-control`, the class Html\Date and a few bundled fields carry by default — Bootstrap's
 * name, which daisyUI does not define. Without this a date field here is an unstyled box.
 */
.form-control {
    width: 100%;
    padding: .5rem .75rem;
    border: 1px solid color-mix(in oklab, currentColor 25%, transparent);
    border-radius: .375rem;
    background: transparent;
    color: inherit;
}

/* The first thing a keyboard reaches, and it must be visible once it has focus.
   Off-screen rather than hidden: `display:none` takes it out of the tab order, which
   is the whole of what it is for. */
.pf-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1000;
    padding: 8px 16px;
    background: #000;
    color: #fff;
    text-decoration: none;
}

.pf-skip-link:focus {
    left: 0;
}

/* The brand logo, in the ink that reads on the navbar behind it.
   The scaffold ships two files — logo.png is dark ink, logo-inverse.png light — and the
   header renders a light/dark toggle, so one <img> cannot serve both: a near-black
   wordmark on a near-black navbar is simply not there, with nothing in any log.
   `content: url()` swaps the image on the element itself, so there is no second <img>
   to keep in sync and no JavaScript in the path.
   The selector is suffix-matched because the dark theme is named after the project —
   `<slug>-dark`, written by `init` into app/themes/theme.css — and this file is static.
   The media query is the other half: with nothing stored the toggle sets no attribute
   and the OS preference decides, which is the same scoping theme-tokens.css uses. */
[data-theme$="-dark"] .pf-logo {
    content: url("../img/logo-inverse.png");
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .pf-logo {
        content: url("../img/logo-inverse.png");
    }
}

/* ── Phone width (below 640px) ───────────────────────────────────────────────
   The account menu scrolls sideways without drawing a scrollbar under it — the
   row itself says there is more. */
.pf-account-nav {
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.pf-account-nav::-webkit-scrollbar { display: none; }

@media (max-width: 639px) {
    /* A long trail stays one line and scrolls, and a long crumb (an email
       address, a person's name) is cut with an ellipsis rather than pushing
       the page wider than the screen. */
    .pf-breadcrumb,
    .breadcrumb {
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
    }
    .pf-breadcrumb::-webkit-scrollbar,
    .breadcrumb::-webkit-scrollbar { display: none; }
    .pf-breadcrumb li,
    .breadcrumb li { flex-shrink: 0; }
    .pf-breadcrumb li > *,
    .breadcrumb li > * {
        display: inline-block;
        max-width: 12rem;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: bottom;
    }
}

/*
 * The admin header's search slot: Html\SearchBox's own .pf-omnibox-input is already a
 * complete, bordered, white field (components.css) — wrapping it in a second bordered
 * pill for the leading icon drew a visible box-in-a-box. Instead the icon sits absolute
 * over the omnibox's own field (header.php), which just needs to fill its slot and leave
 * room on the left for it.
 */
.openwhm-omnibox-wrap .pf-omnibox { display: block; width: 100%; }
.openwhm-omnibox-wrap .pf-omnibox-input { width: 100%; padding-left: 2.25rem; }

/*
 * components.css anchors the results panel to the omnibox's *right* edge
 * (right: 0), sized to a 20rem minimum. In the header this box sits right next
 * to the narrow sidebar and is itself often under 20rem, so the panel's left
 * edge runs past the omnibox's own left edge and under the sidebar. There is
 * always room to the right (the page content), never reliably to the left, so
 * grow that way instead.
 */
.openwhm-omnibox-wrap .pf-omnibox-results { right: auto; left: 0; }
