/*
Theme Name: Bright Start News
Theme URI: https://brightstartnews.com/
Author: Bright Start News
Description: Classic PHP theme for brightstartnews.com. Rebuilt after the disk loss of 2026-08-13. Renders posts, pages, the bsn_glossary terms (/glossary/) and the bsn_step path (/start-here/).
Version: 1.0.0
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 8.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bsn
Tags: news, blog, custom-post-types
*/

/* ---------------------------------------------------------------- tokens */
:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --card: #ffffff;
  --border: #e2e6ec;
  --text: #16202c;
  --muted: #5a6878;
  --brand: #0f6fd6;
  --brand-ink: #0a4f9a;
  --accent: #f6a41c;
  --accent-soft: #fff6e6;
  --ring: rgba(15, 111, 214, 0.28);
  --radius: 12px;
  --wrap: 1140px;
  --measure: 44rem;
  --shadow: 0 1px 2px rgba(16, 32, 48, .05), 0 8px 24px rgba(16, 32, 48, .05);
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/*
 * Dark is opt-in, never automatic — recovered brand rule from the original
 * theme: the bright morning palette is the brand, and a first-time reader
 * should meet it before the site offers them dusk. So this keys off the
 * data-theme attribute the head script sets from localStorage, NOT off
 * prefers-color-scheme.
 */
:root[data-theme="dark"] {
    --bg: #0f151c;
    --surface: #151d26;
    --card: #18212c;
    --border: #2a3644;
    --text: #e8eef5;
    --muted: #9aabbd;
    --brand: #5aa9f5;
    --brand-ink: #8cc4fb;
    --accent: #f7b445;
    --accent-soft: #2b2313;
    --ring: rgba(90, 169, 245, 0.35);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}

img, svg, video { max-width: 100%; height: auto; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-ink); }

:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

.bsn-wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }

.bsn-skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.bsn-skip:focus { left: 0; }

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

/* --------------------------------------------------------------- header */
.bsn-masthead {
  border-bottom: 1px solid var(--border);
  background: var(--card);
  position: relative;
  z-index: 20;
}
.bsn-masthead__bar {
  display: flex; align-items: center; gap: 20px;
  min-height: 68px; flex-wrap: wrap;
}
.bsn-brand { display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none; color: inherit; }
.bsn-brand__mark {
  font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; color: var(--text);
}
.bsn-brand__mark em { font-style: normal; color: var(--accent); }
.bsn-brand__tag { font-size: .78rem; color: var(--muted); display: none; }
@media (min-width: 900px) { .bsn-brand__tag { display: inline; } }

.bsn-nav { margin-left: auto; }
.bsn-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 4px 2px; align-items: center;
}
.bsn-nav a {
  display: inline-block; padding: 8px 11px; border-radius: 8px;
  font-size: .93rem; font-weight: 600; color: var(--text); text-decoration: none;
}
.bsn-nav a:hover { background: var(--surface); color: var(--brand-ink); }
.bsn-nav .bsn-nav__cta a { background: var(--brand); color: #fff; }
.bsn-nav .bsn-nav__cta a:hover { background: var(--brand-ink); color: #fff; }

.bsn-themetoggle {
  font: inherit; font-size: 1rem; line-height: 1; cursor: pointer;
  background: transparent; border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 7px 10px; margin-left: 4px;
}
.bsn-themetoggle:hover { border-color: var(--brand); color: var(--brand); }
.bsn-themetoggle .bsn-themetoggle__dark { display: none; }
:root[data-theme="dark"] .bsn-themetoggle .bsn-themetoggle__dark { display: inline; }
:root[data-theme="dark"] .bsn-themetoggle .bsn-themetoggle__light { display: none; }

/* ---------------------------------------------------------------- layout */
.bsn-main { padding-block: 32px 56px; }
.bsn-cols { display: grid; gap: 40px; }
@media (min-width: 1000px) { .bsn-cols { grid-template-columns: minmax(0,1fr) 300px; } }

.bsn-page-head { margin: 0 0 28px; }
.bsn-page-head h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.2; margin: 0 0 8px; letter-spacing: -.02em; }
.bsn-page-head p { color: var(--muted); margin: 0; max-width: var(--measure); }

.bsn-eyebrow {
  display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--brand); margin-bottom: 10px;
}

/* ----------------------------------------------------------------- cards */
.bsn-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .bsn-grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 900px) { .bsn-grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); } }

