/**
 * NK Medic Events — Main Stylesheet
 * BEM naming convention, no Tailwind, no jQuery
 * Design reference: nk-events-design.jsx
 *
 * @package NK_Medic_Events
 * @version 1.0.0
 */

/* ─── Design Tokens ──────────────────────────────────────────────────────── */
:root {
    --nk-primary:        #2563eb;
    --nk-primary-dark:   #1d4ed8;
    --nk-primary-pale:   #eff6ff;
    --nk-dark:           #1a1a1a;
    --nk-navy:           #0a1628;
    --nk-card-light:     #f4f7fb;
    --nk-card-light-2:   #fafafa;
    --nk-text-heading:   #111827;
    --nk-text-body:      #4b5563;
    --nk-text-muted:     #9ca3af;
    --nk-border:         #e5e7eb;
    --nk-line-bg:        #00b900;
    --nk-radius-card:    2rem;
    --nk-radius-pill:    9999px;
    --nk-shadow-soft:    0 4px 25px -5px rgba(0, 0, 0, .05);
    --nk-shadow-hover:   0 12px 40px -10px rgba(0, 0, 0, .12);

    /* Tag Colors */
    --nk-tag-blue:   #2563eb;
    --nk-tag-sky:    #0284c7;
    --nk-tag-rose:   #be123c;
    --nk-tag-cyan:   #0891b2;
    --nk-tag-gray:   #6b7280;
    --nk-tag-amber:  #d97706;
    --nk-tag-green:  #16a34a;

    /* Hero */
    --nk-hero-bg:    #1a1a1a;
}

/* ─── Reset & Base ───────────────────────────────────────────────────────── */
.nk-events-wrap *,
.nk-events-wrap *::before,
.nk-events-wrap *::after {
    box-sizing: border-box;
    font-family: 'Prompt', system-ui, -apple-system, sans-serif;
}

.nk-single-event *,
.nk-single-event *::before,
.nk-single-event *::after {
    box-sizing: border-box;
    font-family: 'Prompt', system-ui, -apple-system, sans-serif;
}

/* ─── Wrapper ────────────────────────────────────────────────────────────── */
.nk-events-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    background: #f9fafb;
    min-height: 60vh;
}

