@layer vendor, init, reset, wp-base, wp-blocks, tng-base, tng-overrides, tng-critical, tng-debug;

@layer tng-base {
    :root {
        /* Named Stacking Context & Z-Index Tokens */
        --z-index-deep-void:     -999;
        --z-index-underlay:      -1;
        --z-index-map-canvas:    0;
        --z-index-base-flow:     1;
        --z-index-hud-backdrop:  9;
        --z-index-card-column:   10;
        --z-index-card-elevated: 15;
        --z-index-header-nav:    50;
        --z-index-dropdown:      100;
        --z-index-hud-controls:  1000;
        --z-index-modal:         10000;
        --z-index-overlay:       999999;
        --z-index-max:           2147483640;

        /* Light Sunlit Ivory Glass Tokens */
        --tng-glass-bg: rgba(255, 255, 255, 0.90);
        --tng-glass-bg-hud: rgba(253, 251, 247, 0.94);
        --tng-glass-backdrop: blur(20px) saturate(160%);
        --tng-glass-border: 1px solid rgba(255, 255, 255, 0.85);
        --tng-glass-border-subtle: 1px solid rgba(0, 0, 0, 0.06);
        --tng-accent-orange: #ea580c;
        --tng-accent-emerald: #059669;
        --tng-accent-purple: #7c3aed;
        --tng-text-main: #1e293b;
        --tng-text-title: #0f172a;
    }
}

@layer tng-overrides {
    /* Page Background for Events / Blog Archive */
    body.blog {
        background-color: #f8fafc !important;
        color: #334155 !important;
        position: relative;
        min-height: 100vh;
    }

    body.blog::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: url('/IMG_5539.avif') center top / cover no-repeat;
        z-index: var(--z-index-underlay, -1) !important;
        pointer-events: none;
        filter: brightness(1.02) saturate(105%);
    }

    body.blog .wp-site-blocks > main {
        max-width: 900px !important;
        margin: 30px auto 80px auto !important;
        padding: 0 16px !important;
        position: relative !important;
        z-index: var(--z-index-card-column, 10) !important;
    }

    /* Main Portal Container */
    .nwb-portal-wrap {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 24px;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", Meiryo, sans-serif;
        color: #334155;
        box-sizing: border-box;
        position: relative !important;
        z-index: var(--z-index-card-column, 10) !important;
    }

    /* Glassmorphism Card Container */
    .nwb-glass-card {
        background: var(--tng-glass-bg, rgba(255, 255, 255, 0.90));
        backdrop-filter: var(--tng-glass-backdrop, blur(20px) saturate(160%));
        -webkit-backdrop-filter: var(--tng-glass-backdrop, blur(20px) saturate(160%));
        border: var(--tng-glass-border, 1px solid rgba(255, 255, 255, 0.85));
        border-radius: 20px;
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08);
        overflow: hidden;
        transition: box-shadow 0.3s ease, border-color 0.3s ease;
        position: relative !important;
        z-index: var(--z-index-card-column, 10) !important;
    }

    .nwb-glass-card:hover {
        border-color: rgba(234, 88, 12, 0.3);
        box-shadow: 0 20px 48px rgba(0, 0, 0, 0.12);
    }

/* ==========================================================================
   Header & View Switcher
   ========================================================================== */
.nwb-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: #f8fafc;
}

.nwb-header-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nwb-header-icon {
    font-size: 24px;
    color: #ea580c;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nwb-header-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.02em;
}

.nwb-view-switcher {
    display: flex;
    background: #e2e8f0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 30px;
    padding: 3px;
    gap: 2px;
}

.nwb-view-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nwb-view-btn .material-symbols-outlined {
    font-size: 18px;
}

.nwb-view-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nwb-view-btn:hover:not(.active) {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.6);
}

/* ==========================================================================
   Filter Tabs Bar
   ========================================================================== */
.nwb-filter-tabs-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px 8px 20px;
    flex-wrap: wrap;
}

.nwb-filter-tabs-pill-box {
    display: inline-flex;
    background: #e2e8f0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 30px;
    padding: 4px;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.nwb-tab-pill {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nwb-tab-pill:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.6);
}

.nwb-tab-pill.active {
    background: #ffffff;
    color: #ea580c;
    border: 1px solid rgba(234, 88, 12, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   Events List & Accordion Items
   ========================================================================== */
.nwb-events-list {
    display: flex;
    flex-direction: column;
    padding: 12px 16px 16px 16px;
    gap: 10px;
}

.nwb-event-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    transition: all 0.25s ease;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.nwb-event-card:hover {
    background: #ffffff;
    border-color: rgba(234, 88, 12, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.08);
}

.nwb-event-card.is-expanded {
    background: #ffffff;
    border-color: #ea580c;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.nwb-event-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    gap: 14px;
    cursor: pointer;
    user-select: none;
}

.nwb-event-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

/* Date Badge Block */
.nwb-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    flex-shrink: 0;
}

.nwb-date-month {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.1;
    text-transform: uppercase;
}

.nwb-date-day {
    font-size: 1.25rem;
    font-weight: 800;
    color: #c084fc;
    line-height: 1;
}

.nwb-event-thumb-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e2e8f0;
    flex-shrink: 0;
    overflow: hidden;
}

