/*
Theme Name: Dehuan Electronic
Theme URI: https://dhest.net
Author: Dehuan Electronic
Description: Pixel-perfect replica of the reference DHest website with English content.
Version: 2.0.0
Text Domain: dehuan
*/

/* ============================================================
   Base reset & WordPress-specific adjustments
   (All main design styles are in css/legacy.css — dh- design system)
   ============================================================ */

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    font-size: 14px;
    color: #333333;
    line-height: 1.6;
    background: #ffffff;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6 { margin: 0; padding: 0; }
p { margin: 0; }
.clear { clear: both; }

/* WordPress alignment */
.alignleft { float: left; margin-right: 20px; margin-bottom: 20px; }
.alignright { float: right; margin-left: 20px; margin-bottom: 20px; }
.aligncenter { display: block; margin: 0 auto 20px; }

/* Screen reader text */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Fix for section title underline image (xian3.png fallback) */
.dh-sec-head h2 {
    background-image: none;
    position: relative;
}
.dh-sec-head h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #017ddd;
    margin: 10px auto 0;
}

/* Floating toolbar position fix for WordPress */
.dh-fbar {
    position: fixed;
    right: 20px;
    bottom: 80px;
    z-index: 99;
}

/* Product tab active state */
.dh-prod-tab {
    display: inline-block;
    padding: 10px 24px;
    background: #017ddd;
    color: #ffffff;
    font-size: 15px;
    cursor: default;
}
.dh-prod-more {
    float: right;
    color: #ffffff;
    font-size: 13px;
    line-height: 40px;
    padding-right: 16px;
}

/* News column title color correction — reference uses #17494a but our primary is #017ddd */
.dh-news-col h3 {
    color: #017ddd;
    border-bottom-color: #017ddd;
}
.dh-news-col .dh-nc-more:hover {
    color: #017ddd;
}
.dh-tnews-item:hover span.dh-tn-title {
    color: #017ddd;
}

/* Certificate carousel - simplified static grid for WP version */
.dh-cert-scroll {
    overflow: hidden;
}
.dh-cert-track {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}
.dh-cert-item {
    text-align: center;
    flex: 0 0 auto;
}
.dh-cert-item p {
    margin-top: 10px;
    font-size: 13px;
    color: #666666;
}
.dh-cert-more {
    text-align: center;
    margin-top: 30px;
}
.dh-cert-more a {
    display: inline-block;
    color: #017ddd;
    border: 1px solid #017ddd;
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 14px;
}
.dh-cert-more a:hover {
    background: #017ddd;
    color: #ffffff;
}

/* About section stat adjustments */
.dh-about-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 40px;
    padding: 30px 0;
    border-top: 1px solid #e5e5e5;
}
.dh-stat-item {
    text-align: center;
}
.dh-stat-num {
    font-family: Impact, Arial Black, sans-serif;
    font-size: 60px;
    color: #296dde;
    line-height: 1;
    margin-bottom: 8px;
}
.dh-stat-label {
    font-size: 14px;
    color: #666666;
}

/* Strength cards */
.dh-strength-grid {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 16px;
}
.dh-strength-card {
    flex: 1;
    height: 269px;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}
.dh-strength-pic {
    width: 100%;
    height: 100%;
}
.dh-strength-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dh-strength-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
}

/* Scene icon fallback - use a colored circle with text */
.dh-ict {
    display: inline-block;
    width: 32px;
    height: 32px;
    margin-right: 10px;
    vertical-align: middle;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Inner page breadcrumb */
.dh-breadcrumb {
    padding: 16px 0;
    font-size: 13px;
    color: #666666;
}
.dh-breadcrumb a {
    color: #666666;
}
.dh-breadcrumb a:hover {
    color: #017ddd;
}

/* Post content styles */
.dh-post-content {
    font-size: 15px;
    line-height: 1.8;
    color: #333333;
}
.dh-post-content p {
    margin-bottom: 16px;
}
.dh-post-content h2 {
    font-size: 22px;
    margin: 24px 0 16px;
    color: #333333;
}
.dh-post-content h3 {
    font-size: 18px;
    margin: 20px 0 12px;
    color: #333333;
}
.dh-post-content ul,
.dh-post-content ol {
    margin: 0 0 16px 24px;
}
.dh-post-content ul { list-style: disc; }
.dh-post-content ol { list-style: decimal; }
.dh-post-content li {
    margin-bottom: 6px;
}
.dh-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}
.dh-post-content blockquote {
    border-left: 4px solid #017ddd;
    padding: 12px 20px;
    margin: 16px 0;
    background: #f5f9ff;
    color: #555555;
    font-style: italic;
}

