/*
Theme Name: BBGK
Theme URI: https://ahsshohelahmed.com/
Author: AHS Shohel Ahmed
Author URI: https://ahsshohelahmed.com/ahs-shohel-ahmed/
Description: BBGK (Beyond Boundaries Global Knowledge) - a fast, AI-ready editorial theme. Design system derived from the Homepage 2026 and About Me templates.
Version: 2.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bbgk
Tags: editorial, blog, clean, accessibility-ready, custom-logo
*/

/* ══════════════════════════════════════════════════════════════
   1. TOKENS
   ══════════════════════════════════════════════════════════════ */
:root {
  --bg: #FAFAF7;
  --bg-alt: #F2F0EB;
  --bg-warm: #F7F5F0;
  --ink: #1A1A18;
  --ink-secondary: #4A4A45;
  --ink-muted: #7A7A72;
  --accent: #B8860B;
  --accent-hover: #9A7209;
  --rule: #D4D0C8;
  --rule-heavy: #1A1A18;
  --white: #FFFFFF;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --max-width: 1200px;
  --measure: 780px;
  --gutter: 24px;
}

/* ══════════════════════════════════════════════════════════════
   2. RESET + BASE
   ══════════════════════════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  border-top: 3px solid var(--accent);
  overflow-wrap: break-word;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, .skip-link:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
img, svg, video, iframe { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); }

.bbgk-wrap { max-width: var(--max-width); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--ink); color: var(--bg); padding: 10px 18px; font-size: 0.85rem;
}
.skip-link:focus { left: 0; }

/* ══════════════════════════════════════════════════════════════
   3. HEADER / NAV  (Inversion mark: BB white on gold, GK ink)
   ══════════════════════════════════════════════════════════════ */
.site-header { position: relative; z-index: 50; }
.nav {
  max-width: var(--max-width); margin: 0 auto;
  padding: 26px var(--gutter) 18px;
  display: flex; justify-content: space-between; align-items: center; gap: 32px;
}

/* Brand */
.nav-brand { display: flex; flex-direction: column; gap: 7px; flex-shrink: 0; }
.brand-mark {
  display: flex; align-items: center; gap: 4px;
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700;
  letter-spacing: 0.04em; line-height: 1;
}
.brand-mark-bb { background: var(--accent); color: var(--white); padding: 7px 9px 6px; border-radius: 0; }
.brand-mark-gk { color: var(--ink); padding: 7px 0 6px; }
.nav-brand-tag {
  font-family: var(--font-mono); font-size: 0.62rem;
  letter-spacing: 0.17em; text-transform: uppercase; color: var(--ink-muted);
}

/* Desktop menu */
.nav-primary { display: block; }
.nav-links { display: flex; gap: 34px; list-style: none; align-items: center; }
.nav-links li { list-style: none; position: relative; }
.nav-links > li > a {
  display: block; padding: 8px 0;
  font-size: 0.85rem; font-weight: 500; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink-secondary); transition: color 0.2s;
}
.nav-links a:hover,
.nav-links .current-menu-item > a,
.nav-links .current-menu-ancestor > a { color: var(--accent); }

/* Dropdown caret */
.nav-links .menu-item-has-children > a::after,
.nav-links .page_item_has_children > a::after {
  content: ""; display: inline-block; margin-left: 7px; vertical-align: 2px;
  border-left: 3.5px solid transparent; border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor; opacity: 0.55; transition: transform 0.2s;
}
.nav-links li:hover > a::after { transform: rotate(180deg); }

