/* BlogSite front-end design */

:root {
  --bs-ink: #18243b;
  --bs-muted: #526078;
  --bs-accent: #3949a2;
  --bs-accent-dark: #2e377f;
  --bs-tint: #edf0ff;
  --bs-canvas: #f4f6fb;
  --bs-surface: #fff;
  --bs-line: #dce3f0;
  --bs-radius: 18px;
  --bs-shadow: 0 4px 16px rgb(24 36 59 / 5%);
}

body:not(.custom-background) {
  background: var(--bs-canvas);
}

body {
  color: var(--bs-ink);
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}

#page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#page :where(a, button, input, textarea, select):focus-visible {
  outline: 2px solid #6475dc;
  outline-offset: 3px;
}

#page .container {
  width: min(1240px, calc(100% - clamp(28px, 6vw, 80px)));
}

/* Header, search and navigation */

#masthead {
  position: relative;
  z-index: 5;
  height: auto;
  background: var(--bs-surface);
  border-bottom: 1px solid var(--bs-line);
}

#masthead .wp-custom-header {
  position: absolute;
  inset: 0;
  height: 100%;
}

#masthead .wp-custom-header :is(img, video) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#masthead > .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 310px);
  grid-template-areas: "brand search" "navigation navigation";
  gap: 12px 26px;
  align-items: center;
  padding-top: 17px;
}

#masthead .site-branding {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin: 0;
}

#masthead .site-branding #logo,
#masthead .site-title-desc {
  float: none;
  height: auto;
  line-height: 1.3;
  margin: 0;
}

#masthead .site-branding img {
  display: block;
  max-width: min(42vw, 200px);
  max-height: 55px;
  object-fit: contain;
}

#masthead .site-title {
  margin: 0;
  font-size: clamp(1.32rem, 1.05rem + 1vw, 1.9rem);
  line-height: 1.25;
  font-weight: 800;
}

#masthead .site-title a {
  display: inline-block;
  overflow-wrap: anywhere;
}

.site-title a {
  color: var(--bs-ink);
}

#masthead .site-description {
  display: block;
  margin-top: 3px;
  font-size: .83rem;
  line-height: 1.45;
}

.site-description {
  color: var(--bs-muted);
}

#masthead .site-title.no-desc + .site-description {
  display: none;
}

#masthead .header-search {
  grid-area: search;
  display: block;
  position: static;
  width: auto;
  height: auto;
  border: 1px solid var(--bs-line);
  border-radius: 12px;
  background: var(--bs-canvas);
}

#masthead .header-search:focus-within {
  border-color: var(--bs-accent);
  box-shadow: 0 0 0 3px var(--bs-tint);
}

#masthead .header-search form {
  display: flex;
  align-items: center;
  padding: 3px;
}

#masthead .search-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  color: var(--bs-ink);
  text-indent: 0;
  font-size: 1rem;
}

#masthead .search-submit {
  flex: 0 0 42px;
  position: static;
  height: 38px;
  border-radius: 8px;
  background: var(--bs-accent);
  color: #fff;
}

#masthead .search-submit:hover {
  background: var(--bs-accent-dark);
}

#primary-nav {
  grid-area: navigation;
  border-top: 1px solid var(--bs-line);
  padding: 6px 0;
}

#primary-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  float: none;
  margin: 0;
}

#primary-menu > li {
  float: none;
  margin: 0;
  line-height: 1.4;
}

#primary-menu .menu-item-home {
  display: block;
}

#primary-menu > li > a {
  max-width: 100%;
  border-radius: 8px;
  font-size: .96rem;
  font-weight: 650;
}

.sf-menu li a {
  color: var(--bs-ink);
}

#primary-menu > li > a .menu-text {
  height: auto;
  padding: 10px 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  background: transparent;
  color: inherit;
}

#primary-menu > li > a.sf-with-ul .menu-text {
  padding-right: 29px;
}

#primary-menu > li > a.sf-with-ul::after {
  right: 22px;
  color: inherit;
}

