/* Beathan Technologies Ghost theme
   Tokens lifted from the main site's src/index.css so the blog and the site
   render identically. If the site's tokens change, change them here too. */

:root {
  --bt-primary:        #031B49;  /* hsl(220 91% 15%)  nav + footer ground */
  --bt-primary-dark:   #021231;  /* hsl(220 91% 10%) */
  --bt-accent:         #1E8FFF;  /* hsl(210 100% 56%) links, CTAs */
  --bt-background:     #FAFAFA;  /* hsl(0 0% 98%) */
  --bt-foreground:     #14161A;  /* hsl(220 13% 9%) */
  --bt-muted:          #F3F5F7;  /* hsl(210 20% 96%) */
  --bt-muted-fg:       #667085;  /* hsl(220 13% 46%) */
  --bt-border:         #DDE3E9;  /* hsl(210 20% 89%) */
  --bt-card:           #FFFFFF;

  --bt-radius: 0.75rem;
  --bt-shadow-sm: 0 2px 8px rgba(3, 27, 73, 0.08);
  --bt-shadow-md: 0 8px 24px rgba(3, 27, 73, 0.12);
  --bt-gradient-hero: linear-gradient(135deg, var(--bt-primary) 0%, var(--bt-accent) 100%);

  --bt-font: 'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --bt-font-display: 'Space Grotesk', 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--bt-font);
  background: var(--bt-background);
  color: var(--bt-foreground);
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
}

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

