/*
Theme Name: CrunchBrief
Theme URI: https://example.com/crunchbrief
Author: CrunchBrief
Author URI: https://example.com
Description: A minimalist, distraction-free WordPress theme built for newsletters and journals. Dark mode, built-in email capture with a subscriber dashboard, reading time, and clean editorial typography — no page builder or third-party plugin required.
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: brook2-newsletter

All classes are prefixed `brk-` so they never collide with plugin or block
markup. Theme is controlled by [data-theme="light"|"dark"] on <html>,
toggled by assets/js/theme.js and persisted to localStorage.
*/

/* ---------- Reset-ish basics ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

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

/* ---------- Accessibility: standard WP screen-reader-text ---------- */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #f1f1f1;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  clip-path: none;
  color: #21759b;
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* ---------- Design tokens ---------- */
:root {
  --brk-bg: #ffffff;
  --brk-bg-soft: #f6f6f7;
  --brk-surface: #ffffff;
  --brk-border: #e8e8eb;
  --brk-text: #14161a;
  --brk-text-soft: #5b5f68;
  --brk-text-faint: #96999f;
  --brk-accent: #14161a;
  --brk-accent-contrast: #ffffff;
  --brk-link: #2f5fed;
  --brk-focus: #2f5fed;
  --brk-success: #1a8f4c;
  --brk-error: #d0453c;

  --brk-radius-sm: 8px;
  --brk-radius-md: 14px;
  --brk-radius-full: 999px;

  --brk-shadow-soft: 0 20px 45px -28px rgba(20, 22, 26, 0.35);

  --brk-max: 46rem;
  --brk-max-wide: 64rem;

  --brk-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --brk-font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --brk-header-h: 4rem;
  color-scheme: light;
}

[data-theme="dark"] {
  --brk-bg: #0b0c0f;
  --brk-bg-soft: #15171b;
  --brk-surface: #131418;
  --brk-border: #24262c;
  --brk-text: #edeef0;
  --brk-text-soft: #a3a7b0;
  --brk-text-faint: #6c6f77;
  --brk-accent: #edeef0;
  --brk-accent-contrast: #0b0c0f;
  --brk-link: #6f9dff;
  --brk-focus: #6f9dff;
  --brk-shadow-soft: 0 20px 45px -28px rgba(0, 0, 0, 0.65);
  color-scheme: dark;
}

/* ---------- Base ---------- */
body.brk-root {
  background: var(--brk-bg);
  color: var(--brk-text);
  font-family: var(--brk-font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

.brk-container {
  width: 100%;
  max-width: var(--brk-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.brk-container--wide {
  max-width: var(--brk-max-wide);
}

.brk-main {
  flex: 1;
}

/* =============================================================================
   Header / nav
   ============================================================================= */
.brk-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--brk-bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--brk-border);
}

.brk-header-inner {
  max-width: var(--brk-max-wide);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--brk-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brk-logo {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--brk-text);
  text-decoration: none;
}

.brk-logo:hover {
  opacity: 0.75;
}

.brk-logo-wrap img {
  display: block;
  max-height: 140px;
  margin-top:10px;
  width: auto;
}

.brk-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brk-nav-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.brk-nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--brk-text-soft);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}

.brk-nav-link:hover {
  color: var(--brk-text);
  border-bottom-color: var(--brk-border);
}

.brk-nav-link.is-active,
.brk-nav-links .current-menu-item > a {
  color: var(--brk-text);
  font-weight: 700;
  border-bottom-color: var(--brk-text);
}

.brk-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--brk-radius-full);
  border: 1px solid var(--brk-border);
  background: var(--brk-bg-soft);
  color: var(--brk-text);
  cursor: pointer;
  flex-shrink: 0;
}

.brk-theme-toggle:hover {
  background: var(--brk-border);
}

.brk-theme-toggle svg {
  width: 1.05rem;
  height: 1.05rem;
}

.brk-icon-sun {
  display: none;
}

[data-theme="dark"] .brk-icon-sun {
  display: block;
}

[data-theme="dark"] .brk-icon-moon {
  display: none;
}