.bsn-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px;
  min-width: 0;
}
.bsn-card h2, .bsn-card h3 { margin: 0; font-size: 1.08rem; line-height: 1.35; letter-spacing: -.01em; }
.bsn-card h2 a, .bsn-card h3 a { color: inherit; text-decoration: none; }
.bsn-card h2 a:hover, .bsn-card h3 a:hover { color: var(--brand); text-decoration: underline; }
.bsn-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.bsn-card__meta { font-size: .78rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; }
.bsn-card__thumb { margin: -20px -20px 4px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.bsn-card__thumb img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }

/* ---------------------------------------------------------------- single */
.bsn-article { max-width: var(--measure); }
.bsn-article__title { font-size: clamp(1.85rem, 4.6vw, 2.6rem); line-height: 1.18; margin: 0 0 14px; letter-spacing: -.025em; }
.bsn-article__meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
  font-size: .85rem; color: var(--muted);
  padding-bottom: 18px; margin-bottom: 26px; border-bottom: 1px solid var(--border);
}
.bsn-article__hero { margin: 0 0 26px; border-radius: var(--radius); overflow: hidden; }

.bsn-prose { font-size: 1.06rem; }
.bsn-prose > * + * { margin-top: 1.15em; }
.bsn-prose p, .bsn-prose li { color: var(--text); }
.bsn-prose h2 {
  font-size: 1.42rem; line-height: 1.3; margin-top: 2em; letter-spacing: -.015em;
  padding-top: .55em; border-top: 1px solid var(--border);
}
.bsn-prose h3 { font-size: 1.15rem; margin-top: 1.7em; }
.bsn-prose ul, .bsn-prose ol { padding-left: 1.3em; }
.bsn-prose li + li { margin-top: .4em; }
.bsn-prose blockquote {
  margin-inline: 0; padding: 4px 0 4px 18px;
  border-left: 3px solid var(--accent); color: var(--muted); font-style: italic;
}
.bsn-prose code {
  background: var(--surface); border: 1px solid var(--border);
  padding: .1em .35em; border-radius: 5px; font-size: .9em;
}
.bsn-prose img { border-radius: 10px; }
.bsn-prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.bsn-prose th, .bsn-prose td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.bsn-prose th { background: var(--surface); }
.bsn-tablewrap { overflow-x: auto; }

/* --------------------------------------------------------- content blocks */
.bsn-pe {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px; margin: 0 0 28px;
}
.bsn-pe__title {
  font-size: .74rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--brand); margin: 0 0 12px;
}
.bsn-pe dl { margin: 0; display: grid; gap: 14px; }
.bsn-pe dt { font-weight: 700; font-size: .93rem; margin-bottom: 2px; }
.bsn-pe dd { margin: 0; color: var(--muted); font-size: .97rem; }

.bsn-takeaways {
  background: var(--accent-soft); border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 18px 22px; margin: 32px 0;
}
.bsn-takeaways h2 { margin: 0 0 10px; font-size: 1.02rem; border: 0; padding: 0; }
.bsn-takeaways ul { margin: 0; padding-left: 1.2em; }
.bsn-takeaways li { margin: 0; }
.bsn-takeaways li + li { margin-top: .45em; }

.bsn-sources { margin: 32px 0 0; padding-top: 20px; border-top: 1px solid var(--border); }
.bsn-sources h2 { margin: 0 0 10px; font-size: 1rem; border: 0; padding: 0; }
.bsn-sources ul { margin: 0; padding-left: 1.2em; }
.bsn-sources li { font-size: .93rem; }
.bsn-sources li + li { margin-top: .35em; }

.bsn-note {
  margin-top: 34px; padding: 14px 16px; border: 1px dashed var(--border);
  border-radius: var(--radius); font-size: .85rem; color: var(--muted); background: var(--surface);
}

/* -------------------------------------------------------------- glossary */
.bsn-termcard { position: relative; }
.bsn-termcard__short { color: var(--muted); font-size: .95rem; margin: 0; }

.bsn-alpha { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 28px; padding: 0; list-style: none; }
.bsn-alpha a {
  display: inline-block; min-width: 34px; text-align: center;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); font-weight: 700; font-size: .85rem; text-decoration: none;
}
.bsn-alpha a:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

.bsn-alphagroup { margin: 0 0 36px; scroll-margin-top: 20px; }
.bsn-alphagroup__letter {
  font-size: 1.5rem; margin: 0 0 14px; padding-bottom: 6px;
  border-bottom: 2px solid var(--accent); display: inline-block; min-width: 2ch;
}

.bsn-defbox {
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 18px 22px; margin: 0 0 28px;
  font-size: 1.1rem; line-height: 1.55;
}

