/* =====================================================================
   NDRS seminar pages — shared modern theme
   Light / Dark compatible via CSS custom properties.
   Theme resolution order:
     1. Explicit  <html data-theme="light|dark">  (set by toggle / backend)
     2. OS preference  @media (prefers-color-scheme: dark)
     3. Light default
   Brand accent keeps the historic teal (#009399 / #0E7C7B).
   ===================================================================== */

:root {
    --ndrs-bg:        #eef2f3;
    --ndrs-surface:   #ffffff;
    --ndrs-surface-2: #f5f8f9;
    --ndrs-text:      #1f2430;
    --ndrs-heading:   #11161f;
    --ndrs-muted:     #5b6472;
    --ndrs-accent:    #0E7C7B;
    --ndrs-accent-2:  #009399;
    --ndrs-accent-soft:#e6f4f3;
    --ndrs-title:     #2563a8;
    --ndrs-border:    #e2e8ea;
    --ndrs-border-strong:#cfd8da;
    --ndrs-shadow:    0 1px 2px rgba(16,32,40,.06), 0 8px 28px rgba(16,32,40,.07);
    --ndrs-shadow-sm: 0 1px 2px rgba(16,32,40,.05), 0 4px 14px rgba(16,32,40,.06);
    --ndrs-radius:    16px;
    --ndrs-radius-sm: 10px;
}

/* Dark via OS preference, only when the page hasn't forced a theme */
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        --ndrs-bg:        #0f1116;
        --ndrs-surface:   #181b22;
        --ndrs-surface-2: #1f232b;
        --ndrs-text:      #dfe3ea;
        --ndrs-heading:   #f1f4f8;
        --ndrs-muted:     #98a2b3;
        --ndrs-accent:    #2dd4bf;
        --ndrs-accent-2:  #5eead4;
        --ndrs-accent-soft:#163230;
        --ndrs-title:     #7cc0ff;
        --ndrs-border:    #2a2f39;
        --ndrs-border-strong:#3a4150;
        --ndrs-shadow:    0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.45);
        --ndrs-shadow-sm: 0 1px 2px rgba(0,0,0,.35), 0 4px 16px rgba(0,0,0,.4);
    }
}

/* Dark when explicitly forced */
html[data-theme="dark"] {
    --ndrs-bg:        #0f1116;
    --ndrs-surface:   #181b22;
    --ndrs-surface-2: #1f232b;
    --ndrs-text:      #dfe3ea;
    --ndrs-heading:   #f1f4f8;
    --ndrs-muted:     #98a2b3;
    --ndrs-accent:    #2dd4bf;
    --ndrs-accent-2:  #5eead4;
    --ndrs-accent-soft:#163230;
    --ndrs-title:     #7cc0ff;
    --ndrs-border:    #2a2f39;
    --ndrs-border-strong:#3a4150;
    --ndrs-shadow:    0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.45);
    --ndrs-shadow-sm: 0 1px 2px rgba(0,0,0,.35), 0 4px 16px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: "Helvetica Neue", Arial, "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    background: var(--ndrs-bg);
    color: var(--ndrs-text);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    transition: background-color .25s ease, color .25s ease;
}

.ndrs-page {
    max-width: 940px;
    margin: 0 auto;
    padding: 28px 20px 96px;
}

/* When the optional global site header (admin toggle) is shown, it is
   position:fixed; offset the content so nothing hides beneath it. */
body.ndrs-has-header .ndrs-page { padding-top: 92px; }
@media (max-width: 1199.98px) {
    body.ndrs-has-header .ndrs-page { padding-top: 80px; }
}

/* Dark-theme palette for the global site header so it matches the page.
   These override main.css's light ".scrolled .header" variables (higher
   specificity + loaded after main.css). */