/* =============================================================================
   Buttons / pills / tags — shared building blocks
   ============================================================================= */
.brk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--brk-radius-full);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.brk-btn:hover {
  transform: translateY(-1px);
}

.brk-btn--primary {
  background: var(--brk-accent);
  color: var(--brk-accent-contrast);
  box-shadow: var(--brk-shadow-soft);
}

.brk-btn--primary:hover {
  opacity: 0.9;
}

.brk-btn--ghost {
  background: transparent;
  color: var(--brk-text);
  border-color: var(--brk-border);
}

.brk-btn--ghost:hover {
  background: var(--brk-bg-soft);
}

.brk-btn--sm {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

.brk-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  border-radius: var(--brk-radius-full);
  border: 1px solid var(--brk-border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brk-text-soft);
  text-decoration: none;
  background: var(--brk-surface);
  white-space: nowrap;
}

.brk-pill:hover {
  color: var(--brk-text);
  border-color: var(--brk-text-faint);
}

.brk-pill.is-active {
  background: var(--brk-accent);
  color: var(--brk-accent-contrast);
  border-color: var(--brk-accent);
}

.brk-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: var(--brk-radius-full);
  background: var(--brk-bg-soft);
  color: var(--brk-text-soft);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brk-tag:hover {
  color: var(--brk-text);
}

/* =============================================================================
   Hero
   ============================================================================= */
.brk-hero {
  padding: 5rem 0 3rem;
  text-align: center;
}

.brk-hero-eyebrow {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brk-text-faint);
  margin: 0 0 1rem;
}

.brk-hero-title {
  font-size: clamp(2.25rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 1.1rem;
}

.brk-hero-subtitle {
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--brk-text-soft);
  max-width: 34rem;
  margin: 0 auto 2rem;
}

.brk-hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.brk-divider {
  border: none;
  border-top: 1px solid var(--brk-border);
  margin: 0 0 2.5rem;
}

/* =============================================================================
   Newsletter subscribe form
   ============================================================================= */
.brk-subscribe {
  max-width: 26rem;
  margin: 0 auto;
  text-align: center;
}

.brk-subscribe-heading {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
}

.brk-subscribe-subheading {
  color: var(--brk-text-faint);
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0 0 1.1rem;
}

.brk-subscribe-form {
  display: flex;
  gap: 0.5rem;
}

.brk-subscribe-input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 1.1rem;
  border-radius: var(--brk-radius-full);
  border: 1px solid var(--brk-border);
  background: var(--brk-surface);
  color: var(--brk-text);
  font-size: 0.95rem;
  font-family: inherit;
}

.brk-subscribe-input::placeholder {
  color: var(--brk-text-faint);
}

.brk-subscribe-btn {
  flex-shrink: 0;
}

.brk-subscribe-message {
  min-height: 1.2em;
  font-size: 0.85rem;
  margin: 0.65rem 0 0;
  color: var(--brk-text-faint);
}

.brk-subscribe-message.is-success {
  color: var(--brk-success);
}

.brk-subscribe-message.is-error {
  color: var(--brk-error);
}

/* Inline mid-article variant gets a card treatment so it interrupts reading on purpose */
.brk-article .brk-subscribe {
  max-width: none;
  border: 1px solid var(--brk-border);
  border-radius: var(--brk-radius-md);
  background: var(--brk-bg-soft);
  padding: 2.25rem 1.75rem;
  margin: 3rem 0;
}

/* =============================================================================
   Filters — search + category pills
   ============================================================================= */
.brk-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.brk-category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.brk-search-form {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  max-width: 16rem;
}

.brk-search-input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.2rem;
  border-radius: var(--brk-radius-full);
  border: 1px solid var(--brk-border);
  background: var(--brk-surface);
  color: var(--brk-text);
  font-size: 0.9rem;
  font-family: inherit;
}

.brk-search-input::placeholder {
  color: var(--brk-text-faint);
}

.brk-search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.95rem;
  height: 0.95rem;
  color: var(--brk-text-faint);
  pointer-events: none;
}

/* =============================================================================
   Archive / search headers
   ============================================================================= */