/* ─── Hero Section ───────────────────────────────────────────────────────── */
.nk-events-hero {
    background: var(--nk-hero-bg);
    color: #fff;
    padding: 64px 0 80px;

    /* Full-width breakout — ทะลุผ่าน max-width container ของ theme และ plugin */
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.nk-events-hero__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.nk-events-hero__breadcrumb {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nk-events-hero__breadcrumb a {
    color: #6b7280;
    text-decoration: none;
}

.nk-events-hero__breadcrumb a:hover {
    color: #2563eb;
}

.nk-events-hero__content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

@media (min-width: 768px) {
    .nk-events-hero__content {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
}

.nk-events-hero__left {
    flex: 1;
}

/* Pulsing Badge */
.nk-events-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(37, 99, 235, 0.2);
    border: 1px solid rgba(37, 99, 235, 0.4);
    color: #60a5fa;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--nk-radius-pill);
    margin-bottom: 16px;
}

.nk-events-hero__badge-dot {
    width: 6px;
    height: 6px;
    background: #60a5fa;
    border-radius: 50%;
    animation: nkPulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.nk-events-hero__title {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.025em;
    color: #fff;
    margin: 0 0 12px;
}

.nk-events-hero__title .highlight {
    color: #60a5fa;
}

.nk-events-hero__subtitle {
    font-size: 14px;
    color: #9ca3af;
    font-weight: 300;
    line-height: 1.65;
    max-width: 440px;
    margin: 0;
}

/* Stats */
.nk-events-hero__stats {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}

.nk-events-hero__stat {
    text-align: center;
}

.nk-events-hero__stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.nk-events-hero__stat-label {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

.nk-events-hero__stat-divider {
    width: 1px;
    height: 40px;
    background: #374151;
    flex-shrink: 0;
}

/* ─── Controls Bar ───────────────────────────────────────────────────────── */
.nk-events-controls {
    padding: 24px 0 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 640px) {
    .nk-events-controls {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }
}

/* ─── Tab Switcher ───────────────────────────────────────────────────────── */
.nk-tab-switcher {
    display: inline-flex;
    background: #fff;
    border-radius: var(--nk-radius-pill);
    padding: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--nk-border);
    margin: -20px 0 16px; /* pull up into hero overlap */
}

.nk-tab-switcher__tab {
    padding: 10px 24px;
    border: none;
    background: transparent;
    border-radius: var(--nk-radius-pill);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Prompt', system-ui, sans-serif;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    outline: none;
}

.nk-tab-switcher__tab:hover {
    color: var(--nk-text-heading);
}

.nk-tab-switcher__tab:focus-visible {
    outline: 2px solid var(--nk-primary);
    outline-offset: 2px;
}

.nk-tab-switcher__tab--active {
    background: var(--nk-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.nk-tab-switcher__tab--active[data-type="past"] {
    background: var(--nk-dark);
}

/* ─── Year Filter ────────────────────────────────────────────────────────── */
.nk-year-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
    padding: 8px 0;
}

.nk-year-filter__btn {
    padding: 6px 16px;
    border-radius: var(--nk-radius-pill);
    border: 1px solid var(--nk-border);
    background: #fff;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Prompt', system-ui, sans-serif;
    color: var(--nk-text-body);
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.nk-year-filter__btn:hover {
    border-color: #9ca3af;
    color: var(--nk-text-heading);
}

.nk-year-filter__btn:focus-visible {
    outline: 2px solid var(--nk-primary);
    outline-offset: 2px;
}

.nk-year-filter__btn--active {
    background: var(--nk-dark);
    color: #fff;
    border-color: var(--nk-dark);
}

/* ─── Events Grid ────────────────────────────────────────────────────────── */
.nk-events-grid-section {
    padding: 8px 0 0;
}

.nk-events-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .nk-events-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .nk-events-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.nk-events-grid--upcoming {
    /* Inherits grid styles */
}

.nk-events-grid--past {
    background: var(--nk-card-light);
    border-radius: 16px;
    padding: 20px;
    margin: 0 -8px;
}

/* ─── Event Card (Shared) ────────────────────────────────────────────────── */
.nk-event-card {
    border-radius: var(--nk-radius-card);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--nk-shadow-soft);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    animation: nkFadeUp 0.5s ease-out both;
}

.nk-event-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--nk-shadow-hover);
}

/* Past cards use light bg */
.nk-event-card--past {
    background: var(--nk-card-light);
}

/* ─── Card Image ─────────────────────────────────────────────────────────── */
.nk-event-card__image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    flex-shrink: 0;
}

.nk-event-card__image--past {
    aspect-ratio: 16 / 10;
}

.nk-event-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.nk-event-card:hover .nk-event-card__image img {
    transform: scale(1.04);
}

/* Gradient overlay on images */
.nk-event-card__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 60%);
    pointer-events: none;
}

/* Image Placeholder (when no thumbnail) */
.nk-event-card__image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.nk-event-card__image-placeholder span {
    opacity: 0.35;
    font-size: 48px;
}

.nk-event-card__image-placeholder--blue {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
}

.nk-event-card__image-placeholder--sky {
    background: linear-gradient(135deg, #075985, #0ea5e9);
}

.nk-event-card__image-placeholder--rose {
    background: linear-gradient(135deg, #9f1239, #f43f5e);
}

.nk-event-card__image-placeholder--cyan {
    background: linear-gradient(135deg, #155e75, #22d3ee);
}

.nk-event-card__image-placeholder--gray {
    background: linear-gradient(135deg, #374151, #9ca3af);
}

/* Photos Count Badge */
.nk-event-card__photos-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.92);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--nk-radius-pill);
    z-index: 3;
    backdrop-filter: blur(4px);
}

/* End Date Pill */
.nk-event-card__end-date {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: var(--nk-radius-pill);
    z-index: 3;
    backdrop-filter: blur(4px);
}

/* ─── Status Badge ───────────────────────────────────────────────────────── */
.nk-status-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: var(--nk-radius-pill);
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    z-index: 3;
    line-height: 1.4;
}

