/*
Theme Name: OI 2026
Author: Based on Themegrove
Description: Gutentools News is a modern full-site editing WordPress theme designed for news portals, online magazines, and editorial websites, while still catering to businesses, consulting firms, law practices, and educational institutions that need a professional news-style layout. It offers flexible design controls, customizable sections, and clean typography to showcase articles and updates effectively. With seamless integration for WooCommerce, WPML, and Contact Form 7, it supports e-commerce, multilingual publishing, and smooth communication. Optimized for SEO and built for performance, Gutentools News makes it easy to create a dynamic, content-rich website with a polished and authoritative news look. Demo: https://demos.themegrove.com/gutentools-news/
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.0
Version: 1.7.29
License: GNU General Public License v3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Text Domain: OI-2026
Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns, rtl-language-support, sticky-post, threaded-comments, translation-ready, wide-blocks, block-styles, blog, portfolio, news
*/

/* Default: light */
:root {
  /* 响应式断点 (仅供文档参考，media query 中需直接使用数值) */
  --breakpoint-mobile: 768px;
  --breakpoint-desktop: 769px;

  /* featured image圆角尺寸变量 */
  --featured-image-radius: 20px;

  /* 主题颜色变量 */
  --theme-color-background: var(--wp--custom--color-light--background);
  --theme-color-foreground: var(--wp--custom--color-light--foreground);
  --theme-color-primary: var(--wp--custom--color-light--primary);
  --theme-color-title-hover: var(--wp--custom--color-light--title-hover);
  --theme-color-secondary: var(--wp--custom--color-light--secondary);
  --theme-color-tertiary: var(--wp--custom--color-light--tertiary);
  --theme-color-secondary-bg: var(--wp--custom--color-light--secondary-bg);
  --theme-color-base: var(--wp--custom--color-light--base);
  --theme-color-contrast: var(--wp--custom--color-light--contrast);
  --theme-color-dark-text: var(--wp--custom--color-light--dark-text-color);
  --theme-color-link: var(--wp--custom--color-light--link-color);
  --theme-color-button-hover-text: var(--wp--custom--color-light--button-hover-text-color);
  --theme-color-button-hover: var(--wp--custom--color-light--button-hover-color);
  --theme-color-heading: var(--wp--custom--color-light--heading-color);
  --theme-color-secondary-text: var(--wp--custom--color-light--secondary-text-color);
  --theme-color-nav-link: var(--wp--custom--color-light--nav-link-color);
  --theme-color-nav-submenu-bg: var(--wp--custom--color-light--nav-submenu-bg);

  /* Cover overlay gradient - Light mode */
  --gradient-overlay-top: color-mix(in srgb, var(--wp--custom--color-light--background) 40%, transparent);
  --gradient-overlay-bottom: color-mix(in srgb, var(--wp--custom--color-light--background) 80%, transparent);
}


/* Light mode - when system prefers light */
@media (prefers-color-scheme: dark) {
  :root {
    --theme-color-background: var(--wp--custom--color-dark--background);
    --theme-color-foreground: var(--wp--custom--color-dark--foreground);
    --theme-color-primary: var(--wp--custom--color-dark--primary);
    --theme-color-title-hover: var(--wp--custom--color-dark--title-hover);
    --theme-color-secondary: var(--wp--custom--color-dark--secondary);
    --theme-color-tertiary: var(--wp--custom--color-dark--tertiary);
    --theme-color-secondary-bg: var(--wp--custom--color-dark--secondary-bg);
    --theme-color-base: var(--wp--custom--color-dark--base);
    --theme-color-contrast: var(--wp--custom--color-dark--contrast);
    --theme-color-dark-text: var(--wp--custom--color-dark--dark-text-color);
    --theme-color-link: var(--wp--custom--color-dark--link-color);
    --theme-color-button-hover-text: var(--wp--custom--color-dark--button-hover-text-color);
    --theme-color-button-hover: var(--wp--custom--color-dark--button-hover-color);
    --theme-color-heading: var(--wp--custom--color-dark--heading-color);
    --theme-color-secondary-text: var(--wp--custom--color-dark--secondary-text-color);
    --theme-color-nav-link: var(--wp--custom--color-dark--nav-link-color);
    --theme-color-nav-submenu-bg: var(--wp--custom--color-dark--nav-submenu-bg);

    /* Cover overlay gradient - Dark mode */
    --gradient-overlay-top: color-mix(in srgb, var(--wp--custom--color-dark--background) 40%, transparent);
    --gradient-overlay-bottom: color-mix(in srgb, var(--wp--custom--color-dark--background) 80%, transparent);
  }

  strong,
  b {
    color: #FFFFFF;
  }
}

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
}

main {
  display: block;
}

hr {
  box-sizing: content-box;
  height: 0;
  overflow: visible;
}

pre {
  font-family: monospace, monospace;
  font-size: 1em;
}

abbr[title] {
  border-bottom: none;
  text-decoration: underline;
  text-decoration: underline dotted;
}

b,
strong {
  font-weight: bolder;
}

code,
kbd,
samp {
  font-family: monospace, monospace;
  font-size: 1em;
}

small {
  font-size: 80%;
}

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

img {
  border-style: none;
}

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
}

button,
input {
  overflow: visible;
}

button,
select {
  text-transform: none;
}