html[data-theme="dark"] .header {
    --background-color: #14161c;
    --default-color: #e6e7ea;
    --heading-color: #f1f4f8;
    --nav-color: #e6e7ea;
    --nav-hover-color: #2dd4bf;
    --nav-mobile-background-color: #14161c;
    --nav-dropdown-background-color: #1b1f27;
    --nav-dropdown-color: #cdd3dc;
    --nav-dropdown-hover-color: #2dd4bf;
    border-bottom-color: rgba(255, 255, 255, .08);
    box-shadow: 0 2px 18px rgba(0, 0, 0, .5);
}
html[data-theme="dark"] .header .logo span { color: #2dd4bf; }

a { color: var(--ndrs-accent); }

/* ---------- Hero ---------------------------------------------------- */
.ndrs-hero {
    position: relative;
    background: var(--ndrs-surface);
    border: 1px solid var(--ndrs-border);
    border-radius: var(--ndrs-radius);
    box-shadow: var(--ndrs-shadow);
    padding: 34px 34px 30px;
    overflow: hidden;
}
.ndrs-hero::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, var(--ndrs-accent), var(--ndrs-accent-2));
}
.ndrs-eyebrow {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ndrs-accent-2);
}
.ndrs-eyebrow-cn {
    margin: 4px 0 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--ndrs-accent);
}
.ndrs-title {
    margin: 16px 0 10px;
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.18;
    font-weight: 800;
    color: var(--ndrs-heading);
    letter-spacing: -.01em;
}
.ndrs-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin: 14px 0 18px;
}
.ndrs-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .34rem .8rem;
    font-size: 14px;
    font-weight: 600;
    color: var(--ndrs-accent);
    background: var(--ndrs-accent-soft);
    border: 1px solid color-mix(in srgb, var(--ndrs-accent) 24%, transparent);
    border-radius: 999px;
}
.ndrs-hero-sub {
    margin: 4px 0 0;
    font-size: 14.5px;
    color: var(--ndrs-muted);
}

/* Lead block (series / date) shown right under the hero on rich pages */
.ndrs-lead { margin: 2px 0 4px; }
.ndrs-lead .ndrs-eyebrow { margin-top: 0; }

/* ---------- Sections ----------------------------------------------- */
.ndrs-section { margin-top: 30px; }
.ndrs-section-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0 0 14px;
    font-size: 19px;
    font-weight: 800;
    color: var(--ndrs-heading);
}
.ndrs-section-title::before {
    content: "";
    width: 6px;
    height: 20px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--ndrs-accent), var(--ndrs-accent-2));
}

.ndrs-card {
    background: var(--ndrs-surface);
    border: 1px solid var(--ndrs-border);
    border-radius: var(--ndrs-radius);
    box-shadow: var(--ndrs-shadow-sm);
    padding: 22px 24px;
}
.ndrs-card + .ndrs-card { margin-top: 16px; }
.ndrs-card p:first-child { margin-top: 0; }
.ndrs-card p:last-child { margin-bottom: 0; }

/* ---------- Talk / speaker cards ----------------------------------- */
.ndrs-talk {
    position: relative;
    background: var(--ndrs-surface);
    border: 1px solid var(--ndrs-border);
    border-radius: var(--ndrs-radius);
    box-shadow: var(--ndrs-shadow-sm);
    padding: 20px 24px 22px;
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.ndrs-talk + .ndrs-talk { margin-top: 16px; }
.ndrs-talk:hover {
    box-shadow: var(--ndrs-shadow);
    border-color: var(--ndrs-border-strong);
    transform: translateY(-2px);
}
.ndrs-talk-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
}
.ndrs-time {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: .2rem .6rem;
    font-size: 13.5px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--ndrs-accent), var(--ndrs-accent-2));
    border-radius: 999px;
}
html[data-theme="dark"] .ndrs-time,
html:not([data-theme="light"]) .ndrs-time { color: #06231f; }
.ndrs-talk-title {
    flex: 1 1 240px;
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--ndrs-heading);
}
.ndrs-speaker {
    margin: 10px 0 0;
    font-size: 15.5px;
}
.ndrs-speaker b { color: var(--ndrs-heading); font-size: 16px; }
.ndrs-affil { color: var(--ndrs-accent); font-weight: 600; }
.ndrs-bio {
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px dashed var(--ndrs-border);
    font-size: 14.5px;
    color: var(--ndrs-text);
    font-weight: 400;
}
.ndrs-bio .label,
.ndrs-abstract .label {
    display: inline-block;
    font-weight: 700;
    color: var(--ndrs-accent);
}
.ndrs-abstract {
    margin: 12px 0 0;
    font-size: 14.5px;
    font-weight: 400;
    color: var(--ndrs-text);
}