.nk-status-badge--today {
    background: var(--nk-tag-green);
}

.nk-status-badge--soon {
    background: var(--nk-tag-amber);
}

.nk-status-badge--past {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.nk-status-badge--upcoming {
    background: var(--nk-primary);
}

.nk-status-badge--pulse {
    animation: nkPulse 2s ease-in-out infinite;
}

/* ─── Date Badge ─────────────────────────────────────────────────────────── */
.nk-date-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 4px 10px;
    min-width: 44px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Overlay Date Badge (in card image) */
.nk-date-badge--overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
}

.nk-date-badge__day {
    font-size: 18px;
    font-weight: 700;
    color: var(--nk-primary);
    line-height: 1.1;
}

.nk-date-badge__month {
    font-size: 10px;
    color: var(--nk-text-muted);
    font-weight: 500;
    line-height: 1.2;
}

.nk-date-badge__year {
    font-size: 10px;
    color: var(--nk-text-muted);
    line-height: 1.2;
}

/* ─── Tag Badge ──────────────────────────────────────────────────────────── */
.nk-tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--nk-radius-pill);
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    line-height: 1.4;
}

.nk-tag-badge--blue   { background: var(--nk-tag-blue); }
.nk-tag-badge--sky    { background: var(--nk-tag-sky); }
.nk-tag-badge--rose   { background: var(--nk-tag-rose); }
.nk-tag-badge--cyan   { background: var(--nk-tag-cyan); }
.nk-tag-badge--gray   { background: var(--nk-tag-gray); }
.nk-tag-badge--amber  { background: var(--nk-tag-amber); }
.nk-tag-badge--green  { background: var(--nk-tag-green); }

/* ─── Card Meta Row ──────────────────────────────────────────────────────── */
.nk-event-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px 0;
    flex-wrap: wrap;
}

.nk-event-card__date-text {
    font-size: 11px;
    color: var(--nk-text-muted);
    font-weight: 400;
}

/* ─── Card Title ─────────────────────────────────────────────────────────── */
.nk-event-card__title {
    padding: 8px 18px 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--nk-text-heading);
    line-height: 1.35;
    margin: 0;
}

.nk-event-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nk-event-card__title a:hover {
    color: var(--nk-primary);
}

/* ─── Card Location & Speaker ────────────────────────────────────────────── */
.nk-event-card__location,
.nk-event-card__speaker {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 4px 18px;
    font-size: 12px;
    color: var(--nk-text-muted);
    line-height: 1.45;
}

/* ─── Card Description ───────────────────────────────────────────────────── */
.nk-event-card__desc {
    padding: 4px 18px 12px;
    font-size: 12px;
    color: var(--nk-text-body);
    line-height: 1.65;
    margin: 0;
    /* Multi-line clamp (3 lines) */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Card Footer ────────────────────────────────────────────────────────── */
.nk-event-card__footer {
    padding: 12px 18px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--nk-border);
    margin-top: auto;
    gap: 8px;
}

.nk-event-card__cta {
    font-size: 12px;
    font-weight: 600;
    color: var(--nk-primary);
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 6px 0;
}

.nk-event-card__cta:hover {
    color: var(--nk-primary-dark);
}

.nk-event-card__cta--past {
    color: var(--nk-text-body);
}

.nk-event-card__cta--past:hover {
    color: var(--nk-primary);
}

.nk-event-card__ical {
    font-size: 20px;
    text-decoration: none;
    opacity: 0.55;
    transition: opacity 0.2s ease;
    line-height: 1;
    padding: 4px;
}

.nk-event-card__ical:hover {
    opacity: 1;
}