.wp-element-button,
.wp-block-button__link,
a.wp-block-post-excerpt__more-link {
  transition: all 0.3s;
}

.wp-element-button:hover,
.wp-block-button__link:hover,
a.wp-block-post-excerpt__more-link:hover {
  background-color: var(--wp--preset--color--button-hover-color) !important;
  border-color: var(--wp--preset--color--dark-text-color) !important;
  color: var(--wp--preset--color--button-hover-text-color) !important;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

fieldset {
  padding: 0.35em 0.75em 0.625em;
}

legend {
  box-sizing: border-box;
  color: inherit;
  display: table;
  max-width: 100%;
  padding: 0;
  white-space: normal;
}

progress {
  vertical-align: baseline;
}

textarea {
  overflow: auto;
}

[type="checkbox"],
[type="radio"] {
  box-sizing: border-box;
  padding: 0;
}

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
  height: auto;
}

[type="search"] {
  -webkit-appearance: textfield;
  outline-offset: -2px;
}

[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
}

::-webkit-file-upload-button {
  -webkit-appearance: button;
  font: inherit;
}

details {
  display: block;
}

summary {
  display: list-item;
}

template {
  display: none;
}

[hidden] {
  display: none;
}

footer.wp-block-template-part {
  margin: 0;
}

.orderby {
  padding: 15px;
}


/* -------------- pagination start----------------*/

.page-numbers {
  background: var(--wp--preset--color--primary);
  margin: 0 5px 5px 0;
  padding: 6px 13px;
  border-radius: 6px;
  font-size: var(--wp--preset--font-size--small);
  display: inline-block;
  color: var(--wp--preset--color--button-hover-text-color);
  text-decoration: none;
}

.page-numbers:hover {
  color: var(--wp--preset--color--button-hover-text-color);
}

.page-numbers.dots {
  background-color: transparent;
}

.wp-block-query-pagination {
  gap: 10px;
}

/* -------------- pagination End----------------*/

/* -------------- header navigation ----------------*/

/* 桌面端导航样式 - 769px及以上 */
@media (min-width: 769px) {

  /* 隐藏汉堡按钮 */
  .wp-block-navigation .wp-block-navigation__responsive-container-open,
  .wp-block-navigation .wp-block-navigation__responsive-container-close {
    display: none !important;
  }

  .wp-block-navigation a {
    color: var(--theme-color-nav-link);
    font-weight: 500;
    position: relative;
    padding-bottom: 3px;
    transition: color 0.25s ease;
  }

  /* Underline animation */
  .wp-block-navigation a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0%;
    height: 2px;
    background: var(--wp--preset--color--primary);
    border-radius: 2px;
    transition: width 0.3s ease;
  }

  /* Hover & active */
  .wp-block-navigation a:hover,
  .wp-block-navigation-item.current-menu-item a {
    color: var(--wp--preset--color--primary);
  }

  .wp-block-navigation a:hover::after,
  .wp-block-navigation-item.current-menu-item a::after {
    width: 100%;
  }

  /* Dropdown animation */
  .wp-block-navigation__submenu-container {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: all 0.25s ease;
    background: var(--theme-color-nav-submenu-bg);
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  }

  .wp-block-navigation-item:hover>.wp-block-navigation__submenu-container {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  /* Submenu link color */
  .wp-block-navigation__submenu-container {
    background: var(--theme-color-nav-submenu-bg) !important;
  }

  .wp-block-navigation__submenu-container a {
    color: var(--theme-color-nav-link) !important;
  }

  .wp-block-navigation__submenu-container a:hover {
    color: var(--wp--preset--color--primary) !important;
    background: rgba(0, 212, 255, 0.08);
  }
}

/* Mobile Navigation - 移动端样式 768px及以下 */

@media (max-width: 768px) {

  /* Disable animations */
  .wp-block-navigation * {
    transition: none !important;
  }

  /* 强制显示汉堡按钮（覆盖WordPress核心的600px规则） */
  .wp-block-navigation__responsive-container-open {
    display: flex !important;
  }

  /* 隐藏桌面端的responsive-container（菜单未打开时） */
  .wp-block-navigation__responsive-container:not(.is-menu-open) {
    display: none !important;
  }

  /* Responsive container - 移动端菜单弹出层 */
  .wp-block-navigation__responsive-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    overflow-y: auto;
  }

  /* 菜单打开时显示弹出层 */
  .wp-block-navigation.is-menu-open .wp-block-navigation__responsive-container {
    display: flex;
  }

  /* 对话框容器 - 使用主题 base 颜色 */
  .wp-block-navigation__responsive-dialog {
    background-color: var(--wp--preset--color--base);
    padding: 60px 20px 20px 20px;
    min-height: 100vh;
    width: 100%;
    box-sizing: border-box;
  }

  /* 菜单内容容器 */
  .wp-block-navigation__responsive-container-content {
    display: block;
    padding: 20px 0;
  }

  /* 桌面端菜单容器水平布局 */
  .wp-block-navigation__container {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  /* 菜单打开时显示导航容器 */
  .wp-block-navigation.is-menu-open .wp-block-navigation__container,
  .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
    display: flex !important;
    flex-direction: column !important;
  }

  /* 关闭按钮 */
  .wp-block-navigation__responsive-container-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100000;
  }

  /* Mobile link color - 使用主题 foreground 颜色 */
  .wp-block-navigation a {
    display: block;
    padding: 12px 0;
    font-size: var(--wp--preset--font-size--medium);
    color: var(--wp--preset--color--foreground) !important;
    border-bottom: 1px solid var(--wp--preset--color--contrast);
    border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 50%, transparent);
  }

  .wp-block-navigation a:hover {
    color: var(--wp--preset--color--primary) !important;
  }

  /* Submenu */
  .wp-block-navigation__submenu-container {
    padding-left: 15px;
    border-left: 2px solid color-mix(in srgb, var(--wp--preset--color--contrast) 30%, transparent);
    margin-top: 8px;
  }

  .wp-block-navigation__submenu-container a {
    font-size: var(--wp--preset--font-size--sml-medium);
    padding: 8px 0;
    border: none;
    color: var(--wp--preset--color--contrast) !important;
  }

  /* Hamburger buttons style */
  .wp-block-navigation__responsive-container-open,
  .wp-block-navigation__responsive-container-close {
    background: var(--wp--preset--color--primary);
    padding: 6px;
    border-radius: 6px;
    color: #fff !important;
    font-weight: 600;
  }

  /* Reduce Search button width by 20% on mobile */
  header .wp-block-button__link {
    width: 80%;
    text-align: center;
  }
}

