/**
 * Cosmic Echoes V2 — Public Page Styles
 *
 * Styles for the frontend Cosmic Page template.
 * Matches the original Cosmic Echoes visual design.
 */

/* ── Reset & Base ───────────────────────────────────────────────────────── */

* { box-sizing: border-box; }

.ce-page-body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background: linear-gradient(90deg, rgba(26,26,46,1) 0%, rgba(22,33,62,1) 100%);
    color: #e0e0e0;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ── CSS Variables (from theme) ──────────────────────────────────────────── */

:root {
    --color-gold:            #FFD166;
    --color-gold-dim:        rgba(255, 209, 102, 0.6);
    --color-gold-subtle:     rgba(255, 209, 102, 0.12);
    --color-blue:            #008ED8;
    --color-blue-dim:        rgba(0, 142, 216, 0.5);
    --color-blue-subtle:     rgba(0, 142, 216, 0.1);
    --color-text-primary:    #CCCCCC;
    --color-text-muted:      #888899;
    --color-bg-primary:      #01021B;
    --font-heading:          'Cinzel', serif;
    --font-body:             'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:             'Share Tech Mono', 'Courier New', monospace;
    --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
    --space-5: 1.5rem; --space-6: 2rem; --space-7: 3rem; --space-8: 4rem;
    --radius-sm: 4px; --radius-md: 8px;
    --z-nav: 1000;
    --container-2xl: 1400px;
}

/* ── Site Header (glassmorphic, sticky) ─────────────────────────────────── */

.gf-site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-nav);
    width: 100%;
    background: rgba(1, 2, 27, 0.35);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid rgba(255, 209, 102, 0.1);
    box-shadow: 0 2px 40px rgba(0, 0, 0, 0.4);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    overflow: visible;
}
.gf-site-header.is-scrolled {
    background: rgba(1, 2, 27, 0.88);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border-bottom-color: rgba(255, 209, 102, 0.22);
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,209,102,0.06) inset;
}
.admin-bar .gf-site-header { top: 32px; }
@media screen and (max-width: 782px) { .admin-bar .gf-site-header { top: 46px; } }

.gf-header-container { position: relative; }

.gf-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    height: 72px;
    padding: 0 var(--space-6);
    max-width: var(--container-2xl);
    margin: 0 auto;
    position: relative;
}

.gf-site-header::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255,209,102,0.35) 40%, rgba(0,142,216,0.25) 60%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s;
}
.gf-site-header:hover::after,
.gf-site-header.is-scrolled::after { opacity: 1; }

/* ── Brand (logo + text) ────────────────────────────────────────────────── */

.gf-brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none !important; flex-shrink: 0; }
.gf-brand__symbol { width: 52px; height: auto; object-fit: contain; filter: drop-shadow(0 0 8px rgba(255,209,102,0.4)); transition: filter 0.3s ease, transform 0.3s ease; }
.gf-brand:hover .gf-brand__symbol { filter: drop-shadow(0 0 18px rgba(255,209,102,0.75)); transform: rotate(-5deg) scale(1.07); }
.gf-brand__text { line-height: 1.25; }
.gf-brand__name { display: block; font-family: var(--font-heading); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.05em; color: var(--color-gold); text-transform: uppercase; transition: color 0.2s; }
.gf-brand__sub { display: block; font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--color-text-muted); }
@media (max-width: 480px) { .gf-brand__text { display: none; } }

/* ── Primary nav ────────────────────────────────────────────────────────── */

.gf-primary-nav { display: flex; align-items: center; }
.gf-nav-menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: var(--space-1); }
.gf-nav-menu > li { position: relative; }
.gf-menu-link { display: flex; align-items: center; gap: 6px; padding: 7px 13px; font-family: var(--font-body); font-size: 0.875rem; font-weight: 500; letter-spacing: 0.04em; color: rgba(204,204,204,0.9); text-decoration: none; border-radius: var(--radius-sm); border: 1px solid transparent; background: none; cursor: pointer; white-space: nowrap; transition: color 0.2s, background 0.2s, border-color 0.2s; }
.gf-menu-link i.nav-icon { font-size: 0.78rem; color: var(--color-blue); transition: color 0.2s, transform 0.2s; }
.gf-menu-link:hover, .gf-menu-link:focus-visible, .gf-nav-menu > li.gf-is-open > .gf-menu-link { color: var(--color-gold); background: rgba(255,209,102,0.07); border-color: rgba(255,209,102,0.18); }
.gf-menu-link:hover i.nav-icon, .gf-nav-menu > li.gf-is-open > .gf-menu-link i.nav-icon { color: var(--color-gold); transform: scale(1.15); }