.nwb-event-thumb-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nwb-event-meta-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    text-align: left;
}

.nwb-event-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.nwb-event-subline {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nwb-event-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

/* Countdown Pill */
.nwb-countdown-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.85);
    font-variant-numeric: tabular-nums;
}

.nwb-countdown-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: nwbPulse 1.8s infinite;
}

@keyframes nwbPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.nwb-chevron {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.3s ease;
}

.nwb-event-card.is-expanded .nwb-chevron {
    transform: rotate(180deg);
    color: #c084fc;
}

/* Accordion Drawer */
.nwb-event-drawer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    opacity: 0;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nwb-event-card.is-expanded .nwb-event-drawer {
    max-height: 800px;
    opacity: 1;
}

.nwb-drawer-content {
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 0.95rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
}

.nwb-drawer-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.nwb-drawer-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}

.nwb-drawer-meta-item .material-symbols-outlined {
    font-size: 18px;
    color: #c084fc;
}

.nwb-drawer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.nwb-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #ffffff !important;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
}

.nwb-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.6);
    color: #ffffff !important;
    text-decoration: none;
}

.nwb-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff !important;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.2s ease;
}

.nwb-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff !important;
    text-decoration: none;
}

/* ==========================================================================
   Interactive Calendar View
   ========================================================================== */
.nwb-calendar-wrap {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nwb-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nwb-cal-month-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
}

.nwb-cal-nav-btns {
    display: flex;
    gap: 8px;
}

.nwb-cal-nav-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.nwb-cal-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nwb-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.nwb-cal-head-cell {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    padding: 8px 0;
    text-transform: uppercase;
}

.nwb-cal-head-cell.sun { color: #f87171; }
.nwb-cal-head-cell.sat { color: #60a5fa; }

.nwb-cal-day-cell {
    min-height: 64px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nwb-cal-day-cell:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
}

.nwb-cal-day-cell.is-today {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

.nwb-cal-day-cell.other-month {
    opacity: 0.3;
}

.nwb-cal-day-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
}

.nwb-cal-event-dot {
    background: linear-gradient(135deg, #c084fc, #818cf8);
    color: #ffffff;
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* ==========================================================================
   Middle Search & Filter Section
   ========================================================================== */
.nwb-discovery-hub-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 4px 0;
}

.nwb-search-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.25s ease;
}

.nwb-search-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.nwb-search-drawer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    opacity: 0;
    width: 100%;
    max-width: 600px;
}

.nwb-search-drawer.is-open {
    max-height: 200px;
    opacity: 1;
}

.nwb-search-input-box {
    display: flex;
    gap: 8px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 8px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.nwb-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 0.95rem;
    outline: none;
}

.nwb-search-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

/* ==========================================================================
   Glowing Violet Pagination Pills
   ========================================================================== */
.nwb-pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px 0;
}

.nwb-page-pill {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.nwb-page-pill:hover:not(.active) {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.nwb-page-pill.active {
    background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
    border-color: #a78bfa !important;
    color: #ffffff !important;
    box-shadow: 0 0 18px rgba(139, 92, 246, 0.75), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    transform: scale(1.08);
}

/* ==========================================================================
   Bottom Box: Articles / Updates List
   ========================================================================== */
.nwb-articles-card {
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.nwb-articles-list {
    display: flex;
    flex-direction: column;
}

.nwb-article-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-decoration: none !important;
    color: inherit;
    transition: all 0.2s ease;
    gap: 16px;
}

.nwb-article-row:last-child {
    border-bottom: none;
}

.nwb-article-row:hover {
    background: rgba(255, 255, 255, 0.08);
    padding-left: 26px;
}

.nwb-article-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.nwb-article-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e2e8f0;
    flex-shrink: 0;
    overflow: hidden;
}

.nwb-article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nwb-article-title {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.nwb-article-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nwb-article-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 8px;
    border-radius: 6px;
}

.nwb-article-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    background: rgba(139, 92, 246, 0.3);
    border: 1px solid rgba(139, 92, 246, 0.5);
    padding: 3px 10px;
    border-radius: 12px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.nwb-article-arrow {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.4);
    transition: transform 0.2s ease, color 0.2s ease;
}

.nwb-article-row:hover .nwb-article-arrow {
    transform: translateX(4px);
    color: #c084fc;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nwb-card-header {
        padding: 14px 16px;
    }
    .nwb-event-header {
        padding: 12px 14px;
    }
    .nwb-article-row {
        padding: 14px 16px;
    }
    .nwb-event-subline {
        font-size: 0.75rem;
    }
    .nwb-countdown-badge {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}
}