.brk-archive-header {
  padding: 3rem 0 2rem;
}

.brk-archive-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.brk-archive-description {
  color: var(--brk-text-soft);
  font-size: 1rem;
  line-height: 1.6;
}

/* =============================================================================
   Featured / sticky post
   ============================================================================= */
.brk-featured {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--brk-border);
  border-radius: var(--brk-radius-md);
  overflow: hidden;
  margin-bottom: 3rem;
  background: var(--brk-surface);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.brk-featured:hover {
  box-shadow: var(--brk-shadow-soft);
  transform: translateY(-2px);
}

.brk-featured-media {
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  display: block;
  background: var(--brk-bg-soft);
}

.brk-featured-body {
  padding: 1.75rem;
}

.brk-featured-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brk-text-faint);
  margin-bottom: 0.75rem;
}

.brk-featured-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0 0 0.6rem;
}

.brk-featured-excerpt {
  color: var(--brk-text-soft);
  line-height: 1.6;
  margin: 0 0 1rem;
}

.brk-featured-meta {
  font-size: 0.85rem;
  color: var(--brk-text-faint);
}

/* =============================================================================
   Post list (index rows)
   ============================================================================= */
.brk-post-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.brk-post-item {
  border-bottom: 1px solid var(--brk-border);
}

.brk-post-item:first-child {
  border-top: 1px solid var(--brk-border);
}

.brk-post-link {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.75rem 0;
  text-decoration: none;
  color: inherit;
}

.brk-post-thumb {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: var(--brk-radius-sm);
  overflow: hidden;
  background: var(--brk-bg-soft);
}

.brk-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brk-post-body {
  flex: 1;
  min-width: 0;
}

.brk-post-title {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.32;
  margin: 0 0 0.4rem;
  color: var(--brk-text);
  transition: color 0.15s ease;
}

.brk-post-link:hover .brk-post-title {
  color: var(--brk-link);
}

.brk-post-date {
  display: block;
  font-size: 0.85rem;
  color: var(--brk-text-faint);
  white-space: nowrap;
}

.brk-load-more {
  text-align: center;
  margin: 1rem 0 3.5rem;
}

.brk-empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--brk-text-soft);
}

.brk-empty-state-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brk-text);
  margin: 0 0 0.5rem;
}

/* =============================================================================
   Pagination — styles WordPress' native paginate_links() output
   ============================================================================= */
.brk-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 2rem 0 4rem;
}

.brk-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.6rem;
  border-radius: var(--brk-radius-full);
  border: 1px solid var(--brk-border);
  color: var(--brk-text-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.brk-pagination a.page-numbers:hover {
  border-color: var(--brk-text-faint);
  color: var(--brk-text);
}

.brk-pagination .page-numbers.current {
  background: var(--brk-accent);
  border-color: var(--brk-accent);
  color: var(--brk-accent-contrast);
}

.brk-pagination .page-numbers.dots {
  border-color: transparent;
}

/* =============================================================================
   Article (single.php)
   ============================================================================= */
.brk-article {
  padding-top: 2.5rem;
}

.brk-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brk-text-soft);
  text-decoration: none;
  margin-bottom: 2rem;
}

.brk-back-link:hover {
  color: var(--brk-text);
}

.brk-back-link svg {
  width: 0.9rem;
  height: 0.9rem;
}

.brk-article-header {
  margin-bottom: 2rem;
}

.brk-article-meta {
  font-size: 0.9rem;
  color: var(--brk-text-faint);
  margin: 0 0 1rem;
}

.brk-article-meta a {
  color: var(--brk-text-faint);
  text-decoration: none;
}

.brk-article-meta a:hover {
  color: var(--brk-link);
}

.brk-article-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 1rem;
}

.brk-article-excerpt {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--brk-text-soft);
  margin: 0 0 1.25rem;
}

.brk-article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.brk-article-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--brk-radius-md);
  margin-bottom: 2.5rem;
  background: var(--brk-bg-soft);
}

/* ---------- Rich text body (output of the_content()) ---------- */
.brk-article-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--brk-text);
}

