/* AihuaSourcing blog
   Loaded after style.css and responsive.css, so it can override them.
   Note: the base stylesheet sets `ul { list-style: none }` and
   `img { width: 100% }` globally, both of which are undone inside .blog-body. */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------- hero ---------------- */

.blog-hero {
    background: var(--navy);
    color: #fff;
    padding: 9rem 0 3rem;
    text-align: center;
}

.blog-hero.blog-hero-sm { padding: 9rem 0 2.5rem; }

.blog-hero h1 {
    font-size: 2.6rem;
    margin: 0 0 0.6rem;
    color: #fff;
    line-height: 1.2;
}

.blog-hero-sub {
    color: #a9bacb;
    max-width: 620px;
    margin: 0 auto;
    line-height: 1.6;
    font-size: 1.02rem;
}

.blog-search {
    position: relative;
    max-width: 520px;
    margin: 1.8rem auto 0;
    display: flex;
    align-items: center;
}

.blog-search i.fa-search {
    position: absolute;
    left: 1rem;
    color: #7d93aa;
    font-size: 0.95rem;
    pointer-events: none;
}

.blog-search input {
    width: 100%;
    padding: 0.85rem 2.8rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: inherit;
    font-size: 0.97rem;
}

.blog-search input::placeholder { color: #8fa3b8; }

.blog-search input:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.16);
}