#primary-menu > li:is(:hover, .sfHover, .current-menu-item, .current-menu-ancestor) > a,
#primary-menu > li > a:focus-visible {
  background: var(--bs-tint);
  color: var(--bs-accent-dark);
}

#primary-menu .sub-menu {
  width: 246px;
  padding: 6px;
  border: 1px solid var(--bs-line);
  border-radius: 12px;
  box-shadow: 0 14px 35px rgb(24 36 59 / 15%);
}

#primary-menu .sub-menu::before {
  display: none;
}

#primary-menu .sub-menu li {
  border: 0;
}

#primary-menu .sub-menu li > a {
  padding: 9px 12px;
  border-radius: 7px;
}

#primary-menu .sub-menu li > a:hover .menu-text,
#primary-menu .sub-menu li > a:focus-visible .menu-text {
  color: var(--bs-accent-dark) !important;
  text-decoration: underline;
}

#primary-menu .sub-menu .sub-menu {
  left: calc(100% - 4px);
}

/* Page layout and homepage introduction */

#content.site-content {
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(244px, 302px);
  align-items: start;
  gap: clamp(18px, 2.5vw, 32px);
  padding: clamp(20px, 3vw, 38px) 0 clamp(32px, 5vw, 64px);
}

#content.site-content::before,
#content.site-content::after {
  content: none;
}

#content.site-content.is_full_width,
#content.site-content:not(:has(> #secondary .widget)) {
  grid-template-columns: minmax(0, 1fr);
}

#content.is_full_width > #secondary,
#content > #secondary:not(:has(.widget)) {
  display: none;
}

#content > #primary,
#content > #secondary {
  float: none;
  width: auto;
  min-width: 0;
  margin: 0;
}

#content > #primary:last-child,
#content > .blogsite-home-intro {
  grid-column: 1 / -1;
}

.blogsite-home-intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(28px, 5vw, 63px);
  border-radius: clamp(16px, 2vw, 26px);
  background: linear-gradient(118deg, #162344 3%, #263676 60%, #4a3e96);
  box-shadow: 0 14px 34px rgb(29 39 91 / 16%);
  color: #fff;
}

.blogsite-home-intro::after {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: 9%;
  width: clamp(180px, 26vw, 340px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  border: 1px solid rgb(201 214 255 / 46%);
  border-radius: 50%;
  box-shadow: 0 0 0 25px rgb(207 216 255 / 12%), 0 0 0 60px rgb(207 216 255 / 7%);
  background: radial-gradient(circle at 40% 42%, rgb(181 203 255 / 22%), transparent 68%);
  content: "";
  pointer-events: none;
}

.blogsite-home-intro__body {
  max-width: min(39rem, 72%);
}

.blogsite-home-intro__site {
  margin-bottom: 12px;
  color: #d6deff;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .09em;
}

.blogsite-home-intro h1 {
  color: #fff;
  font-size: clamp(2rem, 1.35rem + 2.2vw, 3.15rem);
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.blogsite-home-intro__description {
  margin: 12px 0 0;
  color: #e0e6ff;
  font-size: clamp(.96rem, .88rem + .28vw, 1.1rem);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.blogsite-section-title {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 15px;
  color: var(--bs-ink);
  font-size: clamp(1.35rem, 1.12rem + .55vw, 1.75rem);
  line-height: 1.35;
}

.blogsite-section-title::before {
  width: 5px;
  height: 1em;
  border-radius: 5px;
  background: var(--bs-accent);
  content: "";
}

#content .site-main,
.sidebar .widget,
#recent-content > .hentry {
  border: 1px solid var(--bs-line);
  border-radius: var(--bs-radius);
  background: var(--bs-surface);
  box-shadow: var(--bs-shadow);
}

#content .site-main {
  padding: clamp(16px, 3.5vw, 42px);
  transition: none;
}

:is(.blog, .archive:not(.woocommerce), .search) #content #primary > .site-main {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#featured-content :is(.featured-left, .featured-grid) {
  overflow: hidden;
  border-radius: var(--bs-radius);
}