/* Sidebar widget for inner pages */
.dh-side .widget {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    margin-bottom: 20px;
}
.dh-side .widget-title {
    background: #1565C0;
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;
    padding: 14px 16px;
    margin: 0;
}
.dh-side .widget ul {
    padding: 10px 0;
}
.dh-side .widget li {
    padding: 9px 16px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}
.dh-side .widget li a {
    color: #666666;
}
.dh-side .widget li a:hover {
    color: #1565C0;
}

/* Two-column inner page layout */
.dh-two-col {
    display: flex;
    align-items: flex-start;
}
.dh-two-main {
    flex: 1;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    padding: 30px;
    box-sizing: border-box;
    min-height: 400px;
}

/* Contact form styling */
.dh-contact-form {
    margin-top: 20px;
}
.dh-contact-form .form-group {
    margin-bottom: 16px;
}
.dh-contact-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #333333;
}
.dh-contact-form input[type="text"],
.dh-contact-form input[type="email"],
.dh-contact-form input[type="tel"],
.dh-contact-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    border-radius: 4px;
}
.dh-contact-form input:focus,
.dh-contact-form textarea:focus {
    outline: none;
    border-color: #017ddd;
}
.dh-contact-form textarea {
    resize: vertical;
    min-height: 120px;
}
.dh-contact-form button {
    background: #017ddd;
    color: #ffffff;
    border: none;
    padding: 12px 32px;
    font-size: 15px;
    cursor: pointer;
    border-radius: 4px;
}
.dh-contact-form button:hover {
    background: #0067b6;
}

/* ============================================================
   Additional dh- classes not in legacy.css
   (supplementary styles for inner pages)
   ============================================================ */

/* pcard active state (for client-side pagination) */
.dh-pcard-on { display: block; }

/* product tree - small icon variant */
.dh-ptree-iconS { display: inline-block; width: 10px; height: 10px; margin-right: 8px; vertical-align: middle; }
.dh-ptree-iconS.dh-ptree-icon-leaf {
    background: #017ddd;
    border-radius: 2px;
}

/* pagination button variants */
.dh-spage-prev,
.dh-spage-next {
    min-width: 60px;
}
.dh-spage-num {
    min-width: 36px;
}

/* news total text in pagination */
.dh-news-total {
    display: inline-block;
    margin-right: 12px;
    color: #666;
    font-size: 13px;
}

/* side-phone with icon (cases page style) */
.dh-side-phone img {
    float: left;
    margin-right: 10px;
    width: 60px;
    height: 60px;
}
.dh-side-phone span {
    display: block;
    overflow: hidden;
}
.dh-side-phone em {
    display: block;
    font-style: normal;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}
.dh-side-phone b {
    display: block;
    font-size: 18px;
    color: #ff0000;
    font-weight: bold;
}

/* Sanchor (scroll target offset) */
.dh-sanchor {
    display: block;
    height: 0;
    visibility: hidden;
}

/* News pagination - reference style buttons */
.dh-news-page {
    text-align: center;
    margin-top: 30px;
    padding: 20px 0;
}
.dh-news-page a,
.dh-news-page button {
    display: inline-block;
    padding: 6px 14px;
    margin: 0 4px;
    border: 1px solid #e5e5e5;
    background: #fff;
    color: #666;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    vertical-align: middle;
}
.dh-news-page a:hover {
    border-color: #017ddd;
    color: #017ddd;
}
.dh-news-page a.dh-np-current {
    background: #017ddd;
    border-color: #017ddd;
    color: #fff;
    cursor: default;
}
.dh-news-page button:disabled {
    color: #ccc;
    cursor: not-allowed;
    background: #f9f9f9;
}

/* Clear fix */
.clear { clear: both; }
.clear::after {
    content: "";
    display: table;
    clear: both;
}