/* Chevron / mega trigger */
i.gf-chevron { font-size: 0.62rem; color: rgba(136,136,153,0.7); margin-left: 2px; transition: transform 0.25s ease, color 0.2s; }
.gf-has-mega { position: static; display: flex; align-items: center; }
.gf-mega-trigger { display: inline-flex; align-items: center; justify-content: center; padding: 4px 6px; background: none; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.gf-mega-trigger:hover, .gf-mega-trigger:focus-visible { background: rgba(255,209,102,0.07); border-color: rgba(255,209,102,0.18); }
.gf-nav-menu > li.gf-is-open > .gf-mega-trigger i.gf-chevron { transform: rotate(180deg); color: var(--color-gold); }

/* ── Mega panel ─────────────────────────────────────────────────────────── */

.gf-mega-panel { position: fixed; top: 72px; left: 0; right: 0; width: 100%; background: rgba(7, 8, 28, 0.97); backdrop-filter: blur(28px) saturate(180%); border-top: 2px solid rgba(255,209,102,0.20); border-bottom: 1px solid rgba(255,209,102,0.08); box-shadow: 0 24px 64px rgba(0,0,0,0.85); z-index: 9990; padding: 16px 0 20px; max-height: calc(100vh - 80px); overflow-y: auto; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s; pointer-events: none; }
.admin-bar .gf-mega-panel { top: 104px; }
@media screen and (max-width: 782px) { .admin-bar .gf-mega-panel { top: 118px; } }
.gf-has-mega.gf-is-open > .gf-mega-panel { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.gf-mega-inner { max-width: var(--container-2xl); margin: 0 auto; padding: 0 32px; }
.gf-mega-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,209,102,0.12); }
.gf-mega-title { font-family: var(--font-heading); font-size: 1rem; color: var(--color-gold); letter-spacing: 0.1em; text-transform: uppercase; }
.gf-mega-title i { color: var(--color-blue); margin-right: 8px; }
.gf-mega-view-all { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; color: var(--color-blue); text-decoration: none; border: 1px solid rgba(0,142,216,0.3); border-radius: var(--radius-sm); padding: 5px 12px; transition: background 0.2s, border-color 0.2s, color 0.2s; }
.gf-mega-view-all:hover { background: rgba(0,142,216,0.14); border-color: var(--color-blue); color: #fff; }
.gf-mega-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
@media (max-width: 1400px) { .gf-mega-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 1100px) { .gf-mega-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px)  { .gf-mega-grid { grid-template-columns: repeat(3, 1fr); } }
.gf-mega-item { display: flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: var(--radius-sm); text-decoration: none; color: rgba(204,204,204,0.85); font-size: 0.78rem; border: 1px solid transparent; transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gf-mega-item:hover { background: rgba(255,209,102,0.07); border-color: rgba(255,209,102,0.14); color: var(--color-gold); transform: translateX(2px); }
.gf-mega-item__icon { width: 22px; height: 22px; border-radius: 50%; background: rgba(0,142,216,0.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.gf-mega-item__icon i { font-size: 0.58rem; color: var(--color-blue); }
.gf-mega-item:hover .gf-mega-item__icon { background: rgba(255,209,102,0.15); }
.gf-mega-item:hover .gf-mega-item__icon i { color: var(--color-gold); }

/* ── Search toggle + panel ──────────────────────────────────────────────── */

.gf-search-toggle { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; background: rgba(0,142,216,0.1); border: 1px solid rgba(0,142,216,0.25); border-radius: var(--radius-sm); color: var(--color-blue); font-size: 0.9rem; cursor: pointer; transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s; flex-shrink: 0; }
.gf-search-toggle:hover, .gf-search-toggle.is-active { background: rgba(0,142,216,0.22); border-color: var(--color-blue); color: #fff; transform: scale(1.05); }

.gf-search-panel { position: absolute; top: 100%; left: 0; width: 100%; padding: 16px 24px; background: rgba(7, 8, 28, 0.97); backdrop-filter: blur(24px) saturate(160%); border-top: 1px solid rgba(255,209,102,0.10); border-bottom: 1px solid rgba(255,209,102,0.10); box-shadow: 0 18px 48px rgba(0,0,0,0.75); z-index: calc(var(--z-nav) + 4); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity 0.25s, transform 0.25s, visibility 0.25s; pointer-events: none; }
.gf-search-panel.is-open { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.gf-search-panel__inner { max-width: 640px; margin: 0 auto; }
.gf-search-panel__label { display: block; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 8px; }
.gf-search-panel__form { display: flex; align-items: center; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,209,102,0.22); border-radius: var(--radius-md); overflow: hidden; transition: border-color 0.2s, box-shadow 0.2s; }
.gf-search-panel__form:focus-within { border-color: var(--color-gold); box-shadow: 0 0 0 3px rgba(255,209,102,0.12); }
.gf-search-panel__icon { padding: 0 16px; color: var(--color-gold); font-size: 1rem; flex-shrink: 0; pointer-events: none; }
.gf-search-panel__input { flex: 1; background: transparent; border: none; outline: none; padding: 13px 0; font-family: var(--font-body); font-size: 1rem; color: #fff; caret-color: var(--color-gold); }
.gf-search-panel__input::placeholder { color: rgba(136,136,153,0.65); }
.gf-search-panel__submit { border: none; background: var(--color-gold); color: var(--color-bg-primary); font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 13px 20px; cursor: pointer; flex-shrink: 0; transition: background 0.2s; }
.gf-search-panel__submit:hover { background: #ffe082; }

/* ── Header actions + hamburger ─────────────────────────────────────────── */

.gf-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.gf-hamburger { display: none; flex-direction: column; justify-content: space-around; width: 38px; height: 38px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-sm); padding: 8px; cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.gf-hamburger:hover { background: rgba(255,209,102,0.1); border-color: rgba(255,209,102,0.3); }
.gf-hamburger__bar { display: block; width: 100%; height: 2px; background: var(--color-text-primary); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.gf-hamburger.is-active .gf-hamburger__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.gf-hamburger.is-active .gf-hamburger__bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.gf-hamburger.is-active .gf-hamburger__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav (≤991px) ────────────────────────────────────────────────── */

@media (max-width: 991px) {
    .gf-hamburger { display: flex; }
    .gf-primary-nav { position: fixed; top: 0; right: 0; width: min(380px, 90vw); height: 100vh; height: 100dvh; background: rgba(7, 8, 28, 0.98); backdrop-filter: blur(30px); border-left: 1px solid rgba(255,209,102,0.15); box-shadow: -12px 0 60px rgba(0,0,0,0.8); flex-direction: column; align-items: flex-start; padding: 80px 20px 32px; overflow-y: auto; transform: translateX(100%); transition: transform 0.35s cubic-bezier(0.4,0,0.2,1); z-index: calc(var(--z-nav) + 20); }
    .gf-primary-nav.is-open { transform: translateX(0); }
    .gf-nav-menu { flex-direction: column; align-items: flex-start; width: 100%; gap: 2px; }
    .gf-nav-menu > li { width: 100%; }
    .gf-menu-link { width: 100%; justify-content: space-between; padding: 12px 16px; font-size: 0.95rem; border-radius: 0; border: none; border-bottom: 1px solid rgba(255,255,255,0.05); border-left: 3px solid transparent; }
    .gf-menu-link:hover, .gf-menu-link:focus-visible { border-left-color: var(--color-gold); background: rgba(255,209,102,0.05); }
    /* Mobile mega: accordion */
    .gf-has-mega { position: static; display: flex; flex-wrap: wrap; }
    .gf-has-mega > .gf-menu-link { flex: 1 1 auto; }
    .gf-mega-trigger { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.05); }
    .gf-mega-panel { position: static; opacity: 1; visibility: hidden; transform: none; width: 100%; background: rgba(0,0,0,0.25); backdrop-filter: none; border: none; border-radius: 0; box-shadow: none; padding: 8px 0; max-height: 0; overflow: hidden; transition: max-height 0.35s ease, visibility 0.35s; }
    .gf-has-mega.gf-is-open > .gf-mega-panel { max-height: 500px; visibility: visible; overflow-y: auto; }
    .gf-mega-grid { grid-template-columns: 1fr 1fr; }
    .gf-mega-inner { padding: 0 8px; }
}

/* Body overlay when mobile nav is open */
body.gf-nav-open .gf-site-header { z-index: calc(var(--z-nav) + 21); }
body.gf-nav-open::before { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: calc(var(--z-nav) + 19); backdrop-filter: blur(2px); }

/* ── Hero / Search Section ───────────────────────────────────────────────── */

.ce-hero-section {
    position: relative;
    background: linear-gradient(180deg, rgba(1,2,27,1) 0%, rgba(7,8,38,1) 40%, rgba(16,18,52,1) 100%);
    padding: 60px 0 50px;
    width: 100%;
    overflow: hidden;
    text-align: center;
}

/* Subtle radial glow behind hero content */
.ce-hero-bg-glow {
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(ellipse at center,
        rgba(0,142,216,0.12) 0%,
        rgba(255,209,102,0.06) 40%,
        transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.ce-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 820px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Small badge above the title */
.ce-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-gold);
    background: rgba(255,209,102,0.08);
    border: 1px solid rgba(255,209,102,0.18);
    border-radius: 20px;
    padding: 6px 18px;
    margin-bottom: 20px;
}
.ce-hero-badge i {
    font-size: 0.65rem;
    color: var(--color-blue);
}

.ce-hero-title {
    font-family: var(--font-heading);
    color: #fff;
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0 0 14px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
    text-transform: uppercase;
}

.ce-hero-description {
    color: rgba(204,204,204,0.8);
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 32px;
}

/* Hero Stats Row */
.ce-hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 0 auto 30px;
    padding: 12px 28px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,209,102,0.12);
    border-radius: 12px;
    max-width: 320px;
}
.ce-hero-stat {
    flex: 1;
    text-align: center;
    padding: 4px 16px;
}
.ce-hero-stat__number {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gold);
    line-height: 1.2;
}
.ce-hero-stat__label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(204,204,204,0.55);
    margin-top: 2px;
}
.ce-hero-stat-divider {
    width: 1px;
    height: 32px;
    background: rgba(255,209,102,0.15);
    flex-shrink: 0;
}

/* Bottom edge divider so hero melts into section gradients */
.ce-hero-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255,209,102,0.25) 30%, rgba(0,142,216,0.20) 70%, transparent 100%);
}

