/*
 Theme Name:   GeneratePress XHP
 Template:     generatepress
*/

/* ---- Color Variables ---- */
:root {
    --xhp-primary: #0F2B4C;
    --xhp-accent: #2A7DE1;
    --xhp-accent-hover: #1A5FA8;
    --xhp-accent-light: #E8F0FE;
    --xhp-accent-rgb: 42, 125, 225;
    --xhp-gray-light: #f5f6f8;
    --xhp-gray-border: #e8eaed;
}

/* ---- Global Font ---- */
html body {
    font-family: 'Exo 2', sans-serif;
}

/* ---- Breadcrumb (shared) ---- */
.xhp-breadcrumb {
    background-color: var(--xhp-gray-light);
    width: 100%;
}
.xhp-breadcrumb__inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 25px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 14px;
    color: #666;
}
.xhp-breadcrumb__link {
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.xhp-breadcrumb__link:hover {
    color: var(--xhp-primary);
    text-decoration: underline;
}
.xhp-breadcrumb__separator {
    color: #bbb;
    margin: 0 4px;
    font-size: 11px;
    user-select: none;
}
.xhp-breadcrumb__current {
    color: var(--xhp-primary);
    font-weight: 600;
}

/* ---- Buttons (shared) ---- */
.xhp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
    border: 2px solid transparent;
    font-family: inherit;
    white-space: nowrap;
}
.xhp-btn--primary {
    background-color: var(--xhp-accent);
    color: #fff;
    border-color: var(--xhp-accent);
}
.xhp-btn--primary:hover {
    background-color: transparent;
    color: var(--xhp-accent);
    border-color: var(--xhp-accent);
}
.xhp-btn--outline {
    background-color: transparent;
    color: var(--xhp-primary);
    border-color: #ccc;
}
.xhp-btn--outline:hover {
    border-color: var(--xhp-accent);
    color: var(--xhp-accent);
    background-color: transparent;
}
.xhp-btn--small {
    padding: 6px 18px;
    font-size: 12px;
    border-radius: 3px;
    background-color: #fff;
    color: #000;
    border-color: #000;
}
.xhp-btn--small:hover {
    background-color: #000;
    color: #fff;
}
.xhp-btn--arrow {
    border: none !important;
    background: transparent !important;
    color: #000;
    padding-right: 4px;
}
.xhp-btn--arrow .xhp-btn-arrow {
    display: inline-block;
    transition: transform 0.25s ease, margin-left 0.25s ease;
    margin-left: 4px;
    font-size: 1.4em;
    line-height: 1;
}
.xhp-btn--arrow:hover .xhp-btn-arrow {
    transform: translateX(6px);
}

/* ---- Pagination (shared) ---- */
.xhp-archive__pagination,
.xhp-product-archive__pagination {
    margin-top: 40px;
    text-align: center;
}
.xhp-archive__pagination .page-numbers,
.xhp-product-archive__pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #555;
    text-decoration: none;
    transition: all 0.2s;
}
.xhp-archive__pagination .page-numbers:hover,
.xhp-product-archive__pagination .page-numbers:hover {
    background-color: #f5f5f5;
}
.xhp-archive__pagination .page-numbers.current,
.xhp-product-archive__pagination .page-numbers.current {
    background-color: #000;
    color: #fff;
    border-color: #000;
}

/* ---- Sidebar (shared) ---- */
.xhp-sidebar {
    flex: 0 0 350px;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}
