/* =========================================================
   Ru Ming Education — Public theme
   Palette: deep navy + gold + cream (derived from logo)
   ========================================================= */

:root {
  /* core palette */
  --rm-navy:          #0F1A2E;
  --rm-navy-2:        #1A2942;
  --rm-navy-3:        #243657;
  --rm-gold:          #C9A961;
  --rm-gold-deep:     #A8893F;
  --rm-gold-soft:     #F2E2A8;
  --rm-cream:         #FBF3D6;       /* page background — soft light yellow */
  --rm-cream-2:       #F6EBC3;       /* slightly deeper alt sections */
  --rm-paper:         #FFFCF1;       /* card surface — warm off-white */
  --rm-ink:           #1A1A1A;
  --rm-ink-2:         #4A4A4A;
  --rm-ink-3:         #767676;
  --rm-line:          #E8E4DA;
  --rm-line-2:        #2B3A5C;
  --rm-success:       #2E7D5B;
  --rm-danger:        #B23A3A;

  /* type */
  --rm-font-serif:    'Noto Serif SC', 'Cormorant Garamond', Georgia, serif;
  --rm-font-sans:     'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* layout */
  --rm-radius:        4px;
  --rm-radius-lg:     12px;
  --rm-shadow-sm:     0 1px 3px rgba(15,26,46,.08), 0 1px 2px rgba(15,26,46,.06);
  --rm-shadow-md:     0 4px 14px rgba(15,26,46,.10), 0 2px 6px rgba(15,26,46,.06);
  --rm-shadow-lg:     0 24px 60px -16px rgba(15,26,46,.28);
  --rm-header-h:      112px;
  --rm-pad-x:         clamp(20px, 4vw, 64px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--rm-font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--rm-ink);
  background: var(--rm-cream);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--rm-navy); text-decoration: none; transition: color .2s; }
a:hover { color: var(--rm-gold-deep); }
h1,h2,h3,h4,h5 { font-family: var(--rm-font-serif); color: var(--rm-navy); margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); font-weight: 600; }
p  { margin: 0 0 1em; color: var(--rm-ink-2); }

button { font-family: inherit; cursor: pointer; }

/* =========================================================
   Header
   ========================================================= */
.rm-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 243, 214, .94);   /* cream — matches body */
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(168, 137, 63, .18);
}
.rm-header-inner {
  height: var(--rm-header-h);
  padding: 0 var(--rm-pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.rm-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.rm-brand img.rm-brand-full {
  height: 80px;
  width: auto;
  display: block !important;
}
/* mobile-only — hidden everywhere, shown only inside the mobile media query */
.rm-brand img.rm-brand-mini,
.rm-brand .rm-brand-mini-text { display: none !important; }
.rm-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.rm-nav-link {
  font-family: var(--rm-font-serif);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--rm-navy);
  letter-spacing: .02em;
  position: relative;
  padding: 14px 0;
}
.rm-nav-link:hover { color: var(--rm-gold-deep); }
.rm-nav-link.is-active { color: var(--rm-gold-deep); }
.rm-nav-link.is-active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--rm-gold);
}

/* Dropdown menus */
.rm-nav-dd { position: relative; }
.rm-nav-trigger {
  background: none;
  border: 0;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.rm-caret { font-size: .7em; opacity: .7; transition: transform .2s; }
.rm-nav-dd:hover .rm-caret,
.rm-nav-dd.is-open .rm-caret { transform: translateY(1px) rotate(180deg); opacity: 1; }

.rm-nav-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 220px;
  background: var(--rm-paper);
  border: 1px solid var(--rm-line);
  border-radius: 8px;
  box-shadow: 0 12px 32px -8px rgba(15,26,46,.18);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, transform .2s, visibility .2s;
  z-index: 200;
}
.rm-nav-dd:hover > .rm-nav-menu,
.rm-nav-dd.is-open > .rm-nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.rm-nav-sub {
  display: block;
  padding: 9px 18px;
  color: var(--rm-navy);
  font-family: var(--rm-font-serif);
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border-left: 3px solid transparent;
}
.rm-nav-sub:hover {
  background: var(--rm-cream-2);
  color: var(--rm-gold-deep);
  border-left-color: var(--rm-gold);
}
/* Nav CTA — gold pill button (e.g. Bazi Calculator link) */
.rm-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--rm-gold) 0%, var(--rm-gold-deep) 100%);
  color: var(--rm-navy) !important;
  font-family: var(--rm-font-serif);
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: .04em;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(168,137,63,.35);
  transition: all .22s ease;
  white-space: nowrap;
}
.rm-nav-cta:hover {
  background: linear-gradient(135deg, var(--rm-gold-deep) 0%, var(--rm-navy) 100%);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(168,137,63,.45);
}

.rm-lang {
  font-size: .85rem;
  color: var(--rm-ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--rm-line);
}
.rm-lang a { color: var(--rm-ink-3); }
.rm-lang a.is-active { color: var(--rm-navy); font-weight: 600; }
.rm-burger { display: none; background: none; border: 0; padding: 10px 12px; cursor: pointer; margin-left: auto; }
.rm-burger span { display:block; width: 28px; height: 3px; background: var(--rm-navy); margin: 6px 0; border-radius: 2px; transition: .25s; }

@media (max-width: 760px) {
  /* compact header on phones — show shield + brand text, hide wide logo */
  :root { --rm-header-h: 84px; }

  .rm-header {
    background: #FBF3D6 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    /* Do NOT add safe-area padding here — sticky headers handle the
       notch automatically; safe-area padding inflates the cream band
       and creates the "clipped" look. */
  }
  .rm-header-inner {
    padding: 10px 14px;
    height: var(--rm-header-h);
    min-height: var(--rm-header-h);
  }
  .rm-brand { gap: 6px; min-width: 0; align-items: center; }
  .rm-brand img.rm-brand-full { display: none !important; }
  .rm-brand img.rm-brand-mini {
    display: block !important;
    height: 56px;
    width: 56px;
    flex-shrink: 0;
    object-fit: contain;
    object-position: center;
  }
  .rm-brand .rm-brand-mini-text {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    line-height: 1.25;
    min-width: 0;
  }
  .rm-brand-mini-zh {
    font-family: var(--rm-font-serif);
    font-weight: 700;
    font-size: 1rem;
    color: #000;
    letter-spacing: .05em;
  }
  .rm-brand-mini-en {
    font-family: var(--rm-font-serif);
    font-weight: 700;
    font-size: .62rem;
    color: #000;
    letter-spacing: .12em;
    margin-top: 3px;
    white-space: nowrap;
  }
}