.nk-event-card__gallery-link {
    font-size: 12px;
    font-weight: 500;
    color: var(--nk-primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.nk-event-card__gallery-link:hover {
    opacity: 0.75;
}

/* ─── Skeleton Loader ────────────────────────────────────────────────────── */
.nk-skeleton {
    background: #fff;
    pointer-events: none;
    cursor: default;
}

.nk-skeleton__image {
    height: 180px;
    background: #e5e7eb;
    border-radius: 0;
    animation: nkSkeletonPulse 1.5s ease-in-out infinite;
}

.nk-skeleton__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px 0;
}

.nk-skeleton__tag {
    height: 22px;
    width: 80px;
    border-radius: var(--nk-radius-pill);
    background: #e5e7eb;
    animation: nkSkeletonPulse 1.5s ease-in-out infinite;
    animation-delay: 0.1s;
}

.nk-skeleton__date {
    height: 22px;
    width: 50px;
    border-radius: var(--nk-radius-pill);
    background: #e5e7eb;
    animation: nkSkeletonPulse 1.5s ease-in-out infinite;
    animation-delay: 0.15s;
}

.nk-skeleton__title {
    height: 18px;
    background: #e5e7eb;
    border-radius: 4px;
    margin: 10px 18px 0;
    animation: nkSkeletonPulse 1.5s ease-in-out infinite;
    animation-delay: 0.2s;
}

.nk-skeleton__title--short {
    width: 60%;
    margin-top: 6px;
    animation-delay: 0.25s;
}

.nk-skeleton__text {
    height: 14px;
    background: #e5e7eb;
    border-radius: 4px;
    margin: 10px 18px 0;
    animation: nkSkeletonPulse 1.5s ease-in-out infinite;
    animation-delay: 0.3s;
}

.nk-skeleton__footer {
    height: 36px;
    background: #e5e7eb;
    border-radius: 4px;
    margin: 16px 18px 18px;
    animation: nkSkeletonPulse 1.5s ease-in-out infinite;
    animation-delay: 0.35s;
}

/* ─── Load More ──────────────────────────────────────────────────────────── */
.nk-load-more-wrap {
    text-align: center;
    padding: 4px 0 4px;
}

.nk-load-more-btn {
    background: #fff;
    border: 2px solid var(--nk-primary);
    color: var(--nk-primary);
    padding: 12px 40px;
    border-radius: var(--nk-radius-pill);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Prompt', system-ui, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.nk-load-more-btn:hover {
    background: var(--nk-primary);
    color: #fff;
}

.nk-load-more-btn:focus-visible {
    outline: 2px solid var(--nk-primary);
    outline-offset: 2px;
}

.nk-load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─── Empty State ────────────────────────────────────────────────────────── */
.nk-empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--nk-text-muted);
    grid-column: 1 / -1;
}

.nk-empty-state__icon {
    font-size: 48px;
    margin-bottom: 16px;
    line-height: 1;
}

.nk-empty-state__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--nk-text-heading);
    margin: 0 0 8px;
}

.nk-empty-state__desc {
    font-size: 14px;
    color: var(--nk-text-muted);
    margin: 0;
    font-weight: 300;
}

/* ─── Error State ────────────────────────────────────────────────────────── */
.nk-error-state {
    text-align: center;
    padding: 48px 24px;
    grid-column: 1 / -1;
}

.nk-error-state__icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.nk-error-state__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--nk-text-heading);
    margin: 0 0 8px;
}

.nk-error-state__btn {
    margin-top: 16px;
    padding: 10px 28px;
    background: var(--nk-primary);
    color: #fff;
    border: none;
    border-radius: var(--nk-radius-pill);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Prompt', system-ui, sans-serif;
    cursor: pointer;
    transition: background 0.2s ease;
    outline: none;
}

.nk-error-state__btn:hover {
    background: var(--nk-primary-dark);
}

.nk-error-state__btn:focus-visible {
    outline: 2px solid var(--nk-primary);
    outline-offset: 2px;
}