/* ---------- Info / organizer blocks -------------------------------- */
.ndrs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.ndrs-info b, .ndrs-info strong { color: var(--ndrs-heading); }
.ndrs-info p { margin: 0 0 .5rem; }
.ndrs-map {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .75rem;
    margin: 2px 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ndrs-accent);
    background: var(--ndrs-accent-soft);
    border: 1px solid color-mix(in srgb, var(--ndrs-accent) 24%, transparent);
    border-radius: 999px;
    text-decoration: none;
}
.ndrs-map:hover { filter: brightness(.96); }

/* Inline download link inserted by the admin "insert document" button. */
.ndrs-file {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-weight: 600;
    color: var(--ndrs-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.ndrs-file:hover { filter: brightness(.96); }

.ndrs-logo { margin-top: 26px; }
.ndrs-logo img { max-width: 200px; height: auto; }

img { max-width: 100%; height: auto; }
table { border-collapse: collapse; max-width: 100%; }
table td, table th { border: 1px solid var(--ndrs-border-strong); padding: 6px 10px; }

/* ---------- Footer / back link ------------------------------------- */
.ndrs-foot {
    margin-top: 36px;
    padding-top: 22px;
    border-top: 1px solid var(--ndrs-border);
    color: var(--ndrs-muted);
    font-size: 13.5px;
}
.ndrs-back {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: 16px;
    padding: .55rem 1.05rem;
    font-weight: 600;
    color: var(--ndrs-accent);
    background: var(--ndrs-surface);
    border: 1px solid var(--ndrs-border-strong);
    border-radius: var(--ndrs-radius-sm);
    text-decoration: none;
    transition: background-color .2s ease;
}
.ndrs-back:hover { background: var(--ndrs-accent-soft); }

/* ---------- Content / free rich-text body (admin-generated) --------- */
/* The backend Seminar Builder stores a free rich-text body. These rules give
   that arbitrary HTML (headings, paragraphs, lists, images, tables, links)
   a clean, theme-aware look without requiring special markup. Hand-authored
   pages can still drop in the component classes above (.ndrs-talk, etc.). */
.ndrs-content { margin-top: 24px; }
.ndrs-prose { font-size: 16px; }
.ndrs-prose > :first-child { margin-top: 0; }
.ndrs-prose h2:not([class]) {
    margin: 1.6em 0 .6em;
    font-size: 21px;
    font-weight: 800;
    color: var(--ndrs-heading);
    padding-left: .6rem;
    border-left: 5px solid var(--ndrs-accent);
}
.ndrs-prose h3:not([class]) {
    margin: 1.4em 0 .5em;
    font-size: 18px;
    font-weight: 700;
    color: var(--ndrs-heading);
}
.ndrs-prose h4:not([class]), .ndrs-prose h5:not([class]), .ndrs-prose h6:not([class]) {
    margin: 1.2em 0 .4em;
    color: var(--ndrs-heading);
}
.ndrs-prose p:not([class]) { margin: 0 0 1em; }
.ndrs-prose ul, .ndrs-prose ol { margin: 0 0 1em; padding-left: 1.4em; }
.ndrs-prose li { margin: .25em 0; }
.ndrs-prose a:not([class]) { color: var(--ndrs-accent); text-decoration: underline; }
.ndrs-prose img:not([class]) {
    border-radius: var(--ndrs-radius-sm);
    box-shadow: var(--ndrs-shadow-sm);
    margin: .4em 0;
}
.ndrs-prose figure { margin: 1em 0; }
.ndrs-prose figcaption { font-size: 13.5px; color: var(--ndrs-muted); margin-top: .4rem; }
.ndrs-prose blockquote {
    margin: 1em 0;
    padding: .6rem 1rem;
    border-left: 4px solid var(--ndrs-accent);
    background: var(--ndrs-surface-2);
    border-radius: 0 var(--ndrs-radius-sm) var(--ndrs-radius-sm) 0;
    color: var(--ndrs-muted);
}
.ndrs-prose pre, .ndrs-prose code {
    background: var(--ndrs-surface-2);
    border: 1px solid var(--ndrs-border);
    border-radius: 6px;
}
.ndrs-prose code { padding: .1em .35em; font-size: .92em; }
.ndrs-prose pre { padding: .8rem 1rem; overflow: auto; }
.ndrs-prose pre code { border: 0; padding: 0; background: none; }
.ndrs-prose table { width: 100%; margin: 1em 0; font-size: 14.5px; }
.ndrs-prose th { background: var(--ndrs-surface-2); color: var(--ndrs-heading); }
.ndrs-prose hr { border: 0; border-top: 1px solid var(--ndrs-border); margin: 1.6em 0; }

@media (max-width: 560px) {
    .ndrs-hero { padding: 26px 20px 24px; }
    .ndrs-card, .ndrs-talk { padding: 18px 18px 20px; }
    .ndrs-page { padding: 20px 14px 80px; }
}

/* =====================================================================
   Seminar photo gallery (under the page title) + fullscreen lightbox
   ===================================================================== */
.ndrs-gallery-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .55rem;
    margin: 26px 0 14px;
    font-size: 21px;
    font-weight: 800;
    color: var(--ndrs-heading);
}
.ndrs-gallery-title span {
    font-size: 13px;
    font-weight: 600;
    color: var(--ndrs-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
}
.ndrs-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin: 0 0 30px;
}
.ndrs-shot {
    display: block;
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--ndrs-radius-sm);
    overflow: hidden;
    background: var(--ndrs-surface-2);
    box-shadow: var(--ndrs-shadow-sm);
    cursor: zoom-in;
}
.ndrs-shot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform .35s ease;
}
.ndrs-shot:hover img { transform: scale(1.06); }