.brk-article-body > * + * {
  margin-top: 1.4em;
}

.brk-article-body h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-top: 2.2em;
}

.brk-article-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 2em;
}

.brk-article-body p {
  margin: 0;
}

.brk-article-body a {
  color: var(--brk-link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--brk-link) 40%, transparent);
}

.brk-article-body strong {
  font-weight: 700;
}

.brk-article-body blockquote {
  margin: 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--brk-border);
  color: var(--brk-text-soft);
  font-style: italic;
}

.brk-article-body ul,
.brk-article-body ol {
  margin: 0;
  padding-left: 1.4rem;
}

.brk-article-body li + li {
  margin-top: 0.5em;
}

.brk-article-body img {
  width: 100%;
  border-radius: var(--brk-radius-md);
}

.brk-article-body code {
  font-family: var(--brk-font-mono);
  font-size: 0.85em;
  background: var(--brk-bg-soft);
  padding: 0.15em 0.4em;
  border-radius: 5px;
}

.brk-article-body pre {
  background: var(--brk-bg-soft);
  border: 1px solid var(--brk-border);
  border-radius: var(--brk-radius-sm);
  padding: 1rem;
  overflow-x: auto;
}

.brk-article-body pre code {
  background: none;
  padding: 0;
}

.brk-article-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--brk-border);
  font-size: 0.9rem;
  color: var(--brk-text-soft);
}

.brk-article-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brk-article-footer-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.brk-author {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brk-author-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  overflow: hidden;
  background: var(--brk-bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brk-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Social share ---------- */
.brk-share {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brk-share-label {
  font-size: 0.85rem;
  color: var(--brk-text-faint);
  margin-right: 0.2rem;
}

.brk-share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 1px solid var(--brk-border);
  color: var(--brk-text-soft);
  flex-shrink: 0;
}

.brk-share-link:hover {
  color: var(--brk-text);
  border-color: var(--brk-text-faint);
  background: var(--brk-bg-soft);
}

.brk-share-link svg {
  width: 1rem;
  height: 1rem;
}

/* ---------- Related / popular ---------- */
.brk-section-heading {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
}

.brk-related {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--brk-border);
}

.brk-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.brk-related-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.brk-related-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--brk-radius-sm);
  margin-bottom: 0.75rem;
  background: var(--brk-bg-soft);
  display: block;
}

.brk-related-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 0.35rem;
}

.brk-related-card:hover .brk-related-title {
  color: var(--brk-link);
}

.brk-related-date {
  font-size: 0.8rem;
  color: var(--brk-text-faint);
}

.brk-popular {
  margin-top: 3rem;
}

.brk-popular-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.brk-popular-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--brk-border);
}

.brk-popular-rank {
  flex-shrink: 0;
  width: 1.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brk-text-faint);
}

.brk-popular-link {
  flex: 1;
  text-decoration: none;
  color: var(--brk-text);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.4;
}

.brk-popular-link:hover {
  color: var(--brk-link);
}

.brk-popular-views {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--brk-text-faint);
  white-space: nowrap;
}

/* =============================================================================
   Plain page (page.php)
   ============================================================================= */
.brk-page {
  padding: 3rem 0 4rem;
}

/* =============================================================================
   Paywall (gated content CTA)
   ============================================================================= */
.brk-paywall {
  border: 1px solid var(--brk-border);
  border-radius: var(--brk-radius-md);
  background: var(--brk-bg-soft);
  padding: 2.25rem 1.75rem;
  text-align: center;
  margin-top: 1.5rem;
}

.brk-paywall-title {
  font-weight: 800;
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.brk-paywall-subtitle {
  color: var(--brk-text-soft);
  margin: 0 0 1.25rem;
}

.brk-paywall-notice {
  font-size: 0.9rem;
  color: var(--brk-text-faint);
  margin: 0 0 1rem;
}

.brk-paywall-login {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--brk-text-soft);
}

.brk-paywall-login a {
  color: var(--brk-link);
  text-decoration: none;
}

/* =============================================================================
   Account page + WordPress' default login form
   ============================================================================= */