/* -------------- header navigation  ----------------*/

/* -------------- logos for different color schemes  ----------------*/
footer figure.logo-dark,
header figure.logo-dark {
  display: none;
  margin-top: 0;
}

@media (prefers-color-scheme: dark) {

  footer figure.logo-light,
  header figure.logo-light {
    display: none;
    margin-top: 0;
  }

  footer figure.logo-dark,
  header figure.logo-dark {
    display: block;
  }
}

.page-template-full-width .entry-content {
  margin-top: 0;
}

/* scroll to top */
/* .gutentools-news-scroll-top {
  display: none;
} */

/* PC端隐藏返回顶部按钮 */
/* @media screen and (min-width: 769px) {
  .gutentools-news-scroll-top::before {
    display: none;
  }
} */

/* 移动端显示返回顶部按钮 */
/* @media screen and (max-width: 768px) {
  .gutentools-news-scroll-top::before {
    font-size: 26px;
    padding: 8px 13px;
    cursor: pointer;
    background: transparent;
    color: var(--wp--preset--color--secondary-bg);
    content: "\f062";
    font-family: "Font Awesome 5 Free";
    font-weight: 600;
    position: fixed;
    bottom: 8px;
    right: 15px;
  }

  #site-header > .wp-block-group {
    flex-wrap: wrap;
  }
  #site-header .search-actions-group {
    margin-left: auto;
  }
} */

/* scroll to top */

/* dashicon before categories, tag and date start */

.wp-block-archives-list.wp-block-archives li::before,
.wp-block-categories-list.wp-block-categories li::before {
  font-family: "Font Awesome 5 Free";
  content: "\f054";
  margin-right: 8px;
  font-weight: 600;
  font-size: var(--wp--preset--font-size--small);
}

.wp-block-archives-list.wp-block-archives li,
.wp-block-categories-list.wp-block-categories li {
  list-style-type: none;
}

.wp-block-archives-list.wp-block-archives,
.wp-block-categories-list.wp-block-categories {
  padding-left: 10px;
}

.wp-block-tag-cloud a.tag-cloud-link {
  font-size: var(--wp--preset--font-size--sml-medium) !important;
}

/* 移除 Font Awesome 图标前缀 - 已被 SVG 替代 */
/* .tag-cloud-link::before,
.taxonomy-post_tag a:before {
  font-family: "Font Awesome 5 Free";
  content: "\f02b";
  font-weight: 600;
  margin-right: 8px;
} */

.tag-cloud-link,
.taxonomy-post_tag a {
  text-decoration: none;
  background: transparent;
  margin: 0 5px 5px 0;
  padding: 0 10px;
  border-radius: 6px;
  font-size: var(--wp--preset--font-size--small);
  display: inline-block;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--wp--preset--color--primary);
}

/* Hover 状态 - 添加背景 */
.tag-cloud-link:hover,
.taxonomy-post_tag a:hover {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--white);
}

.products-block-post-template li {
  box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
}

/* p.gutentools-news-scroll-top {
  position: absolute;
} */

.column-has-radius {
  border-radius: 8px;
}

