/* ==========================================================================
   FNSS Espace Membre - Styles
   Primary: #1863DC | Dark: #0f4a9e | Accent: #009899 | Light bg: #f0f5fd
   ========================================================================== */

/* ---------- Reset & Base ---------- */
.fnss-login-wrap,
.fnss-library,
.fnss-access-denied {
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a1a1a;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Buttons ---------- */
.fnss-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, box-shadow 0.2s;
    line-height: 1.4;
}
.fnss-btn-primary {
    background: #1863DC;
    color: #fff;
}
.fnss-btn-primary:hover {
    background: #0f4a9e;
    color: #fff;
}
.fnss-btn-secondary {
    background: #e8edf4;
    color: #1a1a1a;
}
.fnss-btn-secondary:hover {
    background: #d0d8e6;
    color: #1a1a1a;
}
.fnss-btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}
.fnss-btn-full {
    width: 100%;
    justify-content: center;
}

/* ---------- Login ---------- */
.fnss-login-wrap {
    max-width: 440px;
    margin: 40px auto;
    padding: 0 16px;
}
.fnss-login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 40px 36px;
}
.fnss-login-header {
    text-align: center;
    margin-bottom: 28px;
}
.fnss-login-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1863DC;
    margin: 0 0 8px;
}
.fnss-login-header p {
    font-size: 14px;
    color: #555;
    margin: 0;
}

/* Notices */
.fnss-notice {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 20px;
}
.fnss-notice--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.fnss-notice--success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Form */
.fnss-form-group {
    margin-bottom: 18px;
}
.fnss-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}
.fnss-form-group input[type="text"],
.fnss-form-group input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.fnss-form-group input:focus {
    outline: none;
    border-color: #1863DC;
    box-shadow: 0 0 0 3px rgba(24, 99, 220, 0.15);
}
.fnss-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
}
.fnss-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.fnss-checkbox input {
    accent-color: #1863DC;
}
.fnss-forgot-link {
    color: #1863DC;
    text-decoration: none;
    font-size: 13px;
}
.fnss-forgot-link:hover {
    text-decoration: underline;
}
.fnss-logged-in {
    text-align: center;
    font-size: 15px;
    margin-bottom: 20px;
}

/* Registration form 2-col row */
.fnss-form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.fnss-register-login-link {
    text-align: center;
    font-size: 14px;
    margin-top: 20px;
    color: #555;
}
.fnss-register-login-link a {
    color: #1863DC;
    text-decoration: none;
    font-weight: 600;
}
.fnss-register-login-link a:hover {
    text-decoration: underline;
}
.fnss-form-group input[type="email"],
.fnss-form-group input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.fnss-form-group small {
    color: #888;
    font-weight: 400;
}

/* ---------- Access Denied ---------- */
.fnss-access-denied {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 0 auto;
}
.fnss-access-denied h2 {
    color: #1863DC;
    margin-bottom: 12px;
}

/* ---------- Library: Full-width 2-column layout ---------- */
.fnss-library {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Top bar */
.fnss-library-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 24px 40px;
    background: #1863DC;
    color: #fff;
}
.fnss-library-topbar h1 {
    font-family: "Merriweather", Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #fff;
}
.fnss-library-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}
.fnss-library-user .fnss-btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.fnss-library-user .fnss-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Layout container */
.fnss-layout {
    display: flex;
    min-height: calc(100vh - 200px);
}

/* ---------- Sidebar ---------- */
.fnss-sidebar {
    width: 280px;
    min-width: 280px;
    background: #f8f9fb;
    border-right: 1px solid #e5e7eb;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.fnss-sidebar-toggle {
    display: none;
}
.fnss-sidebar-inner {
    padding: 24px 20px;
    position: sticky;
    top: 0;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
}
.fnss-sidebar-section {
    margin-bottom: 28px;
}
.fnss-sidebar-section:last-child {
    margin-bottom: 0;
}
.fnss-sidebar-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin: 0 0 10px;
    padding: 0 8px;
}

/* Search in sidebar */
.fnss-sidebar .fnss-search-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    background: #fff;
}
.fnss-sidebar .fnss-search-input:focus {
    outline: none;
    border-color: #1863DC;
    box-shadow: 0 0 0 3px rgba(24, 99, 220, 0.15);
}