/* Dropdown panel */
.nav-links .sub-menu, .nav-links .children {
  position: absolute; top: 100%; left: -18px; min-width: 232px;
  list-style: none; margin: 0; padding: 8px 0;
  background: var(--white); border: 1px solid var(--rule);
  box-shadow: 0 12px 32px rgba(26,26,24,0.09);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 60;
}
.nav-links li:hover > .sub-menu,
.nav-links li:focus-within > .sub-menu,
.nav-links li:hover > .children,
.nav-links li:focus-within > .children {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-links .sub-menu li, .nav-links .children li { position: relative; }
.nav-links .sub-menu a, .nav-links .children a {
  display: block; padding: 10px 20px;
  font-size: 0.86rem; font-weight: 400; letter-spacing: 0.01em;
  text-transform: none; color: var(--ink-secondary); line-height: 1.45;
  border-left: 2px solid transparent; transition: all 0.18s;
}
.nav-links .sub-menu a:hover, .nav-links .children a:hover {
  background: var(--bg-warm); border-left-color: var(--accent); color: var(--ink);
}

/* Hamburger */
.nav-toggle {
  display: none; align-items: center; gap: 10px;
  background: none; border: 1px solid var(--rule); border-radius: 0;
  padding: 10px 14px; cursor: pointer; color: var(--ink);
  font-family: var(--font-mono); font-size: 0.64rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  transition: border-color 0.2s, color 0.2s;
}
.nav-toggle:hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle-bars { display: inline-flex; flex-direction: column; gap: 3.5px; width: 17px; }
.nav-toggle-bars span { display: block; height: 2px; background: currentColor; }

.nav-rule { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gutter); }
.nav-rule hr { border: none; border-top: 2px solid var(--rule-heavy); }

/* ══════════════════════════════════════════════════════════════
   3b. OFFCANVAS DRAWER
   ══════════════════════════════════════════════════════════════ */
html.bbgk-nav-open { overflow: hidden; }
.offcanvas { position: fixed; inset: 0; z-index: 200; }
.offcanvas[hidden] { display: none; }
.offcanvas-overlay {
  position: absolute; inset: 0; background: rgba(26,26,24,0.5);
  opacity: 0; transition: opacity 0.3s ease; cursor: pointer;
}
.offcanvas.is-open .offcanvas-overlay { opacity: 1; }
.offcanvas-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(380px, 88vw); background: var(--bg);
  border-left: 3px solid var(--accent);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto; overscroll-behavior: contain;
}
.offcanvas.is-open .offcanvas-panel { transform: translateX(0); }

.offcanvas-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px var(--gutter); border-bottom: 2px solid var(--rule-heavy); flex-shrink: 0;
}
.offcanvas-close {
  background: none; border: none; cursor: pointer; color: var(--ink-muted);
  font-size: 1.9rem; line-height: 1; padding: 0 4px; transition: color 0.2s;
}
.offcanvas-close:hover { color: var(--accent); }

.offcanvas-nav { padding: 8px var(--gutter) 0; flex: 1; }
.offcanvas-links, .offcanvas-links ul { list-style: none; margin: 0; padding: 0; }
.offcanvas-links li { position: relative; border-bottom: 1px solid var(--rule); }
.offcanvas-links > li > a {
  display: block; padding: 16px 46px 16px 0;
  font-size: 0.9rem; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--ink); transition: color 0.2s;
}
.offcanvas-links a:hover,
.offcanvas-links .current-menu-item > a { color: var(--accent); }

.offcanvas-sub-toggle {
  position: absolute; top: 8px; right: 0; width: 40px; height: 40px;
  background: none; border: 1px solid var(--rule); cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--ink-secondary);
}
.offcanvas-sub-toggle span[aria-hidden] {
  display: block; width: 8px; height: 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.25s;
}
.offcanvas-sub-toggle[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.offcanvas-sub-toggle[aria-expanded="true"] span[aria-hidden] { transform: rotate(-135deg) translate(-2px, -2px); }

.offcanvas-links .sub-menu, .offcanvas-links .children {
  display: none; padding: 0 0 12px 14px; border-left: 2px solid var(--rule);
  margin-bottom: 6px;
}
.offcanvas-links .is-expanded > .sub-menu,
.offcanvas-links .is-expanded > .children { display: block; }
.offcanvas-links .sub-menu li, .offcanvas-links .children li { border-bottom: none; }
.offcanvas-links .sub-menu a, .offcanvas-links .children a {
  display: block; padding: 9px 0; font-size: 0.86rem; font-weight: 400;
  text-transform: none; letter-spacing: 0; color: var(--ink-secondary);
}

.offcanvas-foot { padding: 24px var(--gutter) 32px; border-top: 1px solid var(--rule); flex-shrink: 0; }
.offcanvas-tag {
  margin-top: 18px; font-family: var(--font-mono); font-size: 0.6rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-muted);
}