.has-bg-image {
  background: #fff;
  border-radius: 100px;
  height: 100px;
  width: 100px;
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

footer .has-arrow ul {
  padding: 0;
}

footer .has-arrow ul li:before {
  content: "\f345";
  font-family: "dashicons";
  position: absolute;
  left: 0;
  top: 2px;
  font-size: 0.75rem;
}

footer .has-arrow ul li {
  list-style: none;
  padding-left: 15px;
  position: relative;
}

a.wp-block-post-excerpt__more-link {
  background: transparent;
  color: inherit;
  border: 1px solid var(--wp--preset--color--secondary-bg);
  text-decoration: none;
  font-size: var(--wp--preset--font-size--small);
  padding: 8px 20px;
  border-radius: 6px;
  position: relative;
}

@media (max-width: 768px) {

  .no-border-mobile,
  .no-border-mobile .wp-block-column {
    border: none !important;
  }

  .wp-block-group.top-bar {
    padding: 10px 15px !important;
  }

  .wp-block-group.top-bar .wp-block-group {
    width: 100%;
    justify-content: space-between;
  }
}

/* blog page style */

.wp-block-post-author__name::before {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  content: "\f007";
  padding-right: 8px;
}

/*日历图标，不需要了
.wp-block-post-date time::before {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  content: "\f073";
  padding-right: 8px;
}*/

/* Post date secondary text color */
.wp-block-post-date time,
.wp-block-post-date a {
  color: var(--theme-color-secondary-text);
}

.wp-block-read-more-is-layout-flow::after {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  content: "\f061";
  padding-left: 8px;
}

.wp-block-read-more-is-layout-flow:hover::after {
  padding-left: 10px;
  transition: color 0.1s ease;
}

a.wp-block-post-author-name__link:before {
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  content: "\f007";
  padding-right: 8px;
}

/* blog page style */

/* footer style */

footer a {
  text-decoration: none;
}

/* footer style */

/* additional css */

.hoverImageWrapper {
  position: relative;
  align-self: stretch;
  height: auto;
  flex-shrink: 0;
  object-fit: cover;
  max-width: 100%;
  overflow: hidden !important;
}

/* 针对 WordPress figure 元素 */
.wp-block-post-featured-image.hoverImageWrapper {
  overflow: hidden !important;
}

/* Trending News - 第一篇文章左侧圆角 */
.trending-news-query>.wp-block-post-template>li:first-child .wp-block-post-featured-image,
.trending-news-query>.wp-block-post-template>li:first-child .wp-block-post-featured-image img,
.trending-news-query>.wp-block-post-template>li:first-child .wp-block-post-featured-image a {
  border-radius: var(--featured-image-radius, 12px) 0 0 var(--featured-image-radius, 12px) !important;
  overflow: hidden !important;
}

/* 确保链接标签不破坏圆角效果 */
.hoverImageWrapper a,
.wp-block-post-featured-image.hoverImageWrapper a {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden !important;
}

.hoverImageWrapper img {
  transition: transform 0.5s ease-in-out;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hoverImageWrapper:hover img {
  transform: scale(1.1);
}

/* Don't Miss 区域的圆角容器 */
.circular-image-container {
  overflow: hidden;
  aspect-ratio: 1 / 1;
  align-self: flex-start;
}

/* 确保 featured-image 块填充整个容器 */
.circular-image-container .wp-block-post-featured-image {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 0 !important;
  display: block !important;
}

/* 图片填充容器，使用 cover 裁剪多余部分 */
.circular-image-container img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  border-radius: 0 !important;
  display: block !important;
}

.wp-block-navigation__submenu-container {
  padding: 10px 18px !important;
}

.wp-block-navigation__submenu-container li {
  padding-bottom: 4px !important;
}

.wp-block-navigation__submenu-container li:last-of-type {
  padding-bottom: 0px !important;
}

/* responsive style */

@media (max-width: 768px) {
  .r-spacing {
    margin-top: 60px !important;
    margin-bottom: 60px !important;
  }

  .r-pad {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
  }

  .r-cover {
    min-height: 250px !important;
  }

  .image-gallery {
    grid-template-columns: repeat(1, 1fr) !important;
  }

  .featured-posts-right {
    padding: 20px !important;
  }

  #site-header>.wp-block-group {
    flex-wrap: wrap;
  }

  #site-header .search-actions-group {
    margin-left: auto;
  }
}

/* gutentools news css */

/* gutentools news css */

/* ==================== 原有搜索按钮样式 ==================== */

/* 隐藏原有的 WordPress 搜索 input，我们使用自定义的搜索表单 */
header .wp-block-search__input {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  position: absolute !important;
  pointer-events: none !important;
}

header .wp-block-search__button,
header .wp-block-search__button:hover {
  background-color: unset !important;
  padding: 0;
  align-items: center;
}

header .wp-block-search__button svg {
  width: 2.5em;
  height: 2.5em;
}

/* 搜索图标使用 primary color */
header .wp-block-search__button {
  color: var(--theme-color-primary);
}

header .wp-block-search__button svg {
  fill: currentColor;
}

/* 保持搜索按钮在所有状态下的颜色 */
header .wp-block-search__button:active,
header .wp-block-search__button:focus,
header .wp-block-search__button:hover {
  color: var(--theme-color-primary) !important;
}

header .wp-block-search__button svg,
header .wp-block-search__button:active svg,
header .wp-block-search__button:focus svg,
header .wp-block-search__button:hover svg {
  fill: currentColor !important;
}

/* ==================== 弹出式搜索表单样式 ==================== */

/* 搜索表单容器 - 默认隐藏，绝对定位弹出 */
form#search-form {
  display: none;
  position: absolute;
  right: 10px;
  bottom: -72px;
  z-index: 9999;
  background: var(--theme-color-background);
  border: 1px solid var(--theme-color-secondary-bg);
  border-radius: 8px;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
  transform: translateY(-10px);
  width: calc(100% - 20px);
  max-width: 400px;
  visibility: hidden;
}