/* ── Search Input ───────────────────────────────────────────────────────── */

.ce-search-input-container {
    position: relative;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,209,102,0.18);
    border-radius: 12px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.ce-search-input-container:focus-within {
    border-color: rgba(255,209,102,0.35);
    box-shadow: 0 0 0 1px rgba(255,209,102,0.08), 0 4px 20px rgba(0,0,0,0.25);
    background: rgba(255,255,255,0.06);
}

/* Kill any browser / Bootstrap focus ring on the input itself */
.ce-search-input:focus,
.ce-search-input:focus-visible,
.ce-clear-search-btn:focus,
.ce-clear-search-btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
}

.ce-search-icon {
    padding: 0 0 0 18px;
    color: var(--color-gold-dim);
    font-size: 0.95rem;
    flex-shrink: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.ce-search-input {
    flex: 1;
    padding: 15px 14px;
    font-size: 1rem;
    font-family: var(--font-body);
    border: none;
    background: transparent;
    outline: none !important;
    color: #fff;
    caret-color: var(--color-gold);
    -webkit-appearance: none;
}

.ce-search-input::placeholder { color: rgba(136,136,153,0.6); }

.ce-clear-search-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    border-left: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,100,100,0.75);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 15px 18px;
    transition: color 0.2s, background 0.2s;
    border-radius: 0 12px 12px 0;
    opacity: 0;
    pointer-events: none;
}