.xhp-sidebar-block {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}
.xhp-sidebar-block__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--xhp-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--xhp-gray-border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.xhp-sidebar-block__title::before {
    content: '';
    display: inline-block;
    flex-shrink: 0;
    width: 4px;
    height: 16px;
    background: var(--xhp-accent);
    border-radius: 2px;
}
.xhp-sidebar-block--image .xhp-sidebar-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}
/* New Arrival */
.xhp-sidebar-product-card {
    position: relative;
}
.xhp-sidebar-product-link {
    text-decoration: none;
    display: block;
}
.xhp-sidebar-product-img {
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    position: relative;
    margin-bottom: 10px;
}
.xhp-sidebar-product-label {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--xhp-accent);
    color: #fff;
    padding: 2px 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
}
.xhp-sidebar-product-title {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    margin: 0 0 4px;
}
.xhp-sidebar-product-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}
/* Recommended */
.xhp-sidebar-recommend-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.xhp-sidebar-recommend-item {
    border-bottom: 1px solid var(--xhp-gray-border);
    padding-bottom: 12px;
}
.xhp-sidebar-recommend-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.xhp-sidebar-recommend-link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-decoration: none;
}
.xhp-sidebar-recommend-img {
    flex: 0 0 100px;
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
}
.xhp-sidebar-recommend-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.xhp-sidebar-recommend-title {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    transition: color 0.2s;
}
.xhp-sidebar-recommend-link:hover .xhp-sidebar-recommend-title {
    color: var(--xhp-accent);
}
.xhp-sidebar-recommend-excerpt {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}
/* Case Studies */
.xhp-sidebar-case-grid {
    display: grid;
    gap: 12px;
}
.xhp-sidebar-case-item {
    position: relative;
}
.xhp-sidebar-case-link {
    display: block;
    text-decoration: none;
}
.xhp-sidebar-case-img {
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.xhp-sidebar-case-title {
    background: rgba(15, 43, 76, 0.75);
    color: #fff;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}
/* Hot News */
.xhp-sidebar-hot-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.xhp-sidebar-hot-list li {
    border-bottom: 1px solid var(--xhp-gray-border);
    padding: 8px 0;
}
.xhp-sidebar-hot-list li:last-child {
    border-bottom: none;
}
.xhp-sidebar-hot-list a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
    display: block;
}
.xhp-sidebar-hot-list a:hover {
    color: var(--xhp-accent);
}

/* ---- Footer Bar (shared) ---- */
.xhp-footer-bar {
    background: var(--xhp-gray-light);
    padding: 30px 0 60px;
}
.xhp-footer-bar__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--xhp-primary);
    text-align: center;
    margin: 0 0 30px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.xhp-footer-bar__title::before,
.xhp-footer-bar__title::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 3px;
    background: var(--xhp-accent);
    border-radius: 2px;
}
.xhp-footer-bar-grid {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.xhp-footer-bar-item {
    background: #fff;
    border-left: 1px solid var(--xhp-gray-border);
    transition: box-shadow 0.2s, transform 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.xhp-footer-bar-item:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}
.xhp-footer-bar-link {
    display: block;
    padding: 40px 40px;
    text-decoration: none;
    color: inherit;
}
.xhp-footer-bar-date {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 30px;
}
.xhp-footer-bar-headline {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--xhp-primary);
    margin: 15px 0;
}
.xhp-footer-bar-desc {
    display: block;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}
.xhp-footer-bar-img {
    display: block;
    margin-top: 30px;
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
}
.xhp-footer-bar-img--4-3 {
    aspect-ratio: 4 / 3;
}

/* ---- Section Title (shared) ---- */
.xhp-section-title {
    font-size: 68px;
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 20px;
    padding: 0;
    text-align: left;
}
.xhp-section-title--light {
    color: #b8b8b8;
}
.xhp-section-title--dark {
    color: #fff;
}

/* ---- Contact Form (shared) ---- */
.xhp-contact-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.xhp-form-row {
    display: flex;
    gap: 20px;
}
.xhp-form-row--two {
    flex-wrap: wrap;
}
.xhp-form-row--two .xhp-form-field {
    flex: 1 1 calc(50% - 10px);
    min-width: 200px;
}
.xhp-form-field {
    flex: 1;
}
.xhp-form-field input,
.xhp-form-field textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid var(--xhp-gray-border);
    border-radius: 5px;
    background-color: #fafafa;
    transition: border-color 0.2s, background-color 0.2s;
    font-family: inherit;
    outline: none;
}
.xhp-form-field input:focus,
.xhp-form-field textarea:focus {
    border-color: var(--xhp-accent);
    background-color: #fff;
}
.xhp-form-field textarea {
    resize: vertical;
}
.xhp-form-row--submit {
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
}
.xhp-contact-status {
    font-size: 14px;
    color: #666;
    margin-right: auto;
}