/* ─── Single Event Page ──────────────────────────────────────────────────── */
.nk-single-event {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* Hero */
.nk-single-event__hero {
    position: relative;
    height: 420px;
    overflow: hidden;
    border-radius: 0 0 2rem 2rem;
    margin: 0 -24px 0;
}

@media (min-width: 768px) {
    .nk-single-event__hero {
        height: 520px;
    }
}

.nk-single-event__hero-img {
    width: 100%;
    height: 100%;
}

.nk-single-event__hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nk-single-event__hero-img--gradient {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nk-single-event__hero-icon {
    font-size: 80px;
    opacity: 0.3;
}

.nk-single-event__hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%);
    pointer-events: none;
}

.nk-single-event__hero-badges {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    z-index: 5;
}

.nk-single-event__hero-badges .nk-status-badge {
    position: static;
}

/* Content */
.nk-single-event__content {
    padding: 0;
}

.nk-single-event__inner {
    padding: 32px 0 0;
}

.nk-single-event__breadcrumb {
    margin-bottom: 20px;
}

.nk-single-event__back {
    font-size: 13px;
    color: var(--nk-text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.nk-single-event__back:hover {
    color: var(--nk-primary);
}

.nk-single-event__title {
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 700;
    color: var(--nk-text-heading);
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0 0 24px;
}

/* Meta Row */
.nk-single-event__meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--nk-card-light);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 32px;
    border: 1px solid var(--nk-border);
}

@media (min-width: 640px) {
    .nk-single-event__meta {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
    }
}

.nk-single-event__meta-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 180px;
}

.nk-single-event__meta-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1.4;
}

.nk-single-event__meta-label {
    display: block;
    font-size: 11px;
    color: var(--nk-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.nk-single-event__meta-value {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--nk-text-heading);
    line-height: 1.4;
}

/* Post Body Content */
.nk-single-event__body {
    font-size: 15px;
    line-height: 1.75;
    color: var(--nk-text-body);
    margin-bottom: 40px;
}

.nk-single-event__body h2,
.nk-single-event__body h3 {
    color: var(--nk-text-heading);
    font-weight: 600;
    margin-top: 1.5em;
}

.nk-single-event__body p {
    margin-bottom: 1em;
}

.nk-single-event__body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

/* Action Buttons */
.nk-single-event__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 24px;
    border-top: 1px solid var(--nk-border);
}

.nk-single-event__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    border-radius: var(--nk-radius-pill);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Prompt', system-ui, sans-serif;
    text-decoration: none;
    transition: all 0.2s ease;
    outline: none;
    cursor: pointer;
}

.nk-single-event__btn:focus-visible {
    outline: 2px solid var(--nk-primary);
    outline-offset: 2px;
}

.nk-single-event__btn--ical {
    background: var(--nk-primary-pale);
    color: var(--nk-primary);
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.nk-single-event__btn--ical:hover {
    background: var(--nk-primary);
    color: #fff;
}

.nk-single-event__btn--detail {
    background: var(--nk-primary);
    color: #fff;
}

.nk-single-event__btn--detail:hover {
    background: var(--nk-primary-dark);
}

.nk-single-event__btn--gallery {
    background: #fff;
    color: var(--nk-text-body);
    border: 1px solid var(--nk-border);
}

.nk-single-event__btn--gallery:hover {
    border-color: var(--nk-primary);
    color: var(--nk-primary);
}

.nk-single-event__photos-count {
    font-weight: 400;
    opacity: 0.75;
    font-size: 13px;
}

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes nkFadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes nkPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

@keyframes nkSkeletonPulse {
    0%, 100% { background-color: #e5e7eb; }
    50%       { background-color: #f3f4f6; }
}

/* ─── Print Styles ───────────────────────────────────────────────────────── */
@media print {
    .nk-tab-switcher,
    .nk-year-filter,
    .nk-load-more-btn,
    .nk-load-more-wrap,
    .nk-events-hero__badge,
    .nk-single-event__actions { display: none; }

    .nk-event-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

    .nk-events-hero {
        background: #f3f4f6;
        color: #111;
        padding: 24px 0;
    }

    .nk-events-hero__title,
    .nk-events-hero__title .highlight {
        color: #111;
    }
}

/* ─── Dark mode (respects system preference) ─────────────────────────────── */
@media (prefers-color-scheme: dark) {
    /* No forced dark mode — site controls its theme */
}

/* ─── Single Event — Content Section ────────────────────────────────────── */
.nk-event-content-section {
    margin-bottom: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--nk-border);
}

.nk-event-content-section__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--nk-text-heading);
    margin: 0 0 20px;
    letter-spacing: -0.015em;
}

