/*
Theme Name: Osto Theme
Theme URI: https://osto.one/
Author: Deepak Verma
Author URI: https://osto.one/
Description: A clean, modern WordPress theme with a full-featured mega menu (icons + descriptions + CTA aside), dynamic category filters on the hub, elegant single-post layout, and a dark navy footer. Built with rigorous responsive design and accessibility in mind.
Version: 2.6.14
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: safe-blog
Tags: blog, minimal, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* =====================================================================
   DESIGN TOKENS
===================================================================== */
:root {
    /* Brand */
    --color-brand: #1c267a;
    --color-brand-hover: #141b5e;
    --color-brand-soft: #eef0fa;
    --color-brand-tint: #f5f6fc;

    /* Accent */
    --color-accent: #4f46e5;
    --color-accent-light: #e0e7ff;

    /* Neutral */
    --color-bg: #f4f4f7;
    --color-bg-alt: #ffffff;
    --color-text: #0f1538;
    --color-text-muted: #5c6280;
    --color-text-light: #8a90a8;
    --color-border: #e4e6ee;
    --color-border-soft: #eef0f6;
    --color-divider: #e9ebf3;

    /* Footer */
    --color-footer-bg: #0a0d2e;
    --color-footer-bg-grad: #141b5e;
    --color-footer-text: #b0b4cc;
    --color-footer-heading: #ffffff;
    --color-footer-border: rgba(255, 255, 255, 0.08);

    /* Mega menu aside gradient */
    --gradient-aside: linear-gradient(135deg, #1c267a 0%, #2d3aa8 50%, #1c267a 100%);
    --gradient-cta: linear-gradient(90deg, #6366f1 0%, #4f46e5 50%, #1c267a 100%);

    /* Sizing — chips stay “squarish” (not capsule) but with enough radius to feel polished */
    --radius-pill: 14px;
    --radius-card: 16px;
    --radius-btn: 10px;
    --radius-panel: 20px;
    --radius-icon: 10px;
    --shadow-card: 0 4px 24px rgba(10, 13, 46, 0.04);
    --shadow-panel: 0 30px 80px rgba(10, 13, 46, 0.15), 0 2px 4px rgba(10, 13, 46, 0.03);
    --shadow-cta: 0 8px 20px rgba(28, 38, 122, 0.25);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --container-max: 1280px;
    --container-pad: 24px;
    --header-height: 76px;
    --header-height-mobile: 56px;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* =====================================================================
   RESET
===================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    background-color: var(--color-footer-bg);
    min-height: 100vh;
    min-height: 100dvh;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Hard guard against accidental horizontal scroll from offscreen pseudo-elements / glows.
       `clip` is preferred over `hidden` because it does not create a containing block
       and so it does not break `position: sticky` for the header. */
    overflow-x: clip;
}

html {
    overflow-x: clip;
}

/* Stretch main so the footer sits at the bottom of the viewport on short pages */
main.site-main {
    flex: 1 0 auto;
}

/*
 * Dark tail after wp_footer(): some plugins inject fixed-height blocks that default to white.
 * This flex item paints the same navy as the footer through the safe-area band.
 */
.site-document-endcap {
    flex: 0 0 auto;
    width: 100%;
    margin: 0;
    padding: 0;
    min-height: max(20px, env(safe-area-inset-bottom, 0px));
    background-color: var(--color-footer-bg);
}

/* When mobile drawer is open, lock the body scroll without layout shift */
body.menu-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
}

a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--color-brand); }
img { max-width: 100%; height: auto; display: block; }

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    padding: 0;
}

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
    width: 100%;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1000;
    padding: 12px 20px;
    background: var(--color-brand);
    color: #fff;
    font-weight: 600;
    border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px; width: 1px;
    overflow: hidden;
    white-space: nowrap;
}