.blog-search-clear {
    position: absolute;
    right: 0.9rem;
    color: #8fa3b8;
    font-size: 0.9rem;
}
.blog-search-clear:hover { color: #fff; }

/* ---------------- breadcrumbs ---------------- */

.blog-crumbs {
    font-size: 0.83rem;
    color: #8fa3b8;
    margin-bottom: 0.9rem;
}
.blog-crumbs a { color: #a9bacb; }
.blog-crumbs a:hover { color: var(--gold); }
.blog-crumbs span { margin: 0 0.35rem; }

.blog-article .blog-crumbs { color: #7a8794; }
.blog-article .blog-crumbs a { color: #5c6b7a; }
.blog-article .blog-crumbs a:hover { color: var(--gold); }

/* ---------------- category pills ---------------- */

.blog-filters {
    background: #fff;
    border-bottom: 1px solid #e8ecf1;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 90;
}

.blog-filters ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    justify-content: center;
}

.blog-pill {
    display: inline-block;
    padding: 0.4rem 0.95rem;
    border-radius: 30px;
    background: #f2f5f8;
    color: #4a5967;
    font-size: 0.86rem;
    transition: var(--trans);
    white-space: nowrap;
}
.blog-pill span { opacity: 0.55; margin-left: 0.2rem; font-size: 0.8rem; }
.blog-pill:hover { background: #e4eaf0; color: var(--navy); }
.blog-pill.is-active { background: var(--navy); color: #fff; }
.blog-pill.is-active span { opacity: 0.7; }

/* ---------------- layout ---------------- */

.blog-wrap { padding: 3rem 1rem 4.5rem; }

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.6rem;
}

/* ---------------- cards ---------------- */

.blog-card,
.blog-featured {
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 12px;
    overflow: hidden;
    transition: var(--trans);
    display: flex;
    flex-direction: column;
}

.blog-card:hover,
.blog-featured:hover {
    border-color: #d3dce5;
    box-shadow: 0 6px 22px rgba(11, 35, 65, 0.08);
    transform: translateY(-2px);
}

.blog-card-media,
.blog-featured-media {
    display: block;
    background: #eef2f6;
    overflow: hidden;
}

.blog-card-media { aspect-ratio: 16 / 9; }

.blog-card-media img,
.blog-featured-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.blog-card:hover .blog-card-media img,
.blog-featured:hover .blog-featured-media img { transform: scale(1.04); }

.blog-media-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 150px;
    color: #b9c6d3;
    font-size: 1.7rem;
}

.blog-card-body,
.blog-featured-body {
    padding: 1.1rem 1.2rem 1.3rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card h3 {
    font-size: 1.12rem;
    line-height: 1.35;
    margin: 0.6rem 0 0.5rem;
}
.blog-card h3 a { color: var(--navy); }
.blog-card h3 a:hover { color: var(--gold); }

.blog-excerpt {
    color: #5c6b7a;
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0 0 0.9rem;
    flex: 1;
}

.blog-meta {
    color: #8593a1;
    font-size: 0.8rem;
    margin: 0;
}
.blog-meta span { margin: 0 0.3rem; }

/* featured */

.blog-featured {
    flex-direction: row;
    margin-bottom: 1.6rem;
}

.blog-featured-media {
    flex: 0 0 46%;
    max-width: 46%;
    min-height: 280px;
}

.blog-featured-body { justify-content: center; padding: 2rem 2.2rem; }

.blog-featured h2 {
    font-size: 1.75rem;
    line-height: 1.28;
    margin: 0.7rem 0 0.7rem;
}
.blog-featured h2 a { color: var(--navy); }
.blog-featured h2 a:hover { color: var(--gold); }
.blog-featured .blog-excerpt { font-size: 1rem; flex: 0; }

/* ---------------- pills ---------------- */

.blog-tag-pill {
    display: inline-block;
    padding: 0.22rem 0.7rem;
    border-radius: 20px;
    background: #e7f7f4;
    color: #0d6b61;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-right: 0.35rem;
}
.blog-tag-pill:hover { background: #d3f0eb; color: #0a544c; }

.blog-tag-featured { background: #fbf0d6; color: #7a5a10; }
.blog-tag-featured:hover { background: #fbf0d6; }

/* ---------------- pagination ---------------- */

.blog-pager {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.blog-pager a,
.blog-pager span {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.7rem;
    border: 1px solid #e0e6ec;
    border-radius: 8px;
    background: #fff;
    color: #4a5967;
    font-size: 0.9rem;
    transition: var(--trans);
}
.blog-pager a:hover { background: #f2f5f8; border-color: #cbd6e0; color: var(--navy); }
.blog-pager .is-current { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }

/* ---------------- buttons ---------------- */

.blog-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    background: var(--gold);
    color: #04342c;
    font-weight: 600;
    font-size: 0.94rem;
    transition: var(--trans);
    white-space: nowrap;
}
.blog-btn:hover { background: #17a99c; color: #fff; }

.blog-btn-ghost {
    background: transparent;
    border: 1px solid #cbd6e0;
    color: #4a5967;
    margin-left: 0.5rem;
}
.blog-btn-ghost:hover { background: #f2f5f8; color: var(--navy); }

/* ---------------- empty state ---------------- */

.blog-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: #6b7a8c;
}
.blog-empty h2 { color: var(--navy); font-size: 1.4rem; margin: 0 0 0.6rem; }
.blog-empty p { margin: 0; line-height: 1.6; }

/* ---------------- article ---------------- */

.blog-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 1000;
}
.blog-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--gold);
    transition: width 0.1s linear;
}

.blog-preview-bar {
    background: var(--gold);
    color: #3d2f06;
    text-align: center;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    margin-top: 5.5rem;
}
.blog-preview-bar a { color: #3d2f06; text-decoration: underline; margin-left: 0.5rem; }

.blog-article-wrap { padding: 7.5rem 1rem 4rem; }
.blog-preview-bar + .blog-article-wrap { padding-top: 2.5rem; }

.blog-article-layout {
    display: flex;
    gap: 2.5rem;
    justify-content: center;
    align-items: flex-start;
}

.blog-share {
    position: sticky;
    top: 6.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex-shrink: 0;
    padding-top: 5.5rem;
}

.blog-share a,
.blog-share button {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e6ec;
    border-radius: 50%;
    background: #fff;
    color: #5c6b7a;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--trans);
    padding: 0;
}
.blog-share a:hover,
.blog-share button:hover {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.blog-article {
    max-width: 720px;
    width: 100%;
    min-width: 0;
}

.blog-article h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    color: var(--navy);
    margin: 0.8rem 0 0.9rem;
}

.blog-byline {
    color: #8593a1;
    font-size: 0.88rem;
    margin: 0 0 1.8rem;
}
.blog-byline span { margin: 0 0.35rem; }

.blog-cover { margin: 0 0 2.2rem; }
.blog-cover img { width: 100%; border-radius: 12px; display: block; }
.blog-cover figcaption {
    color: #8593a1;
    font-size: 0.82rem;
    margin-top: 0.6rem;
    text-align: center;
}

/* ---- article body typography ----
   The measure is capped at 720px, which lands at roughly 65-75 characters
   per line. This is the single largest readability factor on the page. */

.blog-body {
    font-size: 1.08rem;
    line-height: 1.8;
    color: #2f3b47;
}

.blog-body > *:first-child { margin-top: 0; }

.blog-body p { margin: 0 0 1.45rem; }

.blog-body h2 {
    font-size: 1.75rem;
    line-height: 1.3;
    color: var(--navy);
    margin: 2.6rem 0 1rem;
}

.blog-body h3 {
    font-size: 1.32rem;
    line-height: 1.35;
    color: var(--navy);
    margin: 2.1rem 0 0.8rem;
}

.blog-body h4 {
    font-size: 1.1rem;
    color: var(--navy);
    margin: 1.8rem 0 0.7rem;
}

.blog-body ul,
.blog-body ol {
    margin: 0 0 1.45rem;
    padding-left: 1.5rem;
}
.blog-body ul { list-style-type: disc; }
.blog-body ol { list-style-type: decimal; }
.blog-body li { margin-bottom: 0.55rem; }
.blog-body li::marker { color: var(--gold); }

.blog-body a {
    color: #0d7c72;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.blog-body a:hover { color: var(--navy); }

.blog-body blockquote {
    margin: 2rem 0;
    padding: 0.3rem 0 0.3rem 1.4rem;
    border-left: 4px solid var(--gold);
    color: #45535f;
    font-style: italic;
}
.blog-body blockquote p:last-child { margin-bottom: 0; }

.blog-body img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 1.8rem 0;
    display: block;
}

.blog-body figure { margin: 1.8rem 0; }
.blog-body figcaption {
    color: #8593a1;
    font-size: 0.85rem;
    text-align: center;
    margin-top: 0.5rem;
}

.blog-body pre {
    background: #f5f7fa;
    border: 1px solid #e4e9ef;
    border-radius: 8px;
    padding: 1rem 1.1rem;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 1.45rem;
}

.blog-body code {
    background: #f0f3f7;
    padding: 0.12em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}
.blog-body pre code { background: none; padding: 0; }

.blog-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.6rem;
    font-size: 0.95rem;
}
.blog-body th,
.blog-body td {
    border: 1px solid #e4e9ef;
    padding: 0.65rem 0.85rem;
    text-align: left;
}
.blog-body th { background: #f5f7fa; font-weight: 600; color: var(--navy); }

.blog-body hr {
    border: 0;
    border-top: 1px solid #e4e9ef;
    margin: 2.4rem 0;
}

/* Editor alignment classes */
.blog-body .ql-align-center { text-align: center; }
.blog-body .ql-align-right  { text-align: right; }
.blog-body .ql-align-justify { text-align: justify; }
.blog-body .ql-indent-1 { padding-left: 3rem; }
.blog-body .ql-indent-2 { padding-left: 6rem; }

/* ---------------- tags ---------------- */

.blog-taglist {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 2.5rem 0 0;
    padding: 0;
}
.blog-taglist a {
    display: inline-block;
    padding: 0.32rem 0.8rem;
    border: 1px solid #e0e6ec;
    border-radius: 20px;
    color: #5c6b7a;
    font-size: 0.83rem;
    transition: var(--trans);
}
.blog-taglist a:hover { background: #f2f5f8; border-color: #cbd6e0; color: var(--navy); }

/* ---------------- CTA ---------------- */

.blog-cta {
    background: var(--navy);
    border-radius: 12px;
    padding: 1.8rem 2rem;
    margin: 2.8rem 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.blog-cta h2 { color: #fff; font-size: 1.28rem; margin: 0 0 0.4rem; }
.blog-cta p { color: #a9bacb; margin: 0; font-size: 0.94rem; line-height: 1.6; }

/* ---------------- related ---------------- */

.blog-related {
    max-width: 1100px;
    margin: 4.5rem auto 0;
    padding-top: 3rem;
    border-top: 1px solid #e8ecf1;
}
.blog-related h2 {
    font-size: 1.5rem;
    color: var(--navy);
    margin: 0 0 1.6rem;
    text-align: center;
}

/* ---------------- responsive ---------------- */

@media (max-width: 1150px) {
    .blog-share {
        position: static;
        flex-direction: row;
        padding-top: 0;
        margin-bottom: 1.5rem;
        justify-content: center;
    }
    .blog-article-layout { flex-direction: column; align-items: center; gap: 0; }
}

@media (max-width: 992px) {
    .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .blog-featured { flex-direction: column; }
    .blog-featured-media { flex: none; max-width: 100%; min-height: 0; aspect-ratio: 16 / 9; }
    .blog-featured-body { padding: 1.4rem 1.5rem 1.6rem; }
    .blog-featured h2 { font-size: 1.45rem; }

    .blog-hero h1 { font-size: 2.1rem; }
    .blog-article h1 { font-size: 2rem; }
}

@media (max-width: 640px) {
    .blog-grid { grid-template-columns: minmax(0, 1fr); }

    .blog-hero { padding: 7.5rem 0 2.2rem; }
    .blog-hero h1 { font-size: 1.75rem; }
    .blog-hero-sub { font-size: 0.95rem; }

    .blog-wrap { padding: 2rem 1rem 3rem; }
    .blog-article-wrap { padding: 6.5rem 1rem 3rem; }

    .blog-article h1 { font-size: 1.6rem; }
    .blog-body { font-size: 1.02rem; }
    .blog-body h2 { font-size: 1.4rem; }
    .blog-body h3 { font-size: 1.18rem; }

    .blog-filters { padding: 0.7rem 0; }
    .blog-filters ul { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.3rem; }

    .blog-cta { padding: 1.4rem 1.4rem; flex-direction: column; align-items: flex-start; }

    .blog-related { margin-top: 3rem; padding-top: 2.2rem; }
}

/* ---------------- solid navbar (pages with no hero) ----------------
   Article pages open on a white background, so the default transparent
   navbar with white text is invisible until the visitor scrolls past 40px
   and the JS adds .navbar-cng. .navbar-solid applies that same treatment
   from the first paint. Both classes may be present at once; the values
   are identical, so there is nothing to conflict. */

.navbar-solid {
    background-color: #fff;
    box-shadow: 0 4px 5px 0 rgba(48, 48, 48, 0.2);
    transition: var(--trans);
}

.navbar-solid .site-brand { color: var(--gold); }
.navbar-solid .site-brand span { color: var(--navy); }
.navbar-solid #navbar-show-btn { color: var(--navy); }

/* Desktop only: below 992px the links live inside the navy slide-out
   drawer, where they must stay white. Mirrors responsive.css. */
@media screen and (min-width: 992px) {
    .navbar-solid .navbar-nav .nav-link { color: var(--dark); }
}

/* Active nav item, used by the PHP-rendered blog pages */
.navbar-nav .nav-link-active { color: var(--gold); }
.navbar-cng .navbar-nav .nav-link-active { color: var(--gold); }

@media screen and (min-width: 992px) {
    .navbar-solid .navbar-nav .nav-link-active { color: var(--gold); }
}
