/* St. Maria College shared shell (loaded after theme.css): navigation, login, page frames, common stationery
   components, toasts and motion states. Page styles build on these classes. */
:root {
  --page-max: 1180px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur-fast: .16s; --dur: .28s;
  --shadow-paper: 3px 4px 0 rgba(0,0,0,.2), 0 18px 28px -14px rgba(0,0,0,.6);
}

/* ---------- top navigation (one letterhead for every place) ---------- */
#college-nav { position: sticky; top: 0; z-index: 30; }
.college-top { display: flex; align-items: center; gap: 18px; min-height: 60px; padding: 6px 18px 6px 12px; background: var(--red); color: var(--cream); position: relative; box-shadow: 0 3px 0 var(--red-deep); }
.college-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 6px; background: repeating-linear-gradient(90deg, var(--gold) 0 14px, transparent 14px 20px); opacity: .9; pointer-events: none; }
.college-brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; flex: none; }
.college-brand svg { width: 32px; height: 39px; transform: rotate(-4deg); filter: drop-shadow(1px 2px 0 rgba(0,0,0,.25)); }
.college-brand .n { display: grid; line-height: 1.05; }
.college-brand .en { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: .01em; }
.college-brand .cn { font-family: var(--zh); font-weight: 700; font-size: 10.5px; letter-spacing: .45em; color: var(--gold-soft); margin-top: 3px; }
.college-places { display: flex; gap: 4px; margin-left: 8px; }
.college-places a { display: grid; justify-items: center; padding: 5px 13px 4px; border-radius: 4px; color: var(--cream); text-decoration: none; line-height: 1.15; }
.college-places a:hover { background: rgba(0,0,0,.16); }
.college-places a.on { background: var(--paper); color: var(--red-deep); box-shadow: 2px 2px 0 rgba(0,0,0,.25); }
.nav-zh { font-family: var(--zh); font-weight: 700; font-size: 15px; }
.nav-en { font-family: var(--label); font-size: 8.5px; letter-spacing: .18em; opacity: .75; }
.nav-account { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-me { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.nav-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--red-deep); font-weight: 700; font-size: 13px; box-shadow: 0 0 0 2px var(--cream); flex: none; }
.nav-logout, .nav-login { margin-left: auto; background: none; border: 1px solid rgba(243,231,210,.5); color: var(--cream); padding: 5px 12px; border-radius: 4px; font-size: 13px; text-decoration: none; box-shadow: none; font-weight: 400; }
.nav-account .nav-logout { margin-left: 0; }
.nav-logout:hover, .nav-login:hover { background: rgba(0,0,0,.18) !important; }

/* ---------- page frame ---------- */
.college-page { max-width: var(--page-max); margin: 0 auto; padding: 26px 18px 40px; }
.page-head { color: var(--cream); margin: 6px 0 22px; }
.page-head .eyebrow { color: var(--gold); }
.page-head h1 { font-family: var(--zh); font-weight: 900; font-size: 32px; margin: 4px 0 2px; color: var(--paper); text-shadow: 2px 2px 0 rgba(0,0,0,.35); }
.page-head p { margin: 0; color: var(--gold-soft); }
.college-foot { text-align: center; margin: 36px 0 18px; font-family: var(--label); font-size: 10.5px; letter-spacing: .2em; color: var(--gold-soft); opacity: .85; }
.college-foot a { color: var(--gold-soft); }