/* =====================================================================
   HEADER
===================================================================== */
.site-header {
    background: var(--color-bg);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

/* When the mobile drawer is open, hide the main header bar (close via drawer or overlay). */

.site-header.is-scrolled {
    background: rgba(244, 244, 247, 0.92);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    box-shadow: 0 1px 0 rgba(10, 13, 46, 0.04);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    height: var(--header-height);
}

/* Logo + primary nav cluster on the left; Book Demo + menu stay flush right */
.header-inner-start {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 8px;
}

.site-branding { flex-shrink: 0; display: flex; align-items: center; }

.site-logo {
    display: inline-flex;
    align-items: center;
    font-weight: 800;
    font-size: 28px;
    letter-spacing: -0.5px;
    color: var(--color-brand);
    line-height: 1;
}

.site-logo .logo-text { color: var(--color-brand); }

.custom-logo-link img { max-height: 40px; width: auto; }

/* ======================= PRIMARY MENU ======================= */
.main-nav {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    justify-content: flex-start;
    margin: 0 0 0 8px;
    min-width: 0;
    height: 100%;
}

.primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
    gap: 2px;
    height: 100%;
}

.primary-menu > .menu-item {
    position: static;
    display: flex;
    align-items: center;
    height: 100%;
}

.primary-menu > .menu-item > a,
.primary-menu > .menu-item > .menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1;
    white-space: nowrap;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease;
}

.primary-menu > .menu-item > a:hover,
.primary-menu > .menu-item > .menu-trigger:hover,
.primary-menu > .menu-item.is-open > .menu-trigger,
.primary-menu > .menu-item > a:focus-visible {
    background: rgba(28, 38, 122, 0.06);
    color: var(--color-brand);
}

.primary-menu .caret {
    flex-shrink: 0;
    opacity: 0.7;
    transition: transform 0.25s var(--ease-out);
}

.primary-menu > .menu-item.is-open > .menu-trigger .caret {
    transform: rotate(180deg);
}

/* =====================================================================
   MEGA MENU
===================================================================== */
.megamenu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s var(--ease-out), transform 0.25s var(--ease-out), visibility 0.25s;
    pointer-events: none;
    padding-top: 8px;
    padding-bottom: 24px;
}

.primary-menu > .menu-item.is-open .megamenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.megamenu > .container {
    padding-left: var(--container-pad);
    padding-right: var(--container-pad);
}

.megamenu-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    background: #ffffff;
    border-radius: var(--radius-panel);
    box-shadow: var(--shadow-panel);
    border: 1px solid var(--color-border-soft);
    overflow: hidden;
}

.megamenu-content {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    padding: 32px;
}

/* Sections within a column (e.g. Cloud Security + Network Security) */
.megamenu-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.mega-section { min-width: 0; }

.mega-section + .mega-section {
    padding-top: 20px;
    border-top: 1px solid var(--color-divider);
}

.mega-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin: 0 0 14px;
    padding-left: 4px;
}

.mega-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ============= Individual item (icon + title + desc) ============= */
.mega-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--color-text);
    min-width: 0;
    transition: background 0.15s ease, transform 0.15s ease;
    cursor: pointer;
    text-decoration: none;
}

.mega-item:hover,
.mega-item:focus-visible {
    background: var(--color-brand-tint);
    color: var(--color-text);
}

.mega-item.is-soon {
    cursor: default;
    opacity: 0.55;
}

.mega-item.is-soon:hover {
    background: transparent;
}

.mega-item-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--color-brand-soft);
    color: var(--color-brand);
    border-radius: var(--radius-icon);
    transition: background 0.15s ease, transform 0.15s ease;
}

.mega-item:hover .mega-item-icon {
    background: var(--color-brand);
    color: #ffffff;
}

.mega-item.is-soon:hover .mega-item-icon {
    background: var(--color-brand-soft);
    color: var(--color-brand);
}

.mega-item-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding-top: 2px;
}

.mega-item-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--color-text);
}

.mega-item-desc {
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--color-text-muted);
}

/* ============= Dark aside ============= */
.megamenu-aside {
    position: relative;
    background: var(--gradient-aside);
    color: #ffffff;
    overflow: hidden;
    display: flex;
}

.megamenu-aside::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, transparent 70%);
    pointer-events: none;
}