@media (max-width: 1100px) {
  .rm-burger { display: block; }
  .rm-nav {
    position: fixed;
    inset: var(--rm-header-h) 0 auto 0;
    background: var(--rm-cream);
    flex-direction: column;
    align-items: stretch;
    padding: 16px var(--rm-pad-x) 32px;
    gap: 0;
    border-bottom: 1px solid var(--rm-line);
    transform: translateY(-110%);
    transition: transform .3s ease, visibility .3s ease;
    max-height: calc(100vh - var(--rm-header-h));
    overflow-y: auto;
    /* hard-hide when closed so iOS can't half-render the lang switcher */
    visibility: hidden;
    pointer-events: none;
  }
  .rm-nav.is-open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }
  .rm-nav-link, .rm-nav-trigger { padding: 14px 0; border-bottom: 1px solid var(--rm-line); width: 100%; text-align: left; justify-content: space-between; }
  .rm-nav-link.is-active::after { display: none; }
  .rm-nav-cta {
    margin: 14px 0;
    width: 100%;
    justify-content: center;
    padding: 14px 18px;
    font-size: 1rem;
    border-radius: 8px;
  }
  .rm-lang { border-left: 0; padding: 16px 0 0; margin: 0; justify-content: flex-start; }

  /* Dropdowns on mobile: full-width, stacked, click-to-expand */
  .rm-nav-dd { width: 100%; }
  .rm-nav-menu {
    position: static;
    transform: none;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    background: var(--rm-cream-2);
    min-width: 0;
    width: 100%;
    padding: 4px 0 8px;
    max-height: 0;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    transition: max-height .25s ease;
  }
  .rm-nav-dd.is-open > .rm-nav-menu { max-height: 600px; transform: none; }
  .rm-nav-dd:hover > .rm-nav-menu { transform: none; }   /* no hover-open on mobile */
  .rm-nav-sub { padding: 10px 22px; font-size: .92rem; border-left: 0; }
  .rm-nav-sub:hover { border-left: 0; }
}

/* =========================================================
   Main / sections
   ========================================================= */
.rm-main { min-height: 60vh; }
.rm-section { padding: clamp(48px, 7vw, 96px) var(--rm-pad-x); }
/* Full-width page (e.g. /page/our-journey) — kills section padding so child content
   can span the entire viewport. The page's own HTML controls its inner padding. */
.rm-section--full { padding: 0 !important; max-width: none !important; }
.rm-page-full .rm-main { padding: 0; }
/* Also override any inline max-width on the immediate child (in case the page HTML
   has its own wrapper with max-width:1280px etc.) */
.rm-section--full > section,
.rm-section--full > div { max-width: none !important; }
.rm-section--alt { background: var(--rm-cream-2); }
.rm-section--dark { background: var(--rm-navy); color: var(--rm-cream); }
.rm-section--dark h1, .rm-section--dark h2, .rm-section--dark h3 { color: var(--rm-paper); }
.rm-section--dark p { color: rgba(250, 247, 240, .8); }

.rm-section-head { text-align: center; margin-bottom: 48px; }
.rm-section-head .rm-eyebrow { color: var(--rm-gold-deep); letter-spacing: .25em; text-transform: uppercase; font-size: .8rem; font-weight: 600; }
.rm-section-head h2 { margin-top: 8px; }
.rm-section-head p { max-width: 640px; margin: 12px auto 0; color: var(--rm-ink-3); }

/* =========================================================
   Buttons
   ========================================================= */
.rm-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--rm-font-serif);
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid var(--rm-navy);
  background: var(--rm-navy);
  color: var(--rm-paper);
  border-radius: var(--rm-radius);
  cursor: pointer;
  transition: all .25s ease;
  text-decoration: none;
}
.rm-btn:hover { background: var(--rm-navy-2); border-color: var(--rm-navy-2); color: var(--rm-paper); transform: translateY(-1px); box-shadow: var(--rm-shadow-md); }
.rm-btn--gold { background: var(--rm-gold); border-color: var(--rm-gold); color: var(--rm-navy); }
.rm-btn--gold:hover { background: var(--rm-gold-deep); border-color: var(--rm-gold-deep); color: var(--rm-paper); }
.rm-btn--ghost { background: transparent; color: var(--rm-paper); border-color: rgba(250,247,240,.6); }
.rm-btn--ghost:hover { background: var(--rm-paper); color: var(--rm-navy); border-color: var(--rm-paper); }
.rm-btn--outline { background: transparent; color: var(--rm-navy); }

/* =========================================================
   Hero / banner slideshow
   ========================================================= */
.rm-hero {
  position: relative;
  width: 100%;
  height: clamp(420px, 70vh, 720px);
  overflow: hidden;
  background: var(--rm-navy);
}
.rm-hero-track {
  position: absolute;
  inset: 0;
}
.rm-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
  background-size: cover;
  background-position: center;
}
.rm-slide.is-active { opacity: 1; z-index: 2; }
.rm-slide a { display: block; width: 100%; height: 100%; }
.rm-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,26,46,.15) 0%, rgba(15,26,46,.55) 100%);
  pointer-events: none;
}
.rm-slide-caption {
  position: absolute;
  left: 0; right: 0;
  /* default = middle, overridable via .rm-slide-caption--top|middle|bottom */
  top: 50%;
  transform: translateY(-50%);
  padding: 0 var(--rm-pad-x);
  z-index: 3;
  color: var(--rm-paper);
  text-align: center;
  pointer-events: none;
}
.rm-slide-caption.rm-slide-caption--top {
  top: 12%;
  bottom: auto;
  transform: none;
}
.rm-slide-caption.rm-slide-caption--middle {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}
.rm-slide-caption.rm-slide-caption--bottom {
  top: auto;
  bottom: 12%;
  transform: none;
}
.rm-slide-caption h1 { color: var(--rm-paper); text-shadow: 0 2px 24px rgba(0,0,0,.4); }
.rm-slide-caption p  {
  color: rgba(255,255,255,.92);
  /* Responsive: scales from ~1.1rem on phones to 2.3rem on desktop,
     so the subtitle never overpowers the auto-scaling main title. */
  font-size: clamp(1.1rem, 3.6vw, 2.3rem);
  max-width: 900px;
  margin: .5em auto 0;
  text-wrap: balance;            /* spread lines evenly so no single orphan char drops down */
  word-break: keep-all;           /* don't break inside Chinese words */
  overflow-wrap: break-word;
}

.rm-hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.4);
  color: #fff;
  font-size: 1.4rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: all .25s;
}
.rm-hero-arrow:hover { background: var(--rm-gold); color: var(--rm-navy); border-color: var(--rm-gold); }
.rm-hero-arrow.prev { left: 24px; }
.rm-hero-arrow.next { right: 24px; }

.rm-hero-dots {
  position: absolute;
  bottom: 28px; left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 4;
}
.rm-hero-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  border: 0;
  cursor: pointer;
  transition: all .25s;
}
.rm-hero-dot.is-active { background: var(--rm-gold); width: 32px; border-radius: 5px; }

@media (max-width: 600px) {
  .rm-hero { height: 60vh; }
  .rm-hero-arrow { width: 40px; height: 40px; font-size: 1rem; }
  .rm-hero-arrow.prev { left: 10px; } .rm-hero-arrow.next { right: 10px; }
}

/* =========================================================
   Home — feature grid
   ========================================================= */
