/*
Theme Name: Bitnet
Theme URI: https://bitnets.co.uk
Author: Bitnet Solutions
Description: Custom theme converted from the Bitnet Claude Design system. Page templates are generated by convert.py; header, footer and blog templates are hand-built.
Version: 0.3.3
Requires at least: 6.4
Tested up to: 6.6
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bitnet
*/

/* =====================================================================
   Blog templates (Insights listing + article)
   These classes replace the inline styles in the design's Insights pages,
   because the markup is now generated by the WordPress loop.
   ===================================================================== */

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* ---------- Insights listing ---------- */

.bn-insights-head {
  position: relative;
  overflow: hidden;
  padding: clamp(2.8rem, 6vw, 4.5rem) 0 clamp(1.5rem, 3vw, 2rem);
  background: radial-gradient(900px 460px at 85% -20%, var(--azure-50), transparent 60%);
}

.bn-insights-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  color: var(--azure-deep);
  margin: 0;
}

a.chip { text-decoration: none; display: inline-block; }

/* Featured card */
.bn-feat { display: grid; grid-template-columns: 1.15fr .85fr; }
.bn-feat-media { position: relative; min-height: 320px; overflow: hidden; }
.bn-feat-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bn-feat-wash { position: absolute; inset: 0; background: linear-gradient(150deg, var(--azure-a12), transparent 55%); }
.bn-feat-badge {
  position: absolute;
  top: 16px; left: 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #fff;
  background: var(--azure);
  border-radius: 999px;
  padding: 6px 13px;
}
.bn-feat-body {
  padding: clamp(1.8rem, 3vw, 2.6rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.bn-feat-excerpt { font-size: 15.5px; line-height: 1.6; color: var(--fg2); margin: 14px 0 0; }
.bn-feat-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--fg3);
  flex-wrap: wrap;
}

/* Grid cards */
.bn-card-media { aspect-ratio: 16 / 10; overflow: hidden; }
.bn-card-media img { width: 100%; height: 100%; object-fit: cover; }
.bn-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--azure-deep);
  margin: 8px 0;
  line-height: 1.3;
}
.bn-card-excerpt { font-size: 13.8px; line-height: 1.55; color: var(--fg2); margin: 0; }
.bn-card-date { margin-top: 16px; font-size: 12.5px; color: var(--fg3); }

/* Pagination */
.bn-pagination, .navigation.pagination { margin-top: 48px; }
.bn-pagination .nav-links, .navigation.pagination .nav-links {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.navigation.pagination .page-numbers {
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  color: var(--fg2);
  text-decoration: none;
  transition: all var(--dur-base);
}
.navigation.pagination .page-numbers:hover,
.navigation.pagination .page-numbers.current {
  background: var(--azure);
  border-color: var(--azure);
  color: #fff;
}

/* Newsletter */
.bn-newsletter {
  position: relative;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  padding: clamp(2.5rem, 5vw, 3.5rem);
  background: var(--azure-deep);
}
.bn-newsletter-wash {
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 300px at 90% 120%, var(--azure-50), transparent 60%);
  pointer-events: none;
}
.bn-newsletter-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 36px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.bn-newsletter-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 2.8vw, 2rem);
  line-height: 1.15;
  color: #fff;
  margin: 0;
  max-width: 16em;
}
.bn-newsletter-copy { color: rgba(255,255,255,.8); font-size: 15.5px; margin: 12px 0 0; max-width: 32em; }
.bn-newsletter-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.bn-newsletter-form input {
  font-family: var(--font-body);
  font-size: 15px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  min-width: 240px;
  outline: none;
}
.bn-newsletter-form input::placeholder { color: rgba(255,255,255,.6); }
.bn-newsletter-btn {
  background: #fff;
  color: var(--azure-700);
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius-md);
  padding: 14px 24px;
}

/* ---------- Article ---------- */

.bn-read {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--azure);
  z-index: 100;
  transition: width .12s linear;
}