/* ══════════════════════════════════════════════════════════════
   4. LAYOUT SHELLS

   One rule governs width everywhere: the CONTAINER sets the width,
   never the content. .entry-content always fills its container.
   ══════════════════════════════════════════════════════════════ */
.site-main { display: block; }

/* Containers — horizontal constraint + gutters, no vertical padding. */
.bbgk-container {
  width: 100%; max-width: var(--max-width);
  margin-inline: auto; padding-inline: var(--gutter);
}
.bbgk-container--narrow { max-width: var(--measure); }
.bbgk-container--wide { max-width: var(--max-width); }

/* Vertical rhythm — applied separately so containers stay composable. */
.bbgk-pad { padding-block: 56px; }
.bbgk-pad-top { padding-top: 56px; }
.bbgk-pad-bottom { padding-bottom: 56px; }

/* Legacy alias kept so nothing breaks. */
.bbgk-section {
  width: 100%; max-width: var(--max-width);
  margin-inline: auto; padding: 56px var(--gutter);
}

/* Sidebar layout */
.layout-sidebar {
  width: 100%; max-width: var(--max-width);
  margin-inline: auto; padding: 56px var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  gap: 64px; align-items: start;
}
.layout-sidebar > * { min-width: 0; }

.section-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin-bottom: 34px; padding-bottom: 14px; border-bottom: 2px solid var(--rule-heavy);
}
.section-title {
  font-family: var(--font-body); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink);
}
.section-sub { font-size: 0.82rem; font-weight: 300; color: var(--ink-muted); }

/* ══════════════════════════════════════════════════════════════
   5. PAGE / POST HEADER
   ══════════════════════════════════════════════════════════════ */
.page-hero { padding-top: 56px; }
.page-hero-inner { max-width: 100%; }
.entry-eyebrow {
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px;
}
.entry-title {
  font-family: var(--font-display); font-size: 2.6rem; font-weight: 700;
  line-height: 1.12; letter-spacing: -0.015em;
  position: relative; padding-bottom: 20px; margin-bottom: 18px;
}
.entry-title::after { content: ""; position: absolute; left: 2px; bottom: 0; width: 56px; height: 3px; background: var(--accent); }
.entry-title a { transition: color 0.2s; }
.entry-title a:hover { color: var(--accent); }
.entry-lede { font-size: 1.05rem; font-weight: 300; line-height: 1.75; color: var(--ink-secondary); }
.entry-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-muted); margin-top: 16px;
}
.entry-meta a { color: var(--accent-hover); }
.entry-meta a:hover { color: var(--ink); }
.entry-meta-dot { color: var(--rule); }
.entry-thumb { margin: 36px 0 0; }
.entry-thumb img { width: 100%; height: auto; }

/* Breadcrumb */
.bbgk-breadcrumb {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-muted); margin-bottom: 18px;
}
.bbgk-breadcrumb a { color: var(--ink-secondary); }
.bbgk-breadcrumb a:hover { color: var(--accent); }
.bbgk-breadcrumb span[aria-hidden] { color: var(--rule); padding: 0 6px; }

/* ══════════════════════════════════════════════════════════════
   6. CONTENT TYPOGRAPHY (the_content)
   ══════════════════════════════════════════════════════════════ */
/* Content fills its container — width is the container's job, not the
   content's. This is what stops the double-constraint problem. */