.rm-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
}
.rm-feature {
  background: var(--rm-paper);
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius-lg);
  padding: 32px;
  text-align: center;
  transition: transform .3s ease, box-shadow .3s ease;
}
.rm-feature:hover { transform: translateY(-4px); box-shadow: var(--rm-shadow-md); }
.rm-feature-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rm-gold) 0%, var(--rm-gold-deep) 100%);
  margin: 0 auto 20px;
  display: grid; place-items: center;
  color: var(--rm-navy);
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--rm-font-serif);
}

/* =========================================================
   Gallery (masonry-ish grid + lightbox)
   ========================================================= */
.rm-gallery-grid {
  display: grid;
  /* admin-controlled (2-6); CSS clamps the max on smaller screens via media queries below */
  grid-template-columns: repeat(var(--gallery-cols, 4), 1fr);
  gap: 18px;
}
@media (max-width: 1100px) { .rm-gallery-grid { grid-template-columns: repeat(min(var(--gallery-cols, 4), 4), 1fr); } }
@media (max-width: 900px)  { .rm-gallery-grid { grid-template-columns: repeat(min(var(--gallery-cols, 4), 3), 1fr); } }
@media (max-width: 700px)  { .rm-gallery-grid { grid-template-columns: repeat(min(var(--gallery-cols, 4), 2), 1fr); } }
@media (max-width: 480px)  { .rm-gallery-grid { grid-template-columns: 1fr; } }
.rm-gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--rm-radius-lg);
  cursor: zoom-in;
  background: var(--rm-line);
  aspect-ratio: 4/3;
}
.rm-gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.rm-gallery-item:hover img { transform: scale(1.06); }
.rm-gallery-item .rm-gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(15,26,46,.65) 100%);
  display: flex; align-items: flex-end; padding: 16px;
  color: #fff; font-weight: 500;
  opacity: 0; transition: opacity .3s;
}
.rm-gallery-item:hover .rm-gallery-overlay { opacity: 1; }

/* Lightbox */
.rm-lightbox {
  position: fixed; inset: 0;
  background: rgba(15,26,46,.95);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.rm-lightbox.is-open { display: flex; }
.rm-lightbox img { max-width: 90vw; max-height: 86vh; object-fit: contain; box-shadow: var(--rm-shadow-lg); }
.rm-lightbox-close {
  position: absolute; top: 24px; right: 24px;
  width: 44px; height: 44px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.4); color: #fff;
  border-radius: 50%; font-size: 1.4rem; cursor: pointer;
}
.rm-lightbox-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.4); color: #fff;
  font-size: 1.6rem; cursor: pointer;
}
.rm-lightbox-arrow.prev { left: 24px; } .rm-lightbox-arrow.next { right: 24px; }

/* =========================================================
   Education slides (Padlet-style)
   ========================================================= */
.rm-padlet {
  display: grid;
  /* admin-controlled column count via --slides-cols (default 3); auto-stacks on narrow screens */
  grid-template-columns: repeat(var(--slides-cols, 3), 1fr) !important;
  gap: 24px;
}
@media (max-width: 1100px) { .rm-padlet { grid-template-columns: repeat(min(var(--slides-cols, 3), 4), 1fr) !important; } }
@media (max-width: 900px)  { .rm-padlet { grid-template-columns: repeat(min(var(--slides-cols, 3), 3), 1fr) !important; } }
@media (max-width: 700px)  { .rm-padlet { grid-template-columns: repeat(min(var(--slides-cols, 3), 2), 1fr) !important; } }
@media (max-width: 500px)  { .rm-padlet { grid-template-columns: 1fr !important; } }
.rm-padlet-section { background: transparent; }
.rm-padlet-section h3 {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--rm-gold);
  margin-bottom: 16px;
}
.rm-padlet-section h3 .rm-count {
  font-size: .8rem; color: var(--rm-ink-3); font-family: var(--rm-font-sans); font-weight: 400;
}
.rm-padlet-cards { display: flex; flex-direction: column; gap: 16px; }
.rm-padlet-card {
  background: var(--rm-paper);
  border-radius: var(--rm-radius-lg);
  overflow: hidden;
  box-shadow: var(--rm-shadow-sm);
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
  border: 1px solid var(--rm-line);
}
.rm-padlet-card:hover { transform: translateY(-3px); box-shadow: var(--rm-shadow-md); }
.rm-padlet-card-img { aspect-ratio: 16/10; background: var(--rm-line); overflow: hidden; }
.rm-padlet-card-img img { width: 100%; height: 100%; object-fit: cover; }
.rm-padlet-card-body { padding: 14px 16px; }
.rm-padlet-card-body h4 { font-family: var(--rm-font-serif); font-size: 1.05rem; margin: 0 0 4px; color: var(--rm-navy); }
.rm-padlet-card-meta { font-size: .8rem; color: var(--rm-ink-3); }

/* Padlet modal viewer — full-screen image, side panel for nav + comments */
.rm-padview {
  position: fixed; inset: 0;
  background: rgba(15,26,46,.97);
  z-index: 200;
  display: none;
}
.rm-padview.is-open { display: block; }
.rm-padview-close {
  position: absolute; top: 16px; right: 16px; z-index: 10;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.4); color:#fff;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 1.4rem;
}
.rm-padview-body {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 360px;
}
.rm-padview-stage {
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
  overflow: hidden;
}
.rm-padview-stage img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