/* Fullscreen lightbox */
.ndrs-lb {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 10, 14, .94);
    -webkit-user-select: none;
    user-select: none;
}
.ndrs-lb[hidden] { display: none; }
.ndrs-lb-img {
    max-width: 92vw;
    max-height: 86vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, .6);
}
.ndrs-lb button {
    position: absolute;
    border: 0;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease;
    line-height: 1;
}
.ndrs-lb button:hover { background: rgba(255, 255, 255, .26); }
.ndrs-lb-prev, .ndrs-lb-next {
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 30px;
}
.ndrs-lb-prev { left: 18px; }
.ndrs-lb-next { right: 18px; }
.ndrs-lb-close {
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 26px;
}
.ndrs-lb-count {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .85);
    font-size: 14px;
    letter-spacing: .03em;
    background: rgba(0, 0, 0, .35);
    padding: 4px 12px;
    border-radius: 999px;
}
.ndrs-lb-cap {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    max-width: min(80vw, 720px);
    text-align: center;
    color: rgba(255, 255, 255, .94);
    font-size: 15px;
    line-height: 1.55;
    background: rgba(0, 0, 0, .46);
    padding: 8px 16px;
    border-radius: 10px;
}
.ndrs-lb-cap:empty { display: none; }
@media (max-width: 560px) {
    .ndrs-gallery { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .ndrs-lb-prev, .ndrs-lb-next { width: 42px; height: 42px; font-size: 24px; }
    .ndrs-lb-prev { left: 8px; }
    .ndrs-lb-next { right: 8px; }
}