#recent-content {
  margin-bottom: 0;
  scroll-margin-top: 48px;
}

#recent-content > .hentry {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "category" "title" "meta" "summary";
  gap: 7px 20px;
  align-content: center;
  margin: 0 0 14px;
  padding: clamp(15px, 2vw, 24px);
  transition: border-color .2s ease, box-shadow .2s ease;
}

#recent-content > .hentry:last-child {
  margin-bottom: 0;
  border-bottom: 1px solid var(--bs-line);
}

#recent-content > .hentry::after {
  content: none;
}

#recent-content > .hentry:has(> .thumbnail-link) {
  grid-template-columns: minmax(125px, 28%) minmax(0, 1fr);
  grid-template-areas: "image category" "image title" "image meta" "image summary";
}

#recent-content > .hentry:hover,
#recent-content > .hentry:focus-within {
  border-color: #b6c1eb;
  box-shadow: 0 8px 24px rgb(33 49 106 / 10%);
}

#recent-content .thumbnail-link {
  grid-area: image;
  align-self: start;
  float: none;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 11px;
  background: var(--bs-tint);
}

#recent-content .thumbnail-wrap {
  aspect-ratio: 4 / 3;
}

#recent-content .thumbnail-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#recent-content .hentry > .entry-category {
  grid-area: category;
}

#recent-content .hentry > .entry-category:empty {
  display: none;
}

#recent-content .hentry > .entry-category a {
  height: auto;
  margin: 0;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--bs-tint);
  color: var(--bs-accent-dark);
  font-weight: 650;
  line-height: 1.35;
}

#recent-content .hentry > .entry-title {
  grid-area: title;
  margin: 0;
  font-size: clamp(1.13rem, 1rem + .45vw, 1.42rem);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#recent-content .entry-title a {
  color: var(--bs-ink);
}

#recent-content .entry-title a:hover {
  color: var(--bs-accent);
}

#recent-content .hentry > .entry-meta {
  grid-area: meta;
  display: block;
  margin: 0;
  color: var(--bs-muted);
  line-height: 1.5;
}

#recent-content .hentry > .entry-summary {
  grid-area: summary;
  margin: 0;
  color: var(--bs-muted);
  line-height: 1.65;
}

#recent-content .entry-summary::before {
  content: none;
}

.archive #recent-content > .breadcrumbs,
.search #recent-content > .breadcrumbs,
#recent-content > .no-results {
  padding: clamp(16px, 2.5vw, 24px);
  border: 1px solid var(--bs-line);
  border-radius: var(--bs-radius);
  background: var(--bs-surface);
}

/* Supporting content, articles and footer */

.sidebar .widget {
  padding: clamp(15px, 1.8vw, 23px);
  line-height: 1.65;
}

.sidebar .widget :is(h2, .widget-title) {
  color: var(--bs-ink);
  font-weight: 750;
}

.sidebar .widget a,
#primary .entry-content a,
.sidebar .widget li a:hover,
#primary .entry-content a:hover {
  color: var(--bs-accent-dark);
}

.sidebar .wp-block-search .wp-block-search__input {
  min-width: 0;
}

.sidebar .wp-block-search .wp-block-search__button,
.comment-form .submit,
#back-top a span {
  border-radius: 8px;
  background: var(--bs-accent);
  color: #fff;
}

.single-post #primary .entry-header .entry-title,
.page #primary .page-title {
  color: var(--bs-ink);
  font-size: clamp(1.55rem, 1.15rem + 1.45vw, 2.65rem);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

#primary .entry-content {
  line-height: 1.75;
}

#primary .entry-content img,
.author-box {
  border-radius: 10px;
}

#primary .entry-content :is(pre, table) {
  max-width: 100%;
}

.pagination {
  border-color: var(--bs-line);
}