/* Side panel: title + comments + form + nav (prev/next at bottom) */
.rm-padview-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.2);
}
.rm-padview-counter { color: var(--rm-gold); font-family: var(--rm-font-serif); font-size: .95rem; }
.rm-padview-arrow {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  font-family: var(--rm-font-sans);
  font-size: .85rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all .2s;
}
.rm-padview-arrow:hover { background: var(--rm-gold); color: var(--rm-navy); border-color: var(--rm-gold); }
.rm-padview-side {
  background: #1a2942;
  color: #fff;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255,255,255,.08);
}
.rm-padview-side h3 { color: #fff; padding: 20px 24px 8px; border-bottom: 1px solid rgba(255,255,255,.08); margin: 0; font-size: 1.1rem; }
.rm-padview-side .rm-meta { padding: 0 24px 16px; font-size: .85rem; color: rgba(255,255,255,.6); border-bottom: 1px solid rgba(255,255,255,.08);}
.rm-comments {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}
.rm-comment {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.rm-comment-meta { font-size: .8rem; color: rgba(255,255,255,.55); margin-bottom: 4px; }
.rm-comment-meta strong { color: var(--rm-gold); font-weight: 600; }
.rm-comment-body { font-size: .92rem; line-height: 1.5; }
.rm-comment-form {
  padding: 16px 24px;
  background: #243657;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; gap: 8px;
}
.rm-comment-form input,
.rm-comment-form textarea {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  padding: 10px 12px;
  border-radius: var(--rm-radius);
  font: inherit;
}
.rm-comment-form textarea { min-height: 70px; resize: vertical; }
.rm-comment-form button {
  background: var(--rm-gold);
  border: 0;
  color: var(--rm-navy);
  padding: 10px;
  font-weight: 600;
  border-radius: var(--rm-radius);
  font-family: var(--rm-font-serif);
}

@media (max-width: 800px) {
  .rm-padview-body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .rm-padview-side { max-height: 50vh; }
  .rm-padview-stage { padding: 12px; }
  .rm-padview-stage img { max-height: 45vh; }
}

/* =========================================================
   Videos (Gaia-style)
   ========================================================= */
/* =========================================================
   Video page hero — split layout, gold accents, decorative
   ========================================================= */
.rm-vhero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0F1A2E 0%, #1A2942 55%, #2B3A5C 100%);
  color: #fff;
  isolation: isolate;
}
.rm-vhero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 85% 30%, rgba(201,169,97,.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 70% at 10% 80%, rgba(201,169,97,.12) 0%, transparent 65%);
  z-index: 0;
}
.rm-vhero-pattern {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(201,169,97,.04) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.03) 0 1px, transparent 1px 14px);
  z-index: 0; pointer-events: none;
}
.rm-vhero-inner {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 64px;
  align-items: center;
  padding: clamp(64px, 8vw, 110px) var(--rm-pad-x);
  max-width: 1400px;
  margin: 0 auto;
}
.rm-vhero-text { max-width: 560px; }
.rm-vhero-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--rm-gold);
  font-size: .82rem; letter-spacing: .28em; text-transform: uppercase; font-weight: 600;
  margin-bottom: 18px;
}
.rm-vhero-line { width: 36px; height: 1px; background: var(--rm-gold); display:inline-block; }
.rm-vhero-text h1 {
  color: #fff;
  font-family: var(--rm-font-serif);
  font-size: clamp(2.2rem, 4.6vw, 3.8rem);
  line-height: 1.1;
  margin: 0 0 20px;
  font-weight: 700;
  text-shadow: 0 4px 24px rgba(0,0,0,.3);
}
.rm-vhero-text p {
  color: rgba(255,255,255,.82);
  font-size: 1.1rem;
  line-height: 1.7;
  margin: 0 0 32px;
}
.rm-vhero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* Featured card on the right */
.rm-vhero-card {
  display: block;
  text-decoration: none;
  color: #fff;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 60px -16px rgba(0,0,0,.55);
  transition: transform .35s ease, box-shadow .35s ease;
}
.rm-vhero-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 32px 70px -12px rgba(201,169,97,.25), 0 24px 60px -16px rgba(0,0,0,.55);
  text-decoration: none; color: #fff;
}
.rm-vhero-card-img {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--rm-navy);
  overflow: hidden;
}
.rm-vhero-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.rm-vhero-card:hover .rm-vhero-card-img img { transform: scale(1.06); }
.rm-vhero-card-img::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.35) 100%);
}
.rm-vhero-play {
  position: absolute;
  inset: 0; margin: auto;
  width: 72px; height: 72px;
  display: grid; place-items: center;
  background: rgba(201,169,97,.95);
  color: var(--rm-navy);
  border-radius: 50%;
  font-size: 1.4rem;
  padding-left: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  transition: transform .25s, background .25s;
}
.rm-vhero-card:hover .rm-vhero-play { transform: scale(1.1); background: var(--rm-gold-deep); color: #fff; }
.rm-vhero-card-meta {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 18px;
}
.rm-vhero-card-tag {
  font-size: .7rem; color: var(--rm-gold); letter-spacing: .22em; font-weight: 700;
}
.rm-vhero-card-title {
  font-family: var(--rm-font-serif); font-size: 1.15rem; font-weight: 600;
  color: #fff;
}
.rm-vhero-card-dur { font-size: .8rem; color: rgba(255,255,255,.55); }

@media (max-width: 880px) {
  .rm-vhero-inner { grid-template-columns: 1fr; gap: 36px; padding: 56px var(--rm-pad-x); }
  .rm-vhero-card { max-width: 480px; margin: 0 auto; width: 100%; }
}

.rm-video-row { margin-bottom: 64px; }
.rm-video-row-head {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(168,137,63,.18);
}
.rm-video-row-head h2 {
  font-family: var(--rm-font-serif);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700;
  margin: 0;
  color: var(--rm-navy);
}
.rm-video-row-meta { color: var(--rm-ink-3); font-size: .85rem; }

/* Horizontal scrolling track with prev/next arrows (Gaia-style) */
.rm-video-track-wrap {
  position: relative;
  margin: 0 -8px;
  padding: 0 8px;
}
.rm-video-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 24px * 3) / 4);
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 0 8px;
  /* Hide scrollbar — navigate via arrow buttons */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.rm-video-track::-webkit-scrollbar { display: none; }
.rm-video-track .rm-video-card { scroll-snap-align: start; }

@media (max-width: 1100px) { .rm-video-track { grid-auto-columns: calc((100% - 16px * 2) / 3); gap: 16px; } }
@media (max-width: 800px)  { .rm-video-track { grid-auto-columns: calc((100% - 16px) / 2); } }
@media (max-width: 540px)  { .rm-video-track { grid-auto-columns: 80%; } }

/* Admin-controlled column count for video rails (--video-cols set on .rm-video-track-wrap, default 4) */
.rm-video-track-wrap[style*="--video-cols"] > .rm-video-track,
.rm-video-track-wrap > .rm-video-track {
  grid-auto-columns: calc((100% - 24px * (var(--video-cols, 4) - 1)) / var(--video-cols, 4)) !important;
}
@media (max-width: 1100px) { .rm-video-track-wrap > .rm-video-track { grid-auto-columns: calc((100% - 16px * (min(var(--video-cols, 4), 4) - 1)) / min(var(--video-cols, 4), 4)) !important; } }
@media (max-width: 900px)  { .rm-video-track-wrap > .rm-video-track { grid-auto-columns: calc((100% - 16px * (min(var(--video-cols, 4), 3) - 1)) / min(var(--video-cols, 4), 3)) !important; } }
@media (max-width: 700px)  { .rm-video-track-wrap > .rm-video-track { grid-auto-columns: calc((100% - 16px) / 2) !important; } }
@media (max-width: 540px)  { .rm-video-track-wrap > .rm-video-track { grid-auto-columns: 80% !important; } }

.rm-video-arrow {
  position: absolute;
  top: 28%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--rm-paper);
  border: 1px solid var(--rm-line);
  color: var(--rm-navy);
  cursor: pointer;
  font-size: 1.2rem;
  z-index: 5;
  box-shadow: 0 4px 14px rgba(15,26,46,.18);
  display: grid; place-items: center;
  transition: all .25s;
}
.rm-video-arrow:hover { background: var(--rm-gold); color: var(--rm-navy); border-color: var(--rm-gold); transform: translateY(-50%) scale(1.06); }
.rm-video-arrow.prev { left: -16px; }
.rm-video-arrow.next { right: -16px; }
.rm-video-arrow[disabled] { opacity: .35; cursor: not-allowed; }
@media (max-width: 800px) {
  .rm-video-arrow { display: none; }   /* mobile uses native swipe */
}