.megamenu-aside-inner {
    position: relative;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 280px;
    gap: 16px;
    text-align: center;
}

.megamenu-aside-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.megamenu-aside-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.3px;
    margin: 0;
    color: #ffffff;
}

.megamenu-aside-desc {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
    margin: 0 0 4px;
}

.megamenu-aside-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    background: #ffffff;
    color: var(--color-brand);
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--radius-btn);
    transition: all 0.2s ease;
    align-self: center;
    text-align: center;
    width: 100%;
    max-width: 260px;
    box-sizing: border-box;
}

.megamenu-aside-cta:hover {
    color: var(--color-brand);
    background: #f0f0f5;
    transform: translateY(-1px);
}

.megamenu-aside-cta svg { transition: transform 0.2s ease; }
.megamenu-aside-cta:hover svg { transform: translateX(3px); }

/* ============= Backdrop ============= */
/* No dimming overlay behind the mega menu (keep page background unchanged) */
.megamenu-backdrop {
    display: none !important;
    pointer-events: none;
}

/* =====================================================================
   HEADER ACTIONS
===================================================================== */
.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
    align-self: stretch;
}

.header-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--color-brand);
    color: #ffffff;
    padding: 14px 26px;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    transition: all 0.25s ease;
    line-height: 1;
}

.header-cta:hover, .header-cta:focus-visible {
    background: var(--color-brand-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-cta);
}

.header-cta svg { flex-shrink: 0; transition: transform 0.2s ease; }
.header-cta:hover svg { transform: translateX(3px); }

/* Hamburger — explicit open/close SVGs */
.menu-toggle {
    display: none;
    position: relative;
    z-index: 2;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: background 0.15s ease;
}

.menu-toggle:hover, .menu-toggle:focus-visible { background: rgba(28, 38, 122, 0.06); }

.menu-toggle-icons {
    position: relative;
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
}

.menu-toggle-icon {
    position: absolute;
    inset: 0;
    margin: auto;
    color: var(--color-text);
    transition: opacity 0.2s ease, transform 0.25s var(--ease-out);
}

.menu-toggle-icon--close { opacity: 0; transform: scale(0.85); pointer-events: none; }

.menu-toggle[aria-expanded="true"] .menu-toggle-icon--open,
.menu-toggle.is-open .menu-toggle-icon--open {
    opacity: 0;
    transform: scale(0.85);
    pointer-events: none;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon--close,
.menu-toggle.is-open .menu-toggle-icon--close {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* =====================================================================
   MOBILE DRAWER
===================================================================== */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    transform: translateX(100%);
    transition: transform 0.3s var(--ease-out);
    display: flex;
    flex-direction: column;
    visibility: hidden;
    box-shadow: -20px 0 40px rgba(0, 0, 0, 0.12);
}

.mobile-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
}

.mobile-drawer-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 24px;
}

/* Close control at top of drawer (header is hidden while drawer is open on mobile) */
.mobile-drawer-top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
    padding: 16px var(--container-pad) 12px;
}

.mobile-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text);
    transition: background 0.15s ease;
}

.mobile-drawer-close:hover,
.mobile-drawer-close:focus-visible {
    background: rgba(28, 38, 122, 0.08);
    color: var(--color-brand);
}

.mobile-drawer-close svg {
    flex-shrink: 0;
}

.mobile-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(10, 13, 46, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
    pointer-events: none;
}

.mobile-drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu {
    list-style: none;
    margin: 0;
    padding: 0 var(--container-pad);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.mobile-menu-item {
    border-bottom: 1px solid var(--color-divider);
}

.mobile-menu-item > a,
.mobile-menu-item > .mobile-menu-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 18px 8px;
    font-size: 17px;
    font-weight: 500;
    color: var(--color-text);
    font-family: inherit;
    background: transparent;
    border: none;
    text-align: left;
    line-height: 1.3;
}

.mobile-menu-item > a:hover,
.mobile-menu-item > .mobile-menu-trigger:hover,
.mobile-menu-item.is-open > .mobile-menu-trigger {
    color: var(--color-brand);
}