/* ------------------------------------------------------------ step path */
.bsn-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.bsn-step {
  display: grid; grid-template-columns: 52px minmax(0,1fr); gap: 18px; align-items: start;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.bsn-step__num {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.25rem;
}
.bsn-step__body { min-width: 0; }
.bsn-step__body h2 { margin: 0 0 6px; font-size: 1.15rem; line-height: 1.3; }
.bsn-step__body h2 a { color: inherit; text-decoration: none; }
.bsn-step__body h2 a:hover { color: var(--brand); text-decoration: underline; }
.bsn-step__body p { margin: 0; color: var(--muted); font-size: .95rem; }
.bsn-step__time { font-size: .78rem; color: var(--muted); margin-top: 6px; display: block; }

.bsn-stepnav {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border);
}
.bsn-stepnav a {
  flex: 1 1 220px; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; text-decoration: none; background: var(--card);
}
.bsn-stepnav a:hover { border-color: var(--brand); }
.bsn-stepnav span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.bsn-stepnav strong { display: block; font-size: .97rem; color: var(--text); font-weight: 650; }
.bsn-stepnav .bsn-stepnav__next { text-align: right; }

.bsn-progress { font-size: .8rem; color: var(--muted); margin: 0 0 10px; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; }

/* -------------------------------------------------------------- sidebar */
.bsn-side { display: grid; gap: 24px; align-content: start; min-width: 0; }
.bsn-side__box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
}
.bsn-side__box h2 { margin: 0 0 12px; font-size: .95rem; letter-spacing: -.01em; }
.bsn-side__box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.bsn-side__box a { text-decoration: none; font-size: .93rem; font-weight: 600; }
.bsn-side__box a:hover { text-decoration: underline; }

/* ------------------------------------------------------------ pagination */
.bsn-pagination { margin-top: 40px; display: flex; }
.bsn-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.bsn-pagination .page-numbers {
  display: inline-block; padding: 8px 13px; border: 1px solid var(--border);
  border-radius: 8px; text-decoration: none; background: var(--card); font-weight: 600; font-size: .92rem;
}
.bsn-pagination .page-numbers.current { background: var(--brand); color: #fff; border-color: var(--brand); }
.bsn-pagination .page-numbers:hover:not(.current) { border-color: var(--brand); }

/* ----------------------------------------------------------------- tools */
.bsn-tool { max-width: var(--measure); }
.bsn-tool__panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin: 0 0 26px;
}
.bsn-field { display: grid; gap: 6px; margin-bottom: 16px; }
.bsn-field label { font-weight: 650; font-size: .9rem; }
.bsn-field input, .bsn-field select {
  font: inherit; font-size: 1rem; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg); color: var(--text); width: 100%;
}
.bsn-field__row { display: grid; gap: 16px; }
@media (min-width: 560px) { .bsn-field__row { grid-template-columns: 1fr 1fr; } }
.bsn-btn {
  font: inherit; font-weight: 700; cursor: pointer;
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
  padding: 11px 20px; border-radius: 9px;
}
.bsn-btn:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.bsn-result {
  margin-top: 18px; padding: 16px 18px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  font-size: 1.05rem;
}
.bsn-result strong { font-size: 1.25rem; display: block; margin-bottom: 2px; }
.bsn-result small { color: var(--muted); font-size: .82rem; }

/* --------------------------------------------------------------- sitemap */
.bsn-sitemap { display: grid; gap: 34px; }
.bsn-sitemap section { min-width: 0; }
.bsn-sitemap h2 {
  font-size: 1.15rem; margin: 0 0 12px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.bsn-sitemap ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 7px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.bsn-sitemap a { font-size: .92rem; text-decoration: none; }
.bsn-sitemap a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- footer */
.bsn-footer {
  border-top: 1px solid var(--border); background: var(--surface);
  padding-block: 40px 32px; margin-top: 60px; font-size: .9rem;
}
.bsn-footer__cols { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .bsn-footer__cols { grid-template-columns: 1.4fr 1fr 1fr; } }
.bsn-footer h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
.bsn-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bsn-footer a { text-decoration: none; color: var(--text); }
.bsn-footer a:hover { color: var(--brand); text-decoration: underline; }
.bsn-footer__about p { margin: 0 0 12px; color: var(--muted); max-width: 38ch; }
.bsn-footer__legal {
  margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: .82rem;
}
.bsn-footer__legal p { margin: 0 0 6px; }

/* ------------------------------------------------------------------ misc */
.bsn-empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 28px; text-align: center; }
.bsn-lang { font-size: .8rem; color: var(--muted); }
.bsn-lang a { margin-right: 8px; }
