/* =====================================================================
   Hourglass IT Blog - public site styles (Bootstrap 5.3 theme layer)
   ===================================================================== */
:root {
    --hg-navy: #001175;          /* logo wordmark */
    --hg-blue: #3772c5;          /* corporate top-bar blue */
    --hg-blue-600: #2c5fae;
    --hg-sky: #2a95e6;           /* bright accent */
    --hg-footer: #082b72;
    --hg-red: #e3262f;           /* active-nav accent from the corporate site */
    --hg-ink: #1b2437;
    --hg-muted: #5d6779;
    --hg-line: #e6ebf3;
    --hg-soft: #f4f7fc;
    --hg-radius: 16px;
    --hg-shadow: 0 1px 2px rgba(16, 32, 80, .06), 0 6px 20px rgba(16, 32, 80, .06);
    --hg-shadow-hover: 0 4px 10px rgba(16, 32, 80, .08), 0 18px 40px rgba(16, 32, 80, .12);

    --bs-primary: #3772c5;
    --bs-primary-rgb: 55, 114, 197;
    --bs-link-color: #2c5fae;
    --bs-link-color-rgb: 44, 95, 174;
    --bs-link-hover-color: #001175;
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --bs-body-color: #1b2437;
}

body { background: #fff; color: var(--hg-ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, .hg-display { font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif; color: var(--hg-navy); letter-spacing: -.01em; }
a { text-decoration: none; }
a:focus-visible, button:focus-visible, .form-control:focus { outline: 3px solid rgba(42,149,230,.45); outline-offset: 2px; box-shadow: none; }
.btn-primary { --bs-btn-bg: var(--hg-blue); --bs-btn-border-color: var(--hg-blue); --bs-btn-hover-bg: var(--hg-navy); --bs-btn-hover-border-color: var(--hg-navy); --bs-btn-active-bg: var(--hg-navy); }
.btn-outline-primary { --bs-btn-color: var(--hg-blue); --bs-btn-border-color: var(--hg-blue); --bs-btn-hover-bg: var(--hg-blue); --bs-btn-hover-border-color: var(--hg-blue); }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 2000; background: #fff; padding: .5rem 1rem; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------------- top bar ---------------- */
.hg-topbar { background: var(--hg-blue); color: #fff; font-size: .875rem; }
.hg-topbar a { color: #fff; opacity: .95; }
.hg-topbar a:hover { opacity: 1; text-decoration: underline; }
.hg-topbar .hg-social a { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 50%; }
.hg-topbar .hg-social a:hover { background: rgba(255,255,255,.15); text-decoration: none; }
.hg-quote-btn { background: #fff; color: var(--hg-navy) !important; font-weight: 600; letter-spacing: .02em; border-radius: 0; padding: .65rem 1.4rem; opacity: 1 !important; }
.hg-quote-btn:hover { background: var(--hg-navy); color: #fff !important; text-decoration: none !important; }

/* ---------------- main nav ---------------- */
.hg-navbar { background: #fff; border-bottom: 1px solid var(--hg-line); }
.hg-navbar.is-stuck { box-shadow: 0 6px 20px rgba(16,32,80,.08); }
.hg-navbar .navbar-brand img { height: 46px; width: auto; }
.hg-navbar .nav-link { color: var(--hg-blue-600); font-weight: 500; font-size: 1.02rem; padding: 1.6rem .95rem !important; position: relative; }
.hg-navbar .nav-link:hover { color: var(--hg-navy); }
.hg-navbar .nav-link.active { color: var(--hg-navy); font-weight: 600; }
.hg-navbar .nav-link.active::after { content: ""; position: absolute; left: .95rem; right: .95rem; bottom: 0; height: 4px; background: var(--hg-red); border-radius: 2px 2px 0 0; }
@media (max-width: 991.98px) {
    .hg-navbar .nav-link { padding: .7rem 0 !important; border-bottom: 1px solid var(--hg-line); }
    .hg-navbar .nav-link.active::after { left: 0; right: auto; width: 4px; height: 60%; top: 20%; bottom: auto; border-radius: 2px; }
    .hg-navbar .navbar-brand img { height: 38px; }
}

/* ---------------- hero ---------------- */
.hg-hero { position: relative; overflow: hidden; padding: 4.5rem 0 3.5rem;
    background: radial-gradient(1200px 400px at 85% -10%, rgba(42,149,230,.18), transparent 60%),
                radial-gradient(900px 400px at -10% 110%, rgba(55,114,197,.12), transparent 60%),
                linear-gradient(180deg, #f7faff 0%, #fff 100%); border-bottom: 1px solid var(--hg-line); }
.hg-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: radial-gradient(rgba(55,114,197,.18) 1px, transparent 1px); background-size: 22px 22px;
    mask-image: linear-gradient(90deg, transparent 40%, #000 100%); -webkit-mask-image: linear-gradient(90deg, transparent 40%, #000 100%); }
.hg-hero > .container { position: relative; z-index: 1; }
.hg-eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
    color: var(--hg-blue); background: rgba(55,114,197,.09); border: 1px solid rgba(55,114,197,.2); padding: .35rem .8rem; border-radius: 999px; }
.hg-hero h1 { font-size: clamp(2rem, 4.2vw, 3.25rem); font-weight: 800; line-height: 1.12; margin: 1rem 0 .9rem; }
.hg-hero h1 .hg-accent { background: linear-gradient(90deg, var(--hg-blue), var(--hg-sky)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hg-hero .lead { color: var(--hg-muted); font-size: 1.15rem; max-width: 640px; }
.hg-hero-search { max-width: 620px; background: #fff; border: 1px solid var(--hg-line); border-radius: 14px; box-shadow: var(--hg-shadow); padding: .4rem; }
.hg-hero-search .form-control { border: 0; font-size: 1.05rem; padding: .7rem .9rem; }
.hg-hero-search .form-control:focus { box-shadow: none; outline: none; }
.hg-hero-search .btn { border-radius: 10px; padding: .6rem 1.3rem; font-weight: 600; }
.hg-hero-stats { color: var(--hg-muted); font-size: .92rem; }
.hg-hero-stats strong { color: var(--hg-navy); }
.hg-chip { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--hg-line); background: #fff; color: var(--hg-blue-600);
    font-size: .85rem; font-weight: 500; padding: .35rem .8rem; border-radius: 999px; transition: all .15s ease; }
a.hg-chip:hover { border-color: var(--hg-blue); color: var(--hg-navy); background: #f0f5fd; }
.hg-chip.active { background: var(--hg-blue); border-color: var(--hg-blue); color: #fff; }

/* ---------------- page heading (filtered views) ---------------- */
.hg-filterbar { background: var(--hg-soft); border: 1px solid var(--hg-line); border-radius: 12px; padding: .9rem 1.1rem; }

/* ---------------- cards ---------------- */
.hg-card { position: relative; display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--hg-line);
    border-radius: var(--hg-radius); overflow: hidden; box-shadow: var(--hg-shadow); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.hg-card:hover, .hg-card:focus-within { transform: translateY(-4px); box-shadow: var(--hg-shadow-hover); border-color: #d4def0; }
.hg-card-media { position: relative; aspect-ratio: 16 / 9; background: #e8f0fc; overflow: hidden; }
.hg-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.hg-card:hover .hg-card-media img { transform: scale(1.04); }
.hg-card-body { display: flex; flex-direction: column; flex: 1; padding: 1.15rem 1.25rem 1.25rem; }
.hg-card-meta { display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: .82rem; color: var(--hg-muted); margin-bottom: .55rem; }
.hg-card-meta i { color: var(--hg-blue); margin-right: .25rem; }
.hg-card-title { font-size: 1.12rem; font-weight: 700; line-height: 1.35; margin-bottom: .5rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hg-card-title a { color: var(--hg-navy); }
.hg-card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }   /* whole card clickable */
.hg-card:hover .hg-card-title a { color: var(--hg-blue-600); }
.hg-card-text { color: var(--hg-muted); font-size: .94rem; line-height: 1.6; margin-bottom: .9rem;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hg-card-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.hg-tag { font-size: .74rem; font-weight: 500; color: var(--hg-blue-600); background: #eef3fc; border-radius: 6px; padding: .2rem .55rem; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.hg-readmore { margin-top: auto; font-weight: 600; font-size: .92rem; color: var(--hg-blue); display: inline-flex; align-items: center; gap: .35rem; }
.hg-readmore i { transition: transform .2s ease; }
.hg-card:hover .hg-readmore i { transform: translateX(4px); }

/* featured (first) card - horizontal on large screens */
@media (min-width: 992px) {
    .hg-card.hg-card-featured { flex-direction: row; }
    .hg-card-featured .hg-card-media { flex: 0 0 52%; aspect-ratio: auto; min-height: 330px; }
    .hg-card-featured .hg-card-body { padding: 2rem 2.2rem; justify-content: center; }
    .hg-card-featured .hg-card-title { font-size: 1.6rem; -webkit-line-clamp: 3; }
    .hg-card-featured .hg-card-text { font-size: 1rem; -webkit-line-clamp: 4; }
    .hg-card-featured .hg-readmore { margin-top: .5rem; }
}
.hg-badge-latest { position: absolute; top: 14px; left: 14px; z-index: 2; background: var(--hg-navy); color: #fff; font-size: .72rem; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase; padding: .3rem .65rem; border-radius: 6px; }

/* ---------------- sidebar ---------------- */
.hg-side-card { background: #fff; border: 1px solid var(--hg-line); border-radius: var(--hg-radius); padding: 1.3rem; box-shadow: var(--hg-shadow); }
.hg-side-card + .hg-side-card { margin-top: 1.5rem; }
.hg-side-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.hg-side-title::before { content: ""; width: 4px; height: 18px; background: linear-gradient(var(--hg-blue), var(--hg-sky)); border-radius: 2px; }
.hg-recent { list-style: none; padding: 0; margin: 0; }
.hg-recent li + li { border-top: 1px solid var(--hg-line); }
.hg-recent a { display: flex; gap: .8rem; align-items: center; padding: .7rem 0; color: var(--hg-ink); }
.hg-recent a:hover .hg-recent-title { color: var(--hg-blue); }
.hg-recent img { width: 68px; height: 50px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; background: #e8f0fc; }
.hg-recent-title { font-size: .9rem; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hg-recent small { color: var(--hg-muted); font-size: .78rem; }
.hg-topics { list-style: none; padding: 0; margin: 0; }
.hg-topics a { display: flex; justify-content: space-between; align-items: center; padding: .45rem .6rem; border-radius: 8px; color: var(--hg-ink); font-size: .92rem; }
.hg-topics a:hover, .hg-topics a.active { background: #f0f5fd; color: var(--hg-navy); }
.hg-topics .badge { background: #eef3fc; color: var(--hg-blue-600); font-weight: 600; }
.hg-cta { background: linear-gradient(135deg, var(--hg-navy), var(--hg-blue)); color: #fff; border: 0; position: relative; overflow: hidden; }
.hg-cta h3 { color: #fff; font-size: 1.15rem; }
.hg-cta p { color: rgba(255,255,255,.85); font-size: .92rem; }
.hg-cta::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.08); }

/* ---------------- pagination ---------------- */
.hg-pagination .page-link { border: 1px solid var(--hg-line); color: var(--hg-blue-600); margin: 0 .2rem; border-radius: 10px !important; min-width: 42px; text-align: center; padding: .5rem .8rem; font-weight: 500; }
.hg-pagination .page-link:hover { background: #f0f5fd; color: var(--hg-navy); }
.hg-pagination .active .page-link { background: var(--hg-blue); border-color: var(--hg-blue); color: #fff; }
.hg-pagination .disabled .page-link { color: #a7b0c0; background: #fff; }

/* ---------------- article ---------------- */
.hg-article-head { padding: 2.5rem 0 1.5rem; background: linear-gradient(180deg, #f7faff, #fff); }
.hg-breadcrumb { font-size: .88rem; --bs-breadcrumb-divider: "›"; }
.hg-breadcrumb a { color: var(--hg-blue-600); }
.hg-article-title { font-size: clamp(1.8rem, 3.6vw, 2.75rem); font-weight: 800; line-height: 1.18; margin: .8rem 0 1rem; }
.hg-article-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; color: var(--hg-muted); font-size: .93rem; }
.hg-article-meta i { color: var(--hg-blue); margin-right: .35rem; }
.hg-article-hero { border-radius: 20px; overflow: hidden; box-shadow: var(--hg-shadow); background: #e8f0fc; }
.hg-article-hero img { width: 100%; height: auto; display: block; }
.hg-lead { font-size: 1.18rem; line-height: 1.7; color: #33405a; border-left: 4px solid var(--hg-sky); padding: .25rem 0 .25rem 1.2rem; margin: 2rem 0; }

.article-content { font-size: 1.075rem; line-height: 1.8; color: #26324a; overflow-wrap: anywhere; }
.article-content > *:first-child { margin-top: 0; }
.article-content h1, .article-content h2 { font-size: 1.65rem; font-weight: 700; margin: 2.4rem 0 1rem; }
.article-content h3 { font-size: 1.35rem; font-weight: 700; margin: 2rem 0 .8rem; }
.article-content h4, .article-content h5, .article-content h6 { font-size: 1.12rem; font-weight: 700; margin: 1.6rem 0 .6rem; }
.article-content p { margin-bottom: 1.15rem; }
.article-content a { color: var(--hg-blue-600); text-decoration: underline; text-decoration-color: rgba(55,114,197,.35); text-underline-offset: 3px; }
.article-content a:hover { color: var(--hg-navy); text-decoration-color: currentColor; }
.article-content ul, .article-content ol { padding-left: 1.4rem; margin-bottom: 1.2rem; }
.article-content li { margin-bottom: .45rem; }
.article-content li::marker { color: var(--hg-blue); }
.article-content img { max-width: 100%; height: auto !important; border-radius: 12px; margin: 1rem 0; }
.article-content figure { margin: 1.5rem 0; }
.article-content figcaption { font-size: .88rem; color: var(--hg-muted); text-align: center; margin-top: .4rem; }
.article-content blockquote { margin: 1.8rem 0; padding: 1.1rem 1.4rem; background: var(--hg-soft); border-left: 4px solid var(--hg-blue); border-radius: 0 12px 12px 0; font-size: 1.1rem; color: #2a3a5c; }
.article-content blockquote p:last-child { margin-bottom: 0; }
.article-content table { display: block; width: 100% !important; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.5rem 0; font-size: .96rem; }
.article-content th, .article-content td { border: 1px solid var(--hg-line); padding: .65rem .85rem; vertical-align: top; min-width: 120px; }
.article-content th, .article-content thead td { background: #f0f5fd; color: var(--hg-navy); font-weight: 600; }
.article-content tr:nth-child(even) td { background: #fafcff; }
.article-content pre { background: #0f1b3d; color: #e6edff; padding: 1rem 1.2rem; border-radius: 12px; overflow-x: auto; font-size: .9rem; }
.article-content code { background: #eef3fc; color: var(--hg-navy); padding: .1rem .35rem; border-radius: 4px; font-size: .9em; }
.article-content pre code { background: none; color: inherit; padding: 0; }
.article-content iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 12px; }
.article-content hr { margin: 2rem 0; border-color: var(--hg-line); opacity: 1; }

.hg-share { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.hg-share a, .hg-share button { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
    border: 1px solid var(--hg-line); background: #fff; color: var(--hg-blue-600); font-size: 1.05rem; transition: all .15s ease; }
.hg-share a:hover, .hg-share button:hover { color: #fff; transform: translateY(-2px); }
.hg-share .s-fb:hover { background: #1877f2; border-color: #1877f2; }
.hg-share .s-x:hover { background: #000; border-color: #000; }
.hg-share .s-in:hover { background: #0a66c2; border-color: #0a66c2; }
.hg-share .s-wa:hover { background: #25d366; border-color: #25d366; }
.hg-share .s-mail:hover, .hg-share .s-copy:hover { background: var(--hg-blue); border-color: var(--hg-blue); }
.hg-article-foot { border-top: 1px solid var(--hg-line); border-bottom: 1px solid var(--hg-line); padding: 1.4rem 0; margin: 2.5rem 0; }
.hg-section-title { font-size: 1.5rem; font-weight: 800; }
.hg-preview-banner { background: #fff4d6; border-bottom: 1px solid #f2d68a; color: #6b4e00; font-size: .92rem; }
.hg-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--hg-blue), var(--hg-sky)); z-index: 1100; transition: width .1s linear; }

@media (min-width: 992px) { .hg-sticky { position: sticky; top: 100px; } }

/* ---------------- empty / 404 ---------------- */
.hg-empty { text-align: center; padding: 3.5rem 1rem; background: var(--hg-soft); border: 1px dashed #cfdbef; border-radius: var(--hg-radius); }
.hg-empty i { font-size: 2.6rem; color: var(--hg-blue); }

/* ---------------- footer ---------------- */
.hg-footer { background: var(--hg-footer); color: rgba(255,255,255,.78); padding: 3.5rem 0 0; margin-top: 4rem; font-size: .94rem; }
.hg-footer h4 { color: #fff; font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.hg-footer a { color: rgba(255,255,255,.78); }
.hg-footer a:hover { color: #fff; }
.hg-footer ul { list-style: none; padding: 0; }
.hg-footer li { margin-bottom: .5rem; }
.hg-footer .hg-footer-logo { background: #fff; display: inline-block; padding: .6rem .9rem; border-radius: 10px; }
.hg-footer .hg-footer-logo img { height: 38px; }
.hg-footer .hg-social a { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; margin-right: .35rem; }
.hg-footer .hg-social a:hover { background: var(--hg-sky); }
.hg-footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 1.2rem 0; margin-top: 2.5rem; font-size: .85rem; }

.hg-backtotop { position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--hg-blue); color: #fff;
    box-shadow: var(--hg-shadow-hover); opacity: 0; visibility: hidden; transition: all .2s ease; z-index: 1000; }
.hg-backtotop.show { opacity: 1; visibility: visible; }
.hg-backtotop:hover { background: var(--hg-navy); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { .hg-topbar, .hg-navbar, .hg-footer, .hg-share, aside, .hg-related, .hg-backtotop { display: none !important; } }
.hg-cta-btn { position: relative; z-index: 1; }
.hg-crumb-current { max-width: 40ch; }
.hg-related { background: var(--hg-soft); }
.article-content li > p { margin-bottom: .25rem; }
.article-content li > p:last-child { margin-bottom: 0; }