.mobile-menu-trigger .chevron {
    flex-shrink: 0;
    transition: transform 0.25s var(--ease-out);
    color: var(--color-text-light);
}

.mobile-menu-item.is-open .chevron { transform: rotate(180deg); }

/* Submenu = accordion */
.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease-out);
}

.mobile-menu-item.is-open .mobile-submenu { max-height: 3000px; }

.mobile-submenu-inner {
    padding: 4px 8px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.mobile-submenu .mega-section + .mega-section {
    padding-top: 14px;
    border-top: 1px solid var(--color-divider);
}

.mobile-submenu .mega-section-title {
    font-size: 10px;
    margin-bottom: 8px;
}

.mobile-submenu .mega-item {
    padding: 8px 10px;
}

.mobile-submenu .mega-item-icon {
    width: 36px;
    height: 36px;
}

.mobile-submenu .mega-item-title { font-size: 14px; }
.mobile-submenu .mega-item-desc  { font-size: 12px; }

/* Drawer CTA pinned at bottom */
.mobile-drawer-footer {
    padding: 20px var(--container-pad) 8px;
    border-top: 1px solid var(--color-divider);
    background: #ffffff;
}

.mobile-drawer-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: var(--color-brand);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-btn);
    line-height: 1;
    transition: all 0.2s ease;
}

.mobile-drawer-cta:hover {
    background: var(--color-brand-hover);
    color: #ffffff;
}

/* =====================================================================
   BLOG HERO
===================================================================== */
.blog-hero {
    padding: 28px 0 24px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border-soft);
}

/* Inner column: left-aligned inside .container (do not merge with .container — margin:auto on one element + max-width centers the block). */
.blog-hero-inner {
    max-width: 42rem;
    padding: 4px 0 4px 22px;
    border-left: 4px solid var(--color-brand);
    text-align: left;
}

.blog-hero-inner--has-eyebrow .blog-title {
    margin-top: 0;
}

.hub-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin: 0 0 10px;
    padding: 0;
}

.category-pills-wrap .hub-section-label {
    margin-bottom: 6px;
}

.blog-title {
    font-family: var(--font-sans);
    font-size: clamp(1.65rem, 3vw, 2.125rem);
    font-weight: 700;
    line-height: 1.18;
    margin: 0;
    letter-spacing: -0.035em;
    color: var(--color-text);
}

.blog-hero-eyebrow {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--color-brand);
    margin: 0 0 12px;
    line-height: 1.35;
}

.blog-hero-subtitle {
    font-size: 15px;
    line-height: 1.55;
    color: var(--color-text-muted);
    margin: 10px 0 0;
    max-width: 36rem;
}

/* =====================================================================
   SEARCH
===================================================================== */
.blog-search {
    padding: 20px 0 24px;
    margin-top: 0;
}

.blog-search-inner {
    max-width: 40rem;
    width: 100%;
    text-align: left;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-panel);
    padding: 14px 18px;
    box-shadow: var(--shadow-card);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form:focus-within {
    border-color: rgba(28, 38, 122, 0.35);
    box-shadow: 0 8px 28px rgba(10, 13, 46, 0.08);
}

.search-form svg { flex-shrink: 0; color: var(--color-brand); opacity: 0.85; }

.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-transform: none;
    color: var(--color-text);
    padding: 6px 0;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.search-form input[type="search"]::placeholder {
    color: var(--color-text-light);
    opacity: 1;
}

.search-form button[type="submit"] { display: none; }

/* =====================================================================
   PILLS + FILTERS
===================================================================== */
.category-pills-wrap {
    padding-top: 8px;
}

.hub-filter-toolbar-wrap {
    padding: 0;
}

.hub-filter-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 1.5rem;
    /* Do not use vertical-only shorthand — it would reset .container horizontal padding. */
    padding-top: 4px;
    padding-bottom: 8px;
}

.hub-clear-filters {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-brand);
    text-decoration: underline;
    text-underline-offset: 3px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 4px 0;
}

