/* Additions on top of the captured WordPress styles: language switcher + "Chinese only" notice. */

.ewova-lang {
  position: relative;
  display: flex;
  align-items: center;
}

/* Keep the switcher beside the 註冊 / 登入 button instead of wrapping above it. */
.wp-block-buttons:has(> .ewova-lang) {
  flex-wrap: nowrap;
  align-items: center;
}

.wp-block-buttons:has(> .ewova-lang) .wp-block-button__link {
  white-space: nowrap;
}

.ewova-lang summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.ewova-lang summary::-webkit-details-marker {
  display: none;
}

.ewova-lang summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.ewova-lang ul {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 100;
  min-width: 150px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.18);
}

.ewova-lang li a,
.ewova-lang li span {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: #1d1d29;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.ewova-lang li a:hover,
.ewova-lang li a:focus-visible {
  background: #f0eefa;
}

.ewova-lang li span[aria-current] {
  color: #7b61ff;
}

/* Menu labels were sized for 4-character Chinese words; keep translated labels on one line. */
html:not([lang^="zh"]) .wp-block-navigation-item__label {
  white-space: nowrap;
  word-break: keep-all;
}

html:not([lang^="zh"]) .superbthemes-navigation-three-columns-nav .wp-block-navigation__container {
  gap: 0.4em 1.1em;
}

@media (min-width: 1025px) and (max-width: 1280px) {
  html:not([lang^="zh"]) .superbthemes-navigation-three-columns-nav .wp-block-navigation-item__label {
    font-size: 0.85em;
  }
}

.ewova-lang-note {
  padding: 10px 14px;
  border-radius: 8px;
  background: rgb(123 97 255 / 0.1);
  font-size: 0.9em;
}

/* Below 1024px the theme hides the button column; the copy next to the menu button takes over. */
.ewova-lang--mobile {
  display: none;
}

@media only screen and (max-width: 1024px) {
  .ewova-lang--mobile {
    display: flex;
    margin-right: 12px;
  }
}

@media (max-width: 600px) {
  .ewova-lang summary span {
    display: none;
  }

  .ewova-lang summary {
    padding: 6px 8px;
  }
}

/* ---------------------------------------------------------------------------
   Announcements (/blog/, /category/<tag>/, /blog/<id>/) — "magazine" layout (src/lib/render.ts).
   Themed per site: .com = the purple space of its home page, nuk = a light sky under the blue header.
   --------------------------------------------------------------------------- */
[data-site="com"] {
  --nw-ink: #fff;
  --nw-text: rgba(255, 255, 255, 0.8);
  --nw-muted: rgba(255, 255, 255, 0.58);
  --nw-card: rgba(24, 14, 58, 0.55);
  --nw-border: rgba(255, 255, 255, 0.12);
  --nw-border-hover: rgba(192, 132, 252, 0.55);
  --nw-shadow: 0 24px 48px rgba(10, 4, 30, 0.45);
  --nw-shadow-hover: 0 24px 56px rgba(124, 58, 237, 0.35);
  --nw-accent: #d8b4fe;
  --nw-accent-bg: linear-gradient(135deg, #a855f7, #6366f1);
  --nw-tabs: rgba(255, 255, 255, 0.08);
  --nw-tab: rgba(255, 255, 255, 0.78);
  --nw-rule: rgba(255, 255, 255, 0.12);
}
[data-site="nuk"] {
  --nw-ink: #0a284b;
  --nw-text: #334155;
  --nw-muted: #64748b;
  --nw-card: #fff;
  --nw-border: #dbe8f8;
  --nw-border-hover: #9cc7f7;
  --nw-shadow: 0 12px 32px rgba(31, 124, 236, 0.08);
  --nw-shadow-hover: 0 20px 44px rgba(31, 124, 236, 0.18);
  --nw-accent: #1f7cec;
  --nw-accent-bg: linear-gradient(135deg, #3993ff, #1f7cec);
  --nw-tabs: #fff;
  --nw-tab: #334155;
  --nw-rule: #e6eef8;
}
[data-site="com"] body:has(.nw) {
  background: linear-gradient(180deg, rgba(14, 8, 40, 0.15) 0%, rgba(14, 8, 40, 0.75) 70%, #0e0828 100%),
    url(/wp-content/uploads/2025/01/indexbg3.jpg) center top / cover fixed, #0e0828 !important;
}
[data-site="nuk"] body:has(.nw) {
  background: linear-gradient(180deg, rgba(31, 124, 236, 0.08) 0%, rgba(31, 124, 236, 0.22) 100%),
    url(/wp-content/uploads/2025/01/indexbg-edu-02-scaled.png) center top / cover fixed, #8fc1ff !important;
}
/* on nuk's sky photo the page heading reads like the home page's white slogans */
[data-site="nuk"] .nw-head h1 { color: #fff !important; text-shadow: 0 2px 12px rgba(10, 40, 75, 0.35); }
[data-site="nuk"] .nw-eyebrow { color: #fff; text-shadow: 0 1px 6px rgba(10, 40, 75, 0.35); }

/* nuk's footer text is white (made for the slate body); on the light sky it needs to be dark. */
[data-site="nuk"] body:has(.nw) footer p,
[data-site="nuk"] body:has(.nw) footer a,
[data-site="nuk"] body:has(.nw) footer span { color: var(--nw-ink) !important; }

.nw {
  box-sizing: border-box;
  width: 100%;
  margin: 40px auto 96px !important;
  font-family: inherit;
  color: var(--nw-text);
}
.nw-list { max-width: 1200px !important; }
.nw-post { max-width: 920px !important; }
.nw *, .nw *::before, .nw *::after { box-sizing: border-box; }
.nw a { text-decoration: none !important; }

/* heading + category tabs */
.nw-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.nw-eyebrow { margin-bottom: 6px; font-size: 13px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--nw-accent); }
.nw-head h1 { margin: 0 !important; font-size: clamp(34px, 4vw, 48px) !important; font-weight: 800 !important; line-height: 1.1 !important; letter-spacing: -0.01em; color: var(--nw-ink) !important; }
.nw-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; border: 1px solid var(--nw-border); border-radius: 999px; background: var(--nw-tabs); backdrop-filter: blur(12px); }
.nw-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; font-size: 14px !important; font-weight: 600; color: var(--nw-tab) !important; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.nw-tab small { font-size: 12px; font-weight: 600; opacity: 0.6; }
.nw-tab:hover { color: var(--nw-ink) !important; background: rgba(127, 127, 127, 0.12); }
.nw-tab.is-on { background: var(--nw-accent-bg); color: #fff !important; box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3); }
.nw-tab.is-on small { opacity: 0.8; }

/* chips + meta line */
.nw-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--nw-muted); font-variant-numeric: tabular-nums; }
.nw-chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px !important; font-weight: 700; line-height: 1; white-space: nowrap; }
[data-site="com"] .nw-chip--system { background: rgba(129, 140, 248, 0.22); color: #c7d2fe !important; }
[data-site="com"] .nw-chip--update { background: rgba(192, 132, 252, 0.22); color: #ead5ff !important; }
[data-site="com"] .nw-chip--maintenance { background: rgba(251, 191, 36, 0.2); color: #fde68a !important; }
[data-site="com"] .nw-chip--event { background: rgba(52, 211, 153, 0.2); color: #a7f3d0 !important; }
[data-site="nuk"] .nw-chip--system { background: #e0e7ff; color: #3730a3 !important; }
[data-site="nuk"] .nw-chip--update { background: #e0efff; color: #1d4f91 !important; }
[data-site="nuk"] .nw-chip--maintenance { background: #fef3c7; color: #92400e !important; }
[data-site="nuk"] .nw-chip--event { background: #d1fae5; color: #065f46 !important; }
.nw-chip--pinned { background: var(--nw-accent-bg); color: #fff !important; }
a.nw-chip:hover { filter: brightness(1.1); }

/* surfaces */
.nw-lead, .nw-card, .nw-post__card {
  border: 1px solid var(--nw-border);
  background: var(--nw-card);
  box-shadow: var(--nw-shadow);
  backdrop-filter: blur(14px);
}
.nw-lead, .nw-card { transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s; }
.nw-lead:hover, .nw-card:hover { transform: translateY(-4px); border-color: var(--nw-border-hover); box-shadow: var(--nw-shadow-hover); }
.nw-lead img, .nw-card img { transition: transform 0.5s; }
.nw-lead:hover img, .nw-card:hover img { transform: scale(1.04); }

/* lead (newest) */
.nw-lead { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); overflow: hidden; margin-bottom: 28px; border-radius: 26px; color: var(--nw-text) !important; }
.nw-lead__img { display: block; overflow: hidden; }
.nw-lead__img img { display: block; width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.nw-lead__body { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 40px; }
.nw-lead__title { font-size: clamp(24px, 2.5vw, 32px); font-weight: 800; line-height: 1.3; letter-spacing: -0.01em; color: var(--nw-ink); }
.nw-lead__sub { font-size: 16px; line-height: 1.65; color: var(--nw-text); }
.nw-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 15px; font-weight: 700; color: var(--nw-accent); transition: gap 0.2s; }
.nw-lead:hover .nw-more { gap: 10px; }

/* grid */
.nw-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.nw-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; color: var(--nw-text) !important; }
.nw-card__img { display: block; overflow: hidden; }
.nw-card__img img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.nw-card__body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 22px; }
.nw-card__title { display: -webkit-box; overflow: hidden; font-size: 17px; font-weight: 700; line-height: 1.45; color: var(--nw-ink); -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nw-card__sub { display: -webkit-box; overflow: hidden; font-size: 14px; line-height: 1.6; color: var(--nw-muted); -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nw-empty { padding: 64px 0; text-align: center; color: var(--nw-muted) !important; }

/* post page */
.nw-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; padding: 8px 16px 8px 12px; border: 1px solid var(--nw-border); border-radius: 999px; background: var(--nw-tabs); backdrop-filter: blur(12px); font-size: 14px !important; font-weight: 600; color: var(--nw-ink) !important; transition: color 0.15s, border-color 0.15s; }
.nw-back:hover { color: var(--nw-accent) !important; border-color: var(--nw-border-hover); }
.nw-post__card { overflow: hidden; border-radius: 28px; }
.nw-post__cover img { display: block; width: 100%; max-height: 520px; object-fit: cover; }
.nw-post__inner { padding: 40px 48px 52px; }
.nw-post__head { margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--nw-rule); }
.nw-post__head h1 { margin: 14px 0 0 !important; font-size: clamp(28px, 3.4vw, 40px) !important; font-weight: 800 !important; line-height: 1.3 !important; letter-spacing: -0.01em; color: var(--nw-ink) !important; overflow-wrap: anywhere; }
.nw-post__sub { margin: 12px 0 0 !important; font-size: 17px !important; line-height: 1.6 !important; color: var(--nw-muted) !important; }
.nw-post .ewova-lang-note { margin: 0 0 20px !important; }

/* post body */
.nw-prose { font-size: 16px; line-height: 1.85; color: var(--nw-text); overflow-wrap: anywhere; }
.nw-prose > :first-child { margin-top: 0 !important; }
.nw-prose p, .nw-prose ol, .nw-prose ul { margin: 10px 0 !important; font-size: 16px !important; line-height: 1.85 !important; color: var(--nw-text) !important; }
.nw-prose ol, .nw-prose ul { padding-left: 1.5em !important; }
.nw-prose li { margin: 4px 0 !important; color: var(--nw-text) !important; }
.nw-prose h1, .nw-prose h2, .nw-prose h3, .nw-prose h4 { color: var(--nw-ink) !important; font-weight: 800 !important; line-height: 1.4 !important; letter-spacing: 0; }
.nw-prose h1 { margin: 36px 0 12px !important; font-size: 26px !important; }
.nw-prose h2 { margin: 32px 0 12px !important; font-size: 22px !important; }
.nw-prose h3 { margin: 28px 0 10px !important; font-size: 19px !important; }
.nw-prose h4 { margin: 22px 0 8px !important; font-size: 17px !important; }
.nw-prose strong, .nw-prose b { color: var(--nw-ink) !important; font-weight: 700; }
.nw-prose a { color: var(--nw-accent) !important; font-weight: 600; text-decoration: underline !important; text-decoration-thickness: 1px !important; text-underline-offset: 4px; }
.nw-prose blockquote { margin: 12px 0 !important; padding: 2px 0 2px 16px !important; border-left: 3px solid var(--nw-border-hover) !important; font-style: normal; color: var(--nw-text) !important; }
.nw-prose hr { margin: 28px 0; border: 0; border-top: 1px solid var(--nw-rule); }
.nw-prose img, .nw-prose video { max-width: 100%; height: auto; border-radius: 14px; }
.nw-prose iframe { max-width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; }
.nw-prose p:empty, .nw-prose h2:empty, .nw-prose h3:empty { display: none; }
/* old posts mark text with an inline highlighter colour; keep that text dark on both themes */
.nw-prose [style*="background-color"], .nw-prose [style*="background-color"] * { color: #1e1b4b !important; }

@media (max-width: 900px) {
  .nw-lead { grid-template-columns: 1fr; }
  .nw-lead__body { padding: 24px; }
  .nw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
}
@media (max-width: 600px) {
  .nw { margin-top: 20px !important; }
  .nw-head { align-items: stretch; flex-direction: column; flex-wrap: nowrap; }
  .nw-head > * { min-width: 0; max-width: 100%; }
  .nw-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .nw-grid { grid-template-columns: 1fr; }
  .nw-post__inner { padding: 24px 20px 32px; }
  .nw-post__card { border-radius: 20px; }
}

/* .com home 最新消息: the three newest announcements (filled at build time; the section is dark) */
.ewova-home-news { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 16px; }
.ewova-home-news__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff !important;
  text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s;
}
.ewova-home-news__row:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.3); }
.ewova-home-news__meta { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, 0.65); }
.ewova-home-news__meta time { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ewova-home-news__title { font-size: 15px; font-weight: 600; line-height: 1.45; }
.ewova-home-news__cover { display: block; overflow: hidden; border-radius: 16px; }
.ewova-home-news__cover img { display: block; width: 100%; height: auto; }
