/* -----------------------------------------
   Cybersecurity Blog - Previous Posts
------------------------------------------ */
/* Constrain + center module (handles homepage wide layouts safely) */
.mpb-ct__layout,
.mpb-ct__panels,
.mpb-ct__panel {
  max-width: 1065px;
  margin-left: auto;
  margin-right: auto;
}

/* backgorund ownership: keep wrappers transparent */
.mpb-cyber-tabs,
.mpb-ct__panels,
.mpb-ct__panel {
  background: transparent;
}

/* Desktop Layout: tabs left, content right */
@media (min-width: 921px) {
  .mpb-ct__layout {
    display: grid;
    grid-template-columns: 245px 1fr;
    gap: 1rem;
    align-items: start; /* prevent left column stretching/jumping */
    background-color: transparent;
  }
}

/* 921–1199: behave like mobile layout, but keep tabs on the left */
@media (min-width: 921px) and (max-width: 1199px) {

  .mpb-ct__layout {
    display: flex;
    grid-template-columns: none;
    align-items: flex-start;
    gap: 1rem;
  }

  .mpb-ct__nav {
    flex: 0 0 245px;
  }

  .mpb-ct__panels {
    flex: 0 1 auto;
  }

  .mpb-ct__panel {
    overflow-x: hidden;
  }

  .mpb-cyber-tabs {
    padding-inline: clamp(16px, 4vw, 32px);
    box-sizing: border-box;
  }
}

/* LEFT NAV */
.mpb-ct__nav {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e5e5e5;
  align-self: start; 
  background: #f1f0ed;
	border-radius: 12px;
  padding: 0;

  margin-left: 0;
  margin-right: 0;
}

.mpb-ct__tab {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.85rem 1.25rem;
  border: 0;
  border-left: 4px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  column-gap: 12px;
  font-weight: 500;
  position: relative;
}