.hub-clear-filters:hover,
.hub-clear-filters:focus-visible {
    color: var(--color-brand-hover);
}

.hub-clear-filters--hidden {
    display: none !important;
}

.subcategory-pills-wrap {
    padding-top: 4px;
}

.subcategory-pills-wrap .category-pills {
    flex-wrap: wrap;
}

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 4px 0 8px;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 11px 20px;
    border-radius: var(--radius-pill);
    background: var(--color-bg-alt);
    color: var(--color-text);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid var(--color-border);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(10, 13, 46, 0.04);
}

.pill:hover {
    background: var(--color-brand-soft);
    border-color: rgba(28, 38, 122, 0.15);
    transform: translateY(-1px);
}

.pill.active {
    background: var(--color-brand);
    border-color: var(--color-brand);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(28, 38, 122, 0.25);
}

.pill.active:hover {
    background: var(--color-brand-hover);
    border-color: var(--color-brand-hover);
    color: #ffffff;
}

.filter-section { padding: 32px 0 16px; }

/* =====================================================================
   POSTS GRID
===================================================================== */
.blog-hero-desc {
    max-width: 36rem;
    margin: 12px 0 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--color-text-muted);
}

.posts-section {
    min-height: 420px;
    padding-top: 8px;
}

.posts-section .container {
    max-width: var(--container-max);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px 32px;
    padding: 40px 0 56px;
    transition: opacity 0.2s ease;
    min-height: 280px;
    align-items: stretch;
}

.posts-grid--single {
    grid-template-columns: 1fr;
    max-width: 48rem;
}

.posts-grid--duo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.posts-grid.is-loading { opacity: 0.4; pointer-events: none; }

.post-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: transform 0.28s var(--ease-out), box-shadow 0.28s ease;
    background: var(--color-bg-alt);
    border-radius: 20px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(10, 13, 46, 0.06);
    border: 1px solid var(--color-border);
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(10, 13, 46, 0.1);
    border-color: rgba(28, 38, 122, 0.12);
}

.post-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 0;
    margin: 0 0 0;
    background: linear-gradient(145deg, var(--color-border) 0%, var(--color-brand-soft) 100%);
    display: block;
}

.post-card-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(10, 13, 46, 0.04) 100%);
    pointer-events: none;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s var(--ease-out);
}

.post-card:hover .post-card-image img { transform: scale(1.05); }

.post-card-category {
    display: inline-flex;
    align-self: flex-start;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-brand);
    margin: 18px 22px 8px;
    padding: 5px 10px;
    border-radius: 6px;
    background: var(--color-brand-soft);
}

.post-card-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 22px 10px;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.post-card-title a:hover { color: var(--color-brand); }

.post-card-excerpt {
    font-size: 14px;
    line-height: 1.58;
    color: var(--color-text-muted);
    margin: 0 22px 18px;
    flex: 1;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-light);
    letter-spacing: 0.04em;
    margin-top: auto;
    margin-left: 22px;
    margin-right: 22px;
    margin-bottom: 22px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border-soft);
}

.post-card-meta .dot {
    width: 3px; height: 3px;
    background: var(--color-text-light);
    border-radius: 50%;
    flex-shrink: 0;
}

.no-posts-found {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--color-text-muted);
}

.no-posts-found svg { margin: 0 auto 16px; color: var(--color-text-light); }
.no-posts-found h3 { font-size: 22px; font-weight: 600; margin: 0 0 8px; color: var(--color-text); }
.no-posts-found p { margin: 0; font-size: 15px; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 40px 0 60px;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border-radius: var(--radius-pill);
    background: var(--color-bg-alt);
    color: var(--color-text);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current { background: var(--color-brand); color: #ffffff; }

/* =====================================================================
   SINGLE POST
===================================================================== */
.single-post { padding: 40px 0 60px; }
.single-post-container { max-width: 1280px; }

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    margin-bottom: 32px;
}

.breadcrumbs a { color: var(--color-brand); font-weight: 500; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .crumb-sep { color: var(--color-text-light); font-size: 13px; }
.breadcrumbs .crumb-current { color: var(--color-text); font-weight: 500; word-break: break-word; }

.single-post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 60px;
    align-items: start;
}

.single-post-main { min-width: 0; }
.single-post-header { margin-bottom: 40px; }

.single-post-title {
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin: 0 0 28px;
    word-wrap: break-word;
}

.single-post-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--color-accent-light);
    color: var(--color-brand);
    border-radius: var(--radius-btn);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    line-height: 1;
    transition: background 0.15s ease;
}

