/*
Theme Name: Best Carbide
Theme URI: https://www.best-carbide.com
Author: Zhuzhou Best Carbide Co., Ltd.
Author URI: https://www.best-carbide.com
Description: A pixel-faithful WordPress port of the Best Carbide industrial cemented-carbide corporate website. Dark, heavy "hard metal" visual language with a full-width hero slider, product catalog (custom post type), news center, and built-in inquiry / contact lead capture. Follows WordPress theme development standards: theme.json, custom logo/menus, contentWidth, i18n, escaping, nonces and capability checks.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bestcarbide
Tags: custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, wide-blocks
*/

/*
 * The complete "industrial" design system (CSS custom properties, dark theme,
 * layout, components, responsive breakpoints) is shipped verbatim from the
 * original CMS in assets/css/bestcarbide.css and enqueued separately.
 *
 * This root stylesheet only carries the WordPress theme header (above) and
 * the small set of WordPress-specific overrides needed so core-generated
 * markup integrates cleanly with the ported design.
 */

/* ---------------------------------------------------------
   Accessibility: WordPress required screen-reader helpers
   --------------------------------------------------------- */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    clip: auto !important;
    clip-path: none;
    display: block;
    height: auto;
    width: auto;
    padding: 12px 18px;
    background: var(--color-primary, #c45c1a);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: normal;
    text-decoration: none;
    border-radius: var(--radius-sm, 4px);
    position: absolute;
    left: 8px;
    top: 8px;
    z-index: 100000;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

/* Skip link */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--color-primary, #c45c1a);
    color: #fff;
    padding: 12px 20px;
    z-index: 100001;
    border-radius: 0 0 var(--radius-sm, 4px) var(--radius-sm, 4px);
}

.skip-link:focus {
    left: 8px;
    color: #fff;
}

/* ---------------------------------------------------------
   WordPress admin bar / sticky header adjustment
   --------------------------------------------------------- */
body.admin-bar .main-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .main-header {
        top: 46px;
    }
}

/* ---------------------------------------------------------
   Menu: map WordPress state classes to the ported design
   --------------------------------------------------------- */
.nav-menu > li > a.current-menu-item,
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-ancestor > a,
.nav-menu > li.current-page-parent > a {
    color: var(--color-primary-light);
    background: rgba(196, 92, 26, 0.08);
}

.dropdown-menu li a.current-menu-item {
    color: var(--color-primary-light);
    background: rgba(196, 92, 26, 0.08);
    border-left-color: var(--color-primary);
}

/* ---------------------------------------------------------
   WordPress content alignments, captions, galleries
   --------------------------------------------------------- */
.alignleft {
    float: left;
    margin: 0 1.5em 1em 0;
}

.alignright {
    float: right;
    margin: 0 0 1em 1.5em;
}

.aligncenter {
    display: block;
    margin: 1.5em auto;
    clear: both;
}

.alignwide {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.alignfull {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.wp-caption {
    max-width: 100%;
    margin-bottom: 1.5em;
    color: var(--color-text-muted);
}

.wp-caption img[class*="wp-image-"] {
    display: block;
    margin: 0 auto;
    border-radius: var(--radius-md, 8px);
}

.wp-caption-text {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 8px;
    color: var(--color-text-muted);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 1.5em;
}

.gallery-item {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 8px);
    padding: 8px;
    margin: 0;
}

.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.gallery-columns-5 { grid-template-columns: repeat(5, 1fr); }

.gallery-caption {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    padding: 6px 4px 2px;
}

/* ---------------------------------------------------------
   Post content / rich text defaults inside dark cards
   --------------------------------------------------------- */
.entry-content,
.article-body,
.product-detail-content {
    color: var(--color-text);
}

.entry-content a,
.article-body a {
    color: var(--color-primary-light);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.entry-content a:hover,
.article-body a:hover {
    color: var(--color-secondary);
}

.entry-content ul,
.article-body ul {
    list-style: disc;
    padding-left: 1.4em;
    margin-bottom: 1.2em;
}

.entry-content ol,
.article-body ol {
    list-style: decimal;
    padding-left: 1.4em;
    margin-bottom: 1.2em;
}

.entry-content li,
.article-body li {
    margin-bottom: 0.4em;
}

.entry-content blockquote,
.article-body blockquote {
    border-left: 3px solid var(--color-primary);
    padding: 8px 0 8px 20px;
    margin: 1.4em 0;
    color: var(--color-text-muted);
    background: rgba(196, 92, 26, 0.05);
    border-radius: 0 var(--radius-sm, 4px) var(--radius-sm, 4px) 0;
}

.entry-content table,
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.4em;
}

.entry-content th,
.entry-content td,
.article-body th,
.article-body td {
    border: 1px solid var(--color-border);
    padding: 10px 12px;
    text-align: left;
}

.entry-content th,
.article-body th {
    background: var(--color-bg-card);
    color: var(--color-text-light);
}

.entry-content pre,
.article-body pre {
    background: var(--color-bg-darker);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm, 4px);
    padding: 16px;
    overflow-x: auto;
    color: var(--color-text);
}

.entry-content code,
.article-body code {
    background: var(--color-bg-darker);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

/* Featured image on single posts */
.post-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md, 8px);
    margin-bottom: 24px;
    border: 1px solid var(--color-border);
}

/* ---------------------------------------------------------
   Pagination (posts nav + archive pagination)
   --------------------------------------------------------- */
.bc-pagination,
.navigation.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 44px;
}

.bc-pagination a,
.bc-pagination span,
.navigation.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm, 4px);
    color: var(--color-text);
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
}

.bc-pagination a:hover,
.navigation.pagination a.page-numbers:hover {
    border-color: var(--color-primary);
    color: var(--color-primary-light);
}

.bc-pagination .current,
.navigation.pagination .page-numbers.current {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-color: var(--color-primary);
    color: #fff;
    font-weight: 700;
}

/* ---------------------------------------------------------
   Comments
   --------------------------------------------------------- */
.comments-area {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}

.comments-area .comments-title,
.comments-area .comment-reply-title {
    font-size: 1.4rem;
    color: var(--color-text-light);
    margin-bottom: 20px;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment-list .comment {
    margin-bottom: 24px;
}

.comment-body {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 8px);
    padding: 20px;
}

.comment-author .fn {
    color: var(--color-text-light);
    font-weight: 700;
}

.comment-metadata,
.comment-list .reply a {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.comment-list .children {
    list-style: none;
    padding-left: 24px;
    margin-top: 16px;
}

.comment-form label {
    display: block;
    margin-bottom: 6px;
    color: var(--color-text-light);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: var(--color-bg-darker);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm, 4px);
    color: var(--color-text);
}

.comment-form .submit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm, 4px);
    cursor: pointer;
    font-size: 0.95rem;
}

.required {
    color: var(--color-primary-light);
}

/* ---------------------------------------------------------
   Backward-compatible page hero used on static pages
   --------------------------------------------------------- */
.page-hero {
    background: linear-gradient(135deg, #1a0a00 0%, #0d0d0d 60%);
    padding: 70px 0;
    border-bottom: 1px solid var(--color-border);
}

.page-hero h1 {
    font-size: 2.6rem;
    font-weight: 900;
    color: var(--color-text-light);
    margin-bottom: 14px;
}

.page-hero p {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    max-width: 720px;
}

/* Ensure WordPress custom-logo output fits the design */
.custom-logo {
    max-height: 48px;
    width: auto;
    display: block;
}

.site-logo-img {
    display: flex;
    align-items: center;
}