/* ─── Single Event Hero — Video Embed ───────────────────────────────────── */

/* Hero container เมื่อเป็น video mode — ไม่ fixed height */
.nk-single-event__hero--video {
    height: auto;
    background: #000;
    border-radius: 0 0 2rem 2rem;
    overflow: hidden;
}

/* Badge bar เหนือ video (แทน absolute overlay) */
.nk-single-event__hero-badges--bar {
    position: static;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.nk-single-event__hero-badges--bar .nk-status-badge,
.nk-single-event__hero-badges--bar .nk-tag-badge {
    position: static;
}

/* Responsive 16:9 iframe wrapper */
.nk-single-event__hero-video-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16 : 9 */
    height: 0;
    overflow: hidden;
}

.nk-single-event__hero-video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ─── Hero Video — Click-to-Unmute Button (v1.0.4) ─────────────────────── */
.nk-hero-unmute {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 5;

    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 10px 18px;
    border: 0;
    border-radius: 999px; /* pill */

    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    font-family: 'Prompt', system-ui, -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;

    cursor: pointer;
    transition: opacity 0.3s ease, background 0.25s ease, transform 0.25s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.nk-hero-unmute:hover,
.nk-hero-unmute:focus-visible {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.05);
    outline: none;
}

.nk-hero-unmute:focus-visible {
    box-shadow: 0 0 0 2px var(--nk-primary);
}

.nk-hero-unmute__icon {
    font-size: 18px;
    line-height: 1;
    margin-right: 2px;
}

.nk-hero-unmute__text {
    font-size: 13px;
    font-weight: 500;
}

/* Hidden state — ใช้คู่กับ display:none (set โดย JS หลัง 320ms) */
.nk-hero-unmute--hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

/* Mobile — ขนาดเล็กลง + position ใกล้มุม */
@media (max-width: 768px) {
    .nk-hero-unmute {
        bottom: 12px;
        right: 12px;
        padding: 8px 14px;
    }

    .nk-hero-unmute__icon {
        font-size: 16px;
    }

    .nk-hero-unmute__text {
        font-size: 12px;
    }
}

/* Reduced motion — ปิด transition + transform animation */
@media (prefers-reduced-motion: reduce) {
    .nk-hero-unmute {
        transition: opacity 0.01ms linear;
    }

    .nk-hero-unmute:hover,
    .nk-hero-unmute:focus-visible {
        transform: none;
    }

    .nk-hero-unmute--hidden {
        transform: none;
    }
}

/* ─── Atmosphere Gallery ─────────────────────────────────────────────────── */
.nk-event-gallery-section {
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid var(--nk-border);
}

.nk-event-gallery-section__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--nk-text-heading);
    margin: 0 0 20px;
    letter-spacing: -0.015em;
}

.nk-event-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 480px) {
    .nk-event-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .nk-event-gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

.nk-event-gallery__item {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 12px;
    background: var(--nk-card-light);
}

.nk-event-gallery__item {
    cursor: pointer;
    outline: none;
}

.nk-event-gallery__item:focus-visible {
    outline: 2px solid var(--nk-primary);
    outline-offset: 2px;
}

.nk-event-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.nk-event-gallery__item:hover img {
    transform: scale(1.07);
}

/* ─── Lightbox ───────────────────────────────────────────────────────────── */

/* Backdrop + container */
.nk-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
}

.nk-lightbox[hidden] {
    display: none;
}

.nk-lightbox--open {
    opacity: 1;
    pointer-events: auto;
}

.nk-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 10, 0.93);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Close button */
.nk-lightbox__close {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9010;
    transition: background 0.2s ease;
    padding: 0;
    outline: none;
}

.nk-lightbox__close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.nk-lightbox__close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 3px;
}