.category-badge:hover { background: #c7d2fe; color: var(--color-brand); }
.category-badge.small { font-size: 10px; padding: 5px 10px; letter-spacing: 1px; }

.post-date {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.single-post-featured {
    margin: 0 0 40px;
    border-radius: var(--radius-panel);
    overflow: hidden;
}

.single-post-content {
    font-size: 17px;
    line-height: 1.75;
}

.single-post-content p { margin: 0 0 24px; }
.single-post-content h2 { font-size: clamp(26px, 3vw, 32px); font-weight: 700; margin: 44px 0 16px; letter-spacing: -0.5px; }
.single-post-content h3 { font-size: clamp(20px, 2.5vw, 24px); font-weight: 700; margin: 32px 0 12px; }
.single-post-content a { color: var(--color-brand); border-bottom: 1px solid rgba(28, 38, 122, 0.3); }
.single-post-content a:hover { border-bottom-color: var(--color-brand); }
.single-post-content ul, .single-post-content ol { padding-left: 24px; margin: 0 0 24px; }
.single-post-content li { margin-bottom: 8px; }
.single-post-content blockquote {
    margin: 32px 0;
    padding: 20px 28px;
    border-left: 4px solid var(--color-brand);
    background: var(--color-bg-alt);
    border-radius: 0 12px 12px 0;
    font-size: 19px;
    font-style: italic;
}
.single-post-content img { border-radius: 12px; margin: 24px 0; }
.single-post-content pre {
    background: var(--color-text);
    color: #e4e4ea;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    font-size: 14px;
    -webkit-overflow-scrolling: touch;
}
.single-post-content code { background: #ececf0; padding: 2px 8px; border-radius: 4px; font-size: 0.9em; }
.single-post-content pre code { background: transparent; padding: 0; }

/* Sidebar */
.single-post-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: calc(var(--header-height) + 24px);
    min-width: 0;
}

.sidebar-card {
    background: var(--color-bg-alt);
    border-radius: var(--radius-panel);
    padding: 28px 24px;
    box-shadow: var(--shadow-card);
}

.sidebar-heading {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0 0 20px;
    line-height: 1.4;
}

.newsletter-form { display: flex; flex-direction: column; gap: 12px; }
.newsletter-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.newsletter-form input[type="text"],
.newsletter-form input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    background: #f4f4f9;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text);
    outline: none;
    transition: all 0.2s;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
}

.newsletter-form input::placeholder { color: var(--color-text-light); }
.newsletter-form input:focus { border-color: var(--color-brand); background: #ffffff; }

.form-privacy { font-size: 12px; line-height: 1.5; color: var(--color-text-muted); margin: 4px 0 8px; }
.form-privacy a { color: var(--color-brand); text-decoration: underline; }

.newsletter-submit {
    width: 100%;
    padding: 16px 20px;
    background: var(--gradient-cta);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s;
    background-size: 200% auto;
    line-height: 1;
}

.newsletter-submit:hover { background-position: right center; transform: translateY(-1px); box-shadow: var(--shadow-cta); }

.related-posts-card { padding-bottom: 12px; }

.related-post {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border);
    transition: opacity 0.2s;
    min-width: 0;
}

.related-post:last-child { border-bottom: none; }
.related-post:hover { opacity: 0.85; }

.related-post-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--color-border);
}

.related-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-post-body { flex: 1; min-width: 0; }
.related-post-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.related-post-date { font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--color-text-light); }
.related-post-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.related-post:hover .related-post-title { color: var(--color-brand); }