.entry-content { max-width: 100%; font-size: 1.02rem; font-weight: 300; line-height: 1.8; color: var(--ink-secondary); }
.entry-content > * + * { margin-top: 1.35em; }
.entry-content p { margin: 0; }
.entry-content strong, .entry-content b { font-weight: 600; color: var(--ink); }
.entry-content h2 {
  font-family: var(--font-display); font-size: 1.75rem; font-weight: 700;
  color: var(--ink); line-height: 1.25; margin-top: 2em; padding-bottom: 10px;
  border-bottom: 2px solid var(--rule-heavy);
}
.entry-content h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--ink); margin-top: 1.8em; }
.entry-content h4 {
  font-family: var(--font-body); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); margin-top: 1.6em;
}
.entry-content a { color: var(--accent-hover); border-bottom: 1px solid rgba(184,134,11,0.35); transition: border-color 0.2s; }
.entry-content a:hover { border-color: var(--accent-hover); }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li + li { margin-top: 0.5em; }
.entry-content li::marker { color: var(--accent); }
.entry-content blockquote {
  border-left: 3px solid var(--accent); background: var(--bg-warm);
  padding: 22px 28px; font-family: var(--font-display); font-size: 1.15rem;
  font-style: italic; color: var(--ink); line-height: 1.6;
}
.entry-content blockquote p + p { margin-top: 0.8em; }
.entry-content pre {
  background: var(--ink); color: var(--bg); padding: 20px 22px;
  overflow-x: auto; font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.6;
}
.entry-content code { font-family: var(--font-mono); font-size: 0.88em; background: var(--bg-alt); padding: 2px 5px; }
.entry-content pre code { background: none; padding: 0; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.entry-content th, .entry-content td { border: 1px solid var(--rule); padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--bg-alt); font-weight: 600; color: var(--ink); }
.entry-content hr { border: none; border-top: 1px solid var(--rule); }
.entry-content figcaption { font-size: 0.78rem; color: var(--ink-muted); margin-top: 8px; font-family: var(--font-mono); letter-spacing: 0.04em; }
.entry-content .read-more {
  display: inline-block; margin-top: 24px; font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--bg);
  background: var(--ink); padding: 13px 26px; border: none; transition: background 0.2s;
}
.entry-content .read-more:hover { background: var(--accent); color: var(--bg); }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { margin-left: auto; margin-right: auto; }

/* Breakout: let wide/full blocks escape the gutter on the full-width template. */
.alignwide { max-width: none; }
.layout-full .entry-content > .alignfull {
  width: 100vw; max-width: 100vw;
  margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw);
}

/* Footer of a single entry */
.entry-footer {
  margin-top: 40px; padding-top: 22px;
  border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.entry-tag {
  font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent-hover);
  border: 1px solid rgba(184,134,11,0.35); padding: 4px 9px; transition: all 0.2s;
}
.entry-tag:hover { background: var(--accent); color: var(--white); border-color: var(--accent); }

/* Post navigation */
.post-nav {
  width: 100%; max-width: var(--max-width);
  margin-inline: auto; padding: 0 var(--gutter) 56px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
.post-nav a { display: block; border-top: 2px solid var(--rule-heavy); padding-top: 16px; }
.post-nav-label { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.post-nav-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; line-height: 1.35; color: var(--ink); transition: color 0.2s; }
.post-nav a:hover .post-nav-title { color: var(--accent); }
.post-nav .next { text-align: right; }

/* ══════════════════════════════════════════════════════════════
   7. ARCHIVE / LOOP
   ══════════════════════════════════════════════════════════════ */
.archive-hero { padding-top: 56px; }
.archive-title { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 12px; }
.archive-desc { font-size: 0.98rem; font-weight: 300; color: var(--ink-secondary); max-width: 620px; line-height: 1.7; }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 36px; }
.layout-sidebar .post-grid { grid-template-columns: repeat(2, 1fr); }
.post-card { display: flex; flex-direction: column; border-top: 2px solid var(--rule-heavy); padding-top: 18px; }
.post-card-thumb { margin-bottom: 16px; overflow: hidden; }
.post-card-thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform 0.4s ease; }
.post-card:hover .post-card-thumb img { transform: scale(1.03); }
.post-card-date { font-family: var(--font-mono); font-size: 0.63rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 8px; }
.post-card-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; line-height: 1.35; margin-bottom: 8px; }
.post-card-title a { transition: color 0.2s; }
.post-card:hover .post-card-title a { color: var(--accent); }
.post-card-excerpt { font-size: 0.86rem; font-weight: 300; line-height: 1.6; color: var(--ink-muted); }
.post-card-more {
  display: inline-block; margin-top: 12px; font-family: var(--font-mono);
  font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent);
}