/* Nav items (vertical list style) */
.fnss-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.fnss-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    text-align: left;
    line-height: 1.4;
}
.fnss-nav-item:hover {
    background: #e8edf4;
    color: #1863DC;
}
.fnss-nav-item.active {
    background: #1863DC;
    color: #fff;
}
.fnss-nav-item.active .fnss-nav-count {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}
.fnss-nav-item svg {
    flex-shrink: 0;
    opacity: 0.6;
}
.fnss-nav-item.active svg {
    opacity: 1;
}
.fnss-nav-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    background: #e5e7eb;
    color: #666;
    padding: 1px 7px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* ---------- Main content ---------- */
.fnss-main {
    flex: 1;
    padding: 24px 32px;
    min-width: 0;
}
.fnss-main-header {
    margin-bottom: 20px;
}

/* Results count */
.fnss-results-count {
    font-size: 13px;
    color: #777;
}

/* ---------- Grid ---------- */
.fnss-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.fnss-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #777;
}

/* ---------- Card ---------- */
.fnss-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.15s;
}
.fnss-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}
.fnss-card[style*="display: none"] {
    display: none !important;
}

/* Card icon / thumbnail */
.fnss-card-icon {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fb;
    overflow: hidden;
}
.fnss-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.fnss-icon {
    opacity: 0.8;
}

/* Card body */
.fnss-card-body {
    padding: 16px;
    flex: 1;
}
.fnss-card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 6px;
    color: #1a1a1a;
    line-height: 1.4;
}
.fnss-card-excerpt {
    font-size: 13px;
    color: #666;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.fnss-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.fnss-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #f0f5fd;
    color: #1863DC;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.fnss-size {
    font-size: 11px;
    color: #999;
}

/* Card actions */
.fnss-card-actions {
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
}
.fnss-card-actions .fnss-btn {
    flex: 1;
    justify-content: center;
    text-align: center;
}

/* No results */
.fnss-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #777;
    font-size: 15px;
}

/* ---------- Lightbox ---------- */
.fnss-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
}
.fnss-lightbox.active {
    display: flex;
}
.fnss-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
}
.fnss-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
    text-align: center;
}
.fnss-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
}
#fnss-lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}
.fnss-lightbox-caption {
    color: #fff;
    margin-top: 12px;
    font-size: 14px;
}

/* ---------- User bar (shortcode) ---------- */
.fnss-user-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}
.fnss-user-bar__name {
    color: #555;
}
.fnss-btn-outline {
    background: transparent;
    color: #1863DC;
    border: 1px solid #1863DC;
    padding: 6px 14px;
    font-size: 13px;
}
.fnss-btn-outline:hover {
    background: #1863DC;
    color: #fff;
}

/* ---------- Empty tab ---------- */
.fnss-empty-tab {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 15px;
}

/* ---------- Header Button ---------- */
.fnss-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s;
}
.fnss-header-btn--login {
    background: #1863DC;
    color: #fff;
}
.fnss-header-btn--login:hover {
    background: #0f4a9e;
    color: #fff;
}
.fnss-header-btn--member {
    background: #0f4a9e;
    color: #fff;
}
.fnss-header-btn--member:hover {
    background: #1863DC;
    color: #fff;
}

/* ---------- Search results hero title ---------- */
h1.fnss-search-title {
    font-family: "Merriweather", Georgia, serif;
    font-size: 34px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin: 0;
}

/* ---------- Mobile-only menu item (Espace membre in nav) ---------- */
.mainnav.nav li.fnss-mobile-only {
    display: none !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .fnss-layout {
        flex-direction: column;
    }
    .fnss-sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    .fnss-sidebar-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 14px 20px;
        border: none;
        background: #f8f9fb;
        font-size: 14px;
        font-weight: 600;
        color: #333;
        cursor: pointer;
    }
    .fnss-sidebar-inner {
        display: none;
        position: static;
        max-height: none;
    }
    .fnss-sidebar.open .fnss-sidebar-inner {
        display: block;
    }
    .fnss-main {
        padding: 20px 16px;
    }
    .fnss-library-topbar {
        padding: 20px 16px;
    }
}

@media (max-width: 600px) {
    .fnss-library-topbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .fnss-grid {
        grid-template-columns: 1fr;
    }
    .fnss-login-card {
        padding: 28px 20px;
    }
    .fnss-form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