.rm-video-card {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform .25s ease;
}
.rm-video-card:hover { transform: translateY(-3px); text-decoration: none; color: inherit; }

.rm-video-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--rm-navy);
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(15,26,46,.12);
}
.rm-video-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s;
}
.rm-video-card:hover .rm-video-thumb img { transform: scale(1.05); }

/* Title band overlay across the thumbnail — translucent */
/* Legacy gold overlay band on thumbnails — disabled (text now lives below the thumb) */
.rm-video-band, .rm-video-band-title, .rm-video-band-sub { display: none !important; }

/* Founder page — stack the photo on top of the bio text (was a 2-col grid) */
body.page-founder #iojwu {
  grid-template-columns: 1fr !important;
  text-align: center;
}
body.page-founder #iojwu > img {
  max-width: 380px;
  margin: 0 auto !important;
  border-radius: 12px;
}
body.page-founder #i6j3r { text-align: left; }

/* About page — soft gold/cream background that makes the cards float */
body.page-about {
  background: linear-gradient(180deg, #F8EFC9 0%, #F2E2A8 60%, #EAD58E 100%);
}
body.page-about .rm-main { background: transparent; }
/* Make any content cards inside about page lighter so they stand out on the gold background */
body.page-about .rm-section > section > div[style*="background:#FBF6E8"],
body.page-about [style*="background:#FBF6E8"] { background: #FFFAEC !important; }

/* Site-wide standardization — every round circle uses gold background + navy text.
   Catches inline-style circles (any page) regardless of original color. */
[style*="border-radius:50%"][style*="rgb(15, 26, 46)"],
[style*="border-radius: 50%"][style*="rgb(15, 26, 46)"],
[style*="border-radius:50%"][style*="rgb(15,26,46)"],
[style*="border-radius:50%"][style*="#0F1A2E"],
[style*="border-radius: 50%"][style*="#0F1A2E"],
[style*="border-radius:50%"][style*="#0f1a2e"],
[style*="border-radius: 50%"][style*="#0f1a2e"] {
  background: #C9A961 !important;
  color: #0F1A2E !important;
}
/* Fallback for grid-centered circles on any page */
div[style*="border-radius:50%"][style*="grid"][style*="place-items"],
div[style*="border-radius: 50%"][style*="grid"][style*="place-items"] {
  background: #C9A961 !important;
  color: #0F1A2E !important;
}

/* Robust 16:9 video sizing — works on frontend AND in the GrapesJS editor canvas.
   Defines .rm-video-wrap as a class (not relying on inline padding-top tricks that
   GrapesJS may strip on save) + a fallback for naked iframes. */

/* The wrapper class (used by the ▶ YouTube block) */
.rm-video-wrap {
  position: relative !important;
  width: 100% !important;
  max-width: 900px !important;
  aspect-ratio: 16 / 9 !important;
  margin: 24px auto !important;
  background: #000 !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  /* aspect-ratio replaces the padding-top: 56.25% hack — both work, this is cleaner */
  padding-top: 0 !important;
}
.rm-video-wrap iframe,
.rm-video-wrap > iframe {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  aspect-ratio: auto !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

/* Fallback — any naked YouTube/Vimeo iframe (not inside a wrapper) gets 16:9 */
iframe[src*="youtube.com"]:not(.rm-video-wrap iframe):not(.rm-yt-cover iframe),
iframe[src*="youtu.be"]:not(.rm-video-wrap iframe):not(.rm-yt-cover iframe),
iframe[src*="player.vimeo.com"]:not(.rm-video-wrap iframe):not(.rm-yt-cover iframe) {
  display: block !important;
  width: 100% !important;
  max-width: 900px !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  margin: 24px auto !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: #000 !important;
}

/* YouTube click-to-play poster — custom thumbnail swaps to autoplay iframe on click */
.rm-yt-cover { transition: transform .25s; }
.rm-yt-cover:hover { transform: translateY(-2px); }
.rm-yt-cover:hover .rm-yt-play-btn {
  background: rgba(201,169,97,.95) !important;
  color: #0F1A2E !important;
  transform: translate(-50%, -50%) scale(1.1) !important;
}
.rm-yt-cover .rm-yt-play-btn { transition: all .25s; }

/* Front-page "Our Journey" rail — shows 4 cards at a time, prev/next arrows scroll to reveal the rest */
.rm-video-track--4 { grid-auto-columns: calc((100% - 24px * 3) / 4) !important; gap: 24px !important; }
@media (max-width: 1100px) { .rm-video-track--4 { grid-auto-columns: calc((100% - 16px * 2) / 3) !important; gap: 16px !important; } }
@media (max-width: 800px)  { .rm-video-track--4 { grid-auto-columns: calc((100% - 16px) / 2) !important; } }
@media (max-width: 540px)  { .rm-video-track--4 { grid-auto-columns: 80% !important; } }

/* Circular play button — bottom right of thumb */
.rm-video-play {
  position: absolute;
  right: 12px; bottom: 12px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--rm-gold);
  color: var(--rm-navy);
  border-radius: 50%;
  font-size: .85rem;
  padding-left: 3px;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  transition: transform .25s, background .25s;
}
.rm-video-card:hover .rm-video-play {
  transform: scale(1.1);
  background: var(--rm-gold-deep);
  color: #fff;
}

.rm-video-info { padding: 14px 4px 0; }
.rm-video-author { font-size: .82rem; color: var(--rm-ink-3); margin-bottom: 4px; }
.rm-video-info h4 {
  font-size: 1.25rem;        /* bumped from 1.05rem */
  margin: 0 0 8px;
  font-family: var(--rm-font-serif);
  font-weight: 600;
  color: var(--rm-navy);
  line-height: 1.3;
}
.rm-video-desc {
  font-size: 1.05rem;        /* bumped from .88rem */
  color: var(--rm-ink-2);
  line-height: 1.55;
  margin: 0 0 10px;
  /* Limit to 3 lines so cards stay tidy */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rm-video-meta {
  display: flex;
  gap: 6px;
  font-size: .78rem;
  color: var(--rm-ink-3);
}
.rm-video-meta span:not(:last-child)::after { content: '·'; margin-left: 6px; opacity: .6; }

/* Keep .rm-video-scroll for the home page intro-videos rail */
.rm-video-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(260px, 26vw, 360px);
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.rm-video-scroll .rm-video-card { scroll-snap-align: start; }

/* Video player modal */
.rm-vplayer {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.rm-vplayer.is-open { display: flex; }
.rm-vplayer-frame {
  width: min(1100px, 100%);
  aspect-ratio: 16/9;
  background: #000;
  position: relative;
}
.rm-vplayer-frame iframe { position: absolute; inset: 0; width:100%; height:100%; border:0; }
.rm-vplayer-close {
  position: absolute; top: 24px; right: 24px;
  width: 44px; height: 44px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.4); color:#fff;
  border-radius: 50%; cursor:pointer; font-size: 1.2rem;
}

/* =========================================================
   Forms / contact
   ========================================================= */
.rm-form { display: grid; gap: 16px; max-width: 720px; }
.rm-form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .rm-form-grid-2 { grid-template-columns: 1fr; } }
.rm-field { display: flex; flex-direction: column; gap: 6px; }
.rm-field label { font-size: .9rem; color: var(--rm-ink-2); font-weight: 500; }
.rm-field input, .rm-field textarea, .rm-field select {
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius);
  background: var(--rm-paper);
  color: var(--rm-ink);
  transition: border-color .2s, box-shadow .2s;
}
.rm-field input:focus, .rm-field textarea:focus, .rm-field select:focus {
  outline: none;
  border-color: var(--rm-gold);
  box-shadow: 0 0 0 3px rgba(201,169,97,.18);
}
.rm-field textarea { min-height: 140px; resize: vertical; }

.rm-alert {
  padding: 14px 18px;
  border-radius: var(--rm-radius);
  margin-bottom: 20px;
  border-left: 4px solid var(--rm-gold);
  background: var(--rm-gold-soft);
  color: var(--rm-navy);
}
.rm-alert--success { background: #E8F4ED; border-color: var(--rm-success); color: #1B4D34; }
.rm-alert--error   { background: #FBECEC; border-color: var(--rm-danger);  color: #6F1F1F; }

/* Centered contact form */
.rm-contact-form-wrap {
  max-width: 720px;
  margin: 0 auto;
}
.rm-form--centered { display: grid; gap: 18px; max-width: none; }

/* Bottom address strip */
.rm-contact-strip { padding-top: 56px; padding-bottom: 56px; }
.rm-contact-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}
@media (max-width: 900px) { .rm-contact-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .rm-contact-row { grid-template-columns: 1fr; } }

.rm-contact-tile {
  text-align: center;
  padding: 28px 18px;
  background: var(--rm-paper);
  border-radius: 8px;
  box-shadow: var(--rm-shadow-sm);
  transition: transform .25s, box-shadow .25s;
}
.rm-contact-tile:hover { transform: translateY(-3px); box-shadow: var(--rm-shadow-md); }
.rm-contact-tile .rm-i {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  background: var(--rm-navy);
  color: var(--rm-gold);
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 1.4rem;
}
.rm-contact-tile h4 {
  font-family: var(--rm-font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--rm-gold-deep);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.rm-contact-tile p { margin: 0; color: var(--rm-ink); font-size: .95rem; line-height: 1.5; }
.rm-contact-tile p a { color: var(--rm-navy); }

/* =========================================================
   Footer
   ========================================================= */
.rm-footer {
  background: var(--rm-navy);
  color: rgba(250,247,240,.7);
  padding: 64px var(--rm-pad-x) 0;
  margin-top: 64px;
}
.rm-footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 48px;
  padding-bottom: 48px;
}
.rm-footer h4 {
  color: var(--rm-gold);
  font-family: var(--rm-font-serif);
  font-size: 1rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.rm-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  text-decoration: none;
  line-height: 1.15;
}
.rm-footer-brand:hover { text-decoration: none; }
.rm-footer-brand img { height: 108px; width: auto; display: block; }   /* +50% */
.rm-footer-brand-text { display: flex; flex-direction: column; gap: 6px; }
.rm-footer-brand-zh { font-family: var(--rm-font-serif); font-size: 2rem; font-weight: 700; color: var(--rm-gold); letter-spacing: .06em; }
.rm-footer-brand-en { font-family: var(--rm-font-serif); font-size: .95rem; color: #fff; letter-spacing: .18em; text-transform: uppercase; }
.rm-footer-about { color: #fff; opacity: .92; }
.rm-footer-about { font-size: .95rem; line-height: 1.7; }
.rm-footer ul { list-style: none; padding: 0; margin: 0; }
.rm-footer ul li { padding: 6px 0; }
.rm-footer a { color: rgba(250,247,240,.78); }
.rm-footer a:hover { color: var(--rm-gold); }
.rm-footer-contact li span { color: var(--rm-gold); margin-right: 6px; }
.rm-footer-bottom {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .85rem;
  color: rgba(250,247,240,.5);
}
@media (max-width: 800px) { .rm-footer-inner { grid-template-columns: 1fr; gap: 32px; } }

/* =========================================================
   Category cards (home grid) + category detail hero
   ========================================================= */
.rm-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 980px) { .rm-cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .rm-cat-grid { grid-template-columns: 1fr; } }

.rm-cat-card {
  position: relative;
  display: block;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 8px;
  text-decoration: none;
  color: #fff;
  box-shadow: 0 4px 12px rgba(15,26,46,.10);
  transition: transform .35s ease, box-shadow .35s ease;
}
.rm-cat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(15,26,46,.22);
  text-decoration: none;
  color: #fff;
}
.rm-cat-thumb { position: absolute; inset: 0; }
.rm-cat-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.rm-cat-card:hover .rm-cat-thumb img { transform: scale(1.08); }

.rm-cat-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,26,46,.05) 30%, rgba(15,26,46,.85) 100%);
  pointer-events: none;
}