/* ---- Responsive adjustments for shared elements ---- */
@media (max-width: 1024px) {
    .xhp-sidebar {
        flex: 0 0 auto;
        max-width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .xhp-sidebar-block {
        flex: 1 1 calc(50% - 15px);
    }
    .xhp-footer-bar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .xhp-sidebar-block {
        flex: 1 1 100%;
    }
    .xhp-footer-bar-grid {
        grid-template-columns: 1fr;
    }
    .xhp-sidebar-case-grid {
        grid-template-columns: 1fr 1fr;
    }
    .xhp-breadcrumb__inner {
        padding: 10px 16px;
        font-size: 11px;
        gap: 3px;
    }
    .xhp-section-title {
        font-size: 32px;
    }
}
@media (max-width: 480px) {
    .xhp-sidebar-case-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Post/Page layout (single.php) ---- */
.xhp-post-main {
    background: #fff;
    padding: 60px 0 60px;
    width: 100%;
}
.xhp-post-main__inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    gap: 60px;
    align-items: flex-start;
    padding: 0;
}
.xhp-post-main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 30px;
}
.xhp-post-card {
    background-color: #ffffff;
    overflow: hidden;
}
@media (max-width: 768px) {
    .xhp-post-card {
        padding: 20px 20px;
    }
}
.xhp-post-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--xhp-primary);
    margin: 0 0 0.3em;
    line-height: 1.2;
}
@media (max-width: 768px) {
    .xhp-post-title {
        font-size: 26px;
    }
}
.xhp-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--xhp-gray-border);
}
.xhp-post-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    color: #666;
}
.xhp-meta-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.xhp-social-share {
    display: flex;
    align-items: center;
    gap: 8px;
}
.xhp-share-label {
    font-size: 13px;
    color: #999;
    margin-right: 4px;
}
.xhp-share-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: #555;
    transition: color 0.2s, transform 0.2s;
    border-radius: 4px;
}
.xhp-share-link:hover {
    color: var(--xhp-accent);
    transform: scale(1.1);
}
.xhp-share-link svg {
    width: 20px;
    height: 20px;
}
.xhp-post-content {
    font-size: 16px;
    line-height: 1.8;
    color: #444;
    padding: 0 10px;
}
.xhp-post-content h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--xhp-primary);
    margin: 1.4em 0 0.6em;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.3;
}
.xhp-post-content h3::before {
    content: '';
    display: inline-block;
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    background-color: var(--xhp-accent);
    transform: rotate(45deg);
}
.xhp-post-content h3:first-of-type {
    margin-top: 0;
}
.xhp-post-content p {
    margin: 0 0 1.2em;
}
.xhp-post-content img {
    max-width: 100%;
    height: auto;
}
.xhp-page-card .xhp-post-meta {
    display: none;
}
.xhp-base-articles {
    background-color: var(--xhp-gray-light);
    padding: 20px 24px;
    border-radius: 6px;
    margin-bottom: 24px;
}
.xhp-base-articles__title {
    font-size: 20px;
    font-weight: 600;
    color: var(--xhp-primary);
    margin-bottom: 10px;
}
.xhp-base-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}
.xhp-base-grid-item {
    padding: 6px 0;
}
.xhp-base-grid-item:last-child {
    border-bottom: none;
}
.xhp-base-grid-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-decoration: none;
    transition: color 0.2s;
}
.xhp-base-grid-link:hover .xhp-base-grid-title {
    color: var(--xhp-accent);
    text-decoration: underline;
}
.xhp-base-grid-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}
@media (max-width: 768px) {
    .xhp-post-main__inner {
        flex-direction: column;
        gap: 30px;
        padding: 0 16px;
    }
    .xhp-post-main-content {
        order: -1;
    }
    .xhp-post-card {
        padding: 20px;
    }
    .xhp-base-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .xhp-base-articles {
        padding: 16px;
    }
    .xhp-post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .xhp-social-share {
        align-self: flex-start;
    }
}

/* ---- Mobile overflow fix ---- */
body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Ensure any full-width container doesn't overflow */
.xhp-about__factory-grid,
.xhp-about__cert-scroll {
    max-width: 100%;
    overflow: hidden;
}

/* For screens smaller than 768px, adjust margins */
@media (max-width: 768px) {
    .xhp-about__factory-grid {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        padding: 0 16px;
        left: 0;
        right: 0;
    }
}