/*
Theme Name: InfoAsia Theme
Theme URI: https://infoasia.com.vn
Author: InfoAsia Team
Author URI: https://infoasia.com.vn
Description: Giao diện WordPress chuẩn hóa toàn diện cho InfoAsia - Nền tảng chia sẻ kiến thức và giải pháp quản lý sản xuất thông minh (ERP, MES, APS, MRP) theo chuẩn thiết kế Industrial Nexus.
Version: 1.1.0
Requires at least: 5.8
Tested up to: 6.7
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: infoasia
Tags: custom-background, custom-logo, custom-menu, featured-images, full-width-template, theme-options, translation-ready, block-styles, grid-layout
*/

/* Base CSS Variables */
:root {
  --color-primary: #00288e;
  --color-deep-navy: #1a4b7c;
  --color-industrial-gold: #f39c12;
  --color-surface-bright: #fbf9f8;
  --color-surface-gray: #f5f5f5;
  --color-text-main: #333333;
  --color-text-muted: #64748b;
  --color-outline-variant: #c4c5d5;
}

/* Base Body Styles */
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #fbf9f8;
  color: #1b1c1c;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Material Symbols Outlined Icon Styling */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  display: inline-block;
  line-height: 1;
}

/* WordPress Core Alignment Classes */
.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.alignleft {
  float: left;
  margin-right: 1.5em;
  margin-bottom: 1.5em;
}

.alignright {
  float: right;
  margin-left: 1.5em;
  margin-bottom: 1.5em;
}

/* Strict Logo Sizing Constraints */
.custom-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.custom-logo,
.custom-logo-link img,
.site-branding img,
.site-logo img {
  max-height: 46px !important;
  height: auto !important;
  width: auto !important;
  max-width: 220px !important;
  object-fit: contain !important;
  display: block !important;
}

@media (max-width: 768px) {
  .custom-logo,
  .custom-logo-link img,
  .site-branding img,
  .site-logo img {
    max-height: 38px !important;
    max-width: 170px !important;
  }
}

/* Dark Background Strict Contrast Overrides */
.bg-deep-navy h1,
.bg-deep-navy h2,
.bg-deep-navy h3,
section.bg-deep-navy h1,
section.bg-deep-navy h2,
section.bg-deep-navy h3 {
    color: #ffffff !important;
}


/* ==========================================================================
   STRICT WORDPRESS POST CONTENT & TYPOGRAPHY RESTORATION (Overrides Tailwind Reset)
   ========================================================================== */

.entry-content,
.post-body,
.prose,
article.post .entry-content {
    color: #333333 !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 16px !important;
    line-height: 1.8 !important;
}

/* Headings in Post Content */
.entry-content h1,
.post-body h1,
article.post h1,
.entry-content .wp-block-heading:is(h1) {
    font-size: 32px !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    color: #1a4b7c !important;
    margin-top: 2.5rem !important;
    margin-bottom: 1.25rem !important;
    font-family: 'Inter', sans-serif !important;
    display: block !important;
    letter-spacing: -0.01em !important;
}

.entry-content h2,
.post-body h2,
article.post h2,
.entry-content .wp-block-heading:is(h2) {
    font-size: 24px !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;
    color: #1a4b7c !important;
    margin-top: 2.5rem !important;
    margin-bottom: 1.25rem !important;
    padding-bottom: 0.5rem !important;
    border-bottom: 2px solid #f6f3f2 !important;
    position: relative !important;
    font-family: 'Inter', sans-serif !important;
    display: block !important;
}

.entry-content h2::after,
.post-body h2::after {
    content: '' !important;
    position: absolute !important;
    bottom: -2px !important;
    left: 0 !important;
    width: 48px !important;
    height: 2px !important;
    background-color: #f39c12 !important;
}

.entry-content h3,
.post-body h3,
article.post h3,
.entry-content .wp-block-heading:is(h3) {
    font-size: 20px !important;
    line-height: 1.4 !important;
    font-weight: 600 !important;
    color: #1a4b7c !important;
    margin-top: 2rem !important;
    margin-bottom: 0.875rem !important;
    font-family: 'Inter', sans-serif !important;
    display: block !important;
}

.entry-content h4,
.post-body h4,
article.post h4,
.entry-content .wp-block-heading:is(h4) {
    font-size: 18px !important;
    line-height: 1.45 !important;
    font-weight: 600 !important;
    color: #1a4b7c !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.75rem !important;
    font-family: 'Inter', sans-serif !important;
    display: block !important;
}

.entry-content h5,
.post-body h5,
.entry-content h6,
.post-body h6 {
    font-size: 16px !important;
    line-height: 1.5 !important;
    font-weight: 600 !important;
    color: #444653 !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0.5rem !important;
    font-family: 'Inter', sans-serif !important;
    display: block !important;
}

/* Paragraphs & Text */
.entry-content p,
.post-body p,
article.post p {
    font-size: 16px !important;
    line-height: 1.85 !important;
    color: #333333 !important;
    margin-top: 0 !important;
    margin-bottom: 1.5rem !important;
    font-family: 'Inter', sans-serif !important;
    display: block !important;
}

.entry-content strong,
.post-body strong,
.entry-content b,
.post-body b {
    font-weight: 700 !important;
    color: #1a4b7c !important;
}