/* Comments */
.comments-area { margin: 60px 0 0; padding: 36px 28px; background: var(--color-bg-alt); border-radius: var(--radius-card); }
.comments-title { font-size: 22px; font-weight: 700; margin: 0 0 24px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 40px; }
.comment { padding: 20px 0; border-bottom: 1px solid var(--color-border-soft); }
.comment-author { font-weight: 700; margin-bottom: 4px; }
.comment-meta { font-size: 13px; color: var(--color-text-light); margin-bottom: 10px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    margin-bottom: 16px;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--color-brand); }
.comment-form input[type="submit"] {
    background: var(--color-brand); color: #fff; padding: 14px 32px;
    border-radius: var(--radius-btn); font-weight: 600; font-size: 15px;
    border: none; cursor: pointer; transition: all 0.25s;
}
.comment-form input[type="submit"]:hover { background: var(--color-brand-hover); transform: translateY(-1px); }

/* =====================================================================
   FOOTER
===================================================================== */
.site-footer {
    /* Solid base + gradient; size to padding box so the bottom band never shows “unpainted” gaps */
    background-color: var(--color-footer-bg);
    background-image: linear-gradient(180deg, var(--color-footer-bg-grad) 0%, var(--color-footer-bg) 100%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    color: var(--color-footer-text);
    padding: 80px 0 30px;
    margin-top: 80px;
    position: relative;
    /* Pseudo-element glow extends beyond the right edge — clip it so it does not
       create a horizontal scrollbar on the page. */
    overflow: hidden;
    flex-shrink: 0;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: -200px; right: -200px;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.footer-inner {
    position: relative;
    display: grid;
    grid-template-columns: 1.3fr 2fr 1fr 1fr;
    gap: 50px;
    padding-bottom: 50px;
    border-bottom: 1px solid var(--color-footer-border);
}

.footer-brand .footer-logo { display: inline-block; margin-bottom: 24px; }
.footer-brand .site-logo, .footer-brand .logo-text { color: #ffffff; }

.footer-tagline { font-size: 15px; line-height: 1.7; margin: 0 0 28px; max-width: 280px; color: var(--color-footer-text); }

.footer-badges { display: flex; gap: 10px; margin-bottom: 28px; flex-wrap: wrap; }

.compliance-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-btn);
    font-size: 12px;
    font-weight: 500;
    color: #ffffff;
    white-space: nowrap;
}

.footer-socials { display: flex; gap: 10px; }

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #ffffff;
    transition: all 0.25s;
}

.social-icon:hover { background: var(--color-accent); color: #fff; transform: translateY(-2px); border-color: var(--color-accent); }

.footer-column h4 {
    color: var(--color-footer-heading);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0 0 20px;
}

.footer-column ul { list-style: none; padding: 0; margin: 0; }
.footer-column li { margin-bottom: 14px; }
.footer-column a { font-size: 15px; color: var(--color-footer-text); transition: color 0.2s; }
.footer-column a:hover { color: #ffffff; }

.footer-product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; }
.footer-product-grid ul { margin: 0; }

.footer-bottom {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    font-size: 13px;
    color: var(--color-footer-text);
    background-color: var(--color-footer-bg);
    flex-wrap: wrap;
    gap: 20px;
}

.footer-legal { display: flex; gap: 30px; flex-wrap: wrap; }
.footer-legal a { color: var(--color-footer-text); font-size: 13px; }
.footer-legal a:hover { color: #ffffff; }

/* =====================================================================
   RESPONSIVE
===================================================================== */
@media (max-width: 1200px) {
    .megamenu-panel {
        grid-template-columns: minmax(0, 1fr) 260px;
    }
    .megamenu-content {
        gap: 20px;
        padding: 28px 24px;
    }
}

@media (max-width: 1100px) {
    .main-nav { margin-left: 8px; }
    .primary-menu > .menu-item > a,
    .primary-menu > .menu-item > .menu-trigger { padding: 10px 12px; font-size: 14px; }
    .header-cta { padding: 12px 18px; font-size: 14px; }
    .single-post-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; }

    /* Mega menu: drop aside, use 3 columns only */
    .megamenu-panel { grid-template-columns: minmax(0, 1fr); }
    .megamenu-aside { display: none; }
}

@media (max-width: 1024px) {
    :root { --container-pad: 20px; }

    .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }

    .posts-grid--single {
        grid-template-columns: 1fr;
        max-width: none;
    }

    .footer-inner { grid-template-columns: 1fr 1fr; gap: 40px; }
    .footer-product-grid { grid-template-columns: 1fr 1fr; }
}