/* Pagination */
.bbgk-pagination { width: 100%; max-width: var(--max-width); margin-inline: auto; padding: 0 var(--gutter) 56px; }
.bbgk-pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.bbgk-pagination .page-numbers {
  display: inline-block; min-width: 40px; text-align: center;
  padding: 9px 12px; border: 1px solid var(--rule);
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-secondary);
  text-transform: none; letter-spacing: 0.04em; transition: all 0.2s;
}
.bbgk-pagination .page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.bbgk-pagination .page-numbers.current { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ══════════════════════════════════════════════════════════════
   8. SIDEBAR + WIDGETS
   ══════════════════════════════════════════════════════════════ */
.bbgk-sidebar { position: sticky; top: 24px; }
.widget { margin-bottom: 36px; }
.widget:last-child { margin-bottom: 0; }
.widget-title {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--rule);
}
.widget ul { list-style: none; }
.widget li { padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 0.88rem; color: var(--ink-secondary); line-height: 1.5; }
.widget li:last-child { border-bottom: none; }
.widget a:hover { color: var(--accent); }

/* Search form */
.search-form .search-input { display: flex; border: 1px solid var(--rule); background: var(--white); }
.search-form input[type="search"], .search-form input[type="text"] {
  flex: 1; border: none; background: none; padding: 12px 14px;
  font-family: var(--font-body); font-size: 0.9rem; color: var(--ink); min-width: 0;
}
.search-form input::placeholder { color: var(--ink-muted); }
.search-form button {
  border: none; background: var(--ink); color: var(--bg); cursor: pointer;
  padding: 0 18px; font-family: var(--font-mono); font-size: 0.66rem;
  letter-spacing: 0.1em; text-transform: uppercase; transition: background 0.2s;
}
.search-form button:hover { background: var(--accent); }

/* ══════════════════════════════════════════════════════════════
   9. STATES: 404 / no results
   ══════════════════════════════════════════════════════════════ */
.bbgk-state { width: 100%; max-width: var(--measure); margin-inline: auto; padding: 88px var(--gutter); text-align: left; }
.bbgk-state-code { font-family: var(--font-mono); font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
.bbgk-state-title { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 14px; }
.bbgk-state-text { font-size: 1rem; font-weight: 300; color: var(--ink-secondary); line-height: 1.7; margin-bottom: 26px; }
.bbgk-state form { max-width: 420px; }

/* ══════════════════════════════════════════════════════════════
   10. BUTTONS
   ══════════════════════════════════════════════════════════════ */
.cta-primary {
  display: inline-block; font-family: var(--font-body); font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--bg);
  background: var(--ink); padding: 14px 28px; border: none; cursor: pointer; transition: background 0.2s;
}
.cta-primary:hover { background: var(--accent); color: var(--bg); }
.cta-secondary {
  display: inline-block; font-family: var(--font-mono); font-size: 0.76rem;
  letter-spacing: 0.06em; color: var(--accent-hover); padding: 14px 4px; transition: color 0.2s;
}
.cta-secondary:hover { color: var(--ink); }

/* ══════════════════════════════════════════════════════════════
   10b. CONTACT FORM  ([bbgk_contact_form])
   ══════════════════════════════════════════════════════════════ */
