/* === GLOBAL: stop tiny left/right drift on mobile === */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Common WordPress containers that cause micro overflow */
#page, #content, #primary, #main,
.site, .site-content {
  max-width: 100%;
  overflow-x: hidden;
}

/* Images, embeds, iframes */
img, video, iframe, embed, object {
  max-width: 100%;
  height: auto
}

/* Long links / IDs (very important for your conviction pages) */
a, p, li, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* === BF conviction pages (Jan / Feb / March) === */
.bf-jan-wrap, .bf-feb-wrap, .bf-march-wrap,
.bf-jan-wrap *, .bf-feb-wrap *, .bf-march-wrap * {
  box-sizing: border-box;
  max-width: 100%;
}

/* Lock card width so nothing pokes out */
.bf-jan-wrap .bf-case-card,
.bf-feb-wrap .bf-case-card,
.bf-march-wrap .bf-case-card {
  width: calc(100% - 32px);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
/* === JANUARY ONLY: kill the last 1–2px horizontal slip === */

/* Force January page to never exceed viewport */
.page-january-2025,
.page-january-2025 *,
.page-template-january-2025,
.page-template-january-2025 * {
  max-width: 100%;
  box-sizing: border-box;
}

/* Kill any sneaky 100vw usage */
.page-january-2025 [style*="100vw"],
.page-january-2025 [class*="grid"],
.page-january-2025 [class*="wrap"] {
  width: 100%;
  max-width: 100%;
}

/* Lock case cards harder than other months */
.page-january-2025 .bf-case-card {
  width: calc(100% - 32px) !important;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* Force wrapping for long January links */
.page-january-2025 a,
.page-january-2025 p,
.page-january-2025 li {
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* DEBUG — remove after */
.page-january-2025 * {
  outline: 1px solid rgba(255, 0, 0, 0.15);
}
/* === JANUARY (.bf-jan-wrap): kill the last 1–3px horizontal slip (mobile) === */
@media (max-width: 782px){

  /* stop any child pushing the viewport */
  .bf-jan-wrap{
    width: 100%;
    max-width: 100%;
    overflow-x: clip;     /* modern */
    overflow-x: hidden;   /* fallback */
  }

  /* make sure grids can actually shrink (classic overflow cause) */
  .bf-jan-wrap,
  .bf-jan-wrap *{
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;         /* IMPORTANT for grid/flex children */
  }

  /* kill any vw widths inside January */
  .bf-jan-wrap [style*="100vw"],
  .bf-jan-wrap [style*="width:100vw"],
  .bf-jan-wrap [style*="width: 100vw"]{
    width: 100% !important;
    max-width: 100% !important;
  }

  /* media + embeds never exceed the card */
  .bf-jan-wrap img,
  .bf-jan-wrap iframe,
  .bf-jan-wrap video,
  .bf-jan-wrap embed,
  .bf-jan-wrap object{
    max-width: 100% !important;
    height: auto !important;
  }

  /* long links / IDs wrap instead of forcing overflow */  .bf-jan-wrap a,
  .bf-jan-wrap p,
  .bf-jan-wrap li{
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
/* === JANUARY NUCLEAR LOCK: remove the last tiny horizontal slip (mobile only) === */
@media (max-width: 782px){

  /* Hard stop the page wiggle */
  html, body{
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative;
  }

  /* Hard stop the January wrapper */
  .bf-jan-wrap{
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    position: relative;
    left: 0 !important;
    right: 0 !important;
  }

  /* Common hidden cause: something using negative margins */
  .bf-jan-wrap *{
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  /* Kill any vw-based widths that cause 1–3px drift */
  .bf-jan-wrap [style*="vw"],
  .bf-jan-wrap [class*="vw"]{
    width: 100% !important;
    max-width: 100% !important;
  }

  /* If any section uses full-bleed alignment, clamp it */
  .bf-jan-wrap .alignfull,
  .bf-jan-wrap .alignwide{
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}
/* === BF month navigation: dull current page link automatically === */

.bf-month-links a{
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* WordPress automatically adds body classes like:
   .page-january-2025-convictions
   .page-february-2025-convictions
   .page-march-2025-uk-child-sexual-offence-convictions
*/

.page-uk-convictions-index .bf-month-links a[href="/uk-convictions-index/"],
.page-january-2025-convictions .bf-month-links a[href="/january-2025-convictions/"],
.page-february-2025-convictions .bf-month-links a[href="/february-2025-convictions/"],
.page-march-2025-uk-child-sexual-offence-convictions .bf-month-links a[href="/march-2025-uk-child-sexual-offence-convictions/"]{
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
  text-decoration: none;
}
/* === BF month navigation: dull current page link (robust version) === */

.bf-month-links a{
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* INDEX page (matches any body class containing 'convictions-index') */
body[class*="convictions-index"] .bf-month-links a[href*="/uk-convictions-index/"],
body[class*="convictions-index"] .bf-month-links a[href^="https://frankawareness.com/uk-convictions-index/"]{
  opacity: .45 !important;
  pointer-events: none !important;
  cursor: default !important;
  text-decoration: none !important;
}

/* JAN page (matches any body class containing 'january-2025') */
body[class*="january-2025"] .bf-month-links a[href*="/january-2025"],
body[class*="january-2025"] .bf-month-links a[href^="https://frankawareness.com/january-2025"]{
  opacity: .45 !important;
  pointer-events: none !important;
  cursor: default !important;
  text-decoration: none !important;
}

/* FEB page (matches any body class containing 'february-2025') */
body[class*="february-2025"] .bf-month-links a[href*="/february-2025"],
body[class*="february-2025"] .bf-month-links a[href^="https://frankawareness.com/february-2025"]{
  opacity: .45 !important;
  pointer-events: none !important;
  cursor: default !important;
  text-decoration: none !important;
}

/* MARCH page (matches any body class containing 'march-2025') */
body[class*="march-2025"] .bf-month-links a[href*="/march-2025"],
body[class*="march-2025"] .bf-month-links a[href^="https://frankawareness.com/march-2025"]{
  opacity: .45 !important;
  pointer-events: none !important;
  cursor: default !important;
  text-decoration: none !important;
}
/* ===== BF CASE CARDS (site-wide) ===== */
body { overflow-x: hidden; }

.bf-case-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:18px;
  margin:16px auto;
  max-width:900px;
  width:calc(100% - 32px);
  box-sizing:border-box;
  box-shadow:0 8px 22px rgba(0,0,0,0.06);
  position:relative;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.bf-top{
  position:absolute;
  top:12px;
  right:12px;
  font-size:0.8rem;
  letter-spacing:0.08em;
  text-transform:uppercase;
}
.bf-top a{ text-decoration:none; color:#6b7280; }
.bf-top a:hover{ text-decoration:underline; }

.bf-case-head{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding-right:68px;
}

.bf-dot{
  width:12px;
  height:12px;
  border-radius:50%;
  margin-top:10px;
  flex:0 0 12px;
}

.bf-sev-red .bf-dot{ background:#b91c1c; }
.bf-sev-orange .bf-dot{ background:#f97316; }
.bf-sev-yellow .bf-dot{ background:#eab308; }

.bf-case-card:not(.bf-sev-red):not(.bf-sev-orange):not(.bf-sev-yellow) .bf-dot{
  background:#b91c1c;
}

h3.bf-title{
  margin:0;
  font-size:1.25rem;
  line-height:1.25;
  font-weight:750;
  color:#111;
}

.bf-summary{
  margin:0.8rem 0 0;
  color:#374151;
  line-height:1.65;
  font-size:1rem;
}

.bf-meta{
  margin:0.8rem 0 0;
  font-size:0.95rem;
  color:#111;
}

.bf-source{
  margin:0.9rem 0 0;
  padding-top:0.85rem;
  border-top:1px dashed #e5e7eb;
  font-size:0.95rem;
}

.bf-source a{
  color:#111;
  text-decoration:underline;
  overflow-wrap:anywhere;
  word-break:break-word;
}
/* ===== CARD GRID LAYOUT ===== */
.bf-cases-grid{
  display:grid;
  grid-template-columns: 1fr;  /* mobile: 1 column */
  gap: 18px;
  max-width: 1200px;          /* overall page width for the grid */
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

/* remove card's auto-centering when inside grid */
.bf-cases-grid .bf-case-card{
  margin: 0;                  /* grid handles spacing */
  width: 100%;
  max-width: none;
}

/* desktop: 2 columns */
@media (min-width: 900px){
  .bf-cases-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    padding: 0 18px;
  }
}

/* extra wide: 3 columns */
@media (min-width: 1300px){
  .bf-cases-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 1500px;
  }
}
/* ===== FORCE GRID TO CENTER + USE FULL WIDTH ===== */
.bf-cases-grid{
  width: 100%;
  max-width: 1500px;     /* overall grid width */
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

/* Ensure cards fill their grid cells */
.bf-cases-grid .bf-case-card{
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

/* Desktop 2-col */
@media (min-width: 900px){
  .bf-cases-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    padding-left: 18px;
    padding-right: 18px;
  }
}

/* Extra-wide 3-col */
@media (min-width: 1300px){
  .bf-cases-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
/* If theme constrains content width or left-aligns container */
.entry-content .bf-cases-grid,
.wp-block-group__inner-container .bf-cases-grid,
.page-content .bf-cases-grid{
  margin-left: auto !important;
  margin-right: auto !important;
}
/* ===== BREAK OUT OF THE THEME CONTENT COLUMN (Classic Editor safe) ===== */
    /* we’re centering via transform */
  padding: 0 16px;
  box-sizing: border-box;
}
/* ===== HARD RESET FOR GRID ALIGNMENT ===== */

/* Neutralise theme alignment */
.entry-content,
.entry-content *{
  text-align: initial;
}

/* Force grid to center itself */
.bf-cases-grid{
  display: grid !important;
  justify-content: center !important;
  align-content: start;
  width: 100%;
  max-width: 1500px;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}

/* Grid columns */
.bf-cases-grid{
  grid-template-columns: 1fr;
  gap: 18px;
}

@media (min-width: 900px){
  .bf-cases-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1300px){
  .bf-cases-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Force cards to fill grid cells */
.bf-cases-grid > section{
  justify-self: stretch !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}
/* ===== FORCE THE WRAPPER TO STRETCH EVEN INSIDE FLEX PARENTS ===== */
.bf-cases-outer{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  margin:0 !important;
  padding:0 !important;

  /* flex-parent protection */
  flex: 0 0 100% !important;
  align-self: stretch !important;
  justify-self: stretch !important;
}

/* Center the grid inside the stretched wrapper */
.bf-cases-grid{
  width:100% !important;
  max-width:1500px !important;
  margin-left:auto !important;
  margin-right:auto !important;
}
/* Allow Classic Editor content to respect alignwide / alignfull */
.alignwide,
.alignfull{
  width: 100%;
  max-width: none;
}

/* Center grid inside wide/full container */
.alignwide .bf-cases-grid,
.alignfull .bf-cases-grid{
  margin-left: auto !important;
  margin-right: auto !important;
}
/* =========================================================
   BF — JAN 2026 OVERRIDES (PAGE ONLY)
   Replace 2936 if your page id differs
   ========================================================= */

.page-id-2936 .bf-cases-outer{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  margin:0 auto !important;
  padding:0 !important;
  text-align:left !important;

  /* if parent is flex and pushing right */
  flex: 0 0 100% !important;
  align-self: stretch !important;
}

.page-id-2936 .bf-cases-grid{
  /* live inside the theme column cleanly */
  display:grid !important;
  grid-template-columns: 1fr !important;
  gap:18px !important;

  width:100% !important;
  max-width:100% !important;
  margin: 0 auto !important;
  padding: 0 !important;

  justify-items: stretch !important;
  align-items: start !important;
}

@media (min-width: 900px){
  .page-id-2936 .bf-cases-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Force cards to behave as proper grid items */
.page-id-2936 .bf-cases-grid > section.bf-case-card{
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
  box-sizing:border-box !important;
}
/* =========================================================
   BF — JANUARY 2026 FINAL GRID OVERRIDE
   Slug-based (guaranteed to match this page)
   ========================================================= */

body.page-january-2026-uk-child-sexual-offence-convictions .bf-cases-grid{
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 18px !important;

  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 16px !important;
  box-sizing: border-box !important;

  justify-items: stretch !important;
  align-items: start !important;
}

/* Desktop: 2 columns */
@media (min-width: 900px){
  body.page-january-2026-uk-child-sexual-offence-convictions .bf-cases-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 20px !important;
    padding: 0 18px !important;
  }
}

/* Wide screens: 3 columns */
@media (min-width: 1300px){
  body.page-january-2026-uk-child-sexual-offence-convictions .bf-cases-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    max-width: 1500px !important;
  }
}

/* CRITICAL: override the global centred-card rule */
body.page-january-2026-uk-child-sexual-offence-convictions
.bf-cases-grid .bf-case-card{
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}
/* =========================================================
   BF — FORCE FULL-WIDTH POST CONTENT (JAN 2026)
   This removes the right-aligned content column
   ========================================================= */

body.page-january-2026-uk-child-sexual-offence-convictions
.wp-site-blocks > .wp-block-post-content{
  max-width: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
/* =========================================================
   BF — JAN 2026: FORCE THEME WRAPPERS TO STOP RIGHT-ALIGNING
   ========================================================= */

body.page-january-2026-uk-child-sexual-offence-convictions .bf-cases-outer{
  width: 100% !important;
  max-width: 1500px !important;
  margin: 0 auto !important;      /* <-- IMPORTANT (overrides your margin:0) */
  padding: 0 !important;
  display: block !important;
}

/* Block-theme wrappers sometimes behave like flex and push content right */
body.page-january-2026-uk-child-sexual-offence-convictions .wp-block-post-content{
  display: block !important;       /* kills flex behaviour if the theme is using it */
}

/* Center every direct child of the post content (including your grid wrappers) */
body.page-january-2026-uk-child-sexual-offence-convictions .wp-block-post-content > *{
  margin-left: auto !important;
  margin-right: auto !important;
}
/* =========================================
   BF26 ONLY — restrict to RED + ORANGE
   (Yellow treated as orange)
========================================= */

section[id^="BF26-"].bf-sev-yellow .bf-dot{
  background:#f97316 !important; /* orange */
}
/* =========================================
   BF26 ONLY — CARD GRID LAYOUT
   Mobile: 1 column
   Desktop: 2 columns
========================================= */

/* Wrapper that already exists around BF26 cards */
.bf-jan-wrap{
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

/* Desktop: 2 columns */
@media (min-width: 900px){
  .bf-jan-wrap{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Ensure BF26 cards never overflow */
section[id^="BF26-"]{
  max-width: 100%;
  box-sizing: border-box;
}
/* =========================================
   BF26 ONLY — SINGLE COLUMN (ALL SCREENS)
========================================= */

.bf-jan-wrap{
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

/* Safety: prevent overflow */
section[id^="BF26-"]{
  max-width: 100%;
  box-sizing: border-box;
}
/* Global page breathing room */
body {
  overflow-x: hidden;
}

.wp-site-blocks,
.wp-site-blocks > * {
  padding-left: 16px;
  padding-right: 16px;
}

/* Wider screens = nicer spacing */
@media (min-width: 768px) {
  .wp-site-blocks,
  .wp-site-blocks > * {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (min-width: 1200px) {
  .wp-site-blocks,
  .wp-site-blocks > * {
    padding-left: 32px;
    padding-right: 32px;
  }
}