/* 搜索表单激活状态 */
form#search-form.active {
  display: flex !important;
  opacity: 1;
  transform: translateY(0);
  justify-content: space-between;
  align-items: center;
  gap: 0;
  visibility: visible;
}

/* 搜索输入框 */
form#search-form input[type="text"] {
  border: none;
  padding: 16px 20px;
  font-size: var(--wp--preset--font-size--sml-medium);
  background: transparent;
  color: var(--theme-color-foreground);
  outline: none;
  flex: 1;
  min-width: 0;
}

form#search-form input[type="text"]::placeholder {
  color: var(--theme-color-secondary-text);
}

/* 搜索提交按钮 */
form#search-form .search-submit {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-color-primary);
  transition: color 0.3s ease, background-color 0.3s ease;
  flex-shrink: 0;
}

form#search-form .search-submit:hover {
  color: var(--wp--preset--color--primary);
  background-color: rgba(0, 212, 255, 0.08);
}

form#search-form .search-submit svg {
  fill: currentColor;
}

/* 确保header可以包含绝对定位的搜索表单 */
header#sticky-header>.wp-block-group,
#site-header>.wp-block-group {
  position: relative;
}

/* 确保 patterns/header.php 中的容器可以包含绝对定位的搜索表单 */
header#sticky-header .wp-block-group {
  position: relative;
}

@media (max-width: 768px) {
  #site-header>.wp-block-group {
    flex-wrap: nowrap !important;
    justify-content: flex-start;
    align-items: center;
    gap: 0;
  }

  /* 让 logo 占据剩余空间 */
  #site-header>.wp-block-group>.wp-block-group:first-child {
    flex: 1;
  }

  /* 将导航菜单按钮移到搜索旁边 */
  #site-header .wp-block-columns {
    display: flex;
    align-items: center !important;
    margin-right: 0;
  }

  #site-header .wp-block-navigation__responsive-container-open {
    margin-right: 8px;
  }

  /* 移动端搜索表单样式调整 */
  form#search-form {
    right: 10px;
    left: 10px;
    bottom: -68px;
    width: calc(100% - 20px);
  }

  form#search-form input[type="text"] {
    padding: 14px 16px;
    font-size: var(--wp--preset--font-size--sml-medium);
  }

  form#search-form .search-submit {
    padding: 6px 12px;
  }
}

.home .taxonomy-category a {
  display: inline-block;
  padding: 3px 12px 1px;
  border-radius: 3px;
  font-size: var(--wp--preset--font-size--small);
  font-weight: 500;
  margin-top: 5px;
  margin-right: 10px;
}

.home .taxonomy-category.blue-taxonomy a,
.home .all-taxonomy li:nth-child(3n + 1) .taxonomy-category a {
  background-color: #0187ca;
  color: #fff;
}

.home .taxonomy-category.red-taxonomy a,
.home .all-taxonomy li:nth-child(3n + 2) .taxonomy-category a {
  background-color: #c00536;
  color: #fff;
}

.home .taxonomy-category.yellow-taxonomy a,
.home .all-taxonomy li:nth-child(3n + 3) .taxonomy-category a {
  background-color: #ffa100;
  color: #fff;
}

.home .taxonomy-category .wp-block-post-terms__separator {
  display: none;
}

/* Home category taxonomy - unified style for homepage categories */
.home .home-category {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.home .home-category a {
  display: inline-block;
  width: auto;
  height: auto;
  padding: 3px 0px 1px;
  border-radius: 3px;
  font-size: var(--wp--preset--font-size--small);
  font-weight: 500;
  margin-top: 5px;
  margin-left: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--category-underline-color, currentColor);
  text-decoration-thickness: 1px;
}

.home .home-category a+a {
  margin-left: 5px;
}

/* Dynamic overlay - 纯CSS渐变方案，自动适配浅色/深色模式 */
/* 特异度必须高于 WordPress 核心的 .wp-block-cover .has-background-dim:not(...) (0,3,0) */
.wp-block-cover.dynamic-overlay .wp-block-cover__background.has-background-dim {
  background: linear-gradient(180deg,
      transparent 0%,
      transparent 40%,
      var(--gradient-overlay-top) 65%,
      var(--gradient-overlay-bottom) 100%);
}

/* Footer navigation links style */
.wp-block-group .footer-nav-link {
  margin: 0;
  margin-left: 20px;
}

.wp-block-group .footer-nav-link a {
  color: var(--theme-color-contrast);
  text-decoration: none;
  transition: color 0.3s ease;
}

.wp-block-group .footer-nav-link a:hover {
  color: var(--wp--preset--color--primary);
}

/* Footer logo - prevent shrinking */
footer .wp-block-image figure {
  flex-shrink: 0;
  min-width: 260px;
}

/* Footer logo - prevent shrinking */
footer .wp-block-image figure {
  flex-shrink: 0;
  min-width: 260px;
}

/* Footer responsive styles */
@media (max-width: 768px) {

  /* Reduce gap between logo and text on mobile */
  .footer-main-group {
    --footer-gap: 5px;
  }

  /* Increase logo width on mobile by 30% */
  footer .wp-block-group {
    --logo-width: 338px;
  }
}

