/* ---------------------------------------------------------------------------
 * Blue-and-white theme: porcelain cobalt, a seal, and an ink scroll.
 *
 * Switched on by `theme_cn: true` in _config.yml. Nothing here changes layout
 * or markup — only colour, type, and two decorations — so turning the flag off
 * returns the site to stock with no other edits.
 *
 * The palette is 青花: cobalt on a cool porcelain white. The seal stays
 * cinnabar red, which is how a seal is actually struck on a blue-and-white
 * piece, and is the one warm note on the page.
 *
 * Background: Wang Hui (王翚), Landscape, dated 1693, The Metropolitan Museum
 * of Art, public domain (CC0). De-saturated in the file itself rather than
 * with a CSS filter: the painting's aged-silk warmth fights a cool page, and
 * baking it in costs nothing at render time.
 * ------------------------------------------------------------------------- */

:root {
  --cn-ground:   #eef2f7;   /* page */
  --cn-card:     #fcfdff;   /* card face */
  --cn-line:     #d7e0ec;   /* hairlines, replacing card shadows */
  --cn-ink:      #1b2430;   /* body text and headings */
  --cn-muted:    #64707f;
  --cn-cobalt:   #27477f;   /* links, accents — the 青花 blue */
  --cn-cobalt-d: #1a3160;   /* hover */
  --cn-seal:     #9e2b25;   /* cinnabar */
}

body, body.bg-light { background: var(--cn-ground) !important; color: var(--cn-ink); }

/* 80%, not opaque: the scroll behind runs under the right-hand cards, and at
 * this level it reads through them as a wash without touching the legibility
 * of the text sitting on top. */
.card, .bg-white {
  background: rgba(252, 253, 255, .80) !important;
  border: 1px solid var(--cn-line) !important;
  box-shadow: none !important;
}

.navbar {
  background: rgba(238, 242, 247, .92) !important;
  border-bottom: 1px solid var(--cn-line);
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .navbar-brand {
  font-family: Georgia, "Songti SC", "SimSun", serif !important;
  color: var(--cn-ink);
  letter-spacing: .01em;
}

a { color: var(--cn-cobalt); }
a:hover { color: var(--cn-cobalt-d); }
hr { border-top: 1px solid var(--cn-line); }
.text-muted { color: var(--cn-muted) !important; }
.figure-img, .img-thumbnail { border: 1px solid var(--cn-line); background: var(--cn-card); padding: 4px; }

.research-interest-box {
  background: rgba(242, 246, 252, .85) !important;
  border-left: 3px solid var(--cn-cobalt) !important;
  border-radius: 2px !important;
}

/* Buttons and the deadline page's blue, moved onto the cobalt so the two
 * pages do not run different blues against each other. */
.btn-primary { background: var(--cn-cobalt) !important; border-color: var(--cn-cobalt) !important; }
.deadline-promo { background: linear-gradient(120deg, #e8eef8 0%, #f4f8fd 100%); border-color: var(--cn-line); }
.deadline-promo-icon { background: var(--cn-cobalt); }
.deadline-promo-body h5, .deadline-promo-cta { color: var(--cn-cobalt); }
.ddl-filter-btn:hover { border-color: #8fa6cd; color: var(--cn-cobalt); }
.ddl-filter-btn.active { background: var(--cn-cobalt); border-color: var(--cn-cobalt); }

/* The seal, struck in the corner of the name card the way one is struck on a
 * painting. Drawn in CSS: no request, sharp at any pixel density. The card is
 * the only sticky-top one on the homepage, so the hook needs no markup change. */
.sticky-top .card { position: relative; }
.sticky-top .card::after {
  content: "龚";
  position: absolute;
  top: 14px;
  right: 14px;
  font-family: "Songti SC", "SimSun", serif;
  font-size: 1rem;
  line-height: 1;
  color: var(--cn-card);
  background: var(--cn-seal);
  border-radius: 3px;
  padding: .3rem .32rem .24rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}

/* The scroll hangs on the right, overlapping the edge of the content column
 * rather than sitting entirely in the margin — with the cards at 90% it shows
 * through them, which is the point. Below 1400px there is no margin to hang it
 * in and it would sit squarely under the text, so it is not drawn at all. */
@media (min-width: 1400px) {
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: url("../images/etc/ink_scroll.webp") no-repeat right 7vw bottom 0;
    background-size: auto 92%;
    opacity: .5;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
            mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
  }
  body > * { position: relative; z-index: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  /* nothing animated here; declared so the rule above stays easy to find */
}