.rm-cat-info {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 24px;
  z-index: 2;
}
.rm-cat-info h3 {
  color: #fff;
  font-family: var(--rm-font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0,0,0,.45);
  letter-spacing: .03em;
}
.rm-cat-meta {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  background: var(--rm-gold);
  color: var(--rm-navy);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 999px;
}

/* Category detail hero */
.rm-cat-hero {
  position: relative;
  width: 100%;
  height: clamp(320px, 50vh, 520px);
  overflow: hidden;
  background: var(--rm-navy);
}
.rm-cat-hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(.55);
  transform: scale(1.04);
}
.rm-cat-hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--rm-pad-x);
  max-width: 900px;
  color: #fff;
}
.rm-cat-hero-content h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.6rem); margin: 4px 0 12px; }
.rm-cat-hero-content .rm-eyebrow { color: var(--rm-gold); }
.rm-cat-hero-content p { color: rgba(255,255,255,.92); font-size: 1.15rem; max-width: 720px; }
.rm-cat-hero-meta { color: var(--rm-gold); font-size: .9rem; letter-spacing: .12em; text-transform: uppercase; margin-top: 14px; font-weight: 600; }

/* =========================================================
   Content protection helpers (work alongside main.js initProtection)
   ========================================================= */
/* Disable text selection site-wide */
body.rm-protected {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;       /* iOS long-press save */
}
/* Re-enable selection for form fields so users can still type/paste */
body.rm-protected input,
body.rm-protected textarea,
body.rm-protected select {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
/* Image protection */
body.rm-protected img,
body.rm-protected .rm-gallery-item,
body.rm-protected .rm-padlet-card,
body.rm-protected .rm-vhero-card-img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  pointer-events: auto;
}
@media print {
  body.rm-protected * { display: none !important; }
  body.rm-protected::before {
    content: '本网站内容受保护 · This site cannot be printed.';
    display: block;
    font-family: serif;
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
  }
}

/* helpers */
.rm-empty { text-align:center; padding: 80px 24px; color: var(--rm-ink-3); }
.rm-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.rm-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 800px) { .rm-grid-2, .rm-grid-3 { grid-template-columns: 1fr; } }