/* Desktop - Don't Miss horizontal layout */
@media (min-width: 769px) {

  /* Don't Miss section - 3 columns grid layout */
  .is-position-sticky .wp-block-query .wp-block-post-template.is-layout-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Latest 2 to 9 区域 - 图片和文字间距 */
  .latest-right-column .wp-block-columns.horizontal-layout.is-layout-flex {
    gap: 4px;
  }

  /* Don't Miss 区域 - 图片和文字间距 */
  .is-position-sticky .wp-block-columns.horizontal-layout.is-layout-flex {
    gap: 4px;
  }

  .wp-block-columns.horizontal-layout>.wp-block-column:first-child {
    flex-shrink: 0;
    flex-grow: 0;
    min-width: 90px;
    width: 90px;
    max-width: 90px;
  }

  .wp-block-columns.horizontal-layout>.wp-block-column:last-child {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: auto;
    width: auto;
    padding-left: 8px;
  }
}

/* Latest Posts - keep horizontal layout on mobile */
@media (max-width: 768px) {

  /* Override grid layout for Latest 2 to 9 section - use larger minmax to force single column with horizontal content */
  .r-spacing>.wp-block-columns>.wp-block-column:last-child .wp-block-post-template.is-layout-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  /* Force columns to stay horizontal - must use !important to override WordPress core !important */
  /* Directly target .wp-block-columns with maximum specificity */
  .wp-block-columns.is-layout-flex.horizontal-layout {
    flex-wrap: nowrap !important;
    flex-direction: row !important;
  }

  /* Override WordPress core width: 100% rule */
  .wp-block-columns.horizontal-layout>.wp-block-column {
    width: auto !important;
    flex-basis: auto !important;
  }

  .wp-block-columns.horizontal-layout>.wp-block-column:first-child {
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    min-width: 100px !important;
    width: 100px !important;
    max-width: 100px !important;
  }

  .wp-block-columns.horizontal-layout>.wp-block-column:last-child {
    flex-grow: 1 !important;
    flex-shrink: 1 !important;
    flex-basis: auto !important;
    width: auto !important;
    padding-left: 16px !important;
  }

  /* Don't Miss section - keep horizontal layout on mobile */
  @media (max-width: 768px) {

    /* Force columns to stay horizontal - must use !important to override WordPress core !important */
    .wp-block-columns.is-layout-flex.horizontal-layout {
      flex-wrap: nowrap !important;
      flex-direction: row !important;
    }

    /* First column with featured image - 15% width on mobile */
    .wp-block-columns.horizontal-layout>.wp-block-column:first-child {
      flex-shrink: 0 !important;
      flex-grow: 0 !important;
      width: 15% !important;
      max-width: 15% !important;
      min-width: 60px !important;
    }

    /* Limit featured image width inside first column */
    .wp-block-columns.horizontal-layout>.wp-block-column:first-child .wp-block-post-featured-image {
      max-width: 75px !important;
      width: 75px !important;
      height: 75px !important;
      aspect-ratio: 1 !important;
    }

    /* Target the img element inside featured image */
    .wp-block-columns.horizontal-layout>.wp-block-column:first-child .wp-block-post-featured-image img {
      max-width: 75px !important;
      width: 75px !important;
      height: 75px !important;
      object-fit: cover !important;
    }

    /* Don't Miss section - circular image container, only remove max-width limit */
    .wp-block-columns.horizontal-layout>.wp-block-column.circular-image-container {
      max-width: none !important;
    }

    /* Don't Miss section - allow full width for featured image */
    .wp-block-columns.horizontal-layout>.wp-block-column.circular-image-container .wp-block-post-featured-image {
      max-width: none !important;
      width: 100% !important;
      height: 100% !important;
    }

    /* Don't Miss section - allow full width for img */
    .wp-block-columns.horizontal-layout>.wp-block-column.circular-image-container .wp-block-post-featured-image img {
      max-width: none !important;
      width: 100% !important;
      height: 100% !important;
    }

    /* Second column with content - adapt remaining width */
    .wp-block-columns.horizontal-layout>.wp-block-column:last-child {
      flex-grow: 1 !important;
      flex-shrink: 1 !important;
      flex-basis: auto !important;
      width: auto !important;
      padding-left: 10px !important;
    }
  }
}

/* Latest Group - 中等屏幕（768px-1042px）垂直堆叠 */
@media (min-width: 769px) and (max-width: 1042px) {

  /* 让 Latest columns 垂直堆叠 */
  .latest-columns {
    flex-direction: column;
  }

  /* 每个 column 宽度 100% */
  .latest-columns .wp-block-column {
    width: 100% !important;
    flex-basis: 100% !important;
  }

  /* 第一个文章使用移动端高度250px */
  .latest-columns .r-cover {
    min-height: 250px !important;
  }

  /* 取消右侧固定高度 */
  .latest-right-column {
    height: auto !important;
    overflow: visible !important;
  }

  /* 改为单列垂直滚动布局 */
  .latest-right-column .wp-block-post-template.is-layout-grid {
    display: flex;
    flex-direction: column;
    height: auto !important;
    gap: 16px;
  }

  /* 恢复项目间距 */
  .latest-right-column .wp-block-post-template.is-layout-grid>* {
    margin-bottom: 0 !important;
  }
}