.brk-account-card {
  border: 1px solid var(--brk-border);
  border-radius: var(--brk-radius-md);
  padding: 2rem;
  margin-top: 1.5rem;
  max-width: 26rem;
}

.brk-account-status {
  margin: 0 0 1.25rem;
}

#loginform p {
  margin: 0 0 1rem;
}

#loginform label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--brk-text-soft);
}

#loginform input[type="text"],
#loginform input[type="password"] {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: var(--brk-radius-sm);
  border: 1px solid var(--brk-border);
  background: var(--brk-surface);
  color: var(--brk-text);
  font-family: inherit;
  font-size: 0.95rem;
}

#loginform .forgetmenot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--brk-text-soft);
}

#loginform input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  border-radius: var(--brk-radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
  background: var(--brk-accent);
  color: var(--brk-accent-contrast);
  cursor: pointer;
}

/* =============================================================================
   Footer — permanently dark regardless of the site's light/dark toggle,
   as a deliberate design block. Colors here are fixed, not theme tokens.
   ============================================================================= */
.brk-footer {
  margin-top: auto;
  background: #0b0c0d;
  color: #d8dadf;
}

.brk-footer-main {
  max-width: var(--brk-max-wide);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2.5rem;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2.5rem;
}

.brk-footer-col-title {
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 1rem;
}

.brk-logo--footer {
  display: inline-block;
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
  margin-bottom: 0.6rem;
}

.brk-logo--footer:hover {
  opacity: 0.8;
}

.brk-logo-wrap--footer img {
  display: block;
  max-height: 140px;
  width: auto;
  margin-bottom: 0.75rem;
}

.brk-footer-tagline {
  color: #8b8e94;
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 22rem;
  margin: 0;
}

.brk-footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.brk-footer-links a {
  color: #b7b9be;
  text-decoration: none;
  font-size: 0.92rem;
}

.brk-footer-links a:hover {
  color: #ffffff;
}

.brk-follow {
  display: flex;
  gap: 0.6rem;
}

.brk-follow-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1px solid #26282c;
  color: #d8dadf;
}

.brk-follow-link:hover {
  background: #17181b;
  color: #ffffff;
  border-color: #34363b;
}

.brk-follow-link svg {
  width: 1.05rem;
  height: 1.05rem;
}

.brk-footer-bottom {
  max-width: var(--brk-max-wide);
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid #202124;
  font-size: 0.82rem;
  color: #8b8e94;
}

.brk-back-to-top {
  color: #d8dadf;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}

.brk-back-to-top:hover {
  color: #ffffff;
}

/* =============================================================================
   Reduced motion
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .brk-btn,
  .brk-featured,
  .brk-root {
    transition: none;
  }
}

/* =============================================================================
   Media queries
   ============================================================================= */
@media (max-width: 880px) {
  .brk-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  :root {
    --brk-header-h: auto;
  }

  .brk-header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 0.85rem 1.5rem;
    row-gap: 0.75rem;
  }

  .brk-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .brk-nav-links {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .brk-hero {
    padding: 3rem 0 2rem;
  }

  .brk-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .brk-search-form {
    max-width: none;
  }

  .brk-subscribe-form {
    flex-direction: column;
  }

  .brk-post-link {
    gap: 1rem;
    padding: 1.25rem 0;
  }

  .brk-post-thumb {
    width: 68px;
    height: 68px;
  }

  .brk-post-title {
    font-size: 1.1rem;
  }

  .brk-featured-body {
    padding: 1.25rem;
  }

  .brk-related-grid {
    grid-template-columns: 1fr;
  }

  .brk-article-footer-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .brk-share {
    margin-top: 0.25rem;
  }

  .brk-footer-main {
    grid-template-columns: 1fr;
    gap: 2.25rem;
    padding: 3rem 1.5rem 2rem;
  }

  .brk-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
}

@media (max-width: 420px) {
  .brk-container {
    padding: 0 1.1rem;
  }

  .brk-hero-title {
    font-size: 2rem;
  }

  .brk-nav-links {
    gap: 0.75rem;
  }

  .brk-nav-link {
    font-size: 0.88rem;
  }
}