.mpb-ct__tab span.label {
  display: block;
  width: 100%;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mpb-ct__tab:hover { background: #ffffff; }

.mpb-ct__tab.is-active {
  background: #ffffff;
  border-left-color: #0075c9;
  font-weight: 500;
}

.mpb-ct__tab.is-active:focus-visible {
  border-left-color: transparent;
}

/* =========================================
   Cybersecurity Previous Posts — Mobile Nav
   (No dropdown, nav above cards)
   ========================================= */
@media (max-width: 767px) {

  .mpb-ct__layout {
    grid-template-columns: 1fr;
  }

  .mpb-ct__nav {
    /* keep your existing styles */
    background: #0066b1;
    border-radius: 10px;
    margin-bottom: 12px;
    border-right: 0;
    padding: 0;

    /* IMPORTANT: container-relative sizing */
    width: 100%;
    max-width: none;

    /* center it */
    margin-left: auto;
    margin-right: auto;

    box-sizing: border-box;
  }

  .mpb-ct__tab {
    text-align: left;
    position: relative;
  }
  
  .mpb-ct__panel {
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }

  .mpb-ct__panel .mpb-ct__scroller {
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }

  .mpb-ct__tab:hover {
    background: rgba(255, 255, 255, 0.12);
  }
}

/* Blog page: let the module escape any narrow container on mobile & tablet */
@media (max-width: 920px) {
  body.page-id-14479 .mpb-cyber-prevposts-wrap,
  body.page-id-21793 .mpb-cyber-prevposts-wrap {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }

  .mpb-cyber-tabs {
    max-width: 100%;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-inline: clamp(16px, 4vw, 32px);
  }

  .mpb-ct__layout,
  .mpb-ct__nav,
  .mpb-ct__panels,
  .mpb-ct__panel,
  .mpb-ct__grid,
  .mpb-ct__scroller {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }

  /* Stacked (mobile + tablet) nav appearance */
  .mpb-ct__tab {
    padding: 14px 48px 14px 16px;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    color: #ffffff;
  }
  
  .mpb-ct__panel .mpb-ct__scroller {
      width: 100% !important;
      max-width: 100% !important;
      margin-left: 0 !important;
      margin-right: 0 !important;
    }

  .mpb-ct__tab::before {
    content: '›';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    opacity: 0.9;
    pointer-events: none;
  }

  .mpb-ct__tab.is-active {
    background: rgba(255, 255, 255, 0.18);
    font-weight: 600;
  }

  .mpb-ct__tab span.label {
    color: #ffffff;
    white-space: normal;
  }

  .mpb-ct__panel .mpb-ct__grid {
    padding-right: 0 !important;
    margin-left: auto;
    margin-right: auto;
  }

  .mpb-ct__tab:first-child {
    border-top: 0;
  }
}

/* =========================================
   TABLET (768px–920px)
   - Blue stacked nav (like mobile)
   - 2 cards visible + partial third
   - Nav, cards, and slider share the same width
========================================= */
@media (min-width: 768px) and (max-width: 920px) {
  /* Blue stacked nav */
  .mpb-ct__nav {
    background: #0066b1;
    border-radius: 10px;
    padding: 0;
    margin-bottom: 12px;
    border-right: 0;

    width: 100%;
    max-width: none; /* 2 × 260px cards + gap + peek */
    margin-left: auto;
    margin-right: auto;

    box-sizing: border-box;
  }

  .mpb-ct__tab:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  /* Lock cards + scroller aligned with nav width */
  .mpb-ct__panel {
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }

  .mpb-ct__panel .mpb-ct__scroller {
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Focus handling (keep visible focus for keyboard users) */
.mpb-ct__tab:focus,
.mpb-ct__tab:focus-visible,
.mpb-ct__tab:focus-within,
.mpb-ct__tab:active,
.mpb-ct__panel:focus,
.mpb-ct__panel:focus-visible,
.mpb-ct__grid:focus,
.mpb-ct__grid:focus-visible,
.mpb-ct__scroller:focus,
.mpb-ct__scroller:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.mpb-ct__sb-arrow:focus-visible {
  outline: 2px solid #000;
  outline-offset: -4px;
  border-radius: 8px;
  box-shadow: none !important;
}

.mpb-ct__scroller-thumb:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 2px #000 !important;
  border-radius: 6px;
}

.mpb-ct__tab::-moz-focus-inner { border: 0 !important; }

/* Unified focus treatment for tabs (desktop + mobile) */
.mpb-ct__tab {
  position: relative; /* REQUIRED */
}

.mpb-ct__tab:focus-visible::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #000;
  border-radius: 6px;
  pointer-events: none;
  box-sizing: border-box;
}

.mpb-ct__tab:focus:not(:focus-visible)::after {
  content: none;
}

/* Hide inactive panels */
.mpb-ct__panel[hidden] { display: none !important; }

/* RIGHT COLUMN */
.mpb-ct__panels {
  min-width: 0;
  display: flex;
  flex: 1 1 auto;
}

/* Panel */
.mpb-ct__panel {
  height: 100%;
  min-height: 520px; /* reserve space to avoid jump */
  display: flex;
  flex-direction: column;
  padding-bottom: 14px;
  overflow: hidden;
}

.mpb-ct__panel[aria-busy="true"] {
  min-height: 520px;
}

/* -----------------------------------------
   Card row (horizontal slider)
------------------------------------------ */
.mpb-ct__panel .mpb-ct__grid {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-auto-flow: column;
  gap: 12px;
  grid-auto-columns: 260px;
  align-content: stretch;

  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;

  padding-bottom: 6px;

  max-width: none;
  margin-left: 0;
  flex: 1 1 auto;
}

.mpb-ct__panel .mpb-ct__grid,
.mpb-ct__panel .mpb-ct__scroller {
  max-width: 100%;
  box-sizing: border-box;
}

/* Normalize sizing regardless of markup variations */
.mpb-ct__grid > * {
  width: 260px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mpb-ct__grid > * .mpb-card-text {
  flex: 1 1 auto;
}

/* Desktop: keep 3-card cap */
@media (min-width: 1200px) {
  .mpb-ct__panel .mpb-ct__grid {
    max-width: 804px;
    margin-right: auto;
  }
}

.mpb-ct__panel .mpb-ct__grid {
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}

/* Hide grid scrollbar */
.mpb-ct__grid { scrollbar-width: none; }
.mpb-ct__grid::-webkit-scrollbar { display: none; }

/* Desktop: default cursor */
@media (pointer: fine) {
  .mpb-ct__panel .mpb-ct__grid {
    cursor: default;
  }
}

/* Touch devices only */
@media (pointer: coarse) {
  .mpb-ct__panel .mpb-ct__grid {
    cursor: grab;
  }
  .mpb-ct__panel .mpb-ct__grid:active {
    cursor: grabbing;
  }
}

/* -----------------------------------------
   Cards
------------------------------------------ */
.mpb-ct__grid > .mpb-ct__card {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #e5ebef;
  border-radius: 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 420px;
  position: relative;
}

/* Lock featured-image height */
.mpb-ct__grid > * .featured-image {
  margin: 0;
  height: 140px;
  min-height: 140px;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background: #cfe0ef;
}

.mpb-ct__grid .mpb-thumb-placeholder {
  width: 100%;
  height: 100%;
}

/* Ensure images fill consistently */
.mpb-ct__grid > * .featured-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.mpb-ct__grid > .mpb-ct__card .mpb-card-text {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: 1rem;
}

.mpb-ct__grid .card-title { margin: 0; }

.mpb-ct__grid .card-title a {
  font-size: 1rem;
  font-weight: 700;
  color: #005A9C;
  text-decoration: none;
}

.mpb-ct__grid .card-title a:hover { text-decoration: underline; }

.mpb-ct__grid .mpb-date {
  font-size: .95rem;
  color: #003c6c;
  margin: .25rem 0 0;
}

.mpb-ct__grid .mpb-excerpt {
  font-size: .95rem;
  color: #00345a;
  line-height: 1.55;
  margin: .35rem 0 0;
}

/* -----------------------------------------
   Slidebar (aligned to visible row)
------------------------------------------ */
.mpb-ct__scroller {
  height: 20px;
  margin: 0;
  position: relative;
  box-sizing: border-box;
  cursor: pointer;
  padding-left: 52px;
  padding-right: 52px;
  background: transparent;
  border-radius: 10px;
}

.mpb-ct__scroller::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #e5ebef;
  border-radius: 10px;
  z-index: 0;
}

/* Keep slider width exactly aligned with visible cards */
.mpb-ct__panel .mpb-ct__scroller {
  max-width: 100%;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
}

/* Arrows */
.mpb-ct__sb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #005A9C;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  pointer-events: auto;
}

.mpb-ct__sb-prev { left: 0; }
.mpb-ct__sb-next { right: 0; }

.mpb-ct__sb-arrow { z-index: 2; }
.mpb-ct__scroller-thumb { z-index: 1; }

.mpb-ct__sb-prev::before { content: "◄"; font-size: 12px; }
.mpb-ct__sb-next::before { content: "►"; font-size: 12px; }

.mpb-ct__sb-arrow:hover { color: #002f5a; }
.mpb-ct__sb-arrow:disabled { opacity: .45; cursor: default; }

/* Thumb */
.mpb-ct__scroller-thumb {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  width: 80px;
  height: 20px;
  border-radius: 10px;
  background: #9fbdd8;
  cursor: grab;
  z-index: 4;
  pointer-events: auto;
  touch-action: none;
}

/* Accessibility: enlarge clickable area */
.mpb-ct__sb-arrow::after {
  content: '';
  position: absolute;
  inset: -12px;
}

/* Disable mobile tap highlight on slider controls */
.mpb-ct__sb-arrow,
.mpb-ct__scroller,
.mpb-ct__scroller-thumb {
  -webkit-tap-highlight-color: transparent;
}

/* Disable snapping when JS sets data-no-snap="true" */
.mpb-ct__grid[data-no-snap="true"] {
  scroll-snap-type: none !important;
}

/* Prevent text selection while dragging cards */
.mpb-ct__grid.is-dragging {
  user-select: none;
  -webkit-user-select: none;
}

/* Focus ring for keyboard navigation in cards */
.mpb-ct__grid > .mpb-ct__card:focus-within::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #000;
  border-radius: 10px;
  pointer-events: none;
}

.mpb-ct__grid a:focus-visible {
  outline: none;
}

/* Tablet & touch users */
@media (max-width: 1024px) {
  .mpb-ct__sb-arrow {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
  }

  .mpb-ct__scroller { height: 18px; }
  .mpb-ct__scroller-thumb { height: 18px; }

  .mpb-ct__tab:focus-visible::after {
    border-color: #000;
  }
}

/* touch smoothness */
@media (pointer: coarse) {
  .mpb-ct__panel .mpb-ct__grid {
    scroll-behavior: auto;
  }
}

/* =========================================
   LOADING SKELETONS
   ========================================= */

.mpb-ct__grid .mpb-skel {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #e5ebef;
  border-radius: 8px;
  overflow: hidden;
  min-height: 420px;
  width: 260px;
  min-width: 260px;
}

.mpb-ct__grid .mpb-skel .featured-image {
  height: 140px;
  min-height: 140px;
  background: #cfe0ef;
  border-radius: 8px 8px 0 0;
}

.mpb-ct__grid .mpb-skel .mpb-card-text {
  padding: 1rem;
}

.mpb-ct__grid .mpb-skel .skel-line {
  height: 12px;
  border-radius: 6px;
  background: #bcd0e2;
  margin-top: 10px;
}

.mpb-ct__grid .mpb-skel .skel-title {
  height: 18px;
  width: 85%;
  margin-top: 0;
}

.mpb-ct__grid .mpb-skel .skel-date { width: 55%; }
.mpb-ct__grid .mpb-skel .skel-short { width: 70%; }

.mpb-ct__grid .mpb-skel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.35) 50%,
    rgba(255,255,255,0) 100%
  );
  animation: mpb-skeleton 1.2s infinite;
}