/* Navigation arrows — hidden on mobile */
.nk-lightbox__nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9010;
    transition: background 0.2s ease;
    padding: 0;
    outline: none;
}

.nk-lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.nk-lightbox__nav:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 3px;
}

.nk-lightbox__nav--prev { left: 16px; }
.nk-lightbox__nav--next { right: 16px; }

@media (max-width: 640px) {
    /* ซ่อน arrows บน mobile — ใช้ swipe แทน */
    .nk-lightbox__nav { display: none; }
}

/* Image stage */
.nk-lightbox__stage {
    position: relative;
    z-index: 9005;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100vw;
    max-height: 85vh;
    padding: 60px 72px 80px;
}

@media (max-width: 640px) {
    .nk-lightbox__stage {
        padding: 56px 12px 88px;
    }
}

.nk-lightbox__img-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
}

.nk-lightbox__img {
    display: block;
    max-width: min(92vw, 1200px);
    max-height: 75vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.22s ease;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

@media (max-width: 640px) {
    .nk-lightbox__img {
        max-width: 100vw;
        border-radius: 0;
    }
}

.nk-lightbox__img--loaded {
    opacity: 1;
}

/* Spinner */
.nk-lightbox__loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.nk-lightbox__loader span {
    display: block;
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    animation: nkLbSpin 0.75s linear infinite;
}

.nk-lightbox__loader--hidden {
    display: none;
}

@keyframes nkLbSpin {
    to { transform: rotate(360deg); }
}

/* Bottom bar: dots + counter */
.nk-lightbox__bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 9010;
    pointer-events: none;
    /* safe area for iPhone home indicator */
    padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
}

/* Dot indicators */
.nk-lightbox__dots {
    display: flex;
    align-items: center;
    gap: 7px;
    pointer-events: auto;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90vw;
}

.nk-lightbox__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, width 0.2s ease;
    outline: none;
    flex-shrink: 0;
}

.nk-lightbox__dot:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

.nk-lightbox__dot--active {
    background: #fff;
    width: 20px;
    border-radius: 99px;
}

/* Counter */
.nk-lightbox__counter {
    font-size: 12px;
    font-weight: 400;
    font-family: 'Prompt', system-ui, sans-serif;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.04em;
    pointer-events: none;
}

/* ─── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .nk-event-card,
    .nk-event-card__image img,
    .nk-tab-switcher__tab,
    .nk-load-more-btn,
    .nk-status-badge--pulse,
    .nk-events-hero__badge-dot,
    .nk-lightbox,
    .nk-lightbox__img,
    .nk-lightbox__dot,
    .nk-lightbox__loader span { animation: none !important; transition: none !important; }
}

/* ─── Dual-Section Layout (both mode — no tab switcher) ─────────────────── */

/**
 * Used when archive-events.php renders in 'both' mode:
 * Two sections stacked vertically — upcoming on top, past below.
 * Each section has its own grid and load-more button.
 */
.nk-events-dual-section {
    padding: 56px 0 48px;
}

.nk-events-dual-section + .nk-events-dual-section {
    border-top: 1px solid var(--nk-border);
}

.nk-events-dual-section--past {
    background: var(--nk-card-light-2);
}

/* Section header row: title + year filter side by side */
.nk-events-dual-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
    padding: 0 var(--nk-gutter, 24px);
    max-width: var(--nk-max-w, 1200px);
    margin-left: auto;
    margin-right: auto;
}

.nk-events-dual-section__title {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 700;
    color: var(--nk-text-heading);
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.2;
}

/* Year filter in dual-section sits inline with title */
.nk-events-dual-section__head .nk-year-filter {
    margin: 0;
}

/* Load-more button in dual sections gets its own spacing */
.nk-events-dual-section .nk-load-more-wrap {
    padding-top: 32px;
}

@media (max-width: 640px) {
    .nk-events-dual-section {
        padding: 40px 0 32px;
    }
    .nk-events-dual-section__head {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 24px;
    }
    .nk-events-dual-section__title {
        font-size: 20px;
    }
}