.ce-clear-search-btn.show {
    opacity: 1;
    pointer-events: auto;
}

.ce-clear-search-btn:hover {
    color: #ff5252;
    background: rgba(255,80,80,0.08);
}

/* ── Search Results ────────────────────────────────────────────────────── */

.ce-search-results {
    margin-top: 20px;
}

.ce-search-results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 15px;
}

@media (min-width: 768px) {
    .ce-search-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .ce-search-results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.ce-search-result-item {
    border-radius: 8px;
    padding: 15px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    word-wrap: break-word;
    line-height: 1.4;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    position: relative;
    color: #000;
}

.ce-search-result-item:hover {
    background-color: #e2e6ea;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.ce-search-result-section {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 12px;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

.ce-search-result-content {
    line-height: 1.4;
    color: #000;
}

.ce-search-result-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 6px 0;
}

.ce-keyword-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    background: rgba(0,0,0,0.06);
    color: #777;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}
.ce-keyword-tag--match {
    background: rgba(255,209,102,0.3);
    color: #8a6600;
    font-weight: 600;
}

.ce-search-result-count {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #999;
    margin-top: auto;
    padding-top: 8px;
}
.ce-search-result-count i {
    margin-right: 3px;
    font-size: 0.65rem;
}

.ce-search-highlight {
    background: yellow;
    color: #000;
    padding: 2px 4px;
    border-radius: 2px;
}

.ce-search-no-results {
    text-align: center;
    color: rgba(255,255,255,0.7);
    padding: 20px;
}

/* ── Search Results Label (section/comment group headers) ───────────────── */

.ce-search-results-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-gold-dim);
    margin: 0 0 10px 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ce-search-results-label--comments {
    color: var(--color-blue-dim);
    margin-top: 20px;
}