.entry-content em,
.post-body em,
.entry-content i,
.post-body i {
    font-style: italic !important;
}

.entry-content a:not(.wp-element-button),
.post-body a:not(.wp-element-button) {
    color: #00288e !important;
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
    font-weight: 600 !important;
    transition: color 0.2s ease !important;
}

.entry-content a:not(.wp-element-button):hover,
.post-body a:not(.wp-element-button):hover {
    color: #f39c12 !important;
}

/* Unordered Lists */
.entry-content ul:not(.wp-block-social-links),
.post-body ul:not(.wp-block-social-links),
article.post ul:not(.wp-block-social-links),
.entry-content .wp-block-list {
    list-style: none !important;
    padding-left: 0 !important;
    margin-top: 1rem !important;
    margin-bottom: 1.75rem !important;
    display: block !important;
}

.entry-content ul:not(.wp-block-social-links) > li,
.post-body ul:not(.wp-block-social-links) > li,
article.post ul:not(.wp-block-social-links) > li,
.entry-content .wp-block-list > li {
    position: relative !important;
    padding-left: 2rem !important;
    margin-bottom: 0.75rem !important;
    line-height: 1.75 !important;
    color: #333333 !important;
    font-size: 16px !important;
    display: list-item !important;
}

.entry-content ul:not(.wp-block-social-links) > li::before,
.post-body ul:not(.wp-block-social-links) > li::before,
article.post ul:not(.wp-block-social-links) > li::before,
.entry-content .wp-block-list > li::before {
    content: '' !important;
    position: absolute !important;
    left: 0.5rem !important;
    top: 0.65rem !important;
    width: 7px !important;
    height: 7px !important;
    background-color: #f39c12 !important;
    border-radius: 50% !important;
}

/* Ordered Lists */
.entry-content ol,
.post-body ol,
article.post ol {
    list-style: decimal !important;
    padding-left: 2rem !important;
    margin-top: 1rem !important;
    margin-bottom: 1.75rem !important;
    display: block !important;
}

.entry-content ol > li,
.post-body ol > li,
article.post ol > li {
    margin-bottom: 0.75rem !important;
    line-height: 1.75 !important;
    color: #333333 !important;
    font-size: 16px !important;
    padding-left: 0.25rem !important;
    display: list-item !important;
}

/* Blockquotes */
.entry-content blockquote,
.post-body blockquote,
.wp-block-quote,
.wp-block-pullquote {
    background-color: #f6f3f2 !important;
    border-left: 5px solid #f39c12 !important;
    padding: 1.5rem 1.75rem !important;
    margin: 2rem 0 !important;
    border-radius: 0 10px 10px 0 !important;
    font-style: italic !important;
    color: #1a4b7c !important;
    display: block !important;
}

.entry-content blockquote p,
.post-body blockquote p,
.wp-block-quote p {
    margin-bottom: 0 !important;
    font-size: 18px !important;
    line-height: 1.75 !important;
    color: #1a4b7c !important;
}

/* Tables */
.entry-content table,
.post-body table,
.wp-block-table table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 2.25rem 0 !important;
    border: 1px solid #c4c5d5 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    font-size: 15px !important;
    display: table !important;
}

.entry-content th,
.post-body th,
.wp-block-table th {
    background-color: #1a4b7c !important;
    color: #ffffff !important;
    padding: 14px 18px !important;
    font-weight: 700 !important;
    text-align: left !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.entry-content td,
.post-body td,
.wp-block-table td {
    padding: 12px 18px !important;
    border-bottom: 1px solid #e4e2e1 !important;
    border-right: 1px solid #e4e2e1 !important;
    color: #333333 !important;
    line-height: 1.6 !important;
}

.entry-content tr:nth-child(even),
.post-body tr:nth-child(even),
.wp-block-table tr:nth-child(even) {
    background-color: #fbf9f8 !important;
}

.entry-content tr:hover,
.post-body tr:hover {
    background-color: #f0eded !important;
}

/* Images & Figures */
.entry-content figure,
.post-body figure,
.wp-block-image,
.wp-block-gallery {
    margin: 2rem 0 !important;
    display: block !important;
}

.entry-content img,
.post-body img,
.wp-block-image img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
    border: 1px solid #c4c5d5 !important;
    display: block !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06) !important;
}

.entry-content figcaption,
.post-body figcaption,
.wp-block-image figcaption {
    text-align: center !important;
    font-size: 13px !important;
    color: #64748b !important;
    font-style: italic !important;
    margin-top: 10px !important;
    display: block !important;
}

/* Code Blocks */
.entry-content pre,
.post-body pre,
.wp-block-code {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    padding: 1.25rem 1.5rem !important;
    border-radius: 8px !important;
    overflow-x: auto !important;
    font-family: Consolas, 'Courier New', monospace !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    margin: 2rem 0 !important;
    border: 1px solid #334155 !important;
    display: block !important;
}

.entry-content code:not(pre code),
.post-body code:not(pre code) {
    background-color: #f0eded !important;
    color: #00288e !important;
    padding: 3px 7px !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-family: Consolas, 'Courier New', monospace !important;
    font-weight: 600 !important;
}

/* Horizontal Separators */
.entry-content hr,
.post-body hr,
.wp-block-separator {
    border: none !important;
    border-top: 1px solid #c4c5d5 !important;
    margin: 3rem 0 !important;
    display: block !important;
}