a { color: var(--bt-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

.bt-container { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- header ---------- */
.bt-nav {
  position: sticky;
  /* positioning context for #bt-progress, which hangs off its bottom edge */
  top: 0;
  z-index: 50;
  background: var(--bt-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bt-nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.bt-brand { display: flex; align-items: center; flex-shrink: 0; }

/* Height-constrained, width auto: the asset is 968x368 and must not distort. */
.bt-brand-logo {
  height: 30px;
  width: auto;
  display: block;
}

.bt-nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-left: auto;
}

.bt-nav-links a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.bt-nav-links a:hover { color: #fff; }

.bt-nav-links a.bt-current { color: var(--bt-accent); }

.bt-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.5rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.bt-search:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.bt-search:focus-visible { outline: 2px solid var(--bt-accent); outline-offset: 2px; }

/* Sits directly under the sticky nav. Starts hidden and at scaleX(0); the script
   only reveals it on pages meaningfully taller than the viewport. */
.bt-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--bt-accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .bt-progress { transition: none; }
}

/* Footer brand lockup. The nav uses the wordmark image; the footer still renders
   "Beathan / Technologies" as text, so these rules are load-bearing there even
   though the nav no longer uses them. */
.bt-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.bt-brand-name { font-size: 1.25rem; font-weight: 700; color: #fff; font-family: var(--bt-font-display); }
.bt-brand-sub  { font-size: 0.875rem; color: rgba(255, 255, 255, 0.8); }

@media (max-width: 720px) {
  /* All nav responsive behaviour lives in this one block. flex-wrap is what
     actually prevents overflow on a ~400px screen: without it the links row
     cannot drop below the logo and the nav scrolls sideways. Do not split
     these rules across breakpoints again. */
  .bt-nav-inner { height: auto; min-height: 64px; padding: 0.75rem 1rem; gap: 0.75rem; flex-wrap: wrap; }
  .bt-nav-links { margin-left: 0; width: 100%; }
  .bt-brand-logo { height: 24px; }
  .bt-nav-links { gap: 1rem; }
  .bt-nav-links a { font-size: 0.8125rem; }
}

/* ---------- hero ---------- */
.bt-hero { background: var(--bt-primary); color: #fff; padding: 4rem 0 3.5rem; }
.bt-hero h1 { color: #fff; font-size: 2.75rem; margin: 0 0 0.75rem; }
.bt-hero p { color: rgba(255,255,255,0.78); font-size: 1.125rem; max-width: 42rem; margin: 0; }

/* ---------- post grid ---------- */
/* Single column, not a grid. Few published posts; a dense multi-column image
   grid reads as empty, and the card is built for a wide row. */
.bt-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 3rem 0;
}
.bt-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  background: var(--bt-card);
  border: 1px solid var(--bt-border);
  border-radius: var(--bt-radius);
  overflow: hidden;
  box-shadow: var(--bt-shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.bt-card:hover {
  box-shadow: var(--bt-shadow-md);
  transform: translateY(-2px);
}

.bt-card-media {
  display: block;
  position: relative;
  background: var(--bt-muted);
  min-height: 190px;
}

/* Direct child only. The fallback wordmark is nested inside .bt-card-fallback, and
   a bare `.bt-card-media img` selector (specificity 0,1,1) outranks the wordmark's
   own class rule (0,1,0) - so object-fit:cover won and cropped the logo. */
.bt-card-media > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* The no-image state. Not a placeholder: a branded panel. */
.bt-card-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--bt-gradient-hero);
}

/* The wordmark, and the styling of its own alt text. A broken image renders its alt
   string in place, and these font properties apply to that text, so the fallback of
   the fallback is still on-brand rather than default serif black.
   The position/object-fit reset is required: .bt-card-media img above absolutely
   fills the panel, which would stretch the wordmark edge to edge. */
.bt-card-fallback-logo {
  width: 62%;
  max-width: 190px;
  height: auto;
  object-fit: contain;
  opacity: 0.92;
  font-family: var(--bt-font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: #fff;
  text-align: center;
}

.bt-card-body { padding: 1.75rem; }

.bt-card-body h2 {
  margin: 0.5rem 0 0.625rem;
  font-size: 1.5rem;
}

.bt-card-body h2 a { color: var(--bt-foreground); text-decoration: none; }
.bt-card-body h2 a:hover { color: var(--bt-accent); }

/* One rule only. This class was defined twice - here and again 30 lines below - and
   what shipped was the accidental union of both, since equal specificity means later
   source position wins per property. The pill is kept deliberately; the duplicate is
   gone. tools/check-theme.sh now fails on any class defined more than once. */
.bt-tag {
  display: inline-block;
  align-self: flex-start;
  background: rgba(30, 143, 255, 0.1);
  color: var(--bt-accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  margin-bottom: 0.875rem;
}

.bt-excerpt { margin: 0 0 1rem; color: var(--bt-muted-fg); }

.bt-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--bt-muted-fg);
}

/* Card responsive rules MUST live after the card's base rules. Equal specificity
   means later source position wins, so a media query placed above .bt-card is
   silently overridden by it. That is what happened when these sat in the nav's
   breakpoint block near the top of the file: the phone layout never stacked and
   the card body was clipped, while every grep-based check still passed. */
@media (max-width: 720px) {
  .bt-card { grid-template-columns: 1fr; }
  .bt-card-media { min-height: 170px; }
  .bt-card-body { padding: 1.25rem; }
  .bt-card-body h2 { font-size: 1.25rem; }
}

/* ---------- single post ---------- */
.bt-post { max-width: 720px; margin: 0 auto; padding: 3.5rem 1.5rem 4.5rem; }
.bt-post-header { margin-bottom: 2.5rem; }
.bt-post-header h1 { font-size: clamp(1.875rem, 4vw, 2.75rem); margin: 0 0 1rem; }
.bt-feature-img { border-radius: var(--bt-radius); overflow: hidden; margin-bottom: 2.5rem; box-shadow: var(--bt-shadow-md); }
.bt-content { font-size: 1.0625rem; }
.bt-content h2 { font-size: 1.625rem; margin: 2.5rem 0 1rem; }
.bt-content h3 { font-size: 1.3125rem; margin: 2rem 0 0.75rem; }
.bt-content p { margin: 0 0 1.375rem; }
.bt-content img { border-radius: var(--bt-radius); margin: 2rem 0; }
.bt-content blockquote {
  margin: 2rem 0; padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 3px solid var(--bt-accent); color: var(--bt-muted-fg);
}
.bt-content pre {
  background: var(--bt-primary); color: #E8EEF7; padding: 1.25rem;
  border-radius: var(--bt-radius); overflow-x: auto; font-size: 0.875rem;
}
.bt-content code { font-family: ui-monospace, 'Cascadia Code', Menlo, monospace; font-size: 0.9em; }
.bt-content :not(pre) > code {
  background: var(--bt-muted); padding: 0.15em 0.4em; border-radius: 4px; color: var(--bt-primary);
}
.bt-content table { width: 100%; border-collapse: collapse; margin: 2rem 0; }
.bt-content th, .bt-content td { border: 1px solid var(--bt-border); padding: 0.625rem 0.875rem; text-align: left; }
.bt-content th { background: var(--bt-muted); font-weight: 600; }

/* ---------- CTA back to the main site ---------- */
.bt-cta {
  background: var(--bt-gradient-hero); color: #fff; border-radius: var(--bt-radius);
  padding: 2.5rem; margin: 3.5rem auto 4rem; max-width: 720px;
}
.bt-cta h2 { color: #fff; margin: 0 0 0.625rem; font-size: 1.5rem; }
.bt-cta p { color: rgba(255,255,255,0.8); margin: 0 0 1.5rem; }
.bt-btn {
  display: inline-block; color: #fff;
  padding: 0.75rem 1.75rem; border-radius: 0.5rem; font-weight: 600;
  transition: transform .2s, box-shadow .2s, background .15s, color .15s;
}

/* Used on the 404 page, which has no variant class on its button. */
.bt-btn:not(.bt-btn-primary):not(.bt-btn-ghost) { background: var(--bt-accent); }
.bt-btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--bt-shadow-md); }

/* Post header meta and the byline. No avatar element is emitted: the only author
   has no profile image, and an empty circle reads as a broken asset. */
.bt-post-standfirst {
  margin: 1rem 0 0;
  font-size: 1.1875rem;
  color: var(--bt-muted-fg);
  line-height: 1.6;
}

.bt-post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--bt-muted-fg);
}

.bt-byline { font-weight: 600; color: var(--bt-foreground); }

.bt-feature-image {
  width: 100%;
  height: auto;
  border-radius: var(--bt-radius);
  margin: 1rem 0 2rem;
  display: block;
}

.bt-cta-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* These two must stay BELOW .bt-btn: they are single-class selectors of equal
   specificity, so they win on source order alone. Moving them above it silently
   reverts both buttons to the base style. */
.bt-btn-primary { background: #fff; color: var(--bt-primary); }
.bt-btn-primary:hover { background: rgba(255, 255, 255, 0.88); }

.bt-btn-ghost { border: 1px solid rgba(255, 255, 255, 0.55); color: #fff; }
.bt-btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

@media (max-width: 720px) {
  .bt-btn { width: 100%; text-align: center; }
}

/* ---------- pagination ---------- */
.bt-pagination { display: flex; justify-content: center; gap: 1rem; align-items: center; padding-bottom: 4rem; }
.bt-pagination a {
  border: 1px solid var(--bt-border); background: var(--bt-card);
  padding: 0.625rem 1.25rem; border-radius: 0.5rem; color: var(--bt-foreground); font-weight: 500;
}
.bt-pagination a:hover { border-color: var(--bt-accent); color: var(--bt-accent); text-decoration: none; }
.bt-page-num { color: var(--bt-muted-fg); font-size: 0.9375rem; }

/* ---------- footer ---------- */
.bt-footer { background: var(--bt-primary); color: rgba(255,255,255,0.8); padding: 4rem 0 2rem; margin-top: 4rem; }
.bt-footer-grid { display: grid; gap: 3rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.bt-footer h4 { color: #fff; font-size: 1.125rem; margin: 0 0 1.5rem; }
.bt-footer ul { list-style: none; margin: 0; padding: 0; }
.bt-footer li { margin-bottom: 1rem; }
.bt-footer a { color: rgba(255,255,255,0.8); }
.bt-footer a:hover { color: #fff; text-decoration: none; }
.bt-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.2); margin-top: 3rem; padding-top: 1.5rem;
  text-align: center; font-size: 0.875rem; color: rgba(255,255,255,0.6);
}


/* ---------- Koenig editor cards ----------
   Ghost's editor emits these classes for wide and full-bleed images, galleries
   and bookmark cards. A theme must style them or the editor's width controls
   do nothing. The post column is 720px, so "wide" breaks out modestly and
   "full" runs edge to edge. */

.bt-content .kg-width-wide {
  position: relative;
  width: 92vw;
  max-width: 1100px;
  margin-left: 50%;
  transform: translateX(-50%);
}

.bt-content .kg-width-full {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  border-radius: 0;
}

.bt-content .kg-width-full img { border-radius: 0; }

.bt-content figure { margin: 2rem 0; }
.bt-content figcaption {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--bt-muted-fg);
  margin-top: 0.75rem;
}

/* Galleries */
.bt-content .kg-gallery-container { display: flex; flex-direction: column; gap: 0.75rem; }
.bt-content .kg-gallery-row { display: flex; gap: 0.75rem; }
.bt-content .kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--bt-radius); margin: 0; }

/* Bookmark cards */
.bt-content .kg-bookmark-card { margin: 2rem 0; }
.bt-content .kg-bookmark-container {
  display: flex;
  text-decoration: none;
  border: 1px solid var(--bt-border);
  border-radius: var(--bt-radius);
  overflow: hidden;
  background: var(--bt-card);
  color: var(--bt-foreground);
}
.bt-content .kg-bookmark-container:hover { text-decoration: none; border-color: var(--bt-accent); }
.bt-content .kg-bookmark-content { flex: 1; padding: 1.25rem; }
.bt-content .kg-bookmark-title { font-weight: 600; margin-bottom: 0.375rem; }
.bt-content .kg-bookmark-description { font-size: 0.875rem; color: var(--bt-muted-fg); }
.bt-content .kg-bookmark-metadata { font-size: 0.8125rem; color: var(--bt-muted-fg); margin-top: 0.75rem; }
.bt-content .kg-bookmark-thumbnail { flex: 0 0 30%; }
.bt-content .kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 0; }

@media (max-width: 640px) {
  .bt-content .kg-bookmark-container { flex-direction: column-reverse; }
  .bt-content .kg-bookmark-thumbnail { flex: none; aspect-ratio: 16 / 9; }
  .bt-content .kg-width-wide { width: 100%; margin-left: 0; transform: none; }
}