.bn-article-head {
  position: relative;
  overflow: hidden;
  background: radial-gradient(900px 460px at 80% -20%, var(--azure-50), transparent 60%);
  padding: clamp(2.4rem, 5vw, 3.6rem) 0 clamp(1.5rem, 3vw, 2rem);
}
.bn-crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--fg3);
  margin-bottom: 18px;
}
.bn-article-title {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  color: var(--azure-deep);
}
.bn-article-standfirst { margin: 18px 0 0; font-size: 19px; line-height: 1.55; color: var(--fg2); }
.bn-article-byline { display: flex; align-items: center; gap: 14px; margin-top: 26px; }
.bn-avatar { width: 46px; height: 46px; border-radius: 999px; object-fit: cover; }
.bn-byline-name { font-family: var(--font-display); font-weight: 700; color: var(--azure-deep); font-size: 13.5px; }
.bn-byline-meta { color: var(--fg3); font-size: 13.5px; }

.bn-article-hero-wrap {
  max-width: 960px;
  padding-top: clamp(1.5rem, 3vw, 2rem);
  padding-bottom: clamp(1.5rem, 3vw, 2rem);
}
.bn-article-hero {
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 16 / 8;
  position: relative;
}
.bn-article-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bn-article-hero-wash { position: absolute; inset: 0; background: linear-gradient(150deg, var(--azure-a12), transparent 55%); }

/* Block editor output inside .prose */
.prose > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.prose .alignwide { max-width: 960px; }
.prose .alignfull { max-width: none; }
.prose img, .prose figure img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.prose figcaption { font-size: 13px; color: var(--fg3); text-align: center; margin-top: 8px; }
.prose h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(18px, 2vw, 22px);
  color: var(--azure-deep);
  margin: 32px 0 12px;
}
.prose ol { margin: 0 0 20px; padding-left: 1.3em; }
.prose ol li { font-size: 17px; line-height: 1.6; margin-bottom: 10px; display: list-item; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }

.bn-article-cta-wrap {
  max-width: 720px;
  padding-top: clamp(2rem, 4vw, 3rem);
  padding-bottom: clamp(1rem, 2vw, 1.5rem);
}
.bn-article-cta {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  background: linear-gradient(160deg, #304151, #283c4d);
  border: 1px solid rgba(139,189,232,.35);
  box-shadow: 0 24px 54px rgba(16,24,38,.30);
  padding: clamp(2rem, 4vw, 3rem);
  text-align: center;
}
.bn-article-cta-wash {
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 300px at 90% 120%, rgba(96,159,210,.4), transparent 60%);
  pointer-events: none;
}
.bn-article-cta-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.bn-article-cta-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  color: #fff;
  margin: 0 0 8px;
}
.bn-article-cta-copy { font-size: 15px; color: rgba(255,255,255,.78); margin: 0; max-width: 32em; }
.bn-article-cta-btn {
  background: var(--azure);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  border-radius: 999px;
  padding: 13px 26px;
  white-space: nowrap;
  box-shadow: var(--shadow-brand);
}
.bn-article-cta-btn:hover { color: #fff; }

.bn-related-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 26px;
  gap: 16px;
}
.bn-related-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  color: var(--azure-deep);
  margin: 0;
}

/* ---------- generic page + 404 ---------- */

.bn-page-head {
  padding: clamp(2.4rem, 5vw, 3.6rem) 0 clamp(1rem, 2vw, 1.5rem);
  background: radial-gradient(900px 460px at 80% -20%, var(--azure-50), transparent 60%);
}
.bn-page-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  color: var(--azure-deep);
  margin: 0;
}
.bn-page-body { padding: clamp(1.5rem, 3vw, 2.5rem) 0 clamp(3rem, 6vw, 5rem); }

@media (max-width: 900px) {
  .bn-feat { grid-template-columns: 1fr; }
}

/* ---------- listing states ---------- */

/* With one or two posts, a three-column grid leaves the row looking unbalanced.
   Constrain it so cards sit at a natural width instead of stretching. */
.bn-grid--sparse {
  grid-template-columns: repeat(auto-fit, minmax(280px, 360px)) !important;
  justify-content: start;
}

.bn-empty {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 4vw, 3rem);
  text-align: center;
  background: var(--azure-50);
}
.bn-empty .bn-card-title { margin-top: 0; }
.bn-empty .lead { margin: 8px 0 0; }

/* The sticky header is translucent, so anything scrolling underneath shows
   through blurred. Give in-page anchors room to clear it. */
:target { scroll-margin-top: 168px; }
@media (max-width: 980px) { :target { scroll-margin-top: 116px; } }