/* ============================================================
   Education PDFs page (/education) — PDF library, categorised
   Mirrors the videos page's structure: per-category section,
   grid of PDF cards. Each card opens its PDF in a new tab.
   ============================================================ */
.rm-pdf-row { margin-bottom: 56px; }
.rm-pdf-row:last-child { margin-bottom: 0; }
.rm-pdf-row-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--rm-gold);
}
.rm-pdf-row-head h3 {
  margin: 0;
  font-family: var(--rm-font-serif);
  font-size: 1.55rem;
  color: var(--rm-navy);
  letter-spacing: .04em;
}
.rm-pdf-row-meta { color: var(--rm-ink-3); font-size: .9rem; white-space: nowrap; }

.rm-pdf-grid {
  display: grid;
  grid-template-columns: repeat(var(--pdf-cols, 4), 1fr);
  gap: 24px;
}
@media (max-width: 1100px) { .rm-pdf-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px)  { .rm-pdf-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .rm-pdf-grid { grid-template-columns: 1fr; } }

.rm-pdf-card {
  display: block;
  text-decoration: none;
  background: var(--rm-paper);
  border: 1px solid rgba(201, 169, 97, .25);
  border-radius: 12px;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  color: inherit;
}
.rm-pdf-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(15, 26, 46, .12);
  border-color: var(--rm-gold);
}
.rm-pdf-thumb {
  position: relative;
  aspect-ratio: 16 / 9;            /* widescreen — matches PPT/PDF slide orientation */
  background: var(--rm-cream);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.rm-pdf-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;             /* contain → no edges cropped, letterbox if mismatch */
  object-position: center;
  display: block;
  transition: transform .35s ease;
}
.rm-pdf-card:hover .rm-pdf-thumb img { transform: scale(1.03); }
.rm-pdf-placeholder {
  font-family: var(--rm-font-serif);
  font-size: 2.2rem; font-weight: 700;
  color: var(--rm-gold);
  letter-spacing: .18em;
}
.rm-pdf-open {
  position: absolute;
  top: 10px; right: 12px;
  width: 32px; height: 32px;
  background: rgba(255, 255, 255, .9);
  color: var(--rm-navy);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1rem; font-weight: 700;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.rm-pdf-card:hover .rm-pdf-open { opacity: 1; }
.rm-pdf-info { padding: 14px 14px 18px; }
.rm-pdf-info h4 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-family: var(--rm-font-serif);
  font-weight: 600;
  color: var(--rm-navy);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rm-pdf-desc {
  margin: 0;
  font-size: .82rem;
  color: var(--rm-ink-2);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   PDF modal viewer — opens PDFs in an in-page popup instead of
   a new tab. Uses #toolbar=0 to hide Chrome/Edge's native
   download/print toolbar. Right-click + Ctrl+S/P are blocked
   while open (deterrent, not full prevention — the file URL is
   still in devtools/network tab for determined users).
   ============================================================ */
.rm-pdf-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15, 26, 46, .92);
  display: none;
  flex-direction: column;
  padding: 24px 24px 24px;
  -webkit-user-select: none;
  user-select: none;
}
.rm-pdf-modal[data-open="1"] { display: flex; }
.rm-pdf-modal-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: #FBF3D6;
  font-family: var(--rm-font-serif);
}
.rm-pdf-modal-title {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rm-pdf-modal-hint {
  font-size: .82rem;
  color: rgba(251, 243, 214, .55);
  font-family: -apple-system, system-ui, sans-serif;
}
.rm-pdf-modal-close {
  background: rgba(255, 255, 255, .12);
  color: #FBF3D6;
  border: 0;
  width: 38px; height: 38px;
  border-radius: 50%;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}
.rm-pdf-modal-close:hover { background: rgba(255, 255, 255, .22); }
.rm-pdf-modal iframe,
.rm-pdf-viewer {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: transparent;           /* let the modal's dark-navy backdrop show through */
  border-radius: 8px;
}
.rm-pdf-viewer {
  overflow: auto;
  position: relative;
  padding: 20px;
  -webkit-user-select: none;
  user-select: none;
}
.rm-pdf-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(251, 243, 214, .85);   /* cream text on dark navy */
  font-family: var(--rm-font-serif);
  font-size: 1.1rem;
  background: transparent;
  border-radius: 8px;
  z-index: 2;
}
/* Horizontal swipe layout — one page per viewport width, scroll-snap for native touch */
.rm-pdf-pages {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  height: 100%;
  width: 100%;
  scrollbar-width: none;            /* hide scrollbar (Firefox) */
}
.rm-pdf-pages::-webkit-scrollbar { display: none; }   /* hide scrollbar (Chrome/Safari) */

.rm-pdf-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;          /* always snap to next page (skip momentum) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  box-sizing: border-box;
}
.rm-pdf-page {
  display: block;
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .25);
  -webkit-touch-callout: none;
}

/* Nav buttons (prev/next) — overlaid on left/right edges of viewer */
.rm-pdf-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, .12);
  color: #FBF3D6;
  border: 0;
  width: 48px; height: 48px;
  border-radius: 50%;
  font-size: 1.8rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 3;
  transition: background .2s, opacity .2s;
  user-select: none;
}
.rm-pdf-nav-btn:hover { background: rgba(255, 255, 255, .22); }
.rm-pdf-nav-btn:disabled { opacity: .25; cursor: default; }
.rm-pdf-nav-prev { left: 14px; }
.rm-pdf-nav-next { right: 14px; }

.rm-pdf-counter {
  font-size: .82rem;
  font-family: -apple-system, system-ui, sans-serif;
  color: rgba(251, 243, 214, .65);
  margin-right: 10px;
}
@media (max-width: 700px) {
  .rm-pdf-modal { padding: 12px; }
  .rm-pdf-modal-hint { display: none; }
  .rm-pdf-viewer { padding: 10px; }
}

/* Mobile: collapse GrapesJS-generated multi-column grids to single column.
   CMS content often has inline grid-template-columns:repeat(N,1fr) which would
   produce very cramped columns on phones. These selectors win via !important
   because inline styles otherwise beat normal CSS rules. */