/* Latest Group - 大屏幕（1043px以上）固定桌面端高度 */
@media (min-width: 1043px) {

  /* 右侧 column 固定高度并可滚动 */
  .latest-right-column {
    height: 580px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
  }

  /* 让 grid 的 4 行平均分布高度 */
  .latest-right-column .wp-block-post-template.is-layout-grid {
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    height: 580px;
    align-content: start;
    column-gap: 16px;
    row-gap: 0;
  }

  /* 每个文章项的高度平均分配，移除所有 margin */
  .latest-right-column .wp-block-post-template.is-layout-grid>* {
    min-height: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  /* 美化滚动条（可选） */
  .latest-right-column::-webkit-scrollbar {
    width: 6px;
  }

  .latest-right-column::-webkit-scrollbar-track {
    background: var(--theme-color-secondary-bg);
    border-radius: 3px;
  }

  .latest-right-column::-webkit-scrollbar-thumb {
    background: var(--theme-color-tertiary);
    border-radius: 3px;
  }

  .latest-right-column::-webkit-scrollbar-thumb:hover {
    background: var(--theme-color-primary);
  }
}

/* Featured and Latest first post title - use mdm-large on small screens */
@media (max-width: 768px) {

  .featured-first-title a,
  .featured-second-title a,
  .latest-first-title a {
    font-size: var(--wp--preset--font-size--mdm-large) !important;
  }
}

/* Latest 2 to 9 section - title line clamp */
.latest-right-column .wp-block-post-title a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-line-clamp: 4;
  /* 桌面端：限制为4行 */
}

@media (max-width: 768px) {
  .latest-right-column .wp-block-post-title a {
    -webkit-line-clamp: 3;
    /* 移动端：限制为3行 */
    font-size: 1.15rem !important;
  }
}

/* ============== Single Post Staggered Layout ============== */

@media (min-width: 769px) {
  /* Title wrapper: 不做任何覆盖，让它保持 constrained 布局默认的
     max-width: 1200px + margin: 0 auto，与 columns 块左边缘对齐 */

  /* Post title h1: 960px, 在 default layout 的 wrapper 内自然左对齐 */
  .single-post-title-wrapper .wp-block-post-title {
    max-width: 960px;
  }

  /* Featured image + content container: 740px, 左对齐在 content column 内 */
  .single-post-content-area .single-post-featured-inner {
    max-width: 740px;
  }

  /* Content wrapper: 630px, margin-left: auto 使其右边缘与特色图右边缘对齐 */
  .single-post-featured-inner .single-post-content-wrapper {
    max-width: 630px;
    margin-left: auto;
  }
}

/* Mobile: 全部回到 100% 宽度 */
@media (max-width: 768px) {

  .single-post-title-wrapper .wp-block-post-title,
  .single-post-featured-inner,
  .single-post-content-wrapper {
    max-width: 100%;
    margin-left: 0;
  }

  /* 单篇文章页面 - 移动端 margin-top 减半 */
  .single-post-layout {
    margin-top: 40px !important;
  }

  /* Sidebar latest-posts - 移动端 non-first items 字体匹配 Related Posts (继承容器的 90% ≈ 14.4px) */
  .sidebar-latest-posts .wp-block-latest-posts li:not(:first-child) a {
    font-size: inherit;
  }
}

/* ============== Category & Tag Icon Styling ============== */

/* Category SVG 图标样式 - 使用 ::before 伪元素 */
.wp-block-post-terms.has-folder-icon {
  display: inline-flex;
  align-items: center;
  font-family: var(--wp--preset--font-family--heading);
}

/* 去掉 category 和 tags 的分隔逗号 */
.wp-block-post-terms.has-folder-icon .wp-block-post-terms__separator,
.wp-block-post-terms.has-tag-icon .wp-block-post-terms__separator {
  display: none;
}

/* Category 链接添加 primary color 下划线和间距 */
.wp-block-post-terms.has-folder-icon a {
  text-decoration: underline;
  text-decoration-color: var(--wp--preset--color--primary);
  text-underline-offset: 3px;
  margin-right: 8px;
}

/* Tag 链接添加间距 */
.wp-block-post-terms.has-tag-icon a {
  margin-right: 8px;
}

/* 在第一个链接前添加文件夹图标 - 使用 mask 方式实现颜色继承 */
.wp-block-post-terms.has-folder-icon>a:first-of-type::before {
  content: "";
  display: inline-block;
  width: 1.3em;
  height: 1.3em;
  margin-right: 6px;
  vertical-align: middle;
  background-color: currentColor;
  /* 使用 mask，这样可以继承颜色 */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M 4 4 C 2.9057453 4 2 4.9057453 2 6 L 2 18 C 2 19.094255 2.9057453 20 4 20 L 20 20 C 21.094255 20 22 19.094255 22 18 L 22 8 C 22 6.9057453 21.094255 6 20 6 L 12 6 L 10 4 L 4 4 z M 4 6 L 9.171875 6 L 11.171875 8 L 20 8 L 20 18 L 4 18 L 4 6 z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M 4 4 C 2.9057453 4 2 4.9057453 2 6 L 2 18 C 2 19.094255 2.9057453 20 4 20 L 20 20 C 21.094255 20 22 19.094255 22 18 L 22 8 C 22 6.9057453 21.094255 6 20 6 L 12 6 L 10 4 L 4 4 z M 4 6 L 9.171875 6 L 11.171875 8 L 20 8 L 20 18 L 4 18 L 4 6 z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

/* Tag SVG 图标样式 - 使用 ::before 伪元素 */
.wp-block-post-terms.has-tag-icon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--wp--preset--font-family--heading);
}