.bbgk-form-wrap { max-width: 640px; }
.entry-content .bbgk-form-wrap { margin-top: 8px; }
.bbgk-form { margin: 0; }
.bbgk-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.bbgk-field { margin: 0 0 20px; display: block; }
.bbgk-field-row .bbgk-field { margin-bottom: 20px; }
.bbgk-field label {
  display: block; font-family: var(--font-mono); font-size: 0.62rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-secondary); margin-bottom: 8px;
}
.bbgk-req { color: var(--accent); }
.bbgk-field input[type="text"],
.bbgk-field input[type="email"],
.bbgk-field select,
.bbgk-field textarea {
  width: 100%; display: block;
  background: var(--white); border: 1px solid var(--rule); border-radius: 0;
  padding: 13px 14px; font-family: var(--font-body); font-size: 0.95rem;
  color: var(--ink); line-height: 1.55; transition: border-color 0.2s;
  -webkit-appearance: none; appearance: none;
}
.bbgk-field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%), linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 40px;
}
.bbgk-field textarea { resize: vertical; min-height: 150px; }
.bbgk-field input:focus, .bbgk-field select:focus, .bbgk-field textarea:focus {
  border-color: var(--accent); outline: none; box-shadow: inset 0 0 0 1px var(--accent);
}
.bbgk-field input:user-invalid, .bbgk-field textarea:user-invalid { border-color: #B03A2E; }

/* Honeypot — off-screen, never display:none (bots skip hidden fields) */
.bbgk-hp { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; overflow: hidden; }

.bbgk-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin: 4px 0 0; }
.bbgk-form-note { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.06em; color: var(--ink-muted); }

.bbgk-notice { padding: 18px 22px; margin-bottom: 28px; font-size: 0.92rem; line-height: 1.65; }
.bbgk-notice p { margin: 0 0 6px; }
.bbgk-notice ul { margin: 0; padding-left: 1.2em; }
.bbgk-notice li { margin-top: 4px; }
.bbgk-notice-ok { background: var(--bg-warm); border-left: 3px solid var(--accent); color: var(--ink-secondary); }
.bbgk-notice-err { background: #FBF0EE; border-left: 3px solid #B03A2E; color: #7A2C22; }

@media (max-width: 560px) {
  .bbgk-field-row { grid-template-columns: 1fr; gap: 0; }
}

/* ══════════════════════════════════════════════════════════════
   11. FOOTER
   ══════════════════════════════════════════════════════════════ */
.footer { background: var(--bg-alt); border-top: 1px solid var(--rule); padding: 40px 0; margin-top: 8px; }
.footer-widgets {
  max-width: var(--max-width); margin: 0 auto 32px; padding: 0 var(--gutter);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px;
}
.footer-widgets:empty { display: none; }
.footer-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
}
.footer-brand-mark {
  display: flex; align-items: center; gap: 3px;
  font-family: var(--font-display); font-size: 1rem; font-weight: 700;
  letter-spacing: 0.05em; line-height: 1; margin-bottom: 6px;
}
.footer-brand-mark .brand-mark-bb { padding: 4px 5px 3px; font-size: 1rem; }
.footer-copy { font-size: 0.75rem; color: var(--ink-muted); }
.footer-links { display: flex; gap: 28px; list-style: none; flex-wrap: wrap; }
.footer-links li { list-style: none; }
.footer-links a { font-size: 0.8rem; font-weight: 500; color: var(--ink-secondary); transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }

/* ══════════════════════════════════════════════════════════════
   11b. ARTICLE COMPONENTS
   Ported from the retiring Personalio theme and rebuilt on the
   BBGK token set: category link, deck, image caption, framework
   box, FAQ, author box, related band, subscribe band.
   ══════════════════════════════════════════════════════════════ */

/* Category eyebrow becomes a link */
.entry-eyebrow a { color: inherit; transition: color 0.2s; }
.entry-eyebrow a:hover { color: var(--ink); }

/* Deck / subtitle under the title */
.entry-subtitle {
  font-family: var(--font-display); font-size: 1.3rem; font-style: italic;
  font-weight: 400; line-height: 1.5; color: var(--ink-secondary); max-width: 640px;
}

/* Featured image caption */
.entry-thumb-caption {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.06em;
  color: var(--ink-muted); margin-top: 10px; padding-left: 2px;
}

