/* ==========================================================================
   MIDDLEMAN — BLOG / RESSOURCES HUB
   Layered on top of colors_and_type.css + site.css.
   ========================================================================== */

/* ---- HERO ---- */
.bloghub-hero {
  position: relative;
  background:
    radial-gradient(ellipse 60% 60% at 82% 18%, rgba(61,228,207,0.14), transparent 60%),
    radial-gradient(ellipse 55% 55% at 10% 85%, rgba(76,108,226,0.20), transparent 60%),
    linear-gradient(165deg, #0b1437 0%, #0a1b2e 55%, #0a2230 100%);
  color: #fff;
  padding-top: 66px;
  overflow: hidden;
}
.bloghub-hero .grid-tex {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 25%, #000 30%, transparent 75%);
  pointer-events: none;
}
.bloghub-hero-inner { position: relative; z-index: 2; max-width: 900px; margin: 0 auto; padding: 84px 40px 72px; text-align: center; }
.bloghub-hero .eyebrow { color: var(--mint); justify-content: center; }
.bloghub-hero h1 {
  font-family: var(--heading-font);
  font-size: clamp(38px, 5.2vw, 66px);
  font-weight: 900; letter-spacing: -0.035em; line-height: 1.02;
  margin-bottom: 20px; color: #fff; text-wrap: balance;
}
.bloghub-hero h1 .mint { color: var(--mint); }
.bloghub-hero .sub { font-size: 19px; line-height: 1.6; color: #fff; max-width: 60ch; margin: 0 auto 36px; }

/* search */
.blog-search { display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 0 auto 26px; background: #fff; border-radius: var(--radius-full); padding: 7px 7px 7px 20px; box-shadow: 0 18px 50px rgba(5,12,30,0.35); }
.blog-search svg.ic { width: 20px; height: 20px; color: var(--gray-400); flex-shrink: 0; }
.blog-search input { flex: 1; border: 0; outline: 0; font-family: var(--font-sans); font-size: 15.5px; color: var(--ink); background: transparent; padding: 8px 0; }
.blog-search input::placeholder { color: var(--placeholdergray); }
.blog-search .btn { padding: 11px 22px; }

/* hero category pills */
.hero-cats { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; }
.hero-cat { font-family: var(--heading-font); font-size: 13px; font-weight: 600; color: #fff; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); padding: 8px 15px; border-radius: var(--radius-full); cursor: pointer; transition: all .16s ease; }
.hero-cat:hover { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.3); }

/* ---- EDITORIAL CATEGORIES ---- */
.cats { background: var(--bg-app); }
.cats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.catcard { padding: 30px 28px; display: flex; flex-direction: column; cursor: pointer; }
.catcard:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-3px); }
.catcard-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.catcard .itile { width: 46px; height: 46px; border-radius: 12px; }
.catcard h3 { font-size: 19px; font-weight: 800; color: var(--navy); letter-spacing: -0.01em; }
.catcard .slug { font-family: var(--font-mono, monospace); font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.catcard .desc { font-size: 13.5px; line-height: 1.55; color: var(--muted); margin-bottom: 18px; }
.catcard-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.catcard-tags span { font-family: var(--heading-font); font-size: 11.5px; font-weight: 600; color: var(--gray-600); background: var(--bg-app); border: 1px solid var(--gray-200); padding: 4px 10px; border-radius: var(--radius-full); }
.catcard:hover .catcard-tags span { background: #fff; }
.catcard .more { margin-top: 18px; display: inline-flex; align-items: center; gap: 7px; font-family: var(--heading-font); font-size: 13px; font-weight: 700; color: var(--mm-accent); }
.catcard .more svg { width: 15px; height: 15px; }

/* ---- FEATURED + POPULAR ---- */
.feat-section { background: #fff; }
.feat-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 28px; align-items: start; }
.feat-main { display: flex; flex-direction: column; overflow: hidden; }
.feat-main .fm-media { position: relative; min-height: 320px; background: linear-gradient(150deg, #0b1437, #0a2230); display: flex; align-items: flex-end; padding: 30px; }
.feat-main .fm-media .glow { position: absolute; inset: 0; background: radial-gradient(ellipse 60% 60% at 72% 28%, rgba(61,228,207,0.2), transparent 60%), radial-gradient(ellipse 50% 50% at 18% 82%, rgba(76,108,226,0.26), transparent 60%); }
.feat-main .fm-media .badge { position: relative; font-family: var(--heading-font); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mint); background: rgba(10,20,46,0.5); border: 1px solid rgba(94,234,212,0.3); padding: 7px 14px; border-radius: var(--radius-full); }
.feat-main .fm-body { padding: 32px 34px 34px; }
.feat-main .cat { font-family: var(--heading-font); font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mm-accent); margin-bottom: 14px; }
.feat-main h2 { font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; color: var(--navy); line-height: 1.14; letter-spacing: -0.02em; margin-bottom: 14px; }
.feat-main p { font-size: 15.5px; line-height: 1.6; color: var(--muted); margin-bottom: 22px; }

.popular { display: flex; flex-direction: column; }
.popular-head { font-family: var(--heading-font); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gray-500); margin-bottom: 8px; display: flex; align-items: center; gap: 9px; }
.popular-head svg { width: 16px; height: 16px; color: var(--mm-accent); }
.poprow { display: flex; gap: 16px; align-items: flex-start; padding: 18px 0; border-bottom: 1px solid var(--gray-200); }
.poprow:last-child { border-bottom: 0; }
.poprow .num { font-family: var(--heading-font); font-size: 22px; font-weight: 900; color: var(--gray-300); line-height: 1; flex-shrink: 0; width: 26px; }
.poprow .pr-cat { font-family: var(--heading-font); font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 5px; }
.poprow h4 { font-size: 14.5px; font-weight: 700; color: var(--navy); line-height: 1.35; transition: color .15s; }
.poprow:hover h4 { color: var(--mm-accent); }
.poprow .pr-meta { font-size: 12px; color: var(--gray-400); margin-top: 6px; }

/* ---- FILTER BAR + GRID ---- */
.library { background: var(--bg-app); }
.lib-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.lib-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lib-chip { font-family: var(--heading-font); font-size: 13px; font-weight: 700; color: var(--gray-600); background: #fff; border: 1px solid var(--gray-200); padding: 9px 16px; border-radius: var(--radius-full); cursor: pointer; transition: all .15s ease; }
.lib-chip:hover { border-color: var(--mm-accent); color: var(--mm-accent); }
.lib-chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.lib-count { font-size: 13.5px; color: var(--muted); font-family: var(--heading-font); font-weight: 600; }
.lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.lib-empty { display: none; text-align: center; padding: 60px 20px; color: var(--muted); font-size: 15px; }
.lib-empty.show { display: block; }

/* ---- CONTENT FORMATS ---- */
.formats { background: #fff; }
.formats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.fmt { padding: 28px 26px; display: flex; flex-direction: column; }
.fmt .itile { width: 44px; height: 44px; border-radius: 11px; margin-bottom: 18px; }
.fmt h3 { font-size: 17px; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.fmt .fd { font-size: 13px; line-height: 1.55; color: var(--muted); margin-bottom: 18px; }
.fmt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.fmt-list li a { font-size: 13px; line-height: 1.4; color: var(--gray-700); display: flex; gap: 8px; align-items: flex-start; transition: color .15s; }
.fmt-list li a:hover { color: var(--mm-accent); }
.fmt-list li svg { width: 13px; height: 13px; color: var(--tertiary-600); flex-shrink: 0; margin-top: 3px; }

/* ---- DOWNLOADABLE RESOURCES ---- */
.downloads { background: var(--bg-app); }
.dl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.dlcard { display: flex; flex-direction: column; overflow: hidden; }
.dlcard-top { padding: 26px 26px 0; flex: 1; }
.dlcard .kind { display: inline-flex; align-items: center; gap: 7px; font-family: var(--heading-font); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tertiary-700); background: var(--tertiary-50); padding: 5px 11px; border-radius: var(--radius-full); margin-bottom: 16px; }
.dlcard h3 { font-size: 18px; font-weight: 800; color: var(--navy); line-height: 1.25; margin-bottom: 10px; }
.dlcard p { font-size: 13.5px; line-height: 1.55; color: var(--muted); margin-bottom: 18px; }
.dlcard-foot { padding: 0 26px 26px; }
.dlcard .btn { width: 100%; justify-content: center; }

/* ---- NEWSLETTER ---- */
.newsletter { background: #fff; }
.nl-card { background: linear-gradient(135deg, var(--mm-accent-tint), var(--tertiary-25)); border: 1px solid var(--mm-accent-soft); border-radius: 20px; padding: 48px 52px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; align-items: center; }
.nl-card h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; color: var(--navy); line-height: 1.15; margin-bottom: 12px; }
.nl-card p { font-size: 15px; line-height: 1.6; color: var(--gray-600); }
.nl-form { display: flex; flex-direction: column; gap: 10px; }
.nl-form .note { font-size: 12px; color: var(--muted); }
.nl-form .hs-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.nl-form .hs-form-field { margin: 0; }
.nl-form .hs-form-field > label { display: none; }
.nl-form .hs-form .input { margin: 0; }
.nl-form .hs-input[type="email"] { width: 100% !important; min-height: 50px; font-family: var(--font-sans); font-size: 14.5px; color: var(--ink); padding: 13px 16px; border: 1px solid var(--inputgray); border-radius: var(--radius-lg); background: #fff; }
.nl-form .hs-input[type="email"]:focus { outline: none; border-color: var(--primary-500); box-shadow: 0 0 0 3px var(--primary-50); }
.nl-form .hs-submit { grid-column: 2; grid-row: 1; }
.nl-form .hs-button { min-height: 50px; border: 0; border-radius: var(--radius-md); padding: 13px 24px; background: var(--mm-accent); color: #fff; cursor: pointer; font-family: var(--heading-font); font-size: 14px; font-weight: 700; transition: background .18s ease, transform .18s ease, box-shadow .18s ease; }
.nl-form .hs-button:hover { background: var(--mm-accent-700); transform: translateY(-1px); box-shadow: 0 8px 22px rgb(var(--mm-accent-rgb) / .28); }
.nl-form .hs-error-msgs { grid-column: 1 / -1; list-style: none; margin: 6px 0 0; padding: 0; }
.nl-form .hs-error-msg { font-size: 12px; color: var(--error-600, #b42318); }
.nl-form .legal-consent-container { grid-column: 1 / -1; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.nl-form .legal-consent-container p { font-size: inherit; color: inherit; }
.nl-form .legal-consent-container .inputs-list { list-style: none; margin: 6px 0 0; padding: 0; }
.nl-form .legal-consent-container label { display: flex; gap: 8px; align-items: flex-start; }
.nl-form .legal-consent-container input { flex: 0 0 auto; margin-top: 3px; }
.nl-ok { font-family: var(--heading-font); font-weight: 700; color: var(--tertiary-700); font-size: 15px; display: none; align-items: center; gap: 8px; }
.nl-ok.show { display: flex; }
.nl-ok svg { width: 18px; height: 18px; }

/* HubSpot form used by the three downloadable resources */
#hubspot-download-form .hs-form-field { margin-bottom: 16px; }
#hubspot-download-form .hs-form-field > label { display: block; margin-bottom: 7px; font-family: var(--heading-font); font-size: 12px; font-weight: 700; color: var(--gray-700); }
#hubspot-download-form .input { margin: 0; }
#hubspot-download-form .hs-input:not([type="checkbox"]):not([type="radio"]) { width: 100% !important; padding: 11px 14px; border: 1px solid var(--inputgray); border-radius: 8px; background: #fff; color: var(--ink); font-family: var(--font-sans); font-size: 14px; }
#hubspot-download-form .hs-input:focus { outline: none; border-color: var(--mm-accent); box-shadow: 0 0 0 3px var(--mm-accent-soft); }
#hubspot-download-form .hs-button { width: 100%; margin-top: 8px; padding: 13px 20px; border: 0; border-radius: var(--radius-md); background: var(--mm-accent); color: #fff; cursor: pointer; font-family: var(--heading-font); font-size: 14px; font-weight: 700; }
#hubspot-download-form .hs-button:hover { background: var(--mm-accent-700); }
#hubspot-download-form .hs-error-msgs { list-style: none; padding: 0; margin: 6px 0 0; }
#hubspot-download-form .hs-error-msg { font-size: 12px; color: var(--error-600, #b42318); }
#hubspot-download-form .legal-consent-container { margin-top: 12px; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
#hubspot-download-form .legal-consent-container p { font-size: inherit; color: inherit; }
#hubspot-download-form .legal-consent-container .inputs-list { list-style: none; margin: 8px 0; padding: 0; }
#hubspot-download-form .legal-consent-container label { display: flex; align-items: flex-start; gap: 8px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1000px) {
  .cats-grid { grid-template-columns: 1fr 1fr; }
  .feat-layout { grid-template-columns: 1fr; }
  .lib-grid { grid-template-columns: 1fr 1fr; }
  .formats-grid { grid-template-columns: 1fr 1fr; }
  .dl-grid { grid-template-columns: 1fr; }
  .nl-card { grid-template-columns: 1fr; gap: 24px; padding: 36px 32px; }
}
@media (max-width: 600px) {
  .bloghub-hero-inner { padding: 64px 22px 56px; }
  .blog-search { flex-wrap: wrap; border-radius: 16px; padding: 12px; }
  .blog-search input { min-width: 0; width: calc(100% - 32px); }
  .blog-search .btn { width: 100%; }
  .cats-grid { grid-template-columns: 1fr; }
  .lib-grid { grid-template-columns: 1fr; }
  .formats-grid { grid-template-columns: 1fr; }
  .nl-form .hs-form { grid-template-columns: 1fr; }
  .nl-form .hs-submit { grid-column: 1; grid-row: auto; }
  .nl-form .hs-button { width: 100%; }
  .nl-card { padding: 28px 22px; }
  .feat-main .fm-media { min-height: 230px; padding: 22px; }
  .feat-main .fm-body, .catcard, .fmt { padding: 24px 22px; }
  .lib-chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 6px; scrollbar-width: thin; }
  .lib-chip { flex: 0 0 auto; }
}