/* ── Comment Results Block ───────────────────────────────────────────────── */

.ce-comment-results-block {
    margin-top: 4px;
}

.ce-comment-results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 768px) {
    .ce-comment-results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .ce-comment-results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.ce-comment-result-item {
    border-radius: 8px;
    padding: 14px 16px;
    background: rgba(0, 142, 216, 0.07);
    border: 1px solid rgba(0, 142, 216, 0.18);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 90px;
    word-break: break-word;
}

.ce-comment-result-item:hover {
    background: rgba(0, 142, 216, 0.14);
    border-color: rgba(0, 142, 216, 0.35);
    transform: translateY(-2px);
}

.ce-comment-result-section {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-blue-dim);
}

.ce-comment-result-content {
    font-size: 0.85rem;
    color: #ccc;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Match highlight inside comment content ──────────────────────────────── */

mark.ce-highlight {
    background: rgba(255, 209, 102, 0.35);
    color: #ffe066;
    border-radius: 2px;
    padding: 0 2px;
    font-style: normal;
}

/* ── Sections ───────────────────────────────────────────────────────────── */

.ce-section {
    width: 100%;
    padding: 0;
    scroll-margin-top: 126px;
}

.admin-bar .ce-section {
    scroll-margin-top: 158px;
}

@media screen and (max-width: 782px) {
    .admin-bar .ce-section {
        scroll-margin-top: 172px;
    }
}

.ce-section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

/* Section header bar (clickable — toggles expand/collapse) */
.ce-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 0;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s;
}
.ce-section-header:hover {
    opacity: 0.85;
}

.ce-section-header h2 {
    font-size: 1.6rem;
    font-weight: bold;
    margin: 0;
    padding: 0;
    text-align: left;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    flex: 1;
    min-width: 0;
}

.ce-section-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    margin-left: 16px;
}

.ce-section-count {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.ce-section-count i {
    margin-right: 5px;
    font-size: 0.7rem;
}

/* Read Article icon button */
.ce-read-article-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 142, 216, 0.15);
    border: 1px solid rgba(0, 142, 216, 0.3);
    color: var(--color-blue);
    font-size: 0.72rem;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.ce-read-article-btn:hover,
.ce-read-article-btn:focus-visible {
    background: rgba(0, 142, 216, 0.3);
    border-color: var(--color-blue);
    color: #fff;
    transform: scale(1.12);
}

.ce-section-chevron {
    color: rgba(255,255,255,0.45);
    font-size: 0.9rem;
    transition: transform 0.35s ease, color 0.2s;
}
.ce-section--expanded .ce-section-chevron {
    transform: rotate(180deg);
    color: var(--color-gold-dim);
}

/* Loading spinner while AJAX fetches comments */
.ce-section--loading .ce-section-chevron {
    animation: ceSpin 0.8s linear infinite;
}
@keyframes ceSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Collapsed sections — compact bar */
.ce-section--collapsed {
    cursor: pointer;
}

/* Expanded — comments grid slides in */
.ce-section--expanded .ce-comments-grid {
    padding-bottom: 30px;
    animation: ceSlideDown 0.4s ease-out;
}
@keyframes ceSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Comments Grid ──────────────────────────────────────────────────────── */

.ce-comments-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .ce-comments-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .ce-comments-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Comment Cards ──────────────────────────────────────────────────────── */

.ce-comment-block {
    border-radius: 8px;
    padding: 15px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.4;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    font-size: 14px;
    position: relative;
    width: 100%;
}

.ce-comment-block:hover {
    background-color: #e2e6ea;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.ce-comment-block:active {
    transform: translateY(-1px);
    transition: transform 0.05s ease;
}

.ce-comment-content {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    flex: 1;
}

/* Copy button (appears on hover) */
.ce-copy-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 5px 8px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.ce-comment-block:hover .ce-copy-btn { opacity: 1; }
.ce-copy-btn:hover { background: rgba(0,0,0,0.9); }

/* Copy success flash */
.ce-copy-success {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #4CAF50;
    color: #fff;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    pointer-events: none;
    animation: ceCopyFade 2s ease-in-out forwards;
}