/* Single post: stack sidebar under article only on narrow screens (not at 1024 — that hid the sidebar beside content on common laptop widths). */
@media (max-width: 768px) {
    .single-post-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }

    .single-post-sidebar {
        position: static;
        display: flex;
        flex-direction: column;
        gap: 24px;
    }
}

/* ========== MOBILE ========== */
@media (max-width: 900px) {
    :root {
        --header-height: var(--header-height-mobile);
    }

    /* Desktop nav disappears; mobile drawer takes over */
    .main-nav { display: none; }
    .menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; }
    .megamenu-backdrop { display: none; }

    body.menu-open .site-header {
        display: none;
    }

    /* Horizontal insets + notches (old `padding: 6px 0` wiped .container side padding). */
    .site-header .header-inner {
        gap: 8px;
        min-height: var(--header-height);
        height: auto;
        padding: 6px max(18px, calc(var(--container-pad) + env(safe-area-inset-right, 0px)))
            6px max(18px, calc(var(--container-pad) + env(safe-area-inset-left, 0px)));
    }

    .site-logo { font-size: 22px; }
    .custom-logo-link img { max-height: 32px; width: auto; }

    .header-cta { padding: 10px 14px; font-size: 13px; }

    .blog-hero { padding: 18px 0 14px; }
    .blog-hero-inner { padding-left: 14px; border-left-width: 3px; }
    .blog-title { font-size: clamp(1.55rem, 5.2vw, 1.95rem); letter-spacing: -0.03em; }
    .blog-hero-eyebrow { font-size: 11px; margin-bottom: 10px; }

    .posts-grid { grid-template-columns: 1fr; gap: 28px; }
    .posts-grid--single { max-width: none; }

    .breadcrumbs { font-size: 13px; gap: 6px; }

    .footer-inner { grid-template-columns: 1fr; gap: 40px; padding-bottom: 36px; }
    .footer-product-grid { grid-template-columns: 1fr 1fr; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }

    .comments-area { padding: 24px 20px; }

    /* Clear filters sits flush right; give extra inset from screen edge + notch. */
    .hub-filter-toolbar {
        padding-right: max(22px, calc(var(--container-pad) + env(safe-area-inset-right, 0px) + 6px));
    }

    .hub-clear-filters {
        padding-right: 10px;
        padding-left: 12px;
    }
}

@media (max-width: 600px) {
    /* Keep “Book Demo” visible on small screens (icon-only was confusing) */
    .header-cta {
        padding: 8px 12px;
        font-size: 11px;
        gap: 6px;
        min-height: 40px;
        width: auto;
        max-width: none;
    }

    .header-cta svg {
        width: 14px;
        height: auto;
        flex-shrink: 0;
    }

    .pill { padding: 11px 18px; font-size: 11px; }

    .sidebar-card { padding: 24px 20px; }
    .newsletter-form .form-row { grid-template-columns: 1fr; }

    .single-post-title { letter-spacing: -1px; }

    .footer-product-grid { grid-template-columns: 1fr; }
    .site-footer { padding: 60px 0 24px; margin-top: 60px; }

    .mobile-drawer { max-width: 100%; }
}

@media (max-width: 360px) {
    .site-logo { font-size: 24px; }
    .container { padding: 0 16px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* WP defaults */
.alignleft { float: left; margin: 0 20px 20px 0; }
.alignright { float: right; margin: 0 0 20px 20px; }
.aligncenter { display: block; margin: 0 auto 20px; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 13px; color: #777; text-align: center; margin-top: 8px; }
