/* Huaxia Merged 1.10.0: touches adopted from Danqing Modern, rebuilt on Huaxia's own colour variables
   so dark mode and all 14 palettes keep working. */

/* Reading progress bar (single posts) */
.hxm-progress{position:fixed;top:0;left:0;right:0;height:3px;z-index:10000;pointer-events:none;background:transparent}
.hxm-progress__bar{display:block;height:100%;width:100%;transform:scaleX(0);transform-origin:0 50%;background:linear-gradient(90deg,var(--gold,#c8a97e),var(--red,#ac332a));will-change:transform}
.admin-bar .hxm-progress{top:32px}
@media (max-width:782px){.admin-bar .hxm-progress{top:46px}}

/* Sticky header with a light backdrop blur */
.hx-site-header.hxm-sticky{position:sticky;top:0;z-index:900;background:color-mix(in srgb,var(--paper,#faf8f3) 86%,transparent);-webkit-backdrop-filter:saturate(1.4) blur(10px);backdrop-filter:saturate(1.4) blur(10px);transition:box-shadow .25s ease}
.hx-site-header.hxm-sticky.hxm-scrolled{box-shadow:0 6px 22px rgba(16,39,53,.08)}
html[data-theme="dark"] .hx-site-header.hxm-sticky{background:color-mix(in srgb,var(--paper,#0f171d) 84%,transparent)}
html[data-theme="dark"] .hx-site-header.hxm-sticky.hxm-scrolled{box-shadow:0 6px 22px rgba(0,0,0,.45)}
@supports not (background:color-mix(in srgb,red 50%,transparent)){.hx-site-header.hxm-sticky{background:var(--paper,#faf8f3)}}
.admin-bar .hx-site-header.hxm-sticky{top:32px}
@media (max-width:782px){.admin-bar .hx-site-header.hxm-sticky{top:46px}}
@media (max-width:600px){.admin-bar .hx-site-header.hxm-sticky{top:0}}
/* Anchors are not hidden under the sticky header */
#primary,#discover,.hx-reader-prose :is(h2,h3,h4)[id]{scroll-margin-top:96px}

/* Search pop-up: Danqing's red top rule and softer backdrop on Huaxia's native, focus-trapping dialog */
body.hx-refresh .hx-search-dialog{border-top:3px solid var(--red,#ac332a);border-radius:6px}
body.hx-refresh .hx-search-dialog::backdrop{background:rgba(10,20,28,.55);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}

/* Split homepage lead: painting left and whole at 16:9, copy right, in a quiet card */
.hx-lead.hxm-lead--split{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:0;padding:0;border:none !important;border-radius:6px;overflow:hidden;background:var(--white,#fff);margin-top:28px;margin-bottom:8px;min-height:0;box-shadow:none !important}
html[data-theme="dark"] .hx-lead.hxm-lead--split{background:color-mix(in srgb,var(--paper) 92%,#fff 8%)}
.hxm-lead--split .hx-lead-art{order:-1;align-self:stretch;display:flex;align-items:center;background:#ffffff !important}
.hxm-lead--split .hx-lead-art img{width:100%;height:auto;min-height:0;aspect-ratio:16/9;object-fit:contain;object-position:50% 50%}
.hxm-lead--split .hx-lead-copy{padding:40px 44px 0 44px;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start}
.hxm-lead--split h2{font-size:clamp(30px,2.9vw,42px)}
/* Classic lead also keeps the painting whole (no hard crop to 16:10) */
.hx-lead:not(.hxm-lead--split) .hx-lead-art{align-self:center}
.hx-lead:not(.hxm-lead--split) .hx-lead-art img{height:auto;min-height:0;aspect-ratio:16/9;object-fit:contain;background:#ffffff !important}
@media (max-width:950px){
  .hx-lead.hxm-lead--split{grid-template-columns:1fr}
  .hxm-lead--split .hx-lead-copy{padding:28px 24px 30px}
}
@media (max-width:600px){
  .hx-lead.hxm-lead--split{margin-top:16px;border-radius:4px}
  .hxm-lead--split .hx-lead-copy{padding:22px 18px 26px}
}

/* Squircle Read Article Button for Huaxia */
.hx-primary-button,
.hxm-lead--split .hx-primary-button {
  border-radius: 14px !important;
  margin-top: auto !important;
  margin-bottom: 0 !important;
  align-self: flex-start !important;
}

/* Card hover (1.10.6) */
.hxm-divider{display:flex;align-items:center;gap:16px;max-width:1040px;margin:44px auto 30px;color:var(--red,#ac332a)}
.hxm-divider span{flex:1;height:1px;background:var(--line,#e2ddd2)}
.hxm-divider b{font-weight:400;font-size:14px;line-height:1}

/* Tag chips */
.hxm-tags{display:flex;flex-wrap:wrap;gap:8px;max-width:1040px;margin:0 auto 36px}
.hxm-tag{display:inline-flex;align-items:center;min-height:32px;padding:4px 12px;font-size:12px;letter-spacing:.4px;border:1px solid var(--line,#e2ddd2);border-radius:3px;background:var(--white,#fff);color:var(--muted,#5c686c)}
.hxm-tag::before{content:"#";color:var(--gold,#a68352);margin-right:2px}
.hxm-tag:hover{border-color:var(--gold,#c8a97e);color:var(--red,#ac332a)}
html[data-theme="dark"] .hxm-tag{background:transparent}

/* Visible keyboard focus everywhere */
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:2px solid var(--red,#ac332a);outline-offset:2px}

/* ============================================================
   Huaxia & Nekud Parity: Typography, 1040px Measure & Snug Spacing
   ============================================================ */

/* Base font sizes */
html {
  font-size: 19px !important;
}
body {
  font-size: 19px !important;
}

/* Hide dates on index cards/thumbnails - dates only appear on main article page */
body:not(.single) .hx-story-meta time,
body:not(.single) .hx-story-meta > span:first-child:has(+ span),
body:not(.single) .hx-card-bottom time,
body:not(.single) .hx-meta time,
.hx-lead .hx-story-meta time,
.hx-story-card time,
.hx-story-grid time {
  display: none !important;
}

/* Split lead card on homepage */
.hx-lead-deck,
.hxm-lead--split .hx-lead-deck {
  font-size: 17px !important;
  line-height: 1.65 !important;
  max-width: 520px !important;
}
.hxm-lead--split h2 {
  font-size: clamp(28px, 3vw, 42px) !important;
}

/* Card excerpts */
.hx-card-deck {
  font-size: 15.5px !important;
  line-height: 1.6 !important;
}

/* Single post layout: generous 1040px measure matching nekud.click */
.hx-refresh .hx-reader :is(
  .hx-reader-header,
  .hx-reader-image,
  .hx-reader-layout,
  .hx-author-box,
  .hx-related-section,
  .hx-post-navigation
),
.hxm-divider,
.hxm-tags {
  max-width: 1040px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
}

.hx-reader-layout {
  max-width: 1040px !important;
  width: 100% !important;
}

/* Single post reading prose: 21px font size, generous width */
.hx-refresh .hx-reader-prose.single-article__body,
.hx-reader-layout .hx-reader-prose.single-article__body,
.hx-reader-prose.single-article__body,
.hx-reader-prose {
  max-width: 1040px !important;
  width: 100% !important;
  font-size: 21px !important;
  line-height: 1.82 !important;
}

/* Snug space between graphic and text: 12px */
.hx-reader-prose > :first-child,
.hx-reader-prose > p:first-of-type {
  margin-top: 0 !important;
}

.hx-reader-prose :is(p, ul, ol, li) {
  font-size: 21px !important;
  line-height: 1.82 !important;
}

.hx-reader-prose :is(p, ul, ol) {
  margin-bottom: 1.55em !important;
}

.hx-reader-prose h2 {
  font-size: 32px !important;
  line-height: 1.25 !important;
  margin-top: 1.8em !important;
  margin-bottom: 0.6em !important;
}

.hx-reader-prose h3 {
  font-size: 26px !important;
  line-height: 1.3 !important;
  margin-top: 1.6em !important;
  margin-bottom: 0.6em !important;
}

/* Hero image in reader: matching 1040px width and snug 12px gap to text */
.hx-refresh .hx-reader-image,
.single-article__featured-img.hx-reader-image {
  max-width: 1040px !important;
  margin-top: 24px !important;
  margin-bottom: 12px !important;
}

.hx-reader-image img {
  max-width: 1040px !important;
  width: 100% !important;
  max-height: 560px !important;
  object-fit: contain !important;
}

/* Single post title */
.hx-refresh .hx-reader-title,
.hx-reader-title {
  font-size: clamp(32px, 3.8vw, 48px) !important;
  line-height: 1.15 !important;
}

.hx-reader-meta {
  font-size: 14px !important;
}

/* Mobile responsive font sizes */
@media (max-width: 600px) {
  .hx-refresh .hx-reader-image,
  .single-article__featured-img.hx-reader-image {
    margin-bottom: 10px !important;
  }
  .hx-reader-prose :is(p, ul, ol, li),
  .hx-refresh .hx-reader-prose.single-article__body {
    font-size: 18.5px !important;
    line-height: 1.65 !important;
  }
}

@media (prefers-reduced-motion:reduce){
  .hx-story-card-link,.hx-site-header.hxm-sticky{transition:none}
  .hx-story-card-link:hover .hx-card-image,.hx-story-card-link:focus-visible .hx-card-image{transform:none}
  .hxm-progress{display:none}
}
@media print{.hxm-progress,.hxm-tags{display:none}.hx-site-header.hxm-sticky{position:static}}

/* Remove border from images on index pages */
.hx-lead.hxm-lead--split,
.hx-lead,
.hx-lead-art,
.hx-lead-art img,
.hx-hero-image,
.hx-card-image,
.hx-card-image img,
.hx-reader-image,
.hx-reader-image img {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Pure white backgrounds on index page - both sides of card must be white so borders and shapes don't look crushed */
.hx-lead.hxm-lead--split,
.hxm-lead--split .hx-lead-copy,
.hxm-lead--split .hx-lead-art,
.hx-lead:not(.hxm-lead--split) .hx-lead-art,
.hx-lead:not(.hxm-lead--split) .hx-lead-art img,
.hx-lead-art,
.hx-lead-art img,
.home .hx-lead,
.home #lead {
  background: #ffffff !important;
}

body.home.hx-refresh,
.home.hx-refresh {
  background: #ffffff !important;
  --paper: #ffffff !important;
}

/* ============================================================
   Unified Pure White Background on Index Page (Huaxia)
   Both sections must be white so borders and shapes don't look crushed
   ============================================================ */
html:not([data-theme="dark"]) body.home,
html:not([data-theme="dark"]) body.home.hx-refresh,
body.home.hx-refresh,
.home .hx-home,
.home .hx-lead,
.home .hx-lead.hxm-lead--split,
.home .hxm-lead--split .hx-lead-copy,
.home .hxm-lead--split .hx-lead-art,
.home .hx-lead-art,
.home .hx-lead-art img,
.home .hx-discovery-section {
  background: #ffffff !important;
  background-color: #ffffff !important;
  --paper: #ffffff !important;
  --sand: #ffffff !important;
}




/* ============================================================
   SQUIRCLE ALL IMAGES & UNIFIED WHITE INDEX (HUAXIA.CLICK)
   ============================================================ */

/* Pure white index background */
html:not([data-theme="dark"]) body.home,
html:not([data-theme="dark"]) body.home.hx-refresh,
html:not([data-theme="dark"]) .home,
html:not([data-theme="dark"]) .home .hx-home,
html:not([data-theme="dark"]) .home .hx-lead,
html:not([data-theme="dark"]) .home .hx-lead.hxm-lead--split,
html:not([data-theme="dark"]) .home .hxm-lead--split .hx-lead-copy,
html:not([data-theme="dark"]) .home .hxm-lead--split .hx-lead-art,
html:not([data-theme="dark"]) .home .hx-lead-art,
html:not([data-theme="dark"]) .home .hx-lead-art img,
html:not([data-theme="dark"]) .home .hx-discovery-section {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  --paper: #ffffff !important;
  --sand: #ffffff !important;
  --c-paper: #ffffff !important;
  --c-surface: #ffffff !important;
}

/* Squircle: Lead hero graphic on index */
.hx-lead .hx-lead-art,
.hxm-lead--split .hx-lead-art,
.hx-lead .hx-lead-art > a,
.hxm-lead--split .hx-lead-art > a {
  border-radius: 20px !important;
  overflow: hidden !important;
  isolation: isolate !important;
  border: none !important;
  box-shadow: none !important;
  background: #ffffff !important;
}

.hx-lead .hx-lead-art img,
.hxm-lead--split .hx-lead-art img,
.hx-hero-image {
  border-radius: 20px !important;
  overflow: hidden !important;
  border: none !important;
  box-shadow: none !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

/* Squircle: Card thumbnails across index, archive, search, and related */
.hx-card-image,
.hx-story-card__art,
.hx-dispatch-card__art {
  border-radius: 18px !important;
  overflow: hidden !important;
  isolation: isolate !important;
  border: none !important;
  box-shadow: none !important;
}

.hx-card-image img,
.hx-card-thumbnail,
.hx-story-card__art img,
.hx-dispatch-card__art img {
  border-radius: 18px !important;
  overflow: hidden !important;
  border: none !important;
  box-shadow: none !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* Squircle: Single reader featured image */
.hx-reader-image,
.single-article__featured-img,
.single-article__featured-img.hx-reader-image {
  border-radius: 20px !important;
  overflow: hidden !important;
  isolation: isolate !important;
  border: none !important;
  box-shadow: none !important;
}

.hx-reader-image img,
.single-article__featured-img img {
  border-radius: 20px !important;
  overflow: hidden !important;
  border: none !important;
  box-shadow: none !important;
  display: block !important;
  width: 100% !important;
}

/* Squircle: In-article content images, blocks, and figures */
.single-article__content img,
.hx-article-body img,
.entry-content img,
.wp-block-image,
.wp-block-image img,
figure,
figure img {
  border-radius: 20px !important;
  overflow: hidden !important;
  isolation: isolate !important;
}

/* Squircle: All images site-wide */
article img:not(.hx-brand-logo):not(.hx-footer-mark),
main img:not(.hx-brand-logo):not(.hx-footer-mark),
.hx-home img:not(.hx-brand-logo):not(.hx-footer-mark) {
  border-radius: 18px !important;
  overflow: hidden !important;
  isolation: isolate !important;
}

/* Remove all borders from images site-wide */
.hx-lead.hxm-lead--split,
.hx-lead,
.hx-lead-art,
.hx-lead-art img,
.hx-hero-image,
.hx-card-image,
.hx-card-image img,
.hx-reader-image,
.hx-reader-image img {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}


/* ============================================================
   SQUIRCLE ALL IMAGES & UNIFIED WHITE INDEX (HUAXIA.CLICK)
   ============================================================ */

/* Pure white index background */
html:not([data-theme="dark"]) body.home,
html:not([data-theme="dark"]) body.home.hx-refresh,
html:not([data-theme="dark"]) .home,
html:not([data-theme="dark"]) .home .hx-home,
html:not([data-theme="dark"]) .home .hx-lead,
html:not([data-theme="dark"]) .home .hx-lead.hxm-lead--split,
html:not([data-theme="dark"]) .home .hxm-lead--split .hx-lead-copy,
html:not([data-theme="dark"]) .home .hxm-lead--split .hx-lead-art,
html:not([data-theme="dark"]) .home .hx-lead-art,
html:not([data-theme="dark"]) .home .hx-lead-art img,
html:not([data-theme="dark"]) .home .hx-discovery-section {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  --paper: #ffffff !important;
  --sand: #ffffff !important;
  --c-paper: #ffffff !important;
  --c-surface: #ffffff !important;
}

/* Squircle: Lead hero graphic on index */
.hx-lead .hx-lead-art,
.hxm-lead--split .hx-lead-art,
.hx-lead .hx-lead-art > a,
.hxm-lead--split .hx-lead-art > a {
  border-radius: 20px !important;
  overflow: hidden !important;
  isolation: isolate !important;
  border: none !important;
  box-shadow: none !important;
  background: #ffffff !important;
}

.hx-lead .hx-lead-art img,
.hxm-lead--split .hx-lead-art img,
.hx-hero-image {
  border-radius: 20px !important;
  overflow: hidden !important;
  border: none !important;
  box-shadow: none !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

/* Squircle: Card thumbnails across index, archive, search, and related */
.hx-card-image,
.hx-story-card__art,
.hx-dispatch-card__art {
  border-radius: 18px !important;
  overflow: hidden !important;
  isolation: isolate !important;
  border: none !important;
  box-shadow: none !important;
}

.hx-card-image img,
.hx-card-thumbnail,
.hx-story-card__art img,
.hx-dispatch-card__art img {
  border-radius: 18px !important;
  overflow: hidden !important;
  border: none !important;
  box-shadow: none !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* Squircle: Single reader featured image */
.hx-reader-image,
.single-article__featured-img,
.single-article__featured-img.hx-reader-image {
  border-radius: 20px !important;
  overflow: hidden !important;
  isolation: isolate !important;
  border: none !important;
  box-shadow: none !important;
}

.hx-reader-image img,
.single-article__featured-img img {
  border-radius: 20px !important;
  overflow: hidden !important;
  border: none !important;
  box-shadow: none !important;
  display: block !important;
  width: 100% !important;
}

/* Squircle: In-article content images, blocks, and figures */
.single-article__content img,
.hx-article-body img,
.entry-content img,
.wp-block-image,
.wp-block-image img,
figure,
figure img {
  border-radius: 20px !important;
  overflow: hidden !important;
  isolation: isolate !important;
}

/* Squircle: All images site-wide */
article img:not(.hx-brand-logo):not(.hx-footer-mark),
main img:not(.hx-brand-logo):not(.hx-footer-mark),
.hx-home img:not(.hx-brand-logo):not(.hx-footer-mark) {
  border-radius: 18px !important;
  overflow: hidden !important;
  isolation: isolate !important;
}

/* Remove all borders from images site-wide */
.hx-lead.hxm-lead--split,
.hx-lead,
.hx-lead-art,
.hx-lead-art img,
.hx-hero-image,
.hx-card-image,
.hx-card-image img,
.hx-reader-image,
.hx-reader-image img {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}