/* ── Framework box ────────────────────────────────────────── */
.bbgk-framework {
  background: var(--bg-warm); border-left: 3px solid var(--accent);
  padding: 30px 32px; margin: 40px 0;
}
.bbgk-framework-label {
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.bbgk-framework-title {
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 700;
  line-height: 1.25; margin-bottom: 22px;
}
.bbgk-framework-tier { padding: 18px 0; border-top: 1px solid var(--rule); }
.bbgk-framework-tier:first-of-type { border-top: none; padding-top: 0; }
.bbgk-framework-tier:last-child { padding-bottom: 0; }
.bbgk-framework-tier-name {
  font-family: var(--font-mono); font-size: 0.66rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 6px;
}
.bbgk-framework-tier-title {
  font-family: var(--font-display); font-size: 1.08rem; font-weight: 600;
  line-height: 1.3; color: var(--ink); margin-bottom: 6px;
}
.bbgk-framework-tier-desc { font-size: 0.95rem; line-height: 1.7; color: var(--ink-secondary); }

/* ── FAQ ──────────────────────────────────────────────────── */
.bbgk-faq { margin-top: 52px; padding-top: 36px; border-top: 1px solid var(--rule); }
.bbgk-faq-heading {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 700;
  line-height: 1.2; margin-bottom: 26px;
}
.bbgk-faq-item { padding: 22px 0; border-top: 1px solid var(--rule); }
.bbgk-faq-item:first-of-type { border-top: none; padding-top: 0; }
.bbgk-faq-q {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 600;
  line-height: 1.35; color: var(--ink); margin-bottom: 9px;
}
.bbgk-faq-a { font-size: 0.98rem; line-height: 1.75; color: var(--ink-secondary); }
.bbgk-faq-a p { margin: 0 0 0.85em; }
.bbgk-faq-a p:last-child { margin-bottom: 0; }
.bbgk-faq-a a { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }
.bbgk-faq-a a:hover { color: var(--ink); }

/* ── Author box ───────────────────────────────────────────── */
.bbgk-author {
  margin-top: 52px; padding-top: 34px; border-top: 3px solid var(--rule-heavy);
}
.bbgk-author-inner { display: flex; gap: 24px; align-items: flex-start; }
.bbgk-author-avatar {
  width: 72px; height: auto; flex-shrink: 0; border-radius: 0;
}
.bbgk-author-text { min-width: 0; }
.bbgk-author-label {
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
.bbgk-author-name {
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 700;
  line-height: 1.25; margin-bottom: 10px;
}
.bbgk-author-name a { transition: color 0.2s; }
.bbgk-author-name a:hover { color: var(--accent); }
.bbgk-author-bio { font-size: 0.95rem; line-height: 1.75; color: var(--ink-secondary); max-width: 58ch; }
.bbgk-author-more { padding-left: 0; padding-bottom: 0; }

/* ── Related reading band ─────────────────────────────────── */
.bbgk-related { background: var(--bg-alt); border-top: 1px solid var(--rule); margin-top: 64px; padding: 54px 0; }
.bbgk-related-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gutter); }
.bbgk-related-label {
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); margin-bottom: 26px;
}
.bbgk-related-list { display: grid; gap: 0; }
.bbgk-related-item {
  display: block; padding: 22px 0; border-top: 1px solid var(--rule);
  transition: padding-left 0.2s, border-color 0.2s;
}
.bbgk-related-item:first-child { border-top: none; padding-top: 0; }
.bbgk-related-item:last-child { padding-bottom: 0; }
.bbgk-related-item:hover { padding-left: 10px; }
.bbgk-related-item-title {
  display: block; font-family: var(--font-display); font-size: 1.15rem;
  font-weight: 600; line-height: 1.3; color: var(--ink); transition: color 0.2s;
}
.bbgk-related-item:hover .bbgk-related-item-title { color: var(--accent); }
.bbgk-related-item-desc {
  display: block; font-size: 0.92rem; line-height: 1.65;
  color: var(--ink-secondary); margin-top: 6px; max-width: 70ch;
}