.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.pagination .page-numbers {
  min-width: 38px;
  height: auto;
  border: 1px solid var(--bs-line);
  border-radius: 8px;
  background: var(--bs-surface);
  color: var(--bs-ink);
  line-height: 36px;
}

.pagination .page-numbers:is(.current, :hover):not(.dots) {
  background: var(--bs-accent);
  color: #fff;
}

#site-bottom,
.footer-columns {
  background: #18243b;
}

#site-bottom {
  padding: 23px 0;
  border-color: #344059;
  color: #d2dbec;
  line-height: 1.65;
}

#site-bottom :is(.site-info, .footer-nav li) a {
  color: #dbe4f7;
}

#site-bottom :is(.site-info, .footer-nav li) a:hover {
  color: #fff;
  text-decoration: underline;
}

#colophon #block-10.footer-widget {
  float: none;
  width: 100%;
  margin: 0 0 16px;
  line-height: 1.8;
}

#colophon #block-10 > p {
  display: inline-block;
  margin: 0 22px 0 0;
  color: #fff;
  font-weight: 700;
}

#colophon #block-10 > a {
  display: inline-block;
  margin: 5px 20px 5px 0;
  color: #dbe4f7;
  text-decoration: none;
}

#colophon #block-10 > a:hover {
  color: #fff;
  text-decoration: underline;
}

#colophon #block-10 br {
  display: none;
}

.woocommerce ul.products li.product {
  padding: 13px;
  border: 1px solid var(--bs-line);
  border-radius: 14px;
  background: var(--bs-surface);
}

.woocommerce ul.products li.product img {
  border-radius: 9px;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  color: var(--bs-ink);
  line-height: 1.4;
}

.woocommerce span.onsale,
.woocommerce :is(a, button, input).button.alt:not(:disabled, .disabled) {
  background: var(--bs-accent);
  color: #fff;
}

.woocommerce :is(a, button, input).button.alt:not(:disabled, .disabled) {
  border-radius: 8px;
}

.woocommerce :is(a, button, input).button.alt:not(:disabled, .disabled):hover {
  background: var(--bs-accent-dark);
}

@media (max-width: 959px) {
  #masthead > .container {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand toggle" "search search";
    padding: 13px 0;
  }

  #masthead .header-toggles {
    grid-area: toggle;
    position: static;
  }

  #masthead .mobile-nav-toggle {
    min-height: 44px;
    padding: 6px 13px;
    border: 1px solid var(--bs-line);
    border-radius: 10px;
    background: var(--bs-tint);
  }

  #masthead .mobile-nav-toggle .toggle-text {
    color: var(--bs-accent-dark);
    font-weight: 700;
    text-transform: none;
  }

  .menu-modal {
    background: rgb(24 36 59 / 40%);
  }

  .menu-modal-inner {
    width: min(100%, 460px);
    margin-left: auto;
    box-shadow: -12px 0 36px rgb(24 36 59 / 14%);
  }

  .menu-modal .menu-wrapper {
    width: 100%;
  }

  .menu-modal .close-nav-toggle {
    min-height: 55px;
    background: var(--bs-canvas);
    color: var(--bs-accent-dark);
  }

  .modal-menu li {
    border-color: var(--bs-line);
  }

  .modal-menu a {
    color: var(--bs-ink);
    line-height: 1.5;
  }

  .modal-menu button.sub-menu-toggle {
    min-width: 48px;
    min-height: 36px;
    padding-inline: 10px;
    border-color: var(--bs-line);
  }

  #content.site-content {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .blogsite-home-intro__body {
    max-width: 100%;
  }

  .blogsite-home-intro::after {
    right: -104px;
    opacity: .55;
  }

  #recent-content > .hentry:has(> .thumbnail-link) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "image" "category" "title" "meta" "summary";
  }

  #recent-content .thumbnail-wrap {
    aspect-ratio: 16 / 9;
  }

  #recent-content .entry-title {
    display: block;
  }

  .sidebar .widget,
  #content .site-main,
  #recent-content > .hentry {
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #recent-content > .hentry {
    transition: none;
  }
}
