/*
    Template: consulting
    Theme Name: Consulting Child Theme
    Theme URI: http://consulting.stylemixthemes.com/
    Author: StylemixThemes
    Author URI: http://stylemixthemes.com/
    Description: Consulting - Business and Finance WordPress theme. Using Consluting you can easily create a modern website with real content. Easily edit the real content and compose the page layout with drag & drop page builder Consulting is the best ever finance, consulting, brokerage WordPress theme. It’s fully Responsive and Easy to Customize using intuitive Drag & Drop Visual Composer and Theme Options panel in WordPress Customizer.
    Version: 4.0.2
    License: GNU General Public License v2 or later
    License URI: http://www.gnu.org/licenses/gpl-2.0.html
    Tags: blue, one-column, two-columns, three-columns, four-columns, left-sidebar, right-sidebar, fixed-layout, fluid-layout, responsive-layout, custom-background, custom-colors, custom-header, custom-menu, sticky-post, translation-ready
    Text Domain: consulting-child-theme
*/

/* --- 产品页面 "Contact Us" 按钮样式 --- */

/* 1. 让选项卡容器使用Flex布局，方便对齐 */
.woocommerce-tabs ul.tabs {
    display: flex; /* 启用Flex布局 */
    align-items: center; /* 垂直居中对齐所有项目 */
    flex-wrap: wrap; /* 允许换行，适应小屏幕 */
}

/* 2. "Contact Us" 按钮容器的样式 */
li.custom-contact-tab {
    list-style: none !important; /* 移除可能出现的列表圆点 */
    background: none !important; /* 清除从主题继承的背景 */
    border: none !important; /* 清除从主题继承的边框 */
    padding: 0 0 0 20px !important; /* 与左侧的 "Description" 保持间距 */
    margin: 5px 0; /* 添加一点垂直边距 */
}

/* 移除主题可能添加的伪元素 */
li.custom-contact-tab::before {
    display: none !important;
}

/* 3. "Contact Us" 按钮本身的设计 */
a.custom-contact-button {
    display: inline-block;
    background-color: #D4AF37; /* 使用一个醒目的金色作为背景色，您可以换成自己的品牌色 */
    color: #ffffff !important; /* 文字颜色为白色 */
    padding: 10px 25px;
    border-radius: 5px; /* 圆角 */
    font-weight: bold;
    text-decoration: none;
    line-height: 1.4;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
}

/* 4. 鼠标悬停时的交互效果 */
a.custom-contact-button:hover {
    background-color: #c5a02c; /* 鼠标悬停时颜色加深 */
    color: #ffffff !important;
    transform: translateY(-2px); /* 轻微上浮效果 */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* 添加一点阴影 */
}


.staff_department {
	margin-bottom: 2px;
}


/* ======== Factory ======= */
/* Custom Project Grid Styles (WPBakery & Elementor compatible) */
.custom-work-grid-container {
  display: grid;
  /* gap and columns are controlled by inline styles from the shortcode */
}

.custom-work-grid-item {
  position: relative;
  display: block;
  
  /* --- Adjustment: Make cards "taller" --- */
  min-height: 250px; /* Was 350px */
  
  background-size: cover;
  background-position: center center;
  border-radius: 8px; /* Slight rounded corners */
  overflow: hidden; /* Ensures overlay and border-radius work */
  text-decoration: none;
  transition: transform 0.3s ease;
}

.custom-work-grid-item:hover {
  transform: scale(1.03); /* Slight zoom on hover */
}

/* --- Adjustment: "Overlay" effect for better text readability --- */
.custom-work-grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Adjusted gradient: 85% black at the bottom, fading to transparent at 70% height */
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 10%, rgba(0, 0, 0, 0) 70%);
}

/* --- "White Text" effect --- */
.custom-work-grid-content {
  position: absolute;
  bottom: 25px;
  left: 25px;
  right: 25px;
  z-index: 2;
  color: #ffffff; /* Default text color is white */
}

.custom-work-grid-content h3 {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff; /* Title is white */
  margin: 0;
}

.custom-work-grid-content span {
  font-size: 16px;
  color: #ffffff; /* Subtitle is white */
  opacity: 0.9;
}




/*========= Back to top ===================== */
/* Back to Top Button Styles */
.back-to-top-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  
  /* 默认隐藏 (由 JS 控制显示) */
  display: none; 
  
  /* 按钮样式 */
  width: 45px;
  height: 45px;
  background-color: #333333; /* 按钮背景色 (您可以改成您网站的主题色) */
  color: #ffffff; /* 图标颜色 */
  text-decoration: none;
  border-radius: 5px; /* 圆角 (改成 50% 就是圆形) */
  
  /* 图标居中 */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  
  /* 效果 */
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.back-to-top-button:hover {
  opacity: 1;
  color: #ffffff;
  text-decoration: none;
}





/* --- 0. [居中修复] - 强制容器居中 --- */
/* * 这是最关键的修复：
 * 我们给您的 .company_history 容器一个具体的最大宽度 (例如 900px)
 * 然后使用 margin: 0 auto; 强制它在页面上水平居中。
 * 这样，里面的 "left: 50%" 才能实现真正的居中。
*/
div.company_history {
  width: 100%;
  max-width: 900px; /* 您可以调整这个宽度 */
  margin: 0 auto; /* 关键！使整个组件居中 */
  box-sizing: border-box;
}

/* --- 1. 强制重置 (基本不变) --- */
.company_history ul {
  list-style: none;
  padding: 0 !important; /* 强制清除内边距 */
  margin: 0 !important;  /* 强制清除外边距 */
  position: relative;
  display: block !important;
  width: 100%;
}

