/* Polish layer on top of DaisyUI 5 — elevation, glass, and shell chrome.
   Uses the DaisyUI 5 CSS custom properties (`--color-*`, which hold full
   color values), not the removed v4 `--p`/`--b1` HSL-channel aliases. */

/* ── Base ── */

html {
    scroll-behavior: smooth;
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
}
.skip-link { position: fixed; left: 1rem; top: -6rem; z-index: 100; padding: .75rem 1rem; background: var(--color-base-100); color: var(--color-base-content); border: 2px solid var(--color-primary); }
.skip-link:focus { top: 1rem; }
.nav-current { color: var(--color-base-content); background: var(--color-base-200); font-weight: 600; }
@media (max-width: 767px) {
    .blog-frame header :is(button, a[aria-label], summary) { min-width: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

a,
button {
    transition: all 0.15s ease;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Public footer ── */

.footer-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--color-base-300);
    border-radius: 50%;
    background: var(--color-base-100);
    color: color-mix(in srgb, var(--color-base-content) 70%, transparent);
    transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.footer-social:hover {
    color: var(--color-primary);
    border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-base-300));
    background: color-mix(in srgb, var(--color-primary) 7%, var(--color-base-100));
}

.footer-social-icon {
    width: 19px;
    height: 19px;
    background: currentColor;
    mask: var(--social-icon) center / contain no-repeat;
}

.footer-nav-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    width: fit-content;
    max-width: 100%;
    overflow-wrap: anywhere;
    color: color-mix(in srgb, var(--color-base-content) 65%, transparent);
    text-underline-offset: 4px;
}

.footer-nav-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.site-footer .nav-current {
    color: var(--color-base-content);
    background: transparent;
}

/* ── Admin shell ──
   Layered radial glows (azure top-left, indigo top-right) over a subtly
   darkened base give the dashboard depth without a flat single fill. */

.admin-shell {
    min-height: 100vh;
    background:
        radial-gradient(
            1200px 600px at 10% -10%,
            color-mix(in srgb, var(--color-primary) 16%, transparent),
            transparent 60%
        ),
        radial-gradient(
            900px 500px at 110% 0%,
            color-mix(in srgb, var(--color-secondary) 12%, transparent),
            transparent 55%
        ),
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--color-base-100) 92%, black 8%),
            var(--color-base-100)
        );
}

.admin-shell .drawer-content {
    background: transparent;
}