/* ── Subscribe band ───────────────────────────────────────── */
.subscribe {
  background: var(--ink); color: var(--bg);
  padding: 62px var(--gutter); text-align: center; margin-top: 8px;
}
.bbgk-related + .subscribe { margin-top: 0; }
.subscribe-inner { max-width: 620px; margin: 0 auto; }
.subscribe-title {
  font-family: var(--font-display); font-size: 2rem; font-weight: 700;
  line-height: 1.2; color: var(--bg); margin-bottom: 14px;
}
.subscribe-sub { font-size: 1rem; font-weight: 300; line-height: 1.75; color: #C8C6BE; margin-bottom: 28px; }
.subscribe .cta-primary { background: var(--accent); color: var(--white); }
.subscribe .cta-primary:hover { background: var(--white); color: var(--ink); }
.subscribe-note {
  font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-muted); margin-top: 18px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 760px) {
  .entry-subtitle { font-size: 1.12rem; }
  .bbgk-framework { padding: 24px 22px; margin: 32px 0; }
  .bbgk-faq-heading { font-size: 1.35rem; }
  .bbgk-author-inner { flex-direction: column; gap: 16px; }
  .bbgk-related { padding: 42px 0; margin-top: 48px; }
  .bbgk-related-item:hover { padding-left: 0; }
  .subscribe { padding: 46px var(--gutter); }
  .subscribe-title { font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .bbgk-related-item, .bbgk-related-item-title { transition: none; }
  .bbgk-related-item:hover { padding-left: 0; }
}

@media print {
  .bbgk-related, .subscribe { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   12. FLOATING EDIT BUTTON (admins)
   ══════════════════════════════════════════════════════════════ */
.bbgk-edit-btn {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  background: var(--ink); color: var(--white) !important;
  padding: 12px 18px; border-radius: 40px; font-size: 13px; font-weight: 600;
  letter-spacing: 0.03em; box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  transition: background 0.2s, transform 0.2s; line-height: 1;
}
.bbgk-edit-btn:hover { background: var(--accent); transform: translateY(-2px); }

/* ══════════════════════════════════════════════════════════════
   13. RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
/* Nav: swap the desktop bar for the drawer before the links can wrap. */
@media (max-width: 1080px) {
  .nav-primary { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav { padding-top: 20px; padding-bottom: 16px; }
}

@media (max-width: 900px) {
  .layout-sidebar { grid-template-columns: 1fr; gap: 44px; }
  .bbgk-sidebar { position: static; border-top: 1px solid var(--rule); padding-top: 28px; }
  .post-grid, .layout-sidebar .post-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 28px; }
  .entry-title { font-size: 2.1rem; }
  .entry-content h2 { font-size: 1.5rem; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .footer-widgets { grid-template-columns: 1fr; gap: 28px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .bbgk-pad { padding-block: 44px; }
  .bbgk-section, .layout-sidebar { padding-top: 44px; padding-bottom: 44px; }
  .page-hero, .archive-hero { padding-top: 40px; }
}

@media (max-width: 600px) {
  :root { --gutter: 18px; }
  .post-grid, .layout-sidebar .post-grid { grid-template-columns: 1fr; }
  .entry-title { font-size: 1.75rem; }
  .archive-title { font-size: 1.65rem; }
  .entry-content { font-size: 1rem; }
  .entry-content h2 { font-size: 1.35rem; }
  .entry-content h3 { font-size: 1.15rem; }
  .entry-content blockquote { padding: 18px 20px; font-size: 1.05rem; }
  .bbgk-pad { padding-block: 36px; }
  .bbgk-section, .layout-sidebar { padding-top: 36px; padding-bottom: 36px; }
  .page-hero, .archive-hero { padding-top: 32px; }
  .brand-mark { font-size: 1.3rem; }
  .nav-toggle-label { display: none; }
  .nav-toggle { padding: 11px 12px; }
  .bbgk-state { padding-block: 60px; }
}

/* ══════════════════════════════════════════════════════════════
   14. MOTION
   ══════════════════════════════════════════════════════════════ */
@keyframes bbgkFadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.page-hero, .archive-hero { animation: bbgkFadeUp 0.45s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ══════════════════════════════════════════════════════════════
   15. PRINT
   ══════════════════════════════════════════════════════════════ */
@media print {
  .nav, .nav-rule, .footer, .bbgk-sidebar, .post-nav, .bbgk-pagination, .bbgk-edit-btn, .skip-link { display: none !important; }
  body { background: #fff; border-top: none; }
  .entry-content { max-width: none; color: #000; }
}