.company_history ul li {
  display: flex !important;
  justify-content: space-between;
  align-items: flex-start; 
  width: 100% !important;
  padding-bottom: 50px !important;
  position: relative;
}

.company_history .year,
.company_history .company_history_text {
  display: block !important;
  width: 45% !important; 
  padding: 0 !important;
  box-sizing: border-box;
  position: relative;
  /* [美化] 稍微下移内容，使其与圆点顶部对齐 */
  top: 5px; 
}

/* 隐藏主题的旧装饰线 */
.company_history .year::before,
.company_history .year::after,
.company_history ul li::after {
  display: none !important;
}

/* --- 2. 中轴线 (基本不变) --- */
.company_history ul::before {
  content: '';
  position: absolute;
  top: 15px; /* [美化] 调整线条起点 */
  bottom: 50px; 
  left: 50%; /* 现在会正确居中 (因为父级已修复) */
  width: 3px; 
  background-color: #c0a16e; 
  transform: translateX(-50%);
  z-index: 0; 
}

/* --- 3. 中轴线圆点 (基本不变) --- */
.company_history ul li::before {
  content: '';
  position: absolute;
  top: 10px; /* [美化] 调整圆点垂直位置 */
  left: 50%;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: #c0a16e; 
  border: 3px solid #fff; 
  transform: translateX(-50%);
  z-index: 1; 
}

/* --- 4. [美化] 默认 (奇数行) 内容样式 --- */
.company_history .year {
  text-align: right;
  padding-right: 35px; /* 与中轴线保持距离 */
  
  /* [美化] 样式 */
  font-size: 22px; /* 增大字号 */
  font-weight: 700; /* 加粗 */
  color: #333; /* 颜色加深 */
}

.company_history .company_history_text {
  text-align: left;
  padding-left: 35px; /* 与中轴线保持距离 */
}

/* --- 5. [美化] 交错 (偶数行) 内容样式 --- */
.company_history ul li:nth-child(even) {
  flex-direction: row-reverse; 
}

.company_history ul li:nth-child(even) .year {
  text-align: left;
  padding-left: 35px;
  padding-right: 0;
}

.company_history ul li:nth-child(even) .company_history_text {
  text-align: right;
  padding-right: 35px;
  padding-left: 0;
}

/* --- 6. [美化] 详细内容样式 (H4 和 p) --- */
.company_history_text h4 {
  font-size: 22px; /* 增大字号 */
  font-weight: 700; /* 加粗 */
  color: #333; /* 颜色加深 */
  margin-top: 0;
  margin-bottom: 10px; /* [美化] 增加标题和描述的间距 */
}

/* 针对您截图中的 <p> 标签 */
.company_history_text p {
  font-size: 16px; /* [美化] 增大描述字号 */
  line-height: 1.6; /* [美化] 增加行高，更易读 */
  color: #555; /* [美化] 使用柔和的黑色 */
  margin: 0;
}

/* --- 7. 响应式 (更新) --- */
@media (max-width: 768px) {
  /* 移动端，重置容器宽度 */
  div.company_history {
      max-width: 100%;
      padding: 0 15px; /* 在移动端增加两侧边距 */
  }

  /* 隐藏中轴线和圆点 */
  .company_history ul::before,
  .company_history ul li::before {
    display: none;
  }

  /* 强制所有行都变为垂直堆叠 */
  .company_history ul li,
  .company_history ul li:nth-child(even) {
    flex-direction: column;
    /* [美化] 在移动端改为左对齐 */
    align-items: flex-start; 
  }

  /* 元素都占满宽度，并改为左对齐 */
  .company_history .year,
  .company_history .company_history_text,
  .company_history ul li:nth-child(even) .year,
  .company_history ul li:nth-child(even) .company_history_text {
    width: 100% !important;
    max-width: 100%;
    /* [美化] 在移动端改为左对齐 */
    text-align: left !important; 
    padding: 0 0 10px 0 !important;
    top: 0; /* 重置在PC端的偏移 */
  }

  /* 调整堆叠顺序和间距 */
  .company_history .year {
    padding-bottom: 5px !important;
    font-size: 20px; /* 移动端字号 */
  }
  .company_history .company_history_text {
    padding-bottom: 30px !important;
  }
   .company_history_text h4 {
     font-size: 20px; /* 移动端字号 */
     margin-bottom: 5px;
  }
}




/*
 * 关键选择器：
 * 找到 .staff_list 内部的、并且 :has(包含) a.read_more 链接的那个 li
*/
div.staff_list li:has(a.read_more) {
  /* 1. 强制其 flex 布局从“横向”变为“纵向” */
  flex-direction: column !important;
  
  /* 2. 让内部所有元素 (图片、文字) 水平居中 */
  align-items: center !important;
}

/* 3. 重置该 li 内部的 "图片" 容器的样式 */
div.staff_list li:has(a.read_more) .staff_image {
  width: auto !important; /* 宽度自动 */
  flex: none !important; /* 禁用 flex-grow/shrink */
  margin-bottom: 20px; /* 在图片和文字之间增加间距 */
}

/* 4. 重置该 li 内部的 "信息" 容器的样式 */
div.staff_list li:has(a.read_more) .staff_info {
  width: 100% !important; /* 宽度 100% */
  flex: none !important;
  padding-left: 0 !important; /* 移除左侧的内边距 */
  text-align: center; /* 内部文字居中 */
}

/* 5. 隐藏掉那个多余的 "read_more" 链接 */
div.staff_list li:has(a.read_more) a.read_more {
  display: none !important;
}

/* 6. (可选) 确保 Andrew 的图片也是圆形的，和另外两人统一 */
div.staff_list li:has(a.read_more) .staff_image img {
  border-radius: 50%;
}