@keyframes ceCopyFade {
    0% { opacity: 0; transform: translate(-50%,-50%) scale(0.8); }
    20% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%,-50%) scale(0.8); }
}

/* ── Lazy Section Skeleton Placeholders ─────────────────────────────────── */

.ce-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.ce-skeleton-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 24px;
    min-height: 120px;
}

.ce-skeleton-line {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 75%);
    background-size: 200% 100%;
    animation: ceSkeletonShimmer 1.5s ease-in-out infinite;
    margin-bottom: 12px;
}

.ce-skeleton-line.short {
    width: 60%;
}

@keyframes ceSkeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Floating Navigation Menu ───────────────────────────────────────────── */

.ce-floating-menu {
    position: fixed;
    bottom: 28px;
    right: 24px;
    z-index: 1000;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 40px;
    padding: 10px 12px;
    box-shadow:
        0 8px 32px rgba(0,0,0,0.4),
        0 0 20px rgba(70,130,255,0.25),
        inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.12);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.ce-section-select {
    background: linear-gradient(135deg, #2a2a3e, #3a3a5e);
    color: #fff;
    border: 2px solid rgba(70,130,255,0.35);
    border-radius: 24px;
    padding: 9px 32px 9px 14px;
    font-size: 13px;
    min-width: 210px;
    max-width: 260px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    cursor: pointer;
}

.ce-section-select:focus {
    border-color: rgba(70,130,255,0.85);
    box-shadow: 0 0 0 3px rgba(70,130,255,0.2);
    outline: none;
}

.ce-section-select option {
    background: #2a2a3e;
    color: #fff;
}

.ce-scroll-top-btn {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    flex-shrink: 0;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ce-scroll-top-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 14px rgba(76,175,80,0.45);
    background: linear-gradient(135deg, #5CBF60, #4CAF50);
}

/* ── No content ─────────────────────────────────────────────────────────── */

.ce-no-content {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.ce-page-footer {
    background: linear-gradient(90deg, rgba(26,26,46,1) 0%, rgba(22,33,62,1) 100%);
    color: rgba(255,255,255,0.8);
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.04);
    font-size: 14px;
}

.ce-page-footer p { margin: 0; }

/* Hide theme back-to-top button — plugin has its own in the floating nav */
.ce-page-body .gf-back-to-top,
.ce-page-body #gf-back-to-top {
    display: none !important;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .ce-hero-section { padding: 40px 0 36px; }
    .ce-hero-title { font-size: 1.8rem; }
    .ce-hero-description { font-size: 0.95rem; }
    .ce-hero-stats { max-width: 280px; padding: 10px 16px; }
    .ce-hero-stat__number { font-size: 1.2rem; }
    .ce-hero-stat { padding: 4px 10px; }

    .ce-section-header h2 { font-size: 1.3rem; }
    .ce-section-meta { gap: 10px; margin-left: 10px; }
    .ce-section-count { font-size: 0.65rem; }
    .ce-read-article-btn { width: 26px; height: 26px; font-size: 0.62rem; }

    .ce-search-input { font-size: 0.95rem; padding: 13px 12px; }
    .ce-clear-search-btn { padding: 13px 14px; font-size: 0.65rem; }

    .ce-section-inner { padding: 0 16px; }

    .ce-floating-menu {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        border-radius: 0;
        border-top: 1px solid rgba(70,130,255,0.25);
        border-bottom: none;
        border-left: none;
        border-right: none;
        padding: 10px 14px;
        gap: 10px;
        box-sizing: border-box;
        /* Ensure it never exceeds one line */
        flex-wrap: nowrap;
        align-items: center;
    }
    .ce-section-select {
        flex: 1 1 0;
        min-width: 0;
        max-width: none;
        font-size: 14px;
        padding: 10px 30px 10px 14px;
        border-radius: 10px;
    }
    .ce-scroll-top-btn {
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        font-size: 20px;
        border-radius: 50%;
    }

    /* Prevent footer content hiding behind the fixed bar */
    .ce-page-footer { padding-bottom: 80px; }
}

@media (max-width: 480px) {
    .ce-hero-title { font-size: 1.5rem; }
    .ce-hero-badge { font-size: 0.6rem; padding: 5px 14px; }
    .ce-search-icon { padding-left: 14px; }
    .ce-search-input { padding: 12px 10px; font-size: 0.9rem; }
    .ce-clear-search-btn { padding: 12px 12px; font-size: 0.6rem; }
}
