/* Notes Hub — Bookmark styles (isolated so they can't break the main theme) */

.goppo-bookmark-wrap {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 22px;
}

.goppo-bookmark-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 11px;
    border: 1px solid var(--nh-border);
    background: var(--nh-bg);
    color: var(--nh-text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s var(--nh-ease), border-color .15s var(--nh-ease),
                color .15s var(--nh-ease), transform .1s var(--nh-ease), opacity .15s var(--nh-ease);
}
.goppo-bookmark-btn:hover {
    border-color: var(--nh-primary);
    color: var(--nh-primary);
    background: var(--nh-primary-softer);
}
.goppo-bookmark-btn:active { transform: scale(.97); }

/*
 * BUGFIX: :disabled previously only set `cursor: default`, giving users no
 * visual feedback that their click was registering. Every other button in
 * the theme dims via opacity while waiting. Mirror that convention and use
 * a semantically appropriate cursor.
 */
.goppo-bookmark-btn:disabled {
    cursor: progress;
    opacity: .6;
    transform: none;
}
.goppo-bookmark-btn:disabled:hover {
    /* Suppress hover border/color while disabled */
    border-color: var(--nh-border);
    color: var(--nh-text);
    background: var(--nh-bg);
}

.goppo-bookmark-btn .dashicons {
    font-size: 18px; width: 18px; height: 18px; line-height: 18px;
}
.goppo-bookmark-btn.is-saved {
    background: var(--nh-primary-soft);
    border-color: var(--nh-primary);
    color: var(--nh-primary);
}
.goppo-bookmark-login { text-decoration: none; }
.goppo-bookmark-btn:focus-visible {
    outline: 2px solid var(--nh-primary); outline-offset: 2px;
}

.goppo-bookmarks-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 20px;
}
.goppo-bookmark-item {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--nh-bg);
    border: 1px solid var(--nh-border);
    border-radius: var(--nh-radius);
    overflow: hidden;
    transition: transform .25s var(--nh-ease-out), box-shadow .25s var(--nh-ease),
                border-color .25s var(--nh-ease);
}
.goppo-bookmark-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--nh-shadow-lg);
    border-color: color-mix(in srgb, var(--nh-primary) 30%, var(--nh-border));
}
.goppo-bookmark-link {
    display: flex; flex-direction: column; flex: 1;
    color: var(--nh-text); text-decoration: none;
}
.goppo-bookmark-thumb {
    aspect-ratio: 16 / 9; overflow: hidden; background: var(--nh-bg-tint);
}
.goppo-bookmark-thumb img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .5s var(--nh-ease-out);
}
.goppo-bookmark-item:hover .goppo-bookmark-thumb img { transform: scale(1.05); }
.goppo-bookmark-body {
    padding: 18px 20px 22px; flex: 1;
    display: flex; flex-direction: column; gap: 8px;
}
.goppo-bookmark-body h3 {
    font-size: 16px; line-height: 1.35; margin: 0;
    letter-spacing: -0.02em; color: var(--nh-text);
}
.goppo-bookmark-body p {
    margin: 0; font-size: 13.5px; line-height: 1.6;
    color: var(--nh-text-muted); flex: 1;
}
.goppo-bookmark-body small {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .4px; color: var(--nh-text-faint);
}

.goppo-bookmark-remove {
    position: absolute; top: 10px; right: 10px;
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--nh-border);
    border-radius: 9px;
    color: var(--nh-text-muted);
    font-size: 14px; font-weight: 800; line-height: 1;
    cursor: pointer; padding: 0;
    transition: background .15s var(--nh-ease), color .15s var(--nh-ease),
                border-color .15s var(--nh-ease);
}
.goppo-bookmark-remove:hover {
    background: var(--nh-danger); border-color: var(--nh-danger); color: #fff;
}

/*
 * BUGFIX: the theme's global `:focus-visible { border-radius: 4px }` was
 * forcing the remove button's 9px radius down to 4px on keyboard focus,
 * snapping the outline to a smaller shape. Lock the radius back to 9px
 * when focused.
 */
.goppo-bookmark-remove:focus-visible {
    border-radius: 9px;
}

/*
 * BUGFIX: the previous rule only handled `html.nh-dark` (the manual theme
 * toggle). It missed `body.noteshub-dark-default`, which is the class the
 * theme adds when the admin sets "Default to dark mode" in the Customizer.
 * Users on that default saw a light remove button on a dark bookmark card.
 *
 * Combined into one block with both selectors, matching the convention
 * used by theme.css and the other custom stylesheets in this theme.
 */
html.nh-dark .goppo-bookmark-remove,
body.noteshub-dark-default .goppo-bookmark-remove {
    background: rgba(15, 23, 42, .85);
}

/*
 * NOTE ON .goppo-empty:
 * This class is a SHARED empty-state style and is also defined in the
 * series and community-hub stylesheets with different padding and font
 * sizes. Keeping a third definition here means whichever stylesheet loads
 * last wins, so the empty state renders inconsistently depending on
 * context. Recommend moving the canonical rule to theme.css.
 *
 * For now, this file scopes its variant to its own context so it doesn't
 * compete with the other two.
 */
.goppo-bookmark-empty {
    text-align: center;
    padding: clamp(40px, 6vw, 64px) 20px;
    background: var(--nh-bg-soft);
    border: 2px dashed var(--nh-border);
    border-radius: var(--nh-radius);
    color: var(--nh-text-muted);
    font-size: 15px;
}

/*
 * Progress bar — used on scroll-progress indicators.
 *
 * Note: `transition: width` triggers layout on every frame. If you notice
 * jank during scroll on low-end devices, change the animation target to
 * `transform: scaleX()` and drive it from JS with a transform value
 * instead of a width percentage. Left as `width` here for backwards
 * compatibility with the existing JS that sets `.style.width`.
 */
#goppo-progress {
    position: fixed; top: 0; left: 0;
    height: 3px; width: 0;
    background: linear-gradient(90deg, var(--nh-primary), var(--nh-primary-2));
    z-index: 99999;
    transition: width .1s linear;
    pointer-events: none;
    box-shadow: 0 0 8px var(--nh-primary-glow);
}

@media (max-width: 900px) {
    .goppo-bookmark-wrap { margin-bottom: 16px; }
    .goppo-bookmark-btn { padding: 8px 14px; font-size: 12.5px; }
    .goppo-bookmarks-list { grid-template-columns: 1fr; gap: 14px; }
    .goppo-bookmark-body { padding: 16px 18px 18px; }
}

/*
 * BUGFIX: previous dark-mode block handled only `html.nh-dark`. Added
 * `body.noteshub-dark-default` for the default-dark case.
 */
html.nh-dark .goppo-bookmark-btn,
body.noteshub-dark-default .goppo-bookmark-btn {
    background: var(--nh-bg-soft);
}

html.nh-dark .goppo-bookmark-btn.is-saved,
body.noteshub-dark-default .goppo-bookmark-btn.is-saved {
    background: var(--nh-primary-soft);
}

html.nh-dark .goppo-bookmark-item,
body.noteshub-dark-default .goppo-bookmark-item {
    background: var(--nh-bg-soft);
}

/* ═══════════════════════════════════════════════════════════════
   Print — hide transient bookmark UI
   BUGFIX: previously missing. The bookmark button and remove icon
   are interactive chrome with no print value.
   ═══════════════════════════════════════════════════════════════ */

@media print {
    .goppo-bookmark-wrap,
    .goppo-bookmark-remove,
    #goppo-progress {
        display: none !important;
    }
}