/* HMS Blogs - listing and article pages.
   Uses the existing Mediquince palette and type scale (see Softwares/* pages):
   Poppins, headings #373030, body text #666666, primary button #ED3E48 / hover #D92F3A,
   purple #43388C, soft card background rgba(255, 250, 250, 1), banner gradient #FEBC2F -> #FF5132. */

.mq-blog, .mq-blog *:not(i) { font-family: "Poppins", sans-serif; }
.mq-blog { color: #666666; background: #ffffff; }
.mq-blog p, .mq-blog li { font-size: 16px; line-height: 1.7; }
.mq-blog h1, .mq-blog h2, .mq-blog h3, .mq-blog h4 { color: #373030; line-height: 1.3; }
.mq-blog a { text-decoration: none; }
.mq-blog a:hover, .mq-blog a:focus { text-decoration: none; }
.mq-blog img { max-width: 100%; }
.mq-blog strong { font-weight: 600; }
.mq-blog ul, .mq-blog ol { margin-bottom: 0; }

/* ---------- Banner (same gradient as .banner-top on the software pages) ---------- */
.blog-banner {
    background: linear-gradient(to right, rgba(254, 188, 47, 0.6), rgba(255, 81, 50, 0.6));
    padding: 60px 0;
}
.blog-banner .blog-crumb { font-size: 16px; color: #373030; margin-bottom: 18px; }
.blog-banner .blog-crumb a { color: #373030; }
.blog-banner .blog-crumb a:hover { color: #ED3E48; }
.blog-banner .blog-crumb span { margin: 0 6px; }
.blog-banner h1 { font-size: 40px; font-weight: 700; margin-bottom: 15px; }
.blog-banner .blog-intro { font-size: 18px; color: #373030; max-width: 640px; margin-bottom: 25px; }

.blog-search { display: flex; max-width: 520px; background: #ffffff; border-radius: 8px; padding: 6px; box-shadow: 0 4px 15px rgba(0, 0, 0, .08); }
.blog-search input {
    flex: 1; min-width: 0; border: none; outline: none; padding: 8px 12px;
    font-size: 15px; color: #373030; background: transparent; line-height: 1.5;
}
.blog-search button { flex-shrink: 0; }

.blog-stats { display: flex; gap: 15px; justify-content: flex-end; flex-wrap: wrap; }
.blog-stat { background: rgba(255, 255, 255, 0.85); border-radius: 20px; padding: 20px 25px; min-width: 150px; text-align: center; }
.blog-stat strong { display: block; font-size: 32px; font-weight: 700; color: #ED3E48; line-height: 1.2; }
.blog-stat span { font-size: 14px; color: #373030; }

/* ---------- Buttons (same as .ban-button a / .join-btn) ---------- */
.blog-btn {
    display: inline-block; background: #ED3E48; color: #ffffff !important; border: none;
    padding: 12px 24px; border-radius: 7px; font-size: 16px; font-weight: 500; line-height: 1.5;
    cursor: pointer; white-space: nowrap; transition: background 0.3s ease-in-out;
}
.blog-btn:hover, .blog-btn:focus { background: #D92F3A; color: #ffffff; }
.blog-btn-sm { padding: 8px 18px; font-size: 15px; }

/* ---------- Sections ---------- */
.blog-section { padding: 50px 0; }
.blog-section-soft { background: rgba(255, 250, 250, 1); }
.blog-section-title { font-size: 32px; font-weight: 600; margin-bottom: 8px; }
.blog-section-sub { font-size: 16px; color: #666666; margin-bottom: 30px; }

/* ---------- Category chips ---------- */
.blog-cats-bar { border-bottom: 1px solid #f1e3e4; background: #ffffff; }
.blog-cats-nav { display: flex; align-items: center; gap: 12px; }
.blog-cats {
    position: relative; flex: 1; min-width: 0;
    display: flex; gap: 10px; list-style: none; padding: 18px 2px !important; margin: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; -ms-overflow-style: none; /* hidden scrollbar, scrolling still works */
}
.blog-cats::-webkit-scrollbar { display: none; }
.blog-cats-arrow {
    flex-shrink: 0; width: 36px; height: 36px; padding: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #ED3E48; background: #ffffff; color: #ED3E48; font-size: 14px; line-height: 1;
    cursor: pointer; transition: all 0.3s ease-in-out;
}
.blog-cats-arrow:hover:not(:disabled), .blog-cats-arrow:focus-visible { background: #ED3E48; color: #ffffff; }
.blog-cats-arrow:disabled { opacity: .35; cursor: default; }
.blog-cats-static .blog-cats-arrow { display: none; }
/* Mobile (portrait up to 767px, and phones in landscape): no arrows, categories scroll by touch/swipe.
   Tablets and desktops keep the arrows. The scrollbar stays hidden at every size. */
@media (max-width: 767px), (max-width: 991px) and (max-height: 500px) {
    .blog-cats-nav { gap: 0; }
    .blog-cats-arrow { display: none; }
}
.blog-cats li { flex-shrink: 0; font-size: 14px; }
.blog-cats a {
    display: inline-block; padding: 7px 18px; border-radius: 25px; border: 1px solid #ED3E48;
    color: #ED3E48; font-size: 14px; font-weight: 500; white-space: nowrap; transition: all 0.3s ease-in-out;
}
.blog-cats a:hover, .blog-cats a.active { background: #ED3E48; color: #ffffff; }
.blog-cats a .count { opacity: .75; margin-left: 4px; font-size: 13px; }

/* ---------- Cards ---------- */
.blog-tag {
    display: inline-block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    color: #43388C; background: rgba(67, 56, 140, 0.08); padding: 4px 12px; border-radius: 25px; margin-bottom: 12px;
}
a.blog-tag:hover { background: #43388C; color: #ffffff; }
.blog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: #6C6C6C; }
.blog-meta i { color: #ED3E48; margin-right: 5px; }

.blog-card {
    display: flex; flex-direction: column; height: 100%; background: rgba(255, 250, 250, 1);
    border-radius: 20px; overflow: hidden; box-shadow: 0 4px 15px rgba(0, 0, 0, .08);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: 0 10px 25px rgba(0, 0, 0, .12); }
/* Every card image uses the same 16:9 box (source images: 640 x 360). */
.blog-card-img {
    display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; flex-shrink: 0;
    background: rgba(255, 238, 239, 1); overflow: hidden;
}
.blog-card-img img {
    position: absolute; inset: 0; display: block; width: 100%; height: 100%;
    object-fit: cover; object-position: center;
}
.blog-card-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.blog-card-title {
    font-size: 19px; font-weight: 600; margin-bottom: 10px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card-title a { color: #373030; }
.blog-card-title a:hover { color: #ED3E48; }
.blog-card-excerpt {
    font-size: 15px !important; color: #666666; margin-bottom: 16px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.blog-read-more { color: #ED3E48; font-weight: 500; font-size: 15px; white-space: nowrap; }
.blog-read-more:hover { color: #D92F3A; }
.blog-read-more i { margin-left: 6px; transition: margin 0.3s ease-in-out; }
.blog-read-more:hover i { margin-left: 10px; }

/* In multi-column rows, reserve equal room for title and excerpt so the rest of each card lines up. */
@media (min-width: 768px) {
    .blog-card-title { min-height: 3.9em; }
    .blog-card-excerpt { min-height: 5.1em; }
}

.blog-empty { text-align: center; padding: 40px 20px; background: rgba(255, 250, 250, 1); border-radius: 20px; }
.blog-empty h3 { font-size: 22px; font-weight: 600; margin-bottom: 10px; }

/* ---------- Pagination ---------- */
.blog-pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0 !important; margin: 40px 0 0; }
.blog-pagination li { font-size: 15px; }
.blog-pagination a, .blog-pagination span {
    display: flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 12px;
    border-radius: 8px; border: 1px solid #f1d4d6; color: #373030; background: #ffffff; font-weight: 500;
}
.blog-pagination a:hover { border-color: #ED3E48; color: #ED3E48; }
.blog-pagination .active span { background: #ED3E48; border-color: #ED3E48; color: #ffffff; }
.blog-pagination .disabled span { color: #b5b5b5; }

/* ---------- CTA (purple, as footer / .card-blue) ---------- */
.blog-cta { background: #43388C; border-radius: 20px; padding: 40px; color: #ffffff; }
.blog-cta h2, .blog-cta h3 { color: #ffffff; font-weight: 600; }
.blog-cta h2 { font-size: 28px; margin-bottom: 10px; }
.blog-cta h3 { font-size: 20px; margin-bottom: 10px; }
.blog-cta p { color: rgba(255, 255, 255, 0.85); font-size: 15px; margin-bottom: 20px; }

/* ---------- Article page ---------- */
.blog-article-banner { padding: 50px 0 40px; }
.blog-article-banner h1 { font-size: 36px; font-weight: 700; max-width: 900px; }
.blog-article-banner .blog-meta { font-size: 14px; color: #373030; }
.blog-article-banner .blog-meta i { color: #373030; }
.blog-author-chip { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.blog-author-chip img { width: 38px; height: 38px; border-radius: 50%; background: #ffffff; object-fit: contain; padding: 3px; }

.blog-hero-img { background: rgba(255, 238, 239, 1); border-radius: 20px; padding: 25px; text-align: center; margin-bottom: 35px; }
.blog-hero-img img { max-height: 420px; width: auto; object-fit: contain; }

.blog-content { color: #666666; }
.blog-content p { font-size: 17px; line-height: 1.8; margin-bottom: 20px; }
.blog-content h2 { font-size: 26px; font-weight: 600; margin: 35px 0 15px; }
.blog-content h3 { font-size: 21px; font-weight: 600; margin: 28px 0 12px; }
.blog-content ul, .blog-content ol { padding-left: 24px; margin-bottom: 22px; }
.blog-content li { font-size: 17px; line-height: 1.75; margin-bottom: 8px; }
.blog-content ul li::marker { color: #ED3E48; }
.blog-content ol li::marker { color: #ED3E48; font-weight: 600; }
.blog-tip {
    margin: 30px 0; padding: 20px 24px; border-left: 4px solid #F4B223; border-radius: 10px;
    background: rgba(254, 188, 47, 0.12); color: #373030; font-size: 16px; line-height: 1.7;
}
.blog-tip strong { display: block; font-weight: 600; margin-bottom: 4px; color: #373030; }

.blog-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0 !important; margin: 0; }
.blog-tags li { font-size: 13px; background: #f4f4f4; color: #474747; padding: 4px 12px; border-radius: 25px; }

.blog-share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.blog-share span { font-weight: 500; color: #373030; font-size: 15px; }
.blog-share a {
    width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: rgba(237, 62, 72, 0.1); color: #ED3E48; font-size: 16px; transition: all 0.3s ease-in-out;
}
.blog-share a:hover { background: #ED3E48; color: #ffffff; }

.blog-article-foot { border-top: 1px solid #f1e3e4; margin-top: 35px; padding-top: 25px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

.blog-author-box { display: flex; gap: 18px; background: rgba(255, 250, 250, 1); border-radius: 20px; padding: 24px; margin-top: 30px; }
.blog-author-box img { width: 64px; height: 64px; border-radius: 50%; object-fit: contain; background: #ffffff; padding: 6px; flex-shrink: 0; }
.blog-author-box h4 { font-size: 18px; font-weight: 600; margin-bottom: 2px; }
.blog-author-box .role { font-size: 14px; color: #ED3E48; margin-bottom: 6px; }
.blog-author-box p { font-size: 15px; margin-bottom: 0; }

/* Sidebar */
.blog-sidebar { position: sticky; top: 100px; }
.blog-widget { background: rgba(255, 250, 250, 1); border-radius: 20px; padding: 24px; margin-bottom: 25px; }
.blog-widget h3 { font-size: 19px; font-weight: 600; margin-bottom: 15px; }
.blog-widget-cats { list-style: none; padding: 0 !important; margin: 0; }
.blog-widget-cats li { font-size: 15px; border-bottom: 1px solid #f1e3e4; }
.blog-widget-cats li:last-child { border-bottom: none; }
.blog-widget-cats a { display: flex; justify-content: space-between; padding: 9px 0; color: #474747; }
.blog-widget-cats a:hover, .blog-widget-cats a.active { color: #ED3E48; }
.blog-widget-cats .count { background: #ffffff; border-radius: 25px; padding: 0 10px; font-size: 13px; color: #6C6C6C; }
.blog-mini { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1e3e4; }
.blog-mini:last-child { border-bottom: none; padding-bottom: 0; }
.blog-mini-img { width: 72px; height: 56px; flex-shrink: 0; border-radius: 10px; background: rgba(255, 238, 239, 1); display: flex; align-items: center; justify-content: center; padding: 4px; }
.blog-mini-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.blog-mini a.title { display: block; font-size: 14px; font-weight: 500; color: #373030; line-height: 1.4; margin-bottom: 3px; }
.blog-mini a.title:hover { color: #ED3E48; }
.blog-mini .date { font-size: 12px; color: #6C6C6C; }

/* ---------- Responsive (same breakpoints as the rest of the site) ---------- */
@media (max-width: 991px) {
    .blog-banner { padding: 45px 0; text-align: center; }
    .blog-banner .blog-intro { margin-left: auto; margin-right: auto; }
    .blog-banner h1 { font-size: 30px; }
    .blog-search { margin: 0 auto; }
    .blog-stats { justify-content: center; margin-top: 30px; }
    .blog-article-banner { text-align: left; }
    .blog-article-banner h1 { font-size: 30px; }
    .blog-sidebar { position: static; margin-top: 40px; }
    .blog-section-title { font-size: 28px; }
}
@media (max-width: 767px) {
    .blog-section { padding: 35px 0; }
    .blog-banner h1 { font-size: 26px; }
    .blog-banner .blog-intro { font-size: 15px; }
    .blog-article-banner h1 { font-size: 24px; }
    .blog-content p, .blog-content li { font-size: 16px; }
    .blog-content h2 { font-size: 22px; }
    .blog-hero-img { padding: 15px; }
    .blog-cta { padding: 28px 22px; text-align: center; }
    .blog-cta h2 { font-size: 22px; }
    .blog-section-title { font-size: 24px; }
}
@media (max-width: 500px) {
    .blog-banner { padding: 35px 0; }
    .blog-banner .blog-crumb { font-size: 14px; }
    .blog-search button { padding: 8px 14px; font-size: 14px; }
    .blog-stat { min-width: 0; flex: 1; padding: 14px 10px; }
    .blog-stat strong { font-size: 24px; }
    .blog-card-body { padding: 18px; }
    .blog-card-title { font-size: 17px; }
    .blog-author-box { flex-direction: column; align-items: flex-start; }
    .blog-pagination a, .blog-pagination span { min-width: 38px; height: 38px; }
}

/* ---------- Banner search: clear (X) icon and dynamic results ---------- */
.blog-search { align-items: center; }
.blog-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.blog-search input::-ms-clear { display: none; }
.blog-search .blog-search-clear {
    flex-shrink: 0; width: 32px; height: 32px; margin-right: 6px; padding: 0; border: none; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; color: #6C6C6C; font-size: 15px; line-height: 1; cursor: pointer; transition: all 0.3s ease-in-out;
}
.blog-search .blog-search-clear:hover, .blog-search .blog-search-clear:focus-visible { background: rgba(237, 62, 72, 0.1); color: #ED3E48; }
.blog-search .blog-search-clear[hidden] { display: none; }
.blog-results { transition: opacity 0.2s ease-in-out; }
.blog-results.is-loading { opacity: 0.5; pointer-events: none; }