/* ---------- stationery components ---------- */
.paper { position: relative; background: var(--paper); color: var(--ink); padding: 22px 24px; border-top: 6px solid var(--red); box-shadow: var(--shadow-paper); }
.paper.lined { background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(36,48,75,.07) 27px 28px); }
.paper.green { border-top-color: var(--green); } .paper.gold { border-top-color: var(--gold); } .paper.navy { border-top-color: var(--navy); }
.paper h2 { margin-top: 0; }
.tilt-l { transform: rotate(-.6deg); } .tilt-r { transform: rotate(.5deg); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 3px; background: var(--cream); color: var(--brown); white-space: nowrap; }
.tag.red { background: var(--red); color: var(--cream); } .tag.green { background: var(--green); color: var(--cream); }
.tag.gold { background: var(--gold-soft); color: var(--brown); } .tag.navy { background: var(--navy); color: var(--cream); }
.tag.muted { background: #ece4d6; color: var(--muted); }
.demo-flag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--red-deep); background: var(--gold-soft); border: 1px dashed var(--red); padding: 0 6px; border-radius: 3px; }
.empty-note { text-align: center; color: var(--muted); padding: 30px 12px; }
.empty-note img { width: 80px; display: block; margin: 0 auto 8px; }
.empty-note b { display: block; font-family: var(--zh); color: var(--green-deep); font-size: 16px; margin-bottom: 4px; }
.loading-note { color: var(--muted); padding: 24px; text-align: center; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.small-btn { padding: 5px 12px; font-size: 13px; box-shadow: none; }
.link-btn { background: none; border: 0; box-shadow: none; color: var(--red); padding: 0; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover:not(:disabled) { background: none; color: var(--red-deep); }
.rich { line-height: 1.85; overflow-wrap: anywhere; }
.rich img { max-width: 100%; height: auto; }
.rich a { color: var(--red); }

/* ---------- login ---------- */
.login-wrap { display: grid; place-items: center; padding: 40px 0; }
.login-card { width: min(420px, 100%); padding: 34px 32px 24px; transform: rotate(-.6deg); background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(36,48,75,.08) 27px 28px); }
.pin::before { content: ""; position: absolute; top: -14px; left: 50%; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #E8888F, var(--red) 60%, var(--red-deep)); box-shadow: 1px 3px 3px rgba(0,0,0,.35); }
.login-card .stamp { position: absolute; right: 20px; top: 22px; transform: rotate(8deg); border: 2px solid var(--red); color: var(--red); padding: 2px 8px; font-family: var(--label); font-size: 10px; letter-spacing: .14em; opacity: .65; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-brand svg { width: 44px; height: 54px; transform: rotate(-4deg); }
.login-brand b { display: block; font-family: var(--display); font-size: 24px; color: var(--red); line-height: 1; }
.login-brand small { display: block; font-family: var(--zh); font-weight: 700; font-size: 12px; letter-spacing: .5em; color: var(--green); margin-top: 6px; }
.login-card h1 { font-size: 22px; margin: 0 0 2px; }
.login-card .lead { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.login-card .field { display: grid; gap: 6px; margin-bottom: 12px; }
.login-card .field span { font-size: 13px; font-weight: 700; color: var(--brown); }
.primary-wide { width: 100%; height: 42px; margin-top: 6px; }
.login-error { color: var(--red); font-size: 13px; min-height: 18px; margin: 8px 0 0; }
.login-foot { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 12.5px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted); }

/* ---------- toast ---------- */
.college-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) rotate(-1deg); z-index: 60; max-width: calc(100% - 32px);
  background: var(--gold-soft); color: var(--brown); padding: 10px 18px; box-shadow: 2px 4px 0 rgba(0,0,0,.25); }
.college-toast[data-kind="error"] { background: var(--red); color: var(--cream); }

/* ---------- motion states (hooks for a later animation layer) ---------- */
[data-motion] { transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
[data-motion][data-motion-state="entering"] { opacity: 0; translate: 0 8px; }
[data-motion][data-motion-state="entered"] { opacity: 1; translate: 0 0; }
[data-motion][data-motion-state="leaving"] { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
  [data-motion][data-motion-state="entering"] { opacity: 1; translate: none; }
}

@media (max-width: 760px) {
  .college-top { gap: 8px; padding: 6px 10px; flex-wrap: wrap; }
  .college-brand .cn { display: none; }
  .college-brand .en { font-size: 16px; }
  .college-places { order: 3; width: 100%; margin: 0; justify-content: space-between; padding-bottom: 6px; }
  .college-places a { flex: 1; padding: 4px 2px; }
  .nav-en { display: none; }
  .nav-name { display: none; }
  .college-page { padding: 22px 12px 34px; }
  .page-head h1 { font-size: 26px; }
  .paper { padding: 18px 16px; }
  .login-card { padding: 30px 20px 22px; transform: none; }
}
