/* ---------------------------------------------------------
   Material Symbols helper
   Usage: <span class="material-symbols-rounded">favorite</span>
--------------------------------------------------------- */
.material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.material-symbols-rounded.filled {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ---------------------------------------------------------
   Bottom navigation
   Only shown when launched as an installed PWA (standalone)
   on small screens. In a normal browser tab it stays hidden
   so the page behaves like a regular responsive website.
--------------------------------------------------------- */
.pwa-bottom-nav {
    display: none;
}
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
    .pwa-bottom-nav {
        display: flex;
    }
    body {
        padding-bottom: calc(90px + env(safe-area-inset-bottom));
    }
}
/* Fallback class toggled by JS for browsers/devices that
   don't report display-mode reliably (some Android TWAs) */
body.is-pwa .pwa-bottom-nav {
    display: flex;
}
body.is-pwa {
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
}

/* Explicit, defensive layout rules — don't rely solely on Tailwind
   utility class cascade order for this fixed-position bar, since
   some PWA webviews (notably some Android TWAs) apply/inherit
   utility classes inconsistently. */
.pwa-bottom-nav {
    align-items: stretch;
    overflow: hidden; /* hard safety net: nothing can visually spill out of the bar */
    box-sizing: border-box;
}
.pwa-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-width: 0;
}
.pwa-bottom-nav .material-symbols-rounded {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}
.pwa-bottom-nav .nav-label {
    font-size: 11px;
    line-height: 1.2;
    flex-shrink: 0;
}

/* ---------------------------------------------------------
   Floating "Generate" button (.nav-fab)

   The circle is deliberately drawn *outside* the bar, so the
   overflow:hidden safety net above has to be lifted for it —
   scoped to .has-fab (set in bottom-nav.php) and to the FAB's
   own anchor, so every other bottom-nav variant keeps it.
   The white ring around the circle fakes a notch in the bar
   without needing an SVG mask.
--------------------------------------------------------- */
.pwa-bottom-nav.has-fab {
    overflow: visible;
}
.pwa-bottom-nav .nav-fab {
    position: relative;
    overflow: visible;
    justify-content: center;
}
/* 64px box = 52px gradient disc + a 6px white ring on each side. The ring
   is a border rather than an outline so it paints *over* the bar's top
   border, which is what reads as a notch cut into the bar. box-sizing is
   border-box here (global reset), so width includes the ring. */
.pwa-bottom-nav .nav-fab-circle {
    position: absolute;
    left: 50%;
    top: -14px; /* lifts the disc's centre onto the other icons' baseline */
    transform: translateX(-50%);
    width: 64px;
    height: 64px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg,
                #38bdf8 0%,
                var(--color-brand-600, #5046e5) 52%,
                #a855f7 100%);
    color: #fff;
    border: 6px solid #fff;
    box-shadow: 0 6px 18px rgba(80, 70, 229, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pwa-bottom-nav .nav-fab .material-symbols-rounded {
    font-size: 28px;
    color: #fff;
}
.pwa-bottom-nav .nav-fab:active .nav-fab-circle {
    transform: translateX(-50%) scale(0.93);
}
.pwa-bottom-nav .nav-fab.is-active .nav-fab-circle {
    box-shadow: 0 0 0 4px rgba(80, 70, 229, 0.18),
                0 6px 18px rgba(80, 70, 229, 0.45);
}

/* ---------------------------------------------------------
   Copy toast
--------------------------------------------------------- */
#copy-toast {
    position: fixed;
    bottom: calc(110px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 60;
}
#copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------------------------------------------------------
   Heart "pop" animation when favorited
--------------------------------------------------------- */
@keyframes heart-pop {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.35); }
    100% { transform: scale(1); }
}
.heart-pop {
    animation: heart-pop .35s ease;
}

/* Tap highlight removal for app-like feel */
button, a {
    -webkit-tap-highlight-color: transparent;
}

/* PIN input boxes */
.pin-input {
    width: 3rem;
    height: 3.5rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
}
.bg-yellow {
    background-color: #fdd10b;
}
/* ── Desktop header navigation ────────────────────────────────────────── */
.header-desktop-nav {
    display: none;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
}
@media (min-width: 640px) {
    .header-desktop-nav {
        display: flex;
    }
}
/* Hide the desktop header nav when running as an installed PWA — the
   bottom nav (above) takes over navigation duties there instead, so
   showing both at once would be redundant. Uses the same two detection
   methods as .pwa-bottom-nav: the standard display-mode media query,
   plus the JS-toggled body.is-pwa fallback class for devices/browsers
   that don't report display-mode reliably (e.g. some Android TWAs). */
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
    .header-desktop-nav {
        display: none !important;
    }
}
body.is-pwa .header-desktop-nav {
    display: none !important;
}

/* ---------------------------------------------------------
   Horizontal category slider — hide scrollbar, snap scroll
--------------------------------------------------------- */
.cat-scroll {
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}
.cat-scroll::-webkit-scrollbar {
    display: none;
}
.cat-chip {
    scroll-snap-align: start;
}

/* Clickable topic tag on a hook card (data-topic-id present) — filters the
   list to that topic. Plain CSS because hover:* Tailwind utilities aren't
   in the precompiled tailwind.css (no JIT build step on this host). */
.hook-topic-chip[data-topic-id] {
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
.hook-topic-chip[data-topic-id]:hover {
    background-color: var(--color-brand-100);
    color: var(--color-brand-700);
}