@media (max-width: 700px) {
  [style*="grid-template-columns:repeat(3,1fr)"],
  [style*="grid-template-columns: repeat(3, 1fr)"],
  [style*="grid-template-columns:repeat(3, 1fr)"],
  [style*="grid-template-columns: repeat(3,1fr)"],
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"],
  [style*="grid-template-columns:repeat(4, 1fr)"],
  [style*="grid-template-columns: repeat(4,1fr)"] {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   About page (/page/about) — visual polish
   Targets the GrapesJS-generated IDs on the about page.
   Scoped to .page-about so it never bleeds elsewhere.
   ============================================================ */

/* Section header (关于儒明学轩) */
.page-about #i6nl {
  font-size: 2.2rem;
  letter-spacing: .12em;
  display: inline-block;
  padding-bottom: 12px;
  border-bottom: 3px solid #C9A961;
  margin-bottom: 28px;
  text-transform: none;
}

/* Mission / Vision / Value cards */
.page-about #ijmce {
  gap: 28px;
  margin-top: 12px;
}
.page-about #iqnzi,
.page-about #i7wqf,
.page-about #in2z9 {
  background: #FFFFFF !important;
  box-shadow: 0 8px 24px rgba(15, 26, 46, 0.08);
  border-top: 4px solid #C9A961;
  padding: 40px 28px !important;
  transition: transform .3s ease, box-shadow .3s ease;
}
.page-about #iqnzi:hover,
.page-about #i7wqf:hover,
.page-about #in2z9:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(15, 26, 46, 0.12);
}
.page-about #i19a6,
.page-about #iieuz,
.page-about #i9x73 {
  font-size: 1.75rem !important;
  margin-bottom: 18px !important;
  letter-spacing: .08em;
}
.page-about #i19a6::after,
.page-about #iieuz::after,
.page-about #i9x73::after {
  content: '';
  display: block;
  width: 28px;
  height: 2px;
  background: #C9A961;
  margin: 8px auto 0;
}
.page-about #ihnao,
.page-about #im7rc,
.page-about #i4u0q {
  font-size: 1.2rem !important;
  line-height: 1.85 !important;
  color: #4A4A4A;
}
.page-about #imf8bx,
.page-about #i3803w {
  font-size: inherit !important;
}

/* Founder section title (儒明学轩创始人 · 沈顺福老师) */
.page-about #iskzxk {
  margin: 80px 0 32px !important;
  font-size: 1.5rem !important;
}
.page-about #iskzxk h3 {
  display: inline-block;
  padding: 0 32px 14px;
  border-bottom: 2px solid #C9A961;
  letter-spacing: .05em;
  margin: 0;
}

/* Founder bio panel — warm cream gradient with photo (left) + bio text (right) */
.page-about #i191k {
  background: linear-gradient(180deg, #FBF6E8 0%, #F5EBD3 100%) !important;
  border-radius: 16px !important;
  margin: 24px 5% !important;
  padding: 56px 6% !important;
  box-shadow: 0 8px 28px rgba(15, 26, 46, 0.06);
}

/* Override default .gjs-row flex with a clean 2-column grid (text + photo).
   Text goes in the wider left column, photo in the fixed-width right column.
   The DOM order is photo-first / text-last; CSS `order` swaps them visually. */
.page-about #i191k .gjs-row {
  display: grid !important;
  grid-template-columns: 1fr 420px !important;
  gap: 56px !important;
  align-items: start !important;
  padding: 0 !important;
  flex-wrap: nowrap !important;
}

/* Photo cell (first in DOM) — but rendered on the RIGHT via order:2 */
.page-about #i191k .gjs-cell:first-child {
  flex: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  order: 2 !important;
}
/* Hide GrapesJS' empty placeholder divs that sit before the <img> in this cell —
   they were pushing the photo down so its top didn't line up with the 1954 paragraph. */
.page-about #i191k .gjs-cell:first-child > div:empty {
  display: none !important;
}
.page-about #i191k .gjs-cell:first-child img {
  width: 100% !important;
  height: auto !important;
  border-radius: 12px !important;
  display: block !important;
  box-shadow: 0 12px 32px rgba(15, 26, 46, 0.18);
  margin: 0 !important;
}

/* Hide the empty middle spacer cell that GrapesJS may have inserted */
.page-about #i191k .gjs-cell:nth-child(2):not(:last-child) {
  display: none !important;
}

/* Text cell (last in DOM) — but rendered on the LEFT via order:1 */
.page-about #i191k .gjs-cell:last-child {
  flex: none !important;
  min-width: 0 !important;
  font-size: 1.1rem !important;
  line-height: 1.95 !important;
  color: #4A4A4A !important;
  font-family: 'Noto Serif SC', serif;
  order: 1 !important;
}
.page-about #i191k .gjs-cell:last-child div,
.page-about #i191k .gjs-cell:last-child span {
  font-size: inherit !important;
  line-height: inherit !important;
}

/* Year prefix — darker gold and bold (matches image 1 reference) */
.page-about #i191k strong {
  color: #8B6F2F !important;
  font-weight: 700 !important;
  letter-spacing: .03em;
  margin-right: 2px;
}

/* Dashed dividers between each year-paragraph.
   NOTE: #i2832-2-2 (1997) wraps #iv8jh-2-2 (2010) in the DOM, so we can't put
   a border-bottom on 1997 — that border would end up below 2010 and duplicate
   2010's own border. Instead, the 1997→2010 divider is the border-TOP of 2010. */
.page-about #iyejca,
.page-about #is31v-2-2,
.page-about #iv8jh-2-2 {
  display: block !important;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px dashed rgba(201, 169, 97, 0.4);
}
.page-about #i2832-2-2 {
  display: block !important;
}
.page-about #iv8jh-2-2 {
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px dashed rgba(201, 169, 97, 0.4);
}
.page-about #i6anx2 {
  display: block !important;
}
/* Hide the loose <br> tags inside the bio container so spacing comes from the
   block-level padding above instead — they cause double-gaps with our dividers */
.page-about #i89drw > br,
.page-about #i9olsq-2 > br,
.page-about #i2832-2-2 > br,
.page-about #iv8jh-2-2 > br {
  display: none !important;
}

/* Stack on mobile */
@media (max-width: 900px) {
  .page-about #i191k .gjs-row {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .page-about #i191k .gjs-cell:first-child img {
    max-width: 280px;
    margin: 0 auto;
  }
}

/* Quote block — center, decorate, style attribution */
.page-about #isw42c {
  float: none !important;
  margin: 56px auto !important;
  max-width: 720px;
  padding: 44px 48px !important;
  text-align: center !important;
  font-size: 1.3rem !important;
  line-height: 1.85 !important;
  border-left: none !important;
  border-radius: 16px !important;
  background: linear-gradient(135deg, #FBF6E8 0%, #F5EBD3 100%) !important;
  position: relative;
  overflow: visible;
}
.page-about #isw42c::before {
  content: '\201C';
  position: absolute;
  top: -8px;
  left: 28px;
  font-size: 5.5rem;
  color: rgba(201, 169, 97, 0.4);
  font-family: Georgia, 'Noto Serif SC', serif;
  line-height: 1;
  font-style: normal;
}
.page-about #isw42c .rm-cite,
.page-about #isw42c cite {
  display: block;
  margin-top: 20px;
  font-size: 1rem !important;
  color: #8B6F2F !important;
  font-style: normal !important;
  letter-spacing: .2em;
  font-weight: 500;
  text-align: right;
  padding-right: 8px;
}

/* Spacer between sections */
.page-about #idubfi { height: 60px !important; }

/* Mobile */
@media (max-width: 800px) {
  .page-about #ijmce { grid-template-columns: 1fr !important; gap: 20px !important; }
  .page-about #i6nl { font-size: 1.7rem !important; }
  .page-about #isw42c { padding: 32px 24px !important; font-size: 1.1rem !important; }
}