/* 在整个区块前添加标签图标 - 使用 mask 方式实现颜色继承 */
.wp-block-post-terms.has-tag-icon::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 4px;
  vertical-align: middle;
  background-color: currentColor;
  /* 使用 mask，这样可以继承颜色 */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 79.97 79.95'%3E%3Cg id='Layer_2' data-name='Layer 2'%3E%3Cg id='Layer_1-2' data-name='Layer 1'%3E%3Cpath class='cls-1' d='M2,11.41c0,7.18.14,14.1-.05,21a16.6,16.6,0,0,0,5.29,12.9Q21.06,59,34.72,72.78a18.86,18.86,0,0,0,7.88,5c-4.05,3.1-7.45,2.78-10.31,0-10.09-9.87-20-19.91-30-29.91A7.36,7.36,0,0,1,0,42.47Q0,29,0,15.55C0,14.06.16,12.57,2,11.41Z'/%3E%3Cpath d='M76.74,31.36C67.41,21.9,58,12.56,48.59,3.14a9.35,9.35,0,0,0-7-3.14C33.11.07,24.64-.06,16.17.06,10.78.13,8.1,3,8,8.52,7.91,12.68,8,16.83,8,21c0,3.83.13,7.65,0,11.47a10.46,10.46,0,0,0,3.34,8.44c9.34,9.22,18.55,18.57,27.87,27.8,4.48,4.44,8,4.5,12.45.15q12.6-12.42,25-25C81,39.35,81.1,35.77,76.74,31.36Zm-48.62-7a3.45,3.45,0,0,1-3.42-4c.11-2.61,1.64-3.8,4.21-3.63,2.42.16,3.32,1.72,3.48,3.75C32.12,23.29,30.62,24.58,28.12,24.39Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 79.97 79.95'%3E%3Cg id='Layer_2' data-name='Layer 2'%3E%3Cg id='Layer_1-2' data-name='Layer 1'%3E%3Cpath class='cls-1' d='M2,11.41c0,7.18.14,14.1-.05,21a16.6,16.6,0,0,0,5.29,12.9Q21.06,59,34.72,72.78a18.86,18.86,0,0,0,7.88,5c-4.05,3.1-7.45,2.78-10.31,0-10.09-9.87-20-19.91-30-29.91A7.36,7.36,0,0,1,0,42.47Q0,29,0,15.55C0,14.06.16,12.57,2,11.41Z'/%3E%3Cpath d='M76.74,31.36C67.41,21.9,58,12.56,48.59,3.14a9.35,9.35,0,0,0-7-3.14C33.11.07,24.64-.06,16.17.06,10.78.13,8.1,3,8,8.52,7.91,12.68,8,16.83,8,21c0,3.83.13,7.65,0,11.47a10.46,10.46,0,0,0,3.34,8.44c9.34,9.22,18.55,18.57,27.87,27.8,4.48,4.44,8,4.5,12.45.15q12.6-12.42,25-25C81,39.35,81.1,35.77,76.74,31.36Zm-48.62-7a3.45,3.45,0,0,1-3.42-4c.11-2.61,1.64-3.8,4.21-3.63,2.42.16,3.32,1.72,3.48,3.75C32.12,23.29,30.62,24.58,28.12,24.39Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  flex-shrink: 0;
}

/* ---- Sidebar Latest Posts (match Related Posts styling) ---- */

.sidebar-latest-posts .wp-block-latest-posts {
  font-size: 90%;
}

.sidebar-latest-posts .wp-block-latest-posts li {
  margin-bottom: 0.75em;
}

/* First item: flex layout with thumbnail */
.sidebar-latest-posts .wp-block-latest-posts li:first-child {
  margin-bottom: 1.2em;
}

/* Thumbnail: only show on first item */
.sidebar-latest-posts .wp-block-latest-posts li:not(:first-child) .wp-block-latest-posts__featured-image {
  display: none;
}

.sidebar-latest-posts .wp-block-latest-posts__featured-image img {
  border-radius: var(--featured-image-radius, 4px);
}

/* Title links: match Related Posts h4 (font-size 1.1em, weight 400) */
.sidebar-latest-posts .wp-block-latest-posts li:first-child a {
  text-decoration: none;
  font-size: 1.1em;
  font-weight: 400;
}

/* Non-first items: bullet style, normal weight */
.sidebar-latest-posts .wp-block-latest-posts li:not(:first-child) {
  list-style: none;
}

.sidebar-latest-posts .wp-block-latest-posts li:not(:first-child)::before {
  content: "\2022\00a0";
  opacity: 0.7;
}

.sidebar-latest-posts .wp-block-latest-posts li:not(:first-child) a {
  text-decoration: none;
  font-weight: 400;
}

.sidebar-latest-posts .wp-block-latest-posts__post-excerpt {
  display: none;
}

/* ---- Related Posts hover color ---- */

.wp-block-wrp-related-posts .wrp-post-item:hover a {
  color: var(--theme-color-title-hover);
}

.sidebar-latest-posts .wp-block-latest-posts li:hover a {
  color: var(--theme-color-title-hover);
}