/* Default: show all 3 */
.mpb-cyber-tabs .mpb-ct__grid .mpb-skel {
  display: flex;
}

/* Tablet: show 2 (hide 3rd+) */
@media (max-width: 920px) {
  .mpb-cyber-tabs .mpb-ct__grid .mpb-skel:nth-child(n+3) {
    display: none;
  }
}

/* Phone: show 1 (hide 2nd+) */
@media (max-width: 767px) {
  .mpb-cyber-tabs .mpb-ct__grid .mpb-skel:nth-child(n+2) {
    display: none;
  }
}

@keyframes mpb-skeleton {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* =========================================
   EMPTY / ERROR STATE (CSS + JS COMPAT)
   JS uses: .mpb-ct__state --empty/--error
   CSS may also use: .mpb-ct__empty / .mpb-ct__error
   ========================================= */

/* Shared base */
.mpb-ct__state,
.mpb-ct__empty,
.mpb-ct__error {
  width: 100%;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 8px;
  padding: 2rem;
  font-size: 1rem;
  line-height: 1.5;
}

/* Limit text width */
.mpb-ct__state > *,
.mpb-ct__empty > *,
.mpb-ct__error > * {
  max-width: 420px;
}

/* Empty */
.mpb-ct__state--empty,
.mpb-ct__empty {
  background: #f1f0ed;
  color: #005A9C;
}

/* Error */
.mpb-ct__state--error,
.mpb-ct__error {
  background: #fff1f1;
  color: #7a1c1c;
  border: 1px solid #f1c6c6;
}

/* Optional debugId styling if you print it */
.mpb-ct__error small,
.mpb-ct__state--error small {
  display: block;
  margin-top: .75rem;
  opacity: .7;
  font-size: .85rem;
}

/* =========================================
   LOADING STATE
   ========================================= */

.mpb-ct__panel[aria-busy="true"] .mpb-ct__grid {
  pointer-events: none;
  opacity: 0.85;
}

.mpb-ct__panel[aria-busy="false"] .mpb-skel {
  display: none;
}