/* Glass sidebar + mobile navbar */
.glass-panel {
    background: color-mix(in srgb, var(--color-base-200) 92%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.admin-shell .drawer-side > aside {
    background: color-mix(in srgb, var(--color-base-200) 95%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

/* ── Nav links ── */

.nav-link {
    border-radius: 0.75rem;
    padding: 0.6rem 0.75rem;
    gap: 0.6rem;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.nav-link:hover {
    background: color-mix(in srgb, var(--color-base-300) 60%, transparent);
}

.nav-link.active {
    background: color-mix(
        in srgb,
        var(--color-base-300) 78%,
        var(--color-primary) 22%
    );
    box-shadow: inset 0 0 0 1px
        color-mix(in srgb, var(--color-primary) 35%, transparent);
    color: var(--color-base-content);
}

/* ── Cards ──
   `.card-elevated` is the resting surface (border + soft shadow). The lift on
   hover is handled by `.card-hover` in tailwind.css so the two never fight. */

.card-elevated {
    border-radius: 1rem;
    border: 1px solid
        color-mix(in srgb, var(--color-base-300) 70%, transparent);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.03),
        0 8px 22px rgba(0, 0, 0, 0.14);
}

/* ── Buttons ── */

.btn-strong {
    box-shadow: 0 8px 18px
        color-mix(in srgb, var(--color-primary) 22%, transparent);
    border: 1px solid
        color-mix(in srgb, var(--color-primary) 70%, transparent);
}

.btn-strong:hover {
    transform: translateY(-1px);
}

/* ── Docs cards: feature-card style ── */

.docs-shell .not-prose > div[class*="bg-base-300"] {
    background: color-mix(in srgb, var(--color-base-200) 96%, transparent);
    border: 1px solid
        color-mix(in srgb, var(--color-base-300) 70%, transparent);
    border-radius: 14px;
    padding: 0;
    transition:
        border-color 0.25s,
        transform 0.25s,
        box-shadow 0.25s;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.03),
        0 8px 22px rgba(0, 0, 0, 0.12);
}

.docs-shell .not-prose > div[class*="bg-base-300"]:hover {
    border-color: color-mix(
        in srgb,
        var(--color-primary) 35%,
        var(--color-base-300) 65%
    );
    transform: translateY(-2px);
    box-shadow:
        0 2px 0 rgba(255, 255, 255, 0.04),
        0 14px 30px rgba(0, 0, 0, 0.2);
}

/* ── Modals ── */

.modal .modal-box.modal-polished {
    border-radius: 1rem;
    border: 1px solid
        color-mix(in srgb, var(--color-base-300) 70%, transparent);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.modal-backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ── Tables ── */

.table-wrap {
    border-radius: 1rem;
    border: 1px solid
        color-mix(in srgb, var(--color-base-300) 70%, transparent);
    background: color-mix(in srgb, var(--color-base-200) 96%, transparent);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.table-polished thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: color-mix(in srgb, var(--color-base-200) 96%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.table-polished tbody tr {
    transition:
        background 160ms ease,
        box-shadow 160ms ease;
}

.table-polished tbody tr:hover {
    background: color-mix(
        in srgb,
        var(--color-base-200) 85%,
        var(--color-primary) 15%
    );
    box-shadow: inset 3px 0 0 var(--color-primary);
}

/* ── Admin content list ──
   One surface with hairline-divided rows, not a stack of separate cards.
   Rows tint toward the primary on hover with an inset accent bar (matching
   .table-polished); per-row actions reveal on hover or keyboard focus, and
   stay visible on touch screens, where there is no hover to reveal them. */

.list-surface {
    border-radius: 1rem;
    border: 1px solid
        color-mix(in srgb, var(--color-base-300) 70%, transparent);
    background: color-mix(in srgb, var(--color-base-200) 96%, transparent);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.03),
        0 8px 22px rgba(0, 0, 0, 0.14);
    overflow: hidden;
}

.content-row {
    transition:
        background 160ms ease,
        box-shadow 160ms ease;
}

.content-row + .content-row {
    border-top: 1px solid
        color-mix(in srgb, var(--color-base-300) 45%, transparent);
}

.content-row:hover {
    background: color-mix(in srgb, var(--color-primary) 6%, transparent);
    box-shadow: inset 2px 0 0 var(--color-primary);
}

.row-actions {
    opacity: 0;
    transform: translateX(4px);
    transition:
        opacity 160ms ease,
        transform 160ms ease;
}

.content-row:hover .row-actions,
.content-row:focus-within .row-actions,
.row-actions.row-actions-open {
    opacity: 1;
    transform: none;
}

@media (hover: none) and (pointer: coarse) {
    .row-actions {
        opacity: 1;
        transform: none;
    }
}

/* ── Empty state ── */

.empty-state {
    border-radius: 1.5rem;
    border: 1px dashed
        color-mix(in srgb, var(--color-base-300) 70%, transparent);
    background:
        radial-gradient(
            400px 120px at 50% -30%,
            color-mix(in srgb, var(--color-primary) 16%, transparent),
            transparent 60%
        ),
        color-mix(in srgb, var(--color-base-200) 96%, transparent);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
}


/* Compact article sharing, with comfortable targets on touch screens. */
.article-share-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    min-height: 44px;
    padding: 0 .25rem;
    font-size: .875rem;
    font-weight: 500;
    color: color-mix(in srgb, var(--color-base-content) 75%, transparent);
    cursor: pointer;
}
.article-share-control:hover {
    color: var(--color-base-content);
    text-decoration: underline;
    text-underline-offset: 4px;
}
.article-share-control:disabled {
    opacity: .45;
    cursor: default;
}

/* Topcoat theme toggle: both icons ship, the theme picks one (no script needed
   to draw the right one on first paint). */
[data-theme-toggle] .theme-icon-dark { display: none; }
[data-theme="dark"] [data-theme-toggle] .theme-icon-dark { display: inline-block; }
[data-theme="dark"] [data-theme-toggle] .theme-icon-light { display